@discuss-ds/ui 0.30.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1594,18 +1594,140 @@ var FormMessage = React23.forwardRef(
1594
1594
  FormMessage.displayName = "FormMessage";
1595
1595
 
1596
1596
  // src/components/Forms & Data Entry/InlineEdit.tsx
1597
+ var React25 = __toESM(require("react"), 1);
1598
+ var import_react12 = require("@phosphor-icons/react");
1599
+
1600
+ // src/components/Forms & Data Entry/MarkedText.tsx
1597
1601
  var React24 = __toESM(require("react"), 1);
1598
1602
  var import_react11 = require("@phosphor-icons/react");
1603
+ var import_radix_ui14 = require("radix-ui");
1599
1604
  var import_jsx_runtime25 = require("react/jsx-runtime");
1605
+ function splitMarks(text, marks) {
1606
+ const valid = (marks ?? []).filter((m) => Number.isInteger(m.start) && Number.isInteger(m.end) && m.start >= 0 && m.end > m.start && m.end <= text.length).sort((a, b) => a.start - b.start);
1607
+ const out = [];
1608
+ let at = 0;
1609
+ for (const m of valid) {
1610
+ if (m.start < at) continue;
1611
+ if (m.start > at) out.push({ text: text.slice(at, m.start) });
1612
+ out.push({ text: text.slice(m.start, m.end), mark: m });
1613
+ at = m.end;
1614
+ }
1615
+ if (at < text.length) out.push({ text: text.slice(at) });
1616
+ return out;
1617
+ }
1618
+ var markClasses = "rounded-xxs border-b-2 border-destructive-foreground";
1619
+ function useMarkAlignment(ref, text) {
1620
+ const [padding, setPadding] = React24.useState({ top: 0, bottom: 0 });
1621
+ React24.useLayoutEffect(() => {
1622
+ const mark = ref.current;
1623
+ const button = mark?.closest("button");
1624
+ if (!mark || !button) return;
1625
+ const align = () => {
1626
+ const m = mark.getBoundingClientRect();
1627
+ const b = button.getBoundingClientRect();
1628
+ const markStyle = getComputedStyle(mark);
1629
+ const buttonStyle = getComputedStyle(button);
1630
+ const border = parseFloat(markStyle.borderBottomWidth);
1631
+ const baseTop = m.top + parseFloat(markStyle.paddingTop);
1632
+ const baseBottom = m.bottom - parseFloat(markStyle.paddingBottom) - border;
1633
+ const contentTop = b.top + parseFloat(buttonStyle.borderTopWidth) + parseFloat(buttonStyle.paddingTop);
1634
+ const contentBottom = b.bottom - parseFloat(buttonStyle.borderBottomWidth) - parseFloat(buttonStyle.paddingBottom);
1635
+ const lineHeight = parseFloat(buttonStyle.lineHeight) || contentBottom - contentTop;
1636
+ const lines = Math.max(1, Math.round((contentBottom - contentTop) / lineHeight));
1637
+ const lineIndex = Math.min(lines - 1, Math.max(0, Math.floor(((baseTop + baseBottom) / 2 - contentTop) / lineHeight)));
1638
+ const targetTop = lineIndex === 0 ? b.top : contentTop + lineIndex * lineHeight;
1639
+ const targetBottom = lineIndex === lines - 1 ? b.bottom : contentTop + (lineIndex + 1) * lineHeight;
1640
+ const next = { top: Math.max(0, baseTop - targetTop), bottom: Math.max(0, targetBottom - baseBottom - border) };
1641
+ setPadding((p) => Math.abs(p.top - next.top) < 0.5 && Math.abs(p.bottom - next.bottom) < 0.5 ? p : next);
1642
+ };
1643
+ align();
1644
+ const observer = new ResizeObserver(align);
1645
+ observer.observe(button);
1646
+ return () => observer.disconnect();
1647
+ }, [ref, text]);
1648
+ return padding;
1649
+ }
1650
+ var closeOpenMarkCard = null;
1651
+ function MarkedText({ mark, text, onApply, onDismiss }) {
1652
+ const ref = React24.useRef(null);
1653
+ const [open, setOpen] = React24.useState(false);
1654
+ const close = React24.useCallback(() => setOpen(false), []);
1655
+ React24.useEffect(
1656
+ () => () => {
1657
+ if (closeOpenMarkCard === close) closeOpenMarkCard = null;
1658
+ },
1659
+ [close]
1660
+ );
1661
+ const padding = useMarkAlignment(ref, text);
1662
+ const style = { paddingTop: padding.top, paddingBottom: padding.bottom };
1663
+ if (!onApply && !onDismiss) {
1664
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { ref, "data-mark": true, className: markClasses, style, children: text });
1665
+ }
1666
+ const suggestions = (mark.suggestions ?? []).slice(0, 3);
1667
+ const handleOpenChange = (next) => {
1668
+ if (next) {
1669
+ if (closeOpenMarkCard && closeOpenMarkCard !== close) closeOpenMarkCard();
1670
+ closeOpenMarkCard = close;
1671
+ } else if (closeOpenMarkCard === close) {
1672
+ closeOpenMarkCard = null;
1673
+ }
1674
+ setOpen(next);
1675
+ };
1676
+ const stop = (event) => event.stopPropagation();
1677
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_radix_ui14.Popover.Root, { open, onOpenChange: handleOpenChange, children: [
1678
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_radix_ui14.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { ref, "data-mark": true, role: "button", tabIndex: -1, onClick: stop, style, className: cn(markClasses, "cursor-pointer hover:bg-destructive-soft"), children: text }) }),
1679
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_radix_ui14.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
1680
+ import_radix_ui14.Popover.Content,
1681
+ {
1682
+ align: "start",
1683
+ sideOffset: 8,
1684
+ style: { zIndex: "var(--sys-z-40)" },
1685
+ onClick: stop,
1686
+ onKeyDown: stop,
1687
+ onCloseAutoFocus: (event) => event.preventDefault(),
1688
+ className: "flex w-72 flex-col gap-3 rounded-md border border-border bg-surface p-4 text-left text-body-base font-normal shadow-md outline-none",
1689
+ children: [
1690
+ suggestions.length > 1 && onApply ? (
1691
+ // Several possible fixes: each one is a choice, applied with a click, so there is no Apply button.
1692
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex flex-col gap-1", role: "group", "aria-label": "Choose a correction", children: suggestions.map((suggestion) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Button, { type: "button", size: "sm", variant: "ghost", className: "h-auto justify-start px-2 py-1 whitespace-normal", onClick: () => onApply(mark, suggestion), children: [
1693
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("s", { className: "text-destructive-foreground", children: text }),
1694
+ " ",
1695
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "font-semibold text-accent-foreground", children: suggestion === "" ? "Remove" : suggestion })
1696
+ ] }, suggestion)) })
1697
+ ) : suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "min-w-0 break-words", children: [
1698
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("s", { className: "text-destructive-foreground", children: text }),
1699
+ suggestions[0] !== "" && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
1700
+ " ",
1701
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "font-semibold text-accent-foreground", children: suggestions[0] })
1702
+ ] })
1703
+ ] }),
1704
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
1705
+ onDismiss ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Button, { type: "button", size: "sm", variant: "ghost", onClick: () => onDismiss(mark), children: [
1706
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react11.Trash, { size: 16, "aria-hidden": true }),
1707
+ " Dismiss"
1708
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", {}),
1709
+ onApply && suggestions.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { type: "button", size: "sm", onClick: () => onApply(mark, suggestions[0]), children: suggestions[0] === "" ? "Remove" : "Apply" })
1710
+ ] })
1711
+ ]
1712
+ }
1713
+ ) })
1714
+ ] });
1715
+ }
1716
+
1717
+ // src/components/Forms & Data Entry/InlineEdit.tsx
1718
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1600
1719
  function limitsText(min, max) {
1601
1720
  if (min !== void 0) return `${min} ${min === 1 ? "character" : "characters"} required`;
1602
1721
  if (max !== void 0) return `Up to ${max} characters`;
1603
1722
  return "";
1604
1723
  }
