@flamingo-stack/openframe-frontend-core 0.0.697 → 0.0.698-2527.7764.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/{chunk-F6U2H42L.cjs → chunk-2JRKNGJ4.cjs} +6 -1
  2. package/dist/chunk-2JRKNGJ4.cjs.map +1 -0
  3. package/dist/{chunk-WVDBRL2S.js → chunk-3I4UVWLL.js} +7 -7
  4. package/dist/{chunk-LNOXNCEC.js → chunk-3QOEL4WL.js} +4 -4
  5. package/dist/{chunk-FZFEIXGB.cjs → chunk-3Y6OCKKW.cjs} +98 -98
  6. package/dist/{chunk-FZFEIXGB.cjs.map → chunk-3Y6OCKKW.cjs.map} +1 -1
  7. package/dist/{chunk-N4G3C4B4.cjs → chunk-4QRN6FRY.cjs} +12 -12
  8. package/dist/{chunk-N4G3C4B4.cjs.map → chunk-4QRN6FRY.cjs.map} +1 -1
  9. package/dist/{chunk-NE4H4JJG.cjs → chunk-5EL4RXTH.cjs} +42 -42
  10. package/dist/{chunk-NE4H4JJG.cjs.map → chunk-5EL4RXTH.cjs.map} +1 -1
  11. package/dist/{chunk-6CDP6TGH.cjs → chunk-5TAHPP4S.cjs} +126 -27
  12. package/dist/chunk-5TAHPP4S.cjs.map +1 -0
  13. package/dist/{chunk-M3JA577H.js → chunk-6SN6IVLN.js} +3 -3
  14. package/dist/{chunk-J4VGVLQI.js → chunk-7SKHOYTF.js} +3 -3
  15. package/dist/{chunk-7MM6EDNA.cjs → chunk-7WUCZIT4.cjs} +55 -32
  16. package/dist/{chunk-7MM6EDNA.cjs.map → chunk-7WUCZIT4.cjs.map} +1 -1
  17. package/dist/{chunk-75CG72QX.cjs → chunk-A3S7VHTM.cjs} +33 -33
  18. package/dist/{chunk-75CG72QX.cjs.map → chunk-A3S7VHTM.cjs.map} +1 -1
  19. package/dist/{chunk-VSQVJHOS.js → chunk-AKVO7FP4.js} +2 -2
  20. package/dist/{chunk-T33ICOHD.cjs → chunk-AQLW7KV3.cjs} +29 -29
  21. package/dist/{chunk-T33ICOHD.cjs.map → chunk-AQLW7KV3.cjs.map} +1 -1
  22. package/dist/{chunk-J4MCVIXU.js → chunk-BNJBJTEK.js} +209 -110
  23. package/dist/chunk-BNJBJTEK.js.map +1 -0
  24. package/dist/{chunk-YCVDJX7Z.js → chunk-DBF7PGQR.js} +4 -4
  25. package/dist/{chunk-LZXZ3C6M.js → chunk-E47BI33A.js} +32 -9
  26. package/dist/chunk-E47BI33A.js.map +1 -0
  27. package/dist/{chunk-RQ3HFUKV.cjs → chunk-FEXS67IG.cjs} +8 -8
  28. package/dist/{chunk-RQ3HFUKV.cjs.map → chunk-FEXS67IG.cjs.map} +1 -1
  29. package/dist/{chunk-LEGNIETR.cjs → chunk-GPF5IV4F.cjs} +5 -5
  30. package/dist/{chunk-LEGNIETR.cjs.map → chunk-GPF5IV4F.cjs.map} +1 -1
  31. package/dist/{chunk-VE7HLTVQ.js → chunk-H45GRYL4.js} +2 -2
  32. package/dist/{chunk-QYFXRVH3.js → chunk-H7FCFGSD.js} +9 -9
  33. package/dist/{chunk-JU6SBF3C.cjs → chunk-HT7SU5UN.cjs} +7 -7
  34. package/dist/{chunk-JU6SBF3C.cjs.map → chunk-HT7SU5UN.cjs.map} +1 -1
  35. package/dist/{chunk-3V7O7J4S.cjs → chunk-IZ3B3YRO.cjs} +28 -28
  36. package/dist/{chunk-3V7O7J4S.cjs.map → chunk-IZ3B3YRO.cjs.map} +1 -1
  37. package/dist/{chunk-KLDCI3KF.cjs → chunk-JM7KIML2.cjs} +3 -3
  38. package/dist/{chunk-KLDCI3KF.cjs.map → chunk-JM7KIML2.cjs.map} +1 -1
  39. package/dist/{chunk-Y2MDXJB4.js → chunk-JZCCRN3K.js} +2 -2
  40. package/dist/{chunk-4HVWGYHI.js → chunk-LPLXCDNV.js} +6 -1
  41. package/dist/chunk-LPLXCDNV.js.map +1 -0
  42. package/dist/{chunk-LF4S37VU.js → chunk-NKKA4KY7.js} +5 -5
  43. package/dist/{chunk-RIDRAKQ5.cjs → chunk-OF6FE2KT.cjs} +15 -15
  44. package/dist/{chunk-RIDRAKQ5.cjs.map → chunk-OF6FE2KT.cjs.map} +1 -1
  45. package/dist/{chunk-QD4BVKAU.js → chunk-OKA4VKE6.js} +6 -6
  46. package/dist/{chunk-Z7A7FUWY.js → chunk-OM6WC5XG.js} +3 -3
  47. package/dist/{chunk-77XUG4Z4.js → chunk-OPXQ5E3G.js} +10 -10
  48. package/dist/{chunk-GRBZC5N3.js → chunk-PELIFROQ.js} +2 -2
  49. package/dist/{chunk-JBMFCHNT.js → chunk-PMXCBAC4.js} +2883 -2343
  50. package/dist/chunk-PMXCBAC4.js.map +1 -0
  51. package/dist/{chunk-PYNHPMDB.js → chunk-Q7PGQDD4.js} +5 -5
  52. package/dist/{chunk-EWQZ4BXD.cjs → chunk-QYTVHA6G.cjs} +7 -7
  53. package/dist/{chunk-EWQZ4BXD.cjs.map → chunk-QYTVHA6G.cjs.map} +1 -1
  54. package/dist/{chunk-H6SSHFMD.js → chunk-QZFJJRXE.js} +6 -6
  55. package/dist/{chunk-XRW5VZKH.cjs → chunk-SBBLGNXR.cjs} +14 -14
  56. package/dist/{chunk-XRW5VZKH.cjs.map → chunk-SBBLGNXR.cjs.map} +1 -1
  57. package/dist/{chunk-VCR3TW2H.cjs → chunk-TVMY3U3W.cjs} +8 -8
  58. package/dist/{chunk-VCR3TW2H.cjs.map → chunk-TVMY3U3W.cjs.map} +1 -1
  59. package/dist/{chunk-3S56I5MX.js → chunk-U7J7G5J7.js} +3 -3
  60. package/dist/{chunk-SG53SIJX.js → chunk-ULYQ4WFF.js} +6 -6
  61. package/dist/{chunk-CVMWOUAX.cjs → chunk-UTQLLMBP.cjs} +48 -48
  62. package/dist/{chunk-CVMWOUAX.cjs.map → chunk-UTQLLMBP.cjs.map} +1 -1
  63. package/dist/{chunk-5DBWXJBG.cjs → chunk-VVTWH4YS.cjs} +1529 -989
  64. package/dist/chunk-VVTWH4YS.cjs.map +1 -0
  65. package/dist/{chunk-5P2J7E5E.cjs → chunk-WC76QXUX.cjs} +3 -3
  66. package/dist/{chunk-5P2J7E5E.cjs.map → chunk-WC76QXUX.cjs.map} +1 -1
  67. package/dist/{chunk-2FK7BZIM.cjs → chunk-XFIHZS35.cjs} +18 -18
  68. package/dist/{chunk-2FK7BZIM.cjs.map → chunk-XFIHZS35.cjs.map} +1 -1
  69. package/dist/{chunk-OB3ZJ7GQ.js → chunk-XGB5EEFZ.js} +3 -3
  70. package/dist/{chunk-MFU3ALKM.cjs → chunk-YNAWEA3G.cjs} +232 -232
  71. package/dist/{chunk-MFU3ALKM.cjs.map → chunk-YNAWEA3G.cjs.map} +1 -1
  72. package/dist/{chunk-WADR7VIA.cjs → chunk-YWMEVCCZ.cjs} +70 -70
  73. package/dist/{chunk-WADR7VIA.cjs.map → chunk-YWMEVCCZ.cjs.map} +1 -1
  74. package/dist/components/announcement-bar.d.ts +1 -1
  75. package/dist/components/announcement-bar.d.ts.map +1 -1
  76. package/dist/components/calendar.cjs +4 -4
  77. package/dist/components/calendar.js +1 -1
  78. package/dist/components/case-studies/index.cjs +21 -21
  79. package/dist/components/case-studies/index.js +7 -7
  80. package/dist/components/chat/index.cjs +4 -4
  81. package/dist/components/chat/index.js +3 -3
  82. package/dist/components/contact/index.cjs +8 -8
  83. package/dist/components/contact/index.js +7 -7
  84. package/dist/components/docs/index.cjs +11 -11
  85. package/dist/components/docs/index.js +10 -10
  86. package/dist/components/embeds/index.cjs +8 -8
  87. package/dist/components/embeds/index.js +7 -7
  88. package/dist/components/faq/index.cjs +8 -8
  89. package/dist/components/faq/index.js +7 -7
  90. package/dist/components/features/conversation-card.d.ts +32 -0
  91. package/dist/components/features/conversation-card.d.ts.map +1 -0
  92. package/dist/components/features/index.cjs +9 -7
  93. package/dist/components/features/index.cjs.map +1 -1
  94. package/dist/components/features/index.d.ts +1 -0
  95. package/dist/components/features/index.d.ts.map +1 -1
  96. package/dist/components/features/index.js +8 -6
  97. package/dist/components/help-center-pages/index.cjs +101 -101
  98. package/dist/components/help-center-pages/index.js +20 -20
  99. package/dist/components/index.cjs +133 -109
  100. package/dist/components/index.cjs.map +1 -1
  101. package/dist/components/index.js +45 -21
  102. package/dist/components/index.js.map +1 -1
  103. package/dist/components/meeting-scheduler/index.cjs +59 -59
  104. package/dist/components/meeting-scheduler/index.js +8 -8
  105. package/dist/components/navigation/index.cjs +10 -10
  106. package/dist/components/navigation/index.js +9 -9
  107. package/dist/components/onboarding-guides/index.cjs +10 -10
  108. package/dist/components/onboarding-guides/index.js +9 -9
  109. package/dist/components/platform/ToolBadge.d.ts +17 -9
  110. package/dist/components/platform/ToolBadge.d.ts.map +1 -1
  111. package/dist/components/related-content/index.cjs +5 -5
  112. package/dist/components/related-content/index.js +4 -4
  113. package/dist/components/tickets/index.cjs +12 -12
  114. package/dist/components/tickets/index.js +11 -11
  115. package/dist/components/ui/app-window-frame.d.ts +20 -0
  116. package/dist/components/ui/app-window-frame.d.ts.map +1 -0
  117. package/dist/components/ui/button/button-styles.d.ts +1 -0
  118. package/dist/components/ui/button/button-styles.d.ts.map +1 -1
  119. package/dist/components/ui/button/button.d.ts +1 -1
  120. package/dist/components/ui/button/button.d.ts.map +1 -1
  121. package/dist/components/ui/feature-card.d.ts +5 -0
  122. package/dist/components/ui/feature-card.d.ts.map +1 -1
  123. package/dist/components/ui/feature-list.d.ts +7 -1
  124. package/dist/components/ui/feature-list.d.ts.map +1 -1
  125. package/dist/components/ui/file-manager/index.cjs +11 -11
  126. package/dist/components/ui/file-manager/index.js +1 -1
  127. package/dist/components/ui/incident-feed.d.ts +49 -0
  128. package/dist/components/ui/incident-feed.d.ts.map +1 -0
  129. package/dist/components/ui/index.cjs +27 -7
  130. package/dist/components/ui/index.cjs.map +1 -1
  131. package/dist/components/ui/index.d.ts +5 -0
  132. package/dist/components/ui/index.d.ts.map +1 -1
  133. package/dist/components/ui/index.js +26 -6
  134. package/dist/components/ui/page-actions.d.ts +1 -1
  135. package/dist/components/ui/page-actions.d.ts.map +1 -1
  136. package/dist/components/ui/phone-frame.d.ts +60 -0
  137. package/dist/components/ui/phone-frame.d.ts.map +1 -0
  138. package/dist/components/ui/snap-carousel.d.ts +27 -0
  139. package/dist/components/ui/snap-carousel.d.ts.map +1 -0
  140. package/dist/components/ui/sticky-action-bar.d.ts +29 -0
  141. package/dist/components/ui/sticky-action-bar.d.ts.map +1 -0
  142. package/dist/components/ui/tab-navigation.d.ts +14 -1
  143. package/dist/components/ui/tab-navigation.d.ts.map +1 -1
  144. package/dist/hooks/index.cjs +12 -2
  145. package/dist/hooks/index.cjs.map +1 -1
  146. package/dist/hooks/index.d.ts +1 -0
  147. package/dist/hooks/index.d.ts.map +1 -1
  148. package/dist/hooks/index.js +11 -1
  149. package/dist/hooks/ui/index.d.ts +2 -0
  150. package/dist/hooks/ui/index.d.ts.map +1 -1
  151. package/dist/hooks/ui/use-in-view.d.ts +20 -0
  152. package/dist/hooks/ui/use-in-view.d.ts.map +1 -0
  153. package/dist/hooks/ui/use-prefers-reduced-motion.d.ts +13 -0
  154. package/dist/hooks/ui/use-prefers-reduced-motion.d.ts.map +1 -0
  155. package/dist/hooks/use-scenario-player.d.ts +45 -0
  156. package/dist/hooks/use-scenario-player.d.ts.map +1 -0
  157. package/dist/index.cjs +44 -12
  158. package/dist/index.cjs.map +1 -1
  159. package/dist/index.js +42 -10
  160. package/dist/index.js.map +1 -1
  161. package/dist/types/announcement.cjs.map +1 -1
  162. package/dist/types/announcement.d.ts +21 -0
  163. package/dist/types/announcement.d.ts.map +1 -1
  164. package/dist/types/announcement.js.map +1 -1
  165. package/dist/types/index.cjs.map +1 -1
  166. package/dist/types/index.js.map +1 -1
  167. package/package.json +1 -1
  168. package/src/components/announcement-bar.tsx +7 -1
  169. package/src/components/features/conversation-card.tsx +93 -0
  170. package/src/components/features/index.ts +3 -0
  171. package/src/components/platform/ToolBadge.tsx +47 -13
  172. package/src/components/ui/__tests__/snap-carousel.test.tsx +116 -0
  173. package/src/components/ui/app-window-frame.tsx +41 -0
  174. package/src/components/ui/button/button-styles.ts +5 -0
  175. package/src/components/ui/button/button.tsx +1 -0
  176. package/src/components/ui/feature-card.tsx +16 -1
  177. package/src/components/ui/feature-list.tsx +23 -3
  178. package/src/components/ui/incident-feed.tsx +143 -0
  179. package/src/components/ui/index.ts +8 -0
  180. package/src/components/ui/page-actions.tsx +1 -1
  181. package/src/components/ui/phone-frame.tsx +166 -0
  182. package/src/components/ui/snap-carousel.tsx +186 -0
  183. package/src/components/ui/sticky-action-bar.tsx +81 -0
  184. package/src/components/ui/tab-navigation.tsx +63 -13
  185. package/src/hooks/__tests__/use-scenario-player.test.tsx +144 -0
  186. package/src/hooks/index.ts +3 -0
  187. package/src/hooks/ui/index.ts +2 -0
  188. package/src/hooks/ui/use-in-view.ts +63 -0
  189. package/src/hooks/ui/use-prefers-reduced-motion.ts +22 -0
  190. package/src/hooks/use-scenario-player.ts +102 -0
  191. package/src/stories/DemoStage.stories.tsx +242 -0
  192. package/src/types/announcement.ts +21 -0
  193. package/dist/chunk-4HVWGYHI.js.map +0 -1
  194. package/dist/chunk-5DBWXJBG.cjs.map +0 -1
  195. package/dist/chunk-6CDP6TGH.cjs.map +0 -1
  196. package/dist/chunk-F6U2H42L.cjs.map +0 -1
  197. package/dist/chunk-J4MCVIXU.js.map +0 -1
  198. package/dist/chunk-JBMFCHNT.js.map +0 -1
  199. package/dist/chunk-LZXZ3C6M.js.map +0 -1
  200. /package/dist/{chunk-WVDBRL2S.js.map → chunk-3I4UVWLL.js.map} +0 -0
  201. /package/dist/{chunk-LNOXNCEC.js.map → chunk-3QOEL4WL.js.map} +0 -0
  202. /package/dist/{chunk-M3JA577H.js.map → chunk-6SN6IVLN.js.map} +0 -0
  203. /package/dist/{chunk-J4VGVLQI.js.map → chunk-7SKHOYTF.js.map} +0 -0
  204. /package/dist/{chunk-VSQVJHOS.js.map → chunk-AKVO7FP4.js.map} +0 -0
  205. /package/dist/{chunk-YCVDJX7Z.js.map → chunk-DBF7PGQR.js.map} +0 -0
  206. /package/dist/{chunk-VE7HLTVQ.js.map → chunk-H45GRYL4.js.map} +0 -0
  207. /package/dist/{chunk-QYFXRVH3.js.map → chunk-H7FCFGSD.js.map} +0 -0
  208. /package/dist/{chunk-Y2MDXJB4.js.map → chunk-JZCCRN3K.js.map} +0 -0
  209. /package/dist/{chunk-LF4S37VU.js.map → chunk-NKKA4KY7.js.map} +0 -0
  210. /package/dist/{chunk-QD4BVKAU.js.map → chunk-OKA4VKE6.js.map} +0 -0
  211. /package/dist/{chunk-Z7A7FUWY.js.map → chunk-OM6WC5XG.js.map} +0 -0
  212. /package/dist/{chunk-77XUG4Z4.js.map → chunk-OPXQ5E3G.js.map} +0 -0
  213. /package/dist/{chunk-GRBZC5N3.js.map → chunk-PELIFROQ.js.map} +0 -0
  214. /package/dist/{chunk-PYNHPMDB.js.map → chunk-Q7PGQDD4.js.map} +0 -0
  215. /package/dist/{chunk-H6SSHFMD.js.map → chunk-QZFJJRXE.js.map} +0 -0
  216. /package/dist/{chunk-3S56I5MX.js.map → chunk-U7J7G5J7.js.map} +0 -0
  217. /package/dist/{chunk-SG53SIJX.js.map → chunk-ULYQ4WFF.js.map} +0 -0
  218. /package/dist/{chunk-OB3ZJ7GQ.js.map → chunk-XGB5EEFZ.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/button/button.tsx","../src/components/ui/button/button-styles.ts","../src/components/ui/button/split-button.tsx"],"sourcesContent":["'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport React from 'react';\nimport Link from '../../../embed-shims/next-link';\nimport { cn } from '../../../utils/cn';\nimport {\n buttonSurfaceClasses,\n outlineBorderClasses,\n splitDividerColorClasses,\n splitGlyphSizeBySize,\n} from './button-styles';\n\n// Default layout: centered single content area, padding/gap on the button itself.\nconst buttonVariants = cva(\n [\n 'relative inline-flex items-center justify-center gap-[var(--spacing-system-xsf)]',\n 'whitespace-nowrap rounded-md',\n 'transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-focus',\n 'disabled:pointer-events-none',\n '[&_svg]:pointer-events-none [&_svg]:h-5 [&_svg]:w-5 [&_svg]:shrink-0',\n ],\n {\n variants: {\n variant: {\n accent: buttonSurfaceClasses.accent,\n outline: cn(buttonSurfaceClasses.outline, outlineBorderClasses),\n transparent: buttonSurfaceClasses.transparent,\n destructive: buttonSurfaceClasses.destructive,\n warning: buttonSurfaceClasses.warning,\n inverted: buttonSurfaceClasses.inverted,\n glyph: buttonSurfaceClasses.glyph,\n overlay: buttonSurfaceClasses.overlay,\n link: buttonSurfaceClasses.link,\n },\n size: {\n default: 'h-11 px-[var(--spacing-system-m)] py-[var(--spacing-system-sf)] text-h3 md:h-12',\n small: 'h-6 p-[var(--spacing-system-xs)] text-h5 md:h-8',\n // The CHILD is the affordance (a badge, a chip, a thumbnail): the button\n // contributes the hit target, the focus ring and the keyboard/ARIA\n // semantics, and NO box of its own. Without this, call sites reached for\n // a `className=\"h-auto p-0\"` override to cancel the default box.\n wrap: 'h-auto p-0',\n 'small-legacy': 'h-10 px-[var(--spacing-system-m)] py-[var(--spacing-system-xs)] text-[14px] font-bold', // Temporary alias for \"small\" — deprecated; grep size=\"small-legacy\" (lib + hub) and migrate the remaining consumers before removal\n // 24px pill for slim strips (announcement/promo bars, inline banner\n // actions — Primer banner / Polaris banner / Vercel-bar convention).\n // The label matches the strip's MESSAGE type ramp exactly (DM Sans\n // regular, 13px -> md:14px, snug leading — the announcement bar's\n // subtitle styling): in-strip CTAs must never read louder than the\n // message beside them, so this deliberately uses neither the\n // mono-uppercase control style of \"small\" nor a heavier weight.\n // Pinned h-6 across breakpoints (24px = the WCAG 2.5.8 target-size\n // floor) with horizontal-dominant padding and a 14px glyph.\n compact: 'h-6 px-[var(--spacing-system-sf)] py-0 font-normal text-h6 [&_svg]:h-3.5 [&_svg]:w-3.5',\n icon: 'h-11 w-11 p-[var(--spacing-system-sf)] md:h-12 md:w-12 [&_svg]:h-4 [&_svg]:w-4 md:[&_svg]:h-6 md:[&_svg]:w-6',\n // Quiet 32px icon target with a 16px glyph, fixed across breakpoints\n // (Carbon ghost sm / Primer medium / shadcn icon-sm all pin 32px;\n // ≥ the 24px WCAG 2.5.8 target floor). For icon actions that read as\n // metadata rather than CTAs — author-page social rows, share rows.\n // Pair with variant=\"transparent\" for the ghost treatment.\n 'icon-sm': 'h-8 w-8 p-[var(--spacing-system-xxs)] [&_svg]:h-4 [&_svg]:w-4',\n // 20px inline glyph for affordances that sit INSIDE a line of text —\n // an info hint beside a badge, a copy glyph after an id. `icon-sm`'s\n // 32px target is correct for a metadata row but visually swamps a\n // 10px badge or a 14px label, so hosts were reaching for className\n // overrides to shrink it. Below the WCAG 2.5.8 target floor on purpose:\n // this is only for glyphs whose information is ALSO available another\n // way (tooltip content mirrored into an aria-describedby node), never\n // for a sole means of performing an action.\n 'icon-inline': 'h-5 min-h-0 w-5 min-w-0 shrink-0 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5',\n // Bare 56px media glyph (play / unmute over video). A size variant so\n // hosts stop re-implementing a <button> to escape the 20px svg cap.\n 'icon-glyph': 'h-14 w-14 p-0 [&_svg]:h-14 [&_svg]:w-14',\n },\n // Label typography axis (Figma 133-740). `bold` is the classic h3-bold\n // label; `regular` swaps the DEFAULT size's label to the h4 step\n // (DM Sans 500, neutral tracking) — added for navigation buttons.\n // `small` keeps its mono-uppercase h5 label on both fonts per the spec.\n font: {\n bold: '',\n regular: '',\n },\n fullWidth: {\n true: 'w-full',\n false: '',\n },\n noPaddingX: {\n true: 'px-0',\n false: '',\n },\n },\n compoundVariants: [\n { size: 'small', class: '[&_svg]:h-4 [&_svg]:w-4' },\n // Comes after the size classes, so cn()'s tailwind-merge resolves the\n // ods-typography group in favour of text-h4.\n { size: 'default', font: 'regular', class: 'text-h4' },\n ],\n defaultVariants: {\n variant: 'accent',\n size: 'default',\n font: 'bold',\n fullWidth: false,\n noPaddingX: false,\n },\n },\n);\n\n// Split layout (used when `splitIcon` is provided): outer button has no padding;\n// inner slots own padding/gap so the divider can span full button height.\nconst splitShellVariants = cva(\n [\n 'group relative inline-flex items-stretch overflow-hidden whitespace-nowrap rounded-md',\n 'transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-focus',\n 'disabled:pointer-events-none',\n ],\n {\n variants: {\n variant: {\n accent: buttonSurfaceClasses.accent,\n outline: cn(buttonSurfaceClasses.outline, outlineBorderClasses),\n transparent: buttonSurfaceClasses.transparent,\n destructive: buttonSurfaceClasses.destructive,\n warning: buttonSurfaceClasses.warning,\n },\n size: {\n default: 'h-12',\n small: 'h-6 text-h5 md:h-8',\n },\n // Same label-typography axis as the normal layout — `regular` swaps the\n // default size's h3-bold label for the h4 (DM Sans 500) step.\n font: { bold: '', regular: '' },\n fullWidth: { true: 'w-full', false: '' },\n },\n compoundVariants: [\n { size: 'default', font: 'bold', class: 'text-h3' },\n { size: 'default', font: 'regular', class: 'text-h4' },\n ],\n defaultVariants: { variant: 'accent', size: 'default', font: 'bold', fullWidth: false },\n },\n);\n\nconst splitSlotVariants = cva(\n // Glyph size lives per-size, not in the base: cva concatenates base + variant\n // without tailwind-merge, so a base `[&_svg]:h-5` and a variant `[&_svg]:h-4`\n // would both ship and the winner would come down to stylesheet order.\n ['inline-flex items-center justify-center', '[&_svg]:shrink-0'],\n {\n variants: {\n slot: {\n main: 'gap-[var(--spacing-system-xsf)]',\n icon: 'border-l',\n },\n size: splitGlyphSizeBySize,\n variant: { accent: '', outline: '', transparent: '', destructive: '', warning: '' },\n fullWidth: { true: '', false: '' },\n },\n compoundVariants: [\n { slot: 'main', size: 'default', class: 'px-[var(--spacing-system-m)] py-[var(--spacing-system-sf)]' },\n { slot: 'main', size: 'small', class: 'px-[var(--spacing-system-xs)]' },\n // `fullWidth` stretches the SHELL, not its children, so without this the main\n // half stays content-sized and the icon half floats mid-button with dead space\n // after it instead of sitting flush against the trailing edge. Keyed on\n // `fullWidth` to match `SplitButton`, which grows its main half on exactly the\n // same condition (`grow={fullWidth}`) — the two split layouts render side by\n // side in the same rows and must not disagree. Callers that stretch the shell\n // some other way (a `flex-1` className, a grid cell) keep the old behaviour.\n { slot: 'main', fullWidth: true, class: 'flex-1' },\n { slot: 'icon', size: 'default', class: 'w-10' },\n { slot: 'icon', size: 'small', class: 'w-6 md:w-8' },\n {\n slot: 'icon',\n variant: 'accent',\n class: cn(\n splitDividerColorClasses.accent,\n 'group-disabled:border-ods-disabled group-aria-disabled:border-ods-disabled',\n ),\n },\n { slot: 'icon', variant: 'outline', class: splitDividerColorClasses.outline },\n { slot: 'icon', variant: 'transparent', class: splitDividerColorClasses.transparent },\n {\n slot: 'icon',\n variant: 'destructive',\n class: cn(\n splitDividerColorClasses.destructive,\n 'group-disabled:border-ods-disabled group-aria-disabled:border-ods-disabled',\n ),\n },\n {\n slot: 'icon',\n variant: 'warning',\n class: cn(\n splitDividerColorClasses.warning,\n 'group-disabled:border-ods-disabled group-aria-disabled:border-ods-disabled',\n ),\n },\n ],\n defaultVariants: { slot: 'main', size: 'default', variant: 'accent', fullWidth: false },\n },\n);\n\n/** @deprecated Use `size=\"small\"` instead. Temporary alias kept for backward compatibility; will be removed in the future. */\ntype DeprecatedButtonSize = 'small-legacy';\n\ntype ButtonSize =\n Exclude<VariantProps<typeof buttonVariants>['size'], 'small-legacy' | null | undefined> | DeprecatedButtonSize;\n\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, 'size'> {\n asChild?: boolean;\n href?: string;\n openInNewTab?: boolean;\n prefetch?: boolean;\n /**\n * Pre-resolved anchor bundle (from `useNavLink({ href, targetPlatform })`).\n * When set, renders the Button as `<Link>` with `href` / `target` / `rel`\n * / `onClick` spread from this object. Lets callers thread the unified\n * nav decision directly without `<Button asChild><a {...linkProps}/>`\n * gymnastics. Wins over the separate `href` / `openInNewTab` props.\n */\n /**\n * Render a plain `<a href download>` instead of a Next `<Link>`.\n * A download is a RESOURCE fetch, not a route change: `<Link>` would try to\n * prefetch/route it. Only meaningful together with `href`.\n */\n download?: boolean | string;\n linkProps?: {\n href: string;\n target?: '_blank';\n /** `noopener` alone keeps the Referer for a new-tab link to one of our own\n * platforms (cross-domain analytics attribution); `noreferrer` is for\n * third-party destinations. */\n rel?: 'noopener' | 'noopener noreferrer';\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n } | null;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n /**\n * Renders a vertical divider and trailing icon area inside the button.\n * The whole button stays a single click target — the icon is decorative\n * (`aria-hidden`). For two independent click targets, use `<SplitButton>`.\n * Only honored when `size` is `\"default\"` or `\"small\"`.\n */\n splitIcon?: React.ReactNode;\n loading?: boolean;\n size?: ButtonSize;\n}\n\nconst Spinner = () => (\n <svg className=\"animate-spin\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n);\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function ButtonImpl(\n {\n className,\n variant,\n size,\n font,\n fullWidth,\n noPaddingX,\n asChild,\n href,\n openInNewTab,\n prefetch,\n linkProps,\n download,\n leftIcon,\n rightIcon,\n splitIcon,\n loading,\n children,\n disabled,\n onClick,\n ...props\n },\n ref,\n) {\n const isDisabled = disabled || loading;\n\n // splitIcon is only supported for default/small sizes. With other sizes\n // (icon, small-legacy) we silently fall back to the normal layout.\n const useSplitLayout = !!splitIcon && (size === 'default' || size === 'small' || size === undefined);\n\n if (useSplitLayout) {\n const safeSize = size ?? 'default';\n const safeVariant = (variant ?? 'accent') as 'accent' | 'outline' | 'transparent' | 'destructive' | 'warning';\n const shellClasses = cn(splitShellVariants({ variant: safeVariant, size: safeSize, font, fullWidth }), className);\n const mainSlotClass = splitSlotVariants({ slot: 'main', size: safeSize, variant: safeVariant, fullWidth });\n const iconSlotClass = splitSlotVariants({ slot: 'icon', size: safeSize, variant: safeVariant });\n\n const splitContent = (\n <>\n <span className={cn('contents', loading && 'invisible')}>\n <span className={mainSlotClass}>\n {leftIcon && <span className=\"inline-flex items-center\">{leftIcon}</span>}\n {children}\n {rightIcon && <span className=\"inline-flex items-center\">{rightIcon}</span>}\n </span>\n <span aria-hidden=\"true\" className={iconSlotClass}>\n {splitIcon}\n </span>\n </span>\n {loading && (\n // Carries the glyph scale itself: this overlay is a SIBLING of the slots, so\n // it inherits neither their `[&_svg]` sizing nor a shell base rule (the shell\n // deliberately has none — see `splitSlotVariants`). Without it the spinner\n // renders unconstrained and fills the button. Reads the same per-size ramp the\n // slots do, so it matches the glyphs it covers at both breakpoints.\n <span\n className={cn(\n 'absolute inset-0 inline-flex items-center justify-center text-ods-text-primary',\n splitGlyphSizeBySize[safeSize],\n )}\n >\n <Spinner />\n </span>\n )}\n </>\n );\n\n // A download is a resource fetch, not a route change: same `Link` as every\n // other anchor branch (so a host that registered `next/link` keeps ONE\n // anchor implementation), with prefetch off — there is no route to warm,\n // and prefetching would fetch the file itself. Checked BEFORE the\n // linkProps/href resolution.\n if (download && href) {\n return (\n <Link\n href={href}\n download={download}\n prefetch={false}\n className={cn(shellClasses, isDisabled && 'pointer-events-none')}\n aria-label={props['aria-label']}\n >\n {splitContent}\n </Link>\n );\n }\n\n // `linkProps` (the pre-resolved bundle from `useNavLink({ href, targetPlatform })`)\n // wins over the legacy `href` + `openInNewTab` props so callers can thread\n // the unified nav decision directly. Either path produces the same `<Link>`.\n const splitAnchor =\n linkProps ??\n (href\n ? {\n href,\n target: openInNewTab ? ('_blank' as const) : undefined,\n rel: openInNewTab ? ('noopener noreferrer' as const) : undefined,\n onClick: onClick as unknown as React.MouseEventHandler<HTMLAnchorElement> | undefined,\n }\n : null);\n if (splitAnchor) {\n return (\n <Link\n href={splitAnchor.href}\n prefetch={prefetch}\n target={splitAnchor.target}\n rel={splitAnchor.rel}\n // The Link branches don't spread {...props} (button attrs don't\n // belong on an anchor), but the accessible name MUST survive —\n // icon-only link buttons have no text content.\n aria-label={props['aria-label']}\n aria-disabled={isDisabled || undefined}\n tabIndex={isDisabled ? -1 : undefined}\n className={cn(shellClasses, isDisabled && 'pointer-events-none')}\n onClick={splitAnchor.onClick}\n >\n {splitContent}\n </Link>\n );\n }\n\n return (\n <button ref={ref} className={shellClasses} disabled={isDisabled} onClick={onClick} {...props}>\n {splitContent}\n </button>\n );\n }\n\n const classes = cn(buttonVariants({ variant, size, font, fullWidth, noPaddingX }), className);\n\n // asChild: consumer fully controls the rendered element; we just stamp our classes.\n if (asChild) {\n return (\n <Slot ref={ref} className={classes} {...props}>\n {children}\n </Slot>\n );\n }\n\n // Real content stays in layout (preserving width) but goes invisible while loading.\n // The spinner is absolutely positioned so it never shifts the button's size.\n const content = (\n <>\n <span className={cn('contents', loading && 'invisible')}>\n {leftIcon && <span className=\"inline-flex items-center\">{leftIcon}</span>}\n {children}\n {rightIcon && <span className=\"inline-flex items-center\">{rightIcon}</span>}\n </span>\n {loading && (\n <span className=\"absolute inset-0 inline-flex items-center justify-center text-ods-text-primary\">\n <Spinner />\n </span>\n )}\n </>\n );\n\n // Same download short-circuit as the splitIcon branch.\n if (download && href) {\n return (\n <Link\n href={href}\n download={download}\n prefetch={false}\n className={cn(classes, isDisabled && 'pointer-events-none')}\n aria-label={props['aria-label']}\n >\n {content}\n </Link>\n );\n }\n\n // Same `linkProps`-wins-over-href resolution as the splitIcon branch.\n const anchor =\n linkProps ??\n (href\n ? {\n href,\n target: openInNewTab ? ('_blank' as const) : undefined,\n rel: openInNewTab ? ('noopener noreferrer' as const) : undefined,\n onClick: onClick as unknown as React.MouseEventHandler<HTMLAnchorElement> | undefined,\n }\n : null);\n if (anchor) {\n return (\n <Link\n href={anchor.href}\n prefetch={prefetch}\n target={anchor.target}\n rel={anchor.rel}\n // See the splitAnchor branch — keep the accessible name on the\n // anchor render (icon-only link buttons have no text content).\n aria-label={props['aria-label']}\n aria-disabled={isDisabled || undefined}\n tabIndex={isDisabled ? -1 : undefined}\n className={cn(classes, isDisabled && 'pointer-events-none')}\n onClick={anchor.onClick}\n >\n {content}\n </Link>\n );\n }\n\n return (\n <button ref={ref} className={classes} disabled={isDisabled} onClick={onClick} {...props}>\n {content}\n </button>\n );\n});\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants, type ButtonProps };\n","// Shared style atoms for `Button` and `SplitButton`. Extracted to keep a single\n// source of truth for surface colors, outline borders, and split-divider colors.\n\n// Each variant pairs `disabled:` (real `<button disabled>`) with `aria-disabled:`\n// (used for `<Link aria-disabled>` since anchors don't support `:disabled`).\nexport const buttonSurfaceClasses = {\n accent:\n 'bg-ods-accent text-ods-text-on-accent hover:bg-ods-accent-hover active:bg-ods-accent-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n outline:\n 'bg-ods-card text-ods-text-primary hover:bg-ods-bg-hover active:bg-ods-bg-active disabled:bg-ods-card disabled:text-ods-text-disabled aria-disabled:bg-ods-card aria-disabled:text-ods-text-disabled',\n transparent:\n 'bg-transparent text-ods-text-primary hover:bg-ods-bg-hover active:bg-ods-bg-active disabled:bg-transparent disabled:text-ods-text-disabled aria-disabled:bg-transparent aria-disabled:text-ods-text-disabled',\n destructive:\n 'bg-ods-error text-ods-text-on-accent hover:bg-ods-error-hover active:bg-ods-error-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n warning:\n 'bg-ods-warning text-ods-text-on-accent hover:bg-ods-warning-hover active:bg-ods-warning-active disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n // The page's colours swapped: light on a dark theme, dark on a light one. A\n // strong action that must NOT be the accent, for a surface that already\n // holds the one accent call to action (an \"Approve\" inside a product demo).\n inverted:\n 'bg-ods-text-primary text-ods-bg hover:bg-ods-text-secondary active:bg-ods-text-secondary disabled:bg-ods-disabled aria-disabled:bg-ods-disabled',\n // A self-contained glyph (play badge, unmute glyph) that already carries its\n // own scrim: no button surface at all, in any state. Distinct from\n // `transparent`, whose hover/active fills would paint a rectangle behind the\n // glyph — which is why call sites were undoing them with\n // `hover:bg-transparent active:bg-transparent`.\n glyph:\n 'bg-transparent text-ods-text-primary hover:bg-transparent active:bg-transparent disabled:bg-transparent disabled:text-ods-text-disabled aria-disabled:bg-transparent aria-disabled:text-ods-text-disabled',\n // A quiet inline text action (a \"Show all\" / \"Show less\" disclosure, a\n // secondary \"Clear\" beside a field): secondary text that takes the accent on\n // hover, and no surface in any state. Promoted to a variant because the\n // disclosure toggle was a primitive <button> restating these classes. Pair\n // with size=\"compact\" and noPaddingX so the label aligns with the text above.\n link: 'bg-transparent text-ods-text-secondary hover:bg-transparent hover:text-ods-accent active:bg-transparent active:text-ods-accent-active disabled:bg-transparent disabled:text-ods-text-disabled aria-disabled:bg-transparent aria-disabled:text-ods-text-disabled',\n // Chrome that sits ON media (video cards, image lightboxes): a scrim disc so\n // the glyph stays legible over an arbitrary frame. Promoted to a variant\n // because the walkthrough card, its theater and the bite cards were each\n // stacking the same classes at the call site.\n overlay:\n 'rounded-full bg-ods-overlay text-ods-text-primary backdrop-blur-sm hover:text-ods-accent active:text-ods-accent-active disabled:text-ods-text-disabled aria-disabled:text-ods-text-disabled',\n} as const;\n\nexport const outlineBorderClasses =\n 'border border-ods-border hover:border-ods-border-hover active:border-ods-border-active disabled:border-ods-border aria-disabled:border-ods-border';\n\n// Glyph scale for the split-layout button family: 16px below md, 24px from md.\n//\n// Shared because the same page-header action renders through EITHER of the two\n// split layouts depending on its shape — `SplitButton` for two click targets, and\n// `Button` + `splitIcon` for one with a decorative trailing glyph — and the two sit\n// side by side in the same row. They used to disagree: `SplitButton` carried this\n// responsive scale while the `Button` split slots re-declared a flat 20px, so a\n// \"submenu\" action's icons rendered 4px smaller than its neighbour's on desktop.\n// `Button`'s own flat `[&_svg]:h-5` stays as it is for ordinary (non-split) buttons.\nexport const splitGlyphSizeClasses = '[&_svg]:h-4 [&_svg]:w-4 md:[&_svg]:h-6 md:[&_svg]:w-6';\n\n// Per-size glyph scale for `Button`'s split slots AND the loading overlay that\n// covers them, so those two read from ONE place — the overlay sits outside both\n// slots and inherits neither their sizing nor a shell base rule, so without this it\n// would have to restate a number, which is the divergence described above.\n//\n// Scoped to `Button` on purpose: `SplitButton` keeps its own `small` ramp\n// (12px → 16px, vs the flat 16px here) and only shares the `default` step through\n// `splitGlyphSizeClasses`. Aligning `small` too is a visible design change, so it is\n// not folded in here silently.\nexport const splitGlyphSizeBySize = {\n default: splitGlyphSizeClasses,\n small: '[&_svg]:h-4 [&_svg]:w-4',\n} as const;\n\n// Color of the vertical seam between the main and icon halves (split layouts).\nexport const splitDividerColorClasses = {\n accent: 'border-ods-accent-active',\n outline: 'border-ods-border',\n transparent: 'border-ods-border',\n destructive: 'border-ods-error-active',\n warning: 'border-ods-warning-active',\n} as const;\n\nexport type ButtonSurfaceVariant = keyof typeof buttonSurfaceClasses;\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport React from 'react';\nimport Link from '../../../embed-shims/next-link';\nimport { cn } from '../../../utils/cn';\nimport { buttonSurfaceClasses, splitDividerColorClasses, splitGlyphSizeClasses } from './button-styles';\n\n// Two independent interactive halves: each a `<button>` or `<a>`. The seam is\n// a 1px border on the left edge of the icon half, colored per variant. For a\n// single-target variant (decorative trailing icon), use `<Button splitIcon>`.\n\nconst splitHalfBase = [\n 'relative inline-flex items-center justify-center gap-[var(--spacing-system-xsf)]',\n 'whitespace-nowrap transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-focus focus-visible:z-10',\n 'disabled:pointer-events-none',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n];\n\nconst splitHalfVariants = cva(splitHalfBase, {\n variants: {\n variant: {\n accent: buttonSurfaceClasses.accent,\n outline: buttonSurfaceClasses.outline, // Outline border lives in compoundVariants so we can omit the seam edge.\n transparent: buttonSurfaceClasses.transparent,\n destructive: buttonSurfaceClasses.destructive,\n warning: buttonSurfaceClasses.warning,\n },\n size: {\n default: `h-10 px-[var(--spacing-system-m)] py-[var(--spacing-system-sf)] text-h3 md:h-12 ${splitGlyphSizeClasses}`,\n small: 'h-6 px-[var(--spacing-system-xs)] text-h5 md:h-8 [&_svg]:h-3 [&_svg]:w-3 md:[&_svg]:h-4 md:[&_svg]:w-4',\n },\n side: { main: '', icon: '' },\n soloOnMobile: { true: '', false: '' },\n },\n compoundVariants: [\n // Rounded corners + per-variant seam. The icon-side's left border is the divider.\n { variant: 'accent', side: 'main', class: 'rounded-l-md' },\n {\n variant: 'accent',\n side: 'icon',\n class: cn(\n 'rounded-r-md border-l',\n splitDividerColorClasses.accent,\n 'disabled:border-ods-disabled aria-disabled:border-ods-disabled',\n ),\n },\n { variant: 'destructive', side: 'main', class: 'rounded-l-md' },\n {\n variant: 'destructive',\n side: 'icon',\n class: cn(\n 'rounded-r-md border-l',\n splitDividerColorClasses.destructive,\n 'disabled:border-ods-disabled aria-disabled:border-ods-disabled',\n ),\n },\n { variant: 'warning', side: 'main', class: 'rounded-l-md' },\n {\n variant: 'warning',\n side: 'icon',\n class: cn(\n 'rounded-r-md border-l',\n splitDividerColorClasses.warning,\n 'disabled:border-ods-disabled aria-disabled:border-ods-disabled',\n ),\n },\n { variant: 'outline', side: 'main', class: 'rounded-l-md border-y border-l border-ods-border' },\n { variant: 'outline', side: 'icon', class: 'rounded-r-md border border-ods-border' },\n { variant: 'transparent', side: 'main', class: 'rounded-md' },\n { variant: 'transparent', side: 'icon', class: cn('rounded-md', splitDividerColorClasses.transparent) },\n\n // Icon half: per Figma, narrower than main height (default: 40×48; small: 32×32).\n { side: 'icon', size: 'default', class: 'w-10 px-0' },\n { side: 'icon', size: 'small', class: 'w-6 px-0 md:w-8' },\n\n { side: 'icon', soloOnMobile: true, class: 'max-md:hidden' },\n { side: 'main', soloOnMobile: true, class: 'max-md:rounded-r-md' },\n { variant: 'outline', side: 'main', soloOnMobile: true, class: 'max-md:border-r' },\n ],\n defaultVariants: { variant: 'accent', size: 'default', side: 'main', soloOnMobile: false },\n});\n\ntype SplitButtonVariant = NonNullable<VariantProps<typeof splitHalfVariants>['variant']>;\ntype SplitButtonSize = NonNullable<VariantProps<typeof splitHalfVariants>['size']>;\n\ninterface SplitButtonIconAction {\n icon: React.ReactNode;\n /** The icon half is interactive but has no visible text — needs an accessible name. */\n 'aria-label': string;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n href?: string;\n /**\n * Opens `href` with `target=\"_blank\"`. Also marks the half as a new-tab\n * affordance, which hides it below `md` (set it for `onClick` handlers that\n * open a new tab/window themselves).\n */\n openInNewTab?: boolean;\n prefetch?: boolean;\n disabled?: boolean;\n}\n\ninterface SplitButtonProps {\n variant?: SplitButtonVariant;\n size?: SplitButtonSize;\n fullWidth?: boolean;\n className?: string;\n\n children: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n href?: string;\n openInNewTab?: boolean;\n prefetch?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n /** Disables both halves. Equivalent to `mainDisabled && iconAction.disabled`. */\n disabled?: boolean;\n /** Disables only the main half. Combine with `iconAction.disabled` for finer control. */\n mainDisabled?: boolean;\n type?: 'button' | 'submit' | 'reset';\n 'aria-label'?: string;\n groupAriaLabel?: string;\n\n iconAction: SplitButtonIconAction;\n}\n\ninterface HalfOptions {\n variant: SplitButtonVariant;\n size: SplitButtonSize;\n side: 'main' | 'icon';\n soloOnMobile?: boolean;\n href?: string;\n openInNewTab?: boolean;\n prefetch?: boolean;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n disabled?: boolean;\n /** Stretch this half to fill the group's free space (the icon half stays fixed-width). */\n grow?: boolean;\n type?: 'button' | 'submit' | 'reset';\n ariaLabel?: string;\n children: React.ReactNode;\n}\n\nfunction Half({\n variant,\n size,\n side,\n soloOnMobile,\n href,\n openInNewTab,\n prefetch,\n onClick,\n disabled,\n grow,\n type = 'button',\n ariaLabel,\n children,\n}: HalfOptions) {\n const classes = cn(splitHalfVariants({ variant, size, side, soloOnMobile }), grow && 'flex-1');\n\n if (href) {\n return (\n <Link\n href={href}\n prefetch={prefetch}\n target={openInNewTab ? '_blank' : undefined}\n rel={openInNewTab ? 'noopener noreferrer' : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n aria-label={ariaLabel}\n className={cn(classes, disabled && 'pointer-events-none')}\n onClick={onClick}\n >\n {children}\n </Link>\n );\n }\n\n return (\n <button type={type} className={classes} disabled={disabled} aria-label={ariaLabel} onClick={onClick}>\n {children}\n </button>\n );\n}\n\nconst SplitButton = React.forwardRef<HTMLDivElement, SplitButtonProps>(function SplitButtonImpl(\n {\n variant = 'accent',\n size = 'default',\n fullWidth = false,\n className,\n children,\n onClick,\n href,\n openInNewTab,\n prefetch,\n leftIcon,\n rightIcon,\n disabled,\n mainDisabled,\n type,\n iconAction,\n 'aria-label': ariaLabel,\n groupAriaLabel,\n },\n ref,\n) {\n const soloOnMobile = !!iconAction.openInNewTab;\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-label={groupAriaLabel}\n className={cn('inline-flex items-stretch', fullWidth && 'w-full', className)}\n >\n <Half\n variant={variant}\n size={size}\n side=\"main\"\n soloOnMobile={soloOnMobile}\n href={href}\n openInNewTab={openInNewTab}\n prefetch={prefetch}\n onClick={onClick}\n disabled={disabled || mainDisabled}\n grow={fullWidth}\n type={type}\n ariaLabel={ariaLabel}\n >\n {leftIcon && <span className=\"inline-flex items-center\">{leftIcon}</span>}\n <span>{children}</span>\n {rightIcon && <span className=\"inline-flex items-center\">{rightIcon}</span>}\n </Half>\n <Half\n variant={variant}\n size={size}\n side=\"icon\"\n soloOnMobile={soloOnMobile}\n href={iconAction.href}\n openInNewTab={iconAction.openInNewTab}\n prefetch={iconAction.prefetch}\n onClick={iconAction.onClick}\n disabled={disabled || iconAction.disabled}\n ariaLabel={iconAction['aria-label']}\n >\n <span className=\"inline-flex items-center\">{iconAction.icon}</span>\n </Half>\n </div>\n );\n});\nSplitButton.displayName = 'SplitButton';\n\nexport { SplitButton, type SplitButtonProps, type SplitButtonIconAction };\n"],"mappings":";;;;;;;;;AAEA,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,OAAO,WAAW;;;ACCX,IAAM,uBAAuB;AAAA,EAClC,QACE;AAAA,EACF,SACE;AAAA,EACF,aACE;AAAA,EACF,aACE;AAAA,EACF,SACE;AAAA;AAAA;AAAA;AAAA,EAIF,UACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMF,OACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMF,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,EAKN,SACE;AACJ;AAEO,IAAM,uBACX;AAWK,IAAM,wBAAwB;AAW9B,IAAM,uBAAuB;AAAA,EAClC,SAAS;AAAA,EACT,OAAO;AACT;AAGO,IAAM,2BAA2B;AAAA,EACtC,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AAAA,EACb,SAAS;AACX;;;AD8KE,SAiDI,UAhDF,KADF;AA5OF,IAAM,iBAAiB;AAAA,EACrB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,QAAQ,qBAAqB;AAAA,QAC7B,SAAS,GAAG,qBAAqB,SAAS,oBAAoB;AAAA,QAC9D,aAAa,qBAAqB;AAAA,QAClC,aA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ACA,MAAK;AAAA,YACL;AAAA,YACA,MAAM,WAAW;AAAA,YACjB,cAAc,WAAW;AAAA,YACzB,UAAU,WAAW;AAAA,YACrB,SAAS,WAAW;AAAA,YACpB,UAAU,YAAY,WAAW;AAAA,YACjC,WAAW,WAAW,YAAY;AAAA,YAElC,0BAAAA,KAAC,UAAK,WAAU,4BAA4B,qBAAW,MAAK;AAAA;AAAA,QAC9D;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;AACD,YAAY,cAAc;","names":["cva","React","jsx","jsxs","cva","React"]}
@@ -3,16 +3,16 @@ import {
3
3
  FileDownloadCard,
4
4
  GoogleSheetsViewer,
5
5
  PdfViewer
6
- } from "./chunk-PYNHPMDB.js";
6
+ } from "./chunk-Q7PGQDD4.js";
7
7
  import {
8
8
  MobileNavigationDropdown,
9
9
  MultiLevelNavigation,
10
10
  StickySectionNav
11
- } from "./chunk-VE7HLTVQ.js";
11
+ } from "./chunk-H45GRYL4.js";
12
12
  import {
13
13
  DocSearchBar,
14
14
  useDocSearch
15
- } from "./chunk-LNOXNCEC.js";
15
+ } from "./chunk-3QOEL4WL.js";
16
16
  import {
17
17
  CategorySidebarSkeleton,
18
18
  DEFAULT_FOLDER_INDEX_FILE,
@@ -22,7 +22,7 @@ import {
22
22
  findDocNodeByPath,
23
23
  getDocAncestorNodeIds,
24
24
  stripFolderIndexFromPath
25
- } from "./chunk-JBMFCHNT.js";
25
+ } from "./chunk-PMXCBAC4.js";
26
26
  import {
27
27
  contentFetch
28
28
  } from "./chunk-O6BRIUEE.js";
