@discuss-ds/ui 0.30.1 → 0.32.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,22 +2460,28 @@ 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(
2339
- ({ className, variant = "info", actions, onClose, closeLabel = "Close", children, ...props }, ref) => {
2463
+ var ToastAction = import_radix_ui18.Toast.Action;
2464
+ var ToastInline = React34.forwardRef(
2465
+ ({ className, variant = "info", actions, actionsPlacement = "end", onClose, closeLabel = "Close", children, ...props }, ref) => {
2340
2466
  const v = variant ?? "info";
2341
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2467
+ const below = actionsPlacement === "bottom" && !!actions;
2468
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
2342
2469
  "div",
2343
2470
  {
2344
2471
  ref,
2345
2472
  role: v === "destructive" ? "alert" : "status",
2346
- className: cn("flex items-center gap-2 rounded-sm px-2 py-1.5", inlineVariants({ variant: v }), className),
2473
+ className: cn("flex gap-2 rounded-sm px-2 py-1.5", below ? "items-start" : "items-center", inlineVariants({ variant: v }), className),
2347
2474
  ...props,
2348
2475
  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 }) })
2476
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: cn("inline-flex shrink-0", below && "mt-0.5"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(VariantIcon, { variant: v === "neutral" ? "info" : v, size: 16 }) }),
2477
+ below ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
2478
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-body-small text-secondary-muted-foreground", children }),
2479
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center gap-2", children: actions })
2480
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2481
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
2482
+ actions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
2483
+ ] }),
2484
+ 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
2485
  ]
2354
2486
  }
2355
2487
  );
@@ -2358,17 +2490,17 @@ var ToastInline = React33.forwardRef(
2358
2490
  ToastInline.displayName = "ToastInline";
2359
2491
 
2360
2492
  // 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(
2493
+ var React35 = __toESM(require("react"), 1);
2494
+ var import_radix_ui19 = require("radix-ui");
2495
+ var import_jsx_runtime36 = require("react/jsx-runtime");
2496
+ var TooltipProvider = import_radix_ui19.Tooltip.Provider;
2497
+ var Tooltip = import_radix_ui19.Tooltip.Root;
2498
+ var TooltipTrigger = import_radix_ui19.Tooltip.Trigger;
2499
+ var TooltipContent = React35.forwardRef(
2368
2500
  ({ className, sideOffset = 4, title, description, action, arrow = true, children, ...props }, ref) => {
2369
2501
  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,
2502
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_radix_ui19.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
2503
+ import_radix_ui19.Tooltip.Content,
2372
2504
  {
2373
2505
  ref,
2374
2506
  sideOffset,
@@ -2381,12 +2513,12 @@ var TooltipContent = React34.forwardRef(
2381
2513
  ),
2382
2514
  ...props,
2383
2515
  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 })
2516
+ detailed ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
2517
+ title != null && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs leading-4 font-semibold text-label", children: title }),
2518
+ description != null && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs leading-4.5 text-plum-200", children: description }),
2519
+ action != null && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mt-1 text-ui-caption text-plum-300 underline *:underline", children: action })
2388
2520
  ] }) : children,
2389
- arrow && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_radix_ui18.Tooltip.Arrow, { width: 12, height: 8, className: "fill-primary-soft-foreground" })
2521
+ arrow && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_radix_ui19.Tooltip.Arrow, { width: 12, height: 8, className: "fill-primary-soft-foreground" })
2390
2522
  ]
2391
2523
  }
2392
2524
  ) });
@@ -2395,14 +2527,14 @@ var TooltipContent = React34.forwardRef(
2395
2527
  TooltipContent.displayName = "TooltipContent";
2396
2528
 
2397
2529
  // 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");
2530
+ var React37 = __toESM(require("react"), 1);
2531
+ var import_react18 = require("@phosphor-icons/react");
2532
+ var import_radix_ui20 = require("radix-ui");
2401
2533
 
2402
2534
  // src/components/Tags & Badges/Tag.tsx
2403
- var React35 = __toESM(require("react"), 1);
2535
+ var React36 = __toESM(require("react"), 1);
2404
2536
  var import_class_variance_authority5 = require("class-variance-authority");
2405
- var import_jsx_runtime36 = require("react/jsx-runtime");
2537
+ var import_jsx_runtime37 = require("react/jsx-runtime");
2406
2538
  var tagVariants = (0, import_class_variance_authority5.cva)(
2407
2539
  "inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border px-2.5 py-1 text-ui-caption",
2408
2540
  {
@@ -2418,7 +2550,7 @@ var tagVariants = (0, import_class_variance_authority5.cva)(
2418
2550
  defaultVariants: { variant: "neutral" }
2419
2551
  }
2420
2552
  );
2421
- var Tag = React35.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { ref, className: cn(tagVariants({ variant }), className), ...props }));
2553
+ var Tag = React36.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { ref, className: cn(tagVariants({ variant }), className), ...props }));
2422
2554
  Tag.displayName = "Tag";
2423
2555
  var statusDotVariants = (0, import_class_variance_authority5.cva)("size-1.5 shrink-0 rounded-full", {
2424
2556
  variants: {
@@ -2431,20 +2563,20 @@ var statusDotVariants = (0, import_class_variance_authority5.cva)("size-1.5 shri
2431
2563
  },
2432
2564
  defaultVariants: { status: "active" }
2433
2565
  });
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" }),
2566
+ var StatusTag = React36.forwardRef(
2567
+ ({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { ref, className: cn(tagVariants({ variant: "default" }), className), ...props, children: [
2568
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: statusDotVariants({ status }), "aria-hidden": "true" }),
2437
2569
  children
2438
2570
  ] })
2439
2571
  );
2440
2572
  StatusTag.displayName = "StatusTag";
2441
2573
 
2442
2574
  // src/components/Question Types/FileUpload.tsx