1605
- var InlineEdit = React24.forwardRef(
1724
+ var InlineEdit = React25.forwardRef(
1606
1725
  ({
1607
1726
  className,
1608
1727
  textClassName,
1728
+ marks,
1729
+ onMarkApply,
1730
+ onMarkDismiss,
1609
1731
  value: valueProp,
1610
1732
  defaultValue = "",
1611
1733
  onValueChange,
@@ -1625,17 +1747,17 @@ var InlineEdit = React24.forwardRef(
1625
1747
  "aria-label": ariaLabel,
1626
1748
  ...props
1627
1749
  }, ref) => {
1628
- const [internal, setInternal] = React24.useState(defaultValue);
1750
+ const [internal, setInternal] = React25.useState(defaultValue);
1629
1751
  const value = valueProp ?? internal;
1630
- const [editing, setEditing] = React24.useState(false);
1631
- const [draft, setDraft] = React24.useState(value);
1632
- const [error, setError] = React24.useState(null);
1633
- const errorId = React24.useId();
1634
- const fieldRef = React24.useRef(null);
1635
- const readRef = React24.useRef(null);
1636
- const cancelled = React24.useRef(false);
1637
- const restoreFocus = React24.useRef(false);
1638
- React24.useEffect(() => {
1752
+ const [editing, setEditing] = React25.useState(false);
1753
+ const [draft, setDraft] = React25.useState(value);
1754
+ const [error, setError] = React25.useState(null);
1755
+ const errorId = React25.useId();
1756
+ const fieldRef = React25.useRef(null);
1757
+ const readRef = React25.useRef(null);
1758
+ const cancelled = React25.useRef(false);
1759
+ const restoreFocus = React25.useRef(false);
1760
+ React25.useEffect(() => {
1639
1761
  if (editing) {
1640
1762
  fieldRef.current?.focus();
1641
1763
  fieldRef.current?.select();
@@ -1679,14 +1801,14 @@ var InlineEdit = React24.forwardRef(
1679
1801
  const textClasses = cn("text-ui-input-value text-surface-foreground", textClassName);
1680
1802
  const question = variant === "question";
1681
1803
  const fill = multiline || question;
1682
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1804
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1683
1805
  "div",
1684
1806
  {
1685
1807
  ref,
1686
1808
  className: cn(fill ? "flex w-full min-w-0" : "inline-flex min-w-0 max-w-full", editing && (error || showLimits) && "flex-col gap-1.5", className),
1687
1809
  ...props,
1688
- children: editing ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
1689
- React24.createElement(multiline ? "textarea" : "input", {
1810
+ children: editing ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
1811
+ React25.createElement(multiline ? "textarea" : "input", {
1690
1812
  ref: fieldRef,
1691
1813
  value: draft,
1692
1814
  maxLength,
@@ -1697,7 +1819,7 @@ var InlineEdit = React24.forwardRef(
1697
1819
  className: cn(
1698
1820
  "w-full px-3 py-1 outline-none",
1699
1821
  multiline && "field-sizing-content resize-none",
1700
- question ? cn("rounded-none border-0 border-b-2 bg-transparent", error ? "border-destructive" : "border-accent-foreground") : cn("rounded-md", !error && "focus-visible:border-input-accent", fieldSurfaceClasses(error ? "error" : "default")),
1822
+ question ? cn("rounded-none border-0 border-b-2 bg-transparent", error ? "border-destructive" : "border-accent-muted") : cn("rounded-md", !error && "focus-visible:border-input-accent", fieldSurfaceClasses(error ? "error" : "default")),
1701
1823
  textClasses
1702
1824
  ),
1703
1825
  onChange: (event) => {
@@ -1719,26 +1841,26 @@ var InlineEdit = React24.forwardRef(
1719
1841
  if (!cancelled.current) finish(true, false);
1720
1842
  }
1721
1843
  }),
1722
- (error || showLimits) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
1844
+ (error || showLimits) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
1723
1845
  "p",
1724
1846
  {
1725
1847
  id: errorId,
1726
1848
  role: error ? "alert" : void 0,
1727
1849
  className: cn("flex items-start justify-between gap-2 px-3 text-ui-caption", error ? "text-destructive" : "text-secondary-muted-foreground"),
1728
1850
  children: [
1729
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex items-start gap-2", children: [
1730
- error && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react11.WarningCircle, { size: 16, "aria-hidden": true, className: "shrink-0" }),
1851
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "flex items-start gap-2", children: [
1852
+ error && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react12.WarningCircle, { size: 16, "aria-hidden": true, className: "shrink-0" }),
1731
1853
  showLimits ? limitsText(minLength, maxLength) : error,
1732
- showLimits && error && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sr-only", children: error })
1854
+ showLimits && error && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sr-only", children: error })
1733
1855
  ] }),
1734
- showLimits && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
1856
+ showLimits && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
1735
1857
  draft.length,
1736
1858
  maxLength !== void 0 && `/${maxLength}`
1737
1859
  ] })
1738
1860
  ]
1739
1861
  }
1740
1862
  )
1741
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
1863
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
1742
1864
  "button",
1743
1865
  {
1744
1866
  ref: readRef,
@@ -1750,18 +1872,22 @@ var InlineEdit = React24.forwardRef(
1750
1872
  "group inline-flex min-w-0 max-w-full items-center gap-2 px-3 text-left outline-none",
1751
1873
  fill && "w-full",
1752
1874
  question ? (
1753
- // Hover and focus show a 1px bottom border in the input colour; only a selected question gets the 2px accent
1875
+ // Hover and focus show a 1px bottom border in the input colour; only a selected question gets the 2px muted accent
1754
1876
  // one. The extra 1px of bottom padding keeps the height identical so the text never jumps.
1755
- selected ? "rounded-none border-b-2 border-accent-foreground py-1" : "rounded-none border-b border-transparent pb-1.25 pt-1 enabled:hover:border-input-muted enabled:focus-visible:border-input-muted"
1877
+ selected ? "rounded-none border-b-2 border-accent-muted py-1" : "rounded-none border-b border-transparent pb-1.25 pt-1 enabled:hover:border-input-muted enabled:focus-visible:border-input-muted"
1756
1878
  ) : "rounded-md border border-transparent py-1 enabled:focus-visible:border-input-accent",
1757
1879
  // The text is editable in place, so hovering it shows the text cursor.
1758
- "enabled:cursor-text enabled:hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-50",
1880
+ // A selected question already stands out, so its text field takes no hover background.
1881
+ question && selected ? "enabled:cursor-text" : "enabled:cursor-text enabled:hover:bg-secondary",
1882
+ "disabled:cursor-not-allowed disabled:opacity-50",
1759
1883
  textClasses
1760
1884
  ),
1761
1885
  children: [
1762
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: cn("min-w-0", multiline ? "whitespace-pre-wrap" : "truncate", fill && "flex-1", !value && placeholderTone === "muted" && "text-muted-foreground"), children: value || placeholder }),
1763
- !fill && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1764
- import_react11.PencilSimple,
1886
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: cn("min-w-0", multiline ? "whitespace-pre-wrap" : "truncate", fill && "flex-1", !value && placeholderTone === "muted" && "text-muted-foreground"), children: value ? splitMarks(value, marks).map(
1887
+ (piece) => piece.mark ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(MarkedText, { mark: piece.mark, text: piece.text, onApply: onMarkApply, onDismiss: onMarkDismiss }, `${piece.mark.start}:${piece.text}`) : piece.text
1888
+ ) : placeholder }),
1889
+ !fill && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1890
+ import_react12.PencilSimple,
1765
1891
  {
1766
1892
  size: 16,
1767
1893
  "aria-hidden": true,
@@ -1778,17 +1904,17 @@ var InlineEdit = React24.forwardRef(
1778
1904
  InlineEdit.displayName = "InlineEdit";
1779
1905
 
1780
1906
  // src/components/Forms & Data Entry/Input.tsx
1781
- var React25 = __toESM(require("react"), 1);
1782
- var import_jsx_runtime26 = require("react/jsx-runtime");
1907
+ var React26 = __toESM(require("react"), 1);
1908
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1783
1909
  var inputClasses = (status, className) => cn(
1784
1910
  "flex h-10 w-full rounded-md px-3 py-2 text-ui-input-value placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
1785
1911
  fieldSurfaceClasses(status),
1786
1912
  className
1787
1913
  );
1788
- var Input = React25.forwardRef(
1914
+ var Input = React26.forwardRef(
1789
1915
  ({ className, status = "default", label, description, message, id, ...props }, ref) => {
1790
1916
  if (label == null && description == null && message == null) {
1791
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1917
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1792
1918
  "input",
1793
1919
  {
1794
1920
  ref,
@@ -1799,16 +1925,16 @@ var Input = React25.forwardRef(
1799
1925
  }
1800
1926
  );
1801
1927
  }
1802
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("input", { ref, className: inputClasses(status, className), ...control, ...props }) });
1928
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("input", { ref, className: inputClasses(status, className), ...control, ...props }) });
1803
1929
  }
1804
1930
  );
1805
1931
  Input.displayName = "Input";
1806
1932
 
1807
1933
  // src/components/Forms & Data Entry/InputWithAction.tsx
1808
- var React26 = __toESM(require("react"), 1);
1809
- var import_jsx_runtime27 = require("react/jsx-runtime");
1810
- var InputWithAction = React26.forwardRef(
1811
- ({ className, actionLabel, onAction, tags, status = "default", label, description, message, id, disabled, placeholder, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
1934
+ var React27 = __toESM(require("react"), 1);
1935
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1936
+ var InputWithAction = React27.forwardRef(
1937
+ ({ className, actionLabel, onAction, tags, status = "default", label, description, message, id, disabled, placeholder, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
1812
1938
  "div",
1813
1939
  {
1814
1940
  className: cn(
@@ -1820,8 +1946,8 @@ var InputWithAction = React26.forwardRef(
1820
1946
  className
1821
1947
  ),
1822
1948
  children: [
1823
- tags && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex shrink-0 items-center gap-1", children: tags }),
1824
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1949
+ tags && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex shrink-0 items-center gap-1", children: tags }),
1950
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1825
1951
  "input",
1826
1952
  {
1827
1953
  ref,
@@ -1832,7 +1958,7 @@ var InputWithAction = React26.forwardRef(
1832
1958
  ...props
1833
1959
  }
1834
1960
  ),
1835
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { type: "button", variant: "subtle", size: "sm", disabled, onClick: onAction, children: actionLabel })
1961
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { type: "button", variant: "subtle", size: "sm", disabled, onClick: onAction, children: actionLabel })
1836
1962
  ]
1837
1963
  }
1838
1964
  ) })
@@ -1840,10 +1966,10 @@ var InputWithAction = React26.forwardRef(
1840
1966
  InputWithAction.displayName = "InputWithAction";
1841
1967
 
1842
1968
  // src/components/Forms & Data Entry/NumberInput.tsx
1843
- var React27 = __toESM(require("react"), 1);
1844
- var import_react12 = require("@phosphor-icons/react");
1845
- var import_jsx_runtime28 = require("react/jsx-runtime");
1846
- var NumberInput = React27.forwardRef(
1969
+ var React28 = __toESM(require("react"), 1);
1970
+ var import_react13 = require("@phosphor-icons/react");
1971
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1972
+ var NumberInput = React28.forwardRef(
1847
1973
  ({
1848
1974
  className,
1849
1975
  value,
@@ -1861,7 +1987,7 @@ var NumberInput = React27.forwardRef(
1861
1987
  disabled,
1862
1988
  ...props
1863
1989
  }, ref) => {
1864
- const [internal, setInternal] = React27.useState(defaultValue);
1990
+ const [internal, setInternal] = React28.useState(defaultValue);
1865
1991
  const current = value ?? internal;
1866
1992
  const clamp = (next) => Math.min(max, Math.max(min, next));
1867
1993
  const commit = (next) => {
@@ -1869,7 +1995,7 @@ var NumberInput = React27.forwardRef(
1869
1995
  setInternal(clamped);
1870
1996
  onValueChange?.(clamped);
1871
1997
  };
1872
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Field, { label, description, message, status, id, className: "w-50", children: (control) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
1998
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Field, { label, description, message, status, id, className: "w-50", children: (control) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
1873
1999
  "div",
1874
2000
  {
1875
2001
  className: cn(
@@ -1880,7 +2006,7 @@ var NumberInput = React27.forwardRef(
1880
2006
  className
1881
2007
  ),
1882
2008
  children: [
1883
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2009
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1884
2010
  Button,
1885
2011
  {
1886
2012
  type: "button",
@@ -1889,11 +2015,11 @@ var NumberInput = React27.forwardRef(
1889
2015
  "aria-label": "Decrease",
1890
2016
  disabled: disabled || current <= min,
1891
2017
  onClick: () => commit(current - step),
1892
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react12.Minus, { size: 16, "aria-hidden": true })
2018
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react13.Minus, { size: 16, "aria-hidden": true })
1893
2019
  }
1894
2020
  ),
1895
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-center gap-1 text-center", children: [
1896
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2021
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-center gap-1 text-center", children: [
2022
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1897
2023
  "input",
1898
2024
  {
1899
2025
  ref,
@@ -1923,9 +2049,9 @@ var NumberInput = React27.forwardRef(
1923
2049
  ...props
1924
2050
  }
1925
2051
  ),
1926
- unit && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-body-small text-secondary-muted-foreground", children: unit })
2052
+ unit && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-body-small text-secondary-muted-foreground", children: unit })
1927
2053
  ] }),
1928
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2054
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1929
2055
  Button,
1930
2056
  {
1931
2057
  type: "button",
@@ -1934,7 +2060,7 @@ var NumberInput = React27.forwardRef(
1934
2060
  "aria-label": "Increase",
1935
2061
  disabled: disabled || current >= max,
1936
2062
  onClick: () => commit(current + step),
1937
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react12.Plus, { size: 16, "aria-hidden": true })
2063
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react13.Plus, { size: 16, "aria-hidden": true })
1938
2064
  }
1939
2065
  )
1940
2066
  ]
@@ -1945,14 +2071,14 @@ var NumberInput = React27.forwardRef(
1945
2071
  NumberInput.displayName = "NumberInput";
1946
2072
 
1947
2073
  // src/components/Forms & Data Entry/SearchBar.tsx
1948
- var React28 = __toESM(require("react"), 1);
1949
- var import_react13 = require("@phosphor-icons/react");
1950
- var import_jsx_runtime29 = require("react/jsx-runtime");
1951
- var SearchBar = React28.forwardRef(
2074
+ var React29 = __toESM(require("react"), 1);
2075
+ var import_react14 = require("@phosphor-icons/react");
2076
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2077
+ var SearchBar = React29.forwardRef(
1952
2078
  ({ className, value, defaultValue, onChange, onClear, clearLabel = "Clear search", disabled, ...props }, ref) => {
1953
- const innerRef = React28.useRef(null);
1954
- React28.useImperativeHandle(ref, () => innerRef.current);
1955
- const [uncontrolled, setUncontrolled] = React28.useState(String(defaultValue ?? ""));
2079
+ const innerRef = React29.useRef(null);
2080
+ React29.useImperativeHandle(ref, () => innerRef.current);
2081
+ const [uncontrolled, setUncontrolled] = React29.useState(String(defaultValue ?? ""));
1956
2082
  const current = value !== void 0 ? String(value) : uncontrolled;
1957
2083
  const clear = () => {
1958
2084
  const input = innerRef.current;
@@ -1964,7 +2090,7 @@ var SearchBar = React28.forwardRef(
1964
2090
  }
1965
2091
  onClear?.();
1966
2092
  };
1967
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
2093
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
1968
2094
  "div",
1969
2095
  {
1970
2096
  className: cn(
@@ -1975,8 +2101,8 @@ var SearchBar = React28.forwardRef(
1975
2101
  className
1976
2102
  ),
1977
2103
  children: [
1978
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react13.MagnifyingGlass, { size: 16, "aria-hidden": true, className: "shrink-0 text-surface-foreground" }),
1979
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2104
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react14.MagnifyingGlass, { size: 16, "aria-hidden": true, className: "shrink-0 text-surface-foreground" }),
2105
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1980
2106
  "input",
1981
2107
  {
1982
2108
  ref: innerRef,
@@ -1993,14 +2119,14 @@ var SearchBar = React28.forwardRef(
1993
2119
  ...props
1994
2120
  }
1995
2121
  ),
1996
- current !== "" && !disabled && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2122
+ current !== "" && !disabled && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1997
2123
  "button",
1998
2124
  {
1999
2125
  type: "button",
2000
2126
  "aria-label": clearLabel,
2001
2127
  onClick: clear,
2002
2128
  className: "inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground",
2003
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react13.X, { size: 16, "aria-hidden": true })
2129
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react14.X, { size: 16, "aria-hidden": true })
2004
2130
  }
2005
2131
  )
2006
2132
  ]
@@ -2011,17 +2137,17 @@ var SearchBar = React28.forwardRef(
2011
2137
  SearchBar.displayName = "SearchBar";
2012
2138
 
2013
2139
  // src/components/Forms & Data Entry/Select.tsx
2014
- var React29 = __toESM(require("react"), 1);
2015
- var import_react14 = require("@phosphor-icons/react");
2016
- var import_radix_ui14 = require("radix-ui");
2017
- var import_jsx_runtime30 = require("react/jsx-runtime");
2018
- var Select = import_radix_ui14.Select.Root;
2019
- var SelectValue = import_radix_ui14.Select.Value;
2020
- var SelectGroup = import_radix_ui14.Select.Group;
2021
- var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M1 4L3.5 6.5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
2022
- var SelectTrigger = React29.forwardRef(
2023
- ({ className, children, icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2024
- import_radix_ui14.Select.Trigger,
2140
+ var React30 = __toESM(require("react"), 1);
2141
+ var import_react15 = require("@phosphor-icons/react");
2142
+ var import_radix_ui15 = require("radix-ui");
2143
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2144
+ var Select = import_radix_ui15.Select.Root;
2145
+ var SelectValue = import_radix_ui15.Select.Value;
2146
+ var SelectGroup = import_radix_ui15.Select.Group;
2147
+ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("path", { d: "M1 4L3.5 6.5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
2148
+ var SelectTrigger = React30.forwardRef(
2149
+ ({ className, children, icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2150
+ import_radix_ui15.Select.Trigger,
2025
2151
  {
2026
2152
  ref,
2027
2153
  className: cn(
@@ -2033,17 +2159,17 @@ var SelectTrigger = React29.forwardRef(
2033
2159
  ),
2034
2160
  ...props,
2035
2161
  children: [
2036
- icon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "flex shrink-0 text-surface-foreground", children: icon }),
2037
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
2038
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui14.Select.Icon, { className: "shrink-0 text-surface-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react14.CaretDown, { size: 16, "aria-hidden": true }) })
2162
+ icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "flex shrink-0 text-surface-foreground", children: icon }),
2163
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
2164
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_radix_ui15.Select.Icon, { className: "shrink-0 text-surface-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.CaretDown, { size: 16, "aria-hidden": true }) })
2039
2165
  ]
2040
2166
  }
2041
2167
  )
2042
2168
  );
2043
2169
  SelectTrigger.displayName = "SelectTrigger";
2044
- var SelectContent = React29.forwardRef(
2045
- ({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui14.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2046
- import_radix_ui14.Select.Content,
2170
+ var SelectContent = React30.forwardRef(
2171
+ ({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_radix_ui15.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2172
+ import_radix_ui15.Select.Content,
2047
2173
  {
2048
2174
  ref,
2049
2175
  position,
@@ -2056,14 +2182,14 @@ var SelectContent = React29.forwardRef(
2056
2182
  className
2057
2183
  ),
2058
2184
  ...props,
2059
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui14.Select.Viewport, { className: "p-1", children })
2185
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_radix_ui15.Select.Viewport, { className: "p-1", children })
2060
2186
  }
2061
2187
  ) })
2062
2188
  );
2063
2189
  SelectContent.displayName = "SelectContent";
2064
- var SelectItem = React29.forwardRef(
2065
- ({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2066
- import_radix_ui14.Select.Item,
2190
+ var SelectItem = React30.forwardRef(
2191
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2192
+ import_radix_ui15.Select.Item,
2067
2193
  {
2068
2194
  ref,
2069
2195
  className: cn(
@@ -2073,8 +2199,8 @@ var SelectItem = React29.forwardRef(
2073
2199
  ),
2074
2200
  ...props,
2075
2201
  children: [
2076
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute left-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui14.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CheckIcon, {}) }) }),
2077
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui14.Select.ItemText, { children })
2202
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "absolute left-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_radix_ui15.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CheckIcon, {}) }) }),
2203
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_radix_ui15.Select.ItemText, { children })
2078
2204
  ]
2079
2205
  }
2080
2206
  )
@@ -2082,10 +2208,10 @@ var SelectItem = React29.forwardRef(
2082
2208
  SelectItem.displayName = "SelectItem";
2083
2209
 
2084
2210
  // src/components/Forms & Data Entry/Slider.tsx
2085
- var React30 = __toESM(require("react"), 1);
2086
- var import_radix_ui15 = require("radix-ui");
2087
- var import_jsx_runtime31 = require("react/jsx-runtime");
2088
- var Slider = React30.forwardRef(
2211
+ var React31 = __toESM(require("react"), 1);
2212
+ var import_radix_ui16 = require("radix-ui");
2213
+ var import_jsx_runtime32 = require("react/jsx-runtime");
2214
+ var Slider = React31.forwardRef(
2089
2215
  ({
2090
2216
  className,
2091
2217
  value,
@@ -2100,16 +2226,16 @@ var Slider = React30.forwardRef(
2100
2226
  "aria-labelledby": ariaLabelledBy,
2101
2227
  ...props
2102
2228
  }, ref) => {
2103
- const [internal, setInternal] = React30.useState(defaultValue ?? [min]);
2229
+ const [internal, setInternal] = React31.useState(defaultValue ?? [min]);
2104
2230
  const thumbValues = value ?? internal;
2105
2231
  const hasHeader = label != null || showRange;
2106
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
2107
- hasHeader && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center justify-between text-secondary-muted-foreground", children: [
2108
- label != null ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-ui-label text-surface-foreground", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-ui-caption", children: min }),
2109
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-body-small", children: max })
2232
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
2233
+ hasHeader && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center justify-between text-secondary-muted-foreground", children: [
2234
+ label != null ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-ui-label text-surface-foreground", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-ui-caption", children: min }),
2235
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-body-small", children: max })
2110
2236
  ] }),
2111
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2112
- import_radix_ui15.Slider.Root,
2237
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
2238
+ import_radix_ui16.Slider.Root,
2113
2239
  {
2114
2240
  ref,
2115
2241
  value,
@@ -2123,19 +2249,19 @@ var Slider = React30.forwardRef(
2123
2249
  className: "relative flex h-4 w-full touch-none items-center select-none",
2124
2250
  ...props,
2125
2251
  children: [
2126
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_radix_ui15.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_radix_ui15.Slider.Range, { className: "absolute h-full bg-input-accent" }) }),
2252
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_radix_ui16.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_radix_ui16.Slider.Range, { className: "absolute h-full bg-input-accent" }) }),
2127
2253
  thumbValues.map((thumbValue, index) => (
2128
2254
  // The accessible name belongs on each individual thumb (the actual
2129
2255
  // role="slider" element) — Root is just a group container. With
2130
2256
  // more than one thumb this applies the same label to each; give a
2131
2257
  // range slider distinct per-thumb labels via aria-labelledby instead.
2132
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2133
- import_radix_ui15.Slider.Thumb,
2258
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2259
+ import_radix_ui16.Slider.Thumb,
2134
2260
  {
2135
2261
  "aria-label": ariaLabel,
2136
2262
  "aria-labelledby": ariaLabelledBy,
2137
2263
  className: "group relative block size-4 rounded-full border-2 border-surface bg-input-accent shadow-sm transition-colors disabled:pointer-events-none disabled:opacity-50",
2138
- children: showValue && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2264
+ children: showValue && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2139
2265
  "span",
2140
2266
  {
2141
2267
  "aria-hidden": "true",
@@ -2159,17 +2285,17 @@ var Slider = React30.forwardRef(
2159
2285
  Slider.displayName = "Slider";
2160
2286
 
2161
2287
  // src/components/Forms & Data Entry/Textarea.tsx
2162
- var React31 = __toESM(require("react"), 1);
2163
- var import_jsx_runtime32 = require("react/jsx-runtime");
2288
+ var React32 = __toESM(require("react"), 1);
2289
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2164
2290
  var textareaClasses = (status, className) => cn(
2165
2291
  "flex field-sizing-content min-h-25 w-full rounded-md px-3 py-2.5 text-body-base placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
2166
2292
  fieldSurfaceClasses(status),
2167
2293
  className
2168
2294
  );
2169
- var Textarea = React31.forwardRef(
2295
+ var Textarea = React32.forwardRef(
2170
2296
  ({ className, status = "default", label, description, message, id, ...props }, ref) => {
2171
2297
  if (label == null && description == null && message == null) {
2172
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2298
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2173
2299
  "textarea",
2174
2300
  {
2175
2301
  ref,
@@ -2180,30 +2306,30 @@ var Textarea = React31.forwardRef(
2180
2306
  }
2181
2307
  );
2182
2308
  }
2183
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("textarea", { ref, className: textareaClasses(status, className), ...control, ...props }) });
2309
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("textarea", { ref, className: textareaClasses(status, className), ...control, ...props }) });
2184
2310
  }
2185
2311
  );
2186
2312
  Textarea.displayName = "Textarea";
2187
2313
 
2188
2314
  // src/components/Overlays & Feedback/Dialog.tsx
2189
- var React32 = __toESM(require("react"), 1);
2190
- var import_react15 = require("@phosphor-icons/react");
2191
- var import_radix_ui16 = require("radix-ui");
2192
- var import_jsx_runtime33 = require("react/jsx-runtime");
2193
- var Dialog = import_radix_ui16.Dialog.Root;
2194
- var DialogTrigger = import_radix_ui16.Dialog.Trigger;
2195
- var DialogClose = import_radix_ui16.Dialog.Close;
2196
- var DialogContent = React32.forwardRef(
2197
- ({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_radix_ui16.Dialog.Portal, { children: [
2198
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2199
- import_radix_ui16.Dialog.Overlay,
2315
+ var React33 = __toESM(require("react"), 1);
2316
+ var import_react16 = require("@phosphor-icons/react");
2317
+ var import_radix_ui17 = require("radix-ui");
2318
+ var import_jsx_runtime34 = require("react/jsx-runtime");
2319
+ var Dialog = import_radix_ui17.Dialog.Root;
2320
+ var DialogTrigger = import_radix_ui17.Dialog.Trigger;
2321
+ var DialogClose = import_radix_ui17.Dialog.Close;
2322
+ var DialogContent = React33.forwardRef(
2323
+ ({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_radix_ui17.Dialog.Portal, { children: [
2324
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2325
+ import_radix_ui17.Dialog.Overlay,
2200
2326
  {
2201
2327
  style: { zIndex: "var(--sys-z-30)" },
2202
2328
  className: "fixed inset-0 bg-primary/30"
2203
2329
  }
2204
2330
  ),
2205
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
2206
- import_radix_ui16.Dialog.Content,
2331
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2332
+ import_radix_ui17.Dialog.Content,
2207
2333
  {
2208
2334
  ref,
2209
2335
  style: { zIndex: "var(--sys-z-30)" },
@@ -2214,16 +2340,16 @@ var DialogContent = React32.forwardRef(
2214
2340
  ...props,
2215
2341
  children: [
2216
2342
  children,
2217
- !hideClose && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_radix_ui16.Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { variant: "ghost", size: "icon-sm", "aria-label": closeLabel, className: "absolute top-4 right-6", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react15.X, { size: 16, "aria-hidden": true }) }) })
2343
+ !hideClose && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_radix_ui17.Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { variant: "ghost", size: "icon-sm", "aria-label": closeLabel, className: "absolute top-4 right-6", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.X, { size: 16, "aria-hidden": true }) }) })
2218
2344
  ]
2219
2345
  }
2220
2346
  )
2221
2347
  ] })
2222
2348
  );
2223
2349
  DialogContent.displayName = "DialogContent";
2224
- var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("flex flex-col gap-1.5 border-b border-border px-6 py-4 pr-16", className), ...props });
2225
- var DialogTitle = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2226
- import_radix_ui16.Dialog.Title,
2350
+ var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("flex flex-col gap-1.5 border-b border-border px-6 py-4 pr-16", className), ...props });
2351
+ var DialogTitle = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2352
+ import_radix_ui17.Dialog.Title,
2227
2353
  {
2228
2354
  ref,
2229
2355
  className: cn("text-lg leading-6 font-semibold text-surface-foreground", className),
@@ -2231,8 +2357,8 @@ var DialogTitle = React32.forwardRef(({ className, ...props }, ref) => /* @__PUR
2231
2357
  }
2232
2358
  ));
2233
2359
  DialogTitle.displayName = "DialogTitle";
2234
- var DialogDescription = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2235
- import_radix_ui16.Dialog.Description,
2360
+ var DialogDescription = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2361
+ import_radix_ui17.Dialog.Description,
2236
2362
  {
2237
2363
  ref,
2238
2364
  className: cn("text-body-small text-secondary-muted-foreground", className),
@@ -2240,15 +2366,15 @@ var DialogDescription = React32.forwardRef(({ className, ...props }, ref) => /*
2240
2366
  }
2241
2367
  ));
2242
2368
  DialogDescription.displayName = "DialogDescription";
2243
- var DialogBody = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("flex flex-col gap-4 p-6", className), ...props });
2244
- var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("flex items-center justify-end gap-3 border-t border-border px-6 py-4", className), ...props });
2369
+ var DialogBody = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("flex flex-col gap-4 p-6", className), ...props });
2370
+ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("flex items-center justify-end gap-3 border-t border-border px-6 py-4", className), ...props });
2245
2371
 
2246
2372
  // src/components/Overlays & Feedback/Toast.tsx
2247
- var React33 = __toESM(require("react"), 1);
2248
- var import_react16 = require("@phosphor-icons/react");
2373
+ var React34 = __toESM(require("react"), 1);
2374
+ var import_react17 = require("@phosphor-icons/react");
2249
2375
  var import_class_variance_authority4 = require("class-variance-authority");
2250
- var import_radix_ui17 = require("radix-ui");
2251
- var import_jsx_runtime34 = require("react/jsx-runtime");
2376
+ var import_radix_ui18 = require("radix-ui");
2377
+ var import_jsx_runtime35 = require("react/jsx-runtime");
2252
2378
  var toastVariants = (0, import_class_variance_authority4.cva)("border", {
2253
2379
  variants: {
2254
2380
  variant: {
@@ -2286,14 +2412,14 @@ var titleColour = {
2286
2412
  };
2287
2413
  function VariantIcon({ variant, size }) {
2288
2414
  const props = { size, "aria-hidden": true, className: cn("shrink-0", iconColour[variant]) };
2289
- if (variant === "success") return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.CheckCircle, { ...props });
2290
- if (variant === "warning") return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.Warning, { ...props });
2291
- if (variant === "destructive") return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.WarningCircle, { ...props });
2292
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.Info, { ...props });
2415
+ if (variant === "success") return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react17.CheckCircle, { ...props });
2416
+ if (variant === "warning") return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react17.Warning, { ...props });
2417
+ if (variant === "destructive") return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react17.WarningCircle, { ...props });
2418
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react17.Info, { ...props });
2293
2419
  }
2294
- var ToastProvider = import_radix_ui17.Toast.Provider;
2295
- var ToastViewport = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2296
- import_radix_ui17.Toast.Viewport,
2420
+ var ToastProvider = import_radix_ui18.Toast.Provider;
2421
+ var ToastViewport = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2422
+ import_radix_ui18.Toast.Viewport,
2297
2423
  {
2298
2424
  ref,
2299
2425
  style: { zIndex: "var(--sys-z-50)" },
@@ -2302,30 +2428,30 @@ var ToastViewport = React33.forwardRef(({ className, ...props }, ref) => /* @__P
2302
2428
  }
2303
2429
  ));
2304
2430
  ToastViewport.displayName = "ToastViewport";
2305
- var Toast = React33.forwardRef(
2431
+ var Toast = React34.forwardRef(
2306
2432
  ({ className, variant = "info", title, description, action, closeLabel = "Close", children, ...props }, ref) => {
2307
2433
  const v = variant ?? "info";
2308
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2309
- import_radix_ui17.Toast.Root,
2434
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
2435
+ import_radix_ui18.Toast.Root,
2310
2436
  {
2311
2437
  ref,
2312
2438
  type: v === "destructive" ? "foreground" : "background",
2313
2439
  className: cn("flex items-start gap-3 rounded-lg p-4 shadow-lg", toastVariants({ variant: v }), className),
2314
2440
  ...props,
2315
2441
  children: [
2316
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(VariantIcon, { variant: v, size: 20 }),
2317
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1 text-body-small", children: [
2318
- title != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_radix_ui17.Toast.Title, { className: cn("font-semibold", titleColour[v]), children: title }),
2319
- description != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_radix_ui17.Toast.Description, { className: "text-secondary-muted-foreground", children: description }),
2442
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(VariantIcon, { variant: v, size: 20 }),
2443
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1 text-body-small", children: [
2444
+ title != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_radix_ui18.Toast.Title, { className: cn("font-semibold", titleColour[v]), children: title }),
2445
+ description != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_radix_ui18.Toast.Description, { className: "text-secondary-muted-foreground", children: description }),
2320
2446
  children,
2321
2447
  action
2322
2448
  ] }),
2323
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2324
- import_radix_ui17.Toast.Close,
2449
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2450
+ import_radix_ui18.Toast.Close,
2325
2451
  {
2326
2452
  "aria-label": closeLabel,
2327
2453
  className: "inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground",
2328
- children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.X, { size: 16, "aria-hidden": true })
2454
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react17.X, { size: 16, "aria-hidden": true })
2329
2455
  }
2330
2456
  )
2331
2457
  ]
@@ -2334,11 +2460,11 @@ var Toast = React33.forwardRef(
2334
2460
  }
2335
2461
  );
2336
2462
  Toast.displayName = "Toast";
2337
- var ToastAction = import_radix_ui17.Toast.Action;
2338
- var ToastInline = React33.forwardRef(
2463
+ var ToastAction = import_radix_ui18.Toast.Action;
2464
+ var ToastInline = React34.forwardRef(
2339
2465
  ({ className, variant = "info", actions, onClose, closeLabel = "Close", children, ...props }, ref) => {
2340
2466
  const v = variant ?? "info";
2341
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2467
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
2342
2468
  "div",
2343
2469
  {
2344
2470
  ref,
@@ -2346,10 +2472,10 @@ var ToastInline = React33.forwardRef(
2346
2472
  className: cn("flex items-center gap-2 rounded-sm px-2 py-1.5", inlineVariants({ variant: v }), className),
2347
2473
  ...props,
2348
2474
  children: [
2349
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(VariantIcon, { variant: v === "neutral" ? "info" : v, size: 16 }),
2350
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
2351
- actions && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions }),
2352
- onClose && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.X, { size: 16, "aria-hidden": true }) })
2475
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(VariantIcon, { variant: v === "neutral" ? "info" : v, size: 16 }),
2476
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
2477
+ actions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions }),
2478
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react17.X, { size: 16, "aria-hidden": true }) })
2353
2479
  ]
2354
2480
  }
2355
2481
  );
@@ -2358,17 +2484,17 @@ var ToastInline = React33.forwardRef(
2358
2484
  ToastInline.displayName = "ToastInline";
2359
2485
 
2360
2486
  // src/components/Overlays & Feedback/Tooltip.tsx
2361
- var React34 = __toESM(require("react"), 1);
2362
- var import_radix_ui18 = require("radix-ui");
2363
- var import_jsx_runtime35 = require("react/jsx-runtime");
2364
- var TooltipProvider = import_radix_ui18.Tooltip.Provider;
2365
- var Tooltip = import_radix_ui18.Tooltip.Root;
2366
- var TooltipTrigger = import_radix_ui18.Tooltip.Trigger;
2367
- var TooltipContent = React34.forwardRef(
2487
+ var React35 = __toESM(require("react"), 1);
2488
+ var import_radix_ui19 = require("radix-ui");
2489
+ var import_jsx_runtime36 = require("react/jsx-runtime");
2490
+ var TooltipProvider = import_radix_ui19.Tooltip.Provider;
2491
+ var Tooltip = import_radix_ui19.Tooltip.Root;
2492
+ var TooltipTrigger = import_radix_ui19.Tooltip.Trigger;
2493
+ var TooltipContent = React35.forwardRef(
2368
2494
  ({ className, sideOffset = 4, title, description, action, arrow = true, children, ...props }, ref) => {
2369
2495
  const detailed = title != null || description != null;
2370
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_radix_ui18.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
2371
- import_radix_ui18.Tooltip.Content,
2496
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_radix_ui19.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
2497
+ import_radix_ui19.Tooltip.Content,
2372
2498
  {
2373
2499
  ref,
2374
2500
  sideOffset,
@@ -2381,12 +2507,12 @@ var TooltipContent = React34.forwardRef(
2381
2507
  ),
2382
2508
  ...props,
2383
2509
  children: [
2384
- detailed ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2385
- title != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs leading-4 font-semibold text-label", children: title }),
2386
- description != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs leading-4.5 text-plum-200", children: description }),
2387
- action != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "mt-1 text-ui-caption text-plum-300 underline *:underline", children: action })
2510
+ detailed ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
2511
+ title != null && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs leading-4 font-semibold text-label", children: title }),
2512
+ description != null && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs leading-4.5 text-plum-200", children: description }),
2513
+ action != null && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mt-1 text-ui-caption text-plum-300 underline *:underline", children: action })
2388
2514
  ] }) : children,
2389
- arrow && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_radix_ui18.Tooltip.Arrow, { width: 12, height: 8, className: "fill-primary-soft-foreground" })
2515
+ arrow && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_radix_ui19.Tooltip.Arrow, { width: 12, height: 8, className: "fill-primary-soft-foreground" })
2390
2516
  ]
2391
2517
  }
2392
2518
  ) });
@@ -2395,14 +2521,14 @@ var TooltipContent = React34.forwardRef(
2395
2521
  TooltipContent.displayName = "TooltipContent";
2396
2522
 
2397
2523
  // src/components/Question Types/FileUpload.tsx
2398
- var React36 = __toESM(require("react"), 1);
2399
- var import_react17 = require("@phosphor-icons/react");
2400
- var import_radix_ui19 = require("radix-ui");
2524
+ var React37 = __toESM(require("react"), 1);
2525
+ var import_react18 = require("@phosphor-icons/react");
2526
+ var import_radix_ui20 = require("radix-ui");
2401
2527
 
2402
2528
  // src/components/Tags & Badges/Tag.tsx
2403
- var React35 = __toESM(require("react"), 1);
2529
+ var React36 = __toESM(require("react"), 1);
2404
2530
  var import_class_variance_authority5 = require("class-variance-authority");
2405
- var import_jsx_runtime36 = require("react/jsx-runtime");
2531
+ var import_jsx_runtime37 = require("react/jsx-runtime");
2406
2532
  var tagVariants = (0, import_class_variance_authority5.cva)(
2407
2533
  "inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border px-2.5 py-1 text-ui-caption",
2408
2534
  {
@@ -2418,7 +2544,7 @@ var tagVariants = (0, import_class_variance_authority5.cva)(
2418
2544
  defaultVariants: { variant: "neutral" }
2419
2545
  }
2420
2546
  );
2421
- var Tag = React35.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { ref, className: cn(tagVariants({ variant }), className), ...props }));
2547
+ var Tag = React36.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { ref, className: cn(tagVariants({ variant }), className), ...props }));
2422
2548
  Tag.displayName = "Tag";
2423
2549
  var statusDotVariants = (0, import_class_variance_authority5.cva)("size-1.5 shrink-0 rounded-full", {
2424
2550
  variants: {
@@ -2431,20 +2557,20 @@ var statusDotVariants = (0, import_class_variance_authority5.cva)("size-1.5 shri
2431
2557
  },
2432
2558
  defaultVariants: { status: "active" }
2433
2559
  });
2434
- var StatusTag = React35.forwardRef(
2435
- ({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { ref, className: cn(tagVariants({ variant: "default" }), className), ...props, children: [
2436
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: statusDotVariants({ status }), "aria-hidden": "true" }),
2560
+ var StatusTag = React36.forwardRef(
2561
+ ({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { ref, className: cn(tagVariants({ variant: "default" }), className), ...props, children: [
2562
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: statusDotVariants({ status }), "aria-hidden": "true" }),
2437
2563
  children
2438
2564
  ] })
2439
2565
  );
2440
2566
  StatusTag.displayName = "StatusTag";
2441
2567
 
2442
2568
  // src/components/Question Types/FileUpload.tsx
2443
- var import_jsx_runtime37 = require("react/jsx-runtime");
2444
- var FileUploadZone = React36.forwardRef(
2569
+ var import_jsx_runtime38 = require("react/jsx-runtime");
2570
+ var FileUploadZone = React37.forwardRef(
2445
2571
  ({ className, title = "Upload document", hint, icon, onFiles, ...props }, ref) => {
2446
- const [over, setOver] = React36.useState(false);
2447
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
2572
+ const [over, setOver] = React37.useState(false);
2573
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2448
2574
  "label",
2449
2575
  {
2450
2576
  className: cn(
@@ -2464,12 +2590,12 @@ var FileUploadZone = React36.forwardRef(
2464
2590
  onFiles?.(Array.from(event.dataTransfer.files));
2465
2591
  },
2466
2592
  children: [
2467
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "flex size-10 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.FileText, { size: 24, "aria-hidden": true }) }),
2468
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex flex-col gap-1", children: [
2469
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-body-small text-surface-foreground", children: title }),
2470
- hint && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: hint })
2593
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "flex size-10 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.FileText, { size: 24, "aria-hidden": true }) }),
2594
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex flex-col gap-1", children: [
2595
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-body-small text-surface-foreground", children: title }),
2596
+ hint && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: hint })
2471
2597
  ] }),
2472
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2598
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2473
2599
  "input",
2474
2600
  {
2475
2601
  ref,
@@ -2485,47 +2611,47 @@ var FileUploadZone = React36.forwardRef(
2485
2611
  }
2486
2612
  );
2487
2613
  FileUploadZone.displayName = "FileUploadZone";
2488
- var FileUploadItem = React36.forwardRef(
2614
+ var FileUploadItem = React37.forwardRef(
2489
2615
  ({ className, name, size, status = "uploading", progress = 0, timeLeft, icon, onRemove, removeLabel, ...props }, ref) => {
2490
2616
  const uploading = status === "uploading";
2491
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
2617
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2492
2618
  "div",
2493
2619
  {
2494
2620
  ref,
2495
2621
  className: cn("flex w-full flex-col justify-center gap-2 overflow-hidden rounded-sm border border-border p-2", className),
2496
2622
  ...props,
2497
2623
  children: [
2498
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-2", children: [
2499
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.FileText, { size: 24, "aria-hidden": true }) }),
2500
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
2501
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
2502
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "min-w-0 truncate text-ui-label text-surface-foreground", children: name }),
2503
- onRemove && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.X, { size: 16, "aria-hidden": true }) })
2624
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
2625
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.FileText, { size: 24, "aria-hidden": true }) }),
2626
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
2627
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
2628
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "min-w-0 truncate text-ui-label text-surface-foreground", children: name }),
2629
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.X, { size: 16, "aria-hidden": true }) })
2504
2630
  ] }),
2505
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center justify-between text-ui-caption text-secondary-muted-foreground", children: [
2506
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex items-center gap-2", children: [
2631
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between text-ui-caption text-secondary-muted-foreground", children: [
2632
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex items-center gap-2", children: [
2507
2633
  size,
2508
- status === "complete" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Tag, { variant: "success", children: "Complete" }),
2509
- status === "error" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Tag, { variant: "destructive", children: "Error" }),
2510
- uploading && timeLeft && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
2511
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
2634
+ status === "complete" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tag, { variant: "success", children: "Complete" }),
2635
+ status === "error" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tag, { variant: "destructive", children: "Error" }),
2636
+ uploading && timeLeft && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
2637
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
2512
2638
  timeLeft
2513
2639
  ] })
2514
2640
  ] }),
2515
- uploading && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-body-xxs font-normal", children: [
2641
+ uploading && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "text-body-xxs font-normal", children: [
2516
2642
  Math.round(progress),
2517
2643
  "%"
2518
2644
  ] })
2519
2645
  ] })
2520
2646
  ] })
2521
2647
  ] }),
2522
- uploading && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2523
- import_radix_ui19.Progress.Root,
2648
+ uploading && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2649
+ import_radix_ui20.Progress.Root,
2524
2650
  {
2525
2651
  value: progress,
2526
2652
  "aria-label": `Uploading ${name}`,
2527
2653
  className: "h-0.75 w-full overflow-hidden rounded-sm bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5",
2528
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_radix_ui19.Progress.Indicator, { className: "h-full bg-accent transition-[width]", style: { width: `${progress}%` } })
2654
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Progress.Indicator, { className: "h-full bg-accent transition-[width]", style: { width: `${progress}%` } })
2529
2655
  }
2530
2656
  )
2531
2657
  ]
@@ -2536,25 +2662,25 @@ var FileUploadItem = React36.forwardRef(
2536
2662
  FileUploadItem.displayName = "FileUploadItem";
2537
2663
 
2538
2664
  // src/components/Question Types/Media.tsx
2539
- var React37 = __toESM(require("react"), 1);
2540
- var import_react18 = require("@phosphor-icons/react");
2541
- var import_radix_ui20 = require("radix-ui");
2542
- var import_jsx_runtime38 = require("react/jsx-runtime");
2665
+ var React38 = __toESM(require("react"), 1);
2666
+ var import_react19 = require("@phosphor-icons/react");
2667
+ var import_radix_ui21 = require("radix-ui");
2668
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2543
2669
  function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...props }) {
2544
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("flex items-center justify-between border-t border-border bg-surface px-6 py-4", className), ...props, children: [
2545
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
2546
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: cn("truncate text-surface-foreground", large ? "text-body-section" : "text-ui-label"), children: name }),
2547
- details && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: cn("flex items-center gap-2 text-secondary-muted-foreground", large ? "text-body-small" : "text-ui-caption"), children: details.map((part, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(React37.Fragment, { children: [
2548
- index > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
2670
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("flex items-center justify-between border-t border-border bg-surface px-6 py-4", className), ...props, children: [
2671
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
2672
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: cn("truncate text-surface-foreground", large ? "text-body-section" : "text-ui-label"), children: name }),
2673
+ details && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: cn("flex items-center gap-2 text-secondary-muted-foreground", large ? "text-body-small" : "text-ui-caption"), children: details.map((part, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(React38.Fragment, { children: [
2674
+ index > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
2549
2675
  part
2550
2676
  ] }, part)) })
2551
2677
  ] }),
2552
- onRemove && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Button, { type: "button", variant: "destructive", size: "icon", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.Trash, { size: 16, "aria-hidden": true }) })
2678
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, { type: "button", variant: "destructive", size: "icon", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.Trash, { size: 16, "aria-hidden": true }) })
2553
2679
  ] });
2554
2680
  }
2555
- var ImagePreview = React37.forwardRef(
2556
- ({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border", className), ...props, children: [
2557
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2681
+ var ImagePreview = React38.forwardRef(
2682
+ ({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border", className), ...props, children: [
2683
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2558
2684
  "div",
2559
2685
  {
2560
2686
  className: cn(
@@ -2565,13 +2691,13 @@ var ImagePreview = React37.forwardRef(
2565
2691
  children
2566
2692
  }
2567
2693
  ),
2568
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MediaInfo, { name, details, onRemove, large: true })
2694
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MediaInfo, { name, details, onRemove, large: true })
2569
2695
  ] })
2570
2696
  );
2571
2697
  ImagePreview.displayName = "ImagePreview";
2572
- var ImageThumbnails = React37.forwardRef(
2573
- ({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2574
- import_radix_ui20.ToggleGroup.Root,
2698
+ var ImageThumbnails = React38.forwardRef(
2699
+ ({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2700
+ import_radix_ui21.ToggleGroup.Root,
2575
2701
  {
2576
2702
  ref,
2577
2703
  type: "single",
@@ -2582,18 +2708,18 @@ var ImageThumbnails = React37.forwardRef(
2582
2708
  children: Array.from({ length: max }, (_, index) => {
2583
2709
  const image = images[index];
2584
2710
  if (!image) {
2585
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2711
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2586
2712
  "span",
2587
2713
  {
2588
2714
  "aria-hidden": "true",
2589
2715
  className: "flex h-20 min-w-0 flex-1 items-center justify-center rounded-sm border border-dashed border-border text-accent-foreground",
2590
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.Image, { size: 24 })
2716
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.Image, { size: 24 })
2591
2717
  },
2592
2718
  `empty-${index}`
2593
2719
  );
2594
2720
  }
2595
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2596
- import_radix_ui20.ToggleGroup.Item,
2721
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2722
+ import_radix_ui21.ToggleGroup.Item,
2597
2723
  {
2598
2724
  value: image.id,
2599
2725
  "aria-label": image.alt,
@@ -2602,7 +2728,7 @@ var ImageThumbnails = React37.forwardRef(
2602
2728
  "hover:bg-accent-soft hover:bg-none",
2603
2729
  "data-[state=on]:border-accent-foreground data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-foreground"
2604
2730
  ),
2605
- children: image.src ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("img", { src: image.src, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.Image, { size: 24, "aria-hidden": true })
2731
+ children: image.src ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("img", { src: image.src, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.Image, { size: 24, "aria-hidden": true })
2606
2732
  },
2607
2733
  image.id
2608
2734
  );
@@ -2615,13 +2741,13 @@ var formatTime = (seconds) => {
2615
2741
  const total = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));
2616
2742
  return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
2617
2743
  };
2618
- var VideoPlayer = React37.forwardRef(
2744
+ var VideoPlayer = React38.forwardRef(
2619
2745
  ({ className, src, name, details, onRemove, onMore, initialTime = 0, initialDuration = 0, ...props }, ref) => {
2620
- const video = React37.useRef(null);
2621
- const [playing, setPlaying] = React37.useState(false);
2622
- const [time, setTime] = React37.useState(initialTime);
2623
- const [duration, setDuration] = React37.useState(initialDuration);
2624
- const [volume, setVolume] = React37.useState(1);
2746
+ const video = React38.useRef(null);
2747
+ const [playing, setPlaying] = React38.useState(false);
2748
+ const [time, setTime] = React38.useState(initialTime);
2749
+ const [duration, setDuration] = React38.useState(initialDuration);
2750
+ const [volume, setVolume] = React38.useState(1);
2625
2751
  const muted = volume === 0;
2626
2752
  const toggle2 = () => {
2627
2753
  const el = video.current;
@@ -2629,9 +2755,9 @@ var VideoPlayer = React37.forwardRef(
2629
2755
  if (el.paused) void el.play();
2630
2756
  else el.pause();
2631
2757
  };
2632
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface", className), ...props, children: [
2633
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative flex h-60.5 w-full items-end bg-accent-soft", children: [
2634
- src && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2758
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface", className), ...props, children: [
2759
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "relative flex h-60.5 w-full items-end bg-accent-soft", children: [
2760
+ src && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2635
2761
  "video",
2636
2762
  {
2637
2763
  ref: video,
@@ -2644,9 +2770,9 @@ var VideoPlayer = React37.forwardRef(
2644
2770
  onVolumeChange: (event) => setVolume(event.currentTarget.muted ? 0 : event.currentTarget.volume)
2645
2771
  }
2646
2772
  ),
2647
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative flex w-full flex-col gap-2 bg-surface-foreground bg-linear-to-r from-primary/30 to-primary/30 px-4 pt-3 pb-4 text-surface", children: [
2648
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2649
- import_radix_ui20.Slider.Root,
2773
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "relative flex w-full flex-col gap-2 bg-surface-foreground bg-linear-to-r from-primary/30 to-primary/30 px-4 pt-3 pb-4 text-surface", children: [
2774
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
2775
+ import_radix_ui21.Slider.Root,
2650
2776
  {
2651
2777
  min: 0,
2652
2778
  max: duration || 1,
@@ -2659,31 +2785,31 @@ var VideoPlayer = React37.forwardRef(
2659
2785
  },
2660
2786
  className: "relative flex h-4 w-full touch-none items-center select-none",
2661
2787
  children: [
2662
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Range, { className: "absolute h-full bg-accent-foreground" }) }),
2663
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Thumb, { "aria-label": "Seek", className: "block size-3 rounded-full border-2 border-surface bg-surface shadow-sm" })
2788
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_radix_ui21.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_radix_ui21.Slider.Range, { className: "absolute h-full bg-accent-foreground" }) }),
2789
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_radix_ui21.Slider.Thumb, { "aria-label": "Seek", className: "block size-3 rounded-full border-2 border-surface bg-surface shadow-sm" })
2664
2790
  ]
2665
2791
  }
2666
2792
  ),
2667
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between", children: [
2668
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-4", children: [
2669
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2793
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center justify-between", children: [
2794
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-4", children: [
2795
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2670
2796
  "button",
2671
2797
  {
2672
2798
  type: "button",
2673
2799
  "aria-label": playing ? "Pause" : "Play",
2674
2800
  onClick: toggle2,
2675
2801
  className: "inline-flex size-10 items-center justify-center rounded-full bg-surface/12 text-surface transition-colors hover:bg-surface/20",
2676
- children: playing ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.Pause, { size: 16, weight: "fill", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.Play, { size: 16, weight: "fill", "aria-hidden": true })
2802
+ children: playing ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.Pause, { size: 16, weight: "fill", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.Play, { size: 16, weight: "fill", "aria-hidden": true })
2677
2803
  }
2678
2804
  ),
2679
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "text-ui-label whitespace-nowrap text-surface/80", children: [
2805
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "text-ui-label whitespace-nowrap text-surface/80", children: [
2680
2806
  formatTime(time),
2681
2807
  " / ",
2682
2808
  formatTime(duration)
2683
2809
  ] })
2684
2810
  ] }),
2685
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
2686
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2811
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2", children: [
2812
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2687
2813
  VolumeControl,
2688
2814
  {
2689
2815
  volume,
@@ -2696,42 +2822,42 @@ var VideoPlayer = React37.forwardRef(
2696
2822
  }
2697
2823
  }
2698
2824
  ),
2699
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2825
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2700
2826
  "button",
2701
2827
  {
2702
2828
  type: "button",
2703
2829
  "aria-label": "Full screen",
2704
2830
  onClick: () => void video.current?.requestFullscreen?.(),
2705
2831
  className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
2706
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.CornersOut, { size: 16, "aria-hidden": true })
2832
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.CornersOut, { size: 16, "aria-hidden": true })
2707
2833
  }
2708
2834
  ),
2709
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2835
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2710
2836
  "button",
2711
2837
  {
2712
2838
  type: "button",
2713
2839
  "aria-label": "More",
2714
2840
  onClick: onMore,
2715
2841
  className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
2716
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.DotsThree, { size: 16, "aria-hidden": true })
2842
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.DotsThree, { size: 16, "aria-hidden": true })
2717
2843
  }
2718
2844
  )
2719
2845
  ] })
2720
2846
  ] })
2721
2847
  ] })
2722
2848
  ] }),
2723
- name && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MediaInfo, { name, details, onRemove }),
2724
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "sr-only", "aria-live": "polite", children: muted ? "Muted" : "" })
2849
+ name && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MediaInfo, { name, details, onRemove }),
2850
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sr-only", "aria-live": "polite", children: muted ? "Muted" : "" })
2725
2851
  ] });
2726
2852
  }
2727
2853
  );
2728
2854
  VideoPlayer.displayName = "VideoPlayer";
2729
2855
  function VolumeControl({ volume, onVolumeChange, className }) {
2730
- const last = React37.useRef(volume || 1);
2856
+ const last = React38.useRef(volume || 1);
2731
2857
  if (volume > 0) last.current = volume;
2732
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("group/volume flex items-center", className), children: [
2733
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "w-0 overflow-hidden opacity-0 transition-all group-focus-within/volume:w-16 group-focus-within/volume:opacity-100 group-hover/volume:w-16 group-hover/volume:opacity-100", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2734
- import_radix_ui20.Slider.Root,
2858
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("group/volume flex items-center", className), children: [
2859
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "w-0 overflow-hidden opacity-0 transition-all group-focus-within/volume:w-16 group-focus-within/volume:opacity-100 group-hover/volume:w-16 group-hover/volume:opacity-100", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
2860
+ import_radix_ui21.Slider.Root,
2735
2861
  {
2736
2862
  min: 0,
2737
2863
  max: 1,
@@ -2740,32 +2866,32 @@ function VolumeControl({ volume, onVolumeChange, className }) {
2740
2866
  onValueChange: ([next]) => next !== void 0 && onVolumeChange(next),
2741
2867
  className: "relative flex h-4 w-14 touch-none items-center select-none",
2742
2868
  children: [
2743
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Range, { className: "absolute h-full bg-surface" }) }),
2744
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Slider.Thumb, { "aria-label": "Volume", className: "block size-3 rounded-full bg-surface shadow-sm" })
2869
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_radix_ui21.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_radix_ui21.Slider.Range, { className: "absolute h-full bg-surface" }) }),
2870
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_radix_ui21.Slider.Thumb, { "aria-label": "Volume", className: "block size-3 rounded-full bg-surface shadow-sm" })
2745
2871
  ]
2746
2872
  }
2747
2873
  ) }),
2748
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2874
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2749
2875
  "button",
2750
2876
  {
2751
2877
  type: "button",
2752
2878
  "aria-label": volume === 0 ? "Unmute" : "Mute",
2753
2879
  onClick: () => onVolumeChange(volume === 0 ? last.current : 0),
2754
2880
  className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
2755
- children: volume === 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.SpeakerSimpleX, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react18.SpeakerSimpleHigh, { size: 16, "aria-hidden": true })
2881
+ children: volume === 0 ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.SpeakerSimpleX, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.SpeakerSimpleHigh, { size: 16, "aria-hidden": true })
2756
2882
  }
2757
2883
  )
2758
2884
  ] });
2759
2885
  }
2760
2886
 
2761
2887
  // src/components/Question Types/OpenEndAnswer.tsx
2762
- var React38 = __toESM(require("react"), 1);
2763
- var import_jsx_runtime39 = require("react/jsx-runtime");
2764
- var OpenEndAnswer = React38.forwardRef(
2888
+ var React39 = __toESM(require("react"), 1);
2889
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2890
+ var OpenEndAnswer = React39.forwardRef(
2765
2891
  ({ value, defaultValue, onChange, maxLength = 1e3, placeholder = "Write your answer", ...props }, ref) => {
2766
- const [internal, setInternal] = React38.useState(String(defaultValue ?? ""));
2892
+ const [internal, setInternal] = React39.useState(String(defaultValue ?? ""));
2767
2893
  const text = value !== void 0 ? String(value) : internal;
2768
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2894
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2769
2895
  Textarea,
2770
2896
  {
2771
2897
  ref,
@@ -2785,10 +2911,10 @@ var OpenEndAnswer = React38.forwardRef(
2785
2911
  OpenEndAnswer.displayName = "OpenEndAnswer";
2786
2912
 
2787
2913
  // src/components/Question Types/QuestionCard.tsx
2788
- var React39 = __toESM(require("react"), 1);
2789
- var import_jsx_runtime40 = require("react/jsx-runtime");
2790
- var QuestionCard = React39.forwardRef(
2791
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2914
+ var React40 = __toESM(require("react"), 1);
2915
+ var import_jsx_runtime41 = require("react/jsx-runtime");
2916
+ var QuestionCard = React40.forwardRef(
2917
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2792
2918
  "div",
2793
2919
  {
2794
2920
  ref,
@@ -2800,43 +2926,80 @@ var QuestionCard = React39.forwardRef(
2800
2926
  QuestionCard.displayName = "QuestionCard";
2801
2927
 
2802
2928
  // src/components/Question Types/QuestionEditorCard.tsx
2803
- var React41 = __toESM(require("react"), 1);
2929
+ var React43 = __toESM(require("react"), 1);
2930
+ var import_react22 = require("@phosphor-icons/react");
2931
+
2932
+ // src/lib/keepEditingFocus.ts
2933
+ function keepEditingFocus(event) {
2934
+ const target = event.target;
2935
+ if (target.closest('button, a, input, textarea, select, label, [role="button"], [role="dialog"]')) return;
2936
+ const active = document.activeElement;
2937
+ if ((active instanceof HTMLTextAreaElement || active instanceof HTMLInputElement) && event.currentTarget.contains(active)) event.preventDefault();
2938
+ }
2939
+
2940
+ // src/components/Question Types/QuestionHeader.tsx
2941
+ var React42 = __toESM(require("react"), 1);
2942
+ var import_react21 = require("@phosphor-icons/react");
2943
+
2944
+ // src/components/Question Types/QuestionTypeIcon.tsx
2945
+ var React41 = require("react");
2804
2946
  var import_react20 = require("@phosphor-icons/react");
2947
+ var import_jsx_runtime42 = require("react/jsx-runtime");
2948
+ var icons = {
2949
+ "select-one": import_react20.RadioButton,
2950
+ "select-multiple": import_react20.CheckSquare,
2951
+ ranking: import_react20.ListNumbers,
2952
+ upload: import_react20.FileArrowUp,
2953
+ rating: import_react20.StarHalf,
2954
+ "open-end": import_react20.ChatsCircle,
2955
+ "screen-recording": import_react20.VideoCamera
2956
+ };
2957
+ function QuestionTypeIcon({ type, size = 22.5, className, ...props }) {
2958
+ const Icon = icons[type];
2959
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { size, weight: "duotone", "aria-hidden": true, className: className ?? "text-accent-foreground", ...props });
2960
+ }
2805
2961
 
2806
2962
  // src/components/Question Types/QuestionHeader.tsx
2807
- var React40 = __toESM(require("react"), 1);
2808
- var import_react19 = require("@phosphor-icons/react");
2809
- var import_jsx_runtime41 = require("react/jsx-runtime");
2963
+ var import_jsx_runtime43 = require("react/jsx-runtime");
2810
2964
  var eyebrow = "text-ui-caption uppercase text-secondary-muted-foreground";
2811
- var QuestionHeader = React40.forwardRef(
2812
- ({ className, number, title, required, error, onDismissError, editor, onTitleChange, titlePlaceholder = "Click to write the question text", titlePlaceholderTone, titleMinLength, titleRecommendedMax, titleRecommendedNote, actions, meta, maxLength = 2e3, active, showCounter = true, dragHandleProps, showDragHandle = true, ...props }, ref) => {
2813
- const [draft, setDraft] = React40.useState(null);
2965
+ var QuestionHeader = React42.forwardRef(
2966
+ ({ className, number, title, required, error, onDismissError, editor, onTitleChange, titlePlaceholder = "Click to write the question text", titlePlaceholderTone, titleMinLength, titleRecommendedMax, titleRecommendedNote, actions, meta, maxLength = 2e3, active, showCounter = true, dragHandleProps, showDragHandle = true, questionType, titleMarks, onTitleMarkApply, onTitleMarkDismiss, ...props }, ref) => {
2967
+ const [draft, setDraft] = React42.useState(null);
2814
2968
  const label = String(number).padStart(2, "0");
2815
2969
  const showError = error !== void 0 && error !== false;
2816
2970
  if (editor) {
2817
2971
  const text = typeof title === "string" ? title : "";
2818
2972
  const count = (draft ?? text).length;
2819
- const long = titleRecommendedMax !== void 0 && titleRecommendedNote != null && count > titleRecommendedMax;
2820
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
2821
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center justify-between", children: [
2822
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
2823
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
2973
+ const long = titleRecommendedMax !== void 0 && count > titleRecommendedMax;
2974
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
2975
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center justify-between", children: [
2976
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-2", children: [
2977
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
2824
2978
  "span",
2825
2979
  {
2826
2980
  "aria-label": dragHandleProps ? `Reorder question ${number}` : void 0,
2827
2981
  ...dragHandleProps,
2828
2982
  className: cn(
2829
2983
  "group/handle inline-flex h-6 items-center gap-1 rounded-sm px-2.5 text-ui-caption",
2830
- // The tag makes room for the grip on hover, and inside a QuestionEditorCard whenever the card is hovered.
2831
- showDragHandle && "hover:pl-1 group-hover/editor:pl-1 group-data-[hovered]/editor:pl-1",
2984
+ // The tag makes room for the grip on hover, and inside a QuestionEditorCard whenever the card is hovered. With a type icon the grip
2985
+ // takes the icon's place, so the tag keeps its padding and its width.
2986
+ showDragHandle && !questionType && "hover:pl-1 group-hover/editor:pl-1 group-data-[hovered]/editor:pl-1",
2832
2987
  active ? "bg-accent-soft text-accent-soft-foreground" : "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground",
2833
2988
  dragHandleProps && "cursor-grab touch-none select-none",
2834
- dragHandleProps && showDragHandle && "focus-visible:pl-1",
2989
+ dragHandleProps && showDragHandle && !questionType && "focus-visible:pl-1",
2835
2990
  dragHandleProps?.className
2836
2991
  ),
2837
2992
  children: [
2838
- showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2839
- import_react19.DotsSixVertical,
2993
+ questionType && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2994
+ QuestionTypeIcon,
2995
+ {
2996
+ type: questionType,
2997
+ size: 16,
2998
+ className: cn("shrink-0", showDragHandle && "group-hover/editor:hidden group-data-[hovered]/editor:hidden group-hover/handle:hidden group-focus-visible/handle:hidden")
2999
+ }
3000
+ ),
3001
+ showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3002
+ import_react21.DotsSixVertical,
2840
3003
  {
2841
3004
  size: 16,
2842
3005
  "aria-hidden": true,
@@ -2850,13 +3013,13 @@ var QuestionHeader = React40.forwardRef(
2850
3013
  ),
2851
3014
  meta
2852
3015
  ] }),
2853
- actions && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: cn(
3016
+ actions && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: cn(
2854
3017
  "flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100",
2855
3018
  // Inside a QuestionEditorCard, hovering or focusing anywhere on the card reveals them too.
2856
3019
  "group-focus-within/editor:opacity-100 group-hover/editor:opacity-100 group-data-[hovered]/editor:opacity-100"
2857
3020
  ), children: actions })
2858
3021
  ] }),
2859
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3022
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2860
3023
  InlineEdit,
2861
3024
  {
2862
3025
  variant: "question",
@@ -2875,11 +3038,14 @@ var QuestionHeader = React40.forwardRef(
2875
3038
  onEditingChange: (editing) => {
2876
3039
  if (!editing) setDraft(null);
2877
3040
  },
3041
+ marks: titleMarks,
3042
+ onMarkApply: onTitleMarkApply,
3043
+ onMarkDismiss: onTitleMarkDismiss,
2878
3044
  textClassName: long ? "text-body-base" : "text-heading-h4"
2879
3045
  }
2880
3046
  ),
2881
- long && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: titleRecommendedNote }),
2882
- showCounter && titleMinLength === void 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
3047
+ long && titleRecommendedNote != null && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: titleRecommendedNote }),
3048
+ showCounter && titleMinLength === void 0 && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
2883
3049
  count,
2884
3050
  "/",
2885
3051
  maxLength,
@@ -2887,16 +3053,16 @@ var QuestionHeader = React40.forwardRef(
2887
3053
  ] })
2888
3054
  ] });
2889
3055
  }
2890
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
2891
- showError && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ToastInline, { variant: "destructive", onClose: onDismissError, className: "min-h-10", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-ui-label text-destructive", children: error === true ? "This question is mandatory." : error }) }),
2892
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: eyebrow, children: [
3056
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
3057
+ showError && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ToastInline, { variant: "destructive", onClose: onDismissError, className: "min-h-10", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-ui-label text-destructive", children: error === true ? "This question is mandatory." : error }) }),
3058
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("p", { className: eyebrow, children: [
2893
3059
  "Question ",
2894
3060
  label
2895
3061
  ] }),
2896
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("h3", { className: "text-heading-h4 text-surface-foreground", children: [
3062
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("h3", { className: "text-heading-h4 text-surface-foreground", children: [
2897
3063
  title,
2898
- required && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }),
2899
- required && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "sr-only", children: " (required)" })
3064
+ required && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }),
3065
+ required && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "sr-only", children: " (required)" })
2900
3066
  ] })
2901
3067
  ] });
2902
3068
  }
@@ -2904,8 +3070,8 @@ var QuestionHeader = React40.forwardRef(
2904
3070
  QuestionHeader.displayName = "QuestionHeader";
2905
3071
 
2906
3072
  // src/components/Question Types/QuestionEditorCard.tsx
2907
- var import_jsx_runtime42 = require("react/jsx-runtime");
2908
- var QuestionEditorCard = React41.forwardRef(
3073
+ var import_jsx_runtime44 = require("react/jsx-runtime");
3074
+ var QuestionEditorCard = React43.forwardRef(
2909
3075
  ({
2910
3076
  className,
2911
3077
  number,
@@ -2932,19 +3098,27 @@ var QuestionEditorCard = React41.forwardRef(
2932
3098
  meta,
2933
3099
  dragHandleProps,
2934
3100
  showDragHandle,
3101
+ questionType,
3102
+ titleMarks,
3103
+ onTitleMarkApply,
3104
+ onTitleMarkDismiss,
2935
3105
  children,
2936
3106
  ...props
2937
3107
  }, ref) => {
2938
3108
  const footer = active && (countLabel != null || onAdd || onPaste);
2939
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
3109
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
2940
3110
  "div",
2941
3111
  {
2942
3112
  ref,
2943
3113
  className: cn("group/editor flex w-full items-start gap-2", className),
2944
3114
  "data-hovered": hovered ? "" : void 0,
2945
3115
  ...props,
3116
+ onMouseDown: (event) => {
3117
+ keepEditingFocus(event);
3118
+ props.onMouseDown?.(event);
3119
+ },
2946
3120
  children: [
2947
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
3121
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
2948
3122
  "div",
2949
3123
  {
2950
3124
  className: cn(
@@ -2952,9 +3126,9 @@ var QuestionEditorCard = React41.forwardRef(
2952
3126
  active ? "border-accent" : "border-border"
2953
3127
  ),
2954
3128
  children: [
2955
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cn("flex flex-col p-6", footer ? "gap-5" : "gap-4"), children: [
2956
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col gap-4", children: [
2957
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3129
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("flex flex-col p-6", footer ? "gap-5" : "gap-4"), children: [
3130
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-4", children: [
3131
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2958
3132
  QuestionHeader,
2959
3133
  {
2960
3134
  editor: true,
@@ -2970,10 +3144,14 @@ var QuestionEditorCard = React41.forwardRef(
2970
3144
  showCounter: !!active,
2971
3145
  dragHandleProps,
2972
3146
  showDragHandle,
3147
+ questionType,
3148
+ titleMarks,
3149
+ onTitleMarkApply,
3150
+ onTitleMarkDismiss,
2973
3151
  meta,
2974
3152
  maxLength,
2975
- actions: actions ?? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
2976
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3153
+ actions: actions ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
3154
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2977
3155
  Button,
2978
3156
  {
2979
3157
  type: "button",
@@ -2981,10 +3159,10 @@ var QuestionEditorCard = React41.forwardRef(
2981
3159
  size: "icon-sm",
2982
3160
  "aria-label": "Duplicate question",
2983
3161
  onClick: onDuplicate,
2984
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Copy, { size: 16, "aria-hidden": true })
3162
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Copy, { size: 16, "aria-hidden": true })
2985
3163
  }
2986
3164
  ),
2987
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3165
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2988
3166
  Button,
2989
3167
  {
2990
3168
  type: "button",
@@ -2992,10 +3170,10 @@ var QuestionEditorCard = React41.forwardRef(
2992
3170
  size: "icon-sm",
2993
3171
  "aria-label": "Delete question",
2994
3172
  onClick: onDelete,
2995
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Trash, { size: 16, "aria-hidden": true })
3173
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Trash, { size: 16, "aria-hidden": true })
2996
3174
  }
2997
3175
  ),
2998
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3176
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2999
3177
  Button,
3000
3178
  {
3001
3179
  type: "button",
@@ -3003,7 +3181,7 @@ var QuestionEditorCard = React41.forwardRef(
3003
3181
  size: "icon-sm",
3004
3182
  "aria-label": "Preview question",
3005
3183
  onClick: onPreview,
3006
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Eye, { size: 16, "aria-hidden": true })
3184
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Eye, { size: 16, "aria-hidden": true })
3007
3185
  }
3008
3186
  )
3009
3187
  ] })
@@ -3011,18 +3189,18 @@ var QuestionEditorCard = React41.forwardRef(
3011
3189
  ),
3012
3190
  children
3013
3191
  ] }),
3014
- error && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("p", { className: "flex items-center gap-1 text-ui-caption text-destructive-foreground", children: [
3015
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Warning, { size: 16, "aria-hidden": true, className: "shrink-0" }),
3192
+ error && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "flex items-center gap-1 text-ui-caption text-destructive-foreground", children: [
3193
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Warning, { size: 16, "aria-hidden": true, className: "shrink-0" }),
3016
3194
  error
3017
3195
  ] }),
3018
- footer && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between", children: [
3019
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: countLabel }),
3020
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-2", children: [
3021
- onAdd && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Button, { type: "button", variant: "outline", onClick: onAdd, children: [
3022
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Plus, { size: 16, "aria-hidden": true }),
3196
+ footer && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center justify-between", children: [
3197
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: countLabel }),
3198
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center gap-2", children: [
3199
+ onAdd && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Button, { type: "button", variant: "outline", onClick: onAdd, children: [
3200
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Plus, { size: 16, "aria-hidden": true }),
3023
3201
  "Add choice"
3024
3202
  ] }),
3025
- onPaste && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3203
+ onPaste && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3026
3204
  Button,
3027
3205
  {
3028
3206
  type: "button",
@@ -3030,17 +3208,17 @@ var QuestionEditorCard = React41.forwardRef(
3030
3208
  size: "icon",
3031
3209
  "aria-label": "Paste choices",
3032
3210
  onClick: onPaste,
3033
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Clipboard, { size: 16, "aria-hidden": true })
3211
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Clipboard, { size: 16, "aria-hidden": true })
3034
3212
  }
3035
3213
  )
3036
3214
  ] })
3037
3215
  ] })
3038
3216
  ] }),
3039
- note && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "border-t border-border px-2 py-2 text-body-small text-surface-foreground", children: note })
3217
+ note && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "border-t border-border px-2 py-2 text-body-small text-surface-foreground", children: note })
3040
3218
  ]
3041
3219
  }
3042
3220
  ),
3043
- onAskAi && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3221
+ onAskAi && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3044
3222
  Button,
3045
3223
  {
3046
3224
  type: "button",
@@ -3049,7 +3227,7 @@ var QuestionEditorCard = React41.forwardRef(
3049
3227
  "aria-label": "Ask AI",
3050
3228
  onClick: onAskAi,
3051
3229
  className: "shrink-0 opacity-0 transition-opacity group-hover/editor:opacity-100 group-focus-within/editor:opacity-100 group-data-[hovered]/editor:opacity-100 focus-visible:opacity-100",
3052
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Sparkle, { size: 16, "aria-hidden": true })
3230
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Sparkle, { size: 16, "aria-hidden": true })
3053
3231
  }
3054
3232
  )
3055
3233
  ]
@@ -3060,34 +3238,14 @@ var QuestionEditorCard = React41.forwardRef(
3060
3238
  QuestionEditorCard.displayName = "QuestionEditorCard";
3061
3239
 
3062
3240
  // src/components/Question Types/QuestionNavItem.tsx
3063
- var React43 = __toESM(require("react"), 1);
3064
- var import_react22 = require("@phosphor-icons/react");
3065
- var import_radix_ui21 = require("radix-ui");
3066
-
3067
- // src/components/Question Types/QuestionTypeIcon.tsx
3068
- var React42 = require("react");
3069
- var import_react21 = require("@phosphor-icons/react");
3070
- var import_jsx_runtime43 = require("react/jsx-runtime");
3071
- var icons = {
3072
- "select-one": import_react21.RadioButton,
3073
- "select-multiple": import_react21.CheckSquare,
3074
- ranking: import_react21.ListNumbers,
3075
- upload: import_react21.FileArrowUp,
3076
- rating: import_react21.StarHalf,
3077
- "open-end": import_react21.ChatsCircle,
3078
- "screen-recording": import_react21.VideoCamera
3079
- };
3080
- function QuestionTypeIcon({ type, size = 22.5, className, ...props }) {
3081
- const Icon = icons[type];
3082
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { size, weight: "duotone", "aria-hidden": true, className: className ?? "text-accent-foreground", ...props });
3083
- }
3084
-
3085
- // src/components/Question Types/QuestionNavItem.tsx
3086
- var import_jsx_runtime44 = require("react/jsx-runtime");
3087
- var QuestionNavItem = React43.forwardRef(
3241
+ var React44 = __toESM(require("react"), 1);
3242
+ var import_react23 = require("@phosphor-icons/react");
3243
+ var import_radix_ui22 = require("radix-ui");
3244
+ var import_jsx_runtime45 = require("react/jsx-runtime");
3245
+ var QuestionNavItem = React44.forwardRef(
3088
3246
  ({ className, questionType = "select-one", selected, error, asChild, showDragHandle = true, hovered, children, ...props }, ref) => {
3089
- const Comp = asChild ? import_radix_ui21.Slot.Root : "button";
3090
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
3247
+ const Comp = asChild ? import_radix_ui22.Slot.Root : "button";
3248
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
3091
3249
  Comp,
3092
3250
  {
3093
3251
  ref,
@@ -3106,9 +3264,9 @@ var QuestionNavItem = React43.forwardRef(
3106
3264
  ),
3107
3265
  ...props,
3108
3266
  children: [
3109
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
3110
- showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.DotsSixVertical, { size: 16, className: "hidden group-hover/nav:block group-data-[hovered]/nav:block" }),
3111
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: showDragHandle ? "group-hover/nav:hidden group-data-[hovered]/nav:hidden" : void 0, children: error ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Warning, { size: 16, className: "text-destructive-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3267
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
3268
+ showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsSixVertical, { size: 16, className: "hidden group-hover/nav:block group-data-[hovered]/nav:block" }),
3269
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: showDragHandle ? "group-hover/nav:hidden group-data-[hovered]/nav:hidden" : void 0, children: error ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Warning, { size: 16, className: "text-destructive-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3112
3270
  QuestionTypeIcon,
3113
3271
  {
3114
3272
  type: questionType,
@@ -3117,8 +3275,8 @@ var QuestionNavItem = React43.forwardRef(
3117
3275
  }
3118
3276
  ) })
3119
3277
  ] }),
3120
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
3121
- error && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "sr-only", children: ", has errors" })
3278
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
3279
+ error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "sr-only", children: ", has errors" })
3122
3280
  ]
3123
3281
  }
3124
3282
  );
@@ -3127,14 +3285,14 @@ var QuestionNavItem = React43.forwardRef(
3127
3285
  QuestionNavItem.displayName = "QuestionNavItem";
3128
3286
 
3129
3287
  // src/components/Question Types/QuestionOption.tsx
3130
- var React44 = __toESM(require("react"), 1);
3131
- var import_react23 = require("@phosphor-icons/react");
3132
- var import_jsx_runtime45 = require("react/jsx-runtime");
3288
+ var React45 = __toESM(require("react"), 1);
3289
+ var import_react24 = require("@phosphor-icons/react");
3290
+ var import_jsx_runtime46 = require("react/jsx-runtime");
3133
3291
  var optionClasses = "flex w-full max-w-150 cursor-pointer items-center gap-2 rounded-md border border-border bg-surface px-4 py-2 text-body-base text-surface-foreground transition-colors hover:bg-accent-soft hover:shadow-md has-[[data-state=checked]]:border-accent-foreground has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50";
3134
3292
  function QuestionOption(props) {
3135
- const id = React44.useId();
3136
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { htmlFor: id, className: cn(optionClasses, props.className), children: [
3137
- props.kind === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3293
+ const id = React45.useId();
3294
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { htmlFor: id, className: cn(optionClasses, props.className), children: [
3295
+ props.kind === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3138
3296
  Checkbox,
3139
3297
  {
3140
3298
  id,
@@ -3143,16 +3301,16 @@ function QuestionOption(props) {
3143
3301
  onCheckedChange: (next) => props.onCheckedChange?.(next === true),
3144
3302
  disabled: props.disabled
3145
3303
  }
3146
- ) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RadioGroupItem, { id, value: props.value, disabled: props.disabled }),
3147
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "min-w-0 flex-1", children: props.label })
3304
+ ) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RadioGroupItem, { id, value: props.value, disabled: props.disabled }),
3305
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "min-w-0 flex-1", children: props.label })
3148
3306
  ] });
3149
3307
  }
3150
- var QuestionOtherOption = React44.forwardRef(
3308
+ var QuestionOtherOption = React45.forwardRef(
3151
3309
  ({ className, onSubmit, confirmLabel = "Confirm answer", placeholder = "Type your answer", ...props }, ref) => {
3152
- const inner = React44.useRef(null);
3153
- React44.useImperativeHandle(ref, () => inner.current);
3310
+ const inner = React45.useRef(null);
3311
+ React45.useImperativeHandle(ref, () => inner.current);
3154
3312
  const submit = () => onSubmit?.(inner.current?.value ?? "");
3155
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
3313
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3156
3314
  "div",
3157
3315
  {
3158
3316
  className: cn(
@@ -3160,7 +3318,7 @@ var QuestionOtherOption = React44.forwardRef(
3160
3318
  className
3161
3319
  ),
3162
3320
  children: [
3163
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3321
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3164
3322
  "input",
3165
3323
  {
3166
3324
  ref: inner,
@@ -3176,7 +3334,7 @@ var QuestionOtherOption = React44.forwardRef(
3176
3334
  ...props
3177
3335
  }
3178
3336
  ),
3179
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "subtle", size: "icon-sm", "aria-label": confirmLabel, onClick: submit, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Check, { size: 16, "aria-hidden": true }) })
3337
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Button, { type: "button", variant: "subtle", size: "icon-sm", "aria-label": confirmLabel, onClick: submit, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react24.Check, { size: 16, "aria-hidden": true }) })
3180
3338
  ]
3181
3339
  }
3182
3340
  );
@@ -3188,14 +3346,16 @@ function limitsText2(min, max) {
3188
3346
  if (max !== void 0) return `Up to ${max} characters`;
3189
3347
  return "";
3190
3348
  }
3191
- function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone = "muted", minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked }) {
3349
+ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone = "muted", minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked, marks, onMarkApply, onMarkDismiss }) {
3192
3350
  const reveal = kind !== void 0;
3193
3351
  const guarded = minLength !== void 0 || maxLength !== void 0;
3194
- const [draft, setDraft] = React44.useState(null);
3195
- const [error, setError] = React44.useState(null);
3196
- const helperId = React44.useId();
3197
- const fieldRef = React44.useRef(null);
3198
- const skipBlur = React44.useRef(false);
3352
+ const [draft, setDraft] = React45.useState(null);
3353
+ const [error, setError] = React45.useState(null);
3354
+ const helperId = React45.useId();
3355
+ const [focused, setFocused] = React45.useState(false);
3356
+ const showMarks = !!marks?.length && !focused && draft === null;
3357
+ const fieldRef = React45.useRef(null);
3358
+ const skipBlur = React45.useRef(false);
3199
3359
  const problemWith = (text) => minLength !== void 0 && text.trim().length < minLength ? `Enter at least ${minLength} ${minLength === 1 ? "character" : "characters"}.` : null;
3200
3360
  const save = () => {
3201
3361
  if (draft === null) return true;
@@ -3216,9 +3376,9 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3216
3376
  ...dragHandleProps,
3217
3377
  className: cn("cursor-grab touch-none select-none", dragHandleProps.className)
3218
3378
  } : { "aria-hidden": true };
3219
- const grip = dragHandleProps ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { ...gripProps, className: cn("shrink-0", gripProps.className), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsSixVertical, { size: 20, "aria-hidden": true, className: "text-surface-foreground" }) }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsSixVertical, { size: 20, "aria-hidden": true, className: "shrink-0 text-surface-foreground" });
3220
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("group/option flex w-full items-center gap-2", className), children: [
3221
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3379
+ const grip = dragHandleProps ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { ...gripProps, className: cn("shrink-0", gripProps.className), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react24.DotsSixVertical, { size: 20, "aria-hidden": true, className: "text-surface-foreground" }) }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react24.DotsSixVertical, { size: 20, "aria-hidden": true, className: "shrink-0 text-surface-foreground" });
3380
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: cn("group/option flex w-full items-center gap-2", className), children: [
3381
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3222
3382
  "div",
3223
3383
  {
3224
3384
  className: cn(
@@ -3228,10 +3388,10 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3228
3388
  cn("border-border group-hover/option:shadow-md group-focus-within/option:shadow-md", lifted && "shadow-md")
3229
3389
  ) : "border-border hover:border-input-muted hover:shadow-md"
3230
3390
  ),
3231
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex min-w-0 items-start gap-2", children: [
3232
- (kind !== void 0 || !locked) && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex h-7 shrink-0 items-center gap-2", children: kind === "rank" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
3391
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex min-w-0 items-start gap-2", children: [
3392
+ (kind !== void 0 || !locked) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex h-7 shrink-0 items-center gap-2", children: kind === "rank" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
3233
3393
  !locked && grip,
3234
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3394
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3235
3395
  "span",
3236
3396
  {
3237
3397
  "aria-hidden": "true",
@@ -3239,8 +3399,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3239
3399
  children: rank
3240
3400
  }
3241
3401
  )
3242
- ] }) : reveal && locked ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { "aria-hidden": "true", className: "relative flex size-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: cn("inline-flex size-4 border-2 border-input bg-surface", kind === "radio" ? "rounded-full" : "rounded-xxs") }) }) : reveal ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { ...gripProps, className: cn("relative flex size-5 shrink-0 items-center justify-center", gripProps.className), children: [
3243
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3402
+ ] }) : reveal && locked ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { "aria-hidden": "true", className: "relative flex size-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: cn("inline-flex size-4 border-2 border-input bg-surface", kind === "radio" ? "rounded-full" : "rounded-xxs") }) }) : reveal ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { ...gripProps, className: cn("relative flex size-5 shrink-0 items-center justify-center", gripProps.className), children: [
3403
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3244
3404
  "span",
3245
3405
  {
3246
3406
  "aria-hidden": "true",
@@ -3251,8 +3411,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3251
3411
  )
3252
3412
  }
3253
3413
  ),
3254
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3255
- import_react23.DotsSixVertical,
3414
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3415
+ import_react24.DotsSixVertical,
3256
3416
  {
3257
3417
  size: 20,
3258
3418
  "aria-hidden": true,
@@ -3263,67 +3423,76 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3263
3423
  }
3264
3424
  )
3265
3425
  ] }) : locked ? null : grip }),
3266
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
3267
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3268
- "input",
3269
- {
3270
- ref: fieldRef,
3271
- "aria-label": "Option label",
3272
- "aria-invalid": error ? true : void 0,
3273
- "aria-describedby": guarded && draft !== null ? helperId : void 0,
3274
- placeholder,
3275
- maxLength,
3276
- value: guarded ? draft ?? label : label,
3277
- onFocus: () => {
3278
- if (guarded && draft === null) setDraft(label);
3279
- },
3280
- onChange: (event) => {
3281
- if (!guarded) return onLabelChange?.(event.target.value);
3282
- setDraft(event.target.value);
3283
- if (error) setError(problemWith(event.target.value));
3284
- },
3285
- onKeyDown: (event) => {
3286
- if (!guarded) return;
3287
- if (event.key === "Escape") {
3288
- skipBlur.current = true;
3289
- setDraft(null);
3290
- setError(null);
3291
- fieldRef.current?.blur();
3292
- } else if (event.key === "Enter") {
3293
- event.preventDefault();
3294
- if (save()) {
3426
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
3427
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "relative min-w-0", children: [
3428
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3429
+ "input",
3430
+ {
3431
+ ref: fieldRef,
3432
+ "aria-label": "Option label",
3433
+ "aria-invalid": error ? true : void 0,
3434
+ "aria-describedby": guarded && draft !== null ? helperId : void 0,
3435
+ placeholder,
3436
+ maxLength,
3437
+ value: guarded ? draft ?? label : label,
3438
+ onFocus: () => {
3439
+ setFocused(true);
3440
+ if (guarded && draft === null) setDraft(label);
3441
+ },
3442
+ onChange: (event) => {
3443
+ if (!guarded) return onLabelChange?.(event.target.value);
3444
+ setDraft(event.target.value);
3445
+ if (error) setError(problemWith(event.target.value));
3446
+ },
3447
+ onKeyDown: (event) => {
3448
+ if (!guarded) return;
3449
+ if (event.key === "Escape") {
3295
3450
  skipBlur.current = true;
3451
+ setDraft(null);
3452
+ setError(null);
3296
3453
  fieldRef.current?.blur();
3454
+ } else if (event.key === "Enter") {
3455
+ event.preventDefault();
3456
+ if (save()) {
3457
+ skipBlur.current = true;
3458
+ fieldRef.current?.blur();
3459
+ }
3297
3460
  }
3298
- }
3299
- },
3300
- onBlur: () => {
3301
- if (!guarded) return;
3302
- if (skipBlur.current) {
3303
- skipBlur.current = false;
3304
- return;
3305
- }
3306
- save();
3307
- },
3308
- className: cn(
3309
- "min-w-0 flex-1 bg-transparent text-body-base text-surface-foreground outline-none",
3310
- placeholderTone === "regular" ? "placeholder:text-surface-foreground" : "placeholder:text-muted-foreground"
3311
- )
3312
- }
3313
- ),
3314
- guarded && draft !== null && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
3461
+ },
3462
+ onBlur: () => {
3463
+ setFocused(false);
3464
+ if (!guarded) return;
3465
+ if (skipBlur.current) {
3466
+ skipBlur.current = false;
3467
+ return;
3468
+ }
3469
+ save();
3470
+ },
3471
+ className: cn(
3472
+ "w-full min-w-0 bg-transparent text-body-base text-surface-foreground outline-none",
3473
+ placeholderTone === "regular" ? "placeholder:text-surface-foreground" : "placeholder:text-muted-foreground",
3474
+ // The marked text is drawn over the field, so the field's own letters step aside until it is edited.
3475
+ showMarks && "text-transparent"
3476
+ )
3477
+ }
3478
+ ),
3479
+ showMarks && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-0 flex items-center overflow-hidden whitespace-pre text-body-base text-surface-foreground [&_[data-mark]]:pointer-events-auto", children: splitMarks(label, marks).map(
3480
+ (piece, i) => piece.mark ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(MarkedText, { mark: piece.mark, text: piece.text, onApply: onMarkApply, onDismiss: onMarkDismiss }, `${piece.mark.start}:${piece.text}`) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: piece.text }, i)
3481
+ ) })
3482
+ ] }),
3483
+ guarded && draft !== null && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3315
3484
  "p",
3316
3485
  {
3317
3486
  id: helperId,
3318
3487
  role: error ? "alert" : void 0,
3319
3488
  className: cn("flex items-start justify-between gap-2 text-ui-caption", error ? "text-destructive" : "text-secondary-muted-foreground"),
3320
3489
  children: [
3321
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "flex items-start gap-2", children: [
3322
- error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.WarningCircle, { size: 16, "aria-hidden": true, className: "shrink-0" }),
3490
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: "flex items-start gap-2", children: [
3491
+ error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react24.WarningCircle, { size: 16, "aria-hidden": true, className: "shrink-0" }),
3323
3492
  limitsText2(minLength, maxLength),
3324
- error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "sr-only", children: error })
3493
+ error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "sr-only", children: error })
3325
3494
  ] }),
3326
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
3495
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
3327
3496
  draft.length,
3328
3497
  maxLength !== void 0 && `/${maxLength}`
3329
3498
  ] })
@@ -3334,7 +3503,7 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3334
3503
  ] })
3335
3504
  }
3336
3505
  ),
3337
- !locked && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
3506
+ !locked && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3338
3507
  "div",
3339
3508
  {
3340
3509
  className: cn(
@@ -3342,8 +3511,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3342
3511
  reveal && "opacity-0 transition-opacity group-hover/option:opacity-100 group-focus-within/option:opacity-100"
3343
3512
  ),
3344
3513
  children: [
3345
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": "Remove option", disabled: removeDisabled, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Trash, { size: 16, "aria-hidden": true }) }),
3346
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "Add option", disabled: addDisabled, onClick: onAdd, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Plus, { size: 16, "aria-hidden": true }) })
3514
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": "Remove option", disabled: removeDisabled, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react24.Trash, { size: 16, "aria-hidden": true }) }),
3515
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "Add option", disabled: addDisabled, onClick: onAdd, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react24.Plus, { size: 16, "aria-hidden": true }) })
3347
3516
  ]
3348
3517
  }
3349
3518
  )
@@ -3351,9 +3520,9 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3351
3520
  }
3352
3521
 
3353
3522
  // src/components/Question Types/RankList.tsx
3354
- var React45 = __toESM(require("react"), 1);
3355
- var import_react24 = require("@phosphor-icons/react");
3356
- var import_jsx_runtime46 = require("react/jsx-runtime");
3523
+ var React46 = __toESM(require("react"), 1);
3524
+ var import_react25 = require("@phosphor-icons/react");
3525
+ var import_jsx_runtime47 = require("react/jsx-runtime");
3357
3526
  function move(list, from, to) {
3358
3527
  if (from === to || to < 0 || to >= list.length) return list;
3359
3528
  const next = list.slice();
@@ -3361,13 +3530,13 @@ function move(list, from, to) {
3361
3530
  next.splice(to, 0, item);
3362
3531
  return next;
3363
3532
  }
3364
- var RankList = React45.forwardRef(
3533
+ var RankList = React46.forwardRef(
3365
3534
  ({ className, items, onItemsChange, ...props }, ref) => {
3366
- const [dragIndex, setDragIndex] = React45.useState(null);
3367
- const [announcement, setAnnouncement] = React45.useState("");
3368
- const handles = React45.useRef(/* @__PURE__ */ new Map());
3369
- const refocus = React45.useRef(null);
3370
- React45.useEffect(() => {
3535
+ const [dragIndex, setDragIndex] = React46.useState(null);
3536
+ const [announcement, setAnnouncement] = React46.useState("");
3537
+ const handles = React46.useRef(/* @__PURE__ */ new Map());
3538
+ const refocus = React46.useRef(null);
3539
+ React46.useEffect(() => {
3371
3540
  if (refocus.current) {
3372
3541
  handles.current.get(refocus.current)?.focus();
3373
3542
  refocus.current = null;
@@ -3380,8 +3549,8 @@ var RankList = React45.forwardRef(
3380
3549
  setAnnouncement(`Moved to position ${to + 1} of ${items.length}`);
3381
3550
  onItemsChange(next);
3382
3551
  };
3383
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
3384
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("ol", { ref, className: cn("flex w-full max-w-150 flex-col gap-4", className), ...props, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3552
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
3553
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("ol", { ref, className: cn("flex w-full max-w-150 flex-col gap-4", className), ...props, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
3385
3554
  "li",
3386
3555
  {
3387
3556
  draggable: true,
@@ -3398,7 +3567,7 @@ var RankList = React45.forwardRef(
3398
3567
  dragIndex === index && "opacity-50"
3399
3568
  ),
3400
3569
  children: [
3401
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3570
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3402
3571
  "button",
3403
3572
  {
3404
3573
  type: "button",
@@ -3417,10 +3586,10 @@ var RankList = React45.forwardRef(
3417
3586
  }
3418
3587
  },
3419
3588
  className: "inline-flex shrink-0 cursor-grab rounded-xs text-surface-foreground",
3420
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react24.DotsSixVertical, { size: 16, "aria-hidden": true })
3589
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react25.DotsSixVertical, { size: 16, "aria-hidden": true })
3421
3590
  }
3422
3591
  ),
3423
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3592
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3424
3593
  "span",
3425
3594
  {
3426
3595
  "aria-hidden": "true",
@@ -3428,28 +3597,28 @@ var RankList = React45.forwardRef(
3428
3597
  children: index + 1
3429
3598
  }
3430
3599
  ),
3431
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "min-w-0 flex-1", children: item.label })
3600
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "min-w-0 flex-1", children: item.label })
3432
3601
  ]
3433
3602
  },
3434
3603
  item.id
3435
3604
  )) }),
3436
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { role: "status", "aria-live": "polite", className: "sr-only", children: announcement })
3605
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { role: "status", "aria-live": "polite", className: "sr-only", children: announcement })
3437
3606
  ] });