@@ -1098,4 +1098,4 @@ export {
1098
1098
  EmbedSkeleton,
1099
1099
  DocsHubPage
1100
1100
  };
1101
- //# sourceMappingURL=chunk-LF4S37VU.js.map
1101
+ //# sourceMappingURL=chunk-NKKA4KY7.js.map
@@ -5,18 +5,18 @@ var _chunkZSWUCNHVcjs = require('./chunk-ZSWUCNHV.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunk5DBWXJBGcjs = require('./chunk-5DBWXJBG.cjs');
8
+ var _chunkVVTWH4YScjs = require('./chunk-VVTWH4YS.cjs');
9
9
 
10
10
 
11
- var _chunk6CDP6TGHcjs = require('./chunk-6CDP6TGH.cjs');
11
+ var _chunk5TAHPP4Scjs = require('./chunk-5TAHPP4S.cjs');
12
12
 
13
13
 
14
- var _chunkJU6SBF3Ccjs = require('./chunk-JU6SBF3C.cjs');
14
+ var _chunkHT7SU5UNcjs = require('./chunk-HT7SU5UN.cjs');
15
15
 
16
16
 
17
17
 
18
18
 
19
- var _chunkMFU3ALKMcjs = require('./chunk-MFU3ALKM.cjs');
19
+ var _chunkYNAWEA3Gcjs = require('./chunk-YNAWEA3G.cjs');
20
20
 
21
21
 
22
22
 
@@ -30,7 +30,7 @@ var _chunkSADRZ4YIcjs = require('./chunk-SADRZ4YI.cjs');
30
30
  var _chunkDWCV7IDUcjs = require('./chunk-DWCV7IDU.cjs');
31
31
 
32
32
 
33
- var _chunkVCR3TW2Hcjs = require('./chunk-VCR3TW2H.cjs');
33
+ var _chunkTVMY3U3Wcjs = require('./chunk-TVMY3U3W.cjs');
34
34
 
35
35
 
36
36
  var _chunkX7CEWD6Vcjs = require('./chunk-X7CEWD6V.cjs');
@@ -56,7 +56,7 @@ function FaqAccordion({ items, defaultOpenIds = [] }) {
56
56
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
57
57
  "div",
58
58
  {
59
- id: _chunkMFU3ALKMcjs.faqItemAnchor.call(void 0, item.id),
59
+ id: _chunkYNAWEA3Gcjs.faqItemAnchor.call(void 0, item.id),
60
60
  className: "scroll-mt-24 transition-colors hover:bg-ods-bg-hover",
61
61
  children: [
62
62
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -134,7 +134,7 @@ function buildFaqJsonLdFromFaqs(faqs, opts = {}) {
134
134
 
135
135
  var DEFAULT_HEADING_TEXT = "Frequently Asked Questions";
136
136
  function buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl = "") {
137
- return _chunkJU6SBF3Ccjs.buildSuggestionUrl.call(void 0, "/api/faqs", { apiBaseUrl, entityType, entityId, count: minResults });
137
+ return _chunkHT7SU5UNcjs.buildSuggestionUrl.call(void 0, "/api/faqs", { apiBaseUrl, entityType, entityId, count: minResults });
138
138
  }
139
139
  function groupFaqsBySection(faqs) {
140
140
  const byName = /* @__PURE__ */ new Map();
@@ -149,7 +149,7 @@ function groupFaqsBySection(faqs) {
149
149
  }
150
150
  let group = byName.get(name);
151
151
  if (!group) {
152
- group = { section: name, slug: _chunkMFU3ALKMcjs.faqSectionSlug.call(void 0, name), items: [] };
152
+ group = { section: name, slug: _chunkYNAWEA3Gcjs.faqSectionSlug.call(void 0, name), items: [] };
153
153
  byName.set(name, group);
154
154
  }
155
155
  group.items.push(item);
@@ -202,7 +202,7 @@ function GroupedFaqList({
202
202
  }, [slugKey]);
203
203
  const [hashTarget, setHashTarget] = _react.useState.call(void 0, null);
204
204
  _react.useEffect.call(void 0, () => {
205
- const refresh = () => setHashTarget(_chunkMFU3ALKMcjs.parseFaqHash.call(void 0, window.location.hash));
205
+ const refresh = () => setHashTarget(_chunkYNAWEA3Gcjs.parseFaqHash.call(void 0, window.location.hash));
206
206
  refresh();
207
207
  window.addEventListener("hashchange", refresh);
208
208
  return () => window.removeEventListener("hashchange", refresh);
@@ -219,7 +219,7 @@ function GroupedFaqList({
219
219
  }, [groups, hashTarget]);
220
220
  const accordionKeySuffix = _optionalChain([hashTarget, 'optionalAccess', _8 => _8.kind]) === "item" ? `item:${hashTarget.rawId}` : "default";
221
221
  const scrollDep = `${groups.length}|` + (_optionalChain([hashTarget, 'optionalAccess', _9 => _9.kind]) === "item" ? `item:${hashTarget.rawId}` : _optionalChain([hashTarget, 'optionalAccess', _10 => _10.kind]) === "section" ? `section:${hashTarget.slug}` : "none");
222
- _chunk6CDP6TGHcjs.useScrollToHash.call(void 0, scrollDep, { headerOffset: _chunkDMUUWHIIcjs.STICKY_HEADER_OFFSET_PX });
222
+ _chunk5TAHPP4Scjs.useScrollToHash.call(void 0, scrollDep, { headerOffset: _chunkDMUUWHIIcjs.STICKY_HEADER_OFFSET_PX });
223
223
  const [pillSyncedHash, setPillSyncedHash] = _react.useState.call(void 0, hashTarget);
224
224
  if (pillSyncedHash !== hashTarget) {
225
225
  setPillSyncedHash(hashTarget);
@@ -253,7 +253,7 @@ function GroupedFaqList({
253
253
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-10", children: groups.map((group) => {
254
254
  const key = groupKey(group);
255
255
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { id: _nullishCoalesce(group.slug, () => ( void 0)), className: "scroll-mt-24 space-y-4", children: [
256
- group.section && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CategoryHeading, { className: _chunkVCR3TW2Hcjs.SECTION_HEADING_CLASS, children: group.section }),
256
+ group.section && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CategoryHeading, { className: _chunkTVMY3U3Wcjs.SECTION_HEADING_CLASS, children: group.section }),
257
257
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
258
258
  FaqAccordion,
259
259
  {
@@ -294,7 +294,7 @@ function FaqSection({
294
294
  const { data, isLoading, error } = _chunkZSWUCNHVcjs.useSelfFetch.call(void 0, url, { initialData });
295
295
  const faqs = _react.useMemo.call(void 0, () => _nullishCoalesce(_optionalChain([data, 'optionalAccess', _14 => _14.faqs]), () => ( [])), [_optionalChain([data, 'optionalAccess', _15 => _15.faqs])]);
296
296
  const groups = _react.useMemo.call(void 0, () => faqs.length > 0 ? groupFaqsBySection(faqs) : [], [faqs]);
297
- const headingNode = heading === void 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: _chunkVCR3TW2Hcjs.SECTION_HEADING_CLASS, children: DEFAULT_HEADING_TEXT }) : heading;
297
+ const headingNode = heading === void 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: _chunkTVMY3U3Wcjs.SECTION_HEADING_CLASS, children: DEFAULT_HEADING_TEXT }) : heading;
298
298
  if (error) return null;
299
299
  if (!isLoading && faqs.length === 0) return null;
300
300
  if (isLoading && faqs.length === 0) {
@@ -336,7 +336,7 @@ function FaqDocumentPage({
336
336
  label: _nullishCoalesce(_optionalChain([backButton, 'optionalAccess', _16 => _16.label]), () => ( "Back to home")),
337
337
  onClick: () => router.push(_nullishCoalesce(_optionalChain([backButton, 'optionalAccess', _17 => _17.href]), () => ( "/")))
338
338
  };
339
- const inner = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5DBWXJBGcjs.PageLayout, { title, subtitle, backButton: backCfg, titleSize: "h1", titleWrap: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
339
+ const inner = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVVTWH4YScjs.PageLayout, { title, subtitle, backButton: backCfg, titleSize: "h1", titleWrap: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
340
340
  FaqSection,
341
341
  {
342
342
  initialFaqs,
@@ -349,7 +349,7 @@ function FaqDocumentPage({
349
349
  minResults
350
350
  }
351
351
  ) });
352
- return shell ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5DBWXJBGcjs.PageShell, { children: inner }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "page-shell-content", children: inner });
352
+ return shell ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVVTWH4YScjs.PageShell, { children: inner }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "page-shell-content", children: inner });
353
353
  }
354
354
 
355
355
 
@@ -357,4 +357,4 @@ function FaqDocumentPage({
357
357
 
358
358
 
359
359
  exports.FaqAccordion = FaqAccordion; exports.FaqSection = FaqSection; exports.FaqDocumentPage = FaqDocumentPage;
360
- //# sourceMappingURL=chunk-RIDRAKQ5.cjs.map
360
+ //# sourceMappingURL=chunk-OF6FE2KT.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-RIDRAKQ5.cjs","../src/components/faq/faq-section.tsx","../src/components/faq-accordion.tsx","../src/components/faq/json-ld.ts","../src/components/faq/faq-document-page.tsx"],"names":["useState","jsx"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;AClCA,8BAAkE;ADoClE;AACA;AEtCA;AA6CY,+CAAA;AA7BL,SAAS,YAAA,CAAa,EAAE,KAAA,EAAO,eAAA,EAAiB,CAAC,EAAE,CAAA,EAAsB;AAC9E,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,EAAA,EAAI,6BAAA,IAAmC,GAAA,CAAI,cAAc,CAAC,CAAA;AAEpF,EAAA,MAAM,OAAA,EAAS,CAAC,EAAA,EAAA,GAAwB;AACtC,IAAA,UAAA,CAAW,CAAA,IAAA,EAAA,GAAQ;AACjB,MAAA,MAAM,KAAA,EAAO,IAAI,GAAA,CAAI,IAAI,CAAA;AACzB,MAAA,GAAA,CAAI,IAAA,CAAK,GAAA,CAAI,EAAE,CAAA,EAAG,IAAA,CAAK,MAAA,CAAO,EAAE,CAAA;AAAA,MAAA,KAC3B,IAAA,CAAK,GAAA,CAAI,EAAE,CAAA;AAChB,MAAA,OAAO,IAAA;AAAA,IACT,CAAC,CAAA;AAAA,EACH,CAAA;AAEA,EAAA,uBACE,6BAAA,KAAC,EAAA,EAAI,SAAA,EAAU,+FAAA,EACZ,QAAA,EAAA,KAAA,CAAM,GAAA,CAAI,CAAA,IAAA,EAAA,GAAQ;AACjB,IA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D,sBAAA;AACjE,IAAA;AAEEA,IAAAA;AAAC,MAAA;AAAA,MAAA;AACM,QAAA;AAGsD,QAAA;AAAA,MAAA;AAC7D,IAAA;AAEJ,EAAA;AAEJ;ADhGoF;AACA;AIxO9E;AA5B0B;AACtB,EAAA;AACR,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACQ,EAAA;AACe;AACE,EAAA;AAQnB,EAAA;AAC8B,IAAA;AACsB,IAAA;AACpD,EAAA;AAGsD,EAAA;AACvD,IAAA;AAAA,IAAA;AACC,MAAA;AACS,MAAA;AACT,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AAAA,IAAA;AAEJ,EAAA;AAG8C,EAAA;AAClD;AJ6PoF;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-RIDRAKQ5.cjs","sourcesContent":[null,"'use client';\n\nimport type React from 'react';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useScrollToHash } from '../../hooks/use-scroll-to-hash';\nimport { useSelfFetch } from '../../hooks/use-self-fetch';\nimport type { Faq } from '../../types/faq';\nimport { cn } from '../../utils/cn';\nimport { serializeJsonLd } from '../../utils/common';\nimport { faqSectionSlug, parseFaqHash, type FaqHashTarget } from '../../utils/faq-anchor';\nimport { navigateSamePageHash, STICKY_HEADER_OFFSET_PX } from '../../utils/same-page-hash-nav';\nimport { buildSuggestionUrl } from '../../utils/suggestion-url';\nimport { FaqAccordion, type FaqItem } from '../faq-accordion';\nimport { SECTION_HEADING_CLASS } from '../layout/page-heading';\nimport { buildFaqJsonLdFromFaqs, type FaqSchemaOptions } from './json-ld';\n\nexport interface FaqSectionProps {\n /**\n * SSR hydrate. When provided, the hook skips the first client fetch (per\n * useSelfFetch contract). The consuming server page resolves FAQs then drills\n * them into this prop — the lib never re-fetches what the host already gated on.\n */\n initialFaqs?: Faq[];\n /** Both required together for entity-attached FAQs; partial → bare /api/faqs. */\n entityType?: string;\n entityId?: number | string;\n /**\n * Heading node above the grouped list. `undefined` → default\n * `<h2>`\"Frequently Asked Questions\". `null` → no heading (the host page\n * owns the `<h1>`, as the standalone /faqs surface does). A React node lets a\n * platform drill its own <PageHeading> without the lib referencing platform\n * state. Also drives category nesting so the document outline stays correct:\n * `null` → categories render `<h2>` (directly under the page `<h1>`);\n * otherwise categories render `<h3>` beneath this heading.\n */\n heading?: React.ReactNode | null;\n /** Inject FAQPage schema.org JSON-LD as a <script>. Off by default so embeds\n * don't emit duplicate schema. */\n emitJsonLd?: boolean;\n /** Overrides for the JSON-LD's name/description/url. */\n jsonLd?: FaqSchemaOptions;\n className?: string;\n /** Maps to /api/faqs `?count=` (the 5-tier fill target). Absent → param\n * not sent (server default applies). */\n minResults?: number;\n /** Fetch-URL prefix for third-party embeds / reverse proxies\n * ('' = same-origin relative). */\n apiBaseUrl?: string;\n}\n\nconst DEFAULT_HEADING_TEXT = 'Frequently Asked Questions';\n\n/** URL composition shared with RelatedContentSection (`buildSuggestionUrl`)\n * — byte-identical to the historical `buildFaqsUrl` output when\n * `minResults`/`apiBaseUrl` are absent. */\nfunction buildFaqsUrl(entityType?: string, entityId?: number | string, minResults?: number, apiBaseUrl = ''): string {\n return buildSuggestionUrl('/api/faqs', { apiBaseUrl, entityType, entityId, count: minResults });\n}\n\ninterface FaqGroup {\n /** null → the uncategorized bucket: no heading, no jump pill, rendered last. */\n section: string | null;\n slug: string | null;\n items: FaqItem[];\n}\n\n/** Group FAQs by `faq.section`, preserving the server's first-seen\n * (display_order) order for BOTH the section order and the rows within each\n * section. The uncategorized bucket (blank/missing section) sinks to the end\n * since it renders without a heading. Items carry NO badge here — the `<h2>`\n * IS the category, so a per-row chip would be redundant. */\nfunction groupFaqsBySection(faqs: Faq[]): FaqGroup[] {\n // A Map iterates in insertion order, which is exactly the first-seen section\n // order this function promises — so the Map IS the ordering, and no parallel\n // array of names (plus a lookup that has to assert the key back) is needed.\n const byName = new Map<string, FaqGroup>();\n let uncategorized: FaqGroup | null = null;\n for (const faq of faqs) {\n const item: FaqItem = { id: faq.id, question: faq.question, answer: faq.answer };\n const name = faq.section?.trim();\n if (!name) {\n if (!uncategorized) uncategorized = { section: null, slug: null, items: [] };\n uncategorized.items.push(item);\n continue;\n }\n let group = byName.get(name);\n if (!group) {\n group = { section: name, slug: faqSectionSlug(name), items: [] };\n byName.set(name, group);\n }\n group.items.push(item);\n }\n const groups = [...byName.values()];\n if (uncategorized) groups.push(uncategorized);\n return groups;\n}\n\n/** Map key for the uncategorized bucket — `group.slug` is null for it, so\n * every per-group map (default-open ids, accordion keys) uses this sentinel\n * to keep the lookup typed. */\nconst UNCATEGORIZED_KEY = '__uncategorized__';\nconst groupKey = (g: FaqGroup): string => g.slug ?? UNCATEGORIZED_KEY;\n\n/**\n * Grouped FAQ layout: a category jump-nav above stacked `<h2>` category\n * sections (each its own accordion). Isolated into its own component so the\n * scroll-spy hooks only mount in grouped mode — `FaqSection`'s own hooks stay\n * unconditional.\n *\n * The pills are real `<a href=\"#slug\">` anchors (crawlable in-page links,\n * deep-linkable, work without JS); the click handler upgrades the jump to the\n * cancellation-proof `scrollElementIntoView` tween and syncs the URL hash.\n */\nfunction GroupedFaqList({\n groups,\n categoryHeadingAs,\n}: {\n groups: FaqGroup[];\n /** Heading tag for each category, so the document outline nests correctly\n * under whatever owns the heading above this block: `h2` on the standalone\n * page (the page owns the `<h1>`), `h3` beneath an embed's `<h2>` title.\n * The VISUAL is `SECTION_HEADING_CLASS` either way, so categories look\n * identical on every surface. */\n categoryHeadingAs: 'h2' | 'h3';\n}) {\n const CategoryHeading = categoryHeadingAs;\n const navGroups = useMemo(() => groups.filter(g => g.slug), [groups]);\n const [activeSlug, setActiveSlug] = useState<string | null>(navGroups[0]?.slug ?? null);\n // Identity-stable key for the section set so the observer re-binds only when\n // the categories actually change (not on every parent re-render).\n const slugKey = navGroups.map(g => g.slug).join('|');\n // Latest `navGroups` for the scroll-spy observer below, which re-observes on\n // `slugKey` (the section SET) and must not re-run when the array is merely\n // rebuilt with the same slugs.\n const navGroupsRef = useRef(navGroups);\n useEffect(() => {\n navGroupsRef.current = navGroups;\n });\n\n // Scroll-spy: mark the pill for the category currently at the top of the\n // viewport. rootMargin drops the trigger line just below the sticky header\n // and ignores the bottom ~55% so \"active\" is the section being read, not the\n // next one peeking in.\n useEffect(() => {\n if (navGroupsRef.current.length < 2) return undefined;\n const tops = new Map<string, number>();\n const observer = new IntersectionObserver(\n entries => {\n for (const entry of entries) {\n const id = (entry.target as HTMLElement).id;\n if (entry.isIntersecting) tops.set(id, entry.boundingClientRect.top);\n else tops.delete(id);\n }\n let bestId: string | null = null;\n let bestTop = Number.POSITIVE_INFINITY;\n for (const [id, top] of tops) {\n if (top < bestTop) {\n bestTop = top;\n bestId = id;\n }\n }\n if (bestId) setActiveSlug(bestId);\n },\n { rootMargin: `-${STICKY_HEADER_OFFSET_PX}px 0px -55% 0px`, threshold: 0 },\n );\n for (const group of navGroupsRef.current) {\n const el = group.slug ? document.getElementById(group.slug) : null;\n if (el) observer.observe(el);\n }\n return () => observer.disconnect();\n // slugKey encodes the section set; re-observe only when it changes.\n }, [slugKey]);\n\n // ─── Hash dispatch — `/faqs#faq-item-<id>` or `/faqs#faq-<section-slug>` ──\n // Tracks the current hash so:\n // 1. an item-kind hash seeds `defaultOpenIds` on the matching accordion\n // (auto-expands the cited question);\n // 2. either kind triggers the cancellation-proof tween scroll with the\n // sticky-header offset (native browser hash scroll runs once, ignores\n // our offset — re-running the tween puts the target in the right spot).\n // Listens to `hashchange` so back/forward replays the same behavior. SSR-\n // safe: initial null state matches the server render; the first effect\n // tick on the client updates it.\n const [hashTarget, setHashTarget] = useState<FaqHashTarget | null>(null);\n useEffect(() => {\n const refresh = () => setHashTarget(parseFaqHash(window.location.hash));\n refresh();\n window.addEventListener('hashchange', refresh);\n return () => window.removeEventListener('hashchange', refresh);\n }, []);\n\n // Per-group default-open set when the hash points at an item. The map key\n // matches `groupKey(group)` so the render-time lookup is O(1) per group.\n const defaultOpenByGroupKey = useMemo(() => {\n if (hashTarget?.kind !== 'item') return null;\n const targetId = hashTarget.rawId;\n const result = new Map<string, (string | number)[]>();\n for (const group of groups) {\n const hit = group.items.find(i => String(i.id) === targetId);\n if (hit) result.set(groupKey(group), [hit.id]);\n }\n return result.size > 0 ? result : null;\n }, [groups, hashTarget]);\n\n // Accordion is uncontrolled — `defaultOpenIds` is only consumed at mount,\n // so a new item hash needs a remount to honor it. Keying off the item-id\n // suffix triggers exactly the remount we need (and stays stable when the\n // hash points at a section, so category navigation never disturbs the\n // accordion's open state).\n const accordionKeySuffix = hashTarget?.kind === 'item' ? `item:${hashTarget.rawId}` : 'default';\n\n // Unified scroll-to-hash: rAF-polls for the target row (outlasts the SWR self-fetch\n // + Radix accordion expand) and re-fires on `hashchange` — including the synthetic\n // event `navigateSamePageHash` dispatches for a SOFT same-page chat-card nav (a\n // host-router `pushState` fires no `hashchange`). The ready-dep keys off BOTH the\n // loaded `groups` (so a deep-link / refresh scrolls once the self-fetched list\n // mounts) AND `hashTarget` (so a soft nav re-runs the scroll AFTER the re-render\n // that remounts + opens the cited row, landing on its FINAL expanded position\n // instead of racing the uncontrolled accordion's key-remount — the bare-`hashchange`\n // listener alone fires before the remount and lands on the stale closed position).\n const scrollDep =\n `${groups.length}|` +\n (hashTarget?.kind === 'item'\n ? `item:${hashTarget.rawId}`\n : hashTarget?.kind === 'section'\n ? `section:${hashTarget.slug}`\n : 'none');\n useScrollToHash(scrollDep, { headerOffset: STICKY_HEADER_OFFSET_PX });\n\n // A section hash also lights up its category pill; item hashes leave the pills\n // untouched so deep-linking a question never disturbs scroll-spy state.\n //\n // Adjusted while rendering (React's prop-sync pattern) rather than from an\n // effect: the pills below read `activeSlug` in THIS render, so an effect\n // painted the OLD pill lit and then re-rendered to move the highlight. The\n // initial value matches `hashTarget`'s own initial `null`, so a mount is a\n // no-op here exactly as the effect's first run was.\n const [pillSyncedHash, setPillSyncedHash] = useState(hashTarget);\n if (pillSyncedHash !== hashTarget) {\n setPillSyncedHash(hashTarget);\n if (hashTarget?.kind === 'section') setActiveSlug(hashTarget.slug);\n }\n\n // Category pill click. `navigateSamePageHash` owns the entire transition:\n // replaceState → synthetic `hashchange` → `scrollElementIntoView` tween\n // with `STICKY_HEADER_OFFSET_PX` so the section heading lands BELOW the\n // sticky category nav on the FIRST tween (covers the same-target\n // re-click case, where the `hashTarget` effect at L214 is a no-op\n // because the state reference is equal). For DIFFERENT-target clicks\n // the helper's synthetic `hashchange` re-fires that effect, which\n // re-scrolls with the same offset and cancels this tween (singleton)\n // — both paths land at the same position. The effect is still\n // required for back/forward + direct URL edits, where the helper\n // isn't in the call chain.\n //\n // `history: 'replace'` matches the pre-helper behavior: category pills\n // are a TOC, not a navigation step, so the Back button leaves the\n // FAQ page in one step regardless of how many categories the user\n // clicked through.\n const handleJump = useCallback((e: React.MouseEvent<HTMLAnchorElement>, slug: string) => {\n e.preventDefault();\n navigateSamePageHash('#' + slug, {\n headerOffset: STICKY_HEADER_OFFSET_PX,\n history: 'replace',\n });\n }, []);\n\n return (\n <div className=\"space-y-8\">\n {navGroups.length > 1 && (\n <nav aria-label=\"FAQ categories\" className=\"flex flex-wrap gap-2\">\n {navGroups.map(group => {\n const isActive = group.slug === activeSlug;\n return (\n <a\n key={group.slug}\n href={`#${group.slug}`}\n aria-current={isActive ? 'true' : undefined}\n onClick={e => handleJump(e, group.slug as string)}\n className={cn(\n 'rounded-full border px-4 py-2 transition-colors text-h6',\n isActive\n ? 'border-ods-text-primary bg-ods-card text-ods-text-primary'\n : 'border-ods-border bg-ods-card text-ods-text-secondary hover:border-ods-text-secondary hover:text-ods-text-primary',\n )}\n >\n {group.section}\n </a>\n );\n })}\n </nav>\n )}\n <div className=\"space-y-10\">\n {groups.map(group => {\n const key = groupKey(group);\n return (\n <section key={key} id={group.slug ?? undefined} className=\"scroll-mt-24 space-y-4\">\n {group.section && <CategoryHeading className={SECTION_HEADING_CLASS}>{group.section}</CategoryHeading>}\n <FaqAccordion\n // Re-key on item-hash changes so the remount picks up the new\n // `defaultOpenIds` (the accordion is uncontrolled). Stable for\n // section hashes — category navigation doesn't disturb state.\n key={`${key}:${accordionKeySuffix}`}\n items={group.items}\n defaultOpenIds={defaultOpenByGroupKey?.get(key)}\n />\n </section>\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction FaqSkeleton() {\n return (\n <div className=\"animate-pulse space-y-8\">\n <div className=\"h-12 w-2/3 rounded bg-ods-border md:h-14\" />\n <div className=\"w-full divide-y divide-ods-border overflow-hidden rounded-md border border-ods-border bg-transparent\">\n {Array.from({ length: 8 }).map((_, idx) => (\n <div key={idx} className=\"flex items-center justify-between gap-6 px-6 py-4 md:gap-10\">\n <div className=\"h-6 w-5/6 rounded bg-ods-border\" />\n <div className=\"size-6 rounded bg-ods-border\" />\n </div>\n ))}\n </div>\n </div>\n );\n}\n\ninterface FaqsResponse {\n faqs: Faq[];\n}\n\n/**\n * The FAQ display surface — ONE rendering on every host: the list grouped by\n * `faq.section` (each category a heading + its own accordion, with a category\n * jump-nav once there are 2+ categories). There is no flat/ungrouped mode and\n * no page-vs-embedded shell fork; the standalone /faqs page and every embed\n * render through this single path, so they cannot drift.\n *\n * - Standalone /faqs page: pass `initialFaqs` (SSR) + `heading={null}` (the\n * page owns the <h1>) + `emitJsonLd` with `jsonLd` overrides for SEO.\n * - Per-entity embed: pass `entityType` + `entityId` (no `initialFaqs`); the\n * hook self-fetches `GET /api/faqs`, and `heading` is this block's own <h2>.\n *\n * CONTRACT: the consuming app MUST implement `GET /api/faqs`. On a fetch error\n * (or zero FAQs) the component renders nothing so the host page isn't\n * disfigured. The host always supplies the page shell — this renders a bare\n * <section>.\n */\nexport function FaqSection({\n initialFaqs,\n entityType,\n entityId,\n heading,\n emitJsonLd = false,\n jsonLd,\n className,\n minResults,\n apiBaseUrl = '',\n}: FaqSectionProps) {\n const url = buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl);\n // Memoized — useSelfFetch re-syncs on [initialData]; a fresh per-render\n // wrapper object would setState-loop under re-rendering parents.\n const initialData = useMemo<FaqsResponse | undefined>(\n () => (initialFaqs ? { faqs: initialFaqs } : undefined),\n [initialFaqs],\n );\n const { data, isLoading, error } = useSelfFetch<FaqsResponse>(url, { initialData });\n\n // Memoised because the `??` fallback minted a NEW array on every\n // render, which made the memo below re-run every time — i.e. do nothing.\n const faqs = useMemo(() => data?.faqs ?? [], [data?.faqs]);\n // Grouped before the early returns so the hook order stays stable.\n const groups = useMemo(() => (faqs.length > 0 ? groupFaqsBySection(faqs) : []), [faqs]);\n\n // `undefined` → default <h2> title; `null` → the host page owns the <h1>, so\n // no title renders here. `heading === null` also makes the category headings\n // <h2> (directly under the page <h1>); otherwise they nest as <h3>.\n const headingNode =\n heading === undefined ? <h2 className={SECTION_HEADING_CLASS}>{DEFAULT_HEADING_TEXT}</h2> : heading;\n\n // Degrade silently — never show an error banner or an empty section shell\n // where FAQs would be (host pages and the standalone surface both rely on it).\n if (error) return null;\n if (!isLoading && faqs.length === 0) return null;\n if (isLoading && faqs.length === 0) {\n return (\n <div className={className}>\n <FaqSkeleton />\n </div>\n );\n }\n\n const schema = emitJsonLd ? buildFaqJsonLdFromFaqs(faqs, jsonLd) : null;\n\n return (\n <>\n <section className={className ?? 'space-y-10'}>\n {headingNode}\n <GroupedFaqList groups={groups} categoryHeadingAs={heading === null ? 'h2' : 'h3'} />\n </section>\n {schema && (\n <script\n type=\"application/ld+json\"\n // serializeJsonLd, NOT raw JSON.stringify — FAQ answers are\n // admin-entered; an embedded \"</script>\" must not break the tag.\n dangerouslySetInnerHTML={{ __html: serializeJsonLd(schema) }}\n />\n )}\n </>\n );\n}\n","'use client';\n\nimport { useState } from 'react';\nimport { cn } from '../utils/cn';\nimport { faqItemAnchor } from '../utils/faq-anchor';\nimport { Chevron02DownIcon } from './icons-v2-generated/arrows/chevron-02-down-icon';\n\nexport interface FaqItem {\n id: number | string;\n question: string;\n answer: string;\n}\n\ninterface FaqAccordionProps {\n items: FaqItem[];\n defaultOpenIds?: (number | string)[];\n}\n\nexport function FaqAccordion({ items, defaultOpenIds = [] }: FaqAccordionProps) {\n const [openSet, setOpenSet] = useState<Set<string | number>>(new Set(defaultOpenIds));\n\n const toggle = (id: string | number) => {\n setOpenSet(prev => {\n const next = new Set(prev);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n };\n\n return (\n <div className=\"divide-y divide-ods-border overflow-hidden rounded-md border border-ods-border bg-transparent\">\n {items.map(item => {\n const isOpen = openSet.has(item.id);\n\n return (\n <div\n key={item.id}\n // Per-row anchor — chat citation chips (`/faqs#faq-item-<id>`) land\n // here via native browser hash scroll AND via `FaqSection`'s tween\n // dispatch. `scroll-mt-24` keeps the row header below the 96px\n // sticky nav offset (matches `<section>`'s scroll-margin for\n // category anchors).\n id={faqItemAnchor(item.id)}\n className=\"scroll-mt-24 transition-colors hover:bg-ods-bg-hover\"\n >\n {/* Header */}\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => toggle(item.id)}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggle(item.id);\n }\n }}\n aria-expanded={isOpen}\n className=\"flex w-full cursor-pointer items-center gap-6 px-6 py-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ods-focus md:gap-10\"\n >\n <h3 className=\"min-w-0 flex-1 break-words\">{item.question}</h3>\n <Chevron02DownIcon\n aria-hidden=\"true\"\n size={24}\n className={cn(\n 'shrink-0 text-ods-text-primary transition-transform duration-300',\n isOpen && 'rotate-180',\n )}\n />\n </div>\n {/* Content wrapper. Collapses with the grid 1fr->0fr transition the\n rest of the design system uses (see AnnouncementBar) rather than\n an animated max-height: measuring `scrollHeight` needed a hook\n PER ROW, which meant calling hooks inside `items.map` — the hook\n order then changed whenever `items` did. Grid needs no\n measurement, and it animates correctly when an answer's height\n changes after mount. */}\n <div\n className=\"grid transition-[grid-template-rows,opacity] duration-300 ease-in-out motion-reduce:transition-none\"\n style={{ gridTemplateRows: isOpen ? '1fr' : '0fr', opacity: isOpen ? 1 : 0 }}\n >\n {/* break-words: FAQ answers render as plain text, so a long URL or\n token has no wrap opportunity — and the row is overflow-hidden,\n which would CLIP it past the viewport on mobile. Mirrors the\n markdown-renderer overflow-wrap fix. */}\n <div className=\"overflow-hidden\">\n <div className=\"break-words px-6 pb-4 text-ods-text-primary text-h4\">{item.answer}</div>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n );\n}\n","/**\n * Pure FAQ JSON-LD builder. No React, no client-only deps — safe to import from\n * Server Components via the `./components/faq` subpath export. (Do NOT import\n * through the root `./components` barrel — that barrel is `\"use client\"` and\n * dragging it into a Server Component would force the client graph into the\n * server.)\n *\n * The hub used to harcode `name`/`description` here for OpenMSP; in the lib we\n * accept overrides so every embedder can supply its own platform branding.\n */\nimport type { Faq } from '../../types/faq';\n\nexport interface FaqSchemaOptions {\n name?: string;\n description?: string;\n url?: string;\n}\n\nconst DEFAULT_NAME = 'Frequently Asked Questions';\nconst DEFAULT_DESCRIPTION = 'Answers to common questions.';\n\nexport function baseFaqSchema(opts: FaqSchemaOptions = {}) {\n return {\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n name: opts.name ?? DEFAULT_NAME,\n description: opts.description ?? DEFAULT_DESCRIPTION,\n ...(opts.url ? { url: opts.url } : {}),\n } as const;\n}\n\nexport function buildFaqJsonLdFromFaqs(faqs: Faq[], opts: FaqSchemaOptions = {}) {\n return {\n ...baseFaqSchema(opts),\n mainEntity: faqs.map(faq => ({\n '@type': 'Question',\n name: faq.question,\n acceptedAnswer: {\n '@type': 'Answer',\n text: faq.answer,\n },\n })),\n } as const;\n}\n","'use client';\n\n/**\n * FaqDocumentPage — the full `/faqs` page with chrome, so embedders drop in\n * ONE component instead of hand-assembling `PageShell` + `PageLayout` around\n * the bare `<FaqSection>`. Mirrors `LegalDocumentPage` / `DevSectionPage`: the\n * page-level layout lives in the lib, the host page is a thin wrapper that\n * passes only config + the SSR-resolved data.\n *\n * HERO: the title + subtitle route through the canonical (frozen) `PageLayout`\n * `TitleBlock` with `titleSize=\"h1\"` — the unified Help Center header (the\n * `TitleBlock` element is always an `<h1>`; `titleSize` only sets its typography,\n * here `text-h1`). The page owns that `<h1>`, so `<FaqSection heading={null}>`\n * nests its category headings as `<h2>`/`<h3>` (the SEO-recommended FAQ document\n * outline).\n *\n * DATA: pass `initialFaqs` (SSR-resolved, platform-scoped) so `FaqSection`\n * skips its client self-fetch — the standalone page's static platform-only\n * contract. Omit it for embeds that want the self-fetching `/api/faqs`\n * suggestion-fill instead.\n */\n\nimport { useRouter } from '../../embed-shims/next-navigation';\nimport type { Faq } from '../../types/faq';\nimport { PageShell, PageLayout } from '../ui';\nimport { FaqSection } from './faq-section';\nimport type { FaqSchemaOptions } from './json-ld';\n\nexport interface FaqDocumentPageProps {\n /** Page title (frozen `PageLayout` `TitleBlock`). Default \"Frequently Asked Questions\". */\n title?: string;\n /** Subtitle under the title. */\n subtitle?: string;\n /** Back-button config — same pattern as `DevSectionPage` / `LegalDocumentPage`.\n * Pass `false` to hide. Default `{ label: 'Back to home', href: '/' }`. */\n backButton?: { label?: string; href?: string } | false;\n /** Render the standalone `<PageShell>` (own `<main>` + bg + max-width). Default\n * true. Pass false when the host layout already provides the page container\n * (e.g. openframe-frontend's `AppLayout` `<main>`) — only the padding box\n * renders, avoiding a nested `<main>`. */\n shell?: boolean;\n /** SSR-hydrate `FaqSection` (skips the client fetch — the platform-only\n * contract for the standalone page). Omit for self-fetching embeds. */\n initialFaqs?: Faq[];\n /** Emit FAQPage schema.org JSON-LD (forwarded to `FaqSection`). Off by\n * default so embeds don't emit duplicate schema. */\n emitJsonLd?: boolean;\n /** JSON-LD name/description/url overrides (forwarded to `FaqSection`). */\n jsonLd?: FaqSchemaOptions;\n /** Base URL `FaqSection` appends `/api/faqs` to (reverse-proxy embedders). */\n apiBaseUrl?: string;\n /** Optional entity scoping forwarded to `FaqSection`. */\n entityType?: string;\n entityId?: number | string;\n /** Minimum FAQ count before the section renders (forwarded to `FaqSection`). */\n minResults?: number;\n}\n\nexport function FaqDocumentPage({\n title = 'Frequently Asked Questions',\n subtitle,\n backButton,\n initialFaqs,\n emitJsonLd,\n jsonLd,\n apiBaseUrl,\n entityType,\n entityId,\n minResults,\n shell = true,\n}: FaqDocumentPageProps) {\n const router = useRouter();\n\n // Back-button config — mirrors LegalDocumentPage / DevSectionPage. Hide\n // entirely when the caller passes `false` (embed-mode where the host owns\n // nav chrome).\n const backCfg =\n backButton === false\n ? undefined\n : {\n label: backButton?.label ?? 'Back to home',\n onClick: () => router.push(backButton?.href ?? '/'),\n };\n\n const inner = (\n <PageLayout title={title} subtitle={subtitle} backButton={backCfg} titleSize=\"h1\" titleWrap>\n <FaqSection\n initialFaqs={initialFaqs}\n heading={null}\n emitJsonLd={emitJsonLd}\n jsonLd={jsonLd}\n apiBaseUrl={apiBaseUrl}\n entityType={entityType}\n entityId={entityId}\n minResults={minResults}\n />\n </PageLayout>\n );\n\n return shell ? <PageShell>{inner}</PageShell> : <div className=\"page-shell-content\">{inner}</div>;\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-OF6FE2KT.cjs","../src/components/faq/faq-section.tsx","../src/components/faq-accordion.tsx","../src/components/faq/json-ld.ts","../src/components/faq/faq-document-page.tsx"],"names":["useState","jsx"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,w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,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AAAA,IAAA;AAEJ,EAAA;AAG8C,EAAA;AAClD;AJ6PoF;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-OF6FE2KT.cjs","sourcesContent":[null,"'use client';\n\nimport type React from 'react';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useScrollToHash } from '../../hooks/use-scroll-to-hash';\nimport { useSelfFetch } from '../../hooks/use-self-fetch';\nimport type { Faq } from '../../types/faq';\nimport { cn } from '../../utils/cn';\nimport { serializeJsonLd } from '../../utils/common';\nimport { faqSectionSlug, parseFaqHash, type FaqHashTarget } from '../../utils/faq-anchor';\nimport { navigateSamePageHash, STICKY_HEADER_OFFSET_PX } from '../../utils/same-page-hash-nav';\nimport { buildSuggestionUrl } from '../../utils/suggestion-url';\nimport { FaqAccordion, type FaqItem } from '../faq-accordion';\nimport { SECTION_HEADING_CLASS } from '../layout/page-heading';\nimport { buildFaqJsonLdFromFaqs, type FaqSchemaOptions } from './json-ld';\n\nexport interface FaqSectionProps {\n /**\n * SSR hydrate. When provided, the hook skips the first client fetch (per\n * useSelfFetch contract). The consuming server page resolves FAQs then drills\n * them into this prop — the lib never re-fetches what the host already gated on.\n */\n initialFaqs?: Faq[];\n /** Both required together for entity-attached FAQs; partial → bare /api/faqs. */\n entityType?: string;\n entityId?: number | string;\n /**\n * Heading node above the grouped list. `undefined` → default\n * `<h2>`\"Frequently Asked Questions\". `null` → no heading (the host page\n * owns the `<h1>`, as the standalone /faqs surface does). A React node lets a\n * platform drill its own <PageHeading> without the lib referencing platform\n * state. Also drives category nesting so the document outline stays correct:\n * `null` → categories render `<h2>` (directly under the page `<h1>`);\n * otherwise categories render `<h3>` beneath this heading.\n */\n heading?: React.ReactNode | null;\n /** Inject FAQPage schema.org JSON-LD as a <script>. Off by default so embeds\n * don't emit duplicate schema. */\n emitJsonLd?: boolean;\n /** Overrides for the JSON-LD's name/description/url. */\n jsonLd?: FaqSchemaOptions;\n className?: string;\n /** Maps to /api/faqs `?count=` (the 5-tier fill target). Absent → param\n * not sent (server default applies). */\n minResults?: number;\n /** Fetch-URL prefix for third-party embeds / reverse proxies\n * ('' = same-origin relative). */\n apiBaseUrl?: string;\n}\n\nconst DEFAULT_HEADING_TEXT = 'Frequently Asked Questions';\n\n/** URL composition shared with RelatedContentSection (`buildSuggestionUrl`)\n * — byte-identical to the historical `buildFaqsUrl` output when\n * `minResults`/`apiBaseUrl` are absent. */\nfunction buildFaqsUrl(entityType?: string, entityId?: number | string, minResults?: number, apiBaseUrl = ''): string {\n return buildSuggestionUrl('/api/faqs', { apiBaseUrl, entityType, entityId, count: minResults });\n}\n\ninterface FaqGroup {\n /** null → the uncategorized bucket: no heading, no jump pill, rendered last. */\n section: string | null;\n slug: string | null;\n items: FaqItem[];\n}\n\n/** Group FAQs by `faq.section`, preserving the server's first-seen\n * (display_order) order for BOTH the section order and the rows within each\n * section. The uncategorized bucket (blank/missing section) sinks to the end\n * since it renders without a heading. Items carry NO badge here — the `<h2>`\n * IS the category, so a per-row chip would be redundant. */\nfunction groupFaqsBySection(faqs: Faq[]): FaqGroup[] {\n // A Map iterates in insertion order, which is exactly the first-seen section\n // order this function promises — so the Map IS the ordering, and no parallel\n // array of names (plus a lookup that has to assert the key back) is needed.\n const byName = new Map<string, FaqGroup>();\n let uncategorized: FaqGroup | null = null;\n for (const faq of faqs) {\n const item: FaqItem = { id: faq.id, question: faq.question, answer: faq.answer };\n const name = faq.section?.trim();\n if (!name) {\n if (!uncategorized) uncategorized = { section: null, slug: null, items: [] };\n uncategorized.items.push(item);\n continue;\n }\n let group = byName.get(name);\n if (!group) {\n group = { section: name, slug: faqSectionSlug(name), items: [] };\n byName.set(name, group);\n }\n group.items.push(item);\n }\n const groups = [...byName.values()];\n if (uncategorized) groups.push(uncategorized);\n return groups;\n}\n\n/** Map key for the uncategorized bucket — `group.slug` is null for it, so\n * every per-group map (default-open ids, accordion keys) uses this sentinel\n * to keep the lookup typed. */\nconst UNCATEGORIZED_KEY = '__uncategorized__';\nconst groupKey = (g: FaqGroup): string => g.slug ?? UNCATEGORIZED_KEY;\n\n/**\n * Grouped FAQ layout: a category jump-nav above stacked `<h2>` category\n * sections (each its own accordion). Isolated into its own component so the\n * scroll-spy hooks only mount in grouped mode — `FaqSection`'s own hooks stay\n * unconditional.\n *\n * The pills are real `<a href=\"#slug\">` anchors (crawlable in-page links,\n * deep-linkable, work without JS); the click handler upgrades the jump to the\n * cancellation-proof `scrollElementIntoView` tween and syncs the URL hash.\n */\nfunction GroupedFaqList({\n groups,\n categoryHeadingAs,\n}: {\n groups: FaqGroup[];\n /** Heading tag for each category, so the document outline nests correctly\n * under whatever owns the heading above this block: `h2` on the standalone\n * page (the page owns the `<h1>`), `h3` beneath an embed's `<h2>` title.\n * The VISUAL is `SECTION_HEADING_CLASS` either way, so categories look\n * identical on every surface. */\n categoryHeadingAs: 'h2' | 'h3';\n}) {\n const CategoryHeading = categoryHeadingAs;\n const navGroups = useMemo(() => groups.filter(g => g.slug), [groups]);\n const [activeSlug, setActiveSlug] = useState<string | null>(navGroups[0]?.slug ?? null);\n // Identity-stable key for the section set so the observer re-binds only when\n // the categories actually change (not on every parent re-render).\n const slugKey = navGroups.map(g => g.slug).join('|');\n // Latest `navGroups` for the scroll-spy observer below, which re-observes on\n // `slugKey` (the section SET) and must not re-run when the array is merely\n // rebuilt with the same slugs.\n const navGroupsRef = useRef(navGroups);\n useEffect(() => {\n navGroupsRef.current = navGroups;\n });\n\n // Scroll-spy: mark the pill for the category currently at the top of the\n // viewport. rootMargin drops the trigger line just below the sticky header\n // and ignores the bottom ~55% so \"active\" is the section being read, not the\n // next one peeking in.\n useEffect(() => {\n if (navGroupsRef.current.length < 2) return undefined;\n const tops = new Map<string, number>();\n const observer = new IntersectionObserver(\n entries => {\n for (const entry of entries) {\n const id = (entry.target as HTMLElement).id;\n if (entry.isIntersecting) tops.set(id, entry.boundingClientRect.top);\n else tops.delete(id);\n }\n let bestId: string | null = null;\n let bestTop = Number.POSITIVE_INFINITY;\n for (const [id, top] of tops) {\n if (top < bestTop) {\n bestTop = top;\n bestId = id;\n }\n }\n if (bestId) setActiveSlug(bestId);\n },\n { rootMargin: `-${STICKY_HEADER_OFFSET_PX}px 0px -55% 0px`, threshold: 0 },\n );\n for (const group of navGroupsRef.current) {\n const el = group.slug ? document.getElementById(group.slug) : null;\n if (el) observer.observe(el);\n }\n return () => observer.disconnect();\n // slugKey encodes the section set; re-observe only when it changes.\n }, [slugKey]);\n\n // ─── Hash dispatch — `/faqs#faq-item-<id>` or `/faqs#faq-<section-slug>` ──\n // Tracks the current hash so:\n // 1. an item-kind hash seeds `defaultOpenIds` on the matching accordion\n // (auto-expands the cited question);\n // 2. either kind triggers the cancellation-proof tween scroll with the\n // sticky-header offset (native browser hash scroll runs once, ignores\n // our offset — re-running the tween puts the target in the right spot).\n // Listens to `hashchange` so back/forward replays the same behavior. SSR-\n // safe: initial null state matches the server render; the first effect\n // tick on the client updates it.\n const [hashTarget, setHashTarget] = useState<FaqHashTarget | null>(null);\n useEffect(() => {\n const refresh = () => setHashTarget(parseFaqHash(window.location.hash));\n refresh();\n window.addEventListener('hashchange', refresh);\n return () => window.removeEventListener('hashchange', refresh);\n }, []);\n\n // Per-group default-open set when the hash points at an item. The map key\n // matches `groupKey(group)` so the render-time lookup is O(1) per group.\n const defaultOpenByGroupKey = useMemo(() => {\n if (hashTarget?.kind !== 'item') return null;\n const targetId = hashTarget.rawId;\n const result = new Map<string, (string | number)[]>();\n for (const group of groups) {\n const hit = group.items.find(i => String(i.id) === targetId);\n if (hit) result.set(groupKey(group), [hit.id]);\n }\n return result.size > 0 ? result : null;\n }, [groups, hashTarget]);\n\n // Accordion is uncontrolled — `defaultOpenIds` is only consumed at mount,\n // so a new item hash needs a remount to honor it. Keying off the item-id\n // suffix triggers exactly the remount we need (and stays stable when the\n // hash points at a section, so category navigation never disturbs the\n // accordion's open state).\n const accordionKeySuffix = hashTarget?.kind === 'item' ? `item:${hashTarget.rawId}` : 'default';\n\n // Unified scroll-to-hash: rAF-polls for the target row (outlasts the SWR self-fetch\n // + Radix accordion expand) and re-fires on `hashchange` — including the synthetic\n // event `navigateSamePageHash` dispatches for a SOFT same-page chat-card nav (a\n // host-router `pushState` fires no `hashchange`). The ready-dep keys off BOTH the\n // loaded `groups` (so a deep-link / refresh scrolls once the self-fetched list\n // mounts) AND `hashTarget` (so a soft nav re-runs the scroll AFTER the re-render\n // that remounts + opens the cited row, landing on its FINAL expanded position\n // instead of racing the uncontrolled accordion's key-remount — the bare-`hashchange`\n // listener alone fires before the remount and lands on the stale closed position).\n const scrollDep =\n `${groups.length}|` +\n (hashTarget?.kind === 'item'\n ? `item:${hashTarget.rawId}`\n : hashTarget?.kind === 'section'\n ? `section:${hashTarget.slug}`\n : 'none');\n useScrollToHash(scrollDep, { headerOffset: STICKY_HEADER_OFFSET_PX });\n\n // A section hash also lights up its category pill; item hashes leave the pills\n // untouched so deep-linking a question never disturbs scroll-spy state.\n //\n // Adjusted while rendering (React's prop-sync pattern) rather than from an\n // effect: the pills below read `activeSlug` in THIS render, so an effect\n // painted the OLD pill lit and then re-rendered to move the highlight. The\n // initial value matches `hashTarget`'s own initial `null`, so a mount is a\n // no-op here exactly as the effect's first run was.\n const [pillSyncedHash, setPillSyncedHash] = useState(hashTarget);\n if (pillSyncedHash !== hashTarget) {\n setPillSyncedHash(hashTarget);\n if (hashTarget?.kind === 'section') setActiveSlug(hashTarget.slug);\n }\n\n // Category pill click. `navigateSamePageHash` owns the entire transition:\n // replaceState → synthetic `hashchange` → `scrollElementIntoView` tween\n // with `STICKY_HEADER_OFFSET_PX` so the section heading lands BELOW the\n // sticky category nav on the FIRST tween (covers the same-target\n // re-click case, where the `hashTarget` effect at L214 is a no-op\n // because the state reference is equal). For DIFFERENT-target clicks\n // the helper's synthetic `hashchange` re-fires that effect, which\n // re-scrolls with the same offset and cancels this tween (singleton)\n // — both paths land at the same position. The effect is still\n // required for back/forward + direct URL edits, where the helper\n // isn't in the call chain.\n //\n // `history: 'replace'` matches the pre-helper behavior: category pills\n // are a TOC, not a navigation step, so the Back button leaves the\n // FAQ page in one step regardless of how many categories the user\n // clicked through.\n const handleJump = useCallback((e: React.MouseEvent<HTMLAnchorElement>, slug: string) => {\n e.preventDefault();\n navigateSamePageHash('#' + slug, {\n headerOffset: STICKY_HEADER_OFFSET_PX,\n history: 'replace',\n });\n }, []);\n\n return (\n <div className=\"space-y-8\">\n {navGroups.length > 1 && (\n <nav aria-label=\"FAQ categories\" className=\"flex flex-wrap gap-2\">\n {navGroups.map(group => {\n const isActive = group.slug === activeSlug;\n return (\n <a\n key={group.slug}\n href={`#${group.slug}`}\n aria-current={isActive ? 'true' : undefined}\n onClick={e => handleJump(e, group.slug as string)}\n className={cn(\n 'rounded-full border px-4 py-2 transition-colors text-h6',\n isActive\n ? 'border-ods-text-primary bg-ods-card text-ods-text-primary'\n : 'border-ods-border bg-ods-card text-ods-text-secondary hover:border-ods-text-secondary hover:text-ods-text-primary',\n )}\n >\n {group.section}\n </a>\n );\n })}\n </nav>\n )}\n <div className=\"space-y-10\">\n {groups.map(group => {\n const key = groupKey(group);\n return (\n <section key={key} id={group.slug ?? undefined} className=\"scroll-mt-24 space-y-4\">\n {group.section && <CategoryHeading className={SECTION_HEADING_CLASS}>{group.section}</CategoryHeading>}\n <FaqAccordion\n // Re-key on item-hash changes so the remount picks up the new\n // `defaultOpenIds` (the accordion is uncontrolled). Stable for\n // section hashes — category navigation doesn't disturb state.\n key={`${key}:${accordionKeySuffix}`}\n items={group.items}\n defaultOpenIds={defaultOpenByGroupKey?.get(key)}\n />\n </section>\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction FaqSkeleton() {\n return (\n <div className=\"animate-pulse space-y-8\">\n <div className=\"h-12 w-2/3 rounded bg-ods-border md:h-14\" />\n <div className=\"w-full divide-y divide-ods-border overflow-hidden rounded-md border border-ods-border bg-transparent\">\n {Array.from({ length: 8 }).map((_, idx) => (\n <div key={idx} className=\"flex items-center justify-between gap-6 px-6 py-4 md:gap-10\">\n <div className=\"h-6 w-5/6 rounded bg-ods-border\" />\n <div className=\"size-6 rounded bg-ods-border\" />\n </div>\n ))}\n </div>\n </div>\n );\n}\n\ninterface FaqsResponse {\n faqs: Faq[];\n}\n\n/**\n * The FAQ display surface — ONE rendering on every host: the list grouped by\n * `faq.section` (each category a heading + its own accordion, with a category\n * jump-nav once there are 2+ categories). There is no flat/ungrouped mode and\n * no page-vs-embedded shell fork; the standalone /faqs page and every embed\n * render through this single path, so they cannot drift.\n *\n * - Standalone /faqs page: pass `initialFaqs` (SSR) + `heading={null}` (the\n * page owns the <h1>) + `emitJsonLd` with `jsonLd` overrides for SEO.\n * - Per-entity embed: pass `entityType` + `entityId` (no `initialFaqs`); the\n * hook self-fetches `GET /api/faqs`, and `heading` is this block's own <h2>.\n *\n * CONTRACT: the consuming app MUST implement `GET /api/faqs`. On a fetch error\n * (or zero FAQs) the component renders nothing so the host page isn't\n * disfigured. The host always supplies the page shell — this renders a bare\n * <section>.\n */\nexport function FaqSection({\n initialFaqs,\n entityType,\n entityId,\n heading,\n emitJsonLd = false,\n jsonLd,\n className,\n minResults,\n apiBaseUrl = '',\n}: FaqSectionProps) {\n const url = buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl);\n // Memoized — useSelfFetch re-syncs on [initialData]; a fresh per-render\n // wrapper object would setState-loop under re-rendering parents.\n const initialData = useMemo<FaqsResponse | undefined>(\n () => (initialFaqs ? { faqs: initialFaqs } : undefined),\n [initialFaqs],\n );\n const { data, isLoading, error } = useSelfFetch<FaqsResponse>(url, { initialData });\n\n // Memoised because the `??` fallback minted a NEW array on every\n // render, which made the memo below re-run every time — i.e. do nothing.\n const faqs = useMemo(() => data?.faqs ?? [], [data?.faqs]);\n // Grouped before the early returns so the hook order stays stable.\n const groups = useMemo(() => (faqs.length > 0 ? groupFaqsBySection(faqs) : []), [faqs]);\n\n // `undefined` → default <h2> title; `null` → the host page owns the <h1>, so\n // no title renders here. `heading === null` also makes the category headings\n // <h2> (directly under the page <h1>); otherwise they nest as <h3>.\n const headingNode =\n heading === undefined ? <h2 className={SECTION_HEADING_CLASS}>{DEFAULT_HEADING_TEXT}</h2> : heading;\n\n // Degrade silently — never show an error banner or an empty section shell\n // where FAQs would be (host pages and the standalone surface both rely on it).\n if (error) return null;\n if (!isLoading && faqs.length === 0) return null;\n if (isLoading && faqs.length === 0) {\n return (\n <div className={className}>\n <FaqSkeleton />\n </div>\n );\n }\n\n const schema = emitJsonLd ? buildFaqJsonLdFromFaqs(faqs, jsonLd) : null;\n\n return (\n <>\n <section className={className ?? 'space-y-10'}>\n {headingNode}\n <GroupedFaqList groups={groups} categoryHeadingAs={heading === null ? 'h2' : 'h3'} />\n </section>\n {schema && (\n <script\n type=\"application/ld+json\"\n // serializeJsonLd, NOT raw JSON.stringify — FAQ answers are\n // admin-entered; an embedded \"</script>\" must not break the tag.\n dangerouslySetInnerHTML={{ __html: serializeJsonLd(schema) }}\n />\n )}\n </>\n );\n}\n","'use client';\n\nimport { useState } from 'react';\nimport { cn } from '../utils/cn';\nimport { faqItemAnchor } from '../utils/faq-anchor';\nimport { Chevron02DownIcon } from './icons-v2-generated/arrows/chevron-02-down-icon';\n\nexport interface FaqItem {\n id: number | string;\n question: string;\n answer: string;\n}\n\ninterface FaqAccordionProps {\n items: FaqItem[];\n defaultOpenIds?: (number | string)[];\n}\n\nexport function FaqAccordion({ items, defaultOpenIds = [] }: FaqAccordionProps) {\n const [openSet, setOpenSet] = useState<Set<string | number>>(new Set(defaultOpenIds));\n\n const toggle = (id: string | number) => {\n setOpenSet(prev => {\n const next = new Set(prev);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n };\n\n return (\n <div className=\"divide-y divide-ods-border overflow-hidden rounded-md border border-ods-border bg-transparent\">\n {items.map(item => {\n const isOpen = openSet.has(item.id);\n\n return (\n <div\n key={item.id}\n // Per-row anchor — chat citation chips (`/faqs#faq-item-<id>`) land\n // here via native browser hash scroll AND via `FaqSection`'s tween\n // dispatch. `scroll-mt-24` keeps the row header below the 96px\n // sticky nav offset (matches `<section>`'s scroll-margin for\n // category anchors).\n id={faqItemAnchor(item.id)}\n className=\"scroll-mt-24 transition-colors hover:bg-ods-bg-hover\"\n >\n {/* Header */}\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => toggle(item.id)}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggle(item.id);\n }\n }}\n aria-expanded={isOpen}\n className=\"flex w-full cursor-pointer items-center gap-6 px-6 py-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ods-focus md:gap-10\"\n >\n <h3 className=\"min-w-0 flex-1 break-words\">{item.question}</h3>\n <Chevron02DownIcon\n aria-hidden=\"true\"\n size={24}\n className={cn(\n 'shrink-0 text-ods-text-primary transition-transform duration-300',\n isOpen && 'rotate-180',\n )}\n />\n </div>\n {/* Content wrapper. Collapses with the grid 1fr->0fr transition the\n rest of the design system uses (see AnnouncementBar) rather than\n an animated max-height: measuring `scrollHeight` needed a hook\n PER ROW, which meant calling hooks inside `items.map` — the hook\n order then changed whenever `items` did. Grid needs no\n measurement, and it animates correctly when an answer's height\n changes after mount. */}\n <div\n className=\"grid transition-[grid-template-rows,opacity] duration-300 ease-in-out motion-reduce:transition-none\"\n style={{ gridTemplateRows: isOpen ? '1fr' : '0fr', opacity: isOpen ? 1 : 0 }}\n >\n {/* break-words: FAQ answers render as plain text, so a long URL or\n token has no wrap opportunity — and the row is overflow-hidden,\n which would CLIP it past the viewport on mobile. Mirrors the\n markdown-renderer overflow-wrap fix. */}\n <div className=\"overflow-hidden\">\n <div className=\"break-words px-6 pb-4 text-ods-text-primary text-h4\">{item.answer}</div>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n );\n}\n","/**\n * Pure FAQ JSON-LD builder. No React, no client-only deps — safe to import from\n * Server Components via the `./components/faq` subpath export. (Do NOT import\n * through the root `./components` barrel — that barrel is `\"use client\"` and\n * dragging it into a Server Component would force the client graph into the\n * server.)\n *\n * The hub used to harcode `name`/`description` here for OpenMSP; in the lib we\n * accept overrides so every embedder can supply its own platform branding.\n */\nimport type { Faq } from '../../types/faq';\n\nexport interface FaqSchemaOptions {\n name?: string;\n description?: string;\n url?: string;\n}\n\nconst DEFAULT_NAME = 'Frequently Asked Questions';\nconst DEFAULT_DESCRIPTION = 'Answers to common questions.';\n\nexport function baseFaqSchema(opts: FaqSchemaOptions = {}) {\n return {\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n name: opts.name ?? DEFAULT_NAME,\n description: opts.description ?? DEFAULT_DESCRIPTION,\n ...(opts.url ? { url: opts.url } : {}),\n } as const;\n}\n\nexport function buildFaqJsonLdFromFaqs(faqs: Faq[], opts: FaqSchemaOptions = {}) {\n return {\n ...baseFaqSchema(opts),\n mainEntity: faqs.map(faq => ({\n '@type': 'Question',\n name: faq.question,\n acceptedAnswer: {\n '@type': 'Answer',\n text: faq.answer,\n },\n })),\n } as const;\n}\n","'use client';\n\n/**\n * FaqDocumentPage — the full `/faqs` page with chrome, so embedders drop in\n * ONE component instead of hand-assembling `PageShell` + `PageLayout` around\n * the bare `<FaqSection>`. Mirrors `LegalDocumentPage` / `DevSectionPage`: the\n * page-level layout lives in the lib, the host page is a thin wrapper that\n * passes only config + the SSR-resolved data.\n *\n * HERO: the title + subtitle route through the canonical (frozen) `PageLayout`\n * `TitleBlock` with `titleSize=\"h1\"` — the unified Help Center header (the\n * `TitleBlock` element is always an `<h1>`; `titleSize` only sets its typography,\n * here `text-h1`). The page owns that `<h1>`, so `<FaqSection heading={null}>`\n * nests its category headings as `<h2>`/`<h3>` (the SEO-recommended FAQ document\n * outline).\n *\n * DATA: pass `initialFaqs` (SSR-resolved, platform-scoped) so `FaqSection`\n * skips its client self-fetch — the standalone page's static platform-only\n * contract. Omit it for embeds that want the self-fetching `/api/faqs`\n * suggestion-fill instead.\n */\n\nimport { useRouter } from '../../embed-shims/next-navigation';\nimport type { Faq } from '../../types/faq';\nimport { PageShell, PageLayout } from '../ui';\nimport { FaqSection } from './faq-section';\nimport type { FaqSchemaOptions } from './json-ld';\n\nexport interface FaqDocumentPageProps {\n /** Page title (frozen `PageLayout` `TitleBlock`). Default \"Frequently Asked Questions\". */\n title?: string;\n /** Subtitle under the title. */\n subtitle?: string;\n /** Back-button config — same pattern as `DevSectionPage` / `LegalDocumentPage`.\n * Pass `false` to hide. Default `{ label: 'Back to home', href: '/' }`. */\n backButton?: { label?: string; href?: string } | false;\n /** Render the standalone `<PageShell>` (own `<main>` + bg + max-width). Default\n * true. Pass false when the host layout already provides the page container\n * (e.g. openframe-frontend's `AppLayout` `<main>`) — only the padding box\n * renders, avoiding a nested `<main>`. */\n shell?: boolean;\n /** SSR-hydrate `FaqSection` (skips the client fetch — the platform-only\n * contract for the standalone page). Omit for self-fetching embeds. */\n initialFaqs?: Faq[];\n /** Emit FAQPage schema.org JSON-LD (forwarded to `FaqSection`). Off by\n * default so embeds don't emit duplicate schema. */\n emitJsonLd?: boolean;\n /** JSON-LD name/description/url overrides (forwarded to `FaqSection`). */\n jsonLd?: FaqSchemaOptions;\n /** Base URL `FaqSection` appends `/api/faqs` to (reverse-proxy embedders). */\n apiBaseUrl?: string;\n /** Optional entity scoping forwarded to `FaqSection`. */\n entityType?: string;\n entityId?: number | string;\n /** Minimum FAQ count before the section renders (forwarded to `FaqSection`). */\n minResults?: number;\n}\n\nexport function FaqDocumentPage({\n title = 'Frequently Asked Questions',\n subtitle,\n backButton,\n initialFaqs,\n emitJsonLd,\n jsonLd,\n apiBaseUrl,\n entityType,\n entityId,\n minResults,\n shell = true,\n}: FaqDocumentPageProps) {\n const router = useRouter();\n\n // Back-button config — mirrors LegalDocumentPage / DevSectionPage. Hide\n // entirely when the caller passes `false` (embed-mode where the host owns\n // nav chrome).\n const backCfg =\n backButton === false\n ? undefined\n : {\n label: backButton?.label ?? 'Back to home',\n onClick: () => router.push(backButton?.href ?? '/'),\n };\n\n const inner = (\n <PageLayout title={title} subtitle={subtitle} backButton={backCfg} titleSize=\"h1\" titleWrap>\n <FaqSection\n initialFaqs={initialFaqs}\n heading={null}\n emitJsonLd={emitJsonLd}\n jsonLd={jsonLd}\n apiBaseUrl={apiBaseUrl}\n entityType={entityType}\n entityId={entityId}\n minResults={minResults}\n />\n </PageLayout>\n );\n\n return shell ? <PageShell>{inner}</PageShell> : <div className=\"page-shell-content\">{inner}</div>;\n}\n"]}
@@ -8,21 +8,21 @@ import {
8
8
  SelectTrigger,
9
9
  SelectValue,
10
10
  Textarea
11
- } from "./chunk-JBMFCHNT.js";
11
+ } from "./chunk-PMXCBAC4.js";
12
12
  import {
13
13
  useContactSubmission,
14
14
  useHumanitySignals,
15
15
  useRescuedForm
16
- } from "./chunk-J4MCVIXU.js";
16
+ } from "./chunk-BNJBJTEK.js";
17
17
  import {
18
18
  ChatAttachmentAddButton,
19
19
  ChatAttachmentChipStrip,
20
20
  useChatAttachments
21
- } from "./chunk-OB3ZJ7GQ.js";
21
+ } from "./chunk-XGB5EEFZ.js";
22
22
  import {
23
23
  SECTION_HEADING_CLASS,
24
24
  accentSentenceMarks
25
- } from "./chunk-Y2MDXJB4.js";
25
+ } from "./chunk-JZCCRN3K.js";
26
26
  import {
27
27
  Input,
28
28
  Label,
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-RGI52IWK.js";
31
31
  import {
32
32
  Button
33
- } from "./chunk-4HVWGYHI.js";
33
+ } from "./chunk-LPLXCDNV.js";
34
34
 
35
35
  // src/components/contact/contact-form.tsx
36
36
  import { zodResolver } from "@hookform/resolvers/zod";
@@ -388,4 +388,4 @@ function ContactForm({
388
388
  export {
389
389
  ContactForm
390
390
  };
391
- //# sourceMappingURL=chunk-QD4BVKAU.js.map
391
+ //# sourceMappingURL=chunk-OKA4VKE6.js.map
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  createSseSubscription
4
- } from "./chunk-JBMFCHNT.js";
4
+ } from "./chunk-PMXCBAC4.js";
5
5
  import {
6
6
  useChatIdentity
7
- } from "./chunk-OB3ZJ7GQ.js";
7
+ } from "./chunk-XGB5EEFZ.js";
8
8
  import {
9
9
  embedAuthedFetch
10
10
  } from "./chunk-MOKB32FL.js";
@@ -275,4 +275,4 @@ export {
275
275
  TICKET_MARK_READ_DEBOUNCE_MS,
276
276
  TOAST_COPY
277
277
  };
278
- //# sourceMappingURL=chunk-Z7A7FUWY.js.map
278
+ //# sourceMappingURL=chunk-OM6WC5XG.js.map
@@ -1,25 +1,25 @@
1
1
  "use client";
2
2
  import {
3
3
  ContactForm
4
- } from "./chunk-QD4BVKAU.js";
4
+ } from "./chunk-OKA4VKE6.js";
5
5
  import {
6
6
  DeliveryRow,
7
7
  DevCardRowContent,
8
8
  DevCardRowSkeletonList,
9
9
  DevSectionPage,
10
10
  ListEmptyState
11
- } from "./chunk-YCVDJX7Z.js";
11
+ } from "./chunk-DBF7PGQR.js";
12
12
  import {
13
13
  EmptyState,
14
14
  UnifiedPagination
15
- } from "./chunk-M3JA577H.js";
15
+ } from "./chunk-6SN6IVLN.js";
16
16
  import {
17
17
  TICKET_MARK_READ_DEBOUNCE_MS,
18
18
  TICKET_TEXT_MAX_CHARS,
19
19
  TOAST_COPY,
20
20
  isOptimistic,
21
21
  useOptionalTicketLive
22
- } from "./chunk-Z7A7FUWY.js";
22
+ } from "./chunk-OM6WC5XG.js";
23
23
  import {
24
24
  AlertDialog,
25
25
  AlertDialogAction,
@@ -35,11 +35,11 @@ import {
35
35
  Textarea,
36
36
  TicketAttachmentsList,
37
37
  devSectionAnchorId
38
- } from "./chunk-JBMFCHNT.js";
38
+ } from "./chunk-PMXCBAC4.js";
39
39
  import {
40
40
  toast,
41
41
  useScrollToHash
42
- } from "./chunk-J4MCVIXU.js";
42
+ } from "./chunk-BNJBJTEK.js";
43
43
  import {
44
44
  PAGE_PARAM_LIMITS,
45
45
  pageCount,
@@ -55,7 +55,7 @@ import {
55
55
  formatRelativeTime,
56
56
  useChatAttachments,
57
57
  useChatIdentity
58
- } from "./chunk-OB3ZJ7GQ.js";
58
+ } from "./chunk-XGB5EEFZ.js";
59
59
  import {
60
60
  STICKY_HEADER_OFFSET_PX,
61
61
  scrollElementIntoView
@@ -71,7 +71,7 @@ import {
71
71
  SquareAvatar,
72
72
  StatusBadge,
73
73
  getStatusColorScheme
74
- } from "./chunk-Y2MDXJB4.js";
74
+ } from "./chunk-JZCCRN3K.js";
75
75
  import {
76
76
  embedAuthedFetch
77
77
  } from "./chunk-MOKB32FL.js";
@@ -86,7 +86,7 @@ import {
86
86
  } from "./chunk-RGI52IWK.js";
87
87
  import {
88
88
  Button
89
- } from "./chunk-4HVWGYHI.js";
89
+ } from "./chunk-LPLXCDNV.js";
90
90
 
91
91
  // src/components/tickets/ticket-center.tsx
92
92
  import { useQueryClient as useQueryClient2 } from "@tanstack/react-query";
@@ -1833,4 +1833,4 @@ export {
1833
1833
  HelpCenterCreateForm,
1834
1834
  HelpCenterList
1835
1835
  };
1836
- //# sourceMappingURL=chunk-77XUG4Z4.js.map
1836
+ //# sourceMappingURL=chunk-OPXQ5E3G.js.map
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Button
4
- } from "./chunk-4HVWGYHI.js";
4
+ } from "./chunk-LPLXCDNV.js";
5
5
  import {
6
6
  cn
7
7
  } from "./chunk-OXB6LRBK.js";
@@ -213,4 +213,4 @@ export {
213
213
  PaginationPrevious,
214
214
  PaginationNext
215
215
  };
216
- //# sourceMappingURL=chunk-GRBZC5N3.js.map
216
+ //# sourceMappingURL=chunk-PELIFROQ.js.map