2443
- var import_jsx_runtime37 = require("react/jsx-runtime");
2444
- var FileUploadZone = React36.forwardRef(
2575
+ var import_jsx_runtime38 = require("react/jsx-runtime");
2576
+ var FileUploadZone = React37.forwardRef(
2445
2577
  ({ className, title = "Upload document", hint, icon, onFiles, ...props }, ref) => {
2446
- const [over, setOver] = React36.useState(false);
2447
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
2578
+ const [over, setOver] = React37.useState(false);
2579
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2448
2580
  "label",
2449
2581
  {
2450
2582
  className: cn(
@@ -2464,12 +2596,12 @@ var FileUploadZone = React36.forwardRef(
2464
2596
  onFiles?.(Array.from(event.dataTransfer.files));
2465
2597
  },
2466
2598
  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 })
2599
+ /* @__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 }) }),
2600
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex flex-col gap-1", children: [
2601
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-body-small text-surface-foreground", children: title }),
2602
+ hint && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: hint })
2471
2603
  ] }),
2472
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2604
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2473
2605
  "input",
2474
2606
  {
2475
2607
  ref,
@@ -2485,47 +2617,47 @@ var FileUploadZone = React36.forwardRef(
2485
2617
  }
2486
2618
  );
2487
2619
  FileUploadZone.displayName = "FileUploadZone";
2488
- var FileUploadItem = React36.forwardRef(
2620
+ var FileUploadItem = React37.forwardRef(
2489
2621
  ({ className, name, size, status = "uploading", progress = 0, timeLeft, icon, onRemove, removeLabel, ...props }, ref) => {
2490
2622
  const uploading = status === "uploading";
2491
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
2623
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2492
2624
  "div",
2493
2625
  {
2494
2626
  ref,
2495
2627
  className: cn("flex w-full flex-col justify-center gap-2 overflow-hidden rounded-sm border border-border p-2", className),
2496
2628
  ...props,
2497
2629
  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 }) })
2630
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
2631
+ /* @__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 }) }),
2632
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
2633
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
2634
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "min-w-0 truncate text-ui-label text-surface-foreground", children: name }),
2635
+ 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
2636
  ] }),
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: [
2637
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between text-ui-caption text-secondary-muted-foreground", children: [
2638
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex items-center gap-2", children: [
2507
2639
  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" }),
2640
+ status === "complete" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tag, { variant: "success", children: "Complete" }),
2641
+ status === "error" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tag, { variant: "destructive", children: "Error" }),
2642
+ uploading && timeLeft && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
2643
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
2512
2644
  timeLeft
2513
2645
  ] })
2514
2646
  ] }),
2515
- uploading && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-body-xxs font-normal", children: [
2647
+ uploading && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "text-body-xxs font-normal", children: [
2516
2648
  Math.round(progress),
2517
2649
  "%"
2518
2650
  ] })
2519
2651
  ] })
2520
2652
  ] })
2521
2653
  ] }),
2522
- uploading && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2523
- import_radix_ui19.Progress.Root,
2654
+ uploading && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2655
+ import_radix_ui20.Progress.Root,
2524
2656
  {
2525
2657
  value: progress,
2526
2658
  "aria-label": `Uploading ${name}`,
2527
2659
  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}%` } })
2660
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_radix_ui20.Progress.Indicator, { className: "h-full bg-accent transition-[width]", style: { width: `${progress}%` } })
2529
2661
  }
2530
2662
  )
2531
2663
  ]
@@ -2536,25 +2668,25 @@ var FileUploadItem = React36.forwardRef(
2536
2668
  FileUploadItem.displayName = "FileUploadItem";
2537
2669
 
2538
2670
  // 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");
2671
+ var React38 = __toESM(require("react"), 1);
2672
+ var import_react19 = require("@phosphor-icons/react");
2673
+ var import_radix_ui21 = require("radix-ui");
2674
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2543
2675
  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" }),
2676
+ 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: [
2677
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
2678
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: cn("truncate text-surface-foreground", large ? "text-body-section" : "text-ui-label"), children: name }),
2679
+ 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: [
2680
+ index > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
2549
2681
  part
2550
2682
  ] }, part)) })
2551
2683
  ] }),
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 }) })
2684
+ 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
2685
  ] });
2554
2686
  }
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)(
2687
+ var ImagePreview = React38.forwardRef(
2688
+ ({ 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: [
2689
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2558
2690
  "div",
2559
2691
  {
2560
2692
  className: cn(
@@ -2565,13 +2697,13 @@ var ImagePreview = React37.forwardRef(
2565
2697
  children
2566
2698
  }
2567
2699
  ),
2568
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MediaInfo, { name, details, onRemove, large: true })
2700
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MediaInfo, { name, details, onRemove, large: true })
2569
2701
  ] })
2570
2702
  );
2571
2703
  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,
2704
+ var ImageThumbnails = React38.forwardRef(
2705
+ ({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2706
+ import_radix_ui21.ToggleGroup.Root,
2575
2707
  {
2576
2708
  ref,
2577
2709
  type: "single",
@@ -2582,18 +2714,18 @@ var ImageThumbnails = React37.forwardRef(
2582
2714
  children: Array.from({ length: max }, (_, index) => {
2583
2715
  const image = images[index];
2584
2716
  if (!image) {
2585
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2717
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2586
2718
  "span",
2587
2719
  {
2588
2720
  "aria-hidden": "true",
2589
2721
  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 })
2722
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.Image, { size: 24 })
2591
2723
  },
2592
2724
  `empty-${index}`
2593
2725
  );
2594
2726
  }
2595
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2596
- import_radix_ui20.ToggleGroup.Item,
2727
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2728
+ import_radix_ui21.ToggleGroup.Item,
2597
2729
  {
2598
2730
  value: image.id,
2599
2731
  "aria-label": image.alt,
@@ -2602,7 +2734,7 @@ var ImageThumbnails = React37.forwardRef(
2602
2734
  "hover:bg-accent-soft hover:bg-none",
2603
2735
  "data-[state=on]:border-accent-foreground data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-foreground"
2604
2736
  ),
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 })
2737
+ 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
2738
  },
2607
2739
  image.id
2608
2740
  );
@@ -2615,13 +2747,13 @@ var formatTime = (seconds) => {
2615
2747
  const total = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));
2616
2748
  return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
2617
2749
  };
2618
- var VideoPlayer = React37.forwardRef(
2750
+ var VideoPlayer = React38.forwardRef(
2619
2751
  ({ 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);
2752
+ const video = React38.useRef(null);
2753
+ const [playing, setPlaying] = React38.useState(false);
2754
+ const [time, setTime] = React38.useState(initialTime);
2755
+ const [duration, setDuration] = React38.useState(initialDuration);
2756
+ const [volume, setVolume] = React38.useState(1);
2625
2757
  const muted = volume === 0;
2626
2758
  const toggle2 = () => {
2627
2759
  const el = video.current;
@@ -2629,9 +2761,9 @@ var VideoPlayer = React37.forwardRef(
2629
2761
  if (el.paused) void el.play();
2630
2762
  else el.pause();
2631
2763
  };
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)(
2764
+ 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: [
2765
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "relative flex h-60.5 w-full items-end bg-accent-soft", children: [
2766
+ src && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2635
2767
  "video",
2636
2768
  {
2637
2769
  ref: video,
@@ -2644,9 +2776,9 @@ var VideoPlayer = React37.forwardRef(
2644
2776
  onVolumeChange: (event) => setVolume(event.currentTarget.muted ? 0 : event.currentTarget.volume)
2645
2777
  }
2646
2778
  ),
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,
2779
+ /* @__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: [
2780
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
2781
+ import_radix_ui21.Slider.Root,
2650
2782
  {
2651
2783
  min: 0,
2652
2784
  max: duration || 1,
@@ -2659,31 +2791,31 @@ var VideoPlayer = React37.forwardRef(
2659
2791
  },
2660
2792
  className: "relative flex h-4 w-full touch-none items-center select-none",
2661
2793
  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" })
2794
+ /* @__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" }) }),
2795
+ /* @__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
2796
  ]
2665
2797
  }
2666
2798
  ),
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)(
2799
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center justify-between", children: [
2800
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-4", children: [
2801
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2670
2802
  "button",
2671
2803
  {
2672
2804
  type: "button",
2673
2805
  "aria-label": playing ? "Pause" : "Play",
2674
2806
  onClick: toggle2,
2675
2807
  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 })
2808
+ 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
2809
  }
2678
2810
  ),
2679
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "text-ui-label whitespace-nowrap text-surface/80", children: [
2811
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "text-ui-label whitespace-nowrap text-surface/80", children: [
2680
2812
  formatTime(time),
2681
2813
  " / ",
2682
2814
  formatTime(duration)
2683
2815
  ] })
2684
2816
  ] }),
2685
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
2686
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2817
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2", children: [
2818
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2687
2819
  VolumeControl,
2688
2820
  {
2689
2821
  volume,
@@ -2696,42 +2828,42 @@ var VideoPlayer = React37.forwardRef(
2696
2828
  }
2697
2829
  }
2698
2830
  ),
2699
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2831
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2700
2832
  "button",
2701
2833
  {
2702
2834
  type: "button",
2703
2835
  "aria-label": "Full screen",
2704
2836
  onClick: () => void video.current?.requestFullscreen?.(),
2705
2837
  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 })
2838
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.CornersOut, { size: 16, "aria-hidden": true })
2707
2839
  }
2708
2840
  ),
2709
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2841
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2710
2842
  "button",
2711
2843
  {
2712
2844
  type: "button",
2713
2845
  "aria-label": "More",
2714
2846
  onClick: onMore,
2715
2847
  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 })
2848
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react19.DotsThree, { size: 16, "aria-hidden": true })
2717
2849
  }
2718
2850
  )
2719
2851
  ] })
2720
2852
  ] })
2721
2853
  ] })
2722
2854
  ] }),
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" : "" })
2855
+ name && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MediaInfo, { name, details, onRemove }),
2856
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sr-only", "aria-live": "polite", children: muted ? "Muted" : "" })
2725
2857
  ] });
2726
2858
  }
2727
2859
  );
2728
2860
  VideoPlayer.displayName = "VideoPlayer";
2729
2861
  function VolumeControl({ volume, onVolumeChange, className }) {
2730
- const last = React37.useRef(volume || 1);
2862
+ const last = React38.useRef(volume || 1);
2731
2863
  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,
2864
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("group/volume flex items-center", className), children: [
2865
+ /* @__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)(
2866
+ import_radix_ui21.Slider.Root,
2735
2867
  {
2736
2868
  min: 0,
2737
2869
  max: 1,
@@ -2740,32 +2872,32 @@ function VolumeControl({ volume, onVolumeChange, className }) {
2740
2872
  onValueChange: ([next]) => next !== void 0 && onVolumeChange(next),
2741
2873
  className: "relative flex h-4 w-14 touch-none items-center select-none",
2742
2874
  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" })
2875
+ /* @__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" }) }),
2876
+ /* @__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
2877
  ]
2746
2878
  }
2747
2879
  ) }),
2748
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2880
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2749
2881
  "button",
2750
2882
  {
2751
2883
  type: "button",
2752
2884
  "aria-label": volume === 0 ? "Unmute" : "Mute",
2753
2885
  onClick: () => onVolumeChange(volume === 0 ? last.current : 0),
2754
2886
  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 })
2887
+ 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
2888
  }
2757
2889
  )
2758
2890
  ] });
2759
2891
  }
2760
2892
 
2761
2893
  // 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(
2894
+ var React39 = __toESM(require("react"), 1);
2895
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2896
+ var OpenEndAnswer = React39.forwardRef(
2765
2897
  ({ value, defaultValue, onChange, maxLength = 1e3, placeholder = "Write your answer", ...props }, ref) => {
2766
- const [internal, setInternal] = React38.useState(String(defaultValue ?? ""));
2898
+ const [internal, setInternal] = React39.useState(String(defaultValue ?? ""));
2767
2899
  const text = value !== void 0 ? String(value) : internal;
2768
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2900
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2769
2901
  Textarea,
2770
2902
  {
2771
2903
  ref,
@@ -2785,10 +2917,10 @@ var OpenEndAnswer = React38.forwardRef(
2785
2917
  OpenEndAnswer.displayName = "OpenEndAnswer";
2786
2918
 
2787
2919
  // 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)(
2920
+ var React40 = __toESM(require("react"), 1);
2921
+ var import_jsx_runtime41 = require("react/jsx-runtime");
2922
+ var QuestionCard = React40.forwardRef(
2923
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2792
2924
  "div",
2793
2925
  {
2794
2926
  ref,
@@ -2800,43 +2932,83 @@ var QuestionCard = React39.forwardRef(
2800
2932
  QuestionCard.displayName = "QuestionCard";
2801
2933
 
2802
2934
  // src/components/Question Types/QuestionEditorCard.tsx
2803
- var React41 = __toESM(require("react"), 1);
2935
+ var React43 = __toESM(require("react"), 1);
2936
+ var import_react22 = require("@phosphor-icons/react");
2937
+
2938
+ // src/lib/keepEditingFocus.ts
2939
+ function keepEditingFocus(event) {
2940
+ const target = event.target;
2941
+ if (target.closest('button, a, input, textarea, select, label, [role="button"], [role="dialog"]')) return;
2942
+ const active = document.activeElement;
2943
+ if ((active instanceof HTMLTextAreaElement || active instanceof HTMLInputElement) && event.currentTarget.contains(active)) event.preventDefault();
2944
+ }
2945
+
2946
+ // src/components/Question Types/QuestionHeader.tsx
2947
+ var React42 = __toESM(require("react"), 1);
2948
+ var import_react21 = require("@phosphor-icons/react");
2949
+
2950
+ // src/components/Question Types/QuestionTypeIcon.tsx
2951
+ var React41 = require("react");
2804
2952
  var import_react20 = require("@phosphor-icons/react");
2953
+ var import_jsx_runtime42 = require("react/jsx-runtime");
2954
+ var icons = {
2955
+ "select-one": import_react20.RadioButton,
2956
+ "select-multiple": import_react20.CheckSquare,
2957
+ ranking: import_react20.ListNumbers,
2958
+ upload: import_react20.FileArrowUp,
2959
+ "upload-video": import_react20.VideoCamera,
2960
+ "upload-photo": import_react20.Image,
2961
+ "upload-document": import_react20.FileText,
2962
+ rating: import_react20.StarHalf,
2963
+ "open-end": import_react20.ChatsCircle,
2964
+ "screen-recording": import_react20.VideoCamera
2965
+ };
2966
+ function QuestionTypeIcon({ type, size = 22.5, className, ...props }) {
2967
+ const Icon = icons[type];
2968
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { size, weight: "duotone", "aria-hidden": true, className: className ?? "text-accent-foreground", ...props });
2969
+ }
2805
2970
 
2806
2971
  // 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");
2972
+ var import_jsx_runtime43 = require("react/jsx-runtime");
2810
2973
  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);
2974
+ var QuestionHeader = React42.forwardRef(
2975
+ ({ 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) => {
2976
+ const [draft, setDraft] = React42.useState(null);
2814
2977
  const label = String(number).padStart(2, "0");
2815
2978
  const showError = error !== void 0 && error !== false;
2816
2979
  if (editor) {
2817
2980
  const text = typeof title === "string" ? title : "";
2818
2981
  const count = (draft ?? text).length;
2819
2982
  const long = titleRecommendedMax !== void 0 && 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)(
2983
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
2984
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center justify-between", children: [
2985
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-2", children: [
2986
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
2824
2987
  "span",
2825
2988
  {
2826
2989
  "aria-label": dragHandleProps ? `Reorder question ${number}` : void 0,
2827
2990
  ...dragHandleProps,
2828
2991
  className: cn(
2829
2992
  "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",
2993
+ // The tag makes room for the grip on hover, and inside a QuestionEditorCard whenever the card is hovered. With a type icon the grip
2994
+ // takes the icon's place, so the tag keeps its padding and its width.
2995
+ showDragHandle && !questionType && "hover:pl-1 group-hover/editor:pl-1 group-data-[hovered]/editor:pl-1",
2832
2996
  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
2997
  dragHandleProps && "cursor-grab touch-none select-none",
2834
- dragHandleProps && showDragHandle && "focus-visible:pl-1",
2998
+ dragHandleProps && showDragHandle && !questionType && "focus-visible:pl-1",
2835
2999
  dragHandleProps?.className
2836
3000
  ),
2837
3001
  children: [
2838
- showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2839
- import_react19.DotsSixVertical,
3002
+ questionType && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3003
+ QuestionTypeIcon,
3004
+ {
3005
+ type: questionType,
3006
+ size: 16,
3007
+ className: cn("shrink-0", showDragHandle && "group-hover/editor:hidden group-data-[hovered]/editor:hidden group-hover/handle:hidden group-focus-visible/handle:hidden")
3008
+ }
3009
+ ),
3010
+ showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3011
+ import_react21.DotsSixVertical,
2840
3012
  {
2841
3013
  size: 16,
2842
3014
  "aria-hidden": true,
@@ -2850,13 +3022,13 @@ var QuestionHeader = React40.forwardRef(
2850
3022
  ),
2851
3023
  meta
2852
3024
  ] }),
2853
- actions && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: cn(
3025
+ actions && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: cn(
2854
3026
  "flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100",
2855
3027
  // Inside a QuestionEditorCard, hovering or focusing anywhere on the card reveals them too.
2856
3028
  "group-focus-within/editor:opacity-100 group-hover/editor:opacity-100 group-data-[hovered]/editor:opacity-100"
2857
3029
  ), children: actions })
2858
3030
  ] }),
2859
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3031
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2860
3032
  InlineEdit,
2861
3033
  {
2862
3034
  variant: "question",
@@ -2875,11 +3047,14 @@ var QuestionHeader = React40.forwardRef(
2875
3047
  onEditingChange: (editing) => {
2876
3048
  if (!editing) setDraft(null);
2877
3049
  },
3050
+ marks: titleMarks,
3051
+ onMarkApply: onTitleMarkApply,
3052
+ onMarkDismiss: onTitleMarkDismiss,
2878
3053
  textClassName: long ? "text-body-base" : "text-heading-h4"
2879
3054
  }
2880
3055
  ),
2881
- long && titleRecommendedNote != null && /* @__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: [
3056
+ long && titleRecommendedNote != null && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: titleRecommendedNote }),
3057
+ showCounter && titleMinLength === void 0 && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
2883
3058
  count,
2884
3059
  "/",
2885
3060
  maxLength,
@@ -2887,16 +3062,16 @@ var QuestionHeader = React40.forwardRef(
2887
3062
  ] })
2888
3063
  ] });
2889
3064
  }
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: [
3065
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
3066
+ 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 }) }),
3067
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("p", { className: eyebrow, children: [
2893
3068
  "Question ",
2894
3069
  label
2895
3070
  ] }),
2896
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("h3", { className: "text-heading-h4 text-surface-foreground", children: [
3071
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("h3", { className: "text-heading-h4 text-surface-foreground", children: [
2897
3072
  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)" })
3073
+ required && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }),
3074
+ required && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "sr-only", children: " (required)" })
2900
3075
  ] })
2901
3076
  ] });
2902
3077
  }
@@ -2904,8 +3079,8 @@ var QuestionHeader = React40.forwardRef(
2904
3079
  QuestionHeader.displayName = "QuestionHeader";
2905
3080
 
2906
3081
  // src/components/Question Types/QuestionEditorCard.tsx
2907
- var import_jsx_runtime42 = require("react/jsx-runtime");
2908
- var QuestionEditorCard = React41.forwardRef(
3082
+ var import_jsx_runtime44 = require("react/jsx-runtime");
3083
+ var QuestionEditorCard = React43.forwardRef(
2909
3084
  ({
2910
3085
  className,
2911
3086
  number,
@@ -2932,19 +3107,27 @@ var QuestionEditorCard = React41.forwardRef(
2932
3107
  meta,
2933
3108
  dragHandleProps,
2934
3109
  showDragHandle,
3110
+ questionType,
3111
+ titleMarks,
3112
+ onTitleMarkApply,
3113
+ onTitleMarkDismiss,
2935
3114
  children,
2936
3115
  ...props
2937
3116
  }, ref) => {
2938
3117
  const footer = active && (countLabel != null || onAdd || onPaste);
2939
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
3118
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
2940
3119
  "div",
2941
3120
  {
2942
3121
  ref,
2943
3122
  className: cn("group/editor flex w-full items-start gap-2", className),
2944
3123
  "data-hovered": hovered ? "" : void 0,
2945
3124
  ...props,
3125
+ onMouseDown: (event) => {
3126
+ keepEditingFocus(event);
3127
+ props.onMouseDown?.(event);
3128
+ },
2946
3129
  children: [
2947
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
3130
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
2948
3131
  "div",
2949
3132
  {
2950
3133
  className: cn(
@@ -2952,9 +3135,9 @@ var QuestionEditorCard = React41.forwardRef(
2952
3135
  active ? "border-accent" : "border-border"
2953
3136
  ),
2954
3137
  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)(
3138
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("flex flex-col p-6", footer ? "gap-5" : "gap-4"), children: [
3139
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-4", children: [
3140
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2958
3141
  QuestionHeader,
2959
3142
  {
2960
3143
  editor: true,
@@ -2970,10 +3153,14 @@ var QuestionEditorCard = React41.forwardRef(
2970
3153
  showCounter: !!active,
2971
3154
  dragHandleProps,
2972
3155
  showDragHandle,
3156
+ questionType,
3157
+ titleMarks,
3158
+ onTitleMarkApply,
3159
+ onTitleMarkDismiss,
2973
3160
  meta,
2974
3161
  maxLength,
2975
- actions: actions ?? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
2976
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3162
+ actions: actions ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
3163
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2977
3164
  Button,
2978
3165
  {
2979
3166
  type: "button",
@@ -2981,10 +3168,10 @@ var QuestionEditorCard = React41.forwardRef(
2981
3168
  size: "icon-sm",
2982
3169
  "aria-label": "Duplicate question",
2983
3170
  onClick: onDuplicate,
2984
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Copy, { size: 16, "aria-hidden": true })
3171
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Copy, { size: 16, "aria-hidden": true })
2985
3172
  }
2986
3173
  ),
2987
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3174
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2988
3175
  Button,
2989
3176
  {
2990
3177
  type: "button",
@@ -2992,10 +3179,10 @@ var QuestionEditorCard = React41.forwardRef(
2992
3179
  size: "icon-sm",
2993
3180
  "aria-label": "Delete question",
2994
3181
  onClick: onDelete,
2995
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Trash, { size: 16, "aria-hidden": true })
3182
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Trash, { size: 16, "aria-hidden": true })
2996
3183
  }
2997
3184
  ),
2998
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3185
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2999
3186
  Button,
3000
3187
  {
3001
3188
  type: "button",
@@ -3003,7 +3190,7 @@ var QuestionEditorCard = React41.forwardRef(
3003
3190
  size: "icon-sm",
3004
3191
  "aria-label": "Preview question",
3005
3192
  onClick: onPreview,
3006
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Eye, { size: 16, "aria-hidden": true })
3193
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Eye, { size: 16, "aria-hidden": true })
3007
3194
  }
3008
3195
  )
3009
3196
  ] })
@@ -3011,18 +3198,18 @@ var QuestionEditorCard = React41.forwardRef(
3011
3198
  ),
3012
3199
  children
3013
3200
  ] }),
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" }),
3201
+ error && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "flex items-center gap-1 text-ui-caption text-destructive-foreground", children: [
3202
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Warning, { size: 16, "aria-hidden": true, className: "shrink-0" }),
3016
3203
  error
3017
3204
  ] }),
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 }),
3205
+ footer && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center justify-between", children: [
3206
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: countLabel }),
3207
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center gap-2", children: [
3208
+ onAdd && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Button, { type: "button", variant: "outline", onClick: onAdd, children: [
3209
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Plus, { size: 16, "aria-hidden": true }),
3023
3210
  "Add choice"
3024
3211
  ] }),
3025
- onPaste && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3212
+ onPaste && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3026
3213
  Button,
3027
3214
  {
3028
3215
  type: "button",
@@ -3030,17 +3217,17 @@ var QuestionEditorCard = React41.forwardRef(
3030
3217
  size: "icon",
3031
3218
  "aria-label": "Paste choices",
3032
3219
  onClick: onPaste,
3033
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Clipboard, { size: 16, "aria-hidden": true })
3220
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Clipboard, { size: 16, "aria-hidden": true })
3034
3221
  }
3035
3222
  )
3036
3223
  ] })
3037
3224
  ] })
3038
3225
  ] }),
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 })
3226
+ 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
3227
  ]
3041
3228
  }
3042
3229
  ),
3043
- onAskAi && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3230
+ onAskAi && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3044
3231
  Button,
3045
3232
  {
3046
3233
  type: "button",
@@ -3049,7 +3236,7 @@ var QuestionEditorCard = React41.forwardRef(
3049
3236
  "aria-label": "Ask AI",
3050
3237
  onClick: onAskAi,
3051
3238
  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 })
3239
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Sparkle, { size: 16, "aria-hidden": true })
3053
3240
  }
3054
3241
  )
3055
3242
  ]
@@ -3060,34 +3247,14 @@ var QuestionEditorCard = React41.forwardRef(
3060
3247
  QuestionEditorCard.displayName = "QuestionEditorCard";
3061
3248
 
3062
3249
  // 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(
3250
+ var React44 = __toESM(require("react"), 1);
3251
+ var import_react23 = require("@phosphor-icons/react");
3252
+ var import_radix_ui22 = require("radix-ui");
3253
+ var import_jsx_runtime45 = require("react/jsx-runtime");
3254
+ var QuestionNavItem = React44.forwardRef(
3088
3255
  ({ 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)(
3256
+ const Comp = asChild ? import_radix_ui22.Slot.Root : "button";
3257
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
3091
3258
  Comp,
3092
3259
  {
3093
3260
  ref,
@@ -3106,9 +3273,9 @@ var QuestionNavItem = React43.forwardRef(
3106
3273
  ),
3107
3274
  ...props,
3108
3275
  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)(
3276
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
3277
+ showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsSixVertical, { size: 16, className: "hidden group-hover/nav:block group-data-[hovered]/nav:block" }),
3278
+ /* @__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
3279
  QuestionTypeIcon,
3113
3280
  {
3114
3281
  type: questionType,
@@ -3117,8 +3284,8 @@ var QuestionNavItem = React43.forwardRef(
3117
3284
  }
3118
3285
  ) })
3119
3286
  ] }),
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" })
3287
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
3288
+ error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "sr-only", children: ", has errors" })
3122
3289
  ]
3123
3290
  }
3124
3291
  );
@@ -3127,14 +3294,14 @@ var QuestionNavItem = React43.forwardRef(
3127
3294
  QuestionNavItem.displayName = "QuestionNavItem";
3128
3295
 
3129
3296
  // 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");
3297
+ var React45 = __toESM(require("react"), 1);
3298
+ var import_react24 = require("@phosphor-icons/react");
3299
+ var import_jsx_runtime46 = require("react/jsx-runtime");
3133
3300
  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
3301
  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)(
3302
+ const id = React45.useId();
3303
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { htmlFor: id, className: cn(optionClasses, props.className), children: [
3304
+ props.kind === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3138
3305
  Checkbox,
3139
3306
  {
3140
3307
  id,
@@ -3143,16 +3310,16 @@ function QuestionOption(props) {
3143
3310
  onCheckedChange: (next) => props.onCheckedChange?.(next === true),
3144
3311
  disabled: props.disabled
3145
3312
  }
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 })
3313
+ ) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RadioGroupItem, { id, value: props.value, disabled: props.disabled }),
3314
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "min-w-0 flex-1", children: props.label })
3148
3315
  ] });
3149
3316
  }
3150
- var QuestionOtherOption = React44.forwardRef(
3317
+ var QuestionOtherOption = React45.forwardRef(
3151
3318
  ({ className, onSubmit, confirmLabel = "Confirm answer", placeholder = "Type your answer", ...props }, ref) => {
3152
- const inner = React44.useRef(null);
3153
- React44.useImperativeHandle(ref, () => inner.current);
3319
+ const inner = React45.useRef(null);
3320
+ React45.useImperativeHandle(ref, () => inner.current);
3154
3321
  const submit = () => onSubmit?.(inner.current?.value ?? "");
3155
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
3322
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3156
3323
  "div",
3157
3324
  {
3158
3325
  className: cn(
@@ -3160,7 +3327,7 @@ var QuestionOtherOption = React44.forwardRef(
3160
3327
  className
3161
3328
  ),
3162
3329
  children: [
3163
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3330
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3164
3331
  "input",
3165
3332
  {
3166
3333
  ref: inner,
@@ -3176,7 +3343,7 @@ var QuestionOtherOption = React44.forwardRef(
3176
3343
  ...props
3177
3344
  }
3178
3345
  ),
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 }) })
3346
+ /* @__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
3347
  ]
3181
3348
  }
3182
3349
  );
@@ -3188,14 +3355,16 @@ function limitsText2(min, max) {
3188
3355
  if (max !== void 0) return `Up to ${max} characters`;
3189
3356
  return "";
3190
3357
  }
3191
- function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone = "muted", minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked }) {
3358
+ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone = "muted", minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked, marks, onMarkApply, onMarkDismiss }) {
3192
3359
  const reveal = kind !== void 0;
3193
3360
  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);
3361
+ const [draft, setDraft] = React45.useState(null);
3362
+ const [error, setError] = React45.useState(null);
3363
+ const helperId = React45.useId();
3364
+ const [focused, setFocused] = React45.useState(false);
3365
+ const showMarks = !!marks?.length && !focused && draft === null;
3366
+ const fieldRef = React45.useRef(null);
3367
+ const skipBlur = React45.useRef(false);
3199
3368
  const problemWith = (text) => minLength !== void 0 && text.trim().length < minLength ? `Enter at least ${minLength} ${minLength === 1 ? "character" : "characters"}.` : null;
3200
3369
  const save = () => {
3201
3370
  if (draft === null) return true;
@@ -3216,9 +3385,9 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3216
3385
  ...dragHandleProps,
3217
3386
  className: cn("cursor-grab touch-none select-none", dragHandleProps.className)
3218
3387
  } : { "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)(
3388
+ 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" });
3389
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: cn("group/option flex w-full items-center gap-2", className), children: [
3390
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3222
3391
  "div",
3223
3392
  {
3224
3393
  className: cn(
@@ -3228,10 +3397,10 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3228
3397
  cn("border-border group-hover/option:shadow-md group-focus-within/option:shadow-md", lifted && "shadow-md")
3229
3398
  ) : "border-border hover:border-input-muted hover:shadow-md"
3230
3399
  ),
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: [
3400
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex min-w-0 items-start gap-2", children: [
3401
+ (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
3402
  !locked && grip,
3234
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3403
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3235
3404
  "span",
3236
3405
  {
3237
3406
  "aria-hidden": "true",
@@ -3239,8 +3408,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3239
3408
  children: rank
3240
3409
  }
3241
3410
  )
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)(
3411
+ ] }) : 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: [
3412
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3244
3413
  "span",
3245
3414
  {
3246
3415
  "aria-hidden": "true",
@@ -3251,8 +3420,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3251
3420
  )
3252
3421
  }
3253
3422
  ),
3254
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3255
- import_react23.DotsSixVertical,
3423
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3424
+ import_react24.DotsSixVertical,
3256
3425
  {
3257
3426
  size: 20,
3258
3427
  "aria-hidden": true,
@@ -3263,67 +3432,76 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3263
3432
  }
3264
3433
  )
3265
3434
  ] }) : 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()) {
3435
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
3436
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "relative min-w-0", children: [
3437
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3438
+ "input",
3439
+ {
3440
+ ref: fieldRef,
3441
+ "aria-label": "Option label",
3442
+ "aria-invalid": error ? true : void 0,
3443
+ "aria-describedby": guarded && draft !== null ? helperId : void 0,
3444
+ placeholder,
3445
+ maxLength,
3446
+ value: guarded ? draft ?? label : label,
3447
+ onFocus: () => {
3448
+ setFocused(true);
3449
+ if (guarded && draft === null) setDraft(label);
3450
+ },
3451
+ onChange: (event) => {
3452
+ if (!guarded) return onLabelChange?.(event.target.value);
3453
+ setDraft(event.target.value);
3454
+ if (error) setError(problemWith(event.target.value));
3455
+ },
3456
+ onKeyDown: (event) => {
3457
+ if (!guarded) return;
3458
+ if (event.key === "Escape") {
3295
3459
  skipBlur.current = true;
3460
+ setDraft(null);
3461
+ setError(null);
3296
3462
  fieldRef.current?.blur();
3463
+ } else if (event.key === "Enter") {
3464
+ event.preventDefault();
3465
+ if (save()) {
3466
+ skipBlur.current = true;
3467
+ fieldRef.current?.blur();
3468
+ }
3297
3469
  }
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)(
3470
+ },
3471
+ onBlur: () => {
3472
+ setFocused(false);
3473
+ if (!guarded) return;
3474
+ if (skipBlur.current) {
3475
+ skipBlur.current = false;
3476
+ return;
3477
+ }
3478
+ save();
3479
+ },
3480
+ className: cn(
3481
+ "w-full min-w-0 bg-transparent text-body-base text-surface-foreground outline-none",
3482
+ placeholderTone === "regular" ? "placeholder:text-surface-foreground" : "placeholder:text-muted-foreground",
3483
+ // The marked text is drawn over the field, so the field's own letters step aside until it is edited.
3484
+ showMarks && "text-transparent"
3485
+ )
3486
+ }
3487
+ ),
3488
+ 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(
3489
+ (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)
3490
+ ) })
3491
+ ] }),
3492
+ guarded && draft !== null && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3315
3493
  "p",
3316
3494
  {
3317
3495
  id: helperId,
3318
3496
  role: error ? "alert" : void 0,
3319
3497
  className: cn("flex items-start justify-between gap-2 text-ui-caption", error ? "text-destructive" : "text-secondary-muted-foreground"),
3320
3498
  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" }),
3499
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: "flex items-start gap-2", children: [
3500
+ error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react24.WarningCircle, { size: 16, "aria-hidden": true, className: "shrink-0" }),
3323
3501
  limitsText2(minLength, maxLength),
3324
- error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "sr-only", children: error })
3502
+ error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "sr-only", children: error })
3325
3503
  ] }),
3326
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
3504
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { "aria-hidden": true, className: "shrink-0 tabular-nums", children: [
3327
3505
  draft.length,
3328
3506
  maxLength !== void 0 && `/${maxLength}`
3329
3507
  ] })
@@ -3334,7 +3512,7 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3334
3512
  ] })
3335
3513
  }
3336
3514
  ),
3337
- !locked && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
3515
+ !locked && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3338
3516
  "div",
3339
3517
  {
3340
3518
  className: cn(
@@ -3342,8 +3520,8 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3342
3520
  reveal && "opacity-0 transition-opacity group-hover/option:opacity-100 group-focus-within/option:opacity-100"
3343
3521
  ),
3344
3522
  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 }) })
3523
+ /* @__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 }) }),
3524
+ /* @__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
3525
  ]
3348
3526
  }
3349
3527
  )
@@ -3351,9 +3529,9 @@ function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTo
3351
3529
  }
3352
3530
 
3353
3531
  // 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");
3532
+ var React46 = __toESM(require("react"), 1);
3533
+ var import_react25 = require("@phosphor-icons/react");
3534
+ var import_jsx_runtime47 = require("react/jsx-runtime");
3357
3535
  function move(list, from, to) {
3358
3536
  if (from === to || to < 0 || to >= list.length) return list;
3359
3537
  const next = list.slice();
@@ -3361,13 +3539,13 @@ function move(list, from, to) {
3361
3539
  next.splice(to, 0, item);
3362
3540
  return next;
3363
3541
  }
3364
- var RankList = React45.forwardRef(
3542
+ var RankList = React46.forwardRef(
3365
3543
  ({ 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(() => {
3544
+ const [dragIndex, setDragIndex] = React46.useState(null);
3545
+ const [announcement, setAnnouncement] = React46.useState("");
3546
+ const handles = React46.useRef(/* @__PURE__ */ new Map());
3547
+ const refocus = React46.useRef(null);
3548
+ React46.useEffect(() => {
3371
3549
  if (refocus.current) {
3372
3550
  handles.current.get(refocus.current)?.focus();
3373
3551
  refocus.current = null;
@@ -3380,8 +3558,8 @@ var RankList = React45.forwardRef(
3380
3558
  setAnnouncement(`Moved to position ${to + 1} of ${items.length}`);
3381
3559
  onItemsChange(next);
3382
3560
  };
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)(
3561
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
3562
+ /* @__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
3563
  "li",
3386
3564
  {
3387
3565
  draggable: true,
@@ -3398,7 +3576,7 @@ var RankList = React45.forwardRef(
3398
3576
  dragIndex === index && "opacity-50"
3399
3577
  ),
3400
3578
  children: [
3401
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3579
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3402
3580
  "button",
3403
3581
  {
3404
3582
  type: "button",
@@ -3417,10 +3595,10 @@ var RankList = React45.forwardRef(
3417
3595
  }
3418
3596
  },
3419
3597
  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 })
3598
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react25.DotsSixVertical, { size: 16, "aria-hidden": true })
3421
3599
  }
3422
3600
  ),
3423
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3601
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3424
3602
  "span",
3425
3603
  {
3426
3604
  "aria-hidden": "true",
@@ -3428,28 +3606,28 @@ var RankList = React45.forwardRef(
3428
3606
  children: index + 1
3429
3607
  }
3430
3608
  ),
3431
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "min-w-0 flex-1", children: item.label })
3609
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "min-w-0 flex-1", children: item.label })
3432
3610
  ]
3433
3611
  },
3434
3612
  item.id
3435
3613
  )) }),
3436
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { role: "status", "aria-live": "polite", className: "sr-only", children: announcement })
3614
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { role: "status", "aria-live": "polite", className: "sr-only", children: announcement })
3437
3615
  ] });
3438
3616
  }
3439
3617
  );
3440
3618
  RankList.displayName = "RankList";
3441
3619
 
3442
3620
  // 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(
3621
+ var React47 = __toESM(require("react"), 1);
3622
+ var import_radix_ui23 = require("radix-ui");
3623
+ var import_jsx_runtime48 = require("react/jsx-runtime");
3624
+ var RatingScale = React47.forwardRef(
3447
3625
  ({ className, max = 5, value, defaultValue, onValueChange, lowLabel, highLabel, ...props }, ref) => {
3448
- const [internal, setInternal] = React46.useState(defaultValue);
3626
+ const [internal, setInternal] = React47.useState(defaultValue);
3449
3627
  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,
3628
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("flex w-full max-w-150 flex-col gap-2", className), children: [
3629
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3630
+ import_radix_ui23.ToggleGroup.Root,
3453
3631
  {
3454
3632
  ref,
3455
3633
  type: "single",
@@ -3461,8 +3639,8 @@ var RatingScale = React46.forwardRef(
3461
3639
  },
3462
3640
  className: "flex gap-2",
3463
3641
  ...props,
3464
- children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3465
- import_radix_ui22.ToggleGroup.Item,
3642
+ children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3643
+ import_radix_ui23.ToggleGroup.Item,
3466
3644
  {
3467
3645
  value: String(n),
3468
3646
  "aria-label": `${n}`,
@@ -3477,9 +3655,9 @@ var RatingScale = React46.forwardRef(
3477
3655
  ))
3478
3656
  }
3479
3657
  ),
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 })
3658
+ (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: [
3659
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: lowLabel }),
3660
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: highLabel })
3483
3661
  ] })
3484
3662
  ] });
3485
3663
  }
@@ -3487,15 +3665,15 @@ var RatingScale = React46.forwardRef(
3487
3665
  RatingScale.displayName = "RatingScale";
3488
3666
 
3489
3667
  // 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 = (
3668
+ var React48 = __toESM(require("react"), 1);
3669
+ var import_react26 = require("@phosphor-icons/react");
3670
+ var import_jsx_runtime49 = (
3493
3671
  // Out of flow, so the image's own size never sets the thumbnail's size.
3494
3672
  require("react/jsx-runtime")
3495
3673
  );
3496
3674
  var MIN_THUMBNAIL = 92;
3497
3675
  var MAX_THUMBNAIL = 240;
3498
- var StimulusCard = React47.forwardRef(
3676
+ var StimulusCard = React48.forwardRef(
3499
3677
  ({
3500
3678
  className,
3501
3679
  thumbnail,
@@ -3512,14 +3690,14 @@ var StimulusCard = React47.forwardRef(
3512
3690
  removeLabel = "Remove stimulus",
3513
3691
  ...props
3514
3692
  }, ref) => {
3515
- const [failedSrc, setFailedSrc] = React47.useState();
3693
+ const [failedSrc, setFailedSrc] = React48.useState();
3516
3694
  const error = status === "error" || thumbnail !== void 0 && failedSrc === thumbnail;
3517
3695
  const showImage = thumbnail !== void 0 && !error;
3518
- const [draft, setDraft] = React47.useState(null);
3696
+ const [draft, setDraft] = React48.useState(null);
3519
3697
  const count = (draft ?? caption ?? "").length;
3520
- const textRef = React47.useRef(null);
3521
- const [thumbnailSize, setThumbnailSize] = React47.useState(MIN_THUMBNAIL);
3522
- React47.useEffect(() => {
3698
+ const textRef = React48.useRef(null);
3699
+ const [thumbnailSize, setThumbnailSize] = React48.useState(MIN_THUMBNAIL);
3700
+ React48.useEffect(() => {
3523
3701
  const el = textRef.current;
3524
3702
  if (!el || typeof ResizeObserver === "undefined") return;
3525
3703
  const observer = new ResizeObserver(() => {
@@ -3528,7 +3706,7 @@ var StimulusCard = React47.forwardRef(
3528
3706
  observer.observe(el);
3529
3707
  return () => observer.disconnect();
3530
3708
  }, []);
3531
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
3709
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
3532
3710
  "div",
3533
3711
  {
3534
3712
  ref,
@@ -3536,8 +3714,8 @@ var StimulusCard = React47.forwardRef(
3536
3714
  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
3715
  ...props,
3538
3716
  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)(
3717
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
3718
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3541
3719
  "span",
3542
3720
  {
3543
3721
  style: { width: thumbnailSize, height: thumbnailSize },
@@ -3546,12 +3724,12 @@ var StimulusCard = React47.forwardRef(
3546
3724
  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
3725
  showImage && "bg-none"
3548
3726
  ),
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 })
3727
+ 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
3728
  }
3551
3729
  ),
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)(
3730
+ /* @__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: [
3731
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "w-full text-ui-label", children: label }),
3732
+ onCaptionChange ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3555
3733
  InlineEdit,
3556
3734
  {
3557
3735
  variant: "question",
@@ -3568,8 +3746,8 @@ var StimulusCard = React47.forwardRef(
3568
3746
  },
3569
3747
  textClassName: "text-body-base"
3570
3748
  }
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: [
3749
+ ) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "w-full text-body-base [word-break:break-word]", children: caption }),
3750
+ onCaptionChange && showCounter && maxLength !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
3573
3751
  count,
3574
3752
  "/",
3575
3753
  maxLength,
@@ -3577,7 +3755,7 @@ var StimulusCard = React47.forwardRef(
3577
3755
  ] })
3578
3756
  ] })
3579
3757
  ] }),
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 }) })
3758
+ 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
3759
  ]
3582
3760
  }
3583
3761
  );
@@ -3586,28 +3764,28 @@ var StimulusCard = React47.forwardRef(
3586
3764
  StimulusCard.displayName = "StimulusCard";
3587
3765
 
3588
3766
  // 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(
3767
+ var React49 = __toESM(require("react"), 1);
3768
+ var import_radix_ui24 = require("radix-ui");
3769
+ var import_jsx_runtime50 = require("react/jsx-runtime");
3770
+ var Progress = React49.forwardRef(
3593
3771
  ({ className, value = 0, label, valueLabel, detailsStart, detailsEnd, ...props }, ref) => {
3594
3772
  const hasHeader = label != null || valueLabel != null;
3595
3773
  const hasDetails = detailsStart != null || detailsEnd != null;
3596
3774
  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 })
3775
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
3776
+ hasHeader && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center justify-between text-ui-label text-surface-foreground", children: [
3777
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: label }),
3778
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: valueLabel === true ? `${Math.round(clamped)}%` : valueLabel })
3601
3779
  ] }),
3602
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3603
- import_radix_ui23.Progress.Root,
3780
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3781
+ import_radix_ui24.Progress.Root,
3604
3782
  {
3605
3783
  ref,
3606
3784
  value: clamped,
3607
3785
  className: "relative h-2 w-full overflow-hidden rounded-full bg-secondary",
3608
3786
  ...props,
3609
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3610
- import_radix_ui23.Progress.Indicator,
3787
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3788
+ import_radix_ui24.Progress.Indicator,
3611
3789
  {
3612
3790
  className: "h-full rounded-full bg-accent transition-[width]",
3613
3791
  style: { width: `${clamped}%` }
@@ -3615,9 +3793,9 @@ var Progress = React48.forwardRef(
3615
3793
  )
3616
3794
  }
3617
3795
  ),
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 })
3796
+ hasDetails && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground", children: [
3797
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: detailsStart }),
3798
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: detailsEnd })
3621
3799
  ] })
3622
3800
  ] });
3623
3801
  }
@@ -3625,11 +3803,11 @@ var Progress = React48.forwardRef(
3625
3803
  Progress.displayName = "Progress";
3626
3804
 
3627
3805
  // 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)(
3806
+ var React50 = __toESM(require("react"), 1);
3807
+ var import_react27 = require("@phosphor-icons/react");
3808
+ var import_jsx_runtime51 = require("react/jsx-runtime");
3809
+ var Table = React50.forwardRef(
3810
+ ({ 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
3811
  "table",
3634
3812
  {
3635
3813
  ref,
@@ -3640,16 +3818,16 @@ var Table = React49.forwardRef(
3640
3818
  ) })
3641
3819
  );
3642
3820
  Table.displayName = "Table";
3643
- var TableHeader = React49.forwardRef(
3644
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("thead", { ref, className, ...props })
3821
+ var TableHeader = React50.forwardRef(
3822
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("thead", { ref, className, ...props })
3645
3823
  );
3646
3824
  TableHeader.displayName = "TableHeader";
3647
- var TableBody = React49.forwardRef(
3648
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("tbody", { ref, className, ...props })
3825
+ var TableBody = React50.forwardRef(
3826
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("tbody", { ref, className, ...props })
3649
3827
  );
3650
3828
  TableBody.displayName = "TableBody";
3651
- var TableRow = React49.forwardRef(
3652
- ({ className, selected, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3829
+ var TableRow = React50.forwardRef(
3830
+ ({ className, selected, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3653
3831
  "tr",
3654
3832
  {
3655
3833
  ref,
@@ -3666,10 +3844,10 @@ var TableRow = React49.forwardRef(
3666
3844
  );
3667
3845
  TableRow.displayName = "TableRow";
3668
3846
  var ariaSort = { none: "none", asc: "ascending", desc: "descending" };
3669
- var TableHead = React49.forwardRef(
3847
+ var TableHead = React50.forwardRef(
3670
3848
  ({ 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)(
3849
+ 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" });
3850
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3673
3851
  "th",
3674
3852
  {
3675
3853
  ref,
@@ -3682,7 +3860,7 @@ var TableHead = React49.forwardRef(
3682
3860
  className
3683
3861
  ),
3684
3862
  ...props,
3685
- children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
3863
+ children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
3686
3864
  "button",
3687
3865
  {
3688
3866
  type: "button",
@@ -3693,14 +3871,14 @@ var TableHead = React49.forwardRef(
3693
3871
  caret
3694
3872
  ]
3695
3873
  }
3696
- ) : checkbox ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex items-center justify-center", children }) : children
3874
+ ) : checkbox ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex items-center justify-center", children }) : children
3697
3875
  }
3698
3876
  );
3699
3877
  }
3700
3878
  );
3701
3879
  TableHead.displayName = "TableHead";
3702
- var TableCell = React49.forwardRef(
3703
- ({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3880
+ var TableCell = React50.forwardRef(
3881
+ ({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3704
3882
  "td",
3705
3883
  {
3706
3884
  ref,
@@ -3713,25 +3891,25 @@ var TableCell = React49.forwardRef(
3713
3891
  className
3714
3892
  ),
3715
3893
  ...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
3894
+ 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
3895
  }
3718
3896
  )
3719
3897
  );
3720
3898
  TableCell.displayName = "TableCell";
3721
3899
  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: [
3900
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: cn("flex items-center gap-2", className), ...props, children: [
3723
3901
  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 })
3902
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col gap-0.5 whitespace-nowrap", children: [
3903
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-ui-label text-surface-foreground", children: primary }),
3904
+ secondary && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: secondary })
3727
3905
  ] })
3728
3906
  ] });
3729
3907
  }
3730
3908
 
3731
3909
  // src/components/Data Display/StatCard.tsx
3732
- var React50 = __toESM(require("react"), 1);
3910
+ var React51 = __toESM(require("react"), 1);
3733
3911
  var import_class_variance_authority6 = require("class-variance-authority");
3734
- var import_jsx_runtime51 = require("react/jsx-runtime");
3912
+ var import_jsx_runtime52 = require("react/jsx-runtime");
3735
3913
  var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 flex-col gap-2 rounded-md border p-3", {
3736
3914
  variants: {
3737
3915
  variant: {
@@ -3745,25 +3923,26 @@ var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 f
3745
3923
  },
3746
3924
  defaultVariants: { variant: "default" }
3747
3925
  });
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 }),
3926
+ var StatCard = React51.forwardRef(
3927
+ ({ className, variant, label, value, icon, caption, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
3928
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "truncate text-ui-caption text-secondary-muted-foreground", children: label }),
3929
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "flex items-center gap-2 text-body-base text-surface-foreground", children: [
3930
+ 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
3931
  value
3754
- ] })
3932
+ ] }),
3933
+ caption && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: caption })
3755
3934
  ] })
3756
3935
  );
3757
3936
  StatCard.displayName = "StatCard";
3758
3937
 
3759
3938
  // src/components/Research-Specific/ActivityStructure.tsx
3760
- var React52 = __toESM(require("react"), 1);
3939
+ var React53 = __toESM(require("react"), 1);
3761
3940
 
3762
3941
  // src/components/Tags & Badges/EditableTag.tsx
3763
- var React51 = __toESM(require("react"), 1);
3764
- var import_react27 = require("@phosphor-icons/react");
3942
+ var React52 = __toESM(require("react"), 1);
3943
+ var import_react28 = require("@phosphor-icons/react");
3765
3944
  var import_class_variance_authority7 = require("class-variance-authority");
3766
- var import_jsx_runtime52 = require("react/jsx-runtime");
3945
+ var import_jsx_runtime53 = require("react/jsx-runtime");
3767
3946
  var editableTagVariants = (0, import_class_variance_authority7.cva)(
3768
3947
  "inline-flex h-6.5 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
3769
3948
  {
@@ -3778,27 +3957,27 @@ var editableTagVariants = (0, import_class_variance_authority7.cva)(
3778
3957
  defaultVariants: { type: "default" }
3779
3958
  }
3780
3959
  );
3781
- var EditableTag = React51.forwardRef(
3960
+ var EditableTag = React52.forwardRef(
3782
3961
  ({ className, type = "default", icon, onRemove, onClick, children, ...props }, ref) => {
3783
3962
  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;
3963
+ 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
3964
  if (type === "add" || type === "multiple" && onClick) {
3786
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("button", { ref, type: "button", className: classes, onClick, ...props, children: [
3965
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("button", { ref, type: "button", className: classes, onClick, ...props, children: [
3787
3966
  leading,
3788
3967
  children
3789
3968
  ] });
3790
3969
  }
3791
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { ref, className: classes, ...props, children: [
3970
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { ref, className: classes, ...props, children: [
3792
3971
  leading,
3793
3972
  children,
3794
- onRemove && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
3973
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
3795
3974
  "button",
3796
3975
  {
3797
3976
  type: "button",
3798
3977
  "aria-label": typeof children === "string" ? `Remove ${children}` : "Remove",
3799
3978
  onClick: onRemove,
3800
3979
  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 })
3980
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react28.X, { size: 12, "aria-hidden": true })
3802
3981
  }
3803
3982
  )
3804
3983
  ] });
@@ -3807,26 +3986,26 @@ var EditableTag = React51.forwardRef(
3807
3986
  EditableTag.displayName = "EditableTag";
3808
3987
 
3809
3988
  // 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)(
3989
+ var import_jsx_runtime54 = require("react/jsx-runtime");
3990
+ var ActivityStructure = React53.forwardRef(
3991
+ ({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
3813
3992
  "section",
3814
3993
  {
3815
3994
  ref,
3816
3995
  className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-xl bg-surface p-4", className),
3817
3996
  ...props,
3818
3997
  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 }),
3998
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
3999
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h3", { className: "text-body-section text-surface-foreground", children: title }),
3821
4000
  action
3822
4001
  ] }),
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 })
4002
+ 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)) }),
4003
+ sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col gap-2", children: [
4004
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),
4005
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "text-body-base text-surface-foreground", children: body }),
4006
+ (tags?.length || onAddTag) && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
4007
+ tags?.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(EditableTag, { type: "editable", onRemove: onRemoveTag && (() => onRemoveTag(id, tag)), children: tag }, tag)),
4008
+ onAddTag && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(EditableTag, { type: "add", onClick: () => onAddTag(id), children: addTagLabel })
3830
4009
  ] })
3831
4010
  ] }, id)),
3832
4011
  children
@@ -3837,10 +4016,10 @@ var ActivityStructure = React52.forwardRef(
3837
4016
  ActivityStructure.displayName = "ActivityStructure";
3838
4017
 
3839
4018
  // src/components/Tags & Badges/Badge.tsx
3840
- var React53 = __toESM(require("react"), 1);
3841
- var import_react28 = require("@phosphor-icons/react");
4019
+ var React54 = __toESM(require("react"), 1);
4020
+ var import_react29 = require("@phosphor-icons/react");
3842
4021
  var import_class_variance_authority8 = require("class-variance-authority");
3843
- var import_jsx_runtime54 = require("react/jsx-runtime");
4022
+ var import_jsx_runtime55 = require("react/jsx-runtime");
3844
4023
  var roleTagVariants = (0, import_class_variance_authority8.cva)(
3845
4024
  "group inline-flex h-6 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
3846
4025
  {
@@ -3866,11 +4045,11 @@ var roleTagVariants = (0, import_class_variance_authority8.cva)(
3866
4045
  defaultVariants: { type: "primary", selected: false }
3867
4046
  }
3868
4047
  );
3869
- var Badge = React53.forwardRef(
4048
+ var Badge = React54.forwardRef(
3870
4049
  ({ className, type = "primary", selected = false, onClick, children, ...props }, ref) => {
3871
4050
  const classes = cn(roleTagVariants({ type, selected: type === "interactable" ? selected : false }), className);
3872
4051
  if (type === "interactable") {
3873
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
4052
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
3874
4053
  "button",
3875
4054
  {
3876
4055
  ref,
@@ -3880,15 +4059,15 @@ var Badge = React53.forwardRef(
3880
4059
  onClick,
3881
4060
  ...props,
3882
4061
  children: [
3883
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react28.DotsSixVertical, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover:block" }),
4062
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react29.DotsSixVertical, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover:block" }),
3884
4063
  children
3885
4064
  ]
3886
4065
  }
3887
4066
  );
3888
4067
  }
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" }),
4068
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { ref, className: classes, ...props, children: [
4069
+ type === "question" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react29.RadioButton, { size: 16, weight: "fill", "aria-hidden": true }),
4070
+ type === "id" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-secondary-muted-foreground", children: "ID" }),
3892
4071
  children
3893
4072
  ] });
3894
4073
  }
@@ -3896,9 +4075,9 @@ var Badge = React53.forwardRef(
3896
4075
  Badge.displayName = "Badge";
3897
4076
 
3898
4077
  // 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");
4078
+ var React55 = __toESM(require("react"), 1);
4079
+ var import_react30 = require("@phosphor-icons/react");
4080
+ var import_jsx_runtime56 = require("react/jsx-runtime");
3902
4081
  function getPaginationItems(page, pageCount, siblings = 1) {
3903
4082
  const keep = /* @__PURE__ */ new Set([1, pageCount]);
3904
4083
  for (let p = page - siblings; p <= page + siblings; p++) if (p >= 1 && p <= pageCount) keep.add(p);
@@ -3912,10 +4091,10 @@ function getPaginationItems(page, pageCount, siblings = 1) {
3912
4091
  });
3913
4092
  return items;
3914
4093
  }
3915
- var Pagination = React54.forwardRef(
4094
+ var Pagination = React55.forwardRef(
3916
4095
  ({ className, page, pageCount, onPageChange, variant = "full", siblings = 1, ...props }, ref) => {
3917
4096
  const go = (next2) => onPageChange(Math.min(pageCount, Math.max(1, next2)));
3918
- const previous = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4097
+ const previous = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
3919
4098
  Button,
3920
4099
  {
3921
4100
  type: "button",
@@ -3924,10 +4103,10 @@ var Pagination = React54.forwardRef(
3924
4103
  "aria-label": "Previous page",
3925
4104
  disabled: page <= 1,
3926
4105
  onClick: () => go(page - 1),
3927
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react29.ArrowLeft, { size: 16, "aria-hidden": true })
4106
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react30.ArrowLeft, { size: 16, "aria-hidden": true })
3928
4107
  }
3929
4108
  );
3930
- const next = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4109
+ const next = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
3931
4110
  Button,
3932
4111
  {
3933
4112
  type: "button",
@@ -3936,10 +4115,10 @@ var Pagination = React54.forwardRef(
3936
4115
  "aria-label": "Next page",
3937
4116
  disabled: page >= pageCount,
3938
4117
  onClick: () => go(page + 1),
3939
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react29.ArrowRight, { size: 16, "aria-hidden": true })
4118
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react30.ArrowRight, { size: 16, "aria-hidden": true })
3940
4119
  }
3941
4120
  );
3942
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
4121
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
3943
4122
  "nav",
3944
4123
  {
3945
4124
  ref,
@@ -3948,14 +4127,14 @@ var Pagination = React54.forwardRef(
3948
4127
  ...props,
3949
4128
  children: [
3950
4129
  previous,
3951
- variant === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "text-body-small text-surface-foreground", "aria-live": "polite", children: [
4130
+ variant === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "text-body-small text-surface-foreground", "aria-live": "polite", children: [
3952
4131
  page,
3953
4132
  "/",
3954
4133
  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)(
4134
+ ] }) : /* @__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: [
4135
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react30.DotsThree, { size: 16, "aria-hidden": true }),
4136
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "sr-only", children: "More pages" })
4137
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
3959
4138
  Button,
3960
4139
  {
3961
4140
  type: "button",