3438
3607
  }
3439
3608
  );
3440
3609
  RankList.displayName = "RankList";
3441
3610
 
3442
3611
  // src/components/Question Types/RatingScale.tsx
3443
- var React46 = __toESM(require("react"), 1);
3444
- var import_radix_ui22 = require("radix-ui");
3445
- var import_jsx_runtime47 = require("react/jsx-runtime");
3446
- var RatingScale = React46.forwardRef(
3612
+ var React47 = __toESM(require("react"), 1);
3613
+ var import_radix_ui23 = require("radix-ui");
3614
+ var import_jsx_runtime48 = require("react/jsx-runtime");
3615
+ var RatingScale = React47.forwardRef(
3447
3616
  ({ className, max = 5, value, defaultValue, onValueChange, lowLabel, highLabel, ...props }, ref) => {
3448
- const [internal, setInternal] = React46.useState(defaultValue);
3617
+ const [internal, setInternal] = React47.useState(defaultValue);
3449
3618
  const current = value !== void 0 ? value : internal;
3450
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn("flex w-full max-w-150 flex-col gap-2", className), children: [
3451
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3452
- import_radix_ui22.ToggleGroup.Root,
3619
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("flex w-full max-w-150 flex-col gap-2", className), children: [
3620
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3621
+ import_radix_ui23.ToggleGroup.Root,
3453
3622
  {
3454
3623
  ref,
3455
3624
  type: "single",
@@ -3461,8 +3630,8 @@ var RatingScale = React46.forwardRef(
3461
3630
  },
3462
3631
  className: "flex gap-2",
3463
3632
  ...props,
3464
- children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3465
- import_radix_ui22.ToggleGroup.Item,
3633
+ children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3634
+ import_radix_ui23.ToggleGroup.Item,
3466
3635
  {
3467
3636
  value: String(n),
3468
3637
  "aria-label": `${n}`,
@@ -3477,9 +3646,9 @@ var RatingScale = React46.forwardRef(
3477
3646
  ))
3478
3647
  }
3479
3648
  ),
3480
- (lowLabel != null || highLabel != null) && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex justify-between text-ui-caption text-secondary-muted-foreground", "aria-hidden": "true", children: [
3481
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: lowLabel }),
3482
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: highLabel })
3649
+ (lowLabel != null || highLabel != null) && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex justify-between text-ui-caption text-secondary-muted-foreground", "aria-hidden": "true", children: [
3650
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: lowLabel }),
3651
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: highLabel })
3483
3652
  ] })
3484
3653
  ] });
3485
3654
  }
@@ -3487,15 +3656,15 @@ var RatingScale = React46.forwardRef(
3487
3656
  RatingScale.displayName = "RatingScale";
3488
3657
 
3489
3658
  // src/components/Question Types/StimulusCard.tsx
3490
- var React47 = __toESM(require("react"), 1);
3491
- var import_react25 = require("@phosphor-icons/react");
3492
- var import_jsx_runtime48 = (
3659
+ var React48 = __toESM(require("react"), 1);
3660
+ var import_react26 = require("@phosphor-icons/react");
3661
+ var import_jsx_runtime49 = (
3493
3662
  // Out of flow, so the image's own size never sets the thumbnail's size.
3494
3663
  require("react/jsx-runtime")
3495
3664
  );
3496
3665
  var MIN_THUMBNAIL = 92;
3497
3666
  var MAX_THUMBNAIL = 240;
3498
- var StimulusCard = React47.forwardRef(
3667
+ var StimulusCard = React48.forwardRef(
3499
3668
  ({
3500
3669
  className,
3501
3670
  thumbnail,
@@ -3512,14 +3681,14 @@ var StimulusCard = React47.forwardRef(
3512
3681
  removeLabel = "Remove stimulus",
3513
3682
  ...props
3514
3683
  }, ref) => {
3515
- const [failedSrc, setFailedSrc] = React47.useState();
3684
+ const [failedSrc, setFailedSrc] = React48.useState();
3516
3685
  const error = status === "error" || thumbnail !== void 0 && failedSrc === thumbnail;
3517
3686
  const showImage = thumbnail !== void 0 && !error;
3518
- const [draft, setDraft] = React47.useState(null);
3687
+ const [draft, setDraft] = React48.useState(null);
3519
3688
  const count = (draft ?? caption ?? "").length;
3520
- const textRef = React47.useRef(null);
3521
- const [thumbnailSize, setThumbnailSize] = React47.useState(MIN_THUMBNAIL);
3522
- React47.useEffect(() => {
3689
+ const textRef = React48.useRef(null);
3690
+ const [thumbnailSize, setThumbnailSize] = React48.useState(MIN_THUMBNAIL);
3691
+ React48.useEffect(() => {
3523
3692
  const el = textRef.current;
3524
3693
  if (!el || typeof ResizeObserver === "undefined") return;
3525
3694
  const observer = new ResizeObserver(() => {
@@ -3528,7 +3697,7 @@ var StimulusCard = React47.forwardRef(
3528
3697
  observer.observe(el);
3529
3698
  return () => observer.disconnect();
3530
3699
  }, []);
3531
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
3700
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
3532
3701
  "div",
3533
3702
  {
3534
3703
  ref,
@@ -3536,8 +3705,8 @@ var StimulusCard = React47.forwardRef(
3536
3705
  className: cn("flex min-h-24.5 w-full items-center gap-4 rounded-md border border-border p-0.5 pr-4", className),
3537
3706
  ...props,
3538
3707
  children: [
3539
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
3540
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3708
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
3709
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3541
3710
  "span",
3542
3711
  {
3543
3712
  style: { width: thumbnailSize, height: thumbnailSize },
@@ -3546,12 +3715,12 @@ var StimulusCard = React47.forwardRef(
3546
3715
  error ? "border-destructive-soft-border bg-destructive-soft bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-destructive" : "border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground",
3547
3716
  showImage && "bg-none"
3548
3717
  ),
3549
- children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("img", { src: thumbnail, alt: thumbnailAlt, className: "absolute inset-0 size-full object-cover", onError: () => setFailedSrc(thumbnail) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react25.ImageBroken, { size: 24, "aria-hidden": true }) : icon ?? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react25.Image, { size: 24, "aria-hidden": true })
3718
+ children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("img", { src: thumbnail, alt: thumbnailAlt, className: "absolute inset-0 size-full object-cover", onError: () => setFailedSrc(thumbnail) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react26.ImageBroken, { size: 24, "aria-hidden": true }) : icon ?? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react26.Image, { size: 24, "aria-hidden": true })
3550
3719
  }
3551
3720
  ),
3552
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { ref: textRef, className: "flex min-w-0 flex-1 flex-col justify-center gap-2 py-2 text-surface-foreground", children: [
3553
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "w-full text-ui-label", children: label }),
3554
- onCaptionChange ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3721
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { ref: textRef, className: "flex min-w-0 flex-1 flex-col justify-center gap-2 py-2 text-surface-foreground", children: [
3722
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "w-full text-ui-label", children: label }),
3723
+ onCaptionChange ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3555
3724
  InlineEdit,
3556
3725
  {
3557
3726
  variant: "question",
@@ -3568,8 +3737,8 @@ var StimulusCard = React47.forwardRef(
3568
3737
  },
3569
3738
  textClassName: "text-body-base"
3570
3739
  }
3571
- ) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "w-full text-body-base [word-break:break-word]", children: caption }),
3572
- onCaptionChange && showCounter && maxLength !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
3740
+ ) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "w-full text-body-base [word-break:break-word]", children: caption }),
3741
+ onCaptionChange && showCounter && maxLength !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
3573
3742
  count,
3574
3743
  "/",
3575
3744
  maxLength,
@@ -3577,7 +3746,7 @@ var StimulusCard = React47.forwardRef(
3577
3746
  ] })
3578
3747
  ] })
3579
3748
  ] }),
3580
- onRemove && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": removeLabel, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react25.Trash, { size: 16, "aria-hidden": true }) })
3749
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": removeLabel, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react26.Trash, { size: 16, "aria-hidden": true }) })
3581
3750
  ]
3582
3751
  }
3583
3752
  );
@@ -3586,28 +3755,28 @@ var StimulusCard = React47.forwardRef(
3586
3755
  StimulusCard.displayName = "StimulusCard";
3587
3756
 
3588
3757
  // src/components/Data Display/Progress.tsx
3589
- var React48 = __toESM(require("react"), 1);
3590
- var import_radix_ui23 = require("radix-ui");
3591
- var import_jsx_runtime49 = require("react/jsx-runtime");
3592
- var Progress = React48.forwardRef(
3758
+ var React49 = __toESM(require("react"), 1);
3759
+ var import_radix_ui24 = require("radix-ui");
3760
+ var import_jsx_runtime50 = require("react/jsx-runtime");
3761
+ var Progress = React49.forwardRef(
3593
3762
  ({ className, value = 0, label, valueLabel, detailsStart, detailsEnd, ...props }, ref) => {
3594
3763
  const hasHeader = label != null || valueLabel != null;
3595
3764
  const hasDetails = detailsStart != null || detailsEnd != null;
3596
3765
  const clamped = Math.min(100, Math.max(0, value ?? 0));
3597
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
3598
- hasHeader && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center justify-between text-ui-label text-surface-foreground", children: [
3599
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: label }),
3600
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: valueLabel === true ? `${Math.round(clamped)}%` : valueLabel })
3766
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
3767
+ hasHeader && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center justify-between text-ui-label text-surface-foreground", children: [
3768
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: label }),
3769
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: valueLabel === true ? `${Math.round(clamped)}%` : valueLabel })
3601
3770
  ] }),
3602
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3603
- import_radix_ui23.Progress.Root,
3771
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3772
+ import_radix_ui24.Progress.Root,
3604
3773
  {
3605
3774
  ref,
3606
3775
  value: clamped,
3607
3776
  className: "relative h-2 w-full overflow-hidden rounded-full bg-secondary",
3608
3777
  ...props,
3609
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3610
- import_radix_ui23.Progress.Indicator,
3778
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3779
+ import_radix_ui24.Progress.Indicator,
3611
3780
  {
3612
3781
  className: "h-full rounded-full bg-accent transition-[width]",
3613
3782
  style: { width: `${clamped}%` }
@@ -3615,9 +3784,9 @@ var Progress = React48.forwardRef(
3615
3784
  )
3616
3785
  }
3617
3786
  ),
3618
- hasDetails && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground", children: [
3619
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: detailsStart }),
3620
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: detailsEnd })
3787
+ hasDetails && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground", children: [
3788
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: detailsStart }),
3789
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: detailsEnd })
3621
3790
  ] })
3622
3791
  ] });
3623
3792
  }
@@ -3625,11 +3794,11 @@ var Progress = React48.forwardRef(
3625
3794
  Progress.displayName = "Progress";
3626
3795
 
3627
3796
  // src/components/Data Display/Table.tsx
3628
- var React49 = __toESM(require("react"), 1);
3629
- var import_react26 = require("@phosphor-icons/react");
3630
- var import_jsx_runtime50 = require("react/jsx-runtime");
3631
- var Table = React49.forwardRef(
3632
- ({ className, containerClassName, striped, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: cn("relative w-full overflow-auto rounded-lg border border-border bg-surface", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3797
+ var React50 = __toESM(require("react"), 1);
3798
+ var import_react27 = require("@phosphor-icons/react");
3799
+ var import_jsx_runtime51 = require("react/jsx-runtime");
3800
+ var Table = React50.forwardRef(
3801
+ ({ className, containerClassName, striped, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: cn("relative w-full overflow-auto rounded-lg border border-border bg-surface", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3633
3802
  "table",
3634
3803
  {
3635
3804
  ref,
@@ -3640,16 +3809,16 @@ var Table = React49.forwardRef(
3640
3809
  ) })
3641
3810
  );
3642
3811
  Table.displayName = "Table";
3643
- var TableHeader = React49.forwardRef(
3644
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("thead", { ref, className, ...props })
3812
+ var TableHeader = React50.forwardRef(
3813
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("thead", { ref, className, ...props })
3645
3814
  );
3646
3815
  TableHeader.displayName = "TableHeader";
3647
- var TableBody = React49.forwardRef(
3648
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("tbody", { ref, className, ...props })
3816
+ var TableBody = React50.forwardRef(
3817
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("tbody", { ref, className, ...props })
3649
3818
  );
3650
3819
  TableBody.displayName = "TableBody";
3651
- var TableRow = React49.forwardRef(
3652
- ({ className, selected, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3820
+ var TableRow = React50.forwardRef(
3821
+ ({ className, selected, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3653
3822
  "tr",
3654
3823
  {
3655
3824
  ref,
@@ -3666,10 +3835,10 @@ var TableRow = React49.forwardRef(
3666
3835
  );
3667
3836
  TableRow.displayName = "TableRow";
3668
3837
  var ariaSort = { none: "none", asc: "ascending", desc: "descending" };
3669
- var TableHead = React49.forwardRef(
3838
+ var TableHead = React50.forwardRef(
3670
3839
  ({ className, align = "left", sortable, sort = "none", onSort, checkbox, children, ...props }, ref) => {
3671
- const caret = sort === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react26.CaretUp, { size: 16, "aria-hidden": true, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react26.CaretDown, { size: 16, "aria-hidden": true, className: "shrink-0" });
3672
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3840
+ const caret = sort === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react27.CaretUp, { size: 16, "aria-hidden": true, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react27.CaretDown, { size: 16, "aria-hidden": true, className: "shrink-0" });
3841
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3673
3842
  "th",
3674
3843
  {
3675
3844
  ref,
@@ -3682,7 +3851,7 @@ var TableHead = React49.forwardRef(
3682
3851
  className
3683
3852
  ),
3684
3853
  ...props,
3685
- children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
3854
+ children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
3686
3855
  "button",
3687
3856
  {
3688
3857
  type: "button",
@@ -3693,14 +3862,14 @@ var TableHead = React49.forwardRef(
3693
3862
  caret
3694
3863
  ]
3695
3864
  }
3696
- ) : checkbox ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex items-center justify-center", children }) : children
3865
+ ) : checkbox ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex items-center justify-center", children }) : children
3697
3866
  }
3698
3867
  );
3699
3868
  }
3700
3869
  );
3701
3870
  TableHead.displayName = "TableHead";
3702
- var TableCell = React49.forwardRef(
3703
- ({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3871
+ var TableCell = React50.forwardRef(
3872
+ ({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3704
3873
  "td",
3705
3874
  {
3706
3875
  ref,
@@ -3713,25 +3882,25 @@ var TableCell = React49.forwardRef(
3713
3882
  className
3714
3883
  ),
3715
3884
  ...props,
3716
- children: checkbox ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex items-center justify-center", children }) : actions ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex items-start justify-end gap-1", children }) : children
3885
+ children: checkbox ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex items-center justify-center", children }) : actions ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex items-start justify-end gap-1", children }) : children
3717
3886
  }
3718
3887
  )
3719
3888
  );
3720
3889
  TableCell.displayName = "TableCell";
3721
3890
  function TableCellTwoLines({ primary, secondary, avatar, className, ...props }) {
3722
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: cn("flex items-center gap-2", className), ...props, children: [
3891
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: cn("flex items-center gap-2", className), ...props, children: [
3723
3892
  avatar,
3724
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-0.5 whitespace-nowrap", children: [
3725
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-ui-label text-surface-foreground", children: primary }),
3726
- secondary && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: secondary })
3893
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col gap-0.5 whitespace-nowrap", children: [
3894
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-ui-label text-surface-foreground", children: primary }),
3895
+ secondary && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: secondary })
3727
3896
  ] })
3728
3897
  ] });
3729
3898
  }
3730
3899
 
3731
3900
  // src/components/Data Display/StatCard.tsx
3732
- var React50 = __toESM(require("react"), 1);
3901
+ var React51 = __toESM(require("react"), 1);
3733
3902
  var import_class_variance_authority6 = require("class-variance-authority");
3734
- var import_jsx_runtime51 = require("react/jsx-runtime");
3903
+ var import_jsx_runtime52 = require("react/jsx-runtime");
3735
3904
  var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 flex-col gap-2 rounded-md border p-3", {
3736
3905
  variants: {
3737
3906
  variant: {
@@ -3745,11 +3914,11 @@ var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 f
3745
3914
  },
3746
3915
  defaultVariants: { variant: "default" }
3747
3916
  });
3748
- var StatCard = React50.forwardRef(
3749
- ({ className, variant, label, value, icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
3750
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "truncate text-ui-caption text-secondary-muted-foreground", children: label }),
3751
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("p", { className: "flex items-center gap-2 text-body-base text-surface-foreground", children: [
3752
- icon && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { "aria-hidden": "true", className: "inline-flex size-6 shrink-0 items-center justify-center", children: icon }),
3917
+ var StatCard = React51.forwardRef(
3918
+ ({ className, variant, label, value, icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
3919
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "truncate text-ui-caption text-secondary-muted-foreground", children: label }),
3920
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "flex items-center gap-2 text-body-base text-surface-foreground", children: [
3921
+ icon && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { "aria-hidden": "true", className: "inline-flex size-6 shrink-0 items-center justify-center", children: icon }),
3753
3922
  value
3754
3923
  ] })
3755
3924
  ] })
@@ -3757,13 +3926,13 @@ var StatCard = React50.forwardRef(
3757
3926
  StatCard.displayName = "StatCard";
3758
3927
 
3759
3928
  // src/components/Research-Specific/ActivityStructure.tsx
3760
- var React52 = __toESM(require("react"), 1);
3929
+ var React53 = __toESM(require("react"), 1);
3761
3930
 
3762
3931
  // src/components/Tags & Badges/EditableTag.tsx
3763
- var React51 = __toESM(require("react"), 1);
3764
- var import_react27 = require("@phosphor-icons/react");
3932
+ var React52 = __toESM(require("react"), 1);
3933
+ var import_react28 = require("@phosphor-icons/react");
3765
3934
  var import_class_variance_authority7 = require("class-variance-authority");
3766
- var import_jsx_runtime52 = require("react/jsx-runtime");
3935
+ var import_jsx_runtime53 = require("react/jsx-runtime");
3767
3936
  var editableTagVariants = (0, import_class_variance_authority7.cva)(
3768
3937
  "inline-flex h-6.5 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
3769
3938
  {
@@ -3778,27 +3947,27 @@ var editableTagVariants = (0, import_class_variance_authority7.cva)(
3778
3947
  defaultVariants: { type: "default" }
3779
3948
  }
3780
3949
  );
3781
- var EditableTag = React51.forwardRef(
3950
+ var EditableTag = React52.forwardRef(
3782
3951
  ({ className, type = "default", icon, onRemove, onClick, children, ...props }, ref) => {
3783
3952
  const classes = cn(editableTagVariants({ type }), className);
3784
- const leading = type === "add" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react27.Plus, { size: 12, "aria-hidden": true }) : icon !== void 0 ? icon : type === "default" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react27.Crown, { size: 12, weight: "fill", "aria-hidden": true }) : null;
3953
+ const leading = type === "add" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react28.Plus, { size: 12, "aria-hidden": true }) : icon !== void 0 ? icon : type === "default" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react28.Crown, { size: 12, weight: "fill", "aria-hidden": true }) : null;
3785
3954
  if (type === "add" || type === "multiple" && onClick) {
3786
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("button", { ref, type: "button", className: classes, onClick, ...props, children: [
3955
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("button", { ref, type: "button", className: classes, onClick, ...props, children: [
3787
3956
  leading,
3788
3957
  children
3789
3958
  ] });
3790
3959
  }
3791
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { ref, className: classes, ...props, children: [
3960
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { ref, className: classes, ...props, children: [
3792
3961
  leading,
3793
3962
  children,
3794
- onRemove && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
3963
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
3795
3964
  "button",
3796
3965
  {
3797
3966
  type: "button",
3798
3967
  "aria-label": typeof children === "string" ? `Remove ${children}` : "Remove",
3799
3968
  onClick: onRemove,
3800
3969
  className: "inline-flex size-3 items-center justify-center rounded-xs",
3801
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react27.X, { size: 12, "aria-hidden": true })
3970
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react28.X, { size: 12, "aria-hidden": true })
3802
3971
  }
3803
3972
  )
3804
3973
  ] });
@@ -3807,26 +3976,26 @@ var EditableTag = React51.forwardRef(
3807
3976
  EditableTag.displayName = "EditableTag";
3808
3977
 
3809
3978
  // src/components/Research-Specific/ActivityStructure.tsx
3810
- var import_jsx_runtime53 = require("react/jsx-runtime");
3811
- var ActivityStructure = React52.forwardRef(
3812
- ({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
3979
+ var import_jsx_runtime54 = require("react/jsx-runtime");
3980
+ var ActivityStructure = React53.forwardRef(
3981
+ ({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
3813
3982
  "section",
3814
3983
  {
3815
3984
  ref,
3816
3985
  className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-xl bg-surface p-4", className),
3817
3986
  ...props,
3818
3987
  children: [
3819
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
3820
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h3", { className: "text-body-section text-surface-foreground", children: title }),
3988
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
3989
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h3", { className: "text-body-section text-surface-foreground", children: title }),
3821
3990
  action
3822
3991
  ] }),
3823
- stats.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "grid grid-cols-2 gap-3", children: stats.map(({ id, ...stat }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(StatCard, { ...stat }, id)) }),
3824
- sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-col gap-2", children: [
3825
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),
3826
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "text-body-base text-surface-foreground", children: body }),
3827
- (tags?.length || onAddTag) && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
3828
- tags?.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(EditableTag, { type: "editable", onRemove: onRemoveTag && (() => onRemoveTag(id, tag)), children: tag }, tag)),
3829
- onAddTag && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(EditableTag, { type: "add", onClick: () => onAddTag(id), children: addTagLabel })
3992
+ stats.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "grid grid-cols-2 gap-3", children: stats.map(({ id, ...stat }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(StatCard, { ...stat }, id)) }),
3993
+ sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col gap-2", children: [
3994
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),
3995
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "text-body-base text-surface-foreground", children: body }),
3996
+ (tags?.length || onAddTag) && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
3997
+ tags?.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(EditableTag, { type: "editable", onRemove: onRemoveTag && (() => onRemoveTag(id, tag)), children: tag }, tag)),
3998
+ onAddTag && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(EditableTag, { type: "add", onClick: () => onAddTag(id), children: addTagLabel })
3830
3999
  ] })
3831
4000
  ] }, id)),
3832
4001
  children
@@ -3837,10 +4006,10 @@ var ActivityStructure = React52.forwardRef(
3837
4006
  ActivityStructure.displayName = "ActivityStructure";
3838
4007
 
3839
4008
  // src/components/Tags & Badges/Badge.tsx
3840
- var React53 = __toESM(require("react"), 1);
3841
- var import_react28 = require("@phosphor-icons/react");
4009
+ var React54 = __toESM(require("react"), 1);
4010
+ var import_react29 = require("@phosphor-icons/react");
3842
4011
  var import_class_variance_authority8 = require("class-variance-authority");
3843
- var import_jsx_runtime54 = require("react/jsx-runtime");
4012
+ var import_jsx_runtime55 = require("react/jsx-runtime");
3844
4013
  var roleTagVariants = (0, import_class_variance_authority8.cva)(
3845
4014
  "group inline-flex h-6 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
3846
4015
  {
@@ -3866,11 +4035,11 @@ var roleTagVariants = (0, import_class_variance_authority8.cva)(
3866
4035
  defaultVariants: { type: "primary", selected: false }
3867
4036
  }
3868
4037
  );
3869
- var Badge = React53.forwardRef(
4038
+ var Badge = React54.forwardRef(
3870
4039
  ({ className, type = "primary", selected = false, onClick, children, ...props }, ref) => {
3871
4040
  const classes = cn(roleTagVariants({ type, selected: type === "interactable" ? selected : false }), className);
3872
4041
  if (type === "interactable") {
3873
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
4042
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
3874
4043
  "button",
3875
4044
  {
3876
4045
  ref,
@@ -3880,15 +4049,15 @@ var Badge = React53.forwardRef(
3880
4049
  onClick,
3881
4050
  ...props,
3882
4051
  children: [
3883
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react28.DotsSixVertical, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover:block" }),
4052
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react29.DotsSixVertical, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover:block" }),
3884
4053
  children
3885
4054
  ]
3886
4055
  }
3887
4056
  );
3888
4057
  }
3889
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { ref, className: classes, ...props, children: [
3890
- type === "question" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react28.RadioButton, { size: 16, weight: "fill", "aria-hidden": true }),
3891
- type === "id" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-secondary-muted-foreground", children: "ID" }),
4058
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { ref, className: classes, ...props, children: [
4059
+ type === "question" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react29.RadioButton, { size: 16, weight: "fill", "aria-hidden": true }),
4060
+ type === "id" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-secondary-muted-foreground", children: "ID" }),
3892
4061
  children
3893
4062
  ] });
3894
4063
  }
@@ -3896,9 +4065,9 @@ var Badge = React53.forwardRef(
3896
4065
  Badge.displayName = "Badge";
3897
4066
 
3898
4067
  // src/components/Utility/Pagination.tsx
3899
- var React54 = __toESM(require("react"), 1);
3900
- var import_react29 = require("@phosphor-icons/react");
3901
- var import_jsx_runtime55 = require("react/jsx-runtime");
4068
+ var React55 = __toESM(require("react"), 1);
4069
+ var import_react30 = require("@phosphor-icons/react");
4070
+ var import_jsx_runtime56 = require("react/jsx-runtime");
3902
4071
  function getPaginationItems(page, pageCount, siblings = 1) {
3903
4072
  const keep = /* @__PURE__ */ new Set([1, pageCount]);
3904
4073
  for (let p = page - siblings; p <= page + siblings; p++) if (p >= 1 && p <= pageCount) keep.add(p);
@@ -3912,10 +4081,10 @@ function getPaginationItems(page, pageCount, siblings = 1) {
3912
4081
  });
3913
4082
  return items;
3914
4083
  }
3915
- var Pagination = React54.forwardRef(
4084
+ var Pagination = React55.forwardRef(
3916
4085
  ({ className, page, pageCount, onPageChange, variant = "full", siblings = 1, ...props }, ref) => {
3917
4086
  const go = (next2) => onPageChange(Math.min(pageCount, Math.max(1, next2)));
3918
- const previous = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4087
+ const previous = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
3919
4088
  Button,
3920
4089
  {
3921
4090
  type: "button",
@@ -3924,10 +4093,10 @@ var Pagination = React54.forwardRef(
3924
4093
  "aria-label": "Previous page",
3925
4094
  disabled: page <= 1,
3926
4095
  onClick: () => go(page - 1),
3927
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react29.ArrowLeft, { size: 16, "aria-hidden": true })
4096
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react30.ArrowLeft, { size: 16, "aria-hidden": true })
3928
4097
  }
3929
4098
  );
3930
- const next = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4099
+ const next = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
3931
4100
  Button,
3932
4101
  {
3933
4102
  type: "button",
@@ -3936,10 +4105,10 @@ var Pagination = React54.forwardRef(
3936
4105
  "aria-label": "Next page",
3937
4106
  disabled: page >= pageCount,
3938
4107
  onClick: () => go(page + 1),
3939
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react29.ArrowRight, { size: 16, "aria-hidden": true })
4108
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react30.ArrowRight, { size: 16, "aria-hidden": true })
3940
4109
  }
3941
4110
  );
3942
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
4111
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
3943
4112
  "nav",
3944
4113
  {
3945
4114
  ref,
@@ -3948,14 +4117,14 @@ var Pagination = React54.forwardRef(
3948
4117
  ...props,
3949
4118
  children: [
3950
4119
  previous,
3951
- variant === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "text-body-small text-surface-foreground", "aria-live": "polite", children: [
4120
+ variant === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "text-body-small text-surface-foreground", "aria-live": "polite", children: [
3952
4121
  page,
3953
4122
  "/",
3954
4123
  pageCount
3955
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("ul", { className: "flex items-center gap-2", children: getPaginationItems(page, pageCount, siblings).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("li", { children: item === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "inline-flex size-8 items-center justify-center rounded-sm border border-border bg-surface text-surface-foreground", children: [
3956
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react29.DotsThree, { size: 16, "aria-hidden": true }),
3957
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: "More pages" })
3958
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4124
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("ul", { className: "flex items-center gap-2", children: getPaginationItems(page, pageCount, siblings).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("li", { children: item === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "inline-flex size-8 items-center justify-center rounded-sm border border-border bg-surface text-surface-foreground", children: [
4125
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react30.DotsThree, { size: 16, "aria-hidden": true }),
4126
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "sr-only", children: "More pages" })
4127
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
3959
4128
  Button,
3960
4129
  {
3961
4130
  type: "button",