themelia-react-ui 2.0.4 → 2.0.5

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 (588) hide show
  1. package/CHANGELOG.md +135 -0
  2. package/README.md +113 -18
  3. package/dist/{accordion-96o0pN62.js → accordion-B9MHG0cT.js} +11 -11
  4. package/dist/accordion-B9MHG0cT.js.map +1 -0
  5. package/dist/{action-menu-CHgs8vmj.js → action-menu-Dr8K-ghE.js} +48 -45
  6. package/dist/action-menu-Dr8K-ghE.js.map +1 -0
  7. package/dist/{affordance-geometry.generated-B8yGOr8-.js → affordance-geometry.generated-P-aVJisu.js} +36 -36
  8. package/dist/affordance-geometry.generated-P-aVJisu.js.map +1 -0
  9. package/dist/{ai-artifact-BZUGwBq6.js → ai-artifact-C58tQcBy.js} +210 -174
  10. package/dist/ai-artifact-C58tQcBy.js.map +1 -0
  11. package/dist/app-shell-B_IuNWOo.js +321 -0
  12. package/dist/app-shell-B_IuNWOo.js.map +1 -0
  13. package/dist/{attachment-DkoqHPPl.js → attachment-Dg_69lPS.js} +9 -9
  14. package/dist/{attachment-DkoqHPPl.js.map → attachment-Dg_69lPS.js.map} +1 -1
  15. package/dist/{auth-D2FVZ1MH.js → auth-DTkkshS8.js} +43 -46
  16. package/dist/auth-DTkkshS8.js.map +1 -0
  17. package/dist/{avatar-DWO_HHhB.js → avatar-CeZaFmNH.js} +8 -8
  18. package/dist/avatar-CeZaFmNH.js.map +1 -0
  19. package/dist/{badge-DErMA7ul.js → badge-xIiV_E7f.js} +5 -5
  20. package/dist/{badge-DErMA7ul.js.map → badge-xIiV_E7f.js.map} +1 -1
  21. package/dist/base/accordion.js +1 -1
  22. package/dist/base/action-menu.js +1 -1
  23. package/dist/base/attachment.js +1 -1
  24. package/dist/base/avatar.js +1 -1
  25. package/dist/base/badge.js +1 -1
  26. package/dist/base/batch-action-bar.js +1 -1
  27. package/dist/base/buttons.js +1 -1
  28. package/dist/base/cards.js +2 -2
  29. package/dist/base/carousel.js +3 -3
  30. package/dist/base/cascader.js +2 -372
  31. package/dist/base/chart.js +1 -1
  32. package/dist/base/choice-inputs.js +2 -2
  33. package/dist/base/code-block.js +1 -1
  34. package/dist/base/combobox.js +2 -2
  35. package/dist/base/command.js +1 -1
  36. package/dist/base/copyable.js +1 -1
  37. package/dist/base/date-pickers.js +2 -2
  38. package/dist/base/display.js +6 -6
  39. package/dist/base/feedback.js +3 -3
  40. package/dist/base/forms-numeric.js +1 -1
  41. package/dist/base/forms.js +2 -2
  42. package/dist/base/inline-edit.js +10 -10
  43. package/dist/base/item.js +1 -1
  44. package/dist/base/media-gallery.js +1 -1
  45. package/dist/base/metadata-list.js +1 -1
  46. package/dist/base/navigation.js +7 -7
  47. package/dist/base/popover-menu.js +1 -1
  48. package/dist/base/popover.js +1 -1
  49. package/dist/base/qr-code.js +1 -1
  50. package/dist/base/repeaters.js +12 -12
  51. package/dist/base/repeaters.js.map +1 -1
  52. package/dist/base/sheet.js +1 -1
  53. package/dist/base/sidebar.js +2 -2
  54. package/dist/base/signature-pad.js +7 -7
  55. package/dist/base/signature-pad.js.map +1 -1
  56. package/dist/base/skeleton.js +1 -1
  57. package/dist/base/spinner.js +4 -4
  58. package/dist/base/structure.js +1 -1
  59. package/dist/base/table.js +1 -1
  60. package/dist/base/text-inputs.js +2 -2
  61. package/dist/base/toaster.js +36 -36
  62. package/dist/base/toaster.js.map +1 -1
  63. package/dist/base/tree.js +1 -1
  64. package/dist/base/upload-queue.js +1 -1
  65. package/dist/base/upload.js +3 -3
  66. package/dist/base/value-inputs.js +1 -1
  67. package/dist/{batch-action-bar-CdfIkCsV.js → batch-action-bar-Cb8cuvyy.js} +6 -6
  68. package/dist/batch-action-bar-Cb8cuvyy.js.map +1 -0
  69. package/dist/blocks/admin.js +21 -21
  70. package/dist/blocks/admin.js.map +1 -1
  71. package/dist/blocks/ai.js +230 -216
  72. package/dist/blocks/ai.js.map +1 -1
  73. package/dist/blocks/analytics/usage-card.js +1 -1
  74. package/dist/blocks/analytics.js +325 -306
  75. package/dist/blocks/analytics.js.map +1 -1
  76. package/dist/blocks/collaboration.js +1 -1
  77. package/dist/blocks/commerce/receipt.js +1 -1
  78. package/dist/blocks/commerce.js +1259 -1184
  79. package/dist/blocks/commerce.js.map +1 -1
  80. package/dist/blocks/data-display.js +2 -2
  81. package/dist/blocks/onboarding.js +6 -6
  82. package/dist/blocks/onboarding.js.map +1 -1
  83. package/dist/blocks/planning.js +11 -11
  84. package/dist/blocks/timelines.js +1 -1
  85. package/dist/{breadcrumbs-B-WFKecD.js → breadcrumbs-J-K2kl4c.js} +6 -6
  86. package/dist/{breadcrumbs-B-WFKecD.js.map → breadcrumbs-J-K2kl4c.js.map} +1 -1
  87. package/dist/{button-DkmK-z8E.js → button-S2Cubiiz.js} +3 -3
  88. package/dist/button-S2Cubiiz.js.map +1 -0
  89. package/dist/{buttons-BbfzgczK.js → buttons-BedGfygC.js} +16 -16
  90. package/dist/buttons-BedGfygC.js.map +1 -0
  91. package/dist/cards-rNX1M4Xn.js +69 -0
  92. package/dist/cards-rNX1M4Xn.js.map +1 -0
  93. package/dist/cascader-B1MiqkBq.js +439 -0
  94. package/dist/cascader-B1MiqkBq.js.map +1 -0
  95. package/dist/chart-Darg_0Kv.js +162 -0
  96. package/dist/chart-Darg_0Kv.js.map +1 -0
  97. package/dist/{checkbox-CzYUTPeJ.js → checkbox-fflqmODR.js} +2 -2
  98. package/dist/{checkbox-CzYUTPeJ.js.map → checkbox-fflqmODR.js.map} +1 -1
  99. package/dist/{choice-inputs-JLtij2y4.js → choice-inputs-zUgBZfE4.js} +258 -257
  100. package/dist/choice-inputs-zUgBZfE4.js.map +1 -0
  101. package/dist/{code-block-CGNaUtAE.js → code-block-BzmM9Eig.js} +8 -8
  102. package/dist/code-block-BzmM9Eig.js.map +1 -0
  103. package/dist/{collapsible-Do4G0zcC.js → collapsible-BkAI_XD4.js} +5 -5
  104. package/dist/{collapsible-Do4G0zcC.js.map → collapsible-BkAI_XD4.js.map} +1 -1
  105. package/dist/{collection-content-C0e8SsTm.js → collection-content-gDh1v6O4.js} +3 -3
  106. package/dist/{collection-content-C0e8SsTm.js.map → collection-content-gDh1v6O4.js.map} +1 -1
  107. package/dist/combobox-BEx0vJgF.js +362 -0
  108. package/dist/combobox-BEx0vJgF.js.map +1 -0
  109. package/dist/{combobox-CBJDs6w_.js → combobox-BwzoXFSG.js} +254 -247
  110. package/dist/combobox-BwzoXFSG.js.map +1 -0
  111. package/dist/{command-D8NrBj-b.js → command-CrlPIL6m.js} +11 -11
  112. package/dist/command-CrlPIL6m.js.map +1 -0
  113. package/dist/{comments-Di4w0H_S.js → comments-Dmpp0YIc.js} +29 -29
  114. package/dist/{comments-Di4w0H_S.js.map → comments-Dmpp0YIc.js.map} +1 -1
  115. package/dist/components/base/action-menu/action-menu.d.ts +7 -1
  116. package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
  117. package/dist/components/base/cards/card.recipes.d.ts +6 -4
  118. package/dist/components/base/cards/partials/card-primitives.d.ts +9 -2
  119. package/dist/components/base/cards/partials/smart-card-header-row.d.ts +3 -1
  120. package/dist/components/base/cards/smart-card.types.d.ts +3 -4
  121. package/dist/components/base/cascader/cascader-panel.d.ts +76 -0
  122. package/dist/components/base/chart/chart.d.ts +6 -1
  123. package/dist/components/base/choice-inputs/choice-types.d.ts +1 -1
  124. package/dist/components/base/combobox/index.d.ts +4 -2
  125. package/dist/components/base/feedback/alert.d.ts +1 -1
  126. package/dist/components/base/forms/form-sizing.d.ts +7 -7
  127. package/dist/components/base/forms/workflow.d.ts +7 -1
  128. package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -0
  129. package/dist/components/base/metadata-list/metadata-list.d.ts +1 -1
  130. package/dist/components/base/navigation/dropdown-menu.d.ts +1 -1
  131. package/dist/components/base/navigation/page-header/page-header-commands.d.ts +14 -7
  132. package/dist/components/base/navigation/page-header/page-header.d.ts +10 -3
  133. package/dist/components/base/popover/popover.d.ts +3 -3
  134. package/dist/components/base/popover/popover.recipes.d.ts +10 -6
  135. package/dist/components/base/sheet/sheet.d.ts +2 -0
  136. package/dist/components/base/sidebar/index.d.ts +1 -1
  137. package/dist/components/base/sidebar/sidebar.d.ts +27 -5
  138. package/dist/components/base/toaster/index.d.ts +1 -0
  139. package/dist/components/blocks/ai/ai-file-tree/types.d.ts +1 -1
  140. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +3 -1
  141. package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
  142. package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
  143. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
  144. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +1 -1
  145. package/dist/components/blocks/commerce/cart-summary/types.d.ts +3 -1
  146. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +1 -1
  147. package/dist/components/blocks/commerce/discount-stack/types.d.ts +3 -1
  148. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
  149. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +11 -2
  150. package/dist/components/blocks/commerce/index.d.ts +7 -6
  151. package/dist/components/blocks/commerce/inventory-section/inventory-section.d.ts +1 -1
  152. package/dist/components/blocks/commerce/inventory-section/types.d.ts +7 -2
  153. package/dist/components/blocks/commerce/invoice-header/index.d.ts +2 -1
  154. package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
  155. package/dist/components/blocks/commerce/invoice-header/types.d.ts +20 -6
  156. package/dist/components/blocks/commerce/invoice-line-items/invoice-line-items.d.ts +1 -1
  157. package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +24 -7
  158. package/dist/components/blocks/commerce/invoice-mini/index.d.ts +2 -1
  159. package/dist/components/blocks/commerce/invoice-mini/types.d.ts +7 -1
  160. package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +1 -1
  161. package/dist/components/blocks/commerce/order-customer/types.d.ts +9 -1
  162. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +1 -1
  163. package/dist/components/blocks/commerce/refund-status/types.d.ts +3 -1
  164. package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
  165. package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +3 -1
  166. package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
  167. package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +3 -1
  168. package/dist/components/features/activities/activities.types.d.ts +8 -2
  169. package/dist/components/features/activities/partials/activity-marker.d.ts +7 -3
  170. package/dist/components/features/activities/partials/activity-row.d.ts +24 -0
  171. package/dist/components/features/event-calendar/colors.d.ts +2 -2
  172. package/dist/components/features/event-calendar/event-calendar.types.d.ts +4 -0
  173. package/dist/components/features/filters/facets/select-facet.d.ts +2 -1
  174. package/dist/components/features/filters/filters.strings.d.ts +4 -0
  175. package/dist/components/features/filters/filters.types.d.ts +3 -0
  176. package/dist/components/features/filters/partials/filter-editor-header.d.ts +16 -0
  177. package/dist/components/features/filters/partials/filter-popover-content.d.ts +1 -1
  178. package/dist/components/features/filters/partials/nested-filter-options.d.ts +21 -0
  179. package/dist/components/features/filters/partials/regular-filter-content.d.ts +2 -1
  180. package/dist/components/features/filters/utils/filter-utils.d.ts +21 -3
  181. package/dist/components/features/global-search/global-search.types.d.ts +2 -0
  182. package/dist/components/features/global-search/partials/global-search-input.d.ts +10 -0
  183. package/dist/components/features/global-search/partials/global-search-result-row.d.ts +7 -1
  184. package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
  185. package/dist/components/features/media-library/media-library.types.d.ts +14 -4
  186. package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
  187. package/dist/components/features/products/components/product-options-matrix.d.ts +1 -1
  188. package/dist/components/features/products/components/product-variant-editor.d.ts +1 -1
  189. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  190. package/dist/components/features/products/products.strings.d.ts +9 -1
  191. package/dist/components/features/products/products.types.d.ts +43 -6
  192. package/dist/components/features/resource/resource.d.ts +5 -1
  193. package/dist/components/features/resource/resource.types.d.ts +12 -1
  194. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +1 -1
  195. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +12 -2
  196. package/dist/components/features/table/partials/resource-cell.d.ts +22 -5
  197. package/dist/components/features/table/table.types.d.ts +1 -1
  198. package/dist/components/layout/app-shell/app-shell.types.d.ts +35 -6
  199. package/dist/components/layout/app-shell/index.d.ts +1 -1
  200. package/dist/components/layout/app-shell/shell-regions.d.ts +27 -0
  201. package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
  202. package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
  203. package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
  204. package/dist/components/layout/containers/two-column-layout.d.ts +2 -0
  205. package/dist/components/layout/header/header.recipes.d.ts +6 -0
  206. package/dist/components/layout/header/header.types.d.ts +6 -6
  207. package/dist/components/layout/navigation/section-nav/section-nav.d.ts +5 -0
  208. package/dist/components/layout/page/index.d.ts +2 -1
  209. package/dist/components/layout/page/page.d.ts +1 -0
  210. package/dist/components/layout/page/page.strings.d.ts +11 -0
  211. package/dist/components/layout/page/page.types.d.ts +69 -17
  212. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  213. package/dist/components/layout/settings/settings.d.ts +9 -2
  214. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  215. package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
  216. package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
  217. package/dist/components/layout/sidebar/index.d.ts +2 -1
  218. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +36 -0
  219. package/dist/components/layout/sidebar/sidebar.context.d.ts +5 -7
  220. package/dist/components/layout/sidebar/sidebar.types.d.ts +48 -10
  221. package/dist/components/layout/sidebar/sidebar.utils.d.ts +9 -1
  222. package/dist/components/layout/workspace/workspace.types.d.ts +8 -1
  223. package/dist/components/ui/alert-dialog.d.ts +2 -2
  224. package/dist/components/ui/combobox.d.ts +1 -1
  225. package/dist/components/ui/dialog.d.ts +2 -2
  226. package/dist/components/ui/overlay-layer.d.ts +18 -0
  227. package/dist/components/ui/sheet.d.ts +5 -1
  228. package/dist/components/ui/sidebar-state.d.ts +82 -0
  229. package/dist/components/ui/sidebar.d.ts +5 -17
  230. package/dist/{containers-CRmHf7GP.js → containers-CIxwbZt5.js} +26 -18
  231. package/dist/containers-CIxwbZt5.js.map +1 -0
  232. package/dist/{control-group-recipes-DBXmfh2E.js → control-group-recipes-fMuFo0H7.js} +6 -6
  233. package/dist/control-group-recipes-fMuFo0H7.js.map +1 -0
  234. package/dist/{copyable-CnGCZdX4.js → copyable-DIznBqiT.js} +7 -7
  235. package/dist/{copyable-CnGCZdX4.js.map → copyable-DIznBqiT.js.map} +1 -1
  236. package/dist/{data-display-D4oujtx0.js → data-display-BdgCAw8T.js} +268 -277
  237. package/dist/data-display-BdgCAw8T.js.map +1 -0
  238. package/dist/{date-Q7jnXxpk.js → date-Cq8ioE4o.js} +5 -5
  239. package/dist/{date-Q7jnXxpk.js.map → date-Cq8ioE4o.js.map} +1 -1
  240. package/dist/{date-picker-zOt1oNss.js → date-picker-RlIzKom_.js} +446 -437
  241. package/dist/date-picker-RlIzKom_.js.map +1 -0
  242. package/dist/{date-pickers-cj8IXbDC.js → date-pickers-DY-CpXS1.js} +12 -12
  243. package/dist/{date-pickers-cj8IXbDC.js.map → date-pickers-DY-CpXS1.js.map} +1 -1
  244. package/dist/{display-BB4BL_-K.js → display-KsZLw9Ov.js} +9 -9
  245. package/dist/{display-BB4BL_-K.js.map → display-KsZLw9Ov.js.map} +1 -1
  246. package/dist/dropdown-menu-CLs8Lihj.js +194 -0
  247. package/dist/dropdown-menu-CLs8Lihj.js.map +1 -0
  248. package/dist/features/activities.js +302 -253
  249. package/dist/features/activities.js.map +1 -1
  250. package/dist/features/ai-chat.js +15 -14
  251. package/dist/features/ai-chat.js.map +1 -1
  252. package/dist/features/appointment-calendar.js +22 -22
  253. package/dist/features/appointment-calendar.js.map +1 -1
  254. package/dist/features/async-preview.js +11 -10
  255. package/dist/features/async-preview.js.map +1 -1
  256. package/dist/features/combobox.js +1 -1
  257. package/dist/features/comments.js +1 -1
  258. package/dist/features/data-view.js +13 -13
  259. package/dist/features/data-view.js.map +1 -1
  260. package/dist/features/email-composer.js +237 -238
  261. package/dist/features/email-composer.js.map +1 -1
  262. package/dist/features/event-calendar.js +140 -146
  263. package/dist/features/event-calendar.js.map +1 -1
  264. package/dist/features/filters.js +1 -1
  265. package/dist/features/global-search.js +167 -138
  266. package/dist/features/global-search.js.map +1 -1
  267. package/dist/features/kanban.js +6 -7
  268. package/dist/features/kanban.js.map +1 -1
  269. package/dist/features/map.js +269 -260
  270. package/dist/features/map.js.map +1 -1
  271. package/dist/features/media-library.js +375 -326
  272. package/dist/features/media-library.js.map +1 -1
  273. package/dist/features/mentions.js +1 -1
  274. package/dist/features/overlays.js +1 -1
  275. package/dist/features/products.js +1266 -1193
  276. package/dist/features/products.js.map +1 -1
  277. package/dist/features/questionnaire.js +13 -13
  278. package/dist/features/questionnaire.js.map +1 -1
  279. package/dist/features/resource-assignment.js +8 -8
  280. package/dist/features/resource.js +69 -66
  281. package/dist/features/resource.js.map +1 -1
  282. package/dist/features/rich-text-editor.js +2 -2
  283. package/dist/features/schema-form.js +13 -13
  284. package/dist/features/suggestions.js +3 -3
  285. package/dist/features/sync.js +3 -3
  286. package/dist/features/table.js +1 -1
  287. package/dist/features/theme-tweaker.js +94 -95
  288. package/dist/features/theme-tweaker.js.map +1 -1
  289. package/dist/{feedback-DZNL5Lg1.js → feedback-Dm4izqFn.js} +80 -79
  290. package/dist/feedback-Dm4izqFn.js.map +1 -0
  291. package/dist/{field-affordance-recipes-DjwGx8eM.js → field-affordance-recipes-DWcNcOjh.js} +4 -4
  292. package/dist/field-affordance-recipes-DWcNcOjh.js.map +1 -0
  293. package/dist/{filters-BcT-uoFy.js → filters-DzgSJpMK.js} +693 -645
  294. package/dist/filters-DzgSJpMK.js.map +1 -0
  295. package/dist/{form-field-CsgRmdit.js → form-field-BriWAXyg.js} +6 -6
  296. package/dist/{form-field-CsgRmdit.js.map → form-field-BriWAXyg.js.map} +1 -1
  297. package/dist/{form-sizing-NXgjkmBG.js → form-sizing-Bs2qFUeE.js} +4 -4
  298. package/dist/form-sizing-Bs2qFUeE.js.map +1 -0
  299. package/dist/{forms-BV5m5aQF.js → forms-C0RGnJTe.js} +17 -13
  300. package/dist/forms-C0RGnJTe.js.map +1 -0
  301. package/dist/{forms-numeric-Cd33AKbD.js → forms-numeric-DIhghX1Q.js} +86 -82
  302. package/dist/forms-numeric-DIhghX1Q.js.map +1 -0
  303. package/dist/{header-BA697l4a.js → header-DMMxG__r.js} +67 -63
  304. package/dist/header-DMMxG__r.js.map +1 -0
  305. package/dist/header.recipes-BigdJjw1.js +6 -0
  306. package/dist/header.recipes-BigdJjw1.js.map +1 -0
  307. package/dist/{hooks-BQ-L7Uu2.js → hooks-DB6CJ4MR.js} +26 -14
  308. package/dist/hooks-DB6CJ4MR.js.map +1 -0
  309. package/dist/{icon-badge-COWbCCWu.js → icon-badge-DZF-YjQp.js} +4 -4
  310. package/dist/{icon-badge-COWbCCWu.js.map → icon-badge-DZF-YjQp.js.map} +1 -1
  311. package/dist/index.js +4 -5
  312. package/dist/{input-Cdw4k0fb.js → input-CvyDQlY7.js} +8 -8
  313. package/dist/{input-Cdw4k0fb.js.map → input-CvyDQlY7.js.map} +1 -1
  314. package/dist/input-DMBwAZmr.js +21 -0
  315. package/dist/input-DMBwAZmr.js.map +1 -0
  316. package/dist/{item-BvZ2DR_x.js → item-DjCcM18E.js} +16 -16
  317. package/dist/item-DjCcM18E.js.map +1 -0
  318. package/dist/layout/app-shell.js +1 -1
  319. package/dist/layout/auth.js +1 -1
  320. package/dist/layout/containers.js +1 -1
  321. package/dist/layout/header.js +1 -1
  322. package/dist/layout/hooks.js +1 -1
  323. package/dist/layout/navigation.js +1 -1
  324. package/dist/layout/page.js +2 -2
  325. package/dist/layout/settings.js +1 -1
  326. package/dist/layout/sidebar.js +3 -3
  327. package/dist/layout/workspace.js +1 -1
  328. package/dist/layout.js +11 -11
  329. package/dist/lib/affordance-geometry.generated.d.ts +35 -35
  330. package/dist/lib/control-group-recipes.d.ts +5 -5
  331. package/dist/lib/field-affordance-recipes.d.ts +2 -2
  332. package/dist/lib/motion-recipes.d.ts +3 -0
  333. package/dist/lib/navigation-row-recipes.d.ts +7 -7
  334. package/dist/lib/overlay-anatomy-recipes.d.ts +3 -3
  335. package/dist/lib/portal-recipes.d.ts +3 -0
  336. package/dist/lib/token-merge.generated.d.ts +13 -10
  337. package/dist/lib/utils.js +1 -1
  338. package/dist/map-demo-tile.svg +1 -1
  339. package/dist/{media-gallery-CSl5W1Fy.js → media-gallery-C-vChPmE.js} +6 -6
  340. package/dist/{media-gallery-CSl5W1Fy.js.map → media-gallery-C-vChPmE.js.map} +1 -1
  341. package/dist/{mentions-RKOQaaIB.js → mentions-0_4nWuI-.js} +10 -10
  342. package/dist/{mentions-RKOQaaIB.js.map → mentions-0_4nWuI-.js.map} +1 -1
  343. package/dist/{message-INU2xsxu.js → message-g8p7eVtN.js} +7 -7
  344. package/dist/message-g8p7eVtN.js.map +1 -0
  345. package/dist/{metadata-list-qVV7AVxa.js → metadata-list-C3MkU-Om.js} +64 -64
  346. package/dist/metadata-list-C3MkU-Om.js.map +1 -0
  347. package/dist/{motion-recipes-ChBg4HBq.js → motion-recipes-DitYv6P2.js} +10 -2
  348. package/dist/motion-recipes-DitYv6P2.js.map +1 -0
  349. package/dist/navigation-C90-oQFq.js +255 -0
  350. package/dist/navigation-C90-oQFq.js.map +1 -0
  351. package/dist/{navigation-BQNcg1jT.js → navigation-DaRjthVk.js} +101 -82
  352. package/dist/navigation-DaRjthVk.js.map +1 -0
  353. package/dist/{navigation-row-recipes-WZEs-hYo.js → navigation-row-recipes-BGVLvU_O.js} +9 -9
  354. package/dist/navigation-row-recipes-BGVLvU_O.js.map +1 -0
  355. package/dist/{number-E_OiIfJz.js → number-CRU3kGuk.js} +5 -5
  356. package/dist/{number-E_OiIfJz.js.map → number-CRU3kGuk.js.map} +1 -1
  357. package/dist/overflow-tab-bar-IVFVQFV6.js +172 -0
  358. package/dist/overflow-tab-bar-IVFVQFV6.js.map +1 -0
  359. package/dist/overlays-BSgCtM2v.js +1013 -0
  360. package/dist/overlays-BSgCtM2v.js.map +1 -0
  361. package/dist/page-DUUKDAjo.js +331 -0
  362. package/dist/page-DUUKDAjo.js.map +1 -0
  363. package/dist/page-header-commands-7P3sfE9u.js +193 -0
  364. package/dist/page-header-commands-7P3sfE9u.js.map +1 -0
  365. package/dist/{pagination-Ch8X_47u.js → pagination-CgCjElfu.js} +7 -7
  366. package/dist/{pagination-Ch8X_47u.js.map → pagination-CgCjElfu.js.map} +1 -1
  367. package/dist/popover-B85RenIl.js +201 -0
  368. package/dist/popover-B85RenIl.js.map +1 -0
  369. package/dist/{popover-menu-BYaCdFhf.js → popover-menu-DlnQ2zlR.js} +7 -7
  370. package/dist/{popover-menu-BYaCdFhf.js.map → popover-menu-DlnQ2zlR.js.map} +1 -1
  371. package/dist/{popover.recipes-D3j8R8Yp.js → popover.recipes-DdiEp0rd.js} +18 -11
  372. package/dist/popover.recipes-DdiEp0rd.js.map +1 -0
  373. package/dist/portal-recipes-BpsV_iRw.js +9 -0
  374. package/dist/portal-recipes-BpsV_iRw.js.map +1 -0
  375. package/dist/{primitives-Du64iDbb.js → primitives-ByWgGUgt.js} +5 -5
  376. package/dist/{primitives-Du64iDbb.js.map → primitives-ByWgGUgt.js.map} +1 -1
  377. package/dist/primitives.js +4 -4
  378. package/dist/{progress-BvF2oCdV.js → progress-BJhQP9WX.js} +9 -9
  379. package/dist/{progress-BvF2oCdV.js.map → progress-BJhQP9WX.js.map} +1 -1
  380. package/dist/{receipt-D789Jwyy.js → receipt-tOc7B3hw.js} +7 -7
  381. package/dist/receipt-tOc7B3hw.js.map +1 -0
  382. package/dist/{rich-text-CLJEf76s.js → rich-text-Dth5E882.js} +3 -3
  383. package/dist/{rich-text-CLJEf76s.js.map → rich-text-Dth5E882.js.map} +1 -1
  384. package/dist/{rich-text-editor-Cm1dpUpQ.js → rich-text-editor-C1fOjBTd.js} +429 -430
  385. package/dist/rich-text-editor-C1fOjBTd.js.map +1 -0
  386. package/dist/{rich-text-editor-toolbar-L__e4x47.js → rich-text-editor-toolbar-laT3tpBT.js} +32 -28
  387. package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +1 -0
  388. package/dist/{scroll-area-La5RXsEk.js → scroll-area-B0dB2cBi.js} +2 -2
  389. package/dist/{scroll-area-La5RXsEk.js.map → scroll-area-B0dB2cBi.js.map} +1 -1
  390. package/dist/{separator-DAEV0w65.js → separator-Bb17I4pu.js} +2 -2
  391. package/dist/{separator-DAEV0w65.js.map → separator-Bb17I4pu.js.map} +1 -1
  392. package/dist/{separator-GNfPG-90.js → separator-Ct_WSWTJ.js} +3 -3
  393. package/dist/{separator-GNfPG-90.js.map → separator-Ct_WSWTJ.js.map} +1 -1
  394. package/dist/services/actions.js +1 -1
  395. package/dist/{settings-BA2iboic.js → settings-Bar5wiSo.js} +31 -38
  396. package/dist/settings-Bar5wiSo.js.map +1 -0
  397. package/dist/sheet-BGPERY55.js +250 -0
  398. package/dist/sheet-BGPERY55.js.map +1 -0
  399. package/dist/sidebar-D-JYMMbY.js +686 -0
  400. package/dist/sidebar-D-JYMMbY.js.map +1 -0
  401. package/dist/sidebar-f9gRWXIR.js +1001 -0
  402. package/dist/sidebar-f9gRWXIR.js.map +1 -0
  403. package/dist/skeleton-BapcJd9C.js +265 -0
  404. package/dist/skeleton-BapcJd9C.js.map +1 -0
  405. package/dist/smart-card-CW0hjetE.js +617 -0
  406. package/dist/smart-card-CW0hjetE.js.map +1 -0
  407. package/dist/{structure-C0V0_Fyf.js → structure-DuxKl954.js} +2 -2
  408. package/dist/{structure-C0V0_Fyf.js.map → structure-DuxKl954.js.map} +1 -1
  409. package/dist/style.css +1 -1
  410. package/dist/{table-CpvnzJn9.js → table-B4TE7iOV.js} +3 -3
  411. package/dist/{table-CpvnzJn9.js.map → table-B4TE7iOV.js.map} +1 -1
  412. package/dist/{table-DH7rozUv.js → table-CFOWY9pQ.js} +394 -388
  413. package/dist/table-CFOWY9pQ.js.map +1 -0
  414. package/dist/{tabs-eqVsJZWO.js → tabs-e7ko9S2o.js} +11 -11
  415. package/dist/tabs-e7ko9S2o.js.map +1 -0
  416. package/dist/{text-inputs-DXItiR0O.js → text-inputs-B1culiSK.js} +17 -17
  417. package/dist/text-inputs-B1culiSK.js.map +1 -0
  418. package/dist/theme.css +40 -37
  419. package/dist/{timelines-DmtztAY_.js → timelines-D3Sl9ueq.js} +13 -12
  420. package/dist/timelines-D3Sl9ueq.js.map +1 -0
  421. package/dist/tooltip-8wz5S_Zr.js +113 -0
  422. package/dist/tooltip-8wz5S_Zr.js.map +1 -0
  423. package/dist/{tree-CV11PURP.js → tree-CzUJHnFs.js} +8 -8
  424. package/dist/{tree-CV11PURP.js.map → tree-CzUJHnFs.js.map} +1 -1
  425. package/dist/typography/rich-text.js +1 -1
  426. package/dist/{typography-CSyJrh28.js → typography-BQnine1k.js} +12 -12
  427. package/dist/{typography-CSyJrh28.js.map → typography-BQnine1k.js.map} +1 -1
  428. package/dist/typography.js +1 -1
  429. package/dist/ui-provider-C-74NVLc.js +178 -0
  430. package/dist/ui-provider-C-74NVLc.js.map +1 -0
  431. package/dist/ui-provider.js +2 -3
  432. package/dist/{upload-C9SA0X-8.js → upload-BOW6U2tI.js} +25 -24
  433. package/dist/upload-BOW6U2tI.js.map +1 -0
  434. package/dist/{upload-queue-DhQJiSRc.js → upload-queue-qUXn1ykN.js} +16 -14
  435. package/dist/upload-queue-qUXn1ykN.js.map +1 -0
  436. package/dist/{usage-card-DVTRDmGz.js → usage-card-BeSLY0i0.js} +24 -17
  437. package/dist/usage-card-BeSLY0i0.js.map +1 -0
  438. package/dist/{utils-CF3c95Io.js → utils-B6kKb8jB.js} +237 -141
  439. package/dist/utils-B6kKb8jB.js.map +1 -0
  440. package/dist/value-inputs-skdVB2zh.js +980 -0
  441. package/dist/value-inputs-skdVB2zh.js.map +1 -0
  442. package/dist/{value-typography-ClupF0Gz.js → value-typography-uAmWUAL1.js} +2 -2
  443. package/dist/{value-typography-ClupF0Gz.js.map → value-typography-uAmWUAL1.js.map} +1 -1
  444. package/dist/{workspace-9EFVXUyk.js → workspace-DHeHv0qw.js} +50 -49
  445. package/dist/workspace-DHeHv0qw.js.map +1 -0
  446. package/docs/consumer-skill/SKILL.md +4 -3
  447. package/docs/consumer-skill/agents/themelia-ui-designer.md +96 -0
  448. package/docs/consumer-skill/examples/app-layout.tsx +52 -1
  449. package/docs/consumer-skill/examples/commerce-lines.tsx +271 -0
  450. package/docs/consumer-skill/examples/custom-composition.tsx +21 -0
  451. package/docs/consumer-skill/examples/detail.tsx +5 -4
  452. package/docs/consumer-skill/examples/editable-sections.tsx +38 -0
  453. package/docs/consumer-skill/examples/index-table.tsx +4 -4
  454. package/docs/consumer-skill/examples/manifest.json +38 -1
  455. package/docs/consumer-skill/examples/product-media.tsx +41 -0
  456. package/docs/consumer-skill/examples/product-parts.tsx +81 -0
  457. package/docs/consumer-skill/examples/rhf-edit-page.tsx +1 -1
  458. package/docs/consumer-skill/examples/rhf-overlay-form.tsx +24 -11
  459. package/docs/consumer-skill/examples/token-domain-structure.tsx +68 -0
  460. package/docs/consumer-skill/references/agents-md.md +19 -17
  461. package/docs/consumer-skill/references/analytics.md +18 -1
  462. package/docs/consumer-skill/references/commerce-composition.md +97 -0
  463. package/docs/consumer-skill/references/component-contracts.json +7131 -1754
  464. package/docs/consumer-skill/references/composition-mapping.md +17 -3
  465. package/docs/consumer-skill/references/composition.md +159 -31
  466. package/docs/consumer-skill/references/critique-rubric.md +98 -0
  467. package/docs/consumer-skill/references/custom-composition.md +261 -0
  468. package/docs/consumer-skill/references/data-reading.md +79 -0
  469. package/docs/consumer-skill/references/design-contract.md +11 -9
  470. package/docs/consumer-skill/references/discovery.md +27 -3
  471. package/docs/consumer-skill/references/domain-structures.md +124 -0
  472. package/docs/consumer-skill/references/installation.md +15 -4
  473. package/docs/consumer-skill/references/integration.md +35 -0
  474. package/docs/consumer-skill/references/product-composition.md +94 -0
  475. package/docs/consumer-skill/references/public-api.json +2881 -420
  476. package/docs/consumer-skill/references/review.md +39 -2
  477. package/docs/consumer-skill/references/rhf-workflows.md +7 -0
  478. package/docs/consumer-skill/references/screen-archetypes.md +19 -7
  479. package/docs/consumer-skill/references/screen-decisions.md +126 -0
  480. package/docs/consumer-skill/references/theming.md +17 -18
  481. package/docs/consumer-skill/references/tokens.json +9 -9
  482. package/docs/consumer-skill/references/view-craft.md +153 -0
  483. package/docs/consumer-skill/references/view-spec.md +73 -0
  484. package/docs/consumer-skill/references/workflows.md +7 -1
  485. package/docs/consumer-skill/scripts/composition-policy.mjs +39 -3
  486. package/docs/consumer-skill/scripts/composition-schema.mjs +1 -1
  487. package/docs/consumer-skill/scripts/composition.mjs +61 -5
  488. package/docs/consumer-skill/scripts/discovery.mjs +54 -0
  489. package/docs/consumer-skill/scripts/inspect-component.mjs +1 -1
  490. package/docs/consumer-skill/scripts/inspection.mjs +73 -18
  491. package/docs/consumer-skill/scripts/setup-skills.mjs +41 -6
  492. package/docs/consumer-skill/scripts/surface-policy.mjs +5 -5
  493. package/docs/consumer-skills/themelia-components/SKILL.md +14 -13
  494. package/docs/consumer-skills/themelia-composition/SKILL.md +16 -17
  495. package/docs/consumer-skills/themelia-design/SKILL.md +55 -0
  496. package/docs/consumer-skills/themelia-foundation/SKILL.md +2 -1
  497. package/docs/consumer-skills/themelia-tokenization/SKILL.md +24 -17
  498. package/package.json +1 -1
  499. package/dist/accordion-96o0pN62.js.map +0 -1
  500. package/dist/action-menu-CHgs8vmj.js.map +0 -1
  501. package/dist/affordance-geometry.generated-B8yGOr8-.js.map +0 -1
  502. package/dist/ai-artifact-BZUGwBq6.js.map +0 -1
  503. package/dist/app-shell-D63ATkIK.js +0 -237
  504. package/dist/app-shell-D63ATkIK.js.map +0 -1
  505. package/dist/auth-D2FVZ1MH.js.map +0 -1
  506. package/dist/avatar-DWO_HHhB.js.map +0 -1
  507. package/dist/base/cascader.js.map +0 -1
  508. package/dist/batch-action-bar-CdfIkCsV.js.map +0 -1
  509. package/dist/button-DkmK-z8E.js.map +0 -1
  510. package/dist/buttons-BbfzgczK.js.map +0 -1
  511. package/dist/cards-4JTWqvVe.js +0 -68
  512. package/dist/cards-4JTWqvVe.js.map +0 -1
  513. package/dist/chart-C19flDQb.js +0 -155
  514. package/dist/chart-C19flDQb.js.map +0 -1
  515. package/dist/choice-inputs-JLtij2y4.js.map +0 -1
  516. package/dist/code-block-CGNaUtAE.js.map +0 -1
  517. package/dist/combobox-CBJDs6w_.js.map +0 -1
  518. package/dist/combobox-hbhSS18O.js +0 -355
  519. package/dist/combobox-hbhSS18O.js.map +0 -1
  520. package/dist/command-D8NrBj-b.js.map +0 -1
  521. package/dist/containers-CRmHf7GP.js.map +0 -1
  522. package/dist/control-group-recipes-DBXmfh2E.js.map +0 -1
  523. package/dist/data-display-D4oujtx0.js.map +0 -1
  524. package/dist/date-picker-zOt1oNss.js.map +0 -1
  525. package/dist/dropdown-menu-CjY8Vt7W.js +0 -193
  526. package/dist/dropdown-menu-CjY8Vt7W.js.map +0 -1
  527. package/dist/feedback-DZNL5Lg1.js.map +0 -1
  528. package/dist/field-affordance-recipes-DjwGx8eM.js.map +0 -1
  529. package/dist/filters-BcT-uoFy.js.map +0 -1
  530. package/dist/form-sizing-NXgjkmBG.js.map +0 -1
  531. package/dist/forms-BV5m5aQF.js.map +0 -1
  532. package/dist/forms-numeric-Cd33AKbD.js.map +0 -1
  533. package/dist/header-BA697l4a.js.map +0 -1
  534. package/dist/hooks-BQ-L7Uu2.js.map +0 -1
  535. package/dist/input-DOPL5_QE.js +0 -21
  536. package/dist/input-DOPL5_QE.js.map +0 -1
  537. package/dist/item-BvZ2DR_x.js.map +0 -1
  538. package/dist/message-INU2xsxu.js.map +0 -1
  539. package/dist/metadata-list-qVV7AVxa.js.map +0 -1
  540. package/dist/motion-recipes-ChBg4HBq.js.map +0 -1
  541. package/dist/navigation-BQNcg1jT.js.map +0 -1
  542. package/dist/navigation-DLF3E1IC.js +0 -145
  543. package/dist/navigation-DLF3E1IC.js.map +0 -1
  544. package/dist/navigation-row-recipes-WZEs-hYo.js.map +0 -1
  545. package/dist/overflow-tab-bar-CrbqMteP.js +0 -284
  546. package/dist/overflow-tab-bar-CrbqMteP.js.map +0 -1
  547. package/dist/overlays-BlKynmde.js +0 -1004
  548. package/dist/overlays-BlKynmde.js.map +0 -1
  549. package/dist/page-CIwNUtGr.js +0 -227
  550. package/dist/page-CIwNUtGr.js.map +0 -1
  551. package/dist/page-header-commands-DFMlNYzN.js +0 -128
  552. package/dist/page-header-commands-DFMlNYzN.js.map +0 -1
  553. package/dist/popover-uwzX2vo7.js +0 -198
  554. package/dist/popover-uwzX2vo7.js.map +0 -1
  555. package/dist/popover.recipes-D3j8R8Yp.js.map +0 -1
  556. package/dist/receipt-D789Jwyy.js.map +0 -1
  557. package/dist/rich-text-editor-Cm1dpUpQ.js.map +0 -1
  558. package/dist/rich-text-editor-toolbar-L__e4x47.js.map +0 -1
  559. package/dist/settings-BA2iboic.js.map +0 -1
  560. package/dist/sheet-DoAxTb2J.js +0 -213
  561. package/dist/sheet-DoAxTb2J.js.map +0 -1
  562. package/dist/sidebar-ByqKR_W5.js +0 -512
  563. package/dist/sidebar-ByqKR_W5.js.map +0 -1
  564. package/dist/sidebar-D2iSnGJ7.js +0 -619
  565. package/dist/sidebar-D2iSnGJ7.js.map +0 -1
  566. package/dist/skeleton-CUj8O5Bd.js +0 -264
  567. package/dist/skeleton-CUj8O5Bd.js.map +0 -1
  568. package/dist/smart-card-CqkzQsK-.js +0 -614
  569. package/dist/smart-card-CqkzQsK-.js.map +0 -1
  570. package/dist/table-DH7rozUv.js.map +0 -1
  571. package/dist/tabs-eqVsJZWO.js.map +0 -1
  572. package/dist/text-inputs-DXItiR0O.js.map +0 -1
  573. package/dist/theme-scope-BJ6eE2xt.js +0 -50
  574. package/dist/theme-scope-BJ6eE2xt.js.map +0 -1
  575. package/dist/timelines-DmtztAY_.js.map +0 -1
  576. package/dist/tooltip-B4hjKtoV.js +0 -111
  577. package/dist/tooltip-B4hjKtoV.js.map +0 -1
  578. package/dist/ui-provider-CQCuCBcy.js +0 -136
  579. package/dist/ui-provider-CQCuCBcy.js.map +0 -1
  580. package/dist/upload-C9SA0X-8.js.map +0 -1
  581. package/dist/upload-queue-DhQJiSRc.js.map +0 -1
  582. package/dist/usage-card-DVTRDmGz.js.map +0 -1
  583. package/dist/use-mobile-vaLKwgyf.js +0 -15
  584. package/dist/use-mobile-vaLKwgyf.js.map +0 -1
  585. package/dist/utils-CF3c95Io.js.map +0 -1
  586. package/dist/value-inputs-C0o70p-U.js +0 -980
  587. package/dist/value-inputs-C0o70p-U.js.map +0 -1
  588. package/dist/workspace-9EFVXUyk.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"commerce.js","names":["NumberValue","_Fragment","_Fragment","NumberValue","NumberValue","normalizeCode","_Fragment","NumberValue","NumberValue","_Fragment","useMoneyConfig","cn","Button","TextButton","Text","DisplayLabel","Heading","TextLink","AdaptiveGrid","Grid","Stack","toneRecipes","hasRenderableContent","Alert","Card","Progress","compositionRhythm","compositionClasses","ActionMenu","ActionButtons","CardPrimaryAction","interactionRecipes","Value","Phone","SecondaryValue","MonoValue","Email","Initials","formatInitials","Percent","Money","Number$1","IconBadge","AvatarFallback","Avatar","AvatarImage","Badge","Separator","Input","Copyable","FormField","ToggleField","Select","CardRadioGroup","DateBlock","ContentBlock","VisuallyHidden","TagsInput","DecimalInput","WeightInput","ItemMedia","ItemDescription","ItemActions","ItemGroup","ItemContent","Item","ItemTitle","MetadataList","TabsTrigger","TabsContent","TabsList","Tabs","InlineStat","EmptyState","Receipt","ReceiptItems","Timeline","Fragment$1","UpcomingBookingRow","className","bookings","b","timePlacement","dateTone","dateVariant","idx","renderItemValue","value","BookingCalendarEventCard","status","contentClassName","items","item","onAction","actionLabel","defaultLoyaltyPointsStrings","LoyaltyPoints","stringsProp","strings","useStrings","tierTone","tier","balance","history","entry","onRedeem","stripLeadingMinus","formatDeduction","isText","AmountRow","forwardRef","props","hasNote","note","total","deduction","rollup","label","amount","SummaryPanel","defaultDiscountStackStrings","discountKind","kind","discount","DiscountStackPreview","discounts","index","totalSavings","DiscountStack","shipmentStatusTone","defaultShipmentTrackingStrings","latestReachedIndex","steps","ShipmentTracking","current","rail","step","trackingNumber","onCopyTracking","carrier","details","detail","defaultGiftcardStrings","giftcardStatusTone","inverseGradient","gradientMap","compactGradientMap","accentColorMap","headerGradientMap","GiftcardCompact","statusLabel","statusTone","isPartiallyUsed","remainingAmount","displayAmount","gradient","code","recipientName","GiftcardCopyButton","copyStrings","generation","useRef","result","setResult","useState","state","previous","Icon","Check","X","Loader2","Copy","copy","request","inverse","GiftcardCardDark","metadataItems","expiresAt","onView","GiftcardFull","_createdAt","_template","senderName","pattern","message","GiftcardCardIllustrated","headerColor","GiftcardCardMinimal","accent","color","ArrowRight","GiftcardCard","defaultVendorProfileStrings","CHANGE_VARIANTS","ChangeBadge","children","tone","VendorProfileCard","internalView","setInternalView","defaultView","isViewControlled","view","hasEarnings","earnings","hasOverviewContent","metrics","hasStatsContent","stats","availableTabs","requestedView","activeView","hasBody","hasActions","onMessage","onHire","handleViewChange","nextValue","onViewChange","overviewContent","earningsChangeTone","earningsChange","metric","statsContent","stat","profileBody","surface","avatarUrl","name","initials","verified","role","ChevronRight","defaultInventoryLevelStrings","InventoryLevel","stockId","useId","isLow","stock","reorderLevel","isCritical","badgeTone","badgeLabel","productName","variant","maxStock","lastRestocked","defaultTaxBreakdownStrings","TaxBreakdownCard","subtotal","taxes","tax","totalTax","defaultSubscriptionSummaryStrings","SubscriptionSummaryCard","planName","priceLabel","cycleLabel","nextBillingDate","perks","perk","i","onManage","onUpgrade","defaultRefundStatusStrings","STAGE_ORDER","hasContent","RefundStatusCard","currentIdx","stage","hasFacts","reason","method","eta","requestedAt","done","s","RefundStatus","AddressLines","cityLine","address","prominent","defaultAddressCardStrings","AddressCard","defaultAddress","titleByKind","actions","onEdit","Edit2","onMakeDefault","Star","onRemove","Trash2","phone","defaultVoucherEntryStrings","normalizeCode$1","VoucherEntry","inputId","setCode","trimmedCode","appliedCode","event","onCheck","error","LineThumbnailPlaceholder","title","LineThumbnail","failedSrc","setFailedSrc","source","src","alt","defaultCartSummaryStrings","quantity","resolveCartLineTitle","resolveCartLineImageSrc","CartSummaryCard","hasBreakdown","shipping","it","imageSrc","onCheckout","CartSummary","defaultCouponInputStrings","normalizeCode","CouponInputCard","appliedDiscount","onApply","defaultOrderStatusStrings","VARIANT_BY_STATUS","OrderStatusCard","lastCompleteIdx","events","e","acc","nextEvent","orderNumber","currentEta","isLast","isCurrent","CalendarClock","Circle","defaultPaymentMethodStrings","brand","last4","BRAND_LABEL","BRAND_SURFACE","PaymentMethod","defaultMethod","spokenName","onChange","holderName","expiry","PaymentMethodCard","DEFAULT_SEO_LISTING_LIMITS","resolveLimits","limits","clampScore","getCheckStatus","maxScore","ratio","score","makeCheck","scoreRatio","range","lengthScore","length","min","max","overBy","getSeoPermalinkPath","permalink","getSeoPermalinkSlug","permalinkScore","path","slugScore","slug","urlScore","baseUrl","keywordScore","keyword","input","haystack","calculateSeoListingScore","description","permalinkPath","checks","sum","check","defaultSeoListingCardStrings","SCORE_BADGE_TONE","SCORE_PROGRESS_CLASS","CHECK_ICON","CheckCircle2","TriangleAlert","CircleAlert","CHECK_ICON_CLASS","trimSlashes","buildUrlParts","permalinkParts","pathSegments","buildHref","base","getCheckDetail","SeoCheckRow","SeoListingCard","resolvedBaseUrl","resolvedSiteName","siteName","resolvedTitle","resolvedDescription","scoreResult","href","urlParts","Pencil","ExternalLink","part","price","showChecks","defaultInvoiceMiniStrings","count","invoiceStatusTone","InvoiceMini","mergeStrings","labelByStatus","invoice","defaultInvoiceHeaderStrings","PartyBlock","eyebrow","location","InvoiceHeader","resolvedStatusTone","invoiceNumber","from","to","issuedDate","dueDate","defaultInvoiceLineItemsStrings","wrapperGlass","ALIGN_CLASS","InvoiceCurrencyValue","buildDefaultColumns","buildDefaultFooterRows","taxRate","InvoiceLineItems","resolvedCurrency","currency","defaultCurrency","resolvedColumns","columns","resolvedFooterRows","footerRows","gridTemplate","c","defaultGrid","col","row","isSimpleText","OrderTimeline","PaymentTimeline","defaultInventorySectionStrings","STATUS_VARIANT","parseQuantity","parsed","getInventoryStatus","available","threshold","SectionHeading","SummaryMetric","InventorySectionCard","isDisabled","disabled","readOnly","isTracked","requiresShipping","shippingFieldsDisabled","isSectionVisible","visibleSections","section","isFieldVisible","visibleFields","field","updateField","previousValue","next","handleGenerateSku","onGenerateSku","generatedSku","onRestock","errors","checked","locationOptions","unit","countryOptions","nextTags","tagRecommendations","maxTags","fulfillmentStatusTone","paymentStatusTone","transactionStatusTone","outgoingTransactionKinds","defaultOrderStatusVocabulary","defaultOrderHeaderStrings","placedAt","OrderHeader","origin","headingTag","paymentStatus","fulfillmentStatus","defaultOrderLineItemStrings","unitPrice","OrderLineItem","hasMeta","variantTitle","sku","id","imageAlt","properties","property","defaultFulfillmentGroupStrings","FulfillmentGroup","NoticeIcon","lineStrings","useMemo","heading","firstAction","overflowActions","action","hasLocation","hasNotice","notice","line","defaultOrderSummaryStrings","LedgerRow","OrderSummary","hasAlert","alert","AlertDescription","goods","payments","defaultOrderTransactionsStrings","OrderTransactions","transactions","outgoing","transaction","failed","magnitude","meta","defaultOrderCustomerStrings","AddressSection","editLabel","replacement","emptyLabel","OrderCustomer","hasContact","email","onOpenCustomer","orderCount","shippingAddress","onEditShipping","billingAddress","onEditBilling","billingSameAsShipping"],"sources":["../../src/components/blocks/commerce/upcoming-booking/upcoming-booking.tsx","../../src/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.tsx","../../src/components/blocks/commerce/loyalty-points/types.ts","../../src/components/blocks/commerce/loyalty-points/loyalty-points.tsx","../../src/components/blocks/commerce/format-signed-amount.ts","../../src/components/blocks/commerce/summary-panel/amount-row.tsx","../../src/components/blocks/commerce/summary-panel/summary-panel.tsx","../../src/components/blocks/commerce/discount-stack/types.ts","../../src/components/blocks/commerce/discount-stack/discount-stack.tsx","../../src/components/blocks/commerce/shipment-tracking/types.ts","../../src/components/blocks/commerce/shipment-tracking/shipment-tracking.tsx","../../src/components/blocks/commerce/giftcard-card/types.ts","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-compact.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-dark.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-full.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.tsx","../../src/components/blocks/commerce/giftcard-card/giftcard-card.tsx","../../src/components/blocks/commerce/vendor-profile/types.ts","../../src/components/blocks/commerce/vendor-profile/vendor-profile.tsx","../../src/components/blocks/commerce/inventory-level/inventory-level.strings.ts","../../src/components/blocks/commerce/inventory-level/inventory-level.tsx","../../src/components/blocks/commerce/tax-breakdown/types.ts","../../src/components/blocks/commerce/tax-breakdown/tax-breakdown.tsx","../../src/components/blocks/commerce/subscription-summary/types.ts","../../src/components/blocks/commerce/subscription-summary/subscription-summary.tsx","../../src/components/blocks/commerce/refund-status/types.ts","../../src/components/blocks/commerce/refund-status/refund-status.tsx","../../src/components/blocks/commerce/shared/address-lines.tsx","../../src/components/blocks/commerce/address-card/types.ts","../../src/components/blocks/commerce/address-card/address-card.tsx","../../src/components/blocks/commerce/voucher-entry/types.ts","../../src/components/blocks/commerce/voucher-entry/voucher-entry.tsx","../../src/components/blocks/commerce/shared/line-thumbnail.tsx","../../src/components/blocks/commerce/cart-summary/types.ts","../../src/components/blocks/commerce/cart-summary/cart-summary.tsx","../../src/components/blocks/commerce/coupon-input/types.ts","../../src/components/blocks/commerce/coupon-input/coupon-input.tsx","../../src/components/blocks/commerce/order-status/types.ts","../../src/components/blocks/commerce/order-status/order-status.tsx","../../src/components/blocks/commerce/payment-method/types.ts","../../src/components/blocks/commerce/payment-method/payment-method.tsx","../../src/components/blocks/commerce/seo-listing/seo-listing-score.ts","../../src/components/blocks/commerce/seo-listing/types.ts","../../src/components/blocks/commerce/seo-listing/seo-listing-card.tsx","../../src/components/blocks/commerce/invoice-mini/types.ts","../../src/components/blocks/commerce/invoice-mini/invoice-mini.tsx","../../src/components/blocks/commerce/invoice-header/types.ts","../../src/components/blocks/commerce/invoice-header/invoice-header.tsx","../../src/components/blocks/commerce/invoice-line-items/types.ts","../../src/components/blocks/commerce/invoice-line-items/invoice-line-items.tsx","../../src/components/blocks/commerce/order-timeline/order-timeline.tsx","../../src/components/blocks/commerce/payment-timeline/payment-timeline.tsx","../../src/components/blocks/commerce/inventory-section/types.ts","../../src/components/blocks/commerce/inventory-section/inventory-section.tsx","../../src/components/blocks/commerce/shared/order-status.ts","../../src/components/blocks/commerce/order-header/types.ts","../../src/components/blocks/commerce/order-header/order-header.tsx","../../src/components/blocks/commerce/order-line-item/types.ts","../../src/components/blocks/commerce/order-line-item/order-line-item.tsx","../../src/components/blocks/commerce/fulfillment-group/types.ts","../../src/components/blocks/commerce/fulfillment-group/fulfillment-group.tsx","../../src/components/blocks/commerce/order-summary/types.ts","../../src/components/blocks/commerce/order-summary/order-summary.tsx","../../src/components/blocks/commerce/order-transactions/types.ts","../../src/components/blocks/commerce/order-transactions/order-transactions.tsx","../../src/components/blocks/commerce/order-customer/types.ts","../../src/components/blocks/commerce/order-customer/order-customer.tsx"],"sourcesContent":["/**\n * UpcomingBookingRow — compact booking list. Each row shows a `DateBlock`\n * (weekday / day / month / time) on the left, service + customer in the\n * middle, and trailing amount. Locale and date-tone are configurable.\n *\n * Time is placed BELOW the date block by default (matches the date block\n * vertical rhythm); pass `timePlacement=\"inline-trailing\"` to use a\n * separate trailing time column.\n */\nimport { DateBlock } from '../../../base/display/date-block';\nimport { SecondaryValue, Value } from '../../../primitives';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\n\nimport type { UpcomingBookingRowProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\n\nexport function UpcomingBookingRow({\n\tbookings,\n\tclassName,\n\tlocale,\n\t// `inverse` paints a near-black tile in the light theme, which reads as a\n\t// heavy foreign block in an otherwise soft admin list and does not match how\n\t// DateBlock renders anywhere else. Neutral by default; pass\n\t// `dateVariant=\"inverse\"` for the inverted treatment deliberately.\n\tdateTone = 'neutral',\n\tdateVariant = 'default',\n\ttimePlacement = 'below',\n}: UpcomingBookingRowProps) {\n\treturn (\n\t\t// Plain rows touch: each row's density padding is the space between them.\n\t\t<ItemGroup className={cn('upcoming-booking--component w-full', className)}>\n\t\t\t{bookings.map((b, idx) => (\n\t\t\t\t\t<Item key={b.id ?? `${b.service}-${b.time}-${idx}`} className=\"items-center\">\n\t\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t\t<DateBlock\n\t\t\t\t\t\t\t\tdate={b.date}\n\t\t\t\t\t\t\t\ttime={timePlacement === 'below' ? b.time : undefined}\n\t\t\t\t\t\t\t\ttone={dateTone}\n\t\t\t\t\t\t\t\tvariant={dateVariant}\n\t\t\t\t\t\t\t\tlocale={locale}\n\t\t\t\t\t\t\t\ttimePlacement=\"below\"\n\t\t\t\t\t\t\t\tlayout=\"stacked\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t<ItemContent className=\"min-w-0 sm:min-w-48\">\n\t\t\t\t\t\t\t<ItemTitle>{b.service}</ItemTitle>\n\t\t\t\t\t\t\t<ItemDescription clamp={1}>{b.customer}</ItemDescription>\n\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 flex-wrap justify-end\">\n\t\t\t\t\t\t\t{timePlacement === 'inline-trailing' && (\n\t\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t\t{b.time}\n\t\t\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{b.amount}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t</Item>\n\t\t\t))}\n\t\t</ItemGroup>\n\t);\n}\n\nUpcomingBookingRow.displayName = 'UpcomingBookingRow';\n","import type { ReactNode } from 'react';\n\nimport { CardPrimaryAction } from '../../../base/cards';\nimport { ContentBlock } from '../../../base/display';\nimport { Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { BookingCalendarEventCardProps } from './booking-calendar-event-card.types';\n\nfunction renderItemValue(value: ReactNode): ReactNode {\n\tif (\n\t\ttypeof value === 'string' ||\n\t\ttypeof value === 'number' ||\n\t\ttypeof value === 'bigint'\n\t) {\n\t\treturn <Value type=\"inherit\">{String(value)}</Value>;\n\t}\n\n\treturn value;\n}\n\n/**\n * Compact, card-free booking detail composition.\n *\n * The status sits beside the title, the facts share one label-above-value\n * layout, and spacing alone separates them from the action: no header rule,\n * no inset note panel and no rule above the action.\n *\n * All visible copy is supplied by props, so this component intentionally has\n * no strings file. Frame it with `Card` only when the page needs card\n * chrome.\n */\nexport function BookingCalendarEventCard({\n\ttitle,\n\tdescription,\n\tstatus,\n\titems,\n\tactionLabel,\n\tonAction,\n\tclassName,\n\tcontentClassName,\n}: BookingCalendarEventCardProps) {\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={title}\n\t\t\ttitleSuffix={status}\n\t\t\tdescription={description}\n\t\t\tclassName={cn('booking-calendar-event-card--component @container/booking-calendar-event-card', className)}\n\t\t\tcontentClassName={cn('grid gap-space-2xl', contentClassName)}\n\t\t>\n\t\t\t<dl className=\"booking-calendar-event-card--details grid gap-space-lg @md/booking-calendar-event-card:grid-cols-2\">\n\t\t\t\t{items.map((item) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t// Label-to-value rhythm matches MetadataList's fact layout.\n\t\t\t\t\t\t\t'grid min-w-0 gap-normal',\n\t\t\t\t\t\t\titem.fullWidth === true && '@md/booking-calendar-event-card:col-span-2',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* The definition cells would otherwise keep the page's taller\n\t\t\t\t\t\t line box around 14px copy and pad the label/value gap. */}\n\t\t\t\t\t\t<dt className=\"flex\"><DisplayLabel>{item.label}</DisplayLabel></dt>\n\t\t\t\t\t\t<dd className=\"min-w-0 leading-normal\">{renderItemValue(item.value)}</dd>\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</dl>\n\n\t\t\t<div className=\"booking-calendar-event-card--action flex justify-end\">\n\t\t\t\t<CardPrimaryAction\n\t\t\t\t\tfullWidth={false}\n\t\t\t\t\tclassName=\"w-full @md/booking-calendar-event-card:w-auto\"\n\t\t\t\t\tonClick={onAction}\n\t\t\t\t>\n\t\t\t\t\t{actionLabel}\n\t\t\t\t</CardPrimaryAction>\n\t\t\t</div>\n\t\t</ContentBlock>\n\t);\n}\n\nBookingCalendarEventCard.displayName = 'BookingCalendarEventCard';\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface LoyaltyHistoryEntry {\n\t/** Display label. */\n\tlabel: string;\n\tpoints: string;\n\tdate: string;\n\tpositive: boolean;\n}\n\nexport interface LoyaltyPointsStrings {\n\tbalanceLabel: string;\n\tpointsAvailable: string;\n\tredeem: string;\n\t/** Tier chip label used when `tier` is not passed. */\n\ttier: string;\n}\n\nexport const defaultLoyaltyPointsStrings: LoyaltyPointsStrings = {\n\tbalanceLabel: 'Loyalty balance',\n\tpointsAvailable: 'points available',\n\tredeem: 'Redeem points',\n\ttier: 'Gold tier',\n};\n\nexport interface LoyaltyPointsProps {\n\t/** Points currently available. */\n\tbalance: number | string;\n\t/** Membership tier name. Defaults to `strings.tier`. */\n\ttier?: string;\n\t/** Badge tone for the tier chip. A tier is a kind, not a status. @default 'neutral' */\n\ttierTone?: BadgeTone;\n\t/** Recent point movements. */\n\thistory?: LoyaltyHistoryEntry[];\n\tonRedeem?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<LoyaltyPointsStrings>;\n}\n","/**\n * LoyaltyPoints — current balance, tier badge, recent history rows\n * (label / date / signed-points), and a redemption CTA. Strings overridable\n * for i18n.\n */\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue } from '../../../primitives';\nimport { Heading } from '../../../typography/heading';\nimport { Text } from '../../../typography/text';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemTitle,\n} from '../../../base/item';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultLoyaltyPointsStrings, type LoyaltyPointsProps } from './types';\n\nexport function LoyaltyPoints({\n\tbalance,\n\ttier,\n\ttierTone = 'neutral',\n\thistory = [],\n\tonRedeem,\n\tclassName,\n\tstrings: stringsProp,\n}: LoyaltyPointsProps) {\n\tconst strings = useStrings(defaultLoyaltyPointsStrings, stringsProp);\n\t// The tier is a membership kind, so its chip is neutral by default and sits\n\t// beside the title. Balance, history and the action are separated by the\n\t// content gap rather than a rule.\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.balanceLabel}\n\t\t\ttitleSuffix={<Badge tone={tierTone}>{tier ?? strings.tier}</Badge>}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tclassName={cn('loyalty-points--component w-full', className)}\n\t\t>\n\t\t\t<Stack gap=\"dense\" className=\"loyalty-points--balance\">\n\t\t\t\t<Heading tag=\"h3\" className=\"tabular-nums text-inherit\">\n\t\t\t\t\t{typeof balance === 'number' ? (\n\t\t\t\t\t\t<NumberValue type=\"inherit\" value={balance} align=\"left\" />\n\t\t\t\t\t) : balance}\n\t\t\t\t</Heading>\n\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t{strings.pointsAvailable}\n\t\t\t\t</Text>\n\t\t\t</Stack>\n\n\t\t\t{history.length > 0 && (\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{history.map((entry) => (\n\t\t\t\t\t\t<Item key={entry.date + entry.label} size=\"sm\">\n\t\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t\t<ItemTitle bold={false}>{entry.label}</ItemTitle>\n\t\t\t\t\t\t\t\t<ItemDescription clamp={1}>{entry.date}</ItemDescription>\n\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t<ItemActions>\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'tabular-nums',\n\t\t\t\t\t\t\t\t\t\tentry.positive ? 'text-success' : 'text-destructive',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{entry.points}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t\t</Item>\n\t\t\t\t\t))}\n\t\t\t\t</ItemGroup>\n\t\t\t)}\n\n\t\t\t{!!onRedeem && (\n\t\t\t\t<Button tone=\"primary\" fullWidth onClick={onRedeem}>\n\t\t\t\t\t{strings.redeem}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nLoyaltyPoints.displayName = 'LoyaltyPoints';\n","/**\n * Negative-amount presentation shared across commerce surfaces.\n *\n * Consumers pass amounts as opaque preformatted strings, sometimes already\n * carrying a leading \"-\" and sometimes not. Rendering those raw meant the same\n * concept — money coming off a total — appeared with a HYPHEN-MINUS in one card\n * and a MINUS SIGN in the next.\n *\n * U+2212 is the correct glyph: it is drawn to the width of a digit and sits on\n * the maths axis, so it aligns in a tabular-figures column where the narrower,\n * lower hyphen does not.\n */\n\n/** U+2212 MINUS SIGN. */\nexport const MINUS_SIGN = '−';\n\n/** Drop any leading sign or whitespace a consumer already supplied. */\nexport function stripLeadingMinus(value: string): string {\n\treturn value.replace(/^[\\s−-]+/, '');\n}\n\n/**\n * Present an amount as a deduction: exactly one U+2212, whatever the caller\n * passed in. An empty or whitespace-only value is returned untouched so the\n * caller's own empty handling still applies.\n */\nexport function formatDeduction(value: string): string {\n\tif (!value.trim()) return value;\n\treturn `${MINUS_SIGN}${stripLeadingMinus(value)}`;\n}\n","/**\n * AmountRow — the ledger row every commerce money surface is built from.\n *\n * Label, an optional quiet note, and the amount, aligned on their baseline. It\n * is not `InlineStat`: this row knows about money. `total` marks the figure the\n * eye should land on, `deduction` rewrites the sign to U+2212 and inks the\n * figure as a gain, and `rollup` rules the row off from the breakdown above\n * it. Amounts use the sans UI font with tabular figures and arrive already\n * formatted; the row does no arithmetic.\n */\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport { formatDeduction } from '../format-signed-amount';\nimport type { AmountRowProps } from './types';\n\nfunction isText(value: ReactNode): value is string | number {\n\treturn typeof value === 'string' || typeof value === 'number';\n}\n\nexport const AmountRow = forwardRef<HTMLDivElement, AmountRowProps>(function AmountRow({\n\tlabel,\n\tamount,\n\tnote,\n\ttotal = false,\n\tdeduction = false,\n\trollup = false,\n\tclassName,\n\t...props\n}, ref) {\n\tconst hasNote = note !== undefined && note !== null && note !== false && note !== '';\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tdata-slot=\"amount-row\"\n\t\t\tdata-total={total ? '' : undefined}\n\t\t\tdata-deduction={deduction ? '' : undefined}\n\t\t\tdata-rollup={rollup ? '' : undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'amount-row--component flex min-w-0 items-baseline gap-space-md',\n\t\t\t\t// One rule, midway between the breakdown and the total it rolls up.\n\t\t\t\trollup && 'mt-space-sm border-t border-border pt-space-lg',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isText(label) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype={total ? 'inherit' : 'secondary'}\n\t\t\t\t\tweight={total ? 'semibold' : 'regular'}\n\t\t\t\t\t// A total caption shares the summary-total text role used across blocks.\n\t\t\t\t\tlineHeight={total ? 'tight' : 'normal'}\n\t\t\t\t\tclassName=\"amount-row--label min-w-0 flex-1 wrap-anywhere\"\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\t<span className=\"amount-row--label min-w-0 flex-1\">{label}</span>\n\t\t\t)}\n\t\t\t{!!hasNote && (isText(note) ? (\n\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"amount-row--note shrink-0 tabular-nums\">\n\t\t\t\t\t{note}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\t<span className=\"amount-row--note inline-flex shrink-0 items-center\">{note}</span>\n\t\t\t))}\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\ttype={deduction ? 'success' : 'inherit'}\n\t\t\t\tweight={total ? 'bold' : 'medium'}\n\t\t\t\tclassName=\"amount-row--value shrink-0 text-end tabular-nums\"\n\t\t\t>\n\t\t\t\t{deduction ? formatDeduction(amount) : amount}\n\t\t\t</Text>\n\t\t</div>\n\t);\n});\n\nAmountRow.displayName = 'AmountRow';\n","/**\n * SummaryPanel — the money ledger most commerce surfaces are made of: a stack\n * of `AmountRow`s, usually ending in the one row that matters more than the\n * rest. A cart, a tax breakdown, an invoice header and an order summary all\n * draw it, so each emphasises its total the same way.\n *\n * The panel draws no ground of its own: it sits directly on the surface that\n * places it, because a tinted box inside a card is a box-in-box. Its only rule\n * is the one a `rollup` row draws above a grand total.\n */\nimport { forwardRef } from 'react';\n\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nimport type { SummaryPanelProps } from './types';\n\nexport const SummaryPanel = forwardRef<HTMLDivElement, SummaryPanelProps>(function SummaryPanel({\n\tclassName,\n\tchildren,\n\t...props\n}, ref) {\n\treturn (\n\t\t<Stack\n\t\t\tref={ref}\n\t\t\tgap=\"sm\"\n\t\t\tdata-slot=\"summary-panel\"\n\t\t\tclassName={cn('summary-panel--component min-w-0', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Stack>\n\t);\n});\n\nSummaryPanel.displayName = 'SummaryPanel';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface Discount {\n\t/** Stable identity for this entry. Falls back to the kind, label and position. */\n\tid?: string;\n\t/** Display label. */\n\tlabel: string;\n\t/** Already formatted. Rendered as a deduction whatever sign it carries. */\n\tamount: string;\n\t/** What kind of discount it is (\"Code\", \"Automatic\"), shown quietly beside the amount. */\n\tkind?: ReactNode;\n\t/** The kind as plain text. Kept for existing callers; `kind` wins when both are set. */\n\ttype?: string;\n\t/**\n\t * Draws the kind as a chip in this tone. Discount kinds are categories, so\n\t * pass `neutral` unless the chip states a status. Omit it for the quiet note.\n\t */\n\tbadge?: BadgeTone;\n}\n\nexport interface DiscountStackStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted sum of every discount. */\n\ttotalSavings: string;\n}\n\nexport const defaultDiscountStackStrings: DiscountStackStrings = {\n\ttitle: 'Applied discounts',\n\ttotalSavings: 'Total savings',\n};\n\nexport interface DiscountStackPreviewProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Discounts applied, in the order they stack. */\n\tdiscounts: Discount[];\n\t/** Formatted sum of every discount. */\n\ttotalSavings: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<DiscountStackStrings>;\n}\n\n/** The source kit's name for `DiscountStackPreviewProps`. */\nexport type DiscountStackProps = DiscountStackPreviewProps;\n","/**\n * DiscountStackPreview — the discounts applied to an order, in the order they\n * stack, with the total saved. Every row is a deduction on the shared commerce\n * ledger (`SummaryPanel` + `AmountRow`), so the sign is one U+2212 and the\n * figure is in success ink whatever the caller passed. A discount's kind\n * (\"Code\", \"Automatic\") sits quietly beside the amount; pass a `badge` tone\n * to keep it as a chip instead. The total is ruled off from the rows it sums.\n *\n * `DiscountStack` is the same component under the source kit's name.\n */\nimport type { ReactNode } from 'react';\n\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultDiscountStackStrings, type Discount, type DiscountStackPreviewProps } from './types';\n\nfunction discountKind(discount: Discount): ReactNode {\n\tconst kind = discount.kind ?? discount.type;\n\tif (kind === undefined || kind === null || kind === '') return undefined;\n\treturn discount.badge ? <Badge tone={discount.badge} size=\"sm\">{kind}</Badge> : kind;\n}\n\nexport function DiscountStackPreview({\n\tdiscounts,\n\ttotalSavings,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: DiscountStackPreviewProps) {\n\tconst strings = useStrings(defaultDiscountStackStrings, stringsProp);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\tdata-slot=\"discount-stack\"\n\t\t\tclassName={cn('discount-stack--component w-full', className)}\n\t\t>\n\t\t\t<SummaryPanel className=\"discount-stack--ledger\">\n\t\t\t\t{/* A kind is a label, not an identity: two \"Seasonal\" rows once\n\t\t\t\t collided on it. An explicit `id` wins; the index keeps the\n\t\t\t\t fallback key unique without requiring one. */}\n\t\t\t\t{discounts.map((discount, index) => (\n\t\t\t\t\t<AmountRow\n\t\t\t\t\t\tkey={discount.id ?? `${discount.type ?? ''}-${discount.label}-${String(index)}`}\n\t\t\t\t\t\tclassName=\"discount-stack--row\"\n\t\t\t\t\t\tlabel={discount.label}\n\t\t\t\t\t\tnote={discountKind(discount)}\n\t\t\t\t\t\tamount={discount.amount}\n\t\t\t\t\t\tdeduction\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t\t<AmountRow\n\t\t\t\t\tclassName=\"discount-stack--total\"\n\t\t\t\t\tlabel={strings.totalSavings}\n\t\t\t\t\tamount={totalSavings}\n\t\t\t\t\ttotal\n\t\t\t\t\tdeduction\n\t\t\t\t\trollup={discounts.length > 0}\n\t\t\t\t/>\n\t\t\t</SummaryPanel>\n\t\t</Card>\n\t);\n}\n\nDiscountStackPreview.displayName = 'DiscountStackPreview';\n\n/** The source kit's name for `DiscountStackPreview`; the same component. */\nexport const DiscountStack = DiscountStackPreview;\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\n/**\n * Transit stage. Drives the status label (through `strings`) and the tone of\n * the status chip, so a delayed shipment can never be painted as a healthy one.\n */\nexport type ShipmentStatus = 'pending' | 'in_transit' | 'delivered' | 'delayed';\n\n/**\n * Chip tone per stage. `delayed` is a warning, not an error: the parcel is\n * still coming. Primary stays off status chips.\n */\nexport const shipmentStatusTone: Record<ShipmentStatus, BadgeTone> = {\n\tpending: 'neutral',\n\tin_transit: 'info',\n\tdelivered: 'success',\n\tdelayed: 'warning',\n};\n\nexport interface TrackingStep {\n\t/** Stable identity. Falls back to the label and position, so repeated labels never collide. */\n\tid?: string;\n\t/** Display label. */\n\tlabel: string;\n\t/**\n\t * Whether the parcel has reached this checkpoint. The latest reached\n\t * checkpoint stays current until the shipment is delivered.\n\t */\n\tdone: boolean;\n\t/** Already formatted. When the checkpoint was reached: a parcel's rail is a log, not a plan. */\n\ttimestamp?: string;\n}\n\nexport interface ShipmentDetail {\n\t/** Display label. */\n\tlabel: string;\n\tvalue: ReactNode;\n}\n\nexport interface ShipmentTrackingStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Label of the tracking-number row. */\n\ttrackingNumber: string;\n\t/** Label of the carrier row. */\n\tcarrier: string;\n\t/** Accessible name of the copy button beside the tracking number. */\n\tcopyTrackingNumber: string;\n\t/** Status label for each `ShipmentStatus`. */\n\tpending: string;\n\tin_transit: string;\n\tdelivered: string;\n\tdelayed: string;\n}\n\nexport const defaultShipmentTrackingStrings: ShipmentTrackingStrings = {\n\ttitle: 'Shipment tracking',\n\ttrackingNumber: 'Tracking number',\n\tcarrier: 'Carrier',\n\tcopyTrackingNumber: 'Copy tracking number',\n\tpending: 'Pending',\n\tin_transit: 'In transit',\n\tdelivered: 'Delivered',\n\tdelayed: 'Delayed',\n};\n\nexport interface ShipmentTrackingProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Carrier tracking reference. */\n\ttrackingNumber: string;\n\t/** Carrier handling the shipment. */\n\tcarrier?: string;\n\t/** Current transit stage. */\n\tstatus: ShipmentStatus;\n\t/** Tracking checkpoints, oldest first. */\n\tsteps: TrackingStep[];\n\t/** Label/value facts about the shipment. */\n\tdetails?: ShipmentDetail[];\n\t/** Fired after the tracking number is copied to the clipboard. */\n\tonCopyTracking?: (trackingNumber: string) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<ShipmentTrackingStrings>;\n}\n","/**\n * ShipmentTracking — a parcel's tracking number, carrier and checkpoint rail.\n *\n * The title carries the status chip, its tone derived from `status`, so a\n * delayed parcel warns instead of reassuring. The tracking number is a\n * copyable identifier and the carrier a labelled fact, followed by any\n * consumer-supplied details. The checkpoints are a vertical rail drawn by the\n * shared `Timeline` engine with their timestamps: the latest reached\n * checkpoint is the current step (`aria-current=\"step\"`) until the shipment\n * is delivered, and the rail never runs ahead of a checkpoint not yet reached.\n * Carrier polling and checkpoint normalisation stay app-owned.\n */\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { Copyable } from '../../../base/copyable';\nimport { Stack } from '../../../base/structure';\nimport { InlineStat } from '../../data-display';\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultShipmentTrackingStrings,\n\tshipmentStatusTone,\n\ttype ShipmentTrackingProps,\n\ttype TrackingStep,\n} from './types';\n\nfunction latestReachedIndex(steps: readonly TrackingStep[]) {\n\tfor (let index = steps.length - 1; index >= 0; index -= 1) {\n\t\tif (steps[index]?.done) return index;\n\t}\n\treturn -1;\n}\n\nexport function ShipmentTracking({\n\ttrackingNumber,\n\tcarrier,\n\tstatus,\n\tsteps,\n\tdetails = [],\n\tonCopyTracking,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: ShipmentTrackingProps) {\n\tconst strings = useStrings(defaultShipmentTrackingStrings, stringsProp);\n\n\t// The latest reached checkpoint stays current until delivery; a delivered\n\t// parcel, or one that has reached no checkpoint yet, has no current step.\n\tconst current = status === 'delivered' ? -1 : latestReachedIndex(steps);\n\tconst rail: TimelineItem[] = steps.map((step, index) => ({\n\t\tid: step.id ?? `${step.label}-${String(index)}`,\n\t\ttitle: step.label,\n\t\ttimestamp: step.timestamp,\n\t\tstatus: index === current ? 'current' : step.done ? 'completed' : 'pending',\n\t}));\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={(\n\t\t\t\t<Badge tone={shipmentStatusTone[status]} className=\"shipment-tracking--status\">\n\t\t\t\t\t{strings[status]}\n\t\t\t\t</Badge>\n\t\t\t)}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"shipment-tracking\"\n\t\t\tclassName={cn('shipment-tracking--component w-full', className)}\n\t\t>\n\t\t\t<Stack gap=\"md\" className=\"shipment-tracking--facts\">\n\t\t\t\t<InlineStat\n\t\t\t\t\tlabel={strings.trackingNumber}\n\t\t\t\t\tvalue={(\n\t\t\t\t\t\t<Copyable\n\t\t\t\t\t\t\tvalue={trackingNumber}\n\t\t\t\t\t\t\tmono\n\t\t\t\t\t\t\ttruncate\n\t\t\t\t\t\t\tonCopy={onCopyTracking}\n\t\t\t\t\t\t\tstrings={{ copyLabel: strings.copyTrackingNumber }}\n\t\t\t\t\t\t\tclassName=\"shipment-tracking--tracking-number\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tvalueClassName=\"min-w-0\"\n\t\t\t\t/>\n\t\t\t\t{!!carrier && (\n\t\t\t\t\t<InlineStat label={strings.carrier} value={carrier} valueWeight=\"medium\" />\n\t\t\t\t)}\n\t\t\t\t{details.map((detail, index) => (\n\t\t\t\t\t<InlineStat\n\t\t\t\t\t\tkey={`${detail.label}-${String(index)}`}\n\t\t\t\t\t\tlabel={detail.label}\n\t\t\t\t\t\tvalue={detail.value}\n\t\t\t\t\t\tvalueWeight=\"medium\"\n\t\t\t\t\t\tvalueClassName=\"min-w-0 truncate\"\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</Stack>\n\n\t\t\t{rail.length > 0 && <Timeline items={rail} dotSize=\"sm\" className=\"shipment-tracking--rail\" />}\n\t\t</Card>\n\t);\n}\n\nShipmentTracking.displayName = 'ShipmentTracking';\n","import type { StringsProp } from '../../../../lib/strings';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\n/**\n * The card's content, shared by all five presentations. Every field is\n * pre-formatted display copy — this family renders what it is handed and does\n * no currency or date formatting of its own, so localisation stays with the\n * consumer.\n */\nexport interface GiftcardData {\n\t/** Redemption code, shown in a monospace run. */\n\tcode: string;\n\t/** Formatted face value, e.g. `\"$50.00\"`. */\n\tamount: string;\n\t/** Formatted balance left. Omit for a card that shows only its face value. */\n\tremainingAmount?: string;\n\t/** Currency label shown beside the amount when the formatted values omit it. */\n\tcurrency?: string;\n\t/** Lifecycle state, driving the status chip's tone. */\n\tstatus: 'active' | 'redeemed' | 'expired' | 'disabled';\n\t/** Who the card is for. */\n\trecipientName?: string;\n\t/** Who sent it. */\n\tsenderName?: string;\n\t/** Personal note from the sender. */\n\tmessage?: string;\n\t/** Formatted expiry date. */\n\texpiresAt?: string;\n\t/** Formatted issue date. */\n\tcreatedAt?: string;\n\t/** Design name shown as the card's template label. */\n\ttemplate?: string;\n\t/** Fired by the card's view action. Omit to render the card without it. */\n\tonView?: () => void;\n}\n\n/** Background gradient for the illustrated and full presentations. */\nexport type GradientVariant = 'purple' | 'green' | 'warm';\n/** Decorative overlay drawn on top of the gradient. */\nexport type PatternVariant = 'none' | 'circles' | 'waves';\n/** Accent used for the minimal presentation's rule and highlights. */\nexport type AccentColor = 'green' | 'purple' | 'warm';\n/** Header band colour for the compact presentation. */\nexport type HeaderColor = 'green' | 'blue' | 'amber';\n\nexport type GiftcardStatus = GiftcardData['status'];\n\n/**\n * Localised labels for giftcard cards. Covers status chips, the recurring\n * field labels rendered by all five partials (full / dark / illustrated /\n * minimal / compact), and the inline button labels.\n *\n * Override per-instance via `strings`.\n */\nexport interface GiftcardStrings {\n\tstatus: Record<GiftcardStatus, string>;\n\tgiftCard: string;\n\tbalance: string;\n\tpersonalMessage: string;\n\tto: string;\n\tfrom: string;\n\texpires: string;\n\trecipient: string;\n\tviewDetails: string;\n\tcopyCode: string;\n\t/** Successful code-copy feedback. */\n\tcopiedCode?: string;\n\t/** Failed code-copy feedback and retry affordance. */\n\tcopyFailed?: string;\n\t/** Pending code-copy label. */\n\tcopyingCode?: string;\n}\n\nexport const defaultGiftcardStrings: Required<GiftcardStrings> = {\n\tstatus: {\n\t\tactive: 'Active',\n\t\tredeemed: 'Redeemed',\n\t\texpired: 'Expired',\n\t\tdisabled: 'Disabled',\n\t},\n\tgiftCard: 'Gift card',\n\tbalance: 'Balance',\n\tpersonalMessage: 'Personal message',\n\tto: 'To',\n\tfrom: 'From',\n\texpires: 'Expires',\n\trecipient: 'Recipient',\n\tviewDetails: 'View details',\n\tcopyCode: 'Copy code',\n\tcopiedCode: 'Code copied',\n\tcopyFailed: 'Could not copy code. Try again.',\n\tcopyingCode: 'Copying code…',\n};\n\nexport interface GiftcardCommonProps {\n\t/** Override default English giftcard strings. */\n\tstrings?: StringsProp<GiftcardStrings>;\n}\n\nexport const giftcardStatusTone: Record<\n\tGiftcardStatus,\n\t'success' | 'secondary' | 'destructive' | 'warning'\n> = {\n\tactive: 'success',\n\tredeemed: 'secondary',\n\texpired: 'destructive',\n\tdisabled: 'warning',\n};\n\n// Reading regions stay inverse; preset colors belong to their decorative strip.\nconst inverseGradient = 'bg-inverse-background from-inverse-background via-inverse-surface to-inverse-background';\n\nexport const gradientMap: Record<GradientVariant, { card: string; strip: string }> = {\n\tpurple: {\n\t\tcard: inverseGradient,\n\t\tstrip: 'from-primary via-primary/90 to-info',\n\t},\n\tgreen: {\n\t\tcard: inverseGradient,\n\t\tstrip: 'from-success via-info to-success',\n\t},\n\twarm: {\n\t\tcard: inverseGradient,\n\t\tstrip: 'from-warning via-warning/90 to-destructive',\n\t},\n};\n\nexport const compactGradientMap: Record<GradientVariant, string> = {\n\tpurple: 'from-primary to-info',\n\tgreen: 'from-success to-info',\n\twarm: 'from-warning to-destructive',\n};\n\nexport const accentColorMap: Record<AccentColor, { line: string; iconBg: string }> = {\n\tgreen: { line: toneRecipes.success.solid, iconBg: `${toneRecipes.success.tint} ${toneRecipes.success.ink}` },\n\tpurple: { line: toneRecipes.primary.solid, iconBg: `${toneRecipes.primary.tint} ${toneRecipes.primary.ink}` },\n\twarm: { line: toneRecipes.warning.solid, iconBg: `${toneRecipes.warning.tint} ${toneRecipes.warning.ink}` },\n};\n\nexport const headerGradientMap: Record<HeaderColor, string> = {\n\tgreen: 'from-success to-info',\n\tblue: 'from-info to-primary',\n\tamber: 'from-warning to-destructive',\n};\n\n","/**\n * GiftcardCompact — single-row compact layout. A small card-art swatch (the\n * chosen gradient around the inverse card face) on the left, code + recipient\n * in the middle, amount + status badge on the right. Use for inline lists /\n * tables of giftcards. Strings overridable.\n */\nimport { Badge } from '../../../../base/badge';\nimport { MonoValue, Value } from '../../../../primitives';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../../base/item';\nimport { Stack } from '../../../../base/structure';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype GradientVariant,\n\tcompactGradientMap,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCompact({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\tgradient = 'purple',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Background gradient for the leading block. */\n\tgradient?: GradientVariant;\n\t/** Merged onto the row root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\n\treturn (\n\t\t<Item\n\t\t\tsize=\"sm\"\n\t\t\tvariant=\"outline\"\n\t\t\tpadding=\"default\"\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-compact--component flex-nowrap shadow-sm transition-colors duration-150 hover:border-border',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<ItemMedia variant=\"image\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'flex size-full items-center justify-center bg-gradient-to-br p-space-2xs',\n\t\t\t\t\t\tcompactGradientMap[gradient],\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"size-full rounded-inner bg-inverse-background\" />\n\t\t\t\t</div>\n\t\t\t</ItemMedia>\n\n\t\t\t<ItemContent className=\"min-w-0\">\n\t\t\t\t<ItemTitle className=\"w-full max-w-full truncate whitespace-nowrap\">\n\t\t\t\t\t<MonoValue type=\"inherit\">{code}</MonoValue>\n\t\t\t\t</ItemTitle>\n\t\t\t\t{!!recipientName && <ItemDescription clamp={1}>{recipientName}</ItemDescription>}\n\t\t\t</ItemContent>\n\n\t\t\t<ItemActions className=\"shrink-0\">\n\t\t\t\t<Stack gap=\"2xs\" align=\"end\" className=\"shrink-0\">\n\t\t\t\t\t<div className=\"flex items-baseline gap-space-xs\">\n\t\t\t\t\t\t<Value type=\"inherit\" weight=\"bold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t<Value size=\"xs\" className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t<Badge tone={statusTone} size=\"sm\">{statusLabel}</Badge>\n\t\t\t\t</Stack>\n\t\t\t</ItemActions>\n\t\t</Item>\n\t);\n}\n\nGiftcardCompact.displayName = 'GiftcardCompact';\n","import { useEffect, useRef, useState } from 'react';\nimport { Check, Copy, Loader2, X } from 'lucide-react';\nimport { Button } from '../../../../base/buttons';\nimport { Text } from '../../../../typography';\nimport { cn } from '../../../../../lib/utils';\nimport { defaultGiftcardStrings, type GiftcardStrings } from '../types';\nimport { useStrings } from '../../../../../lib/strings';\n\ntype CopyState = 'idle' | 'pending' | 'copied' | 'failed';\n\n/** Owns the four giftcard code actions without changing their display strips. */\nexport function GiftcardCopyButton({ code, strings, inverse = false, className }: {\n code: string;\n strings: Pick<GiftcardStrings, 'copyCode' | 'copiedCode' | 'copyFailed' | 'copyingCode'>;\n /** Explicit inverse reading surface, independent of the surrounding page theme. */\n inverse?: boolean;\n className?: string;\n}) {\n const copyStrings = useStrings<Required<GiftcardStrings>>(defaultGiftcardStrings, strings);\n const generation = useRef(0);\n const [result, setResult] = useState<{ code: string; state: CopyState }>({code, state: 'idle'});\n const state = result.code === code ? result.state : 'idle';\n useEffect(() => {\n generation.current++;\n setResult(previous => previous.code === code ? previous : {code, state: 'idle'});\n return () => { generation.current++; };\n }, [code]);\n const label = state === 'copied' ? copyStrings.copiedCode : state === 'failed' ? copyStrings.copyFailed : state === 'pending' ? copyStrings.copyingCode : copyStrings.copyCode;\n const Icon = state === 'copied' ? Check : state === 'failed' ? X : state === 'pending' ? Loader2 : Copy;\n const copy = async () => {\n if (!code || state === 'pending') return;\n const request = generation.current;\n setResult({code, state: 'pending'});\n try {\n await navigator.clipboard.writeText(code);\n if (generation.current === request) setResult({code, state: 'copied'});\n } catch {\n if (generation.current === request) setResult({code, state: 'failed'});\n }\n };\n return <>\n <Button\n type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly\n disabled={!code || state === 'pending'} aria-busy={state === 'pending'}\n aria-label={label} withTooltip={label}\n className={cn(\n 'giftcard-copy--component', className,\n // Use the same complete state selector as the shared Button recipe so cn\n // replaces its page-themed fill instead of leaving a more specific rule.\n inverse && 'text-inverse-foreground [&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-inverse-surface [&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:text-inverse-foreground [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-inverse-surface-strong focus-visible:bg-inverse-surface',\n )}\n onClick={() => void copy()}\n >\n <Icon aria-hidden className={cn('size-icon-sm', state === 'pending' && 'animate-spin')} />\n </Button>\n {(state === 'copied' || state === 'failed') && <Text tag=\"span\" role=\"status\" className=\"sr-only\">{label}</Text>}\n </>;\n}\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardDark — premium dark variant. Header label and status chip,\n * balance + strike-through line, code strip, metadata rows\n * (recipient / expires), and a full-width call to action. Strings\n * overridable for i18n.\n */\nimport { Heading } from '../../../../typography/heading';\nimport { Text } from '../../../../typography/text';\nimport { Badge } from '../../../../base/badge';\nimport { Card } from '../../../../base/cards';\nimport { Button } from '../../../../base/buttons';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { Stack } from '../../../../base/structure';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCardDark({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & { className?: string }) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\t// The card, scoped to the dark theme, is the one inset owner for label,\n\t// amount, code strip, facts and action, so every region starts on the same edge.\n\treturn (\n\t\t<Card\n\t\t\tsurface=\"card\"\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-dark--component dark max-w-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Stack gap=\"lg\" className=\"giftcard-dark--body\">\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"center\" gap=\"md\" wrap={false}>\n\t\t\t\t\t<Text tag=\"span\" className=\"text-inverse-muted\">\n\t\t\t\t\t\t{strings.giftCard}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Badge tone={statusTone} className=\"shrink-0\">{statusLabel}</Badge>\n\t\t\t\t</Stack>\n\n\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"tabular-nums text-inverse-foreground\">\n\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-inverse-disabled\">\n\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"giftcard-dark--code rounded-inner border border-inverse-border bg-inverse-surface p-surface-xs\">\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t\t<MonoValue className=\"flex-1 tracking-[0.15em] text-inverse-foreground\">\n\t\t\t\t\t\t\t{code}\n\t\t\t\t\t\t</MonoValue>\n\t\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} inverse />\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t\t<MetadataList\n\t\t\t\t\titems={metadataItems}\n\t\t\t\t\tcolumns={1}\n\t\t\t\t\tclassName=\"[&_.metadata-list--label]:text-inverse-muted [&_.metadata-list--value]:text-inverse-foreground\"\n\t\t\t\t/>\n\n\t\t\t\t{/* Inverse button on the dark surface so the label always reads\n\t\t\t\t without raw palette overrides. */}\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"neutral\"\n\t\t\t\t\t\tbuttonStyle=\"solid\"\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nGiftcardCardDark.displayName = 'GiftcardCardDark';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCard (full) — premium gradient layout with optional\n * pattern overlay (circles / waves), header status chip, balance / strike-\n * through line, copyable code strip, personal message block, and metadata\n * grid (To / From / Expires). Strings overridable for i18n.\n */\nimport { DisplayLabel } from '../../../../typography/display-label';\nimport { Text } from '../../../../typography/text';\nimport { Heading } from '../../../../typography/heading';\nimport { Badge } from '../../../../base/badge';\nimport { Button } from '../../../../base/buttons';\nimport { Stack } from '../../../../base/structure';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype GradientVariant,\n\ttype PatternVariant,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n\tgradientMap,\n} from '../types';\n\nexport function GiftcardFull({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\tsenderName,\n\tmessage,\n\texpiresAt,\n\tcreatedAt: _createdAt,\n\ttemplate: _template,\n\tonView,\n\tgradient = 'purple',\n\tpattern = 'none',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData &\n\tGiftcardCommonProps & {\n\t\t/** Background gradient. */\n\t\tgradient?: GradientVariant;\n\t\t/** Decorative overlay on the gradient. */\n\t\tpattern?: PatternVariant;\n\t\tclassName?: string;\n\t}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.to, value: recipientName }] : []),\n\t\t...(senderName ? [{ label: strings.from, value: senderName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component w-full max-w-sm transition-shadow',\n\t\t\t\t'hover:shadow-md',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{/* Gift card header */}\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'relative overflow-hidden rounded-t-radius bg-gradient-to-br p-surface',\n\t\t\t\t\tgradientMap[gradient].card,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<div aria-hidden className={cn('absolute inset-x-0 top-0 z-10 h-1 bg-gradient-to-r', gradientMap[gradient].strip)} />\n\t\t\t\t{/* Pattern: circles */}\n\t\t\t\t{pattern === 'circles' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"absolute -top-8 -right-8 h-32 w-32 rounded-full bg-inverse-decoration\" aria-hidden=\"true\" />\n\t\t\t\t\t\t<div className=\"absolute -bottom-4 -left-4 h-20 w-20 rounded-full bg-inverse-decoration\" aria-hidden=\"true\" />\n\t\t\t\t\t</>\n\t\t\t\t)}\n\n\t\t\t\t{/* Pattern: waves */}\n\t\t\t\t{pattern === 'waves' && (\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclassName=\"absolute inset-0 h-full w-full opacity-5\"\n\t\t\t\t\t\tviewBox=\"0 0 400 200\"\n\t\t\t\t\t\tpreserveAspectRatio=\"none\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path d=\"M0 80 C100 20, 200 140, 400 60 L400 200 L0 200 Z\" className=\"fill-inverse-foreground\" />\n\t\t\t\t\t\t<path d=\"M0 120 C120 60, 280 180, 400 100 L400 200 L0 200 Z\" className=\"fill-inverse-foreground\" />\n\t\t\t\t\t</svg>\n\t\t\t\t)}\n\n\t\t\t\t<div className=\"absolute top-4 right-4 z-10\">\n\t\t\t\t\t<Badge\n\t\t\t\t\t\ttone={statusTone}\n\t\t\t\t\t\tinline\n\t\t\t\t\t\tdot\n\t\t\t\t\t\tclassName=\"border border-inverse-border bg-inverse-background text-inverse-foreground shadow-sm\"\n\t\t\t\t\t\tdata-status={statusTone}\n\t\t\t\t\t>\n\t\t\t\t\t\t{statusLabel}\n\t\t\t\t\t</Badge>\n\t\t\t\t</div>\n\n\t\t\t\t<Stack gap=\"xl\" className=\"relative z-10\">\n\t\t\t\t\t<Text weight=\"medium\" className=\"text-inverse-muted\">{strings.giftCard}</Text>\n\n\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t<DisplayLabel tone=\"inverse\">{strings.balance}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" gap=\"lg\">\n\t\t\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"text-inverse-foreground tabular-nums drop-shadow-sm\">\n\t\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-inverse-disabled\">{amount}</Value>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{/* Code strip — premium feel */}\n\t\t\t\t\t<div className={cn(\n\t\t\t\t\t\t\t'giftcard-full--code',\n\t\t\t\t\t\t\t'rounded-radius p-surface-xs',\n\t\t\t\t\t\t\t'bg-inverse-surface',\n\t\t\t\t\t\t\t'border border-inverse-border',\n\t\t\t\t\t\t\t'shadow-sm',\n\t\t\t\t\t\t)}>\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t\t<MonoValue weight=\"semibold\" className=\"flex-1 tracking-[0.2em] text-inverse-foreground\">\n\t\t\t\t\t\t\t{code}\n\t\t\t\t\t\t</MonoValue>\n\t\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} inverse />\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t{/* Details section — structured metadata grid */}\n\t\t\t\t<div className=\"box-border rounded-b-radius bg-card text-card-foreground p-surface shadow-sm border border-t-0 border-border\">\n\t\t\t\t<Stack gap=\"xl\">\n\t\t\t\t{!!message && (\n\t\t\t\t\t<Stack gap=\"normal\" className=\"giftcard-full--message\">\n\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t{strings.personalMessage}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t<Text type=\"secondary\" lineHeight=\"relaxed\" className=\"italic\">\n\t\t\t\t\t\t\t&ldquo;{message}&rdquo;\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\n\t\t\t\t<MetadataList\n\t\t\t\t\tadaptTo=\"container\"\n\t\t\t\t\titems={metadataItems}\n\t\t\t\t\tcolumns={{ base: 1, sm: 2 }}\n\t\t\t\t/>\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nGiftcardFull.displayName = 'GiftcardFull';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardIllustrated — gift-card surface with a compact illustrated\n * header, balance + status row, code strip, details, and a footer action.\n * Strings are overridable for i18n.\n */\nimport { DisplayLabel } from '../../../../typography/display-label';\nimport { Text } from '../../../../typography/text';\nimport { Heading } from '../../../../typography/heading';\nimport { Badge } from '../../../../base/badge';\nimport { Card } from '../../../../base/cards';\nimport { Button } from '../../../../base/buttons';\nimport { Stack } from '../../../../base/structure';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype HeaderColor,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n\theaderGradientMap,\n} from '../types';\n\nexport function GiftcardCardIllustrated({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\theaderColor = 'green',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Colour of the header band. */\n\theaderColor?: HeaderColor;\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\t// The card owns the frame; the illustrated band bleeds to its edges like\n\t// media, and the body below owns the one content inset.\n\treturn (\n\t\t<Card\n\t\t\tsurface=\"card\"\n\t\t\tpadding=\"none\"\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-illustrated--component max-w-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<div className=\"relative flex h-16 items-center justify-between overflow-hidden bg-inverse-background bg-gradient-to-br from-inverse-background via-inverse-surface to-inverse-background px-surface\">\n\t\t\t\t<div aria-hidden className={cn('absolute inset-x-0 top-0 h-1 bg-gradient-to-r', headerGradientMap[headerColor])} />\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"absolute inset-0 opacity-80\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundImage:\n\t\t\t\t\t\t\t'repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in oklch, var(--inverse-foreground) 3%, transparent) 10px 20px)',\n\t\t\t\t\t}}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"relative\">\n\t\t\t\t\t{strings.giftCard}\n\t\t\t\t</DisplayLabel>\n\t\t\t</div>\n\n\t\t\t<Stack gap=\"lg\" className=\"giftcard-illustrated--body p-surface\">\n\t\t\t\t<div className=\"flex items-start justify-between\">\n\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"tabular-nums text-inherit\">\n\t\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t{strings.balance}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Badge tone={statusTone}>{statusLabel}</Badge>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"giftcard-illustrated--code rounded-inner border border-border bg-muted/30 p-surface-xs\">\n\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t<MonoValue type=\"inherit\" className=\"flex-1 tracking-[0.15em]\">\n\t\t\t\t\t\t{code}\n\t\t\t\t\t</MonoValue>\n\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} />\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t\t<MetadataList adaptTo=\"container\" items={metadataItems} columns={2} />\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nGiftcardCardIllustrated.displayName = 'GiftcardCardIllustrated';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardMinimal — clean minimal layout. A small accent line (driven by\n * `color`) sits above the header label, balance, code strip, and metadata\n * rows. Footer \"View details\" link uses an arrow affordance.\n * Strings overridable for i18n.\n */\nimport { Heading } from '../../../../typography/heading';\nimport { Text } from '../../../../typography/text';\nimport { Badge } from '../../../../base/badge';\nimport { Card } from '../../../../base/cards';\nimport { TextButton } from '../../../../base/buttons';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { Stack } from '../../../../base/structure';\nimport { cn } from '../../../../../lib/utils';\nimport { ArrowRight } from 'lucide-react';\nimport {\n\ttype AccentColor,\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\taccentColorMap,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCardMinimal({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\tcolor = 'green',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Accent for the rule and highlights. */\n\tcolor?: AccentColor;\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst accent = accentColorMap[color];\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\t// One inset owner, the card: the accent rule, label, amount, code, facts and\n\t// link all start on the same edge. Only the code strip keeps its own inset,\n\t// because it is a distinct copyable object.\n\treturn (\n\t\t<Card\n\t\t\tsurface=\"card\"\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-minimal--component max-w-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Stack gap=\"lg\" className=\"giftcard-minimal--body\">\n\t\t\t\t<div aria-hidden=\"true\" className={cn('h-1 w-12 rounded-radius-sm', accent.line)} />\n\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"center\" gap=\"md\" wrap={false}>\n\t\t\t\t\t<Text tag=\"span\" type=\"secondary\">\n\t\t\t\t\t\t{strings.giftCard}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Badge tone={statusTone} size=\"sm\" className=\"shrink-0\">{statusLabel}</Badge>\n\t\t\t\t</Stack>\n\n\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"tabular-nums text-inherit\">\n\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"giftcard-minimal--code rounded-inner border border-border bg-muted/30 p-surface-xs\">\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\">\n\t\t\t\t\t\t<MonoValue type=\"inherit\" className=\"flex-1 tracking-[0.15em]\">\n\t\t\t\t\t\t\t{code}\n\t\t\t\t\t\t</MonoValue>\n\t\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} className=\"shrink-0\" />\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t\t<MetadataList\n\t\t\t\t\titems={metadataItems}\n\t\t\t\t\tcolumns={1}\n\t\t\t\t\tdensity=\"compact\"\n\t\t\t\t\tclassName=\"[&_.metadata-list--grid]:gap-space-sm\"\n\t\t\t\t/>\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<TextButton onClick={onView} className=\"group/link self-start\">\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t\t<ArrowRight aria-hidden=\"true\" className=\"ml-1 size-icon-sm transition-transform group-hover/link:translate-x-0.5\" />\n\t\t\t\t\t</TextButton>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nGiftcardCardMinimal.displayName = 'GiftcardCardMinimal';\n","import { GiftcardCompact } from './partials/giftcard-compact';\nimport { GiftcardCardDark } from './partials/giftcard-dark';\nimport { GiftcardFull } from './partials/giftcard-full';\nimport { GiftcardCardIllustrated } from './partials/giftcard-illustrated';\nimport { GiftcardCardMinimal } from './partials/giftcard-minimal';\nimport type {\n\tAccentColor,\n\tGiftcardCommonProps,\n\tGiftcardData,\n\tGradientVariant,\n\tHeaderColor,\n\tPatternVariant,\n} from './types';\nimport { cn } from '../../../../lib/utils';\n\nexport type GiftcardCardVariant =\n\t| 'gradient'\n\t| 'compact'\n\t| 'minimal'\n\t| 'dark'\n\t| 'illustrated';\n\ninterface GiftcardCardSharedProps extends GiftcardData, GiftcardCommonProps {\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}\n\n/**\n * Each variant admits only the styling prop it can actually use; the others are\n * typed `never`, so passing `headerColor` to the gradient card is a type error\n * rather than a silently ignored prop.\n */\nexport type GiftcardCardProps = GiftcardCardSharedProps & (\n\t| {\n\t\t/** Premium gradient card. The default presentation. */\n\t\tvariant?: 'gradient';\n\t\t/** Background gradient. Default: `purple`. */\n\t\tgradient?: GradientVariant;\n\t\t/** Decorative overlay on the gradient. Default: `none`. */\n\t\tpattern?: PatternVariant;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Short row for collections and lists. */\n\t\tvariant: 'compact';\n\t\t/** Background gradient for the row's leading block. */\n\t\tgradient?: GradientVariant;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Restrained card that inherits the surrounding surface. */\n\t\tvariant: 'minimal';\n\t\t/** Accent for the rule and highlights. */\n\t\tcolor?: AccentColor;\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Solid dark card, for light surfaces that need contrast. */\n\t\tvariant: 'dark';\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Illustrated card with a coloured header band. */\n\t\tvariant: 'illustrated';\n\t\t/** Colour of the header band. */\n\t\theaderColor?: HeaderColor;\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t}\n);\n\n/**\n * GiftcardCard — one gift-card data contract with five deliberate visual\n * variants. The premium gradient card is the useful default; compact is for\n * collection rows, while minimal, dark, and illustrated are explicit styles.\n */\nexport function GiftcardCard(props: GiftcardCardProps) {\n\tconst className = cn('giftcard-card--component', props.className);\n\tswitch (props.variant) {\n\t\tcase 'compact':\n\t\t\treturn <GiftcardCompact {...props} className={className} />;\n\t\tcase 'minimal':\n\t\t\treturn <GiftcardCardMinimal {...props} className={className} />;\n\t\tcase 'dark':\n\t\t\treturn <GiftcardCardDark {...props} className={className} />;\n\t\tcase 'illustrated':\n\t\t\treturn <GiftcardCardIllustrated {...props} className={className} />;\n\t\tdefault:\n\t\t\treturn <GiftcardFull {...props} className={className} />;\n\t}\n}\n\nGiftcardCard.displayName = 'GiftcardCard';\n","import type { SmartCardSurface } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\nimport type { ReactNode } from 'react';\nimport type { SemanticTone } from '../../../../lib/component-vocabulary';\n\nexport type VendorProfileChangeTone = Extract<\n\tSemanticTone,\n\t'secondary' | 'success' | 'warning' | 'destructive'\n>;\n\n/** The two data views available when a dossier has overview and performance data. */\nexport type VendorProfileView = 'overview' | 'stats';\n\n/** A performance tile shown in the stats view. */\nexport interface VendorProfileStat {\n\t/** Stable key used when the stat collection changes order. */\n\tid?: string;\n\t/** Consumer-owned stat label. */\n\tlabel: ReactNode;\n\t/** Display value; prefer package primitives such as Money, Number, or Percent. */\n\tvalue: ReactNode;\n\t/** Optional comparison value rendered as a badge. */\n\tchange?: ReactNode;\n\t/** Explicit semantic meaning of the comparison. Defaults to neutral secondary. */\n\tchangeTone?: VendorProfileChangeTone;\n}\n\n/** An operational label/value row shown in the overview view. */\nexport interface VendorProfileMetric {\n\t/** Stable key used when the metric collection changes order. */\n\tid?: string;\n\t/** Consumer-owned metric label. */\n\tlabel: ReactNode;\n\t/** Display value; prefer a semantic package primitive when one exists. */\n\tvalue: ReactNode;\n}\n\n/**\n * Localised labels for VendorProfileCard. Override per-instance via `strings`.\n */\nexport interface VendorProfileStrings {\n\t/** Label for the operating overview tab. */\n\ttabOverview: string;\n\t/** Label for the performance statistics tab. */\n\ttabStats: string;\n\t/** Label above the primary earnings value. */\n\ttotalEarnings: string;\n\t/** Label for the message action. */\n\tmessage: string;\n\t/** Label for the engagement action. */\n\thire: string;\n\t/** Accessible and visible label for the verified badge. */\n\tverifiedAriaLabel: string;\n}\n\nexport const defaultVendorProfileStrings: VendorProfileStrings = {\n\ttabOverview: 'Overview',\n\ttabStats: 'Stats',\n\ttotalEarnings: 'Total earnings',\n\tmessage: 'Message',\n\thire: 'Hire vendor',\n\tverifiedAriaLabel: 'Verified',\n};\n\nexport interface VendorProfileCardProps {\n\t/** Vendor display name used by the identity header and avatar fallback. */\n\tname: string;\n\t/** Explicit avatar fallback text. Derived from `name` when omitted. */\n\tinitials?: string;\n\t/** Optional vendor avatar URL. */\n\tavatarUrl?: string;\n\t/** Secondary identity context such as category, market, or location. */\n\trole?: ReactNode;\n\t/** Shows the localized verified badge when true. */\n\tverified?: boolean;\n\t/** Primary earnings display; prefer the canonical Money primitive. */\n\tearnings?: ReactNode;\n\t/** Optional comparison rendered beside earnings. */\n\tearningsChange?: ReactNode;\n\t/** Explicit semantic meaning of `earningsChange`. Defaults to neutral secondary. */\n\tearningsChangeTone?: VendorProfileChangeTone;\n\t/** Operational rows rendered in the overview view. */\n\tmetrics?: VendorProfileMetric[];\n\t/** Performance tiles rendered in the stats view. */\n\tstats?: VendorProfileStat[];\n\t/** Controlled active view. Only used when both overview and stats exist. */\n\tview?: VendorProfileView;\n\t/** Initial active view for uncontrolled usage. Defaults to `overview`. */\n\tdefaultView?: VendorProfileView;\n\t/** Called when the user requests a different view in either state mode. */\n\tonViewChange?: (view: VendorProfileView) => void;\n\t/** Shows the message action and delegates its behavior to the consumer. */\n\tonMessage?: () => void;\n\t/** Shows the engagement action and delegates its behavior to the consumer. */\n\tonHire?: () => void;\n\t/**\n\t * Card surface override. Defaults through the shared SmartCard configuration.\n\t * `flat` also drops the dossier's own insets, so the embedding surface owns them.\n\t */\n\tsurface?: SmartCardSurface;\n\t/** Card density override. Defaults through the shared SmartCard configuration. */\n\t/** Additional classes applied to the outer SmartCard element. */\n\tclassName?: string;\n\t/** Deep-partial localized label overrides. */\n\tstrings?: StringsProp<VendorProfileStrings>;\n}\n","/**\n * VendorProfileCard — a compact vendor dossier with identity, earnings,\n * operating metrics, performance stats, and callback-driven actions.\n *\n * The component owns card chrome because it is a fixed-format profile card.\n * Consumers can still opt into `surface=\"flat\"` when embedding the dossier in\n * a larger surface. Its overview/stats view supports controlled and\n * uncontrolled state. Tabs only render when both content views are available;\n * an identity-only profile never grows dead controls or actions.\n */\nimport {compositionClasses} from '../../../base/structure/composition.recipes';\nimport { ChevronRight } from 'lucide-react';\nimport { forwardRef, type ReactNode, useState } from 'react';\n\nimport { Avatar, AvatarFallback, AvatarImage } from '../../../base/avatar';\nimport { Badge, type BadgeProps } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { hasRenderableContent, Card } from '../../../base/cards';\nimport {\n\tItem,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../base/navigation/tabs';\nimport { Grid, Stack } from '../../../base/structure';\nimport { InlineStat } from '../../data-display';\nimport { Initials, Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultVendorProfileStrings,\n\ttype VendorProfileCardProps,\n\ttype VendorProfileChangeTone,\n\ttype VendorProfileView,\n} from './types';\n\nconst CHANGE_VARIANTS: Record<\n\tVendorProfileChangeTone,\n\tNonNullable<BadgeProps['tone']>\n> = {\n\tsecondary: 'secondary',\n\tsuccess: 'success',\n\twarning: 'warning',\n\tdestructive: 'destructive',\n};\n\nfunction ChangeBadge({\n\tchildren,\n\ttone,\n}: {\n\tchildren?: ReactNode;\n\ttone?: VendorProfileChangeTone;\n}) {\n\tif (!hasRenderableContent(children)) return null;\n\n\treturn (\n\t\t<Badge\n\t\t\ttone={CHANGE_VARIANTS[tone ?? 'secondary']}\n\t\t\tclassName=\"vendor-profile--change shrink-0 tabular-nums\"\n\t\t>\n\t\t\t{children}\n\t\t</Badge>\n\t);\n}\n\nexport const VendorProfileCard = forwardRef<HTMLDivElement, VendorProfileCardProps>(\n\tfunction VendorProfileCard(\n\t\t{\n\t\t\tname,\n\t\t\tinitials,\n\t\t\tavatarUrl,\n\t\t\trole,\n\t\t\tverified = false,\n\t\t\tearnings,\n\t\t\tearningsChange,\n\t\t\tearningsChangeTone,\n\t\t\tmetrics = [],\n\t\t\tstats = [],\n\t\t\tview,\n\t\t\tdefaultView = 'overview',\n\t\t\tonViewChange,\n\t\t\tonMessage,\n\t\t\tonHire,\n\t\t\tsurface,\n\t\t\tclassName,\n\t\t\tstrings: stringsProp,\n\t\t}: VendorProfileCardProps,\n\t\tref,\n\t) {\n\t\tconst strings = useStrings(defaultVendorProfileStrings, stringsProp);\n\t\tconst [internalView, setInternalView] = useState<VendorProfileView>(defaultView);\n\t\tconst isViewControlled = view !== undefined;\n\n\t\tconst hasEarnings = hasRenderableContent(earnings);\n\t\tconst hasOverviewContent = hasEarnings || metrics.length > 0;\n\t\tconst hasStatsContent = stats.length > 0;\n\t\tconst availableTabs: VendorProfileView[] = [\n\t\t\t...(hasOverviewContent ? (['overview'] as const) : []),\n\t\t\t...(hasStatsContent ? (['stats'] as const) : []),\n\t\t];\n\t\tconst requestedView = isViewControlled ? view : internalView;\n\t\tconst activeView = availableTabs.includes(requestedView)\n\t\t\t? requestedView\n\t\t\t: availableTabs[0] ?? 'overview';\n\t\tconst hasBody = availableTabs.length > 0;\n\t\tconst hasActions = Boolean(onMessage || onHire);\n\t\tconst handleViewChange = (nextValue: string) => {\n\t\t\tif (nextValue !== 'overview' && nextValue !== 'stats') return;\n\t\t\tif (!availableTabs.includes(nextValue)) return;\n\t\t\tif (!isViewControlled) setInternalView(nextValue);\n\t\t\tonViewChange?.(nextValue);\n\t\t};\n\n\t\t// Earnings and stats are plain label/value facts on the card surface; the\n\t\t// change chip follows its value instead of floating at the far edge.\n\t\tconst overviewContent = (\n\t\t\t<Stack gap=\"xl\" className=\"vendor-profile--overview\">\n\t\t\t\t{hasEarnings && (\n\t\t\t\t\t<Stack gap=\"normal\" className=\"vendor-profile--earnings\">\n\t\t\t\t\t\t<DisplayLabel>{strings.totalEarnings}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"baseline\">\n\t\t\t\t\t\t\t<Value type=\"inherit\" size=\"base\" weight=\"semibold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t{earnings}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t<ChangeBadge tone={earningsChangeTone}>{earningsChange}</ChangeBadge>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\n\t\t\t\t{metrics.length > 0 && (\n\t\t\t\t\t<div className=\"vendor-profile--metrics divide-y divide-border/60\">\n\t\t\t\t\t\t{metrics.map((metric, index) => (\n\t\t\t\t\t\t\t<InlineStat\n\t\t\t\t\t\t\t\tkey={metric.id ?? index}\n\t\t\t\t\t\t\t\tclassName=\"py-row-y first:pt-0 last:pb-0\"\n\t\t\t\t\t\t\t\tlabel={metric.label}\n\t\t\t\t\t\t\t\tvalue={metric.value}\n\t\t\t\t\t\t\t\tvalueWeight=\"medium\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t);\n\n\t\tconst statsContent = (\n\t\t\t<Grid columns={{ base: 1, sm: 2 }} gap=\"xl\" className=\"vendor-profile--stats\">\n\t\t\t\t{stats.map((stat, index) => (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tkey={stat.id ?? index}\n\t\t\t\t\t\tgap=\"normal\"\n\t\t\t\t\t\tclassName=\"vendor-profile--stat\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<DisplayLabel className=\"truncate\">{stat.label}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"baseline\">\n\t\t\t\t\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"min-w-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{stat.value}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t<ChangeBadge tone={stat.changeTone}>{stat.change}</ChangeBadge>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\t\t\t\t))}\n\t\t\t</Grid>\n\t\t);\n\n\t\tconst profileBody = availableTabs.length > 1 ? (\n\t\t\t<Tabs\n\t\t\t\tvalue={activeView}\n\t\t\t\tonValueChange={handleViewChange}\n\t\t\t\tclassName=\"vendor-profile--tabs gap-space-lg\"\n\t\t\t>\n\t\t\t\t<TabsList className=\"grid h-auto w-full grid-cols-2 rounded-inner p-space-xs\">\n\t\t\t\t\t<TabsTrigger value=\"overview\" className=\"h-action-sm rounded-inner px-control-sm text-pxs\">\n\t\t\t\t\t\t{strings.tabOverview}\n\t\t\t\t\t</TabsTrigger>\n\t\t\t\t\t<TabsTrigger value=\"stats\" className=\"h-action-sm rounded-inner px-control-sm text-pxs\">\n\t\t\t\t\t\t{strings.tabStats}\n\t\t\t\t\t</TabsTrigger>\n\t\t\t\t</TabsList>\n\t\t\t\t<TabsContent value=\"overview\" className=\"mt-0\">\n\t\t\t\t\t{overviewContent}\n\t\t\t\t</TabsContent>\n\t\t\t\t<TabsContent value=\"stats\" className=\"mt-0\">\n\t\t\t\t\t{statsContent}\n\t\t\t\t</TabsContent>\n\t\t\t</Tabs>\n\t\t) : activeView === 'stats' ? (\n\t\t\tstatsContent\n\t\t) : (\n\t\t\toverviewContent\n\t\t);\n\n\t\treturn (\n\t\t\t<Card\n\t\t\t\tref={ref}\n\t\t\t\tsurface={surface}\n\t\t\t\t// Embedded flat, the surrounding surface owns the inset, as with the\n\t\t\t\t// other commerce subjects; the region rhythm stays the same.\n\t\t\t\tpadding={surface === 'flat' ? 'none' : 'md'}\n\t\t\t\tgap=\"xl\"\n\t\t\t\theaderStart={\n\t\t\t\t\t<Item className=\"vendor-profile--identity flex-nowrap py-0\">\n\t\t\t\t\t\t<ItemMedia variant=\"avatar\">\n\t\t\t\t\t\t\t<Avatar>\n\t\t\t\t\t\t\t\t{!!avatarUrl && <AvatarImage src={avatarUrl} alt={name} />}\n\t\t\t\t\t\t\t\t<AvatarFallback>\n\t\t\t\t\t\t\t\t\t{initials ?? <Initials value={name} strategy=\"first-words\" />}\n\t\t\t\t\t\t\t\t</AvatarFallback>\n\t\t\t\t\t\t\t</Avatar>\n\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t{/* Verification is the name's status, so it sits beside it. */}\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t\t\t\t<ItemTitle className=\"min-w-0 truncate\">{name}</ItemTitle>\n\t\t\t\t\t\t\t\t{!!verified && (\n\t\t\t\t\t\t\t\t\t<Badge tone=\"success\" className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t\t{strings.verifiedAriaLabel}\n\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{!!role && <ItemDescription clamp={2}>{role}</ItemDescription>}\n\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t</Item>\n\t\t\t\t}\n\t\t\t\tfooterSlot={\n\t\t\t\t\thasActions ? (\n\t\t\t\t\t\t<div className={cn('vendor-profile--actions flex flex-wrap', compositionClasses.commands)}>\n\t\t\t\t\t\t\t{!!onMessage && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\t\t\tclassName=\"min-w-0 flex-1\"\n\t\t\t\t\t\t\t\t\tonClick={onMessage}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{strings.message}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{!!onHire && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"min-w-0 flex-1\"\n\t\t\t\t\t\t\t\t\tonClick={onHire}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{strings.hire}\n\t\t\t\t\t\t\t\t\t<ChevronRight className=\"size-icon-sm\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : undefined\n\t\t\t\t}\n\t\t\t\tcontentClassName={cn(!hasBody && 'hidden')}\n\t\t\t\tclassName={cn('vendor-profile--component', className)}\n\t\t\t>\n\t\t\t\t{hasBody ? profileBody : null}\n\t\t\t</Card>\n\t\t);\n\t},\n);\n\nVendorProfileCard.displayName = 'VendorProfileCard';\n","export interface InventoryLevelStrings {\n\tstatusInStock: string;\n\tstatusLowStock: string;\n\tstatusCritical: string;\n\tvariantLabel: string;\n\tunitsAvailable: string;\n\treorderAtLabel: string;\n\tlastRestockedLabel: string;\n}\n\nexport const defaultInventoryLevelStrings: InventoryLevelStrings = {\n\tstatusInStock: 'In stock',\n\tstatusLowStock: 'Low stock',\n\tstatusCritical: 'Critical',\n\tvariantLabel: 'Variant',\n\tunitsAvailable: 'units available',\n\treorderAtLabel: 'Reorder at',\n\tlastRestockedLabel: 'Last restocked',\n};\n","/**\n * InventoryLevel — single-product inventory snapshot with stock total,\n * reorder threshold, and a status pill (Critical / Low stock / In stock).\n *\n * Status thresholds are computed from `stock`, `reorderLevel`, and the\n * critical threshold (50% of `reorderLevel`). Status pill labels flow via\n * the `strings` prop so consumers can localise without forking the file.\n */\nimport { useId } from 'react';\n\nimport { Badge } from '../../../base/badge';\nimport { Progress } from '../../../base/feedback';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography/text';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultInventoryLevelStrings } from './inventory-level.strings';\nimport type { InventoryLevelProps } from './types';\n\nexport function InventoryLevel({\n\tproductName,\n\tvariant,\n\tstock,\n\treorderLevel,\n\tmaxStock,\n\tlastRestocked,\n\tclassName,\n\tstrings: stringsProp,\n}: InventoryLevelProps) {\n\tconst strings = useStrings(defaultInventoryLevelStrings, stringsProp);\n\tconst stockId = useId();\n\tconst isLow = stock <= reorderLevel;\n\tconst isCritical = stock <= reorderLevel * 0.5;\n\n\tconst badgeTone = isCritical ? 'destructive' : isLow ? 'warning' : 'success';\n\tconst badgeLabel = isCritical\n\t\t? strings.statusCritical\n\t\t: isLow\n\t\t\t? strings.statusLowStock\n\t\t\t: strings.statusInStock;\n\n\t// Three groups — product, stock figure, gauge — spaced by one parent gap.\n\t// The status chip belongs to the product name, so it sits beside it.\n\treturn (\n\t\t<Stack\n\t\t\tdata-component=\"inventory-level\"\n\t\t\tdata-slot=\"inventory-level\"\n\t\t\tgap=\"xl\"\n\t\t\tclassName={cn('inventory-level--component', className)}\n\t\t>\n\t\t\t<Stack gap=\"dense\" className=\"inventory-level--product\">\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t<Text type=\"inherit\" weight=\"semibold\" className=\"min-w-0 truncate\">\n\t\t\t\t\t\t{productName}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Badge tone={badgeTone} className=\"shrink-0\">{badgeLabel}</Badge>\n\t\t\t\t</Stack>\n\t\t\t\t{!!variant && (\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t{`${strings.variantLabel}: ${variant}`}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\n\t\t\t<Stack id={stockId} gap=\"dense\" className=\"inventory-level--stock\">\n\t\t\t\t<NumberValue type=\"inherit\" value={stock} weight=\"semibold\" align=\"left\" />\n\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t{strings.unitsAvailable}\n\t\t\t\t</Text>\n\t\t\t</Stack>\n\n\t\t\t<Stack gap=\"md\" className=\"inventory-level--gauge\">\n\t\t\t\t{/* The shared meter, named by the stock figure it visualises. */}\n\t\t\t\t<Progress value={stock} max={maxStock} tone={badgeTone} aria-labelledby={stockId} />\n\t\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.reorderAtLabel}: <NumberValue type=\"inherit\" value={reorderLevel} weight=\"medium\" align=\"left\" />\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!lastRestocked && (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t{strings.lastRestockedLabel}: <SecondaryValue size=\"xs\">{lastRestocked}</SecondaryValue>\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nInventoryLevel.displayName = 'InventoryLevel';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface TaxLineItem {\n\t/** Stable identity for this entry. */\n\tid?: string;\n\t/** Display label. */\n\tlabel: string;\n\trate?: string;\n\tamount: string;\n}\n\nexport interface TaxBreakdownStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted amount before tax. */\n\tsubtotal: string;\n\t/** Formatted sum of every tax line. */\n\ttotalTax: string;\n\t/** Formatted grand total, including tax. */\n\ttotal: string;\n}\n\nexport const defaultTaxBreakdownStrings: TaxBreakdownStrings = {\n\ttitle: 'Tax breakdown',\n\tsubtotal: 'Subtotal',\n\ttotalTax: 'Total tax',\n\ttotal: 'Total',\n};\n\nexport interface TaxBreakdownCardProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Formatted amount before tax. */\n\tsubtotal: string;\n\t/** Individual tax lines making up the total. */\n\ttaxes: TaxLineItem[];\n\t/** Formatted sum of every tax line. */\n\ttotalTax?: string;\n\t/** Formatted grand total, including tax. */\n\ttotal: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<TaxBreakdownStrings>;\n}\n","/**\n * TaxBreakdownCard — itemised tax breakdown for an order or invoice: a\n * subtotal, one row per tax line with its rate beside the amount, an optional\n * \"Total tax\" rollup, and the final total. Drawn on the shared commerce\n * ledger (`SummaryPanel` + `AmountRow`), so it emphasises its total the same\n * way `CartSummaryCard` does. Pairs with `CartSummaryCard` when consumers\n * need to expose VAT / regional tax detail. Strings overridable for i18n.\n */\nimport { Card } from '../../../base/cards';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultTaxBreakdownStrings, type TaxBreakdownCardProps } from './types';\n\nexport function TaxBreakdownCard({\n\tsubtotal,\n\ttaxes,\n\ttotalTax,\n\ttotal,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: TaxBreakdownCardProps) {\n\tconst strings = useStrings(defaultTaxBreakdownStrings, stringsProp);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\tdata-slot=\"tax-breakdown\"\n\t\t\tclassName={cn('tax-breakdown--component w-full', className)}\n\t\t>\n\t\t\t<SummaryPanel className=\"tax-breakdown--ledger\">\n\t\t\t\t<AmountRow label={strings.subtotal} amount={subtotal} />\n\t\t\t\t{taxes.map((tax, index) => (\n\t\t\t\t\t<AmountRow\n\t\t\t\t\t\tkey={tax.id ?? `${tax.label}-${index}`}\n\t\t\t\t\t\tclassName=\"tax-breakdown--line\"\n\t\t\t\t\t\tlabel={tax.label}\n\t\t\t\t\t\tnote={tax.rate}\n\t\t\t\t\t\tamount={tax.amount}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t\t{/* One tax line is the total tax; a rollup under it would restate the row above. */}\n\t\t\t\t{!!totalTax && taxes.length > 1 && (\n\t\t\t\t\t<AmountRow label={strings.totalTax} amount={totalTax} />\n\t\t\t\t)}\n\t\t\t\t<AmountRow label={strings.total} amount={total} total rollup />\n\t\t\t</SummaryPanel>\n\t\t</Card>\n\t);\n}\n\nTaxBreakdownCard.displayName = 'TaxBreakdownCard';\n","import type { LucideIcon } from 'lucide-react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface SubscriptionPerk {\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n\t/** Display label. */\n\tlabel: string;\n}\n\nexport interface SubscriptionSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tplan: string;\n\tnextBilling: string;\n\t/** Benefits included in the plan. */\n\tperks: string;\n\tmanage: string;\n\tupgrade: string;\n}\n\nexport const defaultSubscriptionSummaryStrings: SubscriptionSummaryStrings = {\n\ttitle: 'Subscription',\n\tplan: 'Plan',\n\tnextBilling: 'Next billing',\n\tperks: 'Included',\n\tmanage: 'Manage',\n\tupgrade: 'Upgrade',\n};\n\nexport interface SubscriptionSummaryCardProps {\n\t/** Name of the subscribed plan. */\n\tplanName: string;\n\t/** Formatted recurring price. */\n\tpriceLabel: string;\n\t/** Billing interval, e.g. monthly or yearly. */\n\tcycleLabel: string;\n\t/** Formatted date of the next charge. */\n\tnextBillingDate: string;\n\t/** Current subscription state. */\n\tstatusLabel?: string;\n\t/** Benefits included in the plan. */\n\tperks?: SubscriptionPerk[];\n\tonManage?: () => void;\n\tonUpgrade?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<SubscriptionSummaryStrings>;\n}\n","/**\n * SubscriptionSummaryCard — at-a-glance subscription card with the active\n * plan name as the hero heading, an inline price + cycle, the next billing\n * date in a meta row, an optional perks list, and trailing\n * Manage / Upgrade actions. Strings overridable for i18n.\n */\nimport { ChevronRight } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport {\n\tItem,\n\tItemContent,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Heading } from '../../../typography/heading';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\n\nimport {\n\tdefaultSubscriptionSummaryStrings,\n\ttype SubscriptionSummaryCardProps,\n} from './types';\n\nimport { cn } from '../../../../lib/utils';\nexport function SubscriptionSummaryCard({\n\tplanName,\n\tpriceLabel,\n\tcycleLabel,\n\tnextBillingDate,\n\tstatusLabel,\n\tperks = [],\n\tonManage,\n\tonUpgrade,\n\tclassName,\n\tstrings: stringsProp,\n}: SubscriptionSummaryCardProps) {\n\tconst strings = useStrings(defaultSubscriptionSummaryStrings, stringsProp);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={statusLabel ? <Badge tone=\"success\">{statusLabel}</Badge> : null}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tclassName={cn('subscription-summary--component w-full', className)}\n\t\t>\n\t\t\t{/* Plan identity left, price right, then the next charge as the same\n\t\t\t label/value row the other commerce summaries use. Spacing alone\n\t\t\t groups them; no inset panel. */}\n\t\t\t<Stack gap=\"lg\" className=\"subscription-summary--plan\">\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"end\" gap=\"lg\">\n\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t{strings.plan}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t<Heading className=\"text-inherit\" tag=\"h3\">\n\t\t\t\t\t\t\t{planName}\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" gap=\"xs\" className=\"shrink-0\">\n\t\t\t\t\t\t<Value type=\"inherit\" weight=\"bold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t{priceLabel}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t<Text type=\"secondary\">\n\t\t\t\t\t\t\t{cycleLabel}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t\t<InlineStat\n\t\t\t\t\tlabel={strings.nextBilling}\n\t\t\t\t\tvalue={nextBillingDate}\n\t\t\t\t\tvalueWeight=\"semibold\"\n\t\t\t\t\tvalueClassName=\"tabular-nums\"\n\t\t\t\t/>\n\t\t\t</Stack>\n\n\t\t\t{perks.length > 0 && (\n\t\t\t\t<Stack gap=\"md\" className=\"subscription-summary--perks\">\n\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t{strings.perks}\n\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t{perks.map((perk, i) => {\n\t\t\t\t\t\t\t// A consumer-supplied glyph renders plainly; no default glyph\n\t\t\t\t\t\t\t// repeats down the list and no colour suggests a state.\n\t\t\t\t\t\t\tconst Icon = perk.icon;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Item key={`${perk.label}-${i}`} size=\"sm\" density=\"compact\">\n\t\t\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t\t\t\t\t\t<Icon aria-hidden=\"true\" className=\"size-icon text-muted-foreground\" />\n\t\t\t\t\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t\t\t\t<ItemTitle bold={false}>{perk.label}</ItemTitle>\n\t\t\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{(onManage || onUpgrade) && (\n\t\t\t\t<div className=\"flex items-center gap-space-md\">\n\t\t\t\t\t{!!onManage && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tonClick={onManage}\n\t\t\t\t\t\t\tclassName=\"flex-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.manage}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!onUpgrade && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\tonClick={onUpgrade}\n\t\t\t\t\t\t\tclassName=\"flex-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.upgrade}\n\t\t\t\t\t\t\t<ChevronRight className=\"ml-1 size-icon-md\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nSubscriptionSummaryCard.displayName = 'SubscriptionSummaryCard';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type RefundStage = 'requested' | 'approved' | 'processing' | 'completed';\n\nexport interface RefundStatusStrings {\n\t/** Surface title. */\n\ttitle: string;\n\trequested: string;\n\tapproved: string;\n\tprocessing: string;\n\tcompleted: string;\n\t/** Formatted refund amount. */\n\tamount: string;\n\t/** Why the refund was requested. */\n\treason: string;\n\t/** Formatted estimate for the funds landing. */\n\teta: string;\n\t/** Where the money is being returned to. */\n\tmethod: string;\n}\n\nexport const defaultRefundStatusStrings: RefundStatusStrings = {\n\ttitle: 'Refund status',\n\trequested: 'Requested',\n\tapproved: 'Approved',\n\tprocessing: 'Processing',\n\tcompleted: 'Completed',\n\tamount: 'Refund amount',\n\treason: 'Reason',\n\teta: 'Expected by',\n\tmethod: 'Refund to',\n};\n\nexport interface RefundStatusCardProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** How far the refund has progressed. */\n\tstage: RefundStage;\n\t/** Formatted refund amount. */\n\tamount: string;\n\t/** Why the refund was requested. */\n\treason?: ReactNode;\n\t/** Where the money is being returned to. */\n\tmethod?: ReactNode;\n\t/** Formatted estimate for the funds landing. */\n\teta?: string;\n\t/** Formatted date the refund was raised. */\n\trequestedAt?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<RefundStatusStrings>;\n}\n\n/** The source kit's name for `RefundStatusCardProps`. */\nexport type RefundStatusProps = RefundStatusCardProps;\n","/**\n * RefundStatusCard — refund-flow tracker. Shows the four canonical refund\n * stages (Requested → Approved → Processing → Completed) as an ordered list\n * whose current stage carries `aria-current=\"step\"`, so the position is\n * announced independently of its colour. The refund amount leads as the\n * ledger's total row, with an optional reason / method / ETA detail block.\n * Strings overridable for i18n.\n *\n * `RefundStatus` is the same component under the source kit's name.\n */\nimport { Check } from 'lucide-react';\n\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\nimport { AmountRow } from '../summary-panel';\nimport {\n\tdefaultRefundStatusStrings,\n\ttype RefundStage,\n\ttype RefundStatusCardProps,\n} from './types';\n\nconst STAGE_ORDER: RefundStage[] = ['requested', 'approved', 'processing', 'completed'];\n\nfunction hasContent(value: unknown) {\n\treturn value !== undefined && value !== null && value !== false && value !== '';\n}\n\nexport function RefundStatusCard({\n\tstage,\n\tamount,\n\treason,\n\tmethod,\n\teta,\n\trequestedAt,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: RefundStatusCardProps) {\n\tconst strings = useStrings(defaultRefundStatusStrings, stringsProp);\n\tconst currentIdx = STAGE_ORDER.indexOf(stage);\n\tconst hasFacts = hasContent(reason) || hasContent(method) || hasContent(eta);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"refund-status\"\n\t\t\tclassName={cn('refund-status--component w-full', className)}\n\t\t>\n\t\t\t{/* Amount, stages and details are separated by the content gap alone:\n\t\t\t no inset panel around the amount and no rule above the details. */}\n\t\t\t<Stack gap=\"dense\">\n\t\t\t\t<AmountRow label={strings.amount} amount={amount} total className=\"refund-status--amount\" />\n\t\t\t\t{!!requestedAt && (\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.requested}: <SecondaryValue size=\"xs\">{requestedAt}</SecondaryValue>\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\n\t\t\t{/* The stages happen in sequence, so they are an ordered list. */}\n\t\t\t<ol className=\"refund-status--stages m-0 flex list-none items-start p-0\">\n\t\t\t\t{STAGE_ORDER.map((s, i) => {\n\t\t\t\t\tconst done = i <= currentIdx;\n\t\t\t\t\tconst current = i === currentIdx;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// The dot leads its column and the connector fills the rest, so\n\t\t\t\t\t\t// the node sits at the column's left edge; the label starts there too.\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={s}\n\t\t\t\t\t\t\tdata-reached={done ? '' : undefined}\n\t\t\t\t\t\t\tdata-current={current ? '' : undefined}\n\t\t\t\t\t\t\taria-current={current ? 'step' : undefined}\n\t\t\t\t\t\t\tclassName=\"refund-status--stage flex min-w-0 flex-1 flex-col items-start gap-space-sm\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div aria-hidden=\"true\" className=\"flex w-full items-center\">\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'relative flex size-icon-lg shrink-0 items-center justify-center rounded-full',\n\t\t\t\t\t\t\t\t\t\tdone\n\t\t\t\t\t\t\t\t\t\t\t? 'bg-success text-success-foreground'\n\t\t\t\t\t\t\t\t\t\t\t: 'border border-border bg-card text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t// The current stage carries the shared halo; an offset ring would paint the\n\t\t\t\t\t\t\t\t\t\t// page background inside a card.\n\t\t\t\t\t\t\t\t\t\tcurrent && cn('ring-4', toneRecipes.success.halo),\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{done ? (\n\t\t\t\t\t\t\t\t\t\t<Check className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<NumberValue type=\"inherit\" value={i + 1} size=\"xs\" weight=\"medium\" align=\"center\" />\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{i < STAGE_ORDER.length - 1 && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'h-0.5 flex-1',\n\t\t\t\t\t\t\t\t\t\t\ti < currentIdx ? 'bg-success' : 'bg-border',\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\tweight={current ? 'semibold' : 'medium'}\n\t\t\t\t\t\t\t\ttype={done ? 'main' : 'secondary'}\n\t\t\t\t\t\t\t\tlineHeight=\"tight\"\n\t\t\t\t\t\t\t\tclassName=\"refund-status--stage-label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{strings[s]}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ol>\n\n\t\t\t{!!hasFacts && (\n\t\t\t\t<Stack gap=\"md\" className=\"refund-status--facts\">\n\t\t\t\t\t{hasContent(reason) && (\n\t\t\t\t\t\t<InlineStat label={strings.reason} value={reason} className=\"items-start\" valueWeight=\"medium\" valueClassName=\"text-end\" />\n\t\t\t\t\t)}\n\t\t\t\t\t{hasContent(method) && (\n\t\t\t\t\t\t<InlineStat label={strings.method} value={method} valueWeight=\"medium\" />\n\t\t\t\t\t)}\n\t\t\t\t\t{hasContent(eta) && (\n\t\t\t\t\t\t<InlineStat label={strings.eta} value={eta} valueWeight=\"medium\" valueClassName=\"tabular-nums\" />\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nRefundStatusCard.displayName = 'RefundStatusCard';\n\n/** The source kit's name for `RefundStatusCard`; the same component. */\nexport const RefundStatus = RefundStatusCard;\n","/**\n * AddressLines — the postal block shared by `AddressCard` and `OrderCustomer`.\n *\n * A real `<address>` (with the browser's italic reset), so assistive technology\n * hears contact information rather than loose lines. The recipient leads, the\n * street lines and the city line follow in the main role, and the country\n * recedes; the city line joins only the parts that exist. A phone number, when\n * the address carries one, closes the block as a `Phone` link.\n *\n * Internal to the commerce family: it is the address anatomy, not a public\n * component.\n */\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { Stack } from '../../../base/structure';\nimport { Phone } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { OrderAddress } from './order-status';\n\nexport interface AddressLinesProps extends Omit<ComponentPropsWithoutRef<'address'>, 'children'> {\n\t/** The address to render. */\n\taddress: OrderAddress;\n\t/** Sets the recipient in semibold, for a surface that leads on the name. */\n\tprominent?: boolean;\n}\n\nexport function AddressLines({ address, prominent = false, className, ...props }: AddressLinesProps) {\n\tconst cityLine = [address.city, address.region, address.postalCode].filter(Boolean).join(', ');\n\n\treturn (\n\t\t<Stack\n\t\t\tgap=\"2xs\"\n\t\t\trender={<address {...props} />}\n\t\t\tclassName={cn('address-lines--component not-italic', className)}\n\t\t>\n\t\t\t{!!address.name && <Text type=\"inherit\" weight={prominent ? 'semibold' : 'regular'}>{address.name}</Text>}\n\t\t\t<Text type=\"inherit\">{address.line1}</Text>\n\t\t\t{!!address.line2 && <Text type=\"inherit\">{address.line2}</Text>}\n\t\t\t{!!cityLine && <Text type=\"inherit\">{cityLine}</Text>}\n\t\t\t<Text type=\"secondary\">{address.country}</Text>\n\t\t\t{!!address.phone && <Phone value={address.phone} className=\"self-start\" />}\n\t\t</Stack>\n\t);\n}\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type AddressKind = 'shipping' | 'billing' | 'pickup';\n\nexport interface AddressCardStrings {\n\tdefaultBadge: string;\n\tedit: string;\n\tremove: string;\n\tmakeDefault: string;\n\tshipping: string;\n\tbilling: string;\n\tpickup: string;\n}\n\nexport const defaultAddressCardStrings: AddressCardStrings = {\n\tdefaultBadge: 'Default',\n\tedit: 'Edit',\n\tremove: 'Remove',\n\tmakeDefault: 'Make default',\n\tshipping: 'Shipping address',\n\tbilling: 'Billing address',\n\tpickup: 'Pickup address',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface AddressCardProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** What the address is for — billing, shipping, or both. */\n\tkind?: AddressKind;\n\t/** Display name. */\n\tname: string;\n\t/** Street address. */\n\tline1: string;\n\t/** Apartment, suite, or unit. */\n\tline2?: string;\n\t/** City or town. */\n\tcity: string;\n\t/** State, province, or region. */\n\tregion?: string;\n\t/** Postal or ZIP code. */\n\tpostalCode?: string;\n\t/** Country name or code. */\n\tcountry: string;\n\t/** Contact number for the delivery. */\n\tphone?: string;\n\t/** Marks this as the account's default address. */\n\tdefault?: boolean;\n\t/** Fired when an entry is edited. */\n\tonEdit?: () => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\tonMakeDefault?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AddressCardStrings>;\n}\n","/**\n * AddressCard — saved postal address surface. Title varies by `kind`\n * (shipping / billing / pickup); shows recipient name, address lines, phone,\n * and a \"Default\" badge when applicable. The lines are the shared commerce\n * `<address>` block, so they read the same here as in `OrderCustomer`.\n *\n * Edit / remove / make-default actions ride through the centralized action\n * menu instead of inline footer buttons.\n */\nimport { Edit2, Star, Trash2 } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport type { ActionMenuAction } from '../../../base/action-menu';\nimport { Phone } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { AddressLines } from '../shared/address-lines';\nimport {\n\tdefaultAddressCardStrings,\n\ttype AddressCardProps,\n\ttype AddressKind,\n} from './types';\n\nimport { cn } from '../../../../lib/utils';\nexport function AddressCard({\n\tkind = 'shipping',\n\tname,\n\tline1,\n\tline2,\n\tcity,\n\tregion,\n\tpostalCode,\n\tcountry,\n\tphone,\n\tdefault: defaultAddress = false,\n\tonEdit,\n\tonRemove,\n\tonMakeDefault,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: AddressCardProps) {\n\tconst strings = useStrings(defaultAddressCardStrings, stringsProp);\n\tconst titleByKind: Record<AddressKind, string> = {\n\t\tshipping: strings.shipping,\n\t\tbilling: strings.billing,\n\t\tpickup: strings.pickup,\n\t};\n\n\tconst actions: ActionMenuAction[] = [];\n\tif (onEdit) {\n\t\tactions.push({\n\t\t\tid: 'edit',\n\t\t\tlabel: strings.edit,\n\t\t\ticon: <Edit2 className=\"size-icon-md\" />,\n\t\t\tonClick: onEdit,\n\t\t});\n\t}\n\tif (onMakeDefault && !defaultAddress) {\n\t\tactions.push({\n\t\t\tid: 'make-default',\n\t\t\tlabel: strings.makeDefault,\n\t\t\ticon: <Star className=\"size-icon-md\" />,\n\t\t\tonClick: onMakeDefault,\n\t\t});\n\t}\n\tif (onRemove) {\n\t\tactions.push({\n\t\t\tid: 'remove',\n\t\t\tlabel: strings.remove,\n\t\t\ticon: <Trash2 className=\"size-icon-md\" />,\n\t\t\tonClick: onRemove,\n\t\t});\n\t}\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={titleByKind[kind]}\n\t\t\ttitleSuffix={\n\t\t\t\tdefaultAddress ? <Badge tone=\"neutral\">{strings.defaultBadge}</Badge> : null\n\t\t\t}\n\t\t\tactions={actions.length > 0 ? actions : undefined}\n\t\t\tclassName={cn('address-card--component w-full', className)}\n\t\t>\n\t\t\t{/* The phone is contact detail, not an address line: the outer gap\n\t\t\t separates the two groups, and the number keeps the size of the\n\t\t\t lines it sits under. */}\n\t\t\t<Stack gap=\"md\">\n\t\t\t\t<AddressLines\n\t\t\t\t\taddress={{ name, line1, line2, city, region, postalCode, country }}\n\t\t\t\t\tprominent\n\t\t\t\t/>\n\t\t\t\t{!!phone && (\n\t\t\t\t\t<Phone\n\t\t\t\t\t\tvalue={phone}\n\t\t\t\t\t\tdisplay={<Text type=\"inherit\" tag=\"span\">{phone}</Text>}\n\t\t\t\t\t\tclassName=\"self-start\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nAddressCard.displayName = 'AddressCard';\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport interface VoucherEntryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tinputLabel: string;\n\tplaceholder: string;\n\thelperText: string;\n\tcheck: string;\n\tremove: string;\n\t/** Formatted remaining value on the voucher. */\n\tbalance: string;\n\tapplied: string;\n\tnotFound: string;\n}\n\nexport const defaultVoucherEntryStrings: VoucherEntryStrings = {\n\ttitle: 'Redeem a gift card',\n\tinputLabel: 'Gift card code',\n\tplaceholder: 'Enter gift card code',\n\thelperText: 'Apply one gift card or voucher to this order.',\n\tcheck: 'Check balance',\n\tremove: 'Remove',\n\tbalance: 'Available balance',\n\tapplied: 'Applied',\n\tnotFound: 'That gift card code is not valid.',\n};\n\nexport interface VoucherEntryProps {\n\t/** Voucher currently applied, if any. */\n\tappliedCode?: string;\n\t/** Formatted remaining value on the voucher. */\n\tbalance?: string;\n\t/** Validation message for a rejected code. */\n\terror?: string;\n\t/** Whether a code is being checked. */\n\tloading?: boolean;\n\t/** Fired with the trimmed, upper-cased code when the form is submitted. */\n\tonCheck?: (code: string) => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<VoucherEntryStrings>;\n}\n","/**\n * VoucherEntry — gift-card / voucher redemption entry.\n *\n * Empty state — code input + check button, helper line surfacing errors.\n * Applied state — the same success-tinted row as CouponInputCard: check\n * medallion, code, balance amount, and a remove control.\n *\n * The component owns the input's draft state and nothing else. Submitting the\n * form — by the check button or by Enter — calls `onCheck(code)` with the\n * trimmed, upper-cased code; the consumer looks it up and drives the applied\n * state back in through `appliedCode`, `balance`, `error`, and `loading`.\n * `onRemove` clears an applied voucher.\n */\nimport {\n\ttype FormEvent,\n\tuseId,\n\tuseState } from 'react';\nimport { Check, X } from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { IconBadge,\n} from '../../../base/display';\nimport { FormField } from '../../../base/forms';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Input } from '../../../base/text-inputs';\nimport { MonoValue, Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultVoucherEntryStrings, type VoucherEntryProps } from './types';\n\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\nconst normalizeCode = (value: string): string => value.toUpperCase();\n\nexport function VoucherEntry({\n\tappliedCode,\n\tbalance,\n\terror,\n\tloading,\n\tonCheck,\n\tonRemove,\n\tclassName,\n\tstrings: stringsProp,\n}: VoucherEntryProps) {\n\tconst strings = useStrings(defaultVoucherEntryStrings, stringsProp);\n\tconst inputId = useId();\n\tconst [code, setCode] = useState('');\n\tconst trimmedCode = code.trim();\n\tconst handleSubmit = (event: FormEvent<HTMLFormElement>) => {\n\t\tevent.preventDefault();\n\t\tif (!trimmedCode) return;\n\t\tonCheck?.(trimmedCode);\n\t};\n\n\tif (appliedCode) {\n\t\t// Same applied row as CouponInputCard: the check, the code and the\n\t\t// amount share one line, with no inner rule. The balance is a plain\n\t\t// amount, not a signed delta, so it stays in the foreground colour.\n\t\treturn (\n\t\t\t<ContentBlock\n\t\t\t\ttitle={strings.title}\n\t\t\t\tclassName={cn('voucher-entry--component w-full', className)}\n\t\t\t>\n\t\t\t\t<Item size=\"sm\" variant=\"muted\" className={cn('items-center gap-y-space-sm border', toneRecipes.success.edge, toneRecipes.success.wash)}>\n\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t<IconBadge icon={Check} tone=\"success\" size=\"md\" />\n\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t{/* A code never truncates: the label wraps under it, and below the\n\t\t\t\t\t content basis the amount and remove control drop to their own line. */}\n\t\t\t\t\t<ItemContent className=\"min-w-0 basis-48\">\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\" className=\"min-w-0\">\n\t\t\t\t\t\t\t<ItemTitle className=\"max-w-full\">\n\t\t\t\t\t\t\t\t<MonoValue type=\"inherit\" className=\"tracking-wider\">{appliedCode}</MonoValue>\n\t\t\t\t\t\t\t</ItemTitle>\n\t\t\t\t\t\t\t<DisplayLabel className=\"shrink-0\">\n\t\t\t\t\t\t\t\t{strings.applied}\n\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t{!!balance && <ItemDescription clamp={1}>{strings.balance}</ItemDescription>}\n\t\t\t\t\t</ItemContent>\n\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 gap-space-sm\">\n\t\t\t\t\t\t{!!balance && (\n\t\t\t\t\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{balance}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!onRemove && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tonClick={onRemove}\n\t\t\t\t\t\t\t\taria-label={strings.remove}\n\t\t\t\t\t\t\t\tclassName=\"size-action-xs shrink-0 text-muted-foreground hover:text-destructive\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ItemActions>\n\t\t\t\t</Item>\n\t\t\t</ContentBlock>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.title}\n\t\t\tclassName={cn('voucher-entry--component w-full', className)}\n\t\t>\n\t\t\t<form onSubmit={handleSubmit}>\n\t\t\t\t<FormField\n\t\t\t\t\tlabel={strings.inputLabel}\n\t\t\t\t\thtmlFor={inputId}\n\t\t\t\t\terror={error}\n\t\t\t\t\thint={error ? undefined : strings.helperText}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"flex flex-wrap gap-space-md\">\n\t\t\t\t\t\t<div className=\"min-w-48 flex-1\">\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid={inputId}\n\t\t\t\t\t\t\t\tvalue={code}\n\t\t\t\t\t\t\t\tonChange={(e) => setCode(normalizeCode((e.target as HTMLInputElement).value))}\n\t\t\t\t\t\t\t\tplaceholder={strings.placeholder}\n\t\t\t\t\t\t\t\tautoCapitalize=\"characters\"\n\t\t\t\t\t\t\t\tspellCheck={false}\n\t\t\t\t\t\t\t\tclassName=\"font-mono\"\n\t\t\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\t\tdisabled={!trimmedCode}\n\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.check}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</FormField>\n\t\t\t</form>\n\t\t</ContentBlock>\n\t);\n}\n\nVoucherEntry.displayName = 'VoucherEntry';\n","/**\n * LineThumbnail — the picture of an ordered or carted line.\n *\n * Renders the image while it loads; when it fails, or when there is none, the\n * line's initials stand in on a neutral tile so the row keeps its shape. A new\n * `src` is tried again: the failure is remembered per source, not per mount.\n *\n * Internal to the commerce family; the caller supplies the media frame\n * (`ItemMedia variant=\"image\"`).\n */\nimport { useState } from 'react';\n\nimport { Initials } from '../../../primitives';\n\nexport interface LineThumbnailProps {\n\t/** Image source. Optional: without one the initials show. */\n\tsrc?: string;\n\t/** Alternative text. Defaults to `title`. */\n\talt?: string;\n\t/** The line's name, used for the initials and as the default alt text. */\n\ttitle: string;\n}\n\nfunction LineThumbnailPlaceholder({ title }: { title: string }) {\n\treturn (\n\t\t<div\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName=\"line-thumbnail--placeholder flex size-full items-center justify-center rounded-[inherit] bg-muted ring-1 ring-border/60\"\n\t\t>\n\t\t\t<Initials\n\t\t\t\tvalue={title}\n\t\t\t\tstrategy=\"first-words\"\n\t\t\t\tfallback={title.trim().slice(0, 2).toUpperCase()}\n\t\t\t\tsize=\"xs\"\n\t\t\t\tweight=\"semibold\"\n\t\t\t\ttype=\"secondary\"\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport function LineThumbnail({ src, alt, title }: LineThumbnailProps) {\n\tconst [failedSrc, setFailedSrc] = useState<string | undefined>(undefined);\n\tconst source = src?.trim() ? src : undefined;\n\n\tif (!source || failedSrc === source) return <LineThumbnailPlaceholder title={title} />;\n\n\treturn (\n\t\t<img\n\t\t\tsrc={source}\n\t\t\talt={alt ?? title}\n\t\t\tclassName=\"line-thumbnail--image\"\n\t\t\tonError={() => setFailedSrc(source)}\n\t\t/>\n\t);\n}\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface CartLineItem {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display name. */\n\tname?: string;\n\tproductTitle?: string;\n\t/** Surface title. */\n\ttitle?: string;\n\tvariantTitle?: string;\n\tqty: number;\n\tprice: string;\n\timageUrl?: string;\n\timageSrc?: string;\n\tsrc?: string;\n\turl?: string;\n\timageAlt?: string;\n}\n\nexport interface CartSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted total before tax, shipping, and discounts. */\n\tsubtotal: string;\n\t/** Formatted tax amount. */\n\ttax: string;\n\t/** Formatted shipping cost. */\n\tshipping: string;\n\t/** Formatted discount, shown as a deduction. */\n\tdiscount: string;\n\t/** Formatted order total. */\n\ttotal: string;\n\tcheckout: string;\n\t/** Writes a line's quantity, so a translation owns the multiplication sign. */\n\tformatQuantity: (quantity: number) => string;\n}\n\nexport const defaultCartSummaryStrings: CartSummaryStrings = {\n\ttitle: 'Cart',\n\tsubtotal: 'Subtotal',\n\ttax: 'Tax',\n\tshipping: 'Shipping',\n\tdiscount: 'Discount',\n\ttotal: 'Total',\n\tcheckout: 'Checkout',\n\tformatQuantity: (quantity) => `×${quantity}`,\n};\n\nexport interface CartSummaryCardProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Line items in the cart. */\n\titems: CartLineItem[];\n\t/** Formatted total before tax, shipping, and discounts. */\n\tsubtotal?: string;\n\t/** Formatted tax amount. */\n\ttax?: string;\n\t/** Formatted shipping cost. */\n\tshipping?: string;\n\t/** Formatted discount, shown as a deduction. */\n\tdiscount?: string;\n\t/** Formatted order total. */\n\ttotal: string;\n\tonCheckout?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<CartSummaryStrings>;\n}\n\n/** The source kit's name for `CartSummaryCardProps`. */\nexport type CartSummaryProps = CartSummaryCardProps;\n","/**\n * CartSummaryCard — line-item list with optional subtotal / tax / shipping /\n * discount breakdown and a primary \"Checkout\" action. Items render through\n * `<ItemGroup>` for density consistency; a line whose image fails to load\n * shows its initials instead, and a new image source is tried again. The\n * breakdown is the shared commerce ledger (`SummaryPanel` + `AmountRow`): the\n * discount reads as a deduction in success ink, and the total is ruled off\n * only when there is a breakdown above it to roll up.\n *\n * `CartSummary` is the same component under the source kit's name.\n */\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { LineThumbnail } from '../shared/line-thumbnail';\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultCartSummaryStrings, type CartLineItem, type CartSummaryCardProps } from './types';\n\nconst resolveCartLineTitle = (item: CartLineItem): string => {\n\treturn [item.productTitle, item.title, item.name].find((value) => !!value?.trim()) ?? item.id;\n};\n\nconst resolveCartLineImageSrc = (item: CartLineItem): string | undefined => {\n\treturn [item.imageUrl, item.imageSrc, item.src, item.url].find((value) => !!value?.trim());\n};\n\nexport function CartSummaryCard({\n\titems,\n\tsubtotal,\n\ttax,\n\tshipping,\n\tdiscount,\n\ttotal,\n\tonCheckout,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: CartSummaryCardProps) {\n\tconst strings = useStrings(defaultCartSummaryStrings, stringsProp);\n\tconst hasBreakdown = !!(subtotal || tax || shipping || discount);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"cart-summary\"\n\t\t\tclassName={cn('cart-summary--component w-full', className)}\n\t\t>\n\t\t\t<ItemGroup>\n\t\t\t\t{items.map((it) => {\n\t\t\t\t\tconst title = resolveCartLineTitle(it);\n\t\t\t\t\tconst imageSrc = resolveCartLineImageSrc(it);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Item key={it.id} className=\"cart-summary--item\">\n\t\t\t\t\t\t\t<ItemMedia variant=\"image\" className=\"cart-summary--item-media\">\n\t\t\t\t\t\t\t\t<LineThumbnail src={imageSrc} alt={it.imageAlt} title={title} />\n\t\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t\t<ItemContent className=\"cart-summary--item-content\">\n\t\t\t\t\t\t\t\t<ItemTitle>{title}</ItemTitle>\n\t\t\t\t\t\t\t\t{!!it.variantTitle && (\n\t\t\t\t\t\t\t\t\t<ItemDescription clamp={1}>{it.variantTitle}</ItemDescription>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t<ItemActions className=\"cart-summary--item-actions\">\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\" align=\"end\" className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"cart-summary--quantity tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t{strings.formatQuantity(it.qty)}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"tabular-nums\">{it.price}</Value>\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t\t</Item>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ItemGroup>\n\n\t\t\t<SummaryPanel className=\"cart-summary--totals\">\n\t\t\t\t{!!subtotal && <AmountRow label={strings.subtotal} amount={subtotal} />}\n\t\t\t\t{!!tax && <AmountRow label={strings.tax} amount={tax} />}\n\t\t\t\t{!!shipping && <AmountRow label={strings.shipping} amount={shipping} />}\n\t\t\t\t{!!discount && <AmountRow label={strings.discount} amount={discount} deduction />}\n\t\t\t\t<AmountRow label={strings.total} amount={total} total rollup={hasBreakdown} />\n\t\t\t</SummaryPanel>\n\n\t\t\t{!!onCheckout && (\n\t\t\t\t<Button tone=\"primary\" onClick={onCheckout} fullWidth>{strings.checkout}</Button>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nCartSummaryCard.displayName = 'CartSummaryCard';\n\n/** The source kit's name for `CartSummaryCard`; the same component. */\nexport const CartSummary = CartSummaryCard;\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport interface CouponInputStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/**\n\t * Accessible name for the code field. The card shows no visible label — the\n\t * placeholder carries the hint — so this is the field's only accessible\n\t * name, and a placeholder alone is not one: it is not reliably announced and\n\t * disappears as soon as the user types.\n\t */\n\tfieldLabel: string;\n\tplaceholder: string;\n\tapply: string;\n\tremove: string;\n\tapplied: string;\n\tinvalid: string;\n}\n\nexport const defaultCouponInputStrings: CouponInputStrings = {\n\ttitle: 'Have a code?',\n\tfieldLabel: 'Coupon code',\n\tplaceholder: 'Enter coupon code',\n\tapply: 'Apply',\n\tremove: 'Remove',\n\tapplied: 'Applied',\n\tinvalid: 'That code is not valid',\n};\n\nexport interface CouponInputCardProps {\n\t/** Coupon currently applied, if any. */\n\tappliedCode?: string;\n\t/** Formatted discount the coupon grants. */\n\tappliedDiscount?: string;\n\t/** Validation message for a rejected code. */\n\terror?: string;\n\tonApply?: (code: string) => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\t/** Whether a code is being checked. */\n\tloading?: boolean;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<CouponInputStrings>;\n}\n","/**\n * CouponInputCard — promo / coupon code entry with an applied state and\n * inline error messaging.\n *\n * Empty state — code input + apply button, helper line for\n * placeholders or errors. Applied state — success-tinted row with a check\n * medallion, monospaced code, discount delta, and a destructive remove icon.\n */\nimport {\n\tuseState } from 'react';\nimport { Check, X } from 'lucide-react';\nimport { ContentBlock } from '../../../base/display';\nimport { Button } from '../../../base/buttons';\nimport { IconBadge,\n} from '../../../base/display';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { Input } from '../../../base/text-inputs';\nimport { Stack } from '../../../base/structure';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultCouponInputStrings, type CouponInputCardProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\nimport { formatDeduction } from '../format-signed-amount';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\nconst normalizeCode = (value: string): string => value.toUpperCase();\n\nexport function CouponInputCard({\n\tappliedCode,\n\tappliedDiscount,\n\terror,\n\tonApply,\n\tonRemove,\n\tloading,\n\tclassName,\n\tstrings: stringsProp,\n}: CouponInputCardProps) {\n\tconst strings = useStrings(defaultCouponInputStrings, stringsProp);\n\tconst [code, setCode] = useState('');\n\tconst trimmedCode = code.trim();\n\n\tif (appliedCode) {\n\t\treturn (\n\t\t\t<ContentBlock title={strings.title} className={cn('coupon-input--component w-full', className)}>\n\t\t\t\t<Item size=\"sm\" variant=\"muted\" className={cn('items-center gap-y-space-sm border', toneRecipes.success.edge, toneRecipes.success.wash)}>\n\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t<IconBadge icon={Check} tone=\"success\" size=\"md\" />\n\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t{/*\n\t\t\t\t\t\tCode and status share one line so the applied panel matches the\n\t\t\t\t\t\tempty state's control height. Stacking them made this state ~20px\n\t\t\t\t\t\ttaller than the input it replaces, so applying a coupon shifted\n\t\t\t\t\t\teverything below it in the surrounding checkout column.\n\t\t\t\t\t*/}\n\t\t\t\t\t<ItemContent className=\"min-w-0\">\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t\t\t<ItemTitle className=\"min-w-0 truncate font-mono tracking-wider\" title={appliedCode}>{appliedCode}</ItemTitle>\n\t\t\t\t\t\t\t<DisplayLabel className=\"shrink-0\">\n\t\t\t\t\t\t\t\t{strings.applied}\n\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</ItemContent>\n\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 gap-space-sm\">\n\t\t\t\t\t\t{!!appliedDiscount && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\ttype=\"success\"\n\t\t\t\t\t\t\t\tclassName=\"tabular-nums shrink-0\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{formatDeduction(appliedDiscount)}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!onRemove && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tonClick={onRemove}\n\t\t\t\t\t\t\t\taria-label={strings.remove}\n\t\t\t\t\t\t\t\tclassName=\"size-action-xs shrink-0 text-muted-foreground hover:text-destructive\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ItemActions>\n\t\t\t\t</Item>\n\t\t\t</ContentBlock>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ContentBlock title={strings.title} className={cn('coupon-input--component w-full', className)}>\n\t\t\t<Stack gap=\"md\">\n\t\t\t\t<div className=\"flex flex-wrap gap-space-md\">\n\t\t\t\t\t<div className=\"min-w-44 flex-1\">\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tvalue={code}\n\t\t\t\t\t\t\tonChange={(e) => setCode(normalizeCode((e.target as HTMLInputElement).value))}\n\t\t\t\t\t\t\taria-label={strings.fieldLabel}\n\t\t\t\t\t\t\tplaceholder={strings.placeholder}\n\t\t\t\t\t\t\tautoCapitalize=\"characters\"\n\t\t\t\t\t\t\tspellCheck={false}\n\t\t\t\t\t\t\tclassName=\"font-mono\"\n\t\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\tsize=\"md\"\n\t\t\t\t\t\tonClick={() => onApply?.(trimmedCode)}\n\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\tdisabled={!trimmedCode}\n\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.apply}\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{!!error && (\n\t\t\t\t\t<Text size=\"xs\" type=\"error\">{error || strings.invalid}</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</ContentBlock>\n\t);\n}\n\nCouponInputCard.displayName = 'CouponInputCard';\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type OrderStatusKind = 'pending' | 'paid' | 'fulfilled' | 'shipped' | 'delivered' | 'cancelled';\n\nexport interface OrderStatusEvent {\n\t/** Display label. */\n\tlabel: string;\n\t/** Formatted time for the entry. */\n\ttimestamp?: string;\n\tcomplete: boolean;\n}\n\nexport interface OrderStatusStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Not rendered: the title badge states the status. Kept for existing overrides. */\n\tstatusLabel: string;\n\t/** Label of the delivery-estimate fact. */\n\teta: string;\n\t/** Not rendered: the timeline shows the latest event. Kept for existing overrides. */\n\tlatestEvent: string;\n\t/** Not rendered: the timeline marks the current step. Kept for existing overrides. */\n\tcurrentStep: string;\n}\n\nexport const defaultOrderStatusStrings: OrderStatusStrings = {\n\ttitle: 'Order status',\n\tstatusLabel: 'Current status',\n\teta: 'ETA',\n\tlatestEvent: 'Latest event',\n\tcurrentStep: 'Current step',\n};\n\nexport interface OrderStatusCardProps {\n\t/** Human-facing order reference. */\n\torderNumber: string;\n\t/** Current fulfilment stage. */\n\tstatus: OrderStatusKind;\n\t/** Badge tone for the status chip. */\n\tstatusTone?: BadgeTone;\n\t/** Timeline entries, oldest first. */\n\tevents: OrderStatusEvent[];\n\t/** Formatted delivery estimate. */\n\tcurrentEta?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OrderStatusStrings>;\n}\n","/**\n * OrderStatusCard — order number + status badge + readable event timeline.\n * Ideal for dashboards / receipt summaries. Strings overridable for i18n.\n *\n * The badge states the status and the timeline states every event, so the\n * only extra fact is the delivery estimate.\n */\nimport { CalendarClock, Check, Circle } from 'lucide-react';\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { ContentBlock } from '../../../base/display';\nimport { SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultOrderStatusStrings,\n\ttype OrderStatusCardProps,\n\ttype OrderStatusKind,\n} from './types';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\n// Every fulfilment stage is a status, so each maps to a status tone. Primary is\n// reserved for the main command and never paints a status chip.\nconst VARIANT_BY_STATUS: Record<OrderStatusKind, BadgeTone> = {\n\tpending: 'warning',\n\tpaid: 'info',\n\tfulfilled: 'info',\n\tshipped: 'info',\n\tdelivered: 'success',\n\tcancelled: 'destructive',\n};\n\nexport function OrderStatusCard({\n\torderNumber,\n\tstatus,\n\tstatusTone,\n\tevents,\n\tcurrentEta,\n\tclassName,\n\tstrings: stringsProp,\n}: OrderStatusCardProps) {\n\tconst strings = useStrings(defaultOrderStatusStrings, stringsProp);\n\tconst variant = statusTone ?? VARIANT_BY_STATUS[status];\n\tconst lastCompleteIdx = events.reduce((acc, e, i) => (e.complete ? i : acc), -1);\n\tconst nextEvent = events.find((event) => !event.complete);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={<Badge tone={variant} className=\"capitalize\">{status}</Badge>}\n\t\t\tdescription={`#${orderNumber}`}\n\t\t\tcontentGap=\"xl\"\n\t\t\tclassName={cn('order-status--component w-full', className)}\n\t\t>\n\t\t\t{/* The same label/value row ShipmentTracking uses for its estimate. */}\n\t\t\t{!!currentEta && (\n\t\t\t\t<InlineStat\n\t\t\t\t\tlabel={strings.eta}\n\t\t\t\t\tvalue={currentEta}\n\t\t\t\t\tclassName=\"order-status--eta\"\n\t\t\t\t\tvalueWeight=\"medium\"\n\t\t\t\t\tvalueClassName=\"tabular-nums\"\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{events.length > 0 && (\n\t\t\t\t<ol className=\"m-0 p-0 list-none\">\n\t\t\t\t\t{events.map((event, index) => {\n\t\t\t\t\t\tconst isLast = index === events.length - 1;\n\t\t\t\t\t\tconst isCurrent = nextEvent ? event === nextEvent : index === lastCompleteIdx;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={`${event.label}-${index}`} className=\"relative flex gap-space-lg\">\n\t\t\t\t\t\t\t\t<div className=\"flex flex-col items-center\">\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'flex size-6 shrink-0 items-center justify-center rounded-full border',\n\t\t\t\t\t\t\t\t\t\t\tevent.complete\n\t\t\t\t\t\t\t\t\t\t\t\t? 'border-success bg-success text-success-foreground'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'border-border bg-card text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t\t// The up-next marker sits directly beneath success-filled steps,\n\t\t\t\t\t\t\t\t\t\t\t// and primary is a neighbouring hue to success in this theme, so a\n\t\t\t\t\t\t\t\t\t\t\t// 10% ring read as the same state at a glance. A tinted fill plus a\n\t\t\t\t\t\t\t\t\t\t\t// heavier border and ring separate it by weight rather than by hue,\n\t\t\t\t\t\t\t\t\t\t\t// which survives a retheme that moves primary closer to success.\n\t\t\t\t\t\t\t\t\t\t\tisCurrent && !event.complete && cn('border-2 border-primary-accent ring-4', toneRecipes.primary.tint, toneRecipes.primary.ink, toneRecipes.primary.halo),\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{event.complete ? (\n\t\t\t\t\t\t\t\t\t\t\t<Check className=\"size-icon-md\" strokeWidth={2.5} />\n\t\t\t\t\t\t\t\t\t\t) : isCurrent ? (\n\t\t\t\t\t\t\t\t\t\t\t<CalendarClock className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<Circle className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{!isLast && (\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t'min-h-6 w-px flex-1',\n\t\t\t\t\t\t\t\t\t\t\t\tindex < lastCompleteIdx ? 'bg-success' : 'bg-border',\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div className={cn('min-w-0 flex-1 pb-space-xl', isLast && 'pb-0')}>\n\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\tweight={event.complete || isCurrent ? 'semibold' : 'medium'}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(!event.complete && !isCurrent && 'text-muted-foreground')}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{event.label}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t{!!event.timestamp && (\n\t\t\t\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t\t{event.timestamp}\n\t\t\t\t\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</ol>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nOrderStatusCard.displayName = 'OrderStatusCard';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type PaymentBrand = 'visa' | 'mastercard' | 'amex' | 'paypal' | 'applepay' | 'googlepay' | 'unknown';\n\n/** `card` draws the card face; `row` the compact identity row. */\nexport type PaymentMethodVariant = 'card' | 'row';\n\nexport interface PaymentMethodStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tdefault: string;\n\tcardHolder: string;\n\texpires: string;\n\tchange: string;\n\t/** Each brand's name as it is read aloud and shown in the `row` form. */\n\tbrands: Record<PaymentBrand, string>;\n\t/** Names the method without reading the number aloud: \"Visa ending 4242\". */\n\tformatCard: (brand: string, last4: string) => string;\n}\n\nexport const defaultPaymentMethodStrings: PaymentMethodStrings = {\n\ttitle: 'Payment method',\n\tdefault: 'Default',\n\tcardHolder: 'Card holder',\n\texpires: 'Expires',\n\tchange: 'Change',\n\tbrands: {\n\t\tvisa: 'Visa',\n\t\tmastercard: 'Mastercard',\n\t\tamex: 'American Express',\n\t\tpaypal: 'PayPal',\n\t\tapplepay: 'Apple Pay',\n\t\tgooglepay: 'Google Pay',\n\t\tunknown: 'Card',\n\t},\n\tformatCard: (brand, last4) => `${brand} ending ${last4}`,\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface PaymentMethodProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title' | 'onChange'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Card network or wallet. */\n\tbrand: PaymentBrand;\n\t/** Last four digits, the only card number this component accepts. */\n\tlast4: string;\n\t/** Expiry in MM/YY form. */\n\texpiry?: string; // MM/YY\n\t/** Name printed on the card. */\n\tholderName?: string;\n\t/** Marks this as the account's default method. */\n\tdefault?: boolean;\n\t/**\n\t * Fired when the \"Change\" action is pressed. It carries no value — the\n\t * component never holds a payment method to hand back — so treat it as a\n\t * request to open your own method picker.\n\t */\n\tonChange?: () => void;\n\t/** `card` (default) draws the card face; `row` the compact identity row. */\n\tvariant?: PaymentMethodVariant;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<PaymentMethodStrings>;\n}\n\n/** Props of `PaymentMethodCard`: `PaymentMethod` with `variant` defaulting to `row`. */\nexport type PaymentMethodCardProps = PaymentMethodProps;\n","/**\n * PaymentMethod — saved payment-method surface, in two forms.\n *\n * - `card` (default): the hero block is a mini credit-card mock with real card\n * proportions, brand chip top-right, and holder + expiry on the bottom row.\n * The centre line is drawn as a full PAN but only `last4` is ever supplied:\n * the leading digits are decorative bullets, hidden from assistive\n * technology, and the card is named aloud through `strings.formatCard`\n * (\"Visa ending 4242\") instead.\n * - `row`: a compact identity row: that same spoken name, with the holder\n * and expiry beneath it. No glyph: one card icon would misname a wallet.\n *\n * The component neither accepts nor stores a full card number. `onChange` is\n * a request to open the consumer's own method picker; it carries no value.\n * `PaymentMethodCard` is this component defaulting to the `row` form.\n */\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { VisuallyHidden } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultPaymentMethodStrings, type PaymentBrand, type PaymentMethodProps } from './types';\n\n/** The brand chip as printed on a card face. The spoken name comes from `strings.brands`. */\nconst BRAND_LABEL: Record<PaymentBrand, string> = {\n\tvisa: 'VISA',\n\tmastercard: 'MasterCard',\n\tamex: 'AMEX',\n\tpaypal: 'PayPal',\n\tapplepay: 'Apple Pay',\n\tgooglepay: 'Google Pay',\n\tunknown: 'Card',\n};\n\n/**\n * The card face is an artwork-backed surface, which `--inverse-*` exists for.\n * Brands previously borrowed semantic state colours — a Visa painted `info`,\n * Google Pay `success` — so retheming an alert colour would have repainted\n * every stored card. Those tokens mean states, not brands. Identity comes from\n * the brand label and mark; the surface stays canonical, which also matches how\n * real cards read in an admin list.\n */\n// Translucent gloss composites over its explicit inverse base in both themes.\nconst BRAND_SURFACE = 'bg-inverse-background from-inverse-background via-inverse-surface-strong to-inverse-background';\n\nexport function PaymentMethod({\n\tbrand,\n\tlast4,\n\texpiry,\n\tholderName,\n\tdefault: defaultMethod = false,\n\tonChange,\n\tvariant = 'card',\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: PaymentMethodProps) {\n\tconst strings = useStrings(defaultPaymentMethodStrings, stringsProp);\n\tconst spokenName = strings.formatCard(strings.brands[brand], last4);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={defaultMethod ? <Badge tone=\"neutral\">{strings.default}</Badge> : null}\n\t\t\theaderAction={onChange ? (\n\t\t\t\t<Button buttonStyle=\"ghost\" tone=\"secondary\" onClick={onChange}>\n\t\t\t\t\t{strings.change}\n\t\t\t\t</Button>\n\t\t\t) : undefined}\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn('payment-method--component w-full', className)}\n\t\t>\n\t\t\t{variant === 'row' ? (\n\t\t\t\t<Stack gap=\"dense\" className=\"payment-method--identity min-w-0\">\n\t\t\t\t\t<Text type=\"inherit\" weight=\"semibold\" className=\"payment-method--name\">{spokenName}</Text>\n\t\t\t\t\t{!!holderName && (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"payment-method--holder truncate\">{holderName}</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!expiry && (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"payment-method--expiry\">\n\t\t\t\t\t\t\t{strings.expires} <Value type=\"inherit\" className=\"tabular-nums\">{expiry}</Value>\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t) : (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'payment-method--face relative flex aspect-[85.6/53.98] w-full max-w-[22rem] flex-col justify-between overflow-hidden rounded-radius bg-gradient-to-br p-surface text-inverse-foreground shadow-sm ring-1 ring-inverse-border',\n\t\t\t\t\t\tBRAND_SURFACE,\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden>{spokenName}</VisuallyHidden>\n\t\t\t\t\t<div aria-hidden=\"true\" className=\"relative flex items-start justify-between\">\n\t\t\t\t\t\t<div className=\"flex size-7 items-center justify-center rounded-radius-md bg-gradient-to-br from-muted to-muted-foreground/60 shadow-sm\">\n\t\t\t\t\t\t\t<div className=\"size-icon rounded-radius-sm border border-warning-foreground/25 bg-warning-foreground/15\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\tweight=\"bold\"\n\t\t\t\t\t\t\tclassName=\"rounded-radius-xs bg-inverse-surface px-space-md py-space-2xs tracking-[0.15em] text-inverse-foreground\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{BRAND_LABEL[brand]}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div aria-hidden=\"true\" className=\"relative\">\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\tclassName=\"payment-method--number block whitespace-nowrap font-mono tracking-widest text-inverse-foreground\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t•••• •••• •••• {last4}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"end\" justify=\"between\" gap=\"lg\" className=\"relative\">\n\t\t\t\t\t\t<div className=\"min-w-0\">\n\t\t\t\t\t\t\t{!!holderName && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"block\">{strings.cardHolder}</DisplayLabel>\n\t\t\t\t\t\t\t\t\t<Text weight=\"semibold\" className=\"truncate text-inverse-foreground\">{holderName}</Text>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{!!expiry && (\n\t\t\t\t\t\t\t<div className=\"text-right shrink-0\">\n\t\t\t\t\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"block\">{strings.expires}</DisplayLabel>\n\t\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"tabular-nums text-inverse-foreground\">{expiry}</Value>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nPaymentMethod.displayName = 'PaymentMethod';\n\n/**\n * The source kit's `PaymentMethodCard`: `PaymentMethod` defaulting to the\n * compact `row` identity form. Pass `variant=\"card\"` for the card face.\n */\nexport function PaymentMethodCard({ variant = 'row', ...props }: PaymentMethodProps) {\n\treturn <PaymentMethod variant={variant} {...props} />;\n}\n\nPaymentMethodCard.displayName = 'PaymentMethodCard';\n","import type {\n\tSeoListingCheckId,\n\tSeoListingCheckResult,\n\tSeoListingCheckStatus,\n\tSeoListingScoreInput,\n\tSeoListingScoreLimits,\n\tSeoListingScoreResult,\n} from './types';\n\nexport const DEFAULT_SEO_LISTING_LIMITS: Required<SeoListingScoreLimits> = {\n\ttitleMin: 35,\n\ttitleMax: 60,\n\tdescriptionMin: 120,\n\tdescriptionMax: 160,\n\tpermalinkMax: 75,\n};\n\nfunction resolveLimits(limits?: SeoListingScoreLimits): Required<SeoListingScoreLimits> {\n\treturn {\n\t\t...DEFAULT_SEO_LISTING_LIMITS,\n\t\t...limits,\n\t};\n}\n\nfunction clampScore(value: number): number {\n\tif (!Number.isFinite(value)) return 0;\n\treturn Math.max(0, Math.min(1, value));\n}\n\nfunction getCheckStatus(score: number, maxScore: number): SeoListingCheckStatus {\n\tif (maxScore <= 0) return 'missing';\n\tconst ratio = score / maxScore;\n\tif (ratio >= 0.9) return 'good';\n\tif (ratio >= 0.5) return 'review';\n\treturn 'missing';\n}\n\nfunction makeCheck(\n\tid: SeoListingCheckId,\n\tscoreRatio: number,\n\tmaxScore: number,\n\tactual: number,\n\trange?: Pick<SeoListingCheckResult, 'min' | 'max'>,\n): SeoListingCheckResult {\n\tconst score = Math.round(clampScore(scoreRatio) * maxScore);\n\treturn {\n\t\tid,\n\t\tscore,\n\t\tmaxScore,\n\t\tactual,\n\t\tstatus: getCheckStatus(score, maxScore),\n\t\t...range,\n\t};\n}\n\nfunction lengthScore(value: string, min: number, max: number): number {\n\tconst length = value.trim().length;\n\tif (length === 0) return 0;\n\tif (length >= min && length <= max) return 1;\n\tif (length < min) return Math.max(0.35, length / min);\n\tif (length > max * 2) return 0.35;\n\tconst overBy = length - max;\n\treturn Math.max(0.55, 1 - overBy / max);\n}\n\nexport function getSeoPermalinkPath(permalink?: string): string {\n\tconst value = permalink?.trim() ?? '';\n\tif (!value) return '';\n\n\tconst withoutHash = value.split('#')[0] ?? '';\n\tconst withoutQuery = withoutHash.split('?')[0] ?? '';\n\tconst withoutProtocol = withoutQuery.replace(/^https?:\\/\\/[^/]+/i, '');\n\n\treturn withoutProtocol.replace(/^\\/+|\\/+$/g, '');\n}\n\nexport function getSeoPermalinkSlug(permalink?: string): string {\n\tconst path = getSeoPermalinkPath(permalink);\n\tconst parts = path.split('/').filter(Boolean);\n\treturn parts.at(-1) ?? '';\n}\n\nfunction permalinkScore(permalink?: string, max = DEFAULT_SEO_LISTING_LIMITS.permalinkMax): number {\n\tconst path = getSeoPermalinkPath(permalink);\n\tif (!path) return 0;\n\tif (path.length <= max) return 1;\n\tif (path.length > max * 2) return 0.35;\n\treturn Math.max(0.55, 1 - (path.length - max) / max);\n}\n\nfunction slugScore(permalink?: string): number {\n\tconst slug = getSeoPermalinkSlug(permalink);\n\tif (!slug) return 0;\n\tif (/^[\\p{L}\\p{N}]+(?:-[\\p{L}\\p{N}]+)*$/u.test(slug) && slug === slug.toLowerCase()) {\n\t\treturn 1;\n\t}\n\tif (!/\\s/.test(slug) && !/[?#]/.test(slug)) return 0.65;\n\treturn 0.25;\n}\n\nfunction urlScore(baseUrl?: string): number {\n\tconst value = baseUrl?.trim() ?? '';\n\tif (!value) return 0;\n\tif (/^https:\\/\\//i.test(value)) return 1;\n\tif (/^http:\\/\\//i.test(value)) return 0.6;\n\treturn 0.45;\n}\n\nfunction keywordScore(input: SeoListingScoreInput): number | null {\n\tconst keyword = input.keyword?.trim().toLowerCase();\n\tif (!keyword) return null;\n\n\tconst haystack = [\n\t\tinput.title,\n\t\tinput.description,\n\t\tgetSeoPermalinkPath(input.permalink),\n\t]\n\t\t.filter(Boolean)\n\t\t.join(' ')\n\t\t.toLowerCase();\n\n\tif (!haystack) return 0;\n\treturn haystack.includes(keyword) ? 1 : 0.35;\n}\n\nexport function calculateSeoListingScore(input: SeoListingScoreInput): SeoListingScoreResult {\n\tconst limits = resolveLimits(input.limits);\n\tconst title = input.title?.trim() ?? '';\n\tconst description = input.description?.trim() ?? '';\n\tconst permalinkPath = getSeoPermalinkPath(input.permalink);\n\tconst slug = getSeoPermalinkSlug(input.permalink);\n\tconst checks: SeoListingCheckResult[] = [\n\t\tmakeCheck('title', lengthScore(title, limits.titleMin, limits.titleMax), 30, title.length, {\n\t\t\tmin: limits.titleMin,\n\t\t\tmax: limits.titleMax,\n\t\t}),\n\t\tmakeCheck(\n\t\t\t'description',\n\t\t\tlengthScore(description, limits.descriptionMin, limits.descriptionMax),\n\t\t\t30,\n\t\t\tdescription.length,\n\t\t\t{\n\t\t\t\tmin: limits.descriptionMin,\n\t\t\t\tmax: limits.descriptionMax,\n\t\t\t},\n\t\t),\n\t\tmakeCheck('permalink', permalinkScore(input.permalink, limits.permalinkMax), 15, permalinkPath.length, {\n\t\t\tmax: limits.permalinkMax,\n\t\t}),\n\t\tmakeCheck('slug', slugScore(input.permalink), 10, slug.length),\n\t\tmakeCheck('url', urlScore(input.baseUrl), 10, input.baseUrl?.trim().length ?? 0),\n\t];\n\n\tconst keyword = keywordScore(input);\n\tif (keyword !== null) {\n\t\tchecks.push(makeCheck('keyword', keyword, 5, input.keyword?.trim().length ?? 0));\n\t}\n\n\tconst score = Math.round(\n\t\t(checks.reduce((sum, check) => sum + check.score, 0) /\n\t\t\tchecks.reduce((sum, check) => sum + check.maxScore, 0)) *\n\t\t\t100,\n\t);\n\n\treturn {\n\t\tscore,\n\t\tstatus: getCheckStatus(score, 100),\n\t\tchecks,\n\t\tlimits,\n\t};\n}\n","import type { ReactNode } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type SeoListingCheckId =\n\t| 'title'\n\t| 'description'\n\t| 'permalink'\n\t| 'slug'\n\t| 'url'\n\t| 'keyword';\n\nexport type SeoListingCheckStatus = 'good' | 'review' | 'missing';\n\nexport interface SeoListingScoreLimits {\n\ttitleMin?: number;\n\ttitleMax?: number;\n\tdescriptionMin?: number;\n\tdescriptionMax?: number;\n\tpermalinkMax?: number;\n}\n\nexport interface SeoListingScoreInput {\n\t/** Surface title. */\n\ttitle?: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/** Full URL shown under the title. */\n\tpermalink?: string;\n\t/** Origin the permalink is built on. */\n\tbaseUrl?: string;\n\t/** Target keyword the copy is scored against. */\n\tkeyword?: string;\n\t/** Character caps for the title and description. */\n\tlimits?: SeoListingScoreLimits;\n}\n\nexport interface SeoListingCheckResult {\n\t/** Stable identity for this entry. */\n\tid: SeoListingCheckId;\n\tstatus: SeoListingCheckStatus;\n\t/** Overall SEO score, 0-100. */\n\tscore: number;\n\tmaxScore: number;\n\tactual: number;\n\tmin?: number;\n\tmax?: number;\n}\n\nexport interface SeoListingScoreResult {\n\t/** Overall SEO score, 0-100. */\n\tscore: number;\n\tstatus: SeoListingCheckStatus;\n\tchecks: SeoListingCheckResult[];\n\t/** Character caps for the title and description. */\n\tlimits: Required<SeoListingScoreLimits>;\n}\n\nexport interface SeoListingCardStrings {\n\t/** Surface title. */\n\ttitle: string;\n\teditLabel: string;\n\tscoreLabel: string;\n\tchecksLabel: string;\n\tsiteFallback: string;\n\ttitleFallback: string;\n\tdescriptionFallback: string;\n\turlFallback: string;\n\tcharacters: string;\n\tmaxLabel: string;\n\ttargetLabel: string;\n\tstatus: Record<SeoListingCheckStatus, string>;\n\tcheckLabels: Record<SeoListingCheckId, string>;\n\tcheckHints: Record<SeoListingCheckId, string>;\n}\n\nexport const defaultSeoListingCardStrings: SeoListingCardStrings = {\n\ttitle: 'Search engine listing',\n\teditLabel: 'Edit search listing',\n\tscoreLabel: 'SEO score',\n\tchecksLabel: 'SEO checks',\n\tsiteFallback: 'Website',\n\ttitleFallback: 'Add an SEO title',\n\tdescriptionFallback: 'Add a meta description to control the search snippet.',\n\turlFallback: 'https://example.com',\n\tcharacters: 'characters',\n\tmaxLabel: 'max',\n\ttargetLabel: 'target',\n\tstatus: {\n\t\tgood: 'Good',\n\t\treview: 'Review',\n\t\tmissing: 'Missing',\n\t},\n\tcheckLabels: {\n\t\ttitle: 'Title',\n\t\tdescription: 'Description',\n\t\tpermalink: 'Permalink',\n\t\tslug: 'Slug format',\n\t\turl: 'URL',\n\t\tkeyword: 'Keyword',\n\t},\n\tcheckHints: {\n\t\ttitle: 'Keep the title inside the target range.',\n\t\tdescription: 'Use a complete meta description inside the target range.',\n\t\tpermalink: 'Keep the permalink readable and below the maximum length.',\n\t\tslug: 'Use lowercase words separated by hyphens.',\n\t\turl: 'Prefer a secure canonical URL.',\n\t\tkeyword: 'Use the focus keyword in the title, description, or permalink.',\n\t},\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface SeoListingCardProps extends Pick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Site name shown in the search preview. */\n\tsiteName?: string;\n\t/** Origin the permalink is built on. */\n\tbaseUrl?: string;\n\t/** Path parts appended to the base URL. */\n\tpathSegments?: string[];\n\t/** Full URL shown under the title. */\n\tpermalink?: string;\n\t/** Surface title. */\n\ttitle?: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/** Formatted price shown in the rich result. */\n\tprice?: ReactNode;\n\t/** Target keyword the copy is scored against. */\n\tkeyword?: string;\n\t/** Overall SEO score, 0-100. */\n\tscore?: SeoListingScoreResult;\n\t/** Character caps for the title and description. */\n\tlimits?: SeoListingScoreLimits;\n\t/** Renders the checks. */\n\tshowChecks?: boolean;\n\t/** Fired when an entry is edited. */\n\tonEdit?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<SeoListingCardStrings>;\n}\n","/**\n * SeoListingCard — search-result preview with a reusable SEO score.\n *\n * The card is render-only: consumers own form state and call `onEdit` or\n * compose their own editor around the exported `calculateSeoListingScore`\n * helper. Scoring is intentionally configurable through `limits` so apps can\n * tune their own title, description, and permalink thresholds.\n */\nimport {\n\tCheckCircle2,\n\tCircleAlert,\n\tExternalLink,\n\tPencil,\n\tTriangleAlert,\n\ttype LucideIcon,\n} from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Progress } from '../../../base/feedback';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue, Value } from '../../../primitives';\nimport { Text, TextLink } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tcalculateSeoListingScore,\n\tgetSeoPermalinkPath,\n} from './seo-listing-score';\nimport {\n\tdefaultSeoListingCardStrings,\n\ttype SeoListingCardProps,\n\ttype SeoListingCardStrings,\n\ttype SeoListingCheckResult,\n\ttype SeoListingCheckStatus,\n} from './types';\n\n// `good` is success, not info: the row already carries a CheckCircle2, and\n// every other commerce surface (order status, inventory level, discount\n// stack, applied coupon, refund stages) signals a passing state in success\n// green. The review/missing rungs already matched the shared vocabulary.\nconst SCORE_BADGE_TONE: Record<SeoListingCheckStatus, BadgeTone> = {\n\tgood: 'success',\n\treview: 'warning',\n\tmissing: 'destructive',\n};\n\nconst SCORE_PROGRESS_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: '[&_[data-slot=progress-indicator]]:bg-success',\n\treview: '[&_[data-slot=progress-indicator]]:bg-warning',\n\tmissing: '[&_[data-slot=progress-indicator]]:bg-destructive',\n};\n\nconst CHECK_ICON: Record<SeoListingCheckStatus, LucideIcon> = {\n\tgood: CheckCircle2,\n\treview: TriangleAlert,\n\tmissing: CircleAlert,\n};\n\n// The glyph encodes the check's state, so it carries the status colour and\n// nothing else: no tinted square behind it and no tinted tile around the row.\nconst CHECK_ICON_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: 'text-success',\n\treview: 'text-warning-accent',\n\tmissing: 'text-destructive',\n};\n\nfunction trimSlashes(value: string): string {\n\treturn value.replace(/^\\/+|\\/+$/g, '');\n}\n\nfunction buildUrlParts(baseUrl: string, pathSegments: string[], permalink?: string): string[] {\n\tconst path = getSeoPermalinkPath(permalink);\n\tconst permalinkParts = path.split('/').filter(Boolean);\n\treturn [\n\t\tbaseUrl,\n\t\t...pathSegments.map(trimSlashes).filter(Boolean),\n\t\t...permalinkParts,\n\t].filter(Boolean);\n}\n\nfunction buildHref(baseUrl: string, pathSegments: string[], permalink?: string): string | undefined {\n\tif (!baseUrl.trim()) return undefined;\n\tconst base = baseUrl.replace(/\\/+$/g, '');\n\tconst path = [\n\t\t...pathSegments.map(trimSlashes).filter(Boolean),\n\t\t...getSeoPermalinkPath(permalink).split('/').filter(Boolean),\n\t].join('/');\n\n\treturn path ? `${base}/${path}` : base;\n}\n\nfunction getCheckDetail(check: SeoListingCheckResult, strings: SeoListingCardStrings): string {\n\tif (check.id === 'title' || check.id === 'description') {\n\t\treturn `${check.actual}/${check.max} ${strings.characters} · ${strings.targetLabel} ${check.min}-${check.max}`;\n\t}\n\tif (check.id === 'permalink') {\n\t\treturn `${check.actual}/${check.max} ${strings.characters} ${strings.maxLabel}`;\n\t}\n\treturn strings.checkHints[check.id];\n}\n\nfunction SeoCheckRow({\n\tcheck,\n\tdetail,\n\tstrings,\n}: {\n\tcheck: SeoListingCheckResult;\n\tdetail: ReactNode;\n\tstrings: SeoListingCardStrings;\n}) {\n\tconst Icon = CHECK_ICON[check.status];\n\n\treturn (\n\t\t<div className=\"seo-listing-card--check min-w-0\">\n\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"start\" wrap={false}>\n\t\t\t\t{/* Same first-line offset the shared ItemMedia applies beside a description. */}\n\t\t\t\t<Icon\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'seo-listing-card--check-icon size-icon shrink-0 translate-y-0.5',\n\t\t\t\t\t\tCHECK_ICON_CLASS[check.status],\n\t\t\t\t\t)}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" justify=\"between\" wrap={false}>\n\t\t\t\t\t\t<Text type=\"inherit\" tag=\"span\" weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t\t\t{strings.checkLabels[check.id]}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\ttone={SCORE_BADGE_TONE[check.status]}\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tinline\n\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.status[check.status]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" lineHeight=\"snug\">\n\t\t\t\t\t\t{detail}\n\t\t\t\t\t</Text>\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t</div>\n\t);\n}\n\nexport function SeoListingCard({\n\tsiteName,\n\tbaseUrl,\n\tpathSegments = [],\n\tpermalink,\n\ttitle,\n\tdescription,\n\tprice,\n\tkeyword,\n\tscore,\n\tlimits,\n\tshowChecks = true,\n\tonEdit,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n}: SeoListingCardProps) {\n\tconst strings = useStrings(defaultSeoListingCardStrings, stringsProp);\n\tconst resolvedBaseUrl = baseUrl?.trim() || strings.urlFallback;\n\tconst resolvedSiteName = siteName?.trim() || strings.siteFallback;\n\tconst resolvedTitle = title?.trim() || strings.titleFallback;\n\tconst resolvedDescription = description?.trim() || strings.descriptionFallback;\n\tconst scoreResult = score ?? calculateSeoListingScore({\n\t\ttitle,\n\t\tdescription,\n\t\tpermalink,\n\t\tbaseUrl,\n\t\tkeyword,\n\t\tlimits,\n\t});\n\tconst href = buildHref(resolvedBaseUrl, pathSegments, permalink);\n\tconst urlParts = buildUrlParts(resolvedBaseUrl, pathSegments, permalink);\n\tconst statusTone = SCORE_BADGE_TONE[scoreResult.status];\n\n\treturn (\n\t\t<Card\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={(\n\t\t\t\t<Badge tone={statusTone} size=\"sm\" inline className=\"shrink-0\">\n\t\t\t\t\t{scoreResult.score}/100 {strings.status[scoreResult.status]}\n\t\t\t\t</Badge>\n\t\t\t)}\n\t\t\tclassName={cn('seo-listing-card--component @container/seo-listing-card w-full', className)}\n\t\t\tcontentGap=\"2xl\"\n\t\t\theaderAction={\n\t\t\t\tonEdit ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\taria-label={strings.editLabel}\n\t\t\t\t\t\tonClick={onEdit}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Pencil className=\"size-icon-sm\" />\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{/*\n\t\t\t\t\t`data-artwork` marks this subtree as a depiction of an external\n\t\t\t\t\tproduct rather than part of the consumer's theme. A search result\n\t\t\t\t\tmust look like a search result whatever colour the admin is themed,\n\t\t\t\t\tso the snippet title states Google's link blue outright instead of\n\t\t\t\t\tborrowing `--color-info`, which would have repainted the preview\n\t\t\t\t\twhenever someone retuned their informational-message colour.\n\t\t\t\t*/}\n\t\t\t\t<div data-artwork=\"serp\" className=\"seo-listing-card--preview min-w-0 rounded-radius border border-border/60 bg-background text-foreground p-surface shadow-xs\">\n\t\t\t\t<Stack gap=\"sm\" className=\"min-w-0\">\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false}>\n\t\t\t\t\t\t<Text type=\"inherit\" weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t\t\t{resolvedSiteName}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t{!!href && <ExternalLink className=\"size-icon-sm shrink-0 text-muted-foreground\" aria-hidden=\"true\" />}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<div className=\"seo-listing-card--url flex min-w-0 flex-wrap items-center gap-x-space-sm gap-y-space-2xs\">\n\t\t\t\t\t\t{urlParts.map((part, index) => (\n\t\t\t\t\t\t\t<span key={`${part}-${index}`} className=\"inline-flex min-w-0 items-center gap-space-sm\">\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t{index < urlParts.length - 1 && (\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t›\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t\t{href ? (\n\t\t\t\t\t\t<TextLink\n\t\t\t\t\t\t\thref={href}\n\t\t\t\t\t\t\tsize=\"base\"\n\t\t\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\t\t\tunderline={false}\n\t\t\t\t\t\t\tclassName=\"seo-listing-card--snippet-title block text-[#1a0dab] dark:text-[#8ab4f8]\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{resolvedTitle}\n\t\t\t\t\t\t</TextLink>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Text type=\"inherit\"\n\t\t\t\t\t\t\tsize=\"base\"\n\t\t\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\t\t\tclassName=\"seo-listing-card--snippet-title text-[#1a0dab] dark:text-[#8ab4f8]\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{resolvedTitle}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t<Text type=\"secondary\" lineHeight=\"relaxed\" className=\"seo-listing-card--description max-w-4xl\">\n\t\t\t\t\t\t{resolvedDescription}\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!price && (\n\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"seo-listing-card--price block tabular-nums\">\n\t\t\t\t\t\t\t{price}\n\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t{/*\n\t\t\t\tThe score is a section of this card, not a second card: no tinted\n\t\t\t\tpanel, no inner rule and no repeated status badge — the title suffix\n\t\t\t\talready states the status, and the bar and glyphs carry its colour.\n\t\t\t*/}\n\t\t\t<Stack gap=\"lg\" className=\"seo-listing-card--score\">\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" justify=\"between\" align=\"start\" wrap={false}>\n\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t\t<Text type=\"inherit\" weight=\"semibold\">{strings.scoreLabel}</Text>\n\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t<NumberValue value={scoreResult.checks.length} size=\"xs\" type=\"secondary\" align=\"left\" /> {strings.checksLabel}\n\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t{scoreResult.score}/100\n\t\t\t\t\t</Value>\n\t\t\t\t</Stack>\n\t\t\t\t<Progress\n\t\t\t\t\tvalue={scoreResult.score}\n\t\t\t\t\taria-label={strings.scoreLabel}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'seo-listing-card--score-progress',\n\t\t\t\t\t\t'[&_[data-slot=progress-track]]:h-space-md',\n\t\t\t\t\t\tSCORE_PROGRESS_CLASS[scoreResult.status],\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t\t{!!showChecks && (\n\t\t\t\t\t<div className=\"seo-listing-card--checks grid gap-x-space-2xl gap-y-space-lg @xl/seo-listing-card:grid-cols-2\">\n\t\t\t\t\t\t{scoreResult.checks.map((check) => (\n\t\t\t\t\t\t\t<SeoCheckRow\n\t\t\t\t\t\t\t\tkey={check.id}\n\t\t\t\t\t\t\t\tcheck={check}\n\t\t\t\t\t\t\t\tdetail={getCheckDetail(check, strings)}\n\t\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nSeoListingCard.displayName = 'SeoListingCard';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type InvoiceStatus = 'paid' | 'pending' | 'overdue';\n\nexport interface InvoiceMiniData {\n\tinvoiceNumber: string;\n\tcustomerName: string;\n\tlineItemsCount: number;\n\ttotalAmount: string;\n\tstatus: InvoiceStatus;\n\tdueDate: string;\n}\n\nexport interface InvoiceMiniStrings {\n\tpaid: string;\n\tpending: string;\n\toverdue: string;\n\titems: (count: number) => string;\n\tdue: string;\n}\n\nexport const defaultInvoiceMiniStrings: InvoiceMiniStrings = {\n\tpaid: 'Paid',\n\tpending: 'Pending',\n\toverdue: 'Overdue',\n\titems: (count) => (count === 1 ? '1 line item' : `${count} line items`),\n\tdue: 'Due',\n};\n\nexport interface InvoiceMiniProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {\n\t/** The invoice to summarise. */\n\tinvoice: InvoiceMiniData;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceMiniStrings>;\n}\n\nexport const invoiceStatusTone: Record<InvoiceStatus, BadgeTone> = {\n\tpaid: 'success',\n\tpending: 'warning',\n\toverdue: 'destructive',\n};\n","/**\n * InvoiceMini — compact invoice tile for lists / dashboards. Header\n * (number + status chip), customer name, footer split between items-count /\n * due date and the total amount. Strings (status labels, \"Due\", item count\n * pluralisation) overridable for i18n via the `strings` prop.\n */\nimport { Badge } from '../../../base/badge';\nimport { Stack } from '../../../base/structure';\nimport { MonoValue, SecondaryValue, Value } from '../../../primitives';\nimport { Text } from '../../../typography/text';\nimport { mergeStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInvoiceMiniStrings,\n\tinvoiceStatusTone,\n\ttype InvoiceMiniProps,\n\ttype InvoiceStatus,\n} from './types';\n\nexport function InvoiceMini({\n\tinvoice,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: InvoiceMiniProps) {\n\tconst strings = mergeStrings(defaultInvoiceMiniStrings, stringsProp);\n\tconst labelByStatus: Record<InvoiceStatus, string> = {\n\t\tpaid: strings.paid,\n\t\tpending: strings.pending,\n\t\toverdue: strings.overdue,\n\t};\n\n\treturn (\n\t\t<Stack\n\t\t\t{...props}\n\t\t\tgap=\"md\"\n\t\t\tdata-component=\"invoice-mini\"\n\t\t\tdata-slot=\"invoice-mini\"\n\t\t\tclassName={cn('invoice-mini--component', className)}\n\t\t>\n\t\t\t{/* The status belongs to the invoice number, as in InvoiceHeader: it\n\t\t\t sits beside it rather than at the far edge, and its tone alone\n\t\t\t states the status. */}\n\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false}>\n\t\t\t\t<MonoValue type=\"inherit\" className=\"min-w-0 truncate tracking-wide\">\n\t\t\t\t\t{invoice.invoiceNumber}\n\t\t\t\t</MonoValue>\n\t\t\t\t<Badge\n\t\t\t\t\ttone={invoiceStatusTone[invoice.status]}\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t>\n\t\t\t\t\t{labelByStatus[invoice.status]}\n\t\t\t\t</Badge>\n\t\t\t</Stack>\n\n\t\t\t<Text type=\"secondary\" className=\"truncate\">\n\t\t\t\t{invoice.customerName}\n\t\t\t</Text>\n\n\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" align=\"end\" justify=\"between\" className=\"pt-space-xs\">\n\t\t\t\t<Stack gap=\"2xs\" className=\"min-w-0\">\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.items(invoice.lineItemsCount)}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"whitespace-nowrap tabular-nums\">\n\t\t\t\t\t\t{strings.due} {invoice.dueDate}\n\t\t\t\t\t</SecondaryValue>\n\t\t\t\t</Stack>\n\t\t\t\t<Value type=\"inherit\"\n\t\t\t\t\tsize=\"base\"\n\t\t\t\t\tweight=\"bold\"\n\t\t\t\t\tlineHeight=\"none\"\n\t\t\t\t\tclassName=\"ml-auto shrink-0 tabular-nums\"\n\t\t\t\t>\n\t\t\t\t\t{invoice.totalAmount}\n\t\t\t\t</Value>\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nInvoiceMini.displayName = 'InvoiceMini';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { InvoiceStatus } from '../invoice-mini/types';\n\nexport interface InvoiceParty {\n\t/** Display name. */\n\tname: string;\n\t/** Where the party is: a city line, or a node such as a full address. */\n\tlocation?: ReactNode;\n}\n\nexport interface InvoiceHeaderStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tbillFrom: string;\n\tbillTo: string;\n\tissued: string;\n\tdue: string;\n\tamountDue: string;\n\t/** Chip label for each `InvoiceStatus`. */\n\tpaid: string;\n\tpending: string;\n\toverdue: string;\n}\n\nexport const defaultInvoiceHeaderStrings: InvoiceHeaderStrings = {\n\ttitle: 'Invoice',\n\tbillFrom: 'Bill from',\n\tbillTo: 'Bill to',\n\tissued: 'Issued',\n\tdue: 'Due',\n\tamountDue: 'Amount due',\n\tpaid: 'Paid',\n\tpending: 'Pending',\n\toverdue: 'Overdue',\n};\n\nexport interface InvoiceHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'> {\n\t/** Human-facing invoice reference. */\n\tinvoiceNumber: string;\n\t/**\n\t * Payment state. Drives both the chip label (through `strings`) and its\n\t * tone, so the two can never disagree. Shares the `InvoiceStatus` union\n\t * with `InvoiceMini`.\n\t */\n\tstatus: InvoiceStatus;\n\t/**\n\t * Overrides the badge tone derived from `status`. Reach for it only when\n\t * the surrounding surface needs a tone the status does not imply.\n\t */\n\tstatusTone?: BadgeTone;\n\t/** Issuing party. */\n\tfrom: InvoiceParty;\n\t/** Billed party. */\n\tto: InvoiceParty;\n\t/** Formatted issue date. */\n\tissuedDate?: string;\n\t/** Formatted due date. */\n\tdueDate?: string;\n\t/** Formatted invoice total. */\n\tamount: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceHeaderStrings>;\n}\n","/**\n * InvoiceHeader — invoice document header.\n *\n * A real, visible title (\"Invoice\", a level-2 heading) with the status chip in\n * its suffix and the invoice number as the identifier beneath it. The\n * Bill-from / Bill-to parties sit side by side once the header's own width\n * allows (the grid follows its container, not the viewport) and stack below\n * that. The dates and the amount due close the header: the dates as plain\n * facts, the amount due as the shared commerce ledger's total row. The section\n * gap separates the three bands; there is no rule between them.\n *\n * Strings overridable for i18n via the `strings` prop.\n */\nimport type { ReactNode } from 'react';\n\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { AdaptiveGrid, Stack } from '../../../base/structure';\nimport { MonoValue } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { invoiceStatusTone, type InvoiceStatus } from '../invoice-mini/types';\nimport { AmountRow } from '../summary-panel';\nimport { defaultInvoiceHeaderStrings, type InvoiceHeaderProps } from './types';\n\nfunction PartyBlock({\n\teyebrow,\n\tname,\n\tlocation,\n}: {\n\teyebrow: string;\n\tname: string;\n\tlocation?: ReactNode;\n}) {\n\treturn (\n\t\t<Stack gap=\"xs\" className=\"invoice-header--party\">\n\t\t\t<DisplayLabel tag=\"div\">{eyebrow}</DisplayLabel>\n\t\t\t<Text type=\"inherit\" weight=\"semibold\" lineHeight=\"snug\">\n\t\t\t\t{name}\n\t\t\t</Text>\n\t\t\t{!!location && (\n\t\t\t\t<Text tag=\"div\" size=\"xs\" type=\"secondary\" lineHeight=\"snug\">\n\t\t\t\t\t{location}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nexport function InvoiceHeader({\n\tinvoiceNumber,\n\tstatus,\n\tstatusTone,\n\tfrom,\n\tto,\n\tissuedDate,\n\tdueDate,\n\tamount,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: InvoiceHeaderProps) {\n\tconst strings = useStrings(defaultInvoiceHeaderStrings, stringsProp);\n\tconst labelByStatus: Record<InvoiceStatus, string> = {\n\t\tpaid: strings.paid,\n\t\tpending: strings.pending,\n\t\toverdue: strings.overdue,\n\t};\n\t// The tone follows the status the same way `InvoiceMini` resolves it, so\n\t// an overdue invoice can no longer inherit a green chip from a default.\n\tconst resolvedStatusTone = statusTone ?? invoiceStatusTone[status];\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={<Badge tone={resolvedStatusTone}>{labelByStatus[status]}</Badge>}\n\t\t\tdescription={<MonoValue type=\"inherit\" className=\"invoice-header--number tracking-wide\">{invoiceNumber}</MonoValue>}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-component=\"invoice-header\"\n\t\t\tdata-slot=\"invoice-header\"\n\t\t\tclassName={cn('invoice-header--component min-w-0', className)}\n\t\t>\n\t\t\t<AdaptiveGrid minColumnWidth=\"sm\" gap=\"xl\" className=\"invoice-header--parties\">\n\t\t\t\t<PartyBlock eyebrow={strings.billFrom} name={from.name} location={from.location} />\n\t\t\t\t<PartyBlock eyebrow={strings.billTo} name={to.name} location={to.location} />\n\t\t\t</AdaptiveGrid>\n\n\t\t\t{/* Dates are facts, not money: only the amount due is a ledger row. */}\n\t\t\t<Stack gap=\"sm\" className=\"invoice-header--amounts\">\n\t\t\t\t{!!issuedDate && (\n\t\t\t\t\t<InlineStat label={strings.issued} value={issuedDate} valueWeight=\"medium\" valueClassName=\"tabular-nums\" />\n\t\t\t\t)}\n\t\t\t\t{!!dueDate && (\n\t\t\t\t\t<InlineStat label={strings.due} value={dueDate} valueWeight=\"medium\" valueClassName=\"tabular-nums\" />\n\t\t\t\t)}\n\t\t\t\t<AmountRow label={strings.amountDue} amount={amount} total />\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nInvoiceHeader.displayName = 'InvoiceHeader';\n","import type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\n/** Default line-item shape used by the concise InvoiceLineItems mode. */\nexport interface InvoiceLineItem {\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\tqty: number;\n\tprice: number;\n\t/** Total number of records across all pages. */\n\ttotal: number;\n}\n\n/**\n * Per-column definition. Each column declares how to render its header label\n * and a row's cell. Generic over the row type so consumers can pass arbitrary\n * data without losing type safety.\n */\nexport interface InvoiceColumn<TItem = InvoiceLineItem> {\n\t/** Stable identity for this entry. */\n\tid: string;\n\theader: ReactNode;\n\t/** Tailwind class for the column's grid track (e.g. `'1fr'`, `'80px'`). */\n\twidth?: string;\n\talign?: 'left' | 'right' | 'center';\n\tcell: (item: TItem, index: number) => ReactNode;\n\t/** Class names appended to header cell. */\n\theaderClassName?: string;\n\t/** Class names appended to each row cell of this column. */\n\tcellClassName?: string;\n}\n\n/** A footer row (totals, taxes, etc.). Ordered as written. */\nexport interface InvoiceLineItemsFooterRow {\n\t/** Display label. */\n\tlabel: ReactNode;\n\tvalue: ReactNode;\n\t/** Emphasis for the row. `total` renders bold + thicker top spacing. */\n\temphasis?: 'normal' | 'total';\n}\n\nexport interface InvoiceLineItemsStrings {\n\titem: string;\n\tquantity: string;\n\tprice: string;\n\tsubtotal: string;\n\ttax: string;\n\t/** Total number of records across all pages. */\n\ttotal: string;\n}\n\nexport const defaultInvoiceLineItemsStrings: InvoiceLineItemsStrings = {\n\titem: 'Item',\n\tquantity: 'Qty',\n\tprice: 'Price',\n\tsubtotal: 'Subtotal',\n\ttax: 'Tax',\n\ttotal: 'Total',\n};\n\nexport interface InvoiceLineItemsProps<TItem = InvoiceLineItem> {\n\t/** Line items on the invoice. */\n\titems: TItem[];\n\t/** Optional custom columns. Defaults to Description / Qty / Price / Total. */\n\tcolumns?: InvoiceColumn<TItem>[];\n\t/** Optional custom footer rows. When omitted with the default columns, an\n\t * auto-computed subtotal / tax / total footer is used. */\n\tfooterRows?: InvoiceLineItemsFooterRow[];\n\t/** Tax ratio for the default footer (`0.2` means 20%). @default 0.2 */\n\ttaxRate?: number;\n\t/** ISO 4217 code for default monetary cells. Falls back to UIProvider. */\n\tcurrency?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceLineItemsStrings>;\n}\n","/**\n * InvoiceLineItems — flexible invoice line-item table.\n *\n * Generic over the row type. Pass custom `columns` and `footerRows` for any\n * shape of data. Without those, uses the concise default\n * `InvoiceLineItem` shape (description / qty / price / total) with an\n * auto-computed subtotal / tax / total footer.\n */\nimport type { ReactNode } from 'react';\n\nimport { DisplayLabel } from '../../../typography/display-label';\nimport { Text } from '../../../typography/text';\nimport { Separator } from '../../../base/display/separator';\nimport { Stack } from '../../../base/structure';\nimport { Money, Number as NumberValue, Percent, Value } from '../../../primitives';\nimport { useStrings } from '../../../../lib/strings';\nimport { useMoneyConfig } from '../../../../lib/ui-provider';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInvoiceLineItemsStrings,\n\ttype InvoiceColumn,\n\ttype InvoiceLineItem,\n\ttype InvoiceLineItemsFooterRow,\n\ttype InvoiceLineItemsProps,\n} from './types';\n\nconst wrapperGlass = 'border border-border shadow-sm';\n\nconst ALIGN_CLASS = {\n\tleft: 'text-left justify-start',\n\tright: 'text-right justify-end',\n\tcenter: 'text-center justify-center',\n} as const;\n\nfunction InvoiceCurrencyValue({\n\tamount,\n\tcurrency,\n\tweight = 'regular',\n}: {\n\tamount: number;\n\tcurrency: string;\n\tweight?: 'regular' | 'bold';\n}) {\n\treturn (\n\t\t<Money type=\"inherit\"\n\t\t\tamount={amount}\n\t\t\tcurrency={currency}\n\t\t\tminimumFractionDigits={2}\n\t\t\tmaximumFractionDigits={2}\n\t\t\tweight={weight}\n\t\t/>\n\t);\n}\n\nfunction buildDefaultColumns(\n\tcurrency: string,\n\tstrings: typeof defaultInvoiceLineItemsStrings,\n): InvoiceColumn<InvoiceLineItem>[] {\n\treturn [\n\t\t{\n\t\t\tid: 'description',\n\t\t\theader: strings.item,\n\t\t\twidth: 'minmax(0,1fr)',\n\t\t\tcell: (item) => <Text type=\"inherit\" className=\"break-words\">{item.description}</Text>,\n\t\t},\n\t\t{\n\t\t\tid: 'qty',\n\t\t\theader: strings.quantity,\n\t\t\twidth: '36px',\n\t\t\talign: 'center',\n\t\t\tcell: (item) => <NumberValue type=\"inherit\" value={item.qty} align=\"center\" />,\n\t\t},\n\t\t{\n\t\t\tid: 'price',\n\t\t\theader: strings.price,\n\t\t\twidth: '82px',\n\t\t\talign: 'right',\n\t\t\tcell: (item) => <InvoiceCurrencyValue amount={item.price} currency={currency} />,\n\t\t},\n\t\t{\n\t\t\tid: 'total',\n\t\t\theader: strings.total,\n\t\t\twidth: '82px',\n\t\t\talign: 'right',\n\t\t\tcell: (item) => <InvoiceCurrencyValue amount={item.total} currency={currency} />,\n\t\t},\n\t];\n}\n\nfunction buildDefaultFooterRows(\n\titems: InvoiceLineItem[],\n\ttaxRate: number,\n\tcurrency: string,\n\tstrings: typeof defaultInvoiceLineItemsStrings,\n): InvoiceLineItemsFooterRow[] {\n\tconst subtotal = items.reduce((s, i) => s + i.total, 0);\n\tconst tax = Math.round(subtotal * taxRate * 100) / 100;\n\tconst total = subtotal + tax;\n\treturn [\n\t\t{ label: strings.subtotal, value: <InvoiceCurrencyValue amount={subtotal} currency={currency} /> },\n\t\t{\n\t\t\tlabel: <>{strings.tax} (<Percent type=\"inherit\" value={taxRate} />)</>,\n\t\t\tvalue: <InvoiceCurrencyValue amount={tax} currency={currency} />,\n\t\t},\n\t\t{ label: strings.total, value: <InvoiceCurrencyValue amount={total} currency={currency} weight=\"bold\" />, emphasis: 'total' },\n\t];\n}\n\nexport function InvoiceLineItems<TItem = InvoiceLineItem>({\n\titems,\n\tcolumns,\n\tfooterRows,\n\ttaxRate = 0.2,\n\tcurrency,\n\tclassName,\n\tstrings: stringsProp,\n}: InvoiceLineItemsProps<TItem>) {\n\tconst strings = useStrings(defaultInvoiceLineItemsStrings, stringsProp);\n\tconst { defaultCurrency } = useMoneyConfig();\n\tconst resolvedCurrency = currency ?? defaultCurrency ?? '€';\n\n\t// Boundary casts: the default builders are intentionally non-generic and\n\t// only run in concise default mode where the consumer didn't pass\n\t// `columns`. In that mode the runtime row shape IS `InvoiceLineItem` —\n\t// the cast is the documented bridge between the generic `<TItem>` API\n\t// and the concrete default shape.\n\tconst resolvedColumns: InvoiceColumn<TItem>[] =\n\t\tcolumns ?? (buildDefaultColumns(resolvedCurrency, strings) as unknown as InvoiceColumn<TItem>[]);\n\n\tconst resolvedFooterRows: InvoiceLineItemsFooterRow[] = footerRows\n\t\t?? (columns\n\t\t\t? []\n\t\t\t: buildDefaultFooterRows(items as unknown as InvoiceLineItem[], taxRate, resolvedCurrency, strings));\n\n\tconst gridTemplate = columns ? resolvedColumns.map((c) => c.width ?? '1fr').join(' ') : undefined;\n\tconst defaultGrid = 'grid-cols-3 @lg/invoice-line-items:grid-cols-[minmax(0,1fr)_36px_82px_82px]';\n\n\treturn (\n\t\t<div className={cn('invoice-line-items--component', '@container/invoice-line-items box-border w-full min-w-0 max-w-full overflow-hidden rounded-radius bg-card text-card-foreground', wrapperGlass, className)}>\n\t\t\t{/* Header */}\n\t\t\t<div\n\t\t\t\tclassName={cn('invoice-line-items--header min-w-0 gap-space-md bg-muted/50 px-row-x py-row-y', columns ? 'grid' : ['hidden @lg/invoice-line-items:grid', defaultGrid])}\n\t\t\t\tstyle={{ gridTemplateColumns: gridTemplate }}\n\t\t\t>\n\t\t\t\t{resolvedColumns.map((col) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={col.id}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'flex min-w-0',\n\t\t\t\t\t\t\tALIGN_CLASS[col.align ?? 'left'],\n\t\t\t\t\t\t\tcol.headerClassName,\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DisplayLabel className=\"min-w-0 truncate\">\n\t\t\t\t\t\t\t{col.header}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</div>\n\n\t\t\t{/* Rows */}\n\t\t\t{items.map((item, i) => (\n\t\t\t\t<div\n\t\t\t\t\tkey={i}\n\t\t\t\t\tclassName={cn('invoice-line-items--row grid min-w-0 gap-space-md px-row-x py-row-y', !columns && defaultGrid, i % 2 === 1 && 'bg-muted/30')}\n\t\t\t\t\tstyle={{ gridTemplateColumns: gridTemplate }}\n\t\t\t\t>\n\t\t\t\t\t{resolvedColumns.map((col) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={col.id}\n\t\t\t\t\t\t\tdata-column={col.id}\n\t\t\t\t\t\t\tclassName={cn('min-w-0', columns ? ['flex items-center', ALIGN_CLASS[col.align ?? 'left']] : col.id === 'description' ? 'col-span-full @lg/invoice-line-items:col-span-1' : ['grid gap-space-xs', col.align === 'center' ? 'text-center justify-items-center' : 'text-right justify-items-end'], col.cellClassName)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!columns && col.id !== 'description' && <DisplayLabel className=\"@lg/invoice-line-items:hidden\">{col.header}</DisplayLabel>}\n\t\t\t\t\t\t\t{col.cell(item, i)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t))}\n\n\t\t\t{/* Footer */}\n\t\t\t{resolvedFooterRows.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<Separator />\n\t\t\t\t\t<div className=\"invoice-line-items--footer p-surface\">\n\t\t\t\t\t<Stack gap=\"sm\">\n\t\t\t\t\t\t{resolvedFooterRows.map((row, idx) => (\n\t\t\t\t\t\t\t<Stack\n\t\t\t\t\t\t\t\tkey={idx}\n\t\t\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\t\t\tjustify=\"between\"\n\t\t\t\t\t\t\t\talign=\"baseline\"\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\trow.emphasis === 'total' && 'pt-space-md',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\ttype={row.emphasis === 'total' ? 'inherit' : 'secondary'}\n\t\t\t\t\t\t\t\t\tweight={row.emphasis === 'total' ? 'bold' : 'regular'}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{row.label}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t{isSimpleText(row.value) ? (\n\t\t\t\t\t\t\t\t\t<Value type=\"inherit\" weight={row.emphasis === 'total' ? 'bold' : 'regular'}>\n\t\t\t\t\t\t\t\t\t\t{row.value}\n\t\t\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<div className=\"invoice-line-items--footer-value shrink-0\">{row.value}</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nInvoiceLineItems.displayName = 'InvoiceLineItems';\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n","import { ContentBlock } from '../../../base/display';\nimport { cn } from '../../../../lib/utils';\n\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport type { OrderTimelineProps } from './types';\n\nexport function OrderTimeline({\n\ttitle,\n\tdescription,\n\tevents,\n\tfooterText,\n\tclassName,\n}: OrderTimelineProps) {\n\tconst items: TimelineItem[] = events.map((event) => ({\n\t\tid: event.id,\n\t\ttitle: event.title,\n\t\tdescription: event.description,\n\t\ttimestamp: event.timestamp,\n\t\tstatus: event.status,\n\t}));\n\n\treturn (\n\t\t<ContentBlock\n\t\t\tdata-component=\"order-timeline\"\n\t\t\tdata-slot=\"order-timeline\"\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tfooterText={footerText}\n\t\t\tclassName={cn('order-timeline--component', className)}\n\t\t>\n\t\t\t<Timeline items={items} />\n\t\t</ContentBlock>\n\t);\n}\n\nOrderTimeline.displayName = 'OrderTimeline';\n","import { Value } from '../../../primitives';\nimport { cn } from '../../../../lib/utils';\n\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport type { PaymentTimelineProps } from './types';\n\nexport function PaymentTimeline({ events, className }: PaymentTimelineProps) {\n\tconst items: TimelineItem[] = events.map((event, index) => ({\n\t\tid: `${event.label}-${String(index)}`,\n\t\ttitle: event.label,\n\t\tdescription: event.date,\n\t\ticon: event.icon,\n\t\tstatus: event.done ? 'success' : 'pending',\n\t\tchildren: event.amount ? (\n\t\t\t// An event amount is an ordinary figure, not a signed delta: foreground.\n\t\t\t<Value type=\"inherit\" weight=\"medium\" className=\"tabular-nums\">\n\t\t\t\t{event.amount}\n\t\t\t</Value>\n\t\t) : undefined,\n\t}));\n\n\treturn (\n\t\t<div\n\t\t\tdata-component=\"payment-timeline\"\n\t\t\tdata-slot=\"payment-timeline\"\n\t\t\tclassName={cn('payment-timeline--component min-w-0', className)}\n\t\t>\n\t\t\t<Timeline items={items} dotSize=\"lg\" />\n\t\t</div>\n\t);\n}\n\nPaymentTimeline.displayName = 'PaymentTimeline';\n","import type { SelectOption } from '../../../base/choice-inputs';\nimport type { WeightUnit } from '../../../base/forms-numeric';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type InventoryPolicy = 'deny' | 'continue';\nexport type InventoryStatus = 'in_stock' | 'low_stock' | 'out_of_stock' | 'untracked';\n\nexport interface InventorySectionValue {\n\tsku?: string;\n\tbarcode?: string;\n\ttrackQuantity?: boolean;\n\tavailable?: string;\n\tcommitted?: string;\n\tincoming?: string;\n\tlowStockThreshold?: string;\n\tinventoryPolicy?: InventoryPolicy;\n\tlocationId?: string;\n\tbinLocation?: string;\n\trequiresShipping?: boolean;\n\tweight?: string;\n\tweightUnit?: WeightUnit;\n\tcountryOfOrigin?: string;\n\thsCode?: string;\n\ttags?: string[];\n}\n\nexport type InventorySectionField = keyof InventorySectionValue;\n\nexport type InventorySectionName =\n\t| 'summary'\n\t| 'identity'\n\t| 'tracking'\n\t| 'location'\n\t| 'shipping'\n\t| 'customs'\n\t| 'tags';\n\nexport interface InventorySectionChange {\n\tfield: InventorySectionField;\n\tvalue: InventorySectionValue[InventorySectionField];\n\tpreviousValue: InventorySectionValue[InventorySectionField];\n}\n\nexport interface InventorySectionMetric {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display label. */\n\tlabel: string;\n\tvalue: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/**\n\t * Semantic tone of the entry. Not rendered by the summary: stats are plain\n\t * and the title badge carries the stock state. Kept for type compatibility.\n\t */\n\ttone?: 'default' | 'success' | 'warning' | 'error' | 'info';\n}\n\nexport interface InventorySectionStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\tstatus: Record<InventoryStatus, string>;\n\tsections: Record<Exclude<InventorySectionName, 'summary'>, string>;\n\tfields: Record<InventorySectionField, string>;\n\tplaceholders: Partial<Record<InventorySectionField, string>>;\n\thints: Partial<Record<InventorySectionField, string>>;\n\t/** Overflow menu for the surface as a whole. */\n\tactions: {\n\t\tgenerateSku: string;\n\t\trestock: string;\n\t};\n\tpolicyOptions: Record<InventoryPolicy, {\n\t\tlabel: string;\n\t\tdescription: string;\n\t}>;\n\tsummary: {\n\t\tavailable: string;\n\t\tcommitted: string;\n\t\tincoming: string;\n\t\tthreshold: string;\n\t\tuntracked: string;\n\t};\n\ttagInput: {\n\t\tplaceholder: string;\n\t\temptyRecommendations: string;\n\t\tclearAll: string;\n\t\tsummary: (current: number, max: number) => string;\n\t};\n}\n\nexport const defaultInventorySectionStrings: InventorySectionStrings = {\n\ttitle: 'Inventory',\n\tdescription: 'Manage stock tracking, availability, fulfillment, and compliance details.',\n\tstatus: {\n\t\tin_stock: 'In stock',\n\t\tlow_stock: 'Low stock',\n\t\tout_of_stock: 'Out of stock',\n\t\tuntracked: 'Not tracked',\n\t},\n\tsections: {\n\t\tidentity: 'Identifiers',\n\t\ttracking: 'Stock tracking',\n\t\tlocation: 'Location',\n\t\tshipping: 'Shipping',\n\t\tcustoms: 'Customs',\n\t\ttags: 'Tags',\n\t},\n\tfields: {\n\t\tsku: 'SKU',\n\t\tbarcode: 'Barcode',\n\t\ttrackQuantity: 'Track quantity',\n\t\tavailable: 'Available',\n\t\tcommitted: 'Committed',\n\t\tincoming: 'Incoming',\n\t\tlowStockThreshold: 'Low-stock threshold',\n\t\tinventoryPolicy: 'When sold out',\n\t\tlocationId: 'Stock location',\n\t\tbinLocation: 'Bin / shelf',\n\t\trequiresShipping: 'Requires shipping',\n\t\tweight: 'Weight',\n\t\tweightUnit: 'Weight unit',\n\t\tcountryOfOrigin: 'Country of origin',\n\t\thsCode: 'HS code',\n\t\ttags: 'Inventory tags',\n\t},\n\tplaceholders: {\n\t\tsku: 'BAL-750-CL',\n\t\tbarcode: 'Scan or enter barcode',\n\t\tavailable: '0',\n\t\tcommitted: '0',\n\t\tincoming: '0',\n\t\tlowStockThreshold: '5',\n\t\tlocationId: 'Select location',\n\t\tbinLocation: 'Aisle / shelf / bin',\n\t\tweight: '0.00',\n\t\tcountryOfOrigin: 'Country code or name',\n\t\thsCode: 'e.g. 2204.21',\n\t\ttags: 'Add tag...',\n\t},\n\thints: {\n\t\tsku: 'Internal stock keeping unit.',\n\t\tbarcode: 'GTIN, UPC, EAN, ISBN, or internal scan code.',\n\t\tavailable: 'Units currently sellable at this location.',\n\t\tcommitted: 'Units already reserved by open orders.',\n\t\tincoming: 'Units expected from transfers, suppliers, or production.',\n\t\tlowStockThreshold: 'Used for low-stock warnings.',\n\t\tinventoryPolicy: 'Choose whether checkout should block when inventory reaches zero.',\n\t\tlocationId: 'Where this inventory is stocked or fulfilled from.',\n\t\tbinLocation: 'Optional warehouse shelf, bay, or bin reference.',\n\t\tweight: 'Used for shipping rates and fulfillment labels.',\n\t\tcountryOfOrigin: 'Required for international customs in many markets.',\n\t\thsCode: 'Harmonized System tariff code for customs.',\n\t\ttags: 'Optional operational labels such as preorder, seasonal, or batch codes.',\n\t},\n\tactions: {\n\t\tgenerateSku: 'Generate SKU',\n\t\trestock: 'Restock',\n\t},\n\tpolicyOptions: {\n\t\tdeny: {\n\t\t\tlabel: 'Stop selling',\n\t\t\tdescription: 'Block checkout when available inventory reaches zero.',\n\t\t},\n\t\tcontinue: {\n\t\t\tlabel: 'Continue selling',\n\t\t\tdescription: 'Allow backorders or made-to-order fulfillment.',\n\t\t},\n\t},\n\tsummary: {\n\t\tavailable: 'Available',\n\t\tcommitted: 'Committed',\n\t\tincoming: 'Incoming',\n\t\tthreshold: 'Low-stock at',\n\t\tuntracked: 'Inventory is not tracked for this product.',\n\t},\n\ttagInput: {\n\t\tplaceholder: 'Add inventory tag...',\n\t\temptyRecommendations: 'No matching tags.',\n\t\tclearAll: 'Clear tags',\n\t\tsummary: (current, max) => `${current} / ${max} tags`,\n\t},\n};\n\nexport interface InventorySectionCardProps {\n\t/** Current field values for every inventory section. Controlled. */\n\tvalue: InventorySectionValue;\n\t/** Fired with the next value. */\n\tonValueChange?: (value: InventorySectionValue, change: InventorySectionChange) => void;\n\t/** Validation messages keyed by field, rendered under the matching control. */\n\terrors?: Partial<Record<InventorySectionField, string>>;\n\t/** Renders the entry as unselectable. */\n\tdisabled?: boolean;\n\t/** Renders every field as read-only text instead of an editable control. */\n\treadOnly?: boolean;\n\t/** Which sections are shown. Omitted sections default to visible. */\n\tvisibleSections?: Partial<Record<InventorySectionName, boolean>>;\n\t/** Which individual fields are shown. Omitted fields default to visible. */\n\tvisibleFields?: Partial<Record<InventorySectionField, boolean>>;\n\t/** Choices for the stock-location select. */\n\tlocationOptions?: SelectOption[];\n\t/** Choices for the country-of-origin select. */\n\tcountryOptions?: SelectOption[];\n\t/** Suggested tags offered beneath the tag input. */\n\ttagRecommendations?: string[];\n\t/** Caps how many tags may be added. */\n\tmaxTags?: number;\n\tonGenerateSku?: (value: InventorySectionValue) => string | void;\n\tonRestock?: (value: InventorySectionValue) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InventorySectionStrings>;\n}\n","/**\n * InventorySectionCard — controlled commerce inventory form card.\n *\n * The component owns no persistence and performs no routing. Consumers pass a\n * `value` object, receive field-level `onValueChange` updates, and decide how to\n * submit or validate. Section and field visibility props let apps reuse the\n * same surface for physical products, digital products, variants, and location\n * level inventory without forking the component.\n */\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { EMPTY } from '../../../../lib/format';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { CardRadioGroup, Select, ToggleField } from '../../../base/choice-inputs';\nimport { FormField } from '../../../base/forms';\nimport { Input } from '../../../base/text-inputs';\nimport { TagsInput } from '../../../base/value-inputs';\nimport { DecimalInput, WeightInput } from '../../../base/forms-numeric';\nimport { Grid, Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInventorySectionStrings,\n\ttype InventoryPolicy,\n\ttype InventorySectionCardProps,\n\ttype InventorySectionField,\n\ttype InventorySectionMetric,\n\ttype InventorySectionName,\n\ttype InventorySectionValue,\n\ttype InventoryStatus,\n} from './types';\n\nconst STATUS_VARIANT: Record<InventoryStatus, BadgeTone> = {\n\tin_stock: 'success',\n\tlow_stock: 'warning',\n\tout_of_stock: 'destructive',\n\tuntracked: 'secondary',\n};\n\nfunction parseQuantity(value?: string): number | undefined {\n\tif (value === undefined || value.trim() === '') return undefined;\n\tconst parsed = Number(value);\n\treturn Number.isFinite(parsed) ? parsed : undefined;\n}\n\nfunction getInventoryStatus(value: InventorySectionValue): InventoryStatus {\n\tconst isTracked = value.trackQuantity ?? true;\n\tif (!isTracked) return 'untracked';\n\n\tconst available = parseQuantity(value.available) ?? 0;\n\tif (available <= 0) return 'out_of_stock';\n\n\tconst threshold = parseQuantity(value.lowStockThreshold);\n\tif (threshold !== undefined && available <= threshold) return 'low_stock';\n\n\treturn 'in_stock';\n}\n\nfunction SectionHeading({ children, className }: { children: string; className?: string }) {\n\treturn (\n\t\t<Text type=\"inherit\" weight=\"semibold\" className={cn('inventory-section-card--section-title', className)}>\n\t\t\t{children}\n\t\t</Text>\n\t);\n}\n\n// A plain stat: no tile and no tint. Stock state is stated once, by the\n// status badge beside the title.\nfunction SummaryMetric({ metric }: { metric: InventorySectionMetric }) {\n\treturn (\n\t\t<div className=\"inventory-section-card--metric min-w-0\">\n\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t{metric.label}\n\t\t\t</Text>\n\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"tabular-nums\">\n\t\t\t\t{metric.value}\n\t\t\t</Value>\n\t\t\t{!!metric.description && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\" lineHeight=\"snug\">\n\t\t\t\t\t{metric.description}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport function InventorySectionCard({\n\tvalue,\n\tonValueChange,\n\terrors,\n\tdisabled = false,\n\treadOnly = false,\n\tvisibleSections,\n\tvisibleFields,\n\tlocationOptions = [],\n\tcountryOptions = [],\n\ttagRecommendations,\n\tmaxTags,\n\tonGenerateSku,\n\tonRestock,\n\tclassName,\n\tstrings: stringsProp,\n}: InventorySectionCardProps) {\n\tconst strings = useStrings(defaultInventorySectionStrings, stringsProp);\n\tconst status = getInventoryStatus(value);\n\tconst isDisabled = disabled || readOnly;\n\tconst isTracked = value.trackQuantity ?? true;\n\tconst requiresShipping = value.requiresShipping ?? true;\n\tconst shippingFieldsDisabled = isDisabled || !requiresShipping;\n\n\tconst isSectionVisible = (section: InventorySectionName) => visibleSections?.[section] !== false;\n\tconst isFieldVisible = (field: InventorySectionField) => visibleFields?.[field] !== false;\n\n\tconst updateField = <TField extends InventorySectionField>(\n\t\tfield: TField,\n\t\tnextValue: InventorySectionValue[TField],\n\t) => {\n\t\tconst previousValue = value[field];\n\t\tconst next = {\n\t\t\t...value,\n\t\t\t[field]: nextValue,\n\t\t};\n\n\t\tonValueChange?.(next, {\n\t\t\tfield,\n\t\t\tvalue: nextValue,\n\t\t\tpreviousValue,\n\t\t});\n\t};\n\n\tconst handleGenerateSku = () => {\n\t\tif (!onGenerateSku || isDisabled) return;\n\t\tconst generatedSku = onGenerateSku(value);\n\t\tif (typeof generatedSku === 'string') {\n\t\t\tupdateField('sku', generatedSku);\n\t\t}\n\t};\n\n\tconst metrics: InventorySectionMetric[] = [\n\t\t{\n\t\t\tid: 'available',\n\t\t\tlabel: strings.summary.available,\n\t\t\tvalue: isTracked ? value.available || '0' : EMPTY,\n\t\t\t// `summary.threshold` is the *label* of the low-stock tile, not a\n\t\t\t// sentence — using it here rendered a dangling \"Low-stock at\" under\n\t\t\t// the available count with no number attached, duplicating a tile\n\t\t\t// that already carries both. Only the untracked case needs a caption,\n\t\t\t// to explain why the value reads \"-\".\n\t\t\tdescription: isTracked ? undefined : strings.summary.untracked,\n\t\t},\n\t\t{\n\t\t\tid: 'committed',\n\t\t\tlabel: strings.summary.committed,\n\t\t\tvalue: value.committed || '0',\n\t\t},\n\t\t{\n\t\t\tid: 'incoming',\n\t\t\tlabel: strings.summary.incoming,\n\t\t\tvalue: value.incoming || '0',\n\t\t},\n\t\t{\n\t\t\tid: 'threshold',\n\t\t\tlabel: strings.summary.threshold,\n\t\t\tvalue: value.lowStockThreshold || '-',\n\t\t},\n\t];\n\n\treturn (\n\t\t// Card (flat, no inset) instead of the deprecated ContentBlock adapter so\n\t\t// the region gap can replace the old header rule: the header keeps the\n\t\t// framed-card distance from its body, and sections sit a step further\n\t\t// apart than the rows inside them.\n\t\t<Card\n\t\t\tsurface=\"flat\"\n\t\t\tpadding=\"none\"\n\t\t\tgap=\"xl\"\n\t\t\ttitle={strings.title}\n\t\t\tdescription={strings.description}\n\t\t\ttitleSuffix={<Badge tone={STATUS_VARIANT[status]}>{strings.status[status]}</Badge>}\n\t\t\theaderAction={\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\tclassName=\"w-full @md/inventory-section-card:w-auto @md/inventory-section-card:justify-end\"\n\t\t\t\t>\n\t\t\t\t\t{!!onGenerateSku && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={handleGenerateSku}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.actions.generateSku}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!onRestock && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={() => onRestock(value)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.actions.restock}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t}\n\t\t\tclassName={cn('inventory-section-card--component @container/inventory-section-card w-full', className)}\n\t\t\tcontentGap=\"2xl\"\n\t\t>\n\t\t\t{!!isSectionVisible('summary') && (\n\t\t\t\t<div className=\"inventory-section-card--summary grid min-w-0 grid-cols-1 gap-space-xl @md/inventory-section-card:grid-cols-2 @3xl/inventory-section-card:grid-cols-4\">\n\t\t\t\t\t{metrics.map((metric) => (\n\t\t\t\t\t\t<SummaryMetric key={metric.id} metric={metric} />\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('identity') && (\n\t\t\t\t<Stack render={<section />} gap=\"md\" className=\"inventory-section-card--identity\">\n\t\t\t\t\t<SectionHeading>{strings.sections.identity}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('sku') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.sku} error={errors?.sku} hint={strings.hints.sku}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.sku ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('sku', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.sku}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.sku}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('barcode') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.barcode} error={errors?.barcode} hint={strings.hints.barcode}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.barcode ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('barcode', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.barcode}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.barcode}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('tracking') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--tracking\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.tracking}</SectionHeading>\n\t\t\t\t\t{!!isFieldVisible('trackQuantity') && (\n\t\t\t\t\t\t<ToggleField\n\t\t\t\t\t\t\tlabel={strings.fields.trackQuantity}\n\t\t\t\t\t\t\tdescription={strings.hints.available}\n\t\t\t\t\t\t\tvalue={isTracked}\n\t\t\t\t\t\t\tonValueChange={(checked) => updateField('trackQuantity', checked)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<div className=\"inventory-section-card--tracking-grid grid min-w-0 grid-cols-1 gap-space-xl @md/inventory-section-card:grid-cols-2 @3xl/inventory-section-card:grid-cols-4\">\n\t\t\t\t\t\t{!!isFieldVisible('available') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.available} error={errors?.available} hint={strings.hints.available}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.available ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('available', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.available}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.available}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('committed') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.committed} error={errors?.committed} hint={strings.hints.committed}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.committed ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('committed', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.committed}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.committed}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('incoming') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.incoming} error={errors?.incoming} hint={strings.hints.incoming}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.incoming ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('incoming', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.incoming}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.incoming}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('lowStockThreshold') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.lowStockThreshold}\n\t\t\t\t\t\t\t\terror={errors?.lowStockThreshold}\n\t\t\t\t\t\t\t\thint={strings.hints.lowStockThreshold}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.lowStockThreshold ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('lowStockThreshold', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.lowStockThreshold}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.lowStockThreshold}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!isFieldVisible('inventoryPolicy') && (\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tlabel={strings.fields.inventoryPolicy}\n\t\t\t\t\t\t\terror={errors?.inventoryPolicy}\n\t\t\t\t\t\t\thint={strings.hints.inventoryPolicy}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CardRadioGroup\n\t\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\t\tvalue={value.inventoryPolicy ?? 'deny'}\n\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('inventoryPolicy', nextValue as InventoryPolicy)}\n\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\tinvalid={!!errors?.inventoryPolicy}\n\t\t\t\t\t\t\t\toptions={[\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvalue: 'deny',\n\t\t\t\t\t\t\t\t\t\tlabel: strings.policyOptions.deny.label,\n\t\t\t\t\t\t\t\t\t\tdescription: strings.policyOptions.deny.description,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvalue: 'continue',\n\t\t\t\t\t\t\t\t\t\tlabel: strings.policyOptions.continue.label,\n\t\t\t\t\t\t\t\t\t\tdescription: strings.policyOptions.continue.description,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FormField>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('location') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--location\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.location}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('locationId') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.locationId} error={errors?.locationId} hint={strings.hints.locationId}>\n\t\t\t\t\t\t\t\t{locationOptions.length > 0 ? (\n\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\tvalue={value.locationId ?? null}\n\t\t\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('locationId', nextValue)}\n\t\t\t\t\t\t\t\t\t\toptions={locationOptions}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.locationId}\n\t\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.locationId}\n\t\t\t\t\t\t\t\t\t\tallowClear\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\tvalue={value.locationId ?? ''}\n\t\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('locationId', event.target.value)}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.locationId}\n\t\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.locationId}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('binLocation') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.binLocation}\n\t\t\t\t\t\t\t\terror={errors?.binLocation}\n\t\t\t\t\t\t\t\thint={strings.hints.binLocation}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.binLocation ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('binLocation', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.binLocation}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.binLocation}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('shipping') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--shipping\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.shipping}</SectionHeading>\n\t\t\t\t\t{!!isFieldVisible('requiresShipping') && (\n\t\t\t\t\t\t<ToggleField\n\t\t\t\t\t\t\tlabel={strings.fields.requiresShipping}\n\t\t\t\t\t\t\tdescription={strings.hints.weight}\n\t\t\t\t\t\t\tvalue={requiresShipping}\n\t\t\t\t\t\t\tonValueChange={(checked) => updateField('requiresShipping', checked)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!isFieldVisible('weight') && (\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tlabel={strings.fields.weight}\n\t\t\t\t\t\t\terror={errors?.weight ?? errors?.weightUnit}\n\t\t\t\t\t\t\thint={strings.hints.weight}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WeightInput\n\t\t\t\t\t\t\t\tvalue={value.weight ?? ''}\n\t\t\t\t\t\t\t\tunit={value.weightUnit ?? 'kg'}\n\t\t\t\t\t\t\t\tonChange={(event) => updateField('weight', event.target.value)}\n\t\t\t\t\t\t\t\tonUnitChange={(unit) => updateField('weightUnit', unit)}\n\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\tinvalid={!!errors?.weight || !!errors?.weightUnit}\n\t\t\t\t\t\t\t\tdecimalPlaces={2}\n\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FormField>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('customs') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--customs\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.customs}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('countryOfOrigin') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.countryOfOrigin}\n\t\t\t\t\t\t\t\terror={errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\thint={strings.hints.countryOfOrigin}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{countryOptions.length > 0 ? (\n\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\tvalue={value.countryOfOrigin ?? null}\n\t\t\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('countryOfOrigin', nextValue)}\n\t\t\t\t\t\t\t\t\t\toptions={countryOptions}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tallowClear\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\tvalue={value.countryOfOrigin ?? ''}\n\t\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('countryOfOrigin', event.target.value)}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('hsCode') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.hsCode} error={errors?.hsCode} hint={strings.hints.hsCode}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.hsCode ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('hsCode', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.hsCode}\n\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.hsCode}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('tags') && !!isFieldVisible('tags') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--tags\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.tags}</SectionHeading>\n\t\t\t\t\t<FormField label={strings.fields.tags} error={errors?.tags} hint={strings.hints.tags}>\n\t\t\t\t\t\t<TagsInput\n\t\t\t\t\t\t\tvalue={value.tags ?? []}\n\t\t\t\t\t\t\tonValueChange={(nextTags) => updateField('tags', nextTags)}\n\t\t\t\t\t\t\trecommendations={tagRecommendations}\n\t\t\t\t\t\t\tmaxTags={maxTags}\n\t\t\t\t\t\t\tshowMaxTags={maxTags !== undefined}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\tinvalid={!!errors?.tags}\n\t\t\t\t\t\t\tstrings={strings.tagInput}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FormField>\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nInventorySectionCard.displayName = 'InventorySectionCard';\n","/**\n * The order vocabularies the order surfaces share. Goods and money move\n * independently (\"refunded, still unfulfilled\"), so an order carries two status\n * axes. Each union has exactly one tone map, and no order surface takes a tone\n * prop that could disagree with its status.\n *\n * Primary stays off every status chip: it is the one main command. A state the\n * order is moving through reads `info`; a starting state that needs attention\n * reads `warning`, not `destructive`.\n */\nimport type { BadgeTone } from '../../../base/badge';\n\n/** Where the goods are. */\nexport type FulfillmentStatus =\n\t| 'unfulfilled'\n\t| 'partiallyFulfilled'\n\t| 'fulfilled'\n\t| 'scheduled'\n\t| 'onHold'\n\t| 'cancelled';\n\nexport const fulfillmentStatusTone: Record<FulfillmentStatus, BadgeTone> = {\n\t// Warning, not destructive: unfulfilled is the starting state, not a failure.\n\tunfulfilled: 'warning',\n\tpartiallyFulfilled: 'warning',\n\tfulfilled: 'success',\n\tscheduled: 'info',\n\tonHold: 'neutral',\n\tcancelled: 'destructive',\n};\n\n/** Where the money is. */\nexport type PaymentStatus =\n\t| 'pending'\n\t| 'authorized'\n\t| 'paid'\n\t| 'partiallyRefunded'\n\t| 'refunded'\n\t| 'voided';\n\nexport const paymentStatusTone: Record<PaymentStatus, BadgeTone> = {\n\tpending: 'warning',\n\t// Authorized is money promised, not money taken: information, not success.\n\tauthorized: 'info',\n\tpaid: 'success',\n\tpartiallyRefunded: 'neutral',\n\trefunded: 'neutral',\n\tvoided: 'neutral',\n};\n\n/** What was attempted against the payment method. */\nexport type TransactionKind =\n\t| 'authorization'\n\t| 'capture'\n\t| 'sale'\n\t| 'refund'\n\t| 'void'\n\t| 'chargeback';\n\n/** Whether the attempt worked. */\nexport type TransactionStatus = 'success' | 'pending' | 'failure';\n\nexport const transactionStatusTone: Record<TransactionStatus, BadgeTone> = {\n\tsuccess: 'success',\n\tpending: 'warning',\n\tfailure: 'destructive',\n};\n\n/** Kinds that take money out of the merchant. They set the sign; callers pass the magnitude. */\nexport const outgoingTransactionKinds: ReadonlySet<TransactionKind> = new Set<TransactionKind>([\n\t'refund',\n\t'void',\n\t'chargeback',\n]);\n\n/** A postal address as an order carries it. `AddressCard` keeps its own flat props. */\nexport interface OrderAddress {\n\t/** Recipient. */\n\tname?: string;\n\t/** Street address. */\n\tline1: string;\n\t/** Apartment, suite, or unit. */\n\tline2?: string;\n\t/** City or town. */\n\tcity: string;\n\t/** State, province, or region. */\n\tregion?: string;\n\t/** Postal or ZIP code. */\n\tpostalCode?: string;\n\t/** Country name or code. */\n\tcountry: string;\n\t/** Contact number for the delivery. */\n\tphone?: string;\n}\n\n/** The words for both status axes. Tones stay derived from the status. */\nexport interface OrderStatusVocabulary {\n\t/** Label for each `FulfillmentStatus`. */\n\tfulfillment: Record<FulfillmentStatus, string>;\n\t/** Label for each `PaymentStatus`. */\n\tpayment: Record<PaymentStatus, string>;\n}\n\nexport const defaultOrderStatusVocabulary: OrderStatusVocabulary = {\n\tfulfillment: {\n\t\tunfulfilled: 'Unfulfilled',\n\t\tpartiallyFulfilled: 'Partially fulfilled',\n\t\tfulfilled: 'Fulfilled',\n\t\tscheduled: 'Scheduled',\n\t\tonHold: 'On hold',\n\t\tcancelled: 'Cancelled',\n\t},\n\tpayment: {\n\t\tpending: 'Pending',\n\t\tauthorized: 'Authorized',\n\t\tpaid: 'Paid',\n\t\tpartiallyRefunded: 'Partially refunded',\n\t\trefunded: 'Refunded',\n\t\tvoided: 'Voided',\n\t},\n};\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { ActionMenuAction, ActionMenuProps } from '../../../base/action-menu';\nimport type { HeadingTag } from '../../../typography';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport {\n\tdefaultOrderStatusVocabulary,\n\ttype FulfillmentStatus,\n\ttype OrderStatusVocabulary,\n\ttype PaymentStatus,\n} from '../shared/order-status';\n\nexport interface OrderHeaderStrings extends OrderStatusVocabulary {\n\t/** Writes the order's own reference: \"#1036\". */\n\tformatOrderNumber: (orderNumber: string) => string;\n\t/** Joins when the order was placed to where it came from. */\n\tformatOrigin: (placedAt: string, source: string) => string;\n\t/** Accessible name of the actions menu trigger. */\n\tmoreActions: string;\n}\n\nexport const defaultOrderHeaderStrings: OrderHeaderStrings = {\n\t...defaultOrderStatusVocabulary,\n\tformatOrderNumber: (orderNumber) => `#${orderNumber}`,\n\tformatOrigin: (placedAt, source) => `${placedAt} from ${source}`,\n\tmoreActions: 'More actions',\n};\n\nexport interface OrderHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {\n\t/** The order's reference, without the leading sign `formatOrderNumber` adds. */\n\torderNumber: string;\n\t/** Where the goods are. Independent of payment. */\n\tfulfillmentStatus?: FulfillmentStatus;\n\t/**\n\t * Where the money is. Both statuses, one, or neither read correctly: an\n\t * order with nothing to ship has no fulfillment state to state.\n\t */\n\tpaymentStatus?: PaymentStatus;\n\t/** Already formatted. */\n\tplacedAt?: string;\n\t/** Where the order came from: a channel, an app, an import. */\n\tsource?: string;\n\t/** Order commands, offered from one actions menu at the end of the title row. */\n\tactions?: readonly ActionMenuAction[];\n\t/** Renders `href` actions through the consumer's router. */\n\trenderLink?: ActionMenuProps['renderLink'];\n\t/** Heading level of the order number. Defaults to `h1`: the order is the page's subject. */\n\theadingTag?: HeadingTag;\n\t/** Overrides this header's own copy, including the status words. */\n\tstrings?: StringsProp<OrderHeaderStrings>;\n}\n","/**\n * OrderHeader — the order page's title row: the order number as the page\n * heading, a status chip for each axis the order moves on, and the order's\n * commands in one actions menu, with where and when the order was placed\n * beneath.\n *\n * Goods and money move independently (\"refunded, still unfulfilled\"), so the\n * payment and fulfillment chips are separate, and each renders only when its\n * status is given. Their words come from `strings`; their tones are derived\n * from the status and cannot disagree with it.\n */\nimport { ActionMenu } from '../../../base/action-menu';\nimport { Badge } from '../../../base/badge';\nimport { Stack } from '../../../base/structure';\nimport { Heading, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { fulfillmentStatusTone, paymentStatusTone } from '../shared/order-status';\nimport { defaultOrderHeaderStrings, type OrderHeaderProps } from './types';\n\nexport function OrderHeader({\n\torderNumber,\n\tfulfillmentStatus,\n\tpaymentStatus,\n\tplacedAt,\n\tsource,\n\tactions,\n\trenderLink,\n\theadingTag = 'h1',\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderHeaderProps) {\n\tconst strings = useStrings(defaultOrderHeaderStrings, stringsProp);\n\n\t// Date, source, both or neither.\n\tconst origin =\n\t\tplacedAt && source\n\t\t\t? strings.formatOrigin(placedAt, source)\n\t\t\t: placedAt || source || undefined;\n\n\treturn (\n\t\t<Stack\n\t\t\t{...props}\n\t\t\tgap=\"xs\"\n\t\t\tdata-slot=\"order-header\"\n\t\t\tclassName={cn('order-header--component min-w-0', className)}\n\t\t>\n\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"center\" wrap={false} className=\"order-header--title-row min-w-0\">\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"center\" wrap className=\"order-header--title-line min-w-0 flex-1\">\n\t\t\t\t\t<Heading tag={headingTag} size=\"lg\" className=\"order-header--number text-inherit\">\n\t\t\t\t\t\t{strings.formatOrderNumber(orderNumber)}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!paymentStatus && (\n\t\t\t\t\t\t<Badge tone={paymentStatusTone[paymentStatus]} data-axis=\"payment\" className=\"order-header--payment\">\n\t\t\t\t\t\t\t{strings.payment[paymentStatus]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!fulfillmentStatus && (\n\t\t\t\t\t\t<Badge tone={fulfillmentStatusTone[fulfillmentStatus]} data-axis=\"fulfillment\" className=\"order-header--fulfillment\">\n\t\t\t\t\t\t\t{strings.fulfillment[fulfillmentStatus]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\n\t\t\t\t{!!actions?.length && (\n\t\t\t\t\t<ActionMenu actions={actions} srText={strings.moreActions} renderLink={renderLink} />\n\t\t\t\t)}\n\t\t\t</Stack>\n\n\t\t\t{!!origin && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"order-header--origin\">\n\t\t\t\t\t{origin}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nOrderHeader.displayName = 'OrderHeader';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { StringsProp } from '../../../../lib/strings';\n\n/** A per-line fact the kit did not anticipate: a gift message, an engraving, an interval. */\nexport interface OrderLineProperty {\n\t/** What the fact is. */\n\tlabel: ReactNode;\n\t/** The fact itself. */\n\tvalue: ReactNode;\n}\n\n/** One line of ordered goods, as data. */\nexport interface OrderLine {\n\t/** Stable identity for this line. */\n\tid: string;\n\t/** Product name. */\n\ttitle: string;\n\t/** The chosen option: \"OS / blue\". */\n\tvariantTitle?: string;\n\t/** Stock-keeping unit, shown as an identifier. */\n\tsku?: string;\n\t/** Product image. Without one, or when it fails to load, the line's initials show. */\n\timageSrc?: string;\n\t/** Alternative text for the image. Defaults to the title. */\n\timageAlt?: string;\n\t/** Already formatted, including its currency. */\n\tunitPrice: string;\n\t/** Units ordered. */\n\tquantity: number;\n\t/**\n\t * Already formatted. Passed, never multiplied: discounts, tax and proration\n\t * break `unitPrice × quantity`.\n\t */\n\ttotal: string;\n\t/** Per-line custom data, rendered as label/value pairs under the title. */\n\tproperties?: OrderLineProperty[];\n\t/** Whatever `properties` cannot express, under them. */\n\tchildren?: ReactNode;\n}\n\nexport interface OrderLineItemStrings {\n\t/** Reads the price column aloud: \"€50.00 × 1\". */\n\tformatUnitPrice: (unitPrice: string, quantity: number) => string;\n}\n\nexport const defaultOrderLineItemStrings: OrderLineItemStrings = {\n\tformatUnitPrice: (unitPrice, quantity) => `${unitPrice} × ${quantity}`,\n};\n\n/* `id` and `title` are the line's, not the element's DOM id and tooltip. */\nexport interface OrderLineItemProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'id' | 'title'>,\n\t\tOrderLine {\n\t/** Overrides this row's own copy. */\n\tstrings?: StringsProp<OrderLineItemStrings>;\n}\n","/**\n * OrderLineItem — one row of ordered goods: thumbnail, title, variant, SKU,\n * per-line properties, `unit × quantity`, and the line total.\n *\n * Shared by fulfillment groups, refunds and packing slips. It never computes\n * the total: discounts, tax and proration break `unit × quantity`, so the\n * caller passes it. The row adapts to its own width, not the viewport: below\n * the container `md` step the price and total sit under the text, and from it\n * they take their own columns. The price column is read aloud as one phrase\n * (`strings.formatUnitPrice`) while its visible parts are hidden from\n * assistive technology.\n */\nimport { Badge } from '../../../base/badge';\nimport { VisuallyHidden } from '../../../base/display';\nimport { ItemMedia } from '../../../base/item';\nimport { MetadataList } from '../../../base/metadata-list';\nimport { Stack } from '../../../base/structure';\nimport { MonoValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { LineThumbnail } from '../shared/line-thumbnail';\nimport { defaultOrderLineItemStrings, type OrderLineItemProps } from './types';\n\nexport function OrderLineItem({\n\tid,\n\ttitle,\n\tvariantTitle,\n\tsku,\n\timageSrc,\n\timageAlt,\n\tunitPrice,\n\tquantity,\n\ttotal,\n\tproperties,\n\tchildren,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderLineItemProps) {\n\tconst strings = useStrings(defaultOrderLineItemStrings, stringsProp);\n\tconst hasMeta = !!variantTitle || !!sku;\n\n\treturn (\n\t\t<div\n\t\t\t{...props}\n\t\t\tdata-slot=\"order-line-item\"\n\t\t\tdata-line-id={id}\n\t\t\tclassName={cn('order-line-item--component @container/order-line-item min-w-0', className)}\n\t\t>\n\t\t\t<div className=\"flex min-w-0 items-start gap-space-lg\">\n\t\t\t\t<ItemMedia variant=\"image\" className=\"order-line-item--media\">\n\t\t\t\t\t<LineThumbnail src={imageSrc} alt={imageAlt} title={title} />\n\t\t\t\t</ItemMedia>\n\n\t\t\t\t<div className=\"order-line-item--layout grid min-w-0 flex-1 gap-space-sm @md/order-line-item:grid-cols-[minmax(0,1fr)_auto_minmax(5rem,auto)] @md/order-line-item:items-center @md/order-line-item:gap-x-space-xl\">\n\t\t\t\t\t<Stack gap=\"xs\" className=\"order-line-item--body min-w-0\">\n\t\t\t\t\t\t<Text type=\"inherit\" weight=\"medium\" className=\"order-line-item--title wrap-anywhere\">\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</Text>\n\n\t\t\t\t\t\t{!!hasMeta && (\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" wrap className=\"order-line-item--meta\">\n\t\t\t\t\t\t\t\t{!!variantTitle && <Badge tone=\"neutral\" size=\"sm\">{variantTitle}</Badge>}\n\t\t\t\t\t\t\t\t{/* An identifier, so monospace. */}\n\t\t\t\t\t\t\t\t{!!sku && <MonoValue size=\"xs\" type=\"secondary\">{sku}</MonoValue>}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!!properties?.length && (\n\t\t\t\t\t\t\t<MetadataList\n\t\t\t\t\t\t\t\tlayout=\"rows\"\n\t\t\t\t\t\t\t\tdensity=\"compact\"\n\t\t\t\t\t\t\t\tclassName=\"order-line-item--properties\"\n\t\t\t\t\t\t\t\titems={properties.map((property, index) => ({\n\t\t\t\t\t\t\t\t\tid: String(index),\n\t\t\t\t\t\t\t\t\tlabel: property.label,\n\t\t\t\t\t\t\t\t\tvalue: property.value,\n\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{/* Under the text in a narrow row; their own columns from the container's md step. */}\n\t\t\t\t\t<div className=\"order-line-item--figures flex min-w-0 items-baseline justify-between gap-space-md @md/order-line-item:contents\">\n\t\t\t\t\t\t<span className=\"order-line-item--price inline-flex items-baseline gap-space-xs @md/order-line-item:justify-end\">\n\t\t\t\t\t\t\t{/* One accessible phrase for the price column: an aria-label on a role-less\n\t\t\t\t\t\t\t span is ignored, so the phrase is hidden text and the parts are aria-hidden. */}\n\t\t\t\t\t\t\t<VisuallyHidden>{strings.formatUnitPrice(unitPrice, quantity)}</VisuallyHidden>\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" aria-hidden=\"true\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t{unitPrice}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t×\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text type=\"inherit\" tag=\"span\" size=\"xs\" weight=\"medium\" aria-hidden=\"true\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t{quantity}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t<Text type=\"inherit\" tag=\"span\" weight=\"medium\" className=\"order-line-item--total text-end tabular-nums\">\n\t\t\t\t\t\t\t{total}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nOrderLineItem.displayName = 'OrderLineItem';\n","import type { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';\n\nimport type { ActionMenuAction, ActionMenuProps } from '../../../base/action-menu';\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { OrderLine, OrderLineItemStrings } from '../order-line-item/types';\nimport { defaultOrderLineItemStrings } from '../order-line-item/types';\nimport { defaultOrderStatusVocabulary, type FulfillmentStatus } from '../shared/order-status';\n\nexport interface FulfillmentGroupStrings extends OrderLineItemStrings {\n\t/** Label for each `FulfillmentStatus`. The tone stays derived from the status. */\n\tfulfillment: Record<FulfillmentStatus, string>;\n\t/** Names the group by state and size: \"Unfulfilled (3)\". */\n\tformatHeading: (status: string, count: number) => string;\n\t/** Accessible name of the overflow menu holding every action after the first. */\n\tmoreActions: string;\n}\n\nexport const defaultFulfillmentGroupStrings: FulfillmentGroupStrings = {\n\t...defaultOrderLineItemStrings,\n\tfulfillment: defaultOrderStatusVocabulary.fulfillment,\n\tformatHeading: (status, count) => `${status} (${count})`,\n\tmoreActions: 'More actions',\n};\n\n/** Header and footer rules follow Card's provider defaults; `headerDivider` / `footerDivider` override them per group. */\nexport interface FulfillmentGroupProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'headerDivider' | 'footerDivider'> {\n\t/** Where these goods are. Drives the heading chip's label and tone. */\n\tstatus: FulfillmentStatus;\n\t/** Where the group ships from. */\n\tlocation?: ReactNode;\n\t/** A standing fact about the group: \"Shipping not required\". */\n\tnotice?: ReactNode;\n\t/**\n\t * Glyph beside the notice, sized by the group. A component rather than a\n\t * node, so it arrives at the icon size of the text it annotates.\n\t */\n\tnoticeIcon?: ComponentType<{ className?: string }>;\n\t/** The rows, as data. The heading counts them. */\n\titems?: OrderLine[];\n\t/** Replaces `items` wholesale, for a caller who needs control of a row. The heading then carries no count. */\n\tchildren?: ReactNode;\n\t/**\n\t * The group's commands. The first renders as a button and the rest collapse\n\t * into an overflow menu: one array, so the menu never repeats the button.\n\t * Mark the main command `tone: 'primary'`.\n\t */\n\tactions?: readonly ActionMenuAction[];\n\t/** Renders `href` actions through the consumer's router. */\n\trenderLink?: ActionMenuProps['renderLink'];\n\t/** Overrides this surface's own copy, including the status words. */\n\tstrings?: StringsProp<FulfillmentGroupStrings>;\n}\n","/**\n * FulfillmentGroup — one shipment's worth of an order: the goods that share a\n * fulfillment state and a location, and the commands that move them on.\n *\n * A card in three bands, using Card's shared spacing and divider defaults. The\n * header names the group by state and size (\"Unfulfilled (3)\", a level-2\n * heading carried by the status chip, so its tone and words come from\n * `status`) with the location and any standing notice beneath. The items band\n * lists `OrderLineItem` rows, ruled between each other because the lines are\n * tabular. The actions band shows the first action as a button and collapses\n * the rest into an overflow menu.\n */\nimport {compositionRhythm} from '../../../base/structure/composition.recipes';\nimport { useMemo } from 'react';\n\nimport { ActionButtons, ActionMenu } from '../../../base/action-menu';\nimport { Badge } from '../../../base/badge';\nimport { Card, hasRenderableContent } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { OrderLineItem } from '../order-line-item/order-line-item';\nimport { fulfillmentStatusTone } from '../shared/order-status';\nimport { defaultFulfillmentGroupStrings, type FulfillmentGroupProps } from './types';\n\nexport function FulfillmentGroup({\n\tstatus,\n\tlocation,\n\tnotice,\n\tnoticeIcon: NoticeIcon,\n\titems,\n\tchildren,\n\tactions,\n\trenderLink,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: FulfillmentGroupProps) {\n\tconst strings = useStrings(defaultFulfillmentGroupStrings, stringsProp);\n\tconst lineStrings = useMemo(() => ({ formatUnitPrice: strings.formatUnitPrice }), [strings.formatUnitPrice]);\n\tconst statusLabel = strings.fulfillment[status];\n\t// Counts `items` only; custom `children` are the caller's rows to count.\n\tconst heading = items ? strings.formatHeading(statusLabel, items.length) : statusLabel;\n\n\tconst visibleActions = (actions ?? []).filter((action) => action.visible !== false);\n\tconst [firstAction, ...overflowActions] = visibleActions;\n\n\tconst hasLocation = location !== undefined && location !== null && location !== '';\n\tconst hasNotice = notice !== undefined && notice !== null && notice !== '';\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface=\"card\"\n\t\t\tpadding=\"md\"\n\t\t\tdata-status={status}\n\t\t\ttitle={(\n\t\t\t\t<span role=\"heading\" aria-level={2} className=\"fulfillment-group--heading inline-flex max-w-full\">\n\t\t\t\t\t<Badge tone={fulfillmentStatusTone[status]}>{heading}</Badge>\n\t\t\t\t</span>\n\t\t\t)}\n\t\t\tdescription={hasLocation || hasNotice ? (\n\t\t\t\t<Stack gap=\"2xs\" className=\"fulfillment-group--context\">\n\t\t\t\t\t{!!hasLocation && (\n\t\t\t\t\t\t<Text tag=\"div\" type=\"secondary\" className=\"fulfillment-group--location\">{location}</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!hasNotice && (\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" wrap={false} className=\"fulfillment-group--notice text-muted-foreground\">\n\t\t\t\t\t\t\t{!!NoticeIcon && <NoticeIcon aria-hidden=\"true\" className=\"size-icon-sm shrink-0\" />}\n\t\t\t\t\t\t\t<Text tag=\"span\" type=\"secondary\">{notice}</Text>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t) : undefined}\n\t\t\tfooterSlot={firstAction ? (\n\t\t\t\t<Stack direction=\"horizontal\" gap={compositionRhythm.commands} justify=\"end\" className=\"fulfillment-group--actions\">\n\t\t\t\t\t<ActionButtons actions={[firstAction]} renderLink={renderLink} />\n\t\t\t\t\t{overflowActions.length > 0 && (\n\t\t\t\t\t\t<ActionMenu\n\t\t\t\t\t\t\tactions={overflowActions}\n\t\t\t\t\t\t\tcontext=\"commands\"\n\t\t\t\t\t\t\tsrText={strings.moreActions}\n\t\t\t\t\t\t\tbuttonProps={{ size: 'sm' }}\n\t\t\t\t\t\t\trenderLink={renderLink}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t) : undefined}\n\t\t\tclassName={cn('fulfillment-group--component w-full', className)}\n\t\t>\n\t\t\t{/* A conditional `children` that renders nothing leaves the `items` rows in place. */}\n\t\t\t{hasRenderableContent(children) ? (\n\t\t\t\t<div className=\"fulfillment-group--items min-w-0\">{children}</div>\n\t\t\t) : (\n\t\t\t\t<ul className=\"fulfillment-group--items m-0 min-w-0 list-none p-0\">\n\t\t\t\t\t{(items ?? []).map((line) => (\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={line.id}\n\t\t\t\t\t\t\tclassName=\"fulfillment-group--line border-t border-border/60 py-space-lg first:border-t-0 first:pt-0 last:pb-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<OrderLineItem {...line} strings={lineStrings} />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t))}\n\t\t\t\t</ul>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nFulfillmentGroup.displayName = 'FulfillmentGroup';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport { defaultOrderStatusVocabulary, type PaymentStatus } from '../shared/order-status';\n\n/** One row of an order's money ledger. */\nexport interface SummaryLine {\n\t/** Stable identity. Falls back to the row's position. */\n\tid?: string;\n\t/** What the amount is: \"Subtotal\", \"Paid\". */\n\tlabel: ReactNode;\n\t/** A count or rate beside the amount: \"3 items\", \"20%\". */\n\tnote?: ReactNode;\n\t/** Already formatted, including its currency. */\n\tamount: string;\n\t/** Money off the customer's total, shown with one U+2212 in success ink. */\n\tdeduction?: boolean;\n}\n\nexport interface OrderSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Label for each `PaymentStatus`. The tone stays derived from the status. */\n\tpayment: Record<PaymentStatus, string>;\n}\n\nexport const defaultOrderSummaryStrings: OrderSummaryStrings = {\n\ttitle: 'Payment',\n\tpayment: defaultOrderStatusVocabulary.payment,\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface OrderSummaryProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** What was ordered: subtotal, discount, shipping, tax. */\n\tgoods: SummaryLine[];\n\t/** The line the eye should land on, closing the goods ledger. */\n\ttotal: SummaryLine;\n\t/** What has actually moved: paid, refunded, balance. A separate ledger from the goods. */\n\tpayments?: SummaryLine[];\n\t/** Where the money is, as a chip beside the title. */\n\tpaymentStatus?: PaymentStatus;\n\t/**\n\t * Standing information about the balance, below the ledgers as a warning\n\t * note (`role=\"note\"`): a caveat, not an error.\n\t */\n\talert?: ReactNode;\n\t/** Overrides this surface's own copy, including the status words. */\n\tstrings?: StringsProp<OrderSummaryStrings>;\n}\n","/**\n * OrderSummary — an order's money in two ledgers: what was ordered (ending in\n * the total) and what has actually moved (paid, refunded, balance). They are\n * different questions, so they are separate ledgers, separated by spacing\n * rather than a rule or a tinted box. The payment status chip sits beside the\n * title; standing information about the balance follows the ledgers as a\n * warning note. Every amount arrives formatted: the summary does no arithmetic,\n * and a refund in the payments ledger is money that moved, not a deduction.\n */\nimport { TriangleAlert } from 'lucide-react';\n\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { Alert, AlertDescription } from '../../../base/feedback';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { paymentStatusTone } from '../shared/order-status';\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultOrderSummaryStrings, type OrderSummaryProps, type SummaryLine } from './types';\n\nfunction LedgerRow({ line, total = false, rollup = false }: { line: SummaryLine; total?: boolean; rollup?: boolean }) {\n\treturn (\n\t\t<AmountRow\n\t\t\tlabel={line.label}\n\t\t\tnote={line.note}\n\t\t\tamount={line.amount}\n\t\t\tdeduction={line.deduction}\n\t\t\ttotal={total}\n\t\t\trollup={rollup}\n\t\t/>\n\t);\n}\n\nexport function OrderSummary({\n\tgoods,\n\ttotal,\n\tpayments,\n\tpaymentStatus,\n\talert,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderSummaryProps) {\n\tconst strings = useStrings(defaultOrderSummaryStrings, stringsProp);\n\tconst hasAlert = alert !== undefined && alert !== null && alert !== false && alert !== '';\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={paymentStatus ? (\n\t\t\t\t<Badge tone={paymentStatusTone[paymentStatus]} className=\"order-summary--status\">\n\t\t\t\t\t{strings.payment[paymentStatus]}\n\t\t\t\t</Badge>\n\t\t\t) : undefined}\n\t\t\tcontentGap=\"xl\"\n\t\t\tcontentBottom={hasAlert ? (\n\t\t\t\t// `note`: standing information, not an error that just happened.\n\t\t\t\t<Alert tone=\"warning\" role=\"note\" className=\"order-summary--alert\">\n\t\t\t\t\t<TriangleAlert aria-hidden=\"true\" />\n\t\t\t\t\t<AlertDescription>{alert}</AlertDescription>\n\t\t\t\t</Alert>\n\t\t\t) : undefined}\n\t\t\tdata-slot=\"order-summary\"\n\t\t\tclassName={cn('order-summary--component w-full', className)}\n\t\t>\n\t\t\t<SummaryPanel className=\"order-summary--goods\">\n\t\t\t\t{goods.map((line, index) => (\n\t\t\t\t\t<LedgerRow key={line.id ?? String(index)} line={line} />\n\t\t\t\t))}\n\t\t\t\t<LedgerRow line={total} total rollup={goods.length > 0} />\n\t\t\t</SummaryPanel>\n\n\t\t\t{!!payments?.length && (\n\t\t\t\t<SummaryPanel className=\"order-summary--payments\">\n\t\t\t\t\t{payments.map((line, index) => (\n\t\t\t\t\t\t<LedgerRow key={line.id ?? String(index)} line={line} />\n\t\t\t\t\t))}\n\t\t\t\t</SummaryPanel>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nOrderSummary.displayName = 'OrderSummary';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { TransactionKind, TransactionStatus } from '../shared/order-status';\n\n/** One attempt against a payment method. */\nexport interface Transaction {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** What was attempted. Sets the sign: refunds, voids and chargebacks take money out. */\n\tkind: TransactionKind;\n\t/** Whether it worked. */\n\tstatus: TransactionStatus;\n\t/** The magnitude, already formatted. The sign comes from `kind`. */\n\tamount: string;\n\t/** Already formatted. */\n\tprocessedAt: string;\n\t/** How it was taken: \"Visa ending 4417\", \"PayPal\". */\n\tmethod?: string;\n\t/** The gateway's own identifier. Monospace: it is compared and copied, not read. */\n\treference?: string;\n\t/** Which gateway processed it. */\n\tgateway?: string;\n}\n\nexport interface OrderTransactionsStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Label for each `TransactionKind`. */\n\tkind: Record<TransactionKind, string>;\n\t/** Chip label for each `TransactionStatus`. A successful attempt shows none. */\n\tstatus: Record<TransactionStatus, string>;\n\t/** Spoken before a gateway reference. */\n\treference: string;\n\t/** Shown, and announced, when there is nothing in the ledger. */\n\tempty: string;\n}\n\nexport const defaultOrderTransactionsStrings: OrderTransactionsStrings = {\n\ttitle: 'Transactions',\n\tkind: {\n\t\tauthorization: 'Authorization',\n\t\tcapture: 'Capture',\n\t\tsale: 'Sale',\n\t\trefund: 'Refund',\n\t\tvoid: 'Void',\n\t\tchargeback: 'Chargeback',\n\t},\n\tstatus: { success: 'Success', pending: 'Pending', failure: 'Failed' },\n\treference: 'Reference',\n\tempty: 'No transactions yet',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface OrderTransactionsProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/**\n\t * Every attempt, oldest first. A failed attempt stays listed: an order that\n\t * shows only what worked cannot answer why it was never captured.\n\t */\n\ttransactions: Transaction[];\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OrderTransactionsStrings>;\n}\n","/**\n * OrderTransactions — the payment ledger: every attempt against the order's\n * payment methods, oldest first.\n *\n * Each row names its kind, says when and how the attempt was made, and\n * carries the gateway reference as an identifier. Success is the expected case\n * and shows no chip; a pending or failed attempt is why someone opened the\n * ledger, so it gets one. Unlike a cart's green deduction, a refund here is\n * money going out: its sign comes from the kind and the figure is never\n * tinted. A failed attempt moved no money, so its figure carries no sign and\n * recedes. The rows sit on the surface that places them, ruled apart because\n * the ledger is tabular. With nothing to list, the ledger says so as a status\n * region.\n */\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { VisuallyHidden } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { MonoValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { EmptyState } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { MINUS_SIGN, stripLeadingMinus } from '../format-signed-amount';\nimport { outgoingTransactionKinds, transactionStatusTone } from '../shared/order-status';\nimport { defaultOrderTransactionsStrings, type OrderTransactionsProps } from './types';\n\nexport function OrderTransactions({\n\ttransactions,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderTransactionsProps) {\n\tconst strings = useStrings(defaultOrderTransactionsStrings, stringsProp);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\tdata-slot=\"order-transactions\"\n\t\t\tclassName={cn('order-transactions--component w-full', className)}\n\t\t>\n\t\t\t{transactions.length === 0 ? (\n\t\t\t\t<EmptyState\n\t\t\t\t\tpadding=\"sm\"\n\t\t\t\t\ttitle={strings.empty}\n\t\t\t\t\tdescription={false}\n\t\t\t\t\tariaLabel={strings.empty}\n\t\t\t\t\tclassName=\"order-transactions--empty\"\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t// No frame of its own: a bordered list inside a card is a box in a box.\n\t\t\t\t<ol className=\"order-transactions--list m-0 list-none p-0\">\n\t\t\t\t\t{transactions.map((transaction) => {\n\t\t\t\t\t\tconst outgoing = outgoingTransactionKinds.has(transaction.kind);\n\t\t\t\t\t\tconst failed = transaction.status === 'failure';\n\t\t\t\t\t\t// Only money that moved takes a sign.\n\t\t\t\t\t\tconst magnitude = stripLeadingMinus(transaction.amount);\n\t\t\t\t\t\tconst amount = outgoing && !failed ? `${MINUS_SIGN}${magnitude}` : magnitude;\n\t\t\t\t\t\tconst meta = [transaction.processedAt, transaction.method, transaction.gateway]\n\t\t\t\t\t\t\t.filter((part): part is string => !!part);\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tkey={transaction.id}\n\t\t\t\t\t\t\t\tdata-status={transaction.status}\n\t\t\t\t\t\t\t\tdata-kind={transaction.kind}\n\t\t\t\t\t\t\t\tdata-outgoing={outgoing ? '' : undefined}\n\t\t\t\t\t\t\t\tclassName=\"order-transactions--row flex min-w-0 items-start gap-space-lg border-t border-border/60 py-row-y-lg first:border-t-0 first:pt-0 last:pb-0\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\" className=\"order-transactions--body min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" wrap className=\"min-w-0\">\n\t\t\t\t\t\t\t\t\t\t<Text type=\"inherit\" tag=\"span\" weight=\"medium\">{strings.kind[transaction.kind]}</Text>\n\t\t\t\t\t\t\t\t\t\t{/* Success needs no chip; a pending or failed attempt is the reason to look. */}\n\t\t\t\t\t\t\t\t\t\t{transaction.status !== 'success' && (\n\t\t\t\t\t\t\t\t\t\t\t<Badge tone={transactionStatusTone[transaction.status]} size=\"sm\" className=\"order-transactions--status\">\n\t\t\t\t\t\t\t\t\t\t\t\t{strings.status[transaction.status]}\n\t\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</Stack>\n\n\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" wrap className=\"order-transactions--meta min-w-0\">\n\t\t\t\t\t\t\t\t\t\t{meta.map((part, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Text key={`${String(index)}-${part}`} tag=\"span\" size=\"xs\" type=\"secondary\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</Stack>\n\n\t\t\t\t\t\t\t\t\t{!!transaction.reference && (\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"order-transactions--reference min-w-0 break-all\">\n\t\t\t\t\t\t\t\t\t\t\t<VisuallyHidden>{`${strings.reference}: `}</VisuallyHidden>\n\t\t\t\t\t\t\t\t\t\t\t<MonoValue type=\"inherit\">{transaction.reference}</MonoValue>\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Stack>\n\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\t\ttype={failed ? 'secondary' : 'main'}\n\t\t\t\t\t\t\t\t\tclassName=\"order-transactions--amount shrink-0 text-end tabular-nums\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</ol>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nOrderTransactions.displayName = 'OrderTransactions';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { OrderAddress } from '../shared/order-status';\n\nexport interface OrderCustomerStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tshippingAddress: string;\n\tbillingAddress: string;\n\t/**\n\t * One name per edit button: each is the accessible name of a glyph with no\n\t * text beside it, and a single \"Edit\" would announce two controls alike.\n\t */\n\teditShipping: string;\n\teditBilling: string;\n\t/** Shown in place of a repeated billing address. */\n\tsameAsShipping: string;\n\t/** Shown when an address is missing. */\n\tnoAddress: string;\n\t/** How many orders the customer has placed, this one included. */\n\tformatOrderCount: (count: number) => string;\n}\n\nexport const defaultOrderCustomerStrings: OrderCustomerStrings = {\n\ttitle: 'Customer',\n\tshippingAddress: 'Shipping address',\n\tbillingAddress: 'Billing address',\n\teditShipping: 'Edit shipping address',\n\teditBilling: 'Edit billing address',\n\tsameAsShipping: 'Same as shipping address',\n\tnoAddress: 'No address on file',\n\tformatOrderCount: (count) => (count === 1 ? '1 order' : `${count} orders`),\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface OrderCustomerProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** The customer's display name. */\n\tname: string;\n\t/** Contact email, rendered as a mail link. */\n\temail?: string;\n\t/** Contact number, rendered as a call link. */\n\tphone?: string;\n\t/** How many orders this customer has placed, this one included. */\n\torderCount?: number;\n\t/** Where the order ships. */\n\tshippingAddress?: OrderAddress;\n\t/** Where the order is billed. */\n\tbillingAddress?: OrderAddress;\n\t/** Renders one line in place of a repeated billing address. */\n\tbillingSameAsShipping?: boolean;\n\t/** Turns the identity row into a button. The app decides whether it navigates or opens a panel. */\n\tonOpenCustomer?: () => void;\n\t/** Shows an edit button on the shipping address. */\n\tonEditShipping?: () => void;\n\t/** Shows an edit button on the billing address. */\n\tonEditBilling?: () => void;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OrderCustomerStrings>;\n}\n","/**\n * OrderCustomer — who bought the order and where it goes: a read-only panel,\n * unlike the editable `AddressCard`.\n *\n * The identity row (avatar and name, with the order count) becomes a button\n * when `onOpenCustomer` is given. Contact details follow as mail and call\n * links, then the shipping and billing addresses, side by side once the\n * panel's own width allows. Each address can carry an icon-only edit button\n * with its own accessible name. `billingSameAsShipping` renders one line\n * instead of a repeated address. Groups are separated by spacing, not rules.\n */\nimport { Pencil } from 'lucide-react';\n\nimport { Avatar, AvatarFallback } from '../../../base/avatar';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Item } from '../../../base/item';\nimport { AdaptiveGrid, Stack } from '../../../base/structure';\nimport { Email, formatInitials, Phone } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AddressLines } from '../shared/address-lines';\nimport type { OrderAddress } from '../shared/order-status';\nimport { defaultOrderCustomerStrings, type OrderCustomerProps } from './types';\n\ninterface AddressSectionProps {\n\tlabel: string;\n\teditLabel: string;\n\taddress?: OrderAddress;\n\tonEdit?: () => void;\n\treplacement?: string;\n\temptyLabel: string;\n\tclassName: string;\n}\n\nfunction AddressSection({ label, editLabel, address, onEdit, replacement, emptyLabel, className }: AddressSectionProps) {\n\treturn (\n\t\t<Stack gap=\"sm\" className={cn('order-customer--address min-w-0', className)}>\n\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" justify=\"between\" wrap={false} className=\"min-h-action-sm\">\n\t\t\t\t<DisplayLabel tag=\"div\">{label}</DisplayLabel>\n\t\t\t\t{/* Icon only; the accessible name says which address it edits. */}\n\t\t\t\t{!!onEdit && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\taria-label={editLabel}\n\t\t\t\t\t\tonClick={onEdit}\n\t\t\t\t\t\tclassName=\"order-customer--edit\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Pencil aria-hidden=\"true\" className=\"size-icon-sm\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t\t{replacement ? (\n\t\t\t\t<Text type=\"secondary\">{replacement}</Text>\n\t\t\t) : address ? (\n\t\t\t\t<AddressLines address={address} />\n\t\t\t) : (\n\t\t\t\t<Text type=\"secondary\">{emptyLabel}</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nexport function OrderCustomer({\n\tname,\n\temail,\n\tphone,\n\torderCount,\n\tshippingAddress,\n\tbillingAddress,\n\tbillingSameAsShipping = false,\n\tonOpenCustomer,\n\tonEditShipping,\n\tonEditBilling,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderCustomerProps) {\n\tconst strings = useStrings(defaultOrderCustomerStrings, stringsProp);\n\tconst hasContact = !!email || !!phone;\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"order-customer\"\n\t\t\tclassName={cn('order-customer--component w-full', className)}\n\t\t>\n\t\t\t{/* An identity (avatar and name), not a label and a value. A button when\n\t\t\t the app can open the customer: it decides whether that navigates. */}\n\t\t\t<Item\n\t\t\t\t// A clickable row pays its own inset and bleeds it back out, so the\n\t\t\t\t// avatar stays on the panel's edge while the hover fill has room.\n\t\t\t\t// The name stays beside its avatar in a narrow column instead of wrapping under it.\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'order-customer--identity flex-nowrap',\n\t\t\t\t\t!!onOpenCustomer && cn('-mx-row-x w-auto text-start', interactionRecipes.rowHover),\n\t\t\t\t)}\n\t\t\t\tpadding={onOpenCustomer ? 'default' : 'none'}\n\t\t\t\trender={onOpenCustomer ? <button type=\"button\" onClick={onOpenCustomer} /> : undefined}\n\t\t\t\tmedia={(\n\t\t\t\t\t<Avatar>\n\t\t\t\t\t\t<AvatarFallback>{formatInitials(name)}</AvatarFallback>\n\t\t\t\t\t</Avatar>\n\t\t\t\t)}\n\t\t\t\ttitle={name}\n\t\t\t\tdescription={orderCount !== undefined ? strings.formatOrderCount(orderCount) : undefined}\n\t\t\t/>\n\n\t\t\t{!!hasContact && (\n\t\t\t\t<Stack gap=\"xs\" className=\"order-customer--contact min-w-0\">\n\t\t\t\t\t{!!email && <Email value={email} className=\"self-start\" />}\n\t\t\t\t\t{!!phone && <Phone value={phone} className=\"self-start\" />}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{/* Side by side once the panel is wide enough, so the two compare at a glance. */}\n\t\t\t<AdaptiveGrid minColumnWidth=\"sm\" gap=\"xl\" className=\"order-customer--addresses\">\n\t\t\t\t<AddressSection\n\t\t\t\t\tlabel={strings.shippingAddress}\n\t\t\t\t\teditLabel={strings.editShipping}\n\t\t\t\t\taddress={shippingAddress}\n\t\t\t\t\tonEdit={onEditShipping}\n\t\t\t\t\temptyLabel={strings.noAddress}\n\t\t\t\t\tclassName=\"order-customer--shipping\"\n\t\t\t\t/>\n\t\t\t\t<AddressSection\n\t\t\t\t\tlabel={strings.billingAddress}\n\t\t\t\t\teditLabel={strings.editBilling}\n\t\t\t\t\taddress={billingAddress}\n\t\t\t\t\tonEdit={onEditBilling}\n\t\t\t\t\treplacement={billingSameAsShipping ? strings.sameAsShipping : undefined}\n\t\t\t\t\temptyLabel={strings.noAddress}\n\t\t\t\t\tclassName=\"order-customer--billing\"\n\t\t\t\t/>\n\t\t\t</AdaptiveGrid>\n\t\t</Card>\n\t);\n}\n\nOrderCustomer.displayName = 'OrderCustomer';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB8E,GAAmB,EAClC,aACA,cACA,WAKA,cAAW,WACX,iBAAc,WACd,mBAAgB,WACW;CAC3B,OAEC,kBAACf,IAAD;EAAW,WAAWpD,EAAG,sCAAsCoE,CAAS;EACtE,UAAAC,EAAS,KAAK,GAAG,MAChB,kBAACf,GAAD;GAAoD,WAAU;GAA9D,UAAA;IACC,kBAACL,GAAD,EAAA,UACC,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oCoE,CAAS;EAR5D,UAAA;GAYC,kBAACd,GAAD;IAIC,WAAWtD,EACV,wCACA,CAAC,CAACiiB,KAAkBjiB,EAAG,+BAA+BoB,EAAmB,QAAQ,CAClF;IACA,SAAS6gB,IAAiB,YAAY;IACtC,QAAQA,IAAiB,kBAAC,UAAD;KAAQ,MAAK;KAAS,SAASA;IAAiB,CAAA,IAAI,KAAA;IAC7E,OACC,kBAAChgB,IAAD,EAAA,UACC,kBAACD,IAAD,EAAA,UAAiBL,GAAe8L,CAAI,EAAkB,CAAA,EAC/C,CAAA;IAET,OAAOA;IACP,aAAayU,MAAe,KAAA,IAAmD,KAAA,IAAvC3c,EAAQ,iBAAiB2c,CAAU;GAC3E,CAAA;GAEA,CAAC,CAACH,KACF,kBAACthB,GAAD;IAAO,KAAI;IAAK,WAAU;IAA1B,UAAA,CACE,CAAC,CAACuhB,KAAS,kBAACvgB,GAAD;KAAO,OAAOugB;KAAO,WAAU;IAAc,CAAA,GACxD,CAAC,CAACtQ,KAAS,kBAACpQ,GAAD;KAAO,OAAOoQ;KAAO,WAAU;IAAc,CAAA,CACnD;;GAIR,kBAACnR,GAAD;IAAc,gBAAe;IAAK,KAAI;IAAK,WAAU;IAArD,UAAA,CACC,kBAACmhB,IAAD;KACC,OAAOnc,EAAQ;KACf,WAAWA,EAAQ;KACnB,SAAS4c;KACT,QAAQC;KACR,YAAY7c,EAAQ;KACpB,WAAU;IACV,CAAA,GACD,kBAACmc,IAAD;KACC,OAAOnc,EAAQ;KACf,WAAWA,EAAQ;KACnB,SAAS8c;KACT,QAAQC;KACR,aAAaC,IAAwBhd,EAAQ,iBAAiB,KAAA;KAC9D,YAAYA,EAAQ;KACpB,WAAU;IACV,CAAA,CACY;;EACT;;AAER;AAEA,GAAc,cAAc"}
1
+ {"version":3,"file":"commerce.js","names":["NumberValue","_Fragment","_Fragment","NumberValue","NumberValue","normalizeCode","_Fragment","NumberValue","NumberValue","_Fragment","useMoneyConfig","cn","Button","TextButton","Text","DisplayLabel","Heading","TextLink","AdaptiveGrid","Grid","Stack","toneRecipes","hasRenderableContent","Alert","Card","Progress","neutralFillRecipes","elevationRecipes","compositionRhythm","compositionClasses","ActionMenu","ActionButtons","CardPrimaryAction","interactionRecipes","Value","Phone","SecondaryValue","MonoValue","Email","Initials","formatInitials","Percent","Money","Number$1","IconBadge","AvatarFallback","Avatar","AvatarImage","Badge","Separator","Input","Copyable","FormField","ToggleField","Select","CardRadioGroup","DateBlock","ContentBlock","VisuallyHidden","TagsInput","DecimalInput","WeightInput","ItemMedia","ItemDescription","ItemActions","ItemGroup","ItemContent","Item","ItemTitle","MetadataList","TabsTrigger","TabsContent","TabsList","Tabs","InlineStat","Receipt","ReceiptItems","Timeline","Fragment$1","UpcomingBookingRow","className","bookings","b","timePlacement","dateTone","dateVariant","idx","renderItemValue","value","BookingCalendarEventCard","status","contentClassName","items","item","onAction","actionLabel","defaultLoyaltyPointsStrings","LoyaltyPoints","stringsProp","strings","useStrings","tierTone","tier","balance","history","entry","onRedeem","stripLeadingMinus","formatDeduction","isText","AmountRow","forwardRef","props","hasNote","note","total","deduction","rollup","label","amount","SummaryPanel","defaultDiscountStackStrings","discountKind","kind","discount","DiscountStackPreview","surface","discounts","index","totalSavings","DiscountStack","shipmentStatusTone","defaultShipmentTrackingStrings","latestReachedIndex","steps","ShipmentTracking","current","rail","step","facts","trackingNumber","onCopyTracking","carrier","details","detail","defaultGiftcardStrings","giftcardStatusTone","inverseGradient","presetStops","gradientMap","compactGradientMap","accentColorMap","headerGradientMap","GiftcardCompact","statusLabel","statusTone","isPartiallyUsed","remainingAmount","displayAmount","gradient","code","recipientName","GiftcardCopyButton","copyStrings","generation","useRef","result","setResult","useState","state","previous","Icon","Check","X","Loader2","Copy","copy","request","inverse","GiftcardCardDark","metadataItems","expiresAt","onView","GiftcardFull","_createdAt","_template","senderName","pattern","message","GiftcardCardIllustrated","headerColor","GiftcardCardMinimal","accent","color","ArrowRight","GiftcardCard","defaultVendorProfileStrings","CHANGE_VARIANTS","ChangeBadge","children","tone","VendorProfileCard","internalView","setInternalView","defaultView","isViewControlled","view","hasEarnings","earnings","hasOverviewContent","metrics","hasStatsContent","stats","availableTabs","requestedView","activeView","hasBody","hasActions","onMessage","onHire","handleViewChange","nextValue","onViewChange","overviewContent","earningsChangeTone","earningsChange","metric","statsContent","stat","profileBody","avatarUrl","name","initials","verified","role","ChevronRight","defaultInventoryLevelStrings","InventoryLevel","stockId","useId","isLow","stock","reorderLevel","isCritical","badgeTone","badgeLabel","productName","variant","maxStock","lastRestocked","defaultTaxBreakdownStrings","TaxBreakdownCard","subtotal","taxes","tax","totalTax","defaultSubscriptionSummaryStrings","SubscriptionSummaryCard","planName","priceLabel","cycleLabel","nextBillingDate","perks","perk","i","onManage","onUpgrade","defaultRefundStatusStrings","STAGE_ORDER","hasContent","RefundStatusCard","currentIdx","stage","hasFacts","reason","method","eta","requestedAt","done","s","RefundStatus","AddressLines","cityLine","address","prominent","defaultAddressCardStrings","AddressCard","defaultAddress","titleByKind","actions","onEdit","Edit2","onMakeDefault","Star","onRemove","Trash2","phone","defaultVoucherEntryStrings","normalizeCode$1","VoucherEntry","inputId","setCode","trimmedCode","appliedCode","event","onCheck","error","LineThumbnailPlaceholder","title","LineThumbnail","failedSrc","setFailedSrc","source","src","alt","defaultCartSummaryStrings","quantity","resolveCartLineTitle","resolveCartLineImageSrc","CartSummaryCard","hasBreakdown","shipping","it","imageSrc","onCheckout","CartSummary","defaultCouponInputStrings","normalizeCode","CouponInputCard","appliedDiscount","onApply","defaultOrderStatusStrings","VARIANT_BY_STATUS","OrderStatusCard","lastCompleteIdx","events","e","acc","nextEvent","orderNumber","currentEta","isLast","isCurrent","CalendarClock","Circle","defaultPaymentMethodStrings","brand","last4","BRAND_LABEL","BRAND_SURFACE","PaymentMethod","defaultMethod","spokenName","onChange","holderName","expiry","PaymentMethodCard","DEFAULT_SEO_LISTING_LIMITS","resolveLimits","limits","clampScore","getCheckStatus","maxScore","ratio","score","makeCheck","scoreRatio","range","lengthScore","length","min","max","overBy","getSeoPermalinkPath","permalink","getSeoPermalinkSlug","permalinkScore","path","slugScore","slug","urlScore","baseUrl","keywordScore","keyword","input","haystack","calculateSeoListingScore","description","permalinkPath","checks","sum","check","defaultSeoListingCardStrings","SCORE_BADGE_TONE","SCORE_PROGRESS_CLASS","CHECK_ICON","CheckCircle2","TriangleAlert","CircleAlert","CHECK_ICON_CLASS","trimSlashes","buildUrlParts","permalinkParts","pathSegments","buildHref","base","getCheckDetail","SeoCheckRow","SeoListingCard","resolvedBaseUrl","resolvedSiteName","siteName","resolvedTitle","resolvedDescription","scoreResult","href","urlParts","Pencil","ExternalLink","part","price","showChecks","defaultInvoiceMiniStrings","count","invoiceStatusTone","InvoiceMini","mergeStrings","labelByStatus","invoice","defaultInvoiceHeaderStrings","PartyBlock","eyebrow","location","InvoiceHeader","resolvedStatusTone","invoiceNumber","from","to","issuedDate","dueDate","defaultInvoiceLineItemsStrings","SURFACE_CLASS","ALIGN_CLASS","QTY_TRACK","PRICE_TRACK","TOTAL_TRACK","DEFAULT_GRID","WIDE_ONLY","RESPONSIVE_CUSTOM_GRID","NARROW_ONLY","NUMERIC_CELL","InvoiceCurrencyValue","buildDefaultColumns","buildDefaultFooterRows","taxRate","InvoiceLineItems","resolvedCurrency","currency","defaultCurrency","flat","resolvedColumns","columns","resolvedFooterRows","footerRows","template","cols","c","responsiveColumns","gridStyle","inset","subgridRow","col","row","isSimpleText","OrderTimeline","PaymentTimeline","defaultInventorySectionStrings","STATUS_VARIANT","parseQuantity","parsed","getInventoryStatus","available","threshold","SectionHeading","SummaryMetric","InventorySectionCard","isDisabled","disabled","readOnly","isTracked","requiresShipping","shippingFieldsDisabled","isSectionVisible","visibleSections","section","isFieldVisible","visibleFields","field","updateField","previousValue","next","handleGenerateSku","onGenerateSku","generatedSku","onRestock","errors","checked","locationOptions","unit","countryOptions","nextTags","tagRecommendations","maxTags","fulfillmentStatusTone","paymentStatusTone","transactionStatusTone","outgoingTransactionKinds","defaultOrderStatusVocabulary","defaultOrderHeaderStrings","placedAt","OrderHeader","origin","headingTag","paymentStatus","fulfillmentStatus","defaultOrderLineItemStrings","unitPrice","OrderLineItem","hasMeta","variantTitle","sku","id","imageAlt","properties","property","defaultFulfillmentGroupStrings","FulfillmentGroup","NoticeIcon","lineStrings","useMemo","headingCount","heading","firstAction","overflowActions","action","hasLocation","hasNotice","notice","line","defaultOrderSummaryStrings","LedgerRow","OrderSummary","hasAlert","alert","AlertDescription","goods","payments","defaultOrderTransactionsStrings","OrderTransactions","transactions","outgoing","transaction","failed","magnitude","meta","defaultOrderCustomerStrings","AddressSection","editLabel","replacement","emptyLabel","OrderCustomer","hasContact","email","onOpenCustomer","orderCount","showShippingAddress","shippingAddress","onEditShipping","shippingMethod","billingAddress","onEditBilling","billingSameAsShipping"],"sources":["../../src/components/blocks/commerce/upcoming-booking/upcoming-booking.tsx","../../src/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.tsx","../../src/components/blocks/commerce/loyalty-points/types.ts","../../src/components/blocks/commerce/loyalty-points/loyalty-points.tsx","../../src/components/blocks/commerce/format-signed-amount.ts","../../src/components/blocks/commerce/summary-panel/amount-row.tsx","../../src/components/blocks/commerce/summary-panel/summary-panel.tsx","../../src/components/blocks/commerce/discount-stack/types.ts","../../src/components/blocks/commerce/discount-stack/discount-stack.tsx","../../src/components/blocks/commerce/shipment-tracking/types.ts","../../src/components/blocks/commerce/shipment-tracking/shipment-tracking.tsx","../../src/components/blocks/commerce/giftcard-card/types.ts","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-compact.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-dark.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-full.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.tsx","../../src/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.tsx","../../src/components/blocks/commerce/giftcard-card/giftcard-card.tsx","../../src/components/blocks/commerce/vendor-profile/types.ts","../../src/components/blocks/commerce/vendor-profile/vendor-profile.tsx","../../src/components/blocks/commerce/inventory-level/inventory-level.strings.ts","../../src/components/blocks/commerce/inventory-level/inventory-level.tsx","../../src/components/blocks/commerce/tax-breakdown/types.ts","../../src/components/blocks/commerce/tax-breakdown/tax-breakdown.tsx","../../src/components/blocks/commerce/subscription-summary/types.ts","../../src/components/blocks/commerce/subscription-summary/subscription-summary.tsx","../../src/components/blocks/commerce/refund-status/types.ts","../../src/components/blocks/commerce/refund-status/refund-status.tsx","../../src/components/blocks/commerce/shared/address-lines.tsx","../../src/components/blocks/commerce/address-card/types.ts","../../src/components/blocks/commerce/address-card/address-card.tsx","../../src/components/blocks/commerce/voucher-entry/types.ts","../../src/components/blocks/commerce/voucher-entry/voucher-entry.tsx","../../src/components/blocks/commerce/shared/line-thumbnail.tsx","../../src/components/blocks/commerce/cart-summary/types.ts","../../src/components/blocks/commerce/cart-summary/cart-summary.tsx","../../src/components/blocks/commerce/coupon-input/types.ts","../../src/components/blocks/commerce/coupon-input/coupon-input.tsx","../../src/components/blocks/commerce/order-status/types.ts","../../src/components/blocks/commerce/order-status/order-status.tsx","../../src/components/blocks/commerce/payment-method/types.ts","../../src/components/blocks/commerce/payment-method/payment-method.tsx","../../src/components/blocks/commerce/seo-listing/seo-listing-score.ts","../../src/components/blocks/commerce/seo-listing/types.ts","../../src/components/blocks/commerce/seo-listing/seo-listing-card.tsx","../../src/components/blocks/commerce/invoice-mini/types.ts","../../src/components/blocks/commerce/invoice-mini/invoice-mini.tsx","../../src/components/blocks/commerce/invoice-header/types.ts","../../src/components/blocks/commerce/invoice-header/invoice-header.tsx","../../src/components/blocks/commerce/invoice-line-items/types.ts","../../src/components/blocks/commerce/invoice-line-items/invoice-line-items.tsx","../../src/components/blocks/commerce/order-timeline/order-timeline.tsx","../../src/components/blocks/commerce/payment-timeline/payment-timeline.tsx","../../src/components/blocks/commerce/inventory-section/types.ts","../../src/components/blocks/commerce/inventory-section/inventory-section.tsx","../../src/components/blocks/commerce/shared/order-status.ts","../../src/components/blocks/commerce/order-header/types.ts","../../src/components/blocks/commerce/order-header/order-header.tsx","../../src/components/blocks/commerce/order-line-item/types.ts","../../src/components/blocks/commerce/order-line-item/order-line-item.tsx","../../src/components/blocks/commerce/fulfillment-group/types.ts","../../src/components/blocks/commerce/fulfillment-group/fulfillment-group.tsx","../../src/components/blocks/commerce/order-summary/types.ts","../../src/components/blocks/commerce/order-summary/order-summary.tsx","../../src/components/blocks/commerce/order-transactions/types.ts","../../src/components/blocks/commerce/order-transactions/order-transactions.tsx","../../src/components/blocks/commerce/order-customer/types.ts","../../src/components/blocks/commerce/order-customer/order-customer.tsx"],"sourcesContent":["/**\n * UpcomingBookingRow — compact booking list. Each row shows a `DateBlock`\n * (weekday / day / month / time) on the left, service + customer in the\n * middle, and trailing amount. Locale and date-tone are configurable.\n *\n * Time is placed BELOW the date block by default (matches the date block\n * vertical rhythm); pass `timePlacement=\"inline-trailing\"` to use a\n * separate trailing time column.\n */\nimport { DateBlock } from '../../../base/display/date-block';\nimport { SecondaryValue, Value } from '../../../primitives';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\n\nimport type { UpcomingBookingRowProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\n\nexport function UpcomingBookingRow({\n\tbookings,\n\tclassName,\n\tlocale,\n\t// `inverse` paints a near-black tile in the light theme, which reads as a\n\t// heavy foreign block in an otherwise soft admin list and does not match how\n\t// DateBlock renders anywhere else. Neutral by default; pass\n\t// `dateVariant=\"inverse\"` for the inverted treatment deliberately.\n\tdateTone = 'neutral',\n\tdateVariant = 'default',\n\ttimePlacement = 'below',\n}: UpcomingBookingRowProps) {\n\treturn (\n\t\t// Plain rows touch: each row's density padding is the space between them.\n\t\t<ItemGroup className={cn('upcoming-booking--component w-full', className)}>\n\t\t\t{bookings.map((b, idx) => (\n\t\t\t\t\t<Item key={b.id ?? `${b.service}-${b.time}-${idx}`} className=\"items-center\">\n\t\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t\t<DateBlock\n\t\t\t\t\t\t\t\tdate={b.date}\n\t\t\t\t\t\t\t\ttime={timePlacement === 'below' ? b.time : undefined}\n\t\t\t\t\t\t\t\ttone={dateTone}\n\t\t\t\t\t\t\t\tvariant={dateVariant}\n\t\t\t\t\t\t\t\tlocale={locale}\n\t\t\t\t\t\t\t\ttimePlacement=\"below\"\n\t\t\t\t\t\t\t\tlayout=\"stacked\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t<ItemContent className=\"min-w-0 sm:min-w-48\">\n\t\t\t\t\t\t\t<ItemTitle>{b.service}</ItemTitle>\n\t\t\t\t\t\t\t<ItemDescription clamp={1}>{b.customer}</ItemDescription>\n\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 flex-wrap justify-end\">\n\t\t\t\t\t\t\t{timePlacement === 'inline-trailing' && (\n\t\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t\t{b.time}\n\t\t\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{b.amount}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t</Item>\n\t\t\t))}\n\t\t</ItemGroup>\n\t);\n}\n\nUpcomingBookingRow.displayName = 'UpcomingBookingRow';\n","import type { ReactNode } from 'react';\n\nimport { CardPrimaryAction } from '../../../base/cards';\nimport { ContentBlock } from '../../../base/display';\nimport { Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { BookingCalendarEventCardProps } from './booking-calendar-event-card.types';\n\nfunction renderItemValue(value: ReactNode): ReactNode {\n\tif (\n\t\ttypeof value === 'string' ||\n\t\ttypeof value === 'number' ||\n\t\ttypeof value === 'bigint'\n\t) {\n\t\treturn <Value type=\"inherit\">{String(value)}</Value>;\n\t}\n\n\treturn value;\n}\n\n/**\n * Compact, card-free booking detail composition.\n *\n * The status sits beside the title, the facts share one label-above-value\n * layout, and spacing alone separates them from the action: no header rule,\n * no inset note panel and no rule above the action.\n *\n * All visible copy is supplied by props, so this component intentionally has\n * no strings file. Frame it with `Card` only when the page needs card\n * chrome.\n */\nexport function BookingCalendarEventCard({\n\ttitle,\n\tdescription,\n\tstatus,\n\titems,\n\tactionLabel,\n\tonAction,\n\tclassName,\n\tcontentClassName,\n}: BookingCalendarEventCardProps) {\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={title}\n\t\t\ttitleSuffix={status}\n\t\t\tdescription={description}\n\t\t\tclassName={cn('booking-calendar-event-card--component @container/booking-calendar-event-card', className)}\n\t\t\tcontentClassName={cn('grid gap-space-2xl', contentClassName)}\n\t\t>\n\t\t\t<dl className=\"booking-calendar-event-card--details grid gap-space-lg @md/booking-calendar-event-card:grid-cols-2\">\n\t\t\t\t{items.map((item) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t// Label-to-value rhythm matches MetadataList's fact layout.\n\t\t\t\t\t\t\t'grid min-w-0 gap-normal',\n\t\t\t\t\t\t\titem.fullWidth === true && '@md/booking-calendar-event-card:col-span-2',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* The definition cells would otherwise keep the page's taller\n\t\t\t\t\t\t line box around 14px copy and pad the label/value gap. */}\n\t\t\t\t\t\t<dt className=\"flex\"><DisplayLabel>{item.label}</DisplayLabel></dt>\n\t\t\t\t\t\t<dd className=\"min-w-0 leading-normal\">{renderItemValue(item.value)}</dd>\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</dl>\n\n\t\t\t<div className=\"booking-calendar-event-card--action flex justify-end\">\n\t\t\t\t<CardPrimaryAction\n\t\t\t\t\tfullWidth={false}\n\t\t\t\t\tclassName=\"w-full @md/booking-calendar-event-card:w-auto\"\n\t\t\t\t\tonClick={onAction}\n\t\t\t\t>\n\t\t\t\t\t{actionLabel}\n\t\t\t\t</CardPrimaryAction>\n\t\t\t</div>\n\t\t</ContentBlock>\n\t);\n}\n\nBookingCalendarEventCard.displayName = 'BookingCalendarEventCard';\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface LoyaltyHistoryEntry {\n\t/** Display label. */\n\tlabel: string;\n\tpoints: string;\n\tdate: string;\n\tpositive: boolean;\n}\n\nexport interface LoyaltyPointsStrings {\n\tbalanceLabel: string;\n\tpointsAvailable: string;\n\tredeem: string;\n\t/** Tier chip label used when `tier` is not passed. */\n\ttier: string;\n}\n\nexport const defaultLoyaltyPointsStrings: LoyaltyPointsStrings = {\n\tbalanceLabel: 'Loyalty balance',\n\tpointsAvailable: 'points available',\n\tredeem: 'Redeem points',\n\ttier: 'Gold tier',\n};\n\nexport interface LoyaltyPointsProps {\n\t/** Points currently available. */\n\tbalance: number | string;\n\t/** Membership tier name. Defaults to `strings.tier`. */\n\ttier?: string;\n\t/** Badge tone for the tier chip. A tier is a kind, not a status. @default 'neutral' */\n\ttierTone?: BadgeTone;\n\t/** Recent point movements. */\n\thistory?: LoyaltyHistoryEntry[];\n\tonRedeem?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<LoyaltyPointsStrings>;\n}\n","/**\n * LoyaltyPoints — current balance, tier badge, recent history rows\n * (label / date / signed-points), and a redemption CTA. Strings overridable\n * for i18n.\n */\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue } from '../../../primitives';\nimport { Heading } from '../../../typography/heading';\nimport { Text } from '../../../typography/text';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemTitle,\n} from '../../../base/item';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultLoyaltyPointsStrings, type LoyaltyPointsProps } from './types';\n\nexport function LoyaltyPoints({\n\tbalance,\n\ttier,\n\ttierTone = 'neutral',\n\thistory = [],\n\tonRedeem,\n\tclassName,\n\tstrings: stringsProp,\n}: LoyaltyPointsProps) {\n\tconst strings = useStrings(defaultLoyaltyPointsStrings, stringsProp);\n\t// The tier is a membership kind, so its chip is neutral by default and sits\n\t// beside the title. Balance, history and the action are separated by the\n\t// content gap rather than a rule.\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.balanceLabel}\n\t\t\ttitleSuffix={<Badge tone={tierTone}>{tier ?? strings.tier}</Badge>}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tclassName={cn('loyalty-points--component w-full', className)}\n\t\t>\n\t\t\t<Stack gap=\"dense\" className=\"loyalty-points--balance\">\n\t\t\t\t<Heading tag=\"h3\" className=\"tabular-nums text-inherit\">\n\t\t\t\t\t{typeof balance === 'number' ? (\n\t\t\t\t\t\t<NumberValue type=\"inherit\" value={balance} align=\"left\" />\n\t\t\t\t\t) : balance}\n\t\t\t\t</Heading>\n\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t{strings.pointsAvailable}\n\t\t\t\t</Text>\n\t\t\t</Stack>\n\n\t\t\t{history.length > 0 && (\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{history.map((entry) => (\n\t\t\t\t\t\t<Item key={entry.date + entry.label} size=\"sm\">\n\t\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t\t<ItemTitle bold={false}>{entry.label}</ItemTitle>\n\t\t\t\t\t\t\t\t<ItemDescription clamp={1}>{entry.date}</ItemDescription>\n\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t<ItemActions>\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'tabular-nums',\n\t\t\t\t\t\t\t\t\t\tentry.positive ? 'text-success' : 'text-destructive',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{entry.points}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t\t</Item>\n\t\t\t\t\t))}\n\t\t\t\t</ItemGroup>\n\t\t\t)}\n\n\t\t\t{!!onRedeem && (\n\t\t\t\t<Button tone=\"primary\" fullWidth onClick={onRedeem}>\n\t\t\t\t\t{strings.redeem}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nLoyaltyPoints.displayName = 'LoyaltyPoints';\n","/**\n * Negative-amount presentation shared across commerce surfaces.\n *\n * Consumers pass amounts as opaque preformatted strings, sometimes already\n * carrying a leading \"-\" and sometimes not. Rendering those raw meant the same\n * concept — money coming off a total — appeared with a HYPHEN-MINUS in one card\n * and a MINUS SIGN in the next.\n *\n * U+2212 is the correct glyph: it is drawn to the width of a digit and sits on\n * the maths axis, so it aligns in a tabular-figures column where the narrower,\n * lower hyphen does not.\n */\n\n/** U+2212 MINUS SIGN. */\nexport const MINUS_SIGN = '−';\n\n/** Drop any leading sign or whitespace a consumer already supplied. */\nexport function stripLeadingMinus(value: string): string {\n\treturn value.replace(/^[\\s−-]+/, '');\n}\n\n/**\n * Present an amount as a deduction: exactly one U+2212, whatever the caller\n * passed in. An empty or whitespace-only value is returned untouched so the\n * caller's own empty handling still applies.\n */\nexport function formatDeduction(value: string): string {\n\tif (!value.trim()) return value;\n\treturn `${MINUS_SIGN}${stripLeadingMinus(value)}`;\n}\n","/**\n * AmountRow — the ledger row every commerce money surface is built from.\n *\n * Label, an optional quiet note, and the amount, aligned on their baseline. It\n * is not `InlineStat`: this row knows about money. `total` marks the figure the\n * eye should land on, `deduction` rewrites the sign to U+2212 and inks the\n * figure as a gain, and `rollup` rules the row off from the breakdown above\n * it. Amounts use the sans UI font with tabular figures and arrive already\n * formatted; the row does no arithmetic.\n */\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport { formatDeduction } from '../format-signed-amount';\nimport type { AmountRowProps } from './types';\n\nfunction isText(value: ReactNode): value is string | number {\n\treturn typeof value === 'string' || typeof value === 'number';\n}\n\nexport const AmountRow = forwardRef<HTMLDivElement, AmountRowProps>(function AmountRow({\n\tlabel,\n\tamount,\n\tnote,\n\ttotal = false,\n\tdeduction = false,\n\trollup = false,\n\tclassName,\n\t...props\n}, ref) {\n\tconst hasNote = note !== undefined && note !== null && note !== false && note !== '';\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tdata-slot=\"amount-row\"\n\t\t\tdata-total={total ? '' : undefined}\n\t\t\tdata-deduction={deduction ? '' : undefined}\n\t\t\tdata-rollup={rollup ? '' : undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'amount-row--component flex min-w-0 items-baseline gap-space-md',\n\t\t\t\t// One rule, midway between the breakdown and the total it rolls up.\n\t\t\t\trollup && 'mt-space-sm border-t border-border pt-space-lg',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isText(label) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype={total ? 'inherit' : 'secondary'}\n\t\t\t\t\tweight={total ? 'semibold' : 'regular'}\n\t\t\t\t\t// A total caption shares the summary-total text role used across blocks.\n\t\t\t\t\tlineHeight={total ? 'tight' : 'normal'}\n\t\t\t\t\tclassName=\"amount-row--label min-w-0 flex-1 wrap-anywhere\"\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\t<span className=\"amount-row--label min-w-0 flex-1\">{label}</span>\n\t\t\t)}\n\t\t\t{!!hasNote && (isText(note) ? (\n\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"amount-row--note shrink-0 tabular-nums\">\n\t\t\t\t\t{note}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\t<span className=\"amount-row--note inline-flex shrink-0 items-center\">{note}</span>\n\t\t\t))}\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\ttype={deduction ? 'success' : 'inherit'}\n\t\t\t\tweight={total ? 'bold' : 'medium'}\n\t\t\t\tclassName=\"amount-row--value shrink-0 text-end tabular-nums\"\n\t\t\t>\n\t\t\t\t{deduction ? formatDeduction(amount) : amount}\n\t\t\t</Text>\n\t\t</div>\n\t);\n});\n\nAmountRow.displayName = 'AmountRow';\n","/**\n * SummaryPanel — the money ledger most commerce surfaces are made of: a stack\n * of `AmountRow`s, usually ending in the one row that matters more than the\n * rest. A cart, a tax breakdown, an invoice header and an order summary all\n * draw it, so each emphasises its total the same way.\n *\n * The panel draws no ground of its own: it sits directly on the surface that\n * places it, because a tinted box inside a card is a box-in-box. Its only rule\n * is the one a `rollup` row draws above a grand total.\n */\nimport { forwardRef } from 'react';\n\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nimport type { SummaryPanelProps } from './types';\n\nexport const SummaryPanel = forwardRef<HTMLDivElement, SummaryPanelProps>(function SummaryPanel({\n\tclassName,\n\tchildren,\n\t...props\n}, ref) {\n\treturn (\n\t\t<Stack\n\t\t\tref={ref}\n\t\t\tgap=\"sm\"\n\t\t\tdata-slot=\"summary-panel\"\n\t\t\tclassName={cn('summary-panel--component min-w-0', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Stack>\n\t);\n});\n\nSummaryPanel.displayName = 'SummaryPanel';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface Discount {\n\t/** Stable identity for this entry. Falls back to the kind, label and position. */\n\tid?: string;\n\t/** Display label. */\n\tlabel: string;\n\t/** Already formatted. Rendered as a deduction whatever sign it carries. */\n\tamount: string;\n\t/** What kind of discount it is (\"Code\", \"Automatic\"), shown quietly beside the amount. */\n\tkind?: ReactNode;\n\t/** The kind as plain text. Kept for existing callers; `kind` wins when both are set. */\n\ttype?: string;\n\t/**\n\t * Draws the kind as a chip in this tone. Discount kinds are categories, so\n\t * pass `neutral` unless the chip states a status. Omit it for the quiet note.\n\t */\n\tbadge?: BadgeTone;\n}\n\nexport interface DiscountStackStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted sum of every discount. */\n\ttotalSavings: string;\n}\n\nexport const defaultDiscountStackStrings: DiscountStackStrings = {\n\ttitle: 'Applied discounts',\n\ttotalSavings: 'Total savings',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface DiscountStackPreviewProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Discounts applied, in the order they stack. */\n\tdiscounts: Discount[];\n\t/** Formatted sum of every discount. */\n\ttotalSavings: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<DiscountStackStrings>;\n}\n\n/** The source kit's name for `DiscountStackPreviewProps`. */\nexport type DiscountStackProps = DiscountStackPreviewProps;\n","/**\n * DiscountStackPreview — the discounts applied to an order, in the order they\n * stack, with the total saved. Every row is a deduction on the shared commerce\n * ledger (`SummaryPanel` + `AmountRow`), so the sign is one U+2212 and the\n * figure is in success ink whatever the caller passed. A discount's kind\n * (\"Code\", \"Automatic\") sits quietly beside the amount; pass a `badge` tone\n * to keep it as a chip instead. The total is ruled off from the rows it sums.\n *\n * `DiscountStack` is the same component under the source kit's name.\n */\nimport type { ReactNode } from 'react';\n\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultDiscountStackStrings, type Discount, type DiscountStackPreviewProps } from './types';\n\nfunction discountKind(discount: Discount): ReactNode {\n\tconst kind = discount.kind ?? discount.type;\n\tif (kind === undefined || kind === null || kind === '') return undefined;\n\treturn discount.badge ? <Badge tone={discount.badge} size=\"sm\">{kind}</Badge> : kind;\n}\n\nexport function DiscountStackPreview({\n\tdiscounts,\n\ttotalSavings,\n\tclassName,\n\tstrings: stringsProp,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\t...props\n}: DiscountStackPreviewProps) {\n\tconst strings = useStrings(defaultDiscountStackStrings, stringsProp);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\tdata-slot=\"discount-stack\"\n\t\t\tclassName={cn('discount-stack--component w-full', className)}\n\t\t>\n\t\t\t<SummaryPanel className=\"discount-stack--ledger\">\n\t\t\t\t{/* A kind is a label, not an identity: two \"Seasonal\" rows once\n\t\t\t\t collided on it. An explicit `id` wins; the index keeps the\n\t\t\t\t fallback key unique without requiring one. */}\n\t\t\t\t{discounts.map((discount, index) => (\n\t\t\t\t\t<AmountRow\n\t\t\t\t\t\tkey={discount.id ?? `${discount.type ?? ''}-${discount.label}-${String(index)}`}\n\t\t\t\t\t\tclassName=\"discount-stack--row\"\n\t\t\t\t\t\tlabel={discount.label}\n\t\t\t\t\t\tnote={discountKind(discount)}\n\t\t\t\t\t\tamount={discount.amount}\n\t\t\t\t\t\tdeduction\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t\t<AmountRow\n\t\t\t\t\tclassName=\"discount-stack--total\"\n\t\t\t\t\tlabel={strings.totalSavings}\n\t\t\t\t\tamount={totalSavings}\n\t\t\t\t\ttotal\n\t\t\t\t\tdeduction\n\t\t\t\t\trollup={discounts.length > 0}\n\t\t\t\t/>\n\t\t\t</SummaryPanel>\n\t\t</Card>\n\t);\n}\n\nDiscountStackPreview.displayName = 'DiscountStackPreview';\n\n/** The source kit's name for `DiscountStackPreview`; the same component. */\nexport const DiscountStack = DiscountStackPreview;\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\n/**\n * Transit stage. Drives the status label (through `strings`) and the tone of\n * the status chip, so a delayed shipment can never be painted as a healthy one.\n */\nexport type ShipmentStatus = 'pending' | 'in_transit' | 'delivered' | 'delayed';\n\n/**\n * Chip tone per stage. `delayed` is a warning, not an error: the parcel is\n * still coming. Primary stays off status chips.\n */\nexport const shipmentStatusTone: Record<ShipmentStatus, BadgeTone> = {\n\tpending: 'neutral',\n\tin_transit: 'info',\n\tdelivered: 'success',\n\tdelayed: 'warning',\n};\n\nexport interface TrackingStep {\n\t/** Stable identity. Falls back to the label and position, so repeated labels never collide. */\n\tid?: string;\n\t/** Display label. */\n\tlabel: string;\n\t/**\n\t * Whether the parcel has reached this checkpoint. The latest reached\n\t * checkpoint stays current until the shipment is delivered.\n\t */\n\tdone: boolean;\n\t/** Already formatted. When the checkpoint was reached: a parcel's rail is a log, not a plan. */\n\ttimestamp?: string;\n}\n\nexport interface ShipmentDetail {\n\t/** Display label. */\n\tlabel: string;\n\tvalue: ReactNode;\n}\n\nexport interface ShipmentTrackingStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Label of the tracking-number row. */\n\ttrackingNumber: string;\n\t/** Label of the carrier row. */\n\tcarrier: string;\n\t/** Accessible name of the copy button beside the tracking number. */\n\tcopyTrackingNumber: string;\n\t/** Status label for each `ShipmentStatus`. */\n\tpending: string;\n\tin_transit: string;\n\tdelivered: string;\n\tdelayed: string;\n}\n\nexport const defaultShipmentTrackingStrings: ShipmentTrackingStrings = {\n\ttitle: 'Shipment tracking',\n\ttrackingNumber: 'Tracking number',\n\tcarrier: 'Carrier',\n\tcopyTrackingNumber: 'Copy tracking number',\n\tpending: 'Pending',\n\tin_transit: 'In transit',\n\tdelivered: 'Delivered',\n\tdelayed: 'Delayed',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface ShipmentTrackingProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Carrier tracking reference. */\n\ttrackingNumber: string;\n\t/** Carrier handling the shipment. */\n\tcarrier?: string;\n\t/** Current transit stage. */\n\tstatus: ShipmentStatus;\n\t/** Tracking checkpoints, oldest first. */\n\tsteps: TrackingStep[];\n\t/** Label/value facts about the shipment. */\n\tdetails?: ShipmentDetail[];\n\t/** Fired after the tracking number is copied to the clipboard. */\n\tonCopyTracking?: (trackingNumber: string) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<ShipmentTrackingStrings>;\n}\n","/**\n * ShipmentTracking — a parcel's tracking number, carrier and checkpoint rail.\n *\n * The title carries the status chip, its tone derived from `status`, so a\n * delayed parcel warns instead of reassuring. The tracking number is a\n * copyable identifier and the carrier a labelled fact, followed by any\n * consumer-supplied details. The facts are a container-adaptive metadata list:\n * each label sits over its value, one column in a narrow rail and two once the\n * block has room, so a long identifier is never squeezed beside its label.\n * The checkpoints are a vertical rail drawn by the\n * shared `Timeline` engine with their timestamps: the latest reached\n * checkpoint is the current step (`aria-current=\"step\"`) until the shipment\n * is delivered, and the rail never runs ahead of a checkpoint not yet reached.\n * Carrier polling and checkpoint normalisation stay app-owned.\n */\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { Copyable } from '../../../base/copyable';\nimport { MetadataList, type MetadataListItem } from '../../../base/metadata-list';\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultShipmentTrackingStrings,\n\tshipmentStatusTone,\n\ttype ShipmentTrackingProps,\n\ttype TrackingStep,\n} from './types';\n\nfunction latestReachedIndex(steps: readonly TrackingStep[]) {\n\tfor (let index = steps.length - 1; index >= 0; index -= 1) {\n\t\tif (steps[index]?.done) return index;\n\t}\n\treturn -1;\n}\n\nexport function ShipmentTracking({\n\ttrackingNumber,\n\tcarrier,\n\tstatus,\n\tsteps,\n\tdetails = [],\n\tonCopyTracking,\n\tclassName,\n\tstrings: stringsProp,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\t...props\n}: ShipmentTrackingProps) {\n\tconst strings = useStrings(defaultShipmentTrackingStrings, stringsProp);\n\n\t// The latest reached checkpoint stays current until delivery; a delivered\n\t// parcel, or one that has reached no checkpoint yet, has no current step.\n\tconst current = status === 'delivered' ? -1 : latestReachedIndex(steps);\n\tconst rail: TimelineItem[] = steps.map((step, index) => ({\n\t\tid: step.id ?? `${step.label}-${String(index)}`,\n\t\ttitle: step.label,\n\t\ttimestamp: step.timestamp,\n\t\tstatus: index === current ? 'current' : step.done ? 'completed' : 'pending',\n\t}));\n\tconst facts: MetadataListItem[] = [\n\t\t{\n\t\t\tid: 'tracking-number',\n\t\t\tlabel: strings.trackingNumber,\n\t\t\tvalue: (\n\t\t\t\t<Copyable\n\t\t\t\t\tvalue={trackingNumber}\n\t\t\t\t\tmono\n\t\t\t\t\ttruncate\n\t\t\t\t\tonCopy={onCopyTracking}\n\t\t\t\t\tstrings={{ copyLabel: strings.copyTrackingNumber }}\n\t\t\t\t\tclassName=\"shipment-tracking--tracking-number\"\n\t\t\t\t/>\n\t\t\t),\n\t\t},\n\t\t...(carrier ? [{ id: 'carrier', label: strings.carrier, value: carrier }] : []),\n\t\t...details.map((detail, index) => ({ id: `detail-${String(index)}`, label: detail.label, value: detail.value })),\n\t];\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={(\n\t\t\t\t<Badge tone={shipmentStatusTone[status]} className=\"shipment-tracking--status\">\n\t\t\t\t\t{strings[status]}\n\t\t\t\t</Badge>\n\t\t\t)}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"shipment-tracking\"\n\t\t\tclassName={cn('shipment-tracking--component w-full', className)}\n\t\t>\n\t\t\t<MetadataList items={facts} columns={{ base: 1, sm: 2 }} className=\"shipment-tracking--facts\" />\n\n\t\t\t{rail.length > 0 && <Timeline items={rail} dotSize=\"sm\" className=\"shipment-tracking--rail\" />}\n\t\t</Card>\n\t);\n}\n\nShipmentTracking.displayName = 'ShipmentTracking';\n","import type { StringsProp } from '../../../../lib/strings';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\n/**\n * The card's content, shared by all five presentations. Every field is\n * pre-formatted display copy — this family renders what it is handed and does\n * no currency or date formatting of its own, so localisation stays with the\n * consumer.\n */\nexport interface GiftcardData {\n\t/** Redemption code, shown in a monospace run. */\n\tcode: string;\n\t/** Formatted face value, e.g. `\"$50.00\"`. */\n\tamount: string;\n\t/** Formatted balance left. Omit for a card that shows only its face value. */\n\tremainingAmount?: string;\n\t/** Currency label shown beside the amount when the formatted values omit it. */\n\tcurrency?: string;\n\t/** Lifecycle state, driving the status chip's tone. */\n\tstatus: 'active' | 'redeemed' | 'expired' | 'disabled';\n\t/** Who the card is for. */\n\trecipientName?: string;\n\t/** Who sent it. */\n\tsenderName?: string;\n\t/** Personal note from the sender. */\n\tmessage?: string;\n\t/** Formatted expiry date. */\n\texpiresAt?: string;\n\t/** Formatted issue date. */\n\tcreatedAt?: string;\n\t/** Design name shown as the card's template label. */\n\ttemplate?: string;\n\t/** Fired by the card's view action. Omit to render the card without it. */\n\tonView?: () => void;\n}\n\n/** Background gradient for the illustrated and full presentations. */\nexport type GradientVariant = 'purple' | 'green' | 'warm';\n/** Decorative overlay drawn on top of the gradient. */\nexport type PatternVariant = 'none' | 'circles' | 'waves';\n/** Accent used for the minimal presentation's rule and highlights. */\nexport type AccentColor = 'green' | 'purple' | 'warm';\n/** Header band colour for the compact presentation. */\nexport type HeaderColor = 'green' | 'blue' | 'amber';\n\nexport type GiftcardStatus = GiftcardData['status'];\n\n/**\n * Localised labels for giftcard cards. Covers status chips, the recurring\n * field labels rendered by all five partials (full / dark / illustrated /\n * minimal / compact), and the inline button labels.\n *\n * Override per-instance via `strings`.\n */\nexport interface GiftcardStrings {\n\tstatus: Record<GiftcardStatus, string>;\n\tgiftCard: string;\n\tbalance: string;\n\tpersonalMessage: string;\n\tto: string;\n\tfrom: string;\n\texpires: string;\n\trecipient: string;\n\tviewDetails: string;\n\tcopyCode: string;\n\t/** Successful code-copy feedback. */\n\tcopiedCode?: string;\n\t/** Failed code-copy feedback and retry affordance. */\n\tcopyFailed?: string;\n\t/** Pending code-copy label. */\n\tcopyingCode?: string;\n}\n\nexport const defaultGiftcardStrings: Required<GiftcardStrings> = {\n\tstatus: {\n\t\tactive: 'Active',\n\t\tredeemed: 'Redeemed',\n\t\texpired: 'Expired',\n\t\tdisabled: 'Disabled',\n\t},\n\tgiftCard: 'Gift card',\n\tbalance: 'Balance',\n\tpersonalMessage: 'Personal message',\n\tto: 'To',\n\tfrom: 'From',\n\texpires: 'Expires',\n\trecipient: 'Recipient',\n\tviewDetails: 'View details',\n\tcopyCode: 'Copy code',\n\tcopiedCode: 'Code copied',\n\tcopyFailed: 'Could not copy code. Try again.',\n\tcopyingCode: 'Copying code…',\n};\n\nexport interface GiftcardCommonProps {\n\t/** Override default English giftcard strings. */\n\tstrings?: StringsProp<GiftcardStrings>;\n}\n\nexport const giftcardStatusTone: Record<\n\tGiftcardStatus,\n\t'success' | 'secondary' | 'destructive' | 'warning'\n> = {\n\tactive: 'success',\n\tredeemed: 'secondary',\n\texpired: 'destructive',\n\tdisabled: 'warning',\n};\n\n// Reading regions stay inverse; preset colors belong to their decorative strip\n// and swatch. The stops are categorical chart roles (plus warning's decorative\n// highlight): their hues hold in both modes and stay legible on the inverse\n// face. Primary is never a stop: it is near-black in the default theme and\n// vanishes into the inverse header.\nconst inverseGradient = 'bg-inverse-background from-inverse-background via-inverse-surface to-inverse-background';\n\nconst presetStops = {\n\tpurple: 'from-chart-3 to-chart-4',\n\tgreen: 'from-chart-1 to-chart-2',\n\twarm: 'from-chart-5 to-warning',\n\tblue: 'from-chart-2 to-chart-3',\n} as const;\n\nexport const gradientMap: Record<GradientVariant, { card: string; strip: string }> = {\n\tpurple: {\n\t\tcard: inverseGradient,\n\t\tstrip: presetStops.purple,\n\t},\n\tgreen: {\n\t\tcard: inverseGradient,\n\t\tstrip: presetStops.green,\n\t},\n\twarm: {\n\t\tcard: inverseGradient,\n\t\tstrip: presetStops.warm,\n\t},\n};\n\nexport const compactGradientMap: Record<GradientVariant, string> = {\n\tpurple: presetStops.purple,\n\tgreen: presetStops.green,\n\twarm: presetStops.warm,\n};\n\nexport const accentColorMap: Record<AccentColor, { line: string; iconBg: string }> = {\n\tgreen: { line: toneRecipes.success.solid, iconBg: `${toneRecipes.success.tint} ${toneRecipes.success.ink}` },\n\tpurple: { line: toneRecipes.primary.solid, iconBg: `${toneRecipes.primary.tint} ${toneRecipes.primary.ink}` },\n\twarm: { line: toneRecipes.warning.solid, iconBg: `${toneRecipes.warning.tint} ${toneRecipes.warning.ink}` },\n};\n\nexport const headerGradientMap: Record<HeaderColor, string> = {\n\tgreen: presetStops.green,\n\tblue: presetStops.blue,\n\tamber: presetStops.warm,\n};\n\n","/**\n * GiftcardCompact — single-row compact layout. A small card-art swatch (the\n * chosen gradient around the inverse card face) on the left, code + recipient\n * in the middle, amount + status badge on the right. Use for inline lists /\n * tables of giftcards. Strings overridable.\n */\nimport { Badge } from '../../../../base/badge';\nimport { MonoValue, Value } from '../../../../primitives';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../../base/item';\nimport { Stack } from '../../../../base/structure';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype GradientVariant,\n\tcompactGradientMap,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCompact({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\tgradient = 'purple',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Background gradient for the leading block. */\n\tgradient?: GradientVariant;\n\t/** Merged onto the row root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\n\treturn (\n\t\t<Item\n\t\t\tsize=\"sm\"\n\t\t\tvariant=\"outline\"\n\t\t\tpadding=\"default\"\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-compact--component flex-nowrap shadow-sm transition-colors duration-150 hover:border-border',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<ItemMedia variant=\"image\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'flex size-full items-center justify-center bg-gradient-to-br p-space-2xs',\n\t\t\t\t\t\tcompactGradientMap[gradient],\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"size-full rounded-radius bg-inverse-background\" />\n\t\t\t\t</div>\n\t\t\t</ItemMedia>\n\n\t\t\t<ItemContent className=\"min-w-0\">\n\t\t\t\t<ItemTitle className=\"w-full max-w-full truncate whitespace-nowrap\">\n\t\t\t\t\t<MonoValue type=\"inherit\">{code}</MonoValue>\n\t\t\t\t</ItemTitle>\n\t\t\t\t{!!recipientName && <ItemDescription clamp={1}>{recipientName}</ItemDescription>}\n\t\t\t</ItemContent>\n\n\t\t\t<ItemActions className=\"shrink-0\">\n\t\t\t\t<Stack gap=\"2xs\" align=\"end\" className=\"shrink-0\">\n\t\t\t\t\t<div className=\"flex items-baseline gap-space-xs\">\n\t\t\t\t\t\t<Value type=\"inherit\" weight=\"bold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t<Value size=\"xs\" className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t<Badge tone={statusTone} size=\"sm\">{statusLabel}</Badge>\n\t\t\t\t</Stack>\n\t\t\t</ItemActions>\n\t\t</Item>\n\t);\n}\n\nGiftcardCompact.displayName = 'GiftcardCompact';\n","import { useEffect, useRef, useState } from 'react';\nimport { Check, Copy, Loader2, X } from 'lucide-react';\nimport { Button } from '../../../../base/buttons';\nimport { Text } from '../../../../typography';\nimport { cn } from '../../../../../lib/utils';\nimport { defaultGiftcardStrings, type GiftcardStrings } from '../types';\nimport { useStrings } from '../../../../../lib/strings';\n\ntype CopyState = 'idle' | 'pending' | 'copied' | 'failed';\n\n/** Owns the four giftcard code actions without changing their display strips. */\nexport function GiftcardCopyButton({ code, strings, inverse = false, className }: {\n code: string;\n strings: Pick<GiftcardStrings, 'copyCode' | 'copiedCode' | 'copyFailed' | 'copyingCode'>;\n /** Explicit inverse reading surface, independent of the surrounding page theme. */\n inverse?: boolean;\n className?: string;\n}) {\n const copyStrings = useStrings<Required<GiftcardStrings>>(defaultGiftcardStrings, strings);\n const generation = useRef(0);\n const [result, setResult] = useState<{ code: string; state: CopyState }>({code, state: 'idle'});\n const state = result.code === code ? result.state : 'idle';\n useEffect(() => {\n generation.current++;\n setResult(previous => previous.code === code ? previous : {code, state: 'idle'});\n return () => { generation.current++; };\n }, [code]);\n const label = state === 'copied' ? copyStrings.copiedCode : state === 'failed' ? copyStrings.copyFailed : state === 'pending' ? copyStrings.copyingCode : copyStrings.copyCode;\n const Icon = state === 'copied' ? Check : state === 'failed' ? X : state === 'pending' ? Loader2 : Copy;\n const copy = async () => {\n if (!code || state === 'pending') return;\n const request = generation.current;\n setResult({code, state: 'pending'});\n try {\n await navigator.clipboard.writeText(code);\n if (generation.current === request) setResult({code, state: 'copied'});\n } catch {\n if (generation.current === request) setResult({code, state: 'failed'});\n }\n };\n return <>\n <Button\n type=\"button\" tone=\"secondary\" buttonStyle=\"ghost\" size=\"sm\" iconOnly\n disabled={!code || state === 'pending'} aria-busy={state === 'pending'}\n aria-label={label} withTooltip={label}\n className={cn(\n 'giftcard-copy--component', className,\n // Use the same complete state selector as the shared Button recipe so cn\n // replaces its page-themed fill instead of leaving a more specific rule.\n inverse && 'text-inverse-foreground [&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-inverse-surface [&:hover:not(:active):not(:disabled):not([data-disabled]):not([aria-disabled=true])]:text-inverse-foreground [&:active:not(:disabled):not([data-disabled]):not([aria-disabled=true])]:bg-inverse-surface-strong focus-visible:bg-inverse-surface',\n )}\n onClick={() => void copy()}\n >\n <Icon aria-hidden className={cn('size-icon-sm', state === 'pending' && 'animate-spin')} />\n </Button>\n {(state === 'copied' || state === 'failed') && <Text tag=\"span\" role=\"status\" className=\"sr-only\">{label}</Text>}\n </>;\n}\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardDark — premium dark variant. Header label and status chip,\n * balance + strike-through line, code strip, metadata rows\n * (recipient / expires), and a full-width call to action. Strings\n * overridable for i18n.\n */\nimport { Heading } from '../../../../typography/heading';\nimport { Text } from '../../../../typography/text';\nimport { Badge } from '../../../../base/badge';\nimport { Card } from '../../../../base/cards';\nimport { Button } from '../../../../base/buttons';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { Stack } from '../../../../base/structure';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCardDark({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & { className?: string }) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\t// The card, scoped to the dark theme, is the one inset owner for label,\n\t// amount, code strip, facts and action, so every region starts on the same edge.\n\treturn (\n\t\t<Card\n\t\t\tsurface=\"card\"\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-dark--component dark max-w-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Stack gap=\"lg\" className=\"giftcard-dark--body\">\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"center\" gap=\"md\" wrap={false}>\n\t\t\t\t\t<Text tag=\"span\" className=\"text-inverse-muted\">\n\t\t\t\t\t\t{strings.giftCard}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Badge tone={statusTone} className=\"shrink-0\">{statusLabel}</Badge>\n\t\t\t\t</Stack>\n\n\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"tabular-nums text-inverse-foreground\">\n\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-inverse-disabled\">\n\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"giftcard-dark--code rounded-radius border border-inverse-border bg-inverse-surface p-surface-xs\">\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t\t<MonoValue className=\"flex-1 tracking-[0.15em] text-inverse-foreground\">\n\t\t\t\t\t\t\t{code}\n\t\t\t\t\t\t</MonoValue>\n\t\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} inverse />\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t\t<MetadataList\n\t\t\t\t\titems={metadataItems}\n\t\t\t\t\tcolumns={1}\n\t\t\t\t\tclassName=\"[&_.metadata-list--label]:text-inverse-muted [&_.metadata-list--value]:text-inverse-foreground\"\n\t\t\t\t/>\n\n\t\t\t\t{/* Inverse button on the dark surface so the label always reads\n\t\t\t\t without raw palette overrides. */}\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"neutral\"\n\t\t\t\t\t\tbuttonStyle=\"solid\"\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nGiftcardCardDark.displayName = 'GiftcardCardDark';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCard (full) — premium gradient layout with optional\n * pattern overlay (circles / waves), header status chip, balance / strike-\n * through line, copyable code strip, personal message block, and metadata\n * grid (To / From / Expires). Strings overridable for i18n.\n */\nimport { DisplayLabel } from '../../../../typography/display-label';\nimport { Text } from '../../../../typography/text';\nimport { Heading } from '../../../../typography/heading';\nimport { Badge } from '../../../../base/badge';\nimport { Button } from '../../../../base/buttons';\nimport { Stack } from '../../../../base/structure';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype GradientVariant,\n\ttype PatternVariant,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n\tgradientMap,\n} from '../types';\n\nexport function GiftcardFull({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\tsenderName,\n\tmessage,\n\texpiresAt,\n\tcreatedAt: _createdAt,\n\ttemplate: _template,\n\tonView,\n\tgradient = 'purple',\n\tpattern = 'none',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData &\n\tGiftcardCommonProps & {\n\t\t/** Background gradient. */\n\t\tgradient?: GradientVariant;\n\t\t/** Decorative overlay on the gradient. */\n\t\tpattern?: PatternVariant;\n\t\tclassName?: string;\n\t}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.to, value: recipientName }] : []),\n\t\t...(senderName ? [{ label: strings.from, value: senderName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component w-full max-w-sm transition-shadow',\n\t\t\t\t'hover:shadow-md',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{/* Gift card header */}\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'relative overflow-hidden rounded-t-surface bg-linear-to-br p-surface',\n\t\t\t\t\tgradientMap[gradient].card,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<div aria-hidden className={cn('absolute inset-x-0 top-0 z-10 h-1 bg-gradient-to-r', gradientMap[gradient].strip)} />\n\t\t\t\t{/* Pattern: circles */}\n\t\t\t\t{pattern === 'circles' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"absolute -top-8 -right-8 h-32 w-32 rounded-full bg-inverse-decoration\" aria-hidden=\"true\" />\n\t\t\t\t\t\t<div className=\"absolute -bottom-4 -left-4 h-20 w-20 rounded-full bg-inverse-decoration\" aria-hidden=\"true\" />\n\t\t\t\t\t</>\n\t\t\t\t)}\n\n\t\t\t\t{/* Pattern: waves */}\n\t\t\t\t{pattern === 'waves' && (\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclassName=\"absolute inset-0 h-full w-full opacity-5\"\n\t\t\t\t\t\tviewBox=\"0 0 400 200\"\n\t\t\t\t\t\tpreserveAspectRatio=\"none\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path d=\"M0 80 C100 20, 200 140, 400 60 L400 200 L0 200 Z\" className=\"fill-inverse-foreground\" />\n\t\t\t\t\t\t<path d=\"M0 120 C120 60, 280 180, 400 100 L400 200 L0 200 Z\" className=\"fill-inverse-foreground\" />\n\t\t\t\t\t</svg>\n\t\t\t\t)}\n\n\t\t\t\t<div className=\"absolute top-4 right-4 z-10\">\n\t\t\t\t\t<Badge\n\t\t\t\t\t\ttone={statusTone}\n\t\t\t\t\t\tinline\n\t\t\t\t\t\tdot\n\t\t\t\t\t\tclassName=\"border border-inverse-border bg-inverse-background text-inverse-foreground shadow-sm\"\n\t\t\t\t\t\tdata-status={statusTone}\n\t\t\t\t\t>\n\t\t\t\t\t\t{statusLabel}\n\t\t\t\t\t</Badge>\n\t\t\t\t</div>\n\n\t\t\t\t<Stack gap=\"xl\" className=\"relative z-10\">\n\t\t\t\t\t<Text weight=\"medium\" className=\"text-inverse-muted\">{strings.giftCard}</Text>\n\n\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t<DisplayLabel tone=\"inverse\">{strings.balance}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" gap=\"lg\">\n\t\t\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"text-inverse-foreground tabular-nums drop-shadow-sm\">\n\t\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-inverse-disabled\">{amount}</Value>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{/* Code strip — premium feel */}\n\t\t\t\t\t<div className={cn(\n\t\t\t\t\t\t\t'giftcard-full--code',\n\t\t\t\t\t\t\t'rounded-radius p-surface-xs',\n\t\t\t\t\t\t\t'bg-inverse-surface',\n\t\t\t\t\t\t\t'border border-inverse-border',\n\t\t\t\t\t\t\t'shadow-sm',\n\t\t\t\t\t\t)}>\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t\t<MonoValue weight=\"semibold\" className=\"flex-1 tracking-[0.2em] text-inverse-foreground\">\n\t\t\t\t\t\t\t{code}\n\t\t\t\t\t\t</MonoValue>\n\t\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} inverse />\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t{/* Details section — structured metadata grid */}\n\t\t\t\t<div className=\"box-border rounded-b-surface bg-card text-card-foreground p-surface shadow-sm border border-t-0 border-border\">\n\t\t\t\t<Stack gap=\"xl\">\n\t\t\t\t{!!message && (\n\t\t\t\t\t<Stack gap=\"normal\" className=\"giftcard-full--message\">\n\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t{strings.personalMessage}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t<Text type=\"secondary\" lineHeight=\"relaxed\" className=\"italic\">\n\t\t\t\t\t\t\t&ldquo;{message}&rdquo;\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\n\t\t\t\t<MetadataList\n\t\t\t\t\tadaptTo=\"container\"\n\t\t\t\t\titems={metadataItems}\n\t\t\t\t\tcolumns={{ base: 1, sm: 2 }}\n\t\t\t\t/>\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nGiftcardFull.displayName = 'GiftcardFull';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardIllustrated — gift-card surface with a compact illustrated\n * header, balance + status row, code strip, details, and a footer action.\n * Strings are overridable for i18n.\n */\nimport { DisplayLabel } from '../../../../typography/display-label';\nimport { Text } from '../../../../typography/text';\nimport { Heading } from '../../../../typography/heading';\nimport { Badge } from '../../../../base/badge';\nimport { Card } from '../../../../base/cards';\nimport { Button } from '../../../../base/buttons';\nimport { Stack } from '../../../../base/structure';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { cn } from '../../../../../lib/utils';\nimport {\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\ttype HeaderColor,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n\theaderGradientMap,\n} from '../types';\n\nexport function GiftcardCardIllustrated({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\theaderColor = 'green',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Colour of the header band. */\n\theaderColor?: HeaderColor;\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\t// The card owns the frame; the illustrated band bleeds to its edges like\n\t// media, and the body below owns the one content inset.\n\treturn (\n\t\t<Card\n\t\t\tsurface=\"card\"\n\t\t\tpadding=\"none\"\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-illustrated--component max-w-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<div className=\"relative flex h-16 items-center justify-between overflow-hidden bg-inverse-background bg-gradient-to-br from-inverse-background via-inverse-surface to-inverse-background px-surface\">\n\t\t\t\t<div aria-hidden className={cn('absolute inset-x-0 top-0 h-1 bg-gradient-to-r', headerGradientMap[headerColor])} />\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"absolute inset-0 opacity-80\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundImage:\n\t\t\t\t\t\t\t'repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in oklch, var(--inverse-foreground) 3%, transparent) 10px 20px)',\n\t\t\t\t\t}}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"relative\">\n\t\t\t\t\t{strings.giftCard}\n\t\t\t\t</DisplayLabel>\n\t\t\t</div>\n\n\t\t\t<Stack gap=\"lg\" className=\"giftcard-illustrated--body p-surface\">\n\t\t\t\t<div className=\"flex items-start justify-between\">\n\t\t\t\t\t<Stack gap=\"dense\">\n\t\t\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"tabular-nums text-inherit\">\n\t\t\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t{strings.balance}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Badge tone={statusTone}>{statusLabel}</Badge>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"giftcard-illustrated--code rounded-radius border border-border bg-muted/30 p-surface-xs\">\n\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\">\n\t\t\t\t\t<MonoValue type=\"inherit\" className=\"flex-1 tracking-[0.15em]\">\n\t\t\t\t\t\t{code}\n\t\t\t\t\t</MonoValue>\n\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} />\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t\t<MetadataList adaptTo=\"container\" items={metadataItems} columns={2} />\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tonClick={onView}\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nGiftcardCardIllustrated.displayName = 'GiftcardCardIllustrated';\n","import { GiftcardCopyButton } from './giftcard-copy-button';\n/**\n * GiftcardCardMinimal — clean minimal layout. A small accent line (driven by\n * `color`) sits above the header label, balance, code strip, and metadata\n * rows. Footer \"View details\" link uses an arrow affordance.\n * Strings overridable for i18n.\n */\nimport { Heading } from '../../../../typography/heading';\nimport { Text } from '../../../../typography/text';\nimport { Badge } from '../../../../base/badge';\nimport { Card } from '../../../../base/cards';\nimport { TextButton } from '../../../../base/buttons';\nimport { MetadataList, type MetadataListItem } from '../../../../base/metadata-list';\nimport { MonoValue, Value } from '../../../../primitives';\nimport { useStrings } from '../../../../../lib/strings';\nimport { Stack } from '../../../../base/structure';\nimport { cn } from '../../../../../lib/utils';\nimport { ArrowRight } from 'lucide-react';\nimport {\n\ttype AccentColor,\n\ttype GiftcardCommonProps,\n\ttype GiftcardData,\n\taccentColorMap,\n\tdefaultGiftcardStrings,\n\tgiftcardStatusTone,\n} from '../types';\n\nexport function GiftcardCardMinimal({\n\tcode,\n\tamount,\n\tremainingAmount,\n\tstatus,\n\trecipientName,\n\texpiresAt,\n\tonView,\n\tcolor = 'green',\n\tclassName,\n\tstrings: stringsProp,\n}: GiftcardData & GiftcardCommonProps & {\n\t/** Accent for the rule and highlights. */\n\tcolor?: AccentColor;\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}) {\n\tconst strings = useStrings(defaultGiftcardStrings, stringsProp);\n\tconst statusLabel = strings.status[status];\n\tconst statusTone = giftcardStatusTone[status];\n\tconst isPartiallyUsed = !!remainingAmount && remainingAmount !== amount;\n\tconst displayAmount = isPartiallyUsed ? remainingAmount : amount;\n\tconst accent = accentColorMap[color];\n\tconst metadataItems: MetadataListItem[] = [\n\t\t...(recipientName ? [{ label: strings.recipient, value: recipientName }] : []),\n\t\t...(expiresAt ? [{ label: strings.expires, value: expiresAt }] : []),\n\t];\n\n\t// One inset owner, the card: the accent rule, label, amount, code, facts and\n\t// link all start on the same edge. Only the code strip keeps its own inset,\n\t// because it is a distinct copyable object.\n\treturn (\n\t\t<Card\n\t\t\tsurface=\"card\"\n\t\t\tclassName={cn(\n\t\t\t\t'giftcard-card--component giftcard-minimal--component max-w-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Stack gap=\"lg\" className=\"giftcard-minimal--body\">\n\t\t\t\t<div aria-hidden=\"true\" className={cn('h-1 w-12 rounded-radius-sm', accent.line)} />\n\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"center\" gap=\"md\" wrap={false}>\n\t\t\t\t\t<Text tag=\"span\" type=\"secondary\">\n\t\t\t\t\t\t{strings.giftCard}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Badge tone={statusTone} size=\"sm\" className=\"shrink-0\">{statusLabel}</Badge>\n\t\t\t\t</Stack>\n\n\t\t\t\t<div className=\"flex items-baseline gap-space-md\">\n\t\t\t\t\t<Heading tag=\"h2\" size=\"2xl\" className=\"tabular-nums text-inherit\">\n\t\t\t\t\t\t{displayAmount}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!isPartiallyUsed && (\n\t\t\t\t\t\t<Value className=\"line-through tabular-nums text-muted-foreground\">\n\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"giftcard-minimal--code rounded-radius border border-border bg-muted/30 p-surface-xs\">\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\">\n\t\t\t\t\t\t<MonoValue type=\"inherit\" className=\"flex-1 tracking-[0.15em]\">\n\t\t\t\t\t\t\t{code}\n\t\t\t\t\t\t</MonoValue>\n\t\t\t\t\t\t<GiftcardCopyButton code={code} strings={strings} className=\"shrink-0\" />\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\n\t\t\t\t<MetadataList\n\t\t\t\t\titems={metadataItems}\n\t\t\t\t\tcolumns={1}\n\t\t\t\t\tdensity=\"compact\"\n\t\t\t\t\tclassName=\"[&_.metadata-list--grid]:gap-space-sm\"\n\t\t\t\t/>\n\n\t\t\t\t{!!onView && (\n\t\t\t\t\t<TextButton onClick={onView} className=\"group/link self-start\">\n\t\t\t\t\t\t{strings.viewDetails}\n\t\t\t\t\t\t<ArrowRight aria-hidden=\"true\" className=\"ml-1 size-icon-sm transition-transform group-hover/link:translate-x-0.5\" />\n\t\t\t\t\t</TextButton>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nGiftcardCardMinimal.displayName = 'GiftcardCardMinimal';\n","import { GiftcardCompact } from './partials/giftcard-compact';\nimport { GiftcardCardDark } from './partials/giftcard-dark';\nimport { GiftcardFull } from './partials/giftcard-full';\nimport { GiftcardCardIllustrated } from './partials/giftcard-illustrated';\nimport { GiftcardCardMinimal } from './partials/giftcard-minimal';\nimport type {\n\tAccentColor,\n\tGiftcardCommonProps,\n\tGiftcardData,\n\tGradientVariant,\n\tHeaderColor,\n\tPatternVariant,\n} from './types';\nimport { cn } from '../../../../lib/utils';\n\nexport type GiftcardCardVariant =\n\t| 'gradient'\n\t| 'compact'\n\t| 'minimal'\n\t| 'dark'\n\t| 'illustrated';\n\ninterface GiftcardCardSharedProps extends GiftcardData, GiftcardCommonProps {\n\t/** Merged onto the card root. */\n\tclassName?: string;\n}\n\n/**\n * Each variant admits only the styling prop it can actually use; the others are\n * typed `never`, so passing `headerColor` to the gradient card is a type error\n * rather than a silently ignored prop.\n */\nexport type GiftcardCardProps = GiftcardCardSharedProps & (\n\t| {\n\t\t/** Premium gradient card. The default presentation. */\n\t\tvariant?: 'gradient';\n\t\t/** Background gradient. Default: `purple`. */\n\t\tgradient?: GradientVariant;\n\t\t/** Decorative overlay on the gradient. Default: `none`. */\n\t\tpattern?: PatternVariant;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Short row for collections and lists. */\n\t\tvariant: 'compact';\n\t\t/** Background gradient for the row's leading block. */\n\t\tgradient?: GradientVariant;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Restrained card that inherits the surrounding surface. */\n\t\tvariant: 'minimal';\n\t\t/** Accent for the rule and highlights. */\n\t\tcolor?: AccentColor;\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Solid dark card, for light surfaces that need contrast. */\n\t\tvariant: 'dark';\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t\theaderColor?: never;\n\t}\n\t| {\n\t\t/** Illustrated card with a coloured header band. */\n\t\tvariant: 'illustrated';\n\t\t/** Colour of the header band. */\n\t\theaderColor?: HeaderColor;\n\t\tgradient?: never;\n\t\tpattern?: never;\n\t\tcolor?: never;\n\t}\n);\n\n/**\n * GiftcardCard — one gift-card data contract with five deliberate visual\n * variants. The premium gradient card is the useful default; compact is for\n * collection rows, while minimal, dark, and illustrated are explicit styles.\n */\nexport function GiftcardCard(props: GiftcardCardProps) {\n\tconst className = cn('giftcard-card--component', props.className);\n\tswitch (props.variant) {\n\t\tcase 'compact':\n\t\t\treturn <GiftcardCompact {...props} className={className} />;\n\t\tcase 'minimal':\n\t\t\treturn <GiftcardCardMinimal {...props} className={className} />;\n\t\tcase 'dark':\n\t\t\treturn <GiftcardCardDark {...props} className={className} />;\n\t\tcase 'illustrated':\n\t\t\treturn <GiftcardCardIllustrated {...props} className={className} />;\n\t\tdefault:\n\t\t\treturn <GiftcardFull {...props} className={className} />;\n\t}\n}\n\nGiftcardCard.displayName = 'GiftcardCard';\n","import type { SmartCardSurface } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\nimport type { ReactNode } from 'react';\nimport type { SemanticTone } from '../../../../lib/component-vocabulary';\n\nexport type VendorProfileChangeTone = Extract<\n\tSemanticTone,\n\t'secondary' | 'success' | 'warning' | 'destructive'\n>;\n\n/** The two data views available when a dossier has overview and performance data. */\nexport type VendorProfileView = 'overview' | 'stats';\n\n/** A performance tile shown in the stats view. */\nexport interface VendorProfileStat {\n\t/** Stable key used when the stat collection changes order. */\n\tid?: string;\n\t/** Consumer-owned stat label. */\n\tlabel: ReactNode;\n\t/** Display value; prefer package primitives such as Money, Number, or Percent. */\n\tvalue: ReactNode;\n\t/** Optional comparison value rendered as a badge. */\n\tchange?: ReactNode;\n\t/** Explicit semantic meaning of the comparison. Defaults to neutral secondary. */\n\tchangeTone?: VendorProfileChangeTone;\n}\n\n/** An operational label/value row shown in the overview view. */\nexport interface VendorProfileMetric {\n\t/** Stable key used when the metric collection changes order. */\n\tid?: string;\n\t/** Consumer-owned metric label. */\n\tlabel: ReactNode;\n\t/** Display value; prefer a semantic package primitive when one exists. */\n\tvalue: ReactNode;\n}\n\n/**\n * Localised labels for VendorProfileCard. Override per-instance via `strings`.\n */\nexport interface VendorProfileStrings {\n\t/** Label for the operating overview tab. */\n\ttabOverview: string;\n\t/** Label for the performance statistics tab. */\n\ttabStats: string;\n\t/** Label above the primary earnings value. */\n\ttotalEarnings: string;\n\t/** Label for the message action. */\n\tmessage: string;\n\t/** Label for the engagement action. */\n\thire: string;\n\t/** Accessible and visible label for the verified badge. */\n\tverifiedAriaLabel: string;\n}\n\nexport const defaultVendorProfileStrings: VendorProfileStrings = {\n\ttabOverview: 'Overview',\n\ttabStats: 'Stats',\n\ttotalEarnings: 'Total earnings',\n\tmessage: 'Message',\n\thire: 'Hire vendor',\n\tverifiedAriaLabel: 'Verified',\n};\n\nexport interface VendorProfileCardProps {\n\t/** Vendor display name used by the identity header and avatar fallback. */\n\tname: string;\n\t/** Explicit avatar fallback text. Derived from `name` when omitted. */\n\tinitials?: string;\n\t/** Optional vendor avatar URL. */\n\tavatarUrl?: string;\n\t/** Secondary identity context such as category, market, or location. */\n\trole?: ReactNode;\n\t/** Shows the localized verified badge when true. */\n\tverified?: boolean;\n\t/** Primary earnings display; prefer the canonical Money primitive. */\n\tearnings?: ReactNode;\n\t/** Optional comparison rendered beside earnings. */\n\tearningsChange?: ReactNode;\n\t/** Explicit semantic meaning of `earningsChange`. Defaults to neutral secondary. */\n\tearningsChangeTone?: VendorProfileChangeTone;\n\t/** Operational rows rendered in the overview view. */\n\tmetrics?: VendorProfileMetric[];\n\t/** Performance tiles rendered in the stats view. */\n\tstats?: VendorProfileStat[];\n\t/** Controlled active view. Only used when both overview and stats exist. */\n\tview?: VendorProfileView;\n\t/** Initial active view for uncontrolled usage. Defaults to `overview`. */\n\tdefaultView?: VendorProfileView;\n\t/** Called when the user requests a different view in either state mode. */\n\tonViewChange?: (view: VendorProfileView) => void;\n\t/** Shows the message action and delegates its behavior to the consumer. */\n\tonMessage?: () => void;\n\t/** Shows the engagement action and delegates its behavior to the consumer. */\n\tonHire?: () => void;\n\t/**\n\t * Card surface override. Defaults through the shared SmartCard configuration.\n\t * `flat` also drops the dossier's own insets, so the embedding surface owns them.\n\t */\n\tsurface?: SmartCardSurface;\n\t/** Card density override. Defaults through the shared SmartCard configuration. */\n\t/** Additional classes applied to the outer SmartCard element. */\n\tclassName?: string;\n\t/** Deep-partial localized label overrides. */\n\tstrings?: StringsProp<VendorProfileStrings>;\n}\n","/**\n * VendorProfileCard — a compact vendor dossier with identity, earnings,\n * operating metrics, performance stats, and callback-driven actions.\n *\n * The component owns card chrome because it is a fixed-format profile card.\n * Consumers can still opt into `surface=\"flat\"` when embedding the dossier in\n * a larger surface. Its overview/stats view supports controlled and\n * uncontrolled state. Tabs only render when both content views are available;\n * an identity-only profile never grows dead controls or actions.\n */\nimport {compositionClasses} from '../../../base/structure/composition.recipes';\nimport { ChevronRight } from 'lucide-react';\nimport { forwardRef, type ReactNode, useState } from 'react';\n\nimport { Avatar, AvatarFallback, AvatarImage } from '../../../base/avatar';\nimport { Badge, type BadgeProps } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { hasRenderableContent, Card } from '../../../base/cards';\nimport {\n\tItem,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../base/navigation/tabs';\nimport { Grid, Stack } from '../../../base/structure';\nimport { InlineStat } from '../../data-display';\nimport { Initials, Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultVendorProfileStrings,\n\ttype VendorProfileCardProps,\n\ttype VendorProfileChangeTone,\n\ttype VendorProfileView,\n} from './types';\n\nconst CHANGE_VARIANTS: Record<\n\tVendorProfileChangeTone,\n\tNonNullable<BadgeProps['tone']>\n> = {\n\tsecondary: 'secondary',\n\tsuccess: 'success',\n\twarning: 'warning',\n\tdestructive: 'destructive',\n};\n\nfunction ChangeBadge({\n\tchildren,\n\ttone,\n}: {\n\tchildren?: ReactNode;\n\ttone?: VendorProfileChangeTone;\n}) {\n\tif (!hasRenderableContent(children)) return null;\n\n\treturn (\n\t\t<Badge\n\t\t\ttone={CHANGE_VARIANTS[tone ?? 'secondary']}\n\t\t\tclassName=\"vendor-profile--change shrink-0 tabular-nums\"\n\t\t>\n\t\t\t{children}\n\t\t</Badge>\n\t);\n}\n\nexport const VendorProfileCard = forwardRef<HTMLDivElement, VendorProfileCardProps>(\n\tfunction VendorProfileCard(\n\t\t{\n\t\t\tname,\n\t\t\tinitials,\n\t\t\tavatarUrl,\n\t\t\trole,\n\t\t\tverified = false,\n\t\t\tearnings,\n\t\t\tearningsChange,\n\t\t\tearningsChangeTone,\n\t\t\tmetrics = [],\n\t\t\tstats = [],\n\t\t\tview,\n\t\t\tdefaultView = 'overview',\n\t\t\tonViewChange,\n\t\t\tonMessage,\n\t\t\tonHire,\n\t\t\tsurface,\n\t\t\tclassName,\n\t\t\tstrings: stringsProp,\n\t\t}: VendorProfileCardProps,\n\t\tref,\n\t) {\n\t\tconst strings = useStrings(defaultVendorProfileStrings, stringsProp);\n\t\tconst [internalView, setInternalView] = useState<VendorProfileView>(defaultView);\n\t\tconst isViewControlled = view !== undefined;\n\n\t\tconst hasEarnings = hasRenderableContent(earnings);\n\t\tconst hasOverviewContent = hasEarnings || metrics.length > 0;\n\t\tconst hasStatsContent = stats.length > 0;\n\t\tconst availableTabs: VendorProfileView[] = [\n\t\t\t...(hasOverviewContent ? (['overview'] as const) : []),\n\t\t\t...(hasStatsContent ? (['stats'] as const) : []),\n\t\t];\n\t\tconst requestedView = isViewControlled ? view : internalView;\n\t\tconst activeView = availableTabs.includes(requestedView)\n\t\t\t? requestedView\n\t\t\t: availableTabs[0] ?? 'overview';\n\t\tconst hasBody = availableTabs.length > 0;\n\t\tconst hasActions = Boolean(onMessage || onHire);\n\t\tconst handleViewChange = (nextValue: string) => {\n\t\t\tif (nextValue !== 'overview' && nextValue !== 'stats') return;\n\t\t\tif (!availableTabs.includes(nextValue)) return;\n\t\t\tif (!isViewControlled) setInternalView(nextValue);\n\t\t\tonViewChange?.(nextValue);\n\t\t};\n\n\t\t// Earnings and stats are plain label/value facts on the card surface; the\n\t\t// change chip follows its value instead of floating at the far edge.\n\t\tconst overviewContent = (\n\t\t\t<Stack gap=\"xl\" className=\"vendor-profile--overview\">\n\t\t\t\t{hasEarnings && (\n\t\t\t\t\t<Stack gap=\"normal\" className=\"vendor-profile--earnings\">\n\t\t\t\t\t\t<DisplayLabel>{strings.totalEarnings}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"baseline\">\n\t\t\t\t\t\t\t<Value type=\"inherit\" size=\"base\" weight=\"semibold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t{earnings}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t<ChangeBadge tone={earningsChangeTone}>{earningsChange}</ChangeBadge>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\n\t\t\t\t{metrics.length > 0 && (\n\t\t\t\t\t<div className=\"vendor-profile--metrics divide-y divide-border/60\">\n\t\t\t\t\t\t{metrics.map((metric, index) => (\n\t\t\t\t\t\t\t<InlineStat\n\t\t\t\t\t\t\t\tkey={metric.id ?? index}\n\t\t\t\t\t\t\t\tclassName=\"py-row-y first:pt-0 last:pb-0\"\n\t\t\t\t\t\t\t\tlabel={metric.label}\n\t\t\t\t\t\t\t\tvalue={metric.value}\n\t\t\t\t\t\t\t\tvalueWeight=\"medium\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t);\n\n\t\tconst statsContent = (\n\t\t\t<Grid columns={{ base: 1, sm: 2 }} gap=\"xl\" className=\"vendor-profile--stats\">\n\t\t\t\t{stats.map((stat, index) => (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tkey={stat.id ?? index}\n\t\t\t\t\t\tgap=\"normal\"\n\t\t\t\t\t\tclassName=\"vendor-profile--stat\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<DisplayLabel className=\"truncate\">{stat.label}</DisplayLabel>\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"baseline\">\n\t\t\t\t\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"min-w-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{stat.value}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t<ChangeBadge tone={stat.changeTone}>{stat.change}</ChangeBadge>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</Stack>\n\t\t\t\t))}\n\t\t\t</Grid>\n\t\t);\n\n\t\tconst profileBody = availableTabs.length > 1 ? (\n\t\t\t<Tabs\n\t\t\t\tvalue={activeView}\n\t\t\t\tonValueChange={handleViewChange}\n\t\t\t\tclassName=\"vendor-profile--tabs gap-space-lg\"\n\t\t\t>\n\t\t\t\t<TabsList className=\"grid h-auto w-full grid-cols-2 rounded-radius p-space-xs\">\n\t\t\t\t\t<TabsTrigger value=\"overview\" className=\"h-action-sm rounded-radius px-control-sm text-pxs\">\n\t\t\t\t\t\t{strings.tabOverview}\n\t\t\t\t\t</TabsTrigger>\n\t\t\t\t\t<TabsTrigger value=\"stats\" className=\"h-action-sm rounded-radius px-control-sm text-pxs\">\n\t\t\t\t\t\t{strings.tabStats}\n\t\t\t\t\t</TabsTrigger>\n\t\t\t\t</TabsList>\n\t\t\t\t<TabsContent value=\"overview\" className=\"mt-0\">\n\t\t\t\t\t{overviewContent}\n\t\t\t\t</TabsContent>\n\t\t\t\t<TabsContent value=\"stats\" className=\"mt-0\">\n\t\t\t\t\t{statsContent}\n\t\t\t\t</TabsContent>\n\t\t\t</Tabs>\n\t\t) : activeView === 'stats' ? (\n\t\t\tstatsContent\n\t\t) : (\n\t\t\toverviewContent\n\t\t);\n\n\t\treturn (\n\t\t\t<Card\n\t\t\t\tref={ref}\n\t\t\t\tsurface={surface}\n\t\t\t\t// Embedded flat, the surrounding surface owns the inset, as with the\n\t\t\t\t// other commerce subjects; the region rhythm stays the same.\n\t\t\t\tpadding={surface === 'flat' ? 'none' : 'md'}\n\t\t\t\tgap=\"xl\"\n\t\t\t\theaderStart={\n\t\t\t\t\t<Item className=\"vendor-profile--identity flex-nowrap py-0\">\n\t\t\t\t\t\t<ItemMedia variant=\"avatar\">\n\t\t\t\t\t\t\t<Avatar>\n\t\t\t\t\t\t\t\t{!!avatarUrl && <AvatarImage src={avatarUrl} alt={name} />}\n\t\t\t\t\t\t\t\t<AvatarFallback>\n\t\t\t\t\t\t\t\t\t{initials ?? <Initials value={name} strategy=\"first-words\" />}\n\t\t\t\t\t\t\t\t</AvatarFallback>\n\t\t\t\t\t\t\t</Avatar>\n\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t{/* Verification is the name's status, so it sits beside it. */}\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t\t\t\t<ItemTitle className=\"min-w-0 truncate\">{name}</ItemTitle>\n\t\t\t\t\t\t\t\t{!!verified && (\n\t\t\t\t\t\t\t\t\t<Badge tone=\"success\" className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t\t{strings.verifiedAriaLabel}\n\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{!!role && <ItemDescription clamp={2}>{role}</ItemDescription>}\n\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t</Item>\n\t\t\t\t}\n\t\t\t\tfooterSlot={\n\t\t\t\t\thasActions ? (\n\t\t\t\t\t\t<div className={cn('vendor-profile--actions flex flex-wrap', compositionClasses.commands)}>\n\t\t\t\t\t\t\t{!!onMessage && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\t\t\tclassName=\"min-w-0 flex-1\"\n\t\t\t\t\t\t\t\t\tonClick={onMessage}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{strings.message}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{!!onHire && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"min-w-0 flex-1\"\n\t\t\t\t\t\t\t\t\tonClick={onHire}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{strings.hire}\n\t\t\t\t\t\t\t\t\t<ChevronRight className=\"size-icon-sm\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : undefined\n\t\t\t\t}\n\t\t\t\tcontentClassName={cn(!hasBody && 'hidden')}\n\t\t\t\tclassName={cn('vendor-profile--component', className)}\n\t\t\t>\n\t\t\t\t{hasBody ? profileBody : null}\n\t\t\t</Card>\n\t\t);\n\t},\n);\n\nVendorProfileCard.displayName = 'VendorProfileCard';\n","export interface InventoryLevelStrings {\n\tstatusInStock: string;\n\tstatusLowStock: string;\n\tstatusCritical: string;\n\tvariantLabel: string;\n\tunitsAvailable: string;\n\treorderAtLabel: string;\n\tlastRestockedLabel: string;\n}\n\nexport const defaultInventoryLevelStrings: InventoryLevelStrings = {\n\tstatusInStock: 'In stock',\n\tstatusLowStock: 'Low stock',\n\tstatusCritical: 'Critical',\n\tvariantLabel: 'Variant',\n\tunitsAvailable: 'units available',\n\treorderAtLabel: 'Reorder at',\n\tlastRestockedLabel: 'Last restocked',\n};\n","/**\n * InventoryLevel — single-product inventory snapshot with stock total,\n * reorder threshold, and a status pill (Critical / Low stock / In stock).\n *\n * Status thresholds are computed from `stock`, `reorderLevel`, and the\n * critical threshold (50% of `reorderLevel`). Status pill labels flow via\n * the `strings` prop so consumers can localise without forking the file.\n */\nimport { useId } from 'react';\n\nimport { Badge } from '../../../base/badge';\nimport { Progress } from '../../../base/feedback';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography/text';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultInventoryLevelStrings } from './inventory-level.strings';\nimport type { InventoryLevelProps } from './types';\n\nexport function InventoryLevel({\n\tproductName,\n\tvariant,\n\tstock,\n\treorderLevel,\n\tmaxStock,\n\tlastRestocked,\n\tclassName,\n\tstrings: stringsProp,\n}: InventoryLevelProps) {\n\tconst strings = useStrings(defaultInventoryLevelStrings, stringsProp);\n\tconst stockId = useId();\n\tconst isLow = stock <= reorderLevel;\n\tconst isCritical = stock <= reorderLevel * 0.5;\n\n\tconst badgeTone = isCritical ? 'destructive' : isLow ? 'warning' : 'success';\n\tconst badgeLabel = isCritical\n\t\t? strings.statusCritical\n\t\t: isLow\n\t\t\t? strings.statusLowStock\n\t\t\t: strings.statusInStock;\n\n\t// Three groups — product, stock figure, gauge — spaced by one parent gap.\n\t// The status chip belongs to the product name, so it sits beside it.\n\treturn (\n\t\t<Stack\n\t\t\tdata-component=\"inventory-level\"\n\t\t\tdata-slot=\"inventory-level\"\n\t\t\tgap=\"xl\"\n\t\t\tclassName={cn('inventory-level--component', className)}\n\t\t>\n\t\t\t<Stack gap=\"dense\" className=\"inventory-level--product\">\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t<Text type=\"inherit\" weight=\"semibold\" className=\"min-w-0 truncate\">\n\t\t\t\t\t\t{productName}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Badge tone={badgeTone} className=\"shrink-0\">{badgeLabel}</Badge>\n\t\t\t\t</Stack>\n\t\t\t\t{!!variant && (\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t{`${strings.variantLabel}: ${variant}`}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\n\t\t\t<Stack id={stockId} gap=\"dense\" className=\"inventory-level--stock\">\n\t\t\t\t<NumberValue type=\"inherit\" value={stock} weight=\"semibold\" align=\"left\" />\n\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t{strings.unitsAvailable}\n\t\t\t\t</Text>\n\t\t\t</Stack>\n\n\t\t\t<Stack gap=\"md\" className=\"inventory-level--gauge\">\n\t\t\t\t{/* The shared meter, named by the stock figure it visualises. */}\n\t\t\t\t<Progress value={stock} max={maxStock} tone={badgeTone} aria-labelledby={stockId} />\n\t\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.reorderAtLabel}: <NumberValue type=\"inherit\" value={reorderLevel} weight=\"medium\" align=\"left\" />\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!lastRestocked && (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t{strings.lastRestockedLabel}: <SecondaryValue size=\"xs\">{lastRestocked}</SecondaryValue>\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nInventoryLevel.displayName = 'InventoryLevel';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface TaxLineItem {\n\t/** Stable identity for this entry. */\n\tid?: string;\n\t/** Display label. */\n\tlabel: string;\n\trate?: string;\n\tamount: string;\n}\n\nexport interface TaxBreakdownStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted amount before tax. */\n\tsubtotal: string;\n\t/** Formatted sum of every tax line. */\n\ttotalTax: string;\n\t/** Formatted grand total, including tax. */\n\ttotal: string;\n}\n\nexport const defaultTaxBreakdownStrings: TaxBreakdownStrings = {\n\ttitle: 'Tax breakdown',\n\tsubtotal: 'Subtotal',\n\ttotalTax: 'Total tax',\n\ttotal: 'Total',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface TaxBreakdownCardProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Formatted amount before tax. */\n\tsubtotal: string;\n\t/** Individual tax lines making up the total. */\n\ttaxes: TaxLineItem[];\n\t/** Formatted sum of every tax line. */\n\ttotalTax?: string;\n\t/** Formatted grand total, including tax. */\n\ttotal: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<TaxBreakdownStrings>;\n}\n","/**\n * TaxBreakdownCard — itemised tax breakdown for an order or invoice: a\n * subtotal, one row per tax line with its rate beside the amount, an optional\n * \"Total tax\" rollup, and the final total. Drawn on the shared commerce\n * ledger (`SummaryPanel` + `AmountRow`), so it emphasises its total the same\n * way `CartSummaryCard` does. Pairs with `CartSummaryCard` when consumers\n * need to expose VAT / regional tax detail. Strings overridable for i18n.\n */\nimport { Card } from '../../../base/cards';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultTaxBreakdownStrings, type TaxBreakdownCardProps } from './types';\n\nexport function TaxBreakdownCard({\n\tsubtotal,\n\ttaxes,\n\ttotalTax,\n\ttotal,\n\tclassName,\n\tstrings: stringsProp,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\t...props\n}: TaxBreakdownCardProps) {\n\tconst strings = useStrings(defaultTaxBreakdownStrings, stringsProp);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\tdata-slot=\"tax-breakdown\"\n\t\t\tclassName={cn('tax-breakdown--component w-full', className)}\n\t\t>\n\t\t\t<SummaryPanel className=\"tax-breakdown--ledger\">\n\t\t\t\t<AmountRow label={strings.subtotal} amount={subtotal} />\n\t\t\t\t{taxes.map((tax, index) => (\n\t\t\t\t\t<AmountRow\n\t\t\t\t\t\tkey={tax.id ?? `${tax.label}-${index}`}\n\t\t\t\t\t\tclassName=\"tax-breakdown--line\"\n\t\t\t\t\t\tlabel={tax.label}\n\t\t\t\t\t\tnote={tax.rate}\n\t\t\t\t\t\tamount={tax.amount}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t\t{/* One tax line is the total tax; a rollup under it would restate the row above. */}\n\t\t\t\t{!!totalTax && taxes.length > 1 && (\n\t\t\t\t\t<AmountRow label={strings.totalTax} amount={totalTax} />\n\t\t\t\t)}\n\t\t\t\t<AmountRow label={strings.total} amount={total} total rollup />\n\t\t\t</SummaryPanel>\n\t\t</Card>\n\t);\n}\n\nTaxBreakdownCard.displayName = 'TaxBreakdownCard';\n","import type { LucideIcon } from 'lucide-react';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface SubscriptionPerk {\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n\t/** Display label. */\n\tlabel: string;\n}\n\nexport interface SubscriptionSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tplan: string;\n\tnextBilling: string;\n\t/** Benefits included in the plan. */\n\tperks: string;\n\tmanage: string;\n\tupgrade: string;\n}\n\nexport const defaultSubscriptionSummaryStrings: SubscriptionSummaryStrings = {\n\ttitle: 'Subscription',\n\tplan: 'Plan',\n\tnextBilling: 'Next billing',\n\tperks: 'Included',\n\tmanage: 'Manage',\n\tupgrade: 'Upgrade',\n};\n\nexport interface SubscriptionSummaryCardProps {\n\t/** Name of the subscribed plan. */\n\tplanName: string;\n\t/** Formatted recurring price. */\n\tpriceLabel: string;\n\t/** Billing interval, e.g. monthly or yearly. */\n\tcycleLabel: string;\n\t/** Formatted date of the next charge. */\n\tnextBillingDate: string;\n\t/** Current subscription state. */\n\tstatusLabel?: string;\n\t/** Benefits included in the plan. */\n\tperks?: SubscriptionPerk[];\n\tonManage?: () => void;\n\tonUpgrade?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<SubscriptionSummaryStrings>;\n}\n","/**\n * SubscriptionSummaryCard — at-a-glance subscription card with the active\n * plan name as the hero heading, an inline price + cycle, the next billing\n * date in a meta row, an optional perks list, and trailing\n * Manage / Upgrade actions. Strings overridable for i18n.\n */\nimport { ChevronRight } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport {\n\tItem,\n\tItemContent,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Heading } from '../../../typography/heading';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\n\nimport {\n\tdefaultSubscriptionSummaryStrings,\n\ttype SubscriptionSummaryCardProps,\n} from './types';\n\nimport { cn } from '../../../../lib/utils';\nexport function SubscriptionSummaryCard({\n\tplanName,\n\tpriceLabel,\n\tcycleLabel,\n\tnextBillingDate,\n\tstatusLabel,\n\tperks = [],\n\tonManage,\n\tonUpgrade,\n\tclassName,\n\tstrings: stringsProp,\n}: SubscriptionSummaryCardProps) {\n\tconst strings = useStrings(defaultSubscriptionSummaryStrings, stringsProp);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={statusLabel ? <Badge tone=\"success\">{statusLabel}</Badge> : null}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tclassName={cn('subscription-summary--component w-full', className)}\n\t\t>\n\t\t\t{/* Plan identity left, price right, then the next charge as the same\n\t\t\t label/value row the other commerce summaries use. Spacing alone\n\t\t\t groups them; no inset panel. */}\n\t\t\t<Stack gap=\"lg\" className=\"subscription-summary--plan\">\n\t\t\t\t<Stack direction=\"horizontal\" justify=\"between\" align=\"end\" gap=\"lg\">\n\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t{strings.plan}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t<Heading className=\"text-inherit\" tag=\"h3\">\n\t\t\t\t\t\t\t{planName}\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" gap=\"xs\" className=\"shrink-0\">\n\t\t\t\t\t\t<Value type=\"inherit\" weight=\"bold\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t{priceLabel}\n\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t<Text type=\"secondary\">\n\t\t\t\t\t\t\t{cycleLabel}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t\t<InlineStat\n\t\t\t\t\tlabel={strings.nextBilling}\n\t\t\t\t\tvalue={nextBillingDate}\n\t\t\t\t\tvalueWeight=\"semibold\"\n\t\t\t\t\tvalueClassName=\"tabular-nums\"\n\t\t\t\t/>\n\t\t\t</Stack>\n\n\t\t\t{perks.length > 0 && (\n\t\t\t\t<Stack gap=\"md\" className=\"subscription-summary--perks\">\n\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t{strings.perks}\n\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t{perks.map((perk, i) => {\n\t\t\t\t\t\t\t// A consumer-supplied glyph renders plainly; no default glyph\n\t\t\t\t\t\t\t// repeats down the list and no colour suggests a state.\n\t\t\t\t\t\t\tconst Icon = perk.icon;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Item key={`${perk.label}-${i}`} size=\"sm\" density=\"compact\">\n\t\t\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t\t\t\t\t\t<Icon aria-hidden=\"true\" className=\"size-icon text-muted-foreground\" />\n\t\t\t\t\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t\t\t\t<ItemTitle bold={false}>{perk.label}</ItemTitle>\n\t\t\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{(onManage || onUpgrade) && (\n\t\t\t\t<div className=\"flex items-center gap-space-md\">\n\t\t\t\t\t{!!onManage && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tonClick={onManage}\n\t\t\t\t\t\t\tclassName=\"flex-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.manage}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!onUpgrade && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\tonClick={onUpgrade}\n\t\t\t\t\t\t\tclassName=\"flex-1\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.upgrade}\n\t\t\t\t\t\t\t<ChevronRight className=\"ml-1 size-icon-md\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nSubscriptionSummaryCard.displayName = 'SubscriptionSummaryCard';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type RefundStage = 'requested' | 'approved' | 'processing' | 'completed';\n\nexport interface RefundStatusStrings {\n\t/** Surface title. */\n\ttitle: string;\n\trequested: string;\n\tapproved: string;\n\tprocessing: string;\n\tcompleted: string;\n\t/** Formatted refund amount. */\n\tamount: string;\n\t/** Why the refund was requested. */\n\treason: string;\n\t/** Formatted estimate for the funds landing. */\n\teta: string;\n\t/** Where the money is being returned to. */\n\tmethod: string;\n}\n\nexport const defaultRefundStatusStrings: RefundStatusStrings = {\n\ttitle: 'Refund status',\n\trequested: 'Requested',\n\tapproved: 'Approved',\n\tprocessing: 'Processing',\n\tcompleted: 'Completed',\n\tamount: 'Refund amount',\n\treason: 'Reason',\n\teta: 'Expected by',\n\tmethod: 'Refund to',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface RefundStatusCardProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** How far the refund has progressed. */\n\tstage: RefundStage;\n\t/** Formatted refund amount. */\n\tamount: string;\n\t/** Why the refund was requested. */\n\treason?: ReactNode;\n\t/** Where the money is being returned to. */\n\tmethod?: ReactNode;\n\t/** Formatted estimate for the funds landing. */\n\teta?: string;\n\t/** Formatted date the refund was raised. */\n\trequestedAt?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<RefundStatusStrings>;\n}\n\n/** The source kit's name for `RefundStatusCardProps`. */\nexport type RefundStatusProps = RefundStatusCardProps;\n","/**\n * RefundStatusCard — refund-flow tracker. Shows the four canonical refund\n * stages (Requested → Approved → Processing → Completed) as an ordered list\n * whose current stage carries `aria-current=\"step\"`, so the position is\n * announced independently of its colour. The refund amount leads as the\n * ledger's total row, with an optional reason / method / ETA detail block.\n * Strings overridable for i18n.\n *\n * `RefundStatus` is the same component under the source kit's name.\n */\nimport { Check } from 'lucide-react';\n\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\nimport { AmountRow } from '../summary-panel';\nimport {\n\tdefaultRefundStatusStrings,\n\ttype RefundStage,\n\ttype RefundStatusCardProps,\n} from './types';\n\nconst STAGE_ORDER: RefundStage[] = ['requested', 'approved', 'processing', 'completed'];\n\nfunction hasContent(value: unknown) {\n\treturn value !== undefined && value !== null && value !== false && value !== '';\n}\n\nexport function RefundStatusCard({\n\tstage,\n\tamount,\n\treason,\n\tmethod,\n\teta,\n\trequestedAt,\n\tclassName,\n\tstrings: stringsProp,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\t...props\n}: RefundStatusCardProps) {\n\tconst strings = useStrings(defaultRefundStatusStrings, stringsProp);\n\tconst currentIdx = STAGE_ORDER.indexOf(stage);\n\tconst hasFacts = hasContent(reason) || hasContent(method) || hasContent(eta);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"refund-status\"\n\t\t\tclassName={cn('refund-status--component w-full', className)}\n\t\t>\n\t\t\t{/* Amount, stages and details are separated by the content gap alone:\n\t\t\t no inset panel around the amount and no rule above the details. */}\n\t\t\t<Stack gap=\"dense\">\n\t\t\t\t<AmountRow label={strings.amount} amount={amount} total className=\"refund-status--amount\" />\n\t\t\t\t{!!requestedAt && (\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.requested}: <SecondaryValue size=\"xs\">{requestedAt}</SecondaryValue>\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\n\t\t\t{/* The stages happen in sequence, so they are an ordered list. */}\n\t\t\t<ol className=\"refund-status--stages m-0 flex list-none items-start p-0\">\n\t\t\t\t{STAGE_ORDER.map((s, i) => {\n\t\t\t\t\tconst done = i <= currentIdx;\n\t\t\t\t\tconst current = i === currentIdx;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// The dot leads its column and the connector fills the rest, so\n\t\t\t\t\t\t// the node sits at the column's left edge; the label starts there too.\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={s}\n\t\t\t\t\t\t\tdata-reached={done ? '' : undefined}\n\t\t\t\t\t\t\tdata-current={current ? '' : undefined}\n\t\t\t\t\t\t\taria-current={current ? 'step' : undefined}\n\t\t\t\t\t\t\tclassName=\"refund-status--stage flex min-w-0 flex-1 flex-col items-start gap-space-sm\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div aria-hidden=\"true\" className=\"flex w-full items-center\">\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'relative flex size-icon-lg shrink-0 items-center justify-center rounded-full',\n\t\t\t\t\t\t\t\t\t\tdone\n\t\t\t\t\t\t\t\t\t\t\t? 'bg-success text-success-foreground'\n\t\t\t\t\t\t\t\t\t\t\t: 'border border-border bg-card text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t// The current stage carries the shared halo; an offset ring would paint the\n\t\t\t\t\t\t\t\t\t\t// page background inside a card.\n\t\t\t\t\t\t\t\t\t\tcurrent && cn('ring-4', toneRecipes.success.halo),\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{done ? (\n\t\t\t\t\t\t\t\t\t\t<Check className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<NumberValue type=\"inherit\" value={i + 1} size=\"xs\" weight=\"medium\" align=\"center\" />\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{i < STAGE_ORDER.length - 1 && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'h-0.5 flex-1',\n\t\t\t\t\t\t\t\t\t\t\ti < currentIdx ? 'bg-success' : 'bg-border',\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\tweight={current ? 'semibold' : 'medium'}\n\t\t\t\t\t\t\t\ttype={done ? 'main' : 'secondary'}\n\t\t\t\t\t\t\t\tlineHeight=\"tight\"\n\t\t\t\t\t\t\t\tclassName=\"refund-status--stage-label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{strings[s]}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ol>\n\n\t\t\t{!!hasFacts && (\n\t\t\t\t<Stack gap=\"md\" className=\"refund-status--facts\">\n\t\t\t\t\t{hasContent(reason) && (\n\t\t\t\t\t\t<InlineStat label={strings.reason} value={reason} className=\"items-start\" valueWeight=\"medium\" valueClassName=\"text-end\" />\n\t\t\t\t\t)}\n\t\t\t\t\t{hasContent(method) && (\n\t\t\t\t\t\t<InlineStat label={strings.method} value={method} valueWeight=\"medium\" />\n\t\t\t\t\t)}\n\t\t\t\t\t{hasContent(eta) && (\n\t\t\t\t\t\t<InlineStat label={strings.eta} value={eta} valueWeight=\"medium\" valueClassName=\"tabular-nums\" />\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nRefundStatusCard.displayName = 'RefundStatusCard';\n\n/** The source kit's name for `RefundStatusCard`; the same component. */\nexport const RefundStatus = RefundStatusCard;\n","/**\n * AddressLines — the postal block shared by `AddressCard` and `OrderCustomer`.\n *\n * A real `<address>` (with the browser's italic reset), so assistive technology\n * hears contact information rather than loose lines. The recipient leads, the\n * street lines and the city line follow in the main role, and the country\n * recedes; the city line joins only the parts that exist. A phone number, when\n * the address carries one, closes the block as a `Phone` link.\n *\n * Internal to the commerce family: it is the address anatomy, not a public\n * component.\n */\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { Stack } from '../../../base/structure';\nimport { Phone } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { OrderAddress } from './order-status';\n\nexport interface AddressLinesProps extends Omit<ComponentPropsWithoutRef<'address'>, 'children'> {\n\t/** The address to render. */\n\taddress: OrderAddress;\n\t/** Sets the recipient in semibold, for a surface that leads on the name. */\n\tprominent?: boolean;\n}\n\nexport function AddressLines({ address, prominent = false, className, ...props }: AddressLinesProps) {\n\tconst cityLine = [address.city, address.region, address.postalCode].filter(Boolean).join(', ');\n\n\treturn (\n\t\t<Stack\n\t\t\tgap=\"2xs\"\n\t\t\trender={<address {...props} />}\n\t\t\tclassName={cn('address-lines--component not-italic', className)}\n\t\t>\n\t\t\t{!!address.name && <Text type=\"inherit\" weight={prominent ? 'semibold' : 'regular'}>{address.name}</Text>}\n\t\t\t<Text type=\"inherit\">{address.line1}</Text>\n\t\t\t{!!address.line2 && <Text type=\"inherit\">{address.line2}</Text>}\n\t\t\t{!!cityLine && <Text type=\"inherit\">{cityLine}</Text>}\n\t\t\t<Text type=\"secondary\">{address.country}</Text>\n\t\t\t{!!address.phone && <Phone value={address.phone} className=\"self-start\" />}\n\t\t</Stack>\n\t);\n}\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type AddressKind = 'shipping' | 'billing' | 'pickup';\n\nexport interface AddressCardStrings {\n\tdefaultBadge: string;\n\tedit: string;\n\tremove: string;\n\tmakeDefault: string;\n\tshipping: string;\n\tbilling: string;\n\tpickup: string;\n}\n\nexport const defaultAddressCardStrings: AddressCardStrings = {\n\tdefaultBadge: 'Default',\n\tedit: 'Edit',\n\tremove: 'Remove',\n\tmakeDefault: 'Make default',\n\tshipping: 'Shipping address',\n\tbilling: 'Billing address',\n\tpickup: 'Pickup address',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface AddressCardProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** What the address is for — billing, shipping, or both. */\n\tkind?: AddressKind;\n\t/** Display name. */\n\tname: string;\n\t/** Street address. */\n\tline1: string;\n\t/** Apartment, suite, or unit. */\n\tline2?: string;\n\t/** City or town. */\n\tcity: string;\n\t/** State, province, or region. */\n\tregion?: string;\n\t/** Postal or ZIP code. */\n\tpostalCode?: string;\n\t/** Country name or code. */\n\tcountry: string;\n\t/** Contact number for the delivery. */\n\tphone?: string;\n\t/** Marks this as the account's default address. */\n\tdefault?: boolean;\n\t/** Fired when an entry is edited. */\n\tonEdit?: () => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\tonMakeDefault?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AddressCardStrings>;\n}\n","/**\n * AddressCard — saved postal address surface. Title varies by `kind`\n * (shipping / billing / pickup); shows recipient name, address lines, phone,\n * and a \"Default\" badge when applicable. The lines are the shared commerce\n * `<address>` block, so they read the same here as in `OrderCustomer`.\n *\n * Edit / remove / make-default actions ride through the centralized action\n * menu instead of inline footer buttons.\n */\nimport { Edit2, Star, Trash2 } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport type { ActionMenuAction } from '../../../base/action-menu';\nimport { Phone } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { AddressLines } from '../shared/address-lines';\nimport {\n\tdefaultAddressCardStrings,\n\ttype AddressCardProps,\n\ttype AddressKind,\n} from './types';\n\nimport { cn } from '../../../../lib/utils';\nexport function AddressCard({\n\tkind = 'shipping',\n\tname,\n\tline1,\n\tline2,\n\tcity,\n\tregion,\n\tpostalCode,\n\tcountry,\n\tphone,\n\tdefault: defaultAddress = false,\n\tonEdit,\n\tonRemove,\n\tonMakeDefault,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: AddressCardProps) {\n\tconst strings = useStrings(defaultAddressCardStrings, stringsProp);\n\tconst titleByKind: Record<AddressKind, string> = {\n\t\tshipping: strings.shipping,\n\t\tbilling: strings.billing,\n\t\tpickup: strings.pickup,\n\t};\n\n\tconst actions: ActionMenuAction[] = [];\n\tif (onEdit) {\n\t\tactions.push({\n\t\t\tid: 'edit',\n\t\t\tlabel: strings.edit,\n\t\t\ticon: <Edit2 className=\"size-icon-md\" />,\n\t\t\tonClick: onEdit,\n\t\t});\n\t}\n\tif (onMakeDefault && !defaultAddress) {\n\t\tactions.push({\n\t\t\tid: 'make-default',\n\t\t\tlabel: strings.makeDefault,\n\t\t\ticon: <Star className=\"size-icon-md\" />,\n\t\t\tonClick: onMakeDefault,\n\t\t});\n\t}\n\tif (onRemove) {\n\t\tactions.push({\n\t\t\tid: 'remove',\n\t\t\tlabel: strings.remove,\n\t\t\ticon: <Trash2 className=\"size-icon-md\" />,\n\t\t\tonClick: onRemove,\n\t\t});\n\t}\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={titleByKind[kind]}\n\t\t\ttitleSuffix={\n\t\t\t\tdefaultAddress ? <Badge tone=\"neutral\">{strings.defaultBadge}</Badge> : null\n\t\t\t}\n\t\t\tactions={actions.length > 0 ? actions : undefined}\n\t\t\tclassName={cn('address-card--component w-full', className)}\n\t\t>\n\t\t\t{/* The phone is contact detail, not an address line: the outer gap\n\t\t\t separates the two groups, and the number keeps the size of the\n\t\t\t lines it sits under. */}\n\t\t\t<Stack gap=\"md\">\n\t\t\t\t<AddressLines\n\t\t\t\t\taddress={{ name, line1, line2, city, region, postalCode, country }}\n\t\t\t\t\tprominent\n\t\t\t\t/>\n\t\t\t\t{!!phone && (\n\t\t\t\t\t<Phone\n\t\t\t\t\t\tvalue={phone}\n\t\t\t\t\t\tdisplay={<Text type=\"inherit\" tag=\"span\">{phone}</Text>}\n\t\t\t\t\t\tclassName=\"self-start\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nAddressCard.displayName = 'AddressCard';\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport interface VoucherEntryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tinputLabel: string;\n\tplaceholder: string;\n\thelperText: string;\n\tcheck: string;\n\tremove: string;\n\t/** Formatted remaining value on the voucher. */\n\tbalance: string;\n\tapplied: string;\n\tnotFound: string;\n}\n\nexport const defaultVoucherEntryStrings: VoucherEntryStrings = {\n\ttitle: 'Redeem a gift card',\n\tinputLabel: 'Gift card code',\n\tplaceholder: 'Enter gift card code',\n\thelperText: 'Apply one gift card or voucher to this order.',\n\tcheck: 'Check balance',\n\tremove: 'Remove',\n\tbalance: 'Available balance',\n\tapplied: 'Applied',\n\tnotFound: 'That gift card code is not valid.',\n};\n\nexport interface VoucherEntryProps {\n\t/** Voucher currently applied, if any. */\n\tappliedCode?: string;\n\t/** Formatted remaining value on the voucher. */\n\tbalance?: string;\n\t/** Validation message for a rejected code. */\n\terror?: string;\n\t/** Whether a code is being checked. */\n\tloading?: boolean;\n\t/** Fired with the trimmed, upper-cased code when the form is submitted. */\n\tonCheck?: (code: string) => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<VoucherEntryStrings>;\n}\n","/**\n * VoucherEntry — gift-card / voucher redemption entry.\n *\n * Empty state — code input + check button, helper line surfacing errors.\n * Applied state — the same success-tinted row as CouponInputCard: check\n * medallion, code, balance amount, and a remove control.\n *\n * The component owns the input's draft state and nothing else. Submitting the\n * form — by the check button or by Enter — calls `onCheck(code)` with the\n * trimmed, upper-cased code; the consumer looks it up and drives the applied\n * state back in through `appliedCode`, `balance`, `error`, and `loading`.\n * `onRemove` clears an applied voucher.\n */\nimport {\n\ttype FormEvent,\n\tuseId,\n\tuseState } from 'react';\nimport { Check, X } from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { ContentBlock } from '../../../base/display';\nimport { IconBadge,\n} from '../../../base/display';\nimport { FormField } from '../../../base/forms';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { Input } from '../../../base/text-inputs';\nimport { MonoValue, Value } from '../../../primitives';\nimport { DisplayLabel } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultVoucherEntryStrings, type VoucherEntryProps } from './types';\n\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\nconst normalizeCode = (value: string): string => value.toUpperCase();\n\nexport function VoucherEntry({\n\tappliedCode,\n\tbalance,\n\terror,\n\tloading,\n\tonCheck,\n\tonRemove,\n\tclassName,\n\tstrings: stringsProp,\n}: VoucherEntryProps) {\n\tconst strings = useStrings(defaultVoucherEntryStrings, stringsProp);\n\tconst inputId = useId();\n\tconst [code, setCode] = useState('');\n\tconst trimmedCode = code.trim();\n\tconst handleSubmit = (event: FormEvent<HTMLFormElement>) => {\n\t\tevent.preventDefault();\n\t\tif (!trimmedCode) return;\n\t\tonCheck?.(trimmedCode);\n\t};\n\n\tif (appliedCode) {\n\t\t// Same applied row as CouponInputCard: the check, the code and the\n\t\t// amount share one line, with no inner rule. The balance is a plain\n\t\t// amount, not a signed delta, so it stays in the foreground colour.\n\t\treturn (\n\t\t\t<ContentBlock\n\t\t\t\ttitle={strings.title}\n\t\t\t\tclassName={cn('voucher-entry--component w-full', className)}\n\t\t\t>\n\t\t\t\t<Item size=\"sm\" variant=\"muted\" className={cn('items-center gap-y-space-sm border', toneRecipes.success.edge, toneRecipes.success.wash)}>\n\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t<IconBadge icon={Check} tone=\"success\" size=\"md\" />\n\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t{/* A code never truncates: the label wraps under it, and below the\n\t\t\t\t\t content basis the amount and remove control drop to their own line. */}\n\t\t\t\t\t<ItemContent className=\"min-w-0 basis-48\">\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\" className=\"min-w-0\">\n\t\t\t\t\t\t\t<ItemTitle className=\"max-w-full\">\n\t\t\t\t\t\t\t\t<MonoValue type=\"inherit\" className=\"tracking-wider\">{appliedCode}</MonoValue>\n\t\t\t\t\t\t\t</ItemTitle>\n\t\t\t\t\t\t\t<DisplayLabel className=\"shrink-0\">\n\t\t\t\t\t\t\t\t{strings.applied}\n\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t{!!balance && <ItemDescription clamp={1}>{strings.balance}</ItemDescription>}\n\t\t\t\t\t</ItemContent>\n\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 gap-space-sm\">\n\t\t\t\t\t\t{!!balance && (\n\t\t\t\t\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t\t\t{balance}\n\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!onRemove && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tonClick={onRemove}\n\t\t\t\t\t\t\t\taria-label={strings.remove}\n\t\t\t\t\t\t\t\tclassName=\"size-action-xs shrink-0 text-muted-foreground hover:text-destructive\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ItemActions>\n\t\t\t\t</Item>\n\t\t\t</ContentBlock>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.title}\n\t\t\tclassName={cn('voucher-entry--component w-full', className)}\n\t\t>\n\t\t\t<form onSubmit={handleSubmit}>\n\t\t\t\t<FormField\n\t\t\t\t\tlabel={strings.inputLabel}\n\t\t\t\t\thtmlFor={inputId}\n\t\t\t\t\terror={error}\n\t\t\t\t\thint={error ? undefined : strings.helperText}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"flex flex-wrap gap-space-md\">\n\t\t\t\t\t\t<div className=\"min-w-48 flex-1\">\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid={inputId}\n\t\t\t\t\t\t\t\tvalue={code}\n\t\t\t\t\t\t\t\tonChange={(e) => setCode(normalizeCode((e.target as HTMLInputElement).value))}\n\t\t\t\t\t\t\t\tplaceholder={strings.placeholder}\n\t\t\t\t\t\t\t\tautoCapitalize=\"characters\"\n\t\t\t\t\t\t\t\tspellCheck={false}\n\t\t\t\t\t\t\t\tclassName=\"font-mono\"\n\t\t\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\t\tdisabled={!trimmedCode}\n\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.check}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</FormField>\n\t\t\t</form>\n\t\t</ContentBlock>\n\t);\n}\n\nVoucherEntry.displayName = 'VoucherEntry';\n","/**\n * LineThumbnail — the picture of an ordered or carted line.\n *\n * Renders the image while it loads; when it fails, or when there is none, the\n * line's initials stand in on a neutral tile so the row keeps its shape. A new\n * `src` is tried again: the failure is remembered per source, not per mount.\n *\n * Internal to the commerce family; the caller supplies the media frame\n * (`ItemMedia variant=\"image\"`).\n */\nimport { useState } from 'react';\n\nimport { Initials } from '../../../primitives';\n\nexport interface LineThumbnailProps {\n\t/** Image source. Optional: without one the initials show. */\n\tsrc?: string;\n\t/** Alternative text. Defaults to `title`. */\n\talt?: string;\n\t/** The line's name, used for the initials and as the default alt text. */\n\ttitle: string;\n}\n\nfunction LineThumbnailPlaceholder({ title }: { title: string }) {\n\treturn (\n\t\t<div\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName=\"line-thumbnail--placeholder flex size-full items-center justify-center rounded-[inherit] bg-muted ring-1 ring-border/60\"\n\t\t>\n\t\t\t<Initials\n\t\t\t\tvalue={title}\n\t\t\t\tstrategy=\"first-words\"\n\t\t\t\tfallback={title.trim().slice(0, 2).toUpperCase()}\n\t\t\t\tsize=\"xs\"\n\t\t\t\tweight=\"semibold\"\n\t\t\t\ttype=\"secondary\"\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport function LineThumbnail({ src, alt, title }: LineThumbnailProps) {\n\tconst [failedSrc, setFailedSrc] = useState<string | undefined>(undefined);\n\tconst source = src?.trim() ? src : undefined;\n\n\tif (!source || failedSrc === source) return <LineThumbnailPlaceholder title={title} />;\n\n\treturn (\n\t\t<img\n\t\t\tsrc={source}\n\t\t\talt={alt ?? title}\n\t\t\tclassName=\"line-thumbnail--image\"\n\t\t\tonError={() => setFailedSrc(source)}\n\t\t/>\n\t);\n}\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport interface CartLineItem {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display name. */\n\tname?: string;\n\tproductTitle?: string;\n\t/** Surface title. */\n\ttitle?: string;\n\tvariantTitle?: string;\n\tqty: number;\n\tprice: string;\n\timageUrl?: string;\n\timageSrc?: string;\n\tsrc?: string;\n\turl?: string;\n\timageAlt?: string;\n}\n\nexport interface CartSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Formatted total before tax, shipping, and discounts. */\n\tsubtotal: string;\n\t/** Formatted tax amount. */\n\ttax: string;\n\t/** Formatted shipping cost. */\n\tshipping: string;\n\t/** Formatted discount, shown as a deduction. */\n\tdiscount: string;\n\t/** Formatted order total. */\n\ttotal: string;\n\tcheckout: string;\n\t/** Writes a line's quantity, so a translation owns the multiplication sign. */\n\tformatQuantity: (quantity: number) => string;\n}\n\nexport const defaultCartSummaryStrings: CartSummaryStrings = {\n\ttitle: 'Cart',\n\tsubtotal: 'Subtotal',\n\ttax: 'Tax',\n\tshipping: 'Shipping',\n\tdiscount: 'Discount',\n\ttotal: 'Total',\n\tcheckout: 'Checkout',\n\tformatQuantity: (quantity) => `×${quantity}`,\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface CartSummaryCardProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Line items in the cart. */\n\titems: CartLineItem[];\n\t/** Formatted total before tax, shipping, and discounts. */\n\tsubtotal?: string;\n\t/** Formatted tax amount. */\n\ttax?: string;\n\t/** Formatted shipping cost. */\n\tshipping?: string;\n\t/** Formatted discount, shown as a deduction. */\n\tdiscount?: string;\n\t/** Formatted order total. */\n\ttotal: string;\n\tonCheckout?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<CartSummaryStrings>;\n}\n\n/** The source kit's name for `CartSummaryCardProps`. */\nexport type CartSummaryProps = CartSummaryCardProps;\n","/**\n * CartSummaryCard — line-item list with optional subtotal / tax / shipping /\n * discount breakdown and a primary \"Checkout\" action. Items render through\n * `<ItemGroup>` for density consistency; a line whose image fails to load\n * shows its initials instead, and a new image source is tried again. The\n * breakdown is the shared commerce ledger (`SummaryPanel` + `AmountRow`): the\n * discount reads as a deduction in success ink, and the total is ruled off\n * only when there is a breakdown above it to roll up.\n *\n * `CartSummary` is the same component under the source kit's name.\n */\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { LineThumbnail } from '../shared/line-thumbnail';\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultCartSummaryStrings, type CartLineItem, type CartSummaryCardProps } from './types';\n\nconst resolveCartLineTitle = (item: CartLineItem): string => {\n\treturn [item.productTitle, item.title, item.name].find((value) => !!value?.trim()) ?? item.id;\n};\n\nconst resolveCartLineImageSrc = (item: CartLineItem): string | undefined => {\n\treturn [item.imageUrl, item.imageSrc, item.src, item.url].find((value) => !!value?.trim());\n};\n\nexport function CartSummaryCard({\n\titems,\n\tsubtotal,\n\ttax,\n\tshipping,\n\tdiscount,\n\ttotal,\n\tonCheckout,\n\tclassName,\n\tstrings: stringsProp,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\t...props\n}: CartSummaryCardProps) {\n\tconst strings = useStrings(defaultCartSummaryStrings, stringsProp);\n\tconst hasBreakdown = !!(subtotal || tax || shipping || discount);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"cart-summary\"\n\t\t\tclassName={cn('cart-summary--component w-full', className)}\n\t\t>\n\t\t\t<ItemGroup>\n\t\t\t\t{items.map((it) => {\n\t\t\t\t\tconst title = resolveCartLineTitle(it);\n\t\t\t\t\tconst imageSrc = resolveCartLineImageSrc(it);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Item key={it.id} className=\"cart-summary--item\">\n\t\t\t\t\t\t\t<ItemMedia variant=\"image\" className=\"cart-summary--item-media\">\n\t\t\t\t\t\t\t\t<LineThumbnail src={imageSrc} alt={it.imageAlt} title={title} />\n\t\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t\t<ItemContent className=\"cart-summary--item-content\">\n\t\t\t\t\t\t\t\t<ItemTitle>{title}</ItemTitle>\n\t\t\t\t\t\t\t\t{!!it.variantTitle && (\n\t\t\t\t\t\t\t\t\t<ItemDescription clamp={1}>{it.variantTitle}</ItemDescription>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t<ItemActions className=\"cart-summary--item-actions\">\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\" align=\"end\" className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"cart-summary--quantity tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t{strings.formatQuantity(it.qty)}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"tabular-nums\">{it.price}</Value>\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t\t</Item>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ItemGroup>\n\n\t\t\t<SummaryPanel className=\"cart-summary--totals\">\n\t\t\t\t{!!subtotal && <AmountRow label={strings.subtotal} amount={subtotal} />}\n\t\t\t\t{!!tax && <AmountRow label={strings.tax} amount={tax} />}\n\t\t\t\t{!!shipping && <AmountRow label={strings.shipping} amount={shipping} />}\n\t\t\t\t{!!discount && <AmountRow label={strings.discount} amount={discount} deduction />}\n\t\t\t\t<AmountRow label={strings.total} amount={total} total rollup={hasBreakdown} />\n\t\t\t</SummaryPanel>\n\n\t\t\t{!!onCheckout && (\n\t\t\t\t<Button tone=\"primary\" onClick={onCheckout} fullWidth>{strings.checkout}</Button>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nCartSummaryCard.displayName = 'CartSummaryCard';\n\n/** The source kit's name for `CartSummaryCard`; the same component. */\nexport const CartSummary = CartSummaryCard;\n","import type { StringsProp } from '../../../../lib/strings';\n\nexport interface CouponInputStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/**\n\t * Accessible name for the code field. The card shows no visible label — the\n\t * placeholder carries the hint — so this is the field's only accessible\n\t * name, and a placeholder alone is not one: it is not reliably announced and\n\t * disappears as soon as the user types.\n\t */\n\tfieldLabel: string;\n\tplaceholder: string;\n\tapply: string;\n\tremove: string;\n\tapplied: string;\n\tinvalid: string;\n}\n\nexport const defaultCouponInputStrings: CouponInputStrings = {\n\ttitle: 'Have a code?',\n\tfieldLabel: 'Coupon code',\n\tplaceholder: 'Enter coupon code',\n\tapply: 'Apply',\n\tremove: 'Remove',\n\tapplied: 'Applied',\n\tinvalid: 'That code is not valid',\n};\n\nexport interface CouponInputCardProps {\n\t/** Coupon currently applied, if any. */\n\tappliedCode?: string;\n\t/** Formatted discount the coupon grants. */\n\tappliedDiscount?: string;\n\t/** Validation message for a rejected code. */\n\terror?: string;\n\tonApply?: (code: string) => void;\n\t/** Fired when an entry is removed. */\n\tonRemove?: () => void;\n\t/** Whether a code is being checked. */\n\tloading?: boolean;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<CouponInputStrings>;\n}\n","/**\n * CouponInputCard — promo / coupon code entry with an applied state and\n * inline error messaging.\n *\n * Empty state — code input + apply button, helper line for\n * placeholders or errors. Applied state — success-tinted row with a check\n * medallion, monospaced code, discount delta, and a destructive remove icon.\n */\nimport {\n\tuseState } from 'react';\nimport { Check, X } from 'lucide-react';\nimport { ContentBlock } from '../../../base/display';\nimport { Button } from '../../../base/buttons';\nimport { IconBadge,\n} from '../../../base/display';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { Input } from '../../../base/text-inputs';\nimport { Stack } from '../../../base/structure';\nimport { useStrings } from '../../../../lib/strings';\n\nimport { defaultCouponInputStrings, type CouponInputCardProps } from './types';\n\nimport { cn } from '../../../../lib/utils';\nimport { formatDeduction } from '../format-signed-amount';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\nconst normalizeCode = (value: string): string => value.toUpperCase();\n\nexport function CouponInputCard({\n\tappliedCode,\n\tappliedDiscount,\n\terror,\n\tonApply,\n\tonRemove,\n\tloading,\n\tclassName,\n\tstrings: stringsProp,\n}: CouponInputCardProps) {\n\tconst strings = useStrings(defaultCouponInputStrings, stringsProp);\n\tconst [code, setCode] = useState('');\n\tconst trimmedCode = code.trim();\n\n\tif (appliedCode) {\n\t\treturn (\n\t\t\t<ContentBlock title={strings.title} className={cn('coupon-input--component w-full', className)}>\n\t\t\t\t<Item size=\"sm\" variant=\"muted\" className={cn('items-center gap-y-space-sm border', toneRecipes.success.edge, toneRecipes.success.wash)}>\n\t\t\t\t\t<ItemMedia>\n\t\t\t\t\t\t<IconBadge icon={Check} tone=\"success\" size=\"md\" />\n\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t{/*\n\t\t\t\t\t\tCode and status share one line so the applied panel matches the\n\t\t\t\t\t\tempty state's control height. Stacking them made this state ~20px\n\t\t\t\t\t\ttaller than the input it replaces, so applying a coupon shifted\n\t\t\t\t\t\teverything below it in the surrounding checkout column.\n\t\t\t\t\t*/}\n\t\t\t\t\t<ItemContent className=\"min-w-0\">\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\" wrap={false} className=\"min-w-0\">\n\t\t\t\t\t\t\t<ItemTitle className=\"min-w-0 truncate font-mono tracking-wider\" title={appliedCode}>{appliedCode}</ItemTitle>\n\t\t\t\t\t\t\t<DisplayLabel className=\"shrink-0\">\n\t\t\t\t\t\t\t\t{strings.applied}\n\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</ItemContent>\n\t\t\t\t\t<ItemActions className=\"ml-auto shrink-0 gap-space-sm\">\n\t\t\t\t\t\t{!!appliedDiscount && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\ttype=\"success\"\n\t\t\t\t\t\t\t\tclassName=\"tabular-nums shrink-0\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{formatDeduction(appliedDiscount)}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!onRemove && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"destructive\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tonClick={onRemove}\n\t\t\t\t\t\t\t\taria-label={strings.remove}\n\t\t\t\t\t\t\t\tclassName=\"size-action-xs shrink-0 text-muted-foreground hover:text-destructive\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ItemActions>\n\t\t\t\t</Item>\n\t\t\t</ContentBlock>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ContentBlock title={strings.title} className={cn('coupon-input--component w-full', className)}>\n\t\t\t<Stack gap=\"md\">\n\t\t\t\t<div className=\"flex flex-wrap gap-space-md\">\n\t\t\t\t\t<div className=\"min-w-44 flex-1\">\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tvalue={code}\n\t\t\t\t\t\t\tonChange={(e) => setCode(normalizeCode((e.target as HTMLInputElement).value))}\n\t\t\t\t\t\t\taria-label={strings.fieldLabel}\n\t\t\t\t\t\t\tplaceholder={strings.placeholder}\n\t\t\t\t\t\t\tautoCapitalize=\"characters\"\n\t\t\t\t\t\t\tspellCheck={false}\n\t\t\t\t\t\t\tclassName=\"font-mono\"\n\t\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\tsize=\"md\"\n\t\t\t\t\t\tonClick={() => onApply?.(trimmedCode)}\n\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\tdisabled={!trimmedCode}\n\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{strings.apply}\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{!!error && (\n\t\t\t\t\t<Text size=\"xs\" type=\"error\">{error || strings.invalid}</Text>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</ContentBlock>\n\t);\n}\n\nCouponInputCard.displayName = 'CouponInputCard';\n","import type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type OrderStatusKind = 'pending' | 'paid' | 'fulfilled' | 'shipped' | 'delivered' | 'cancelled';\n\nexport interface OrderStatusEvent {\n\t/** Display label. */\n\tlabel: string;\n\t/** Formatted time for the entry. */\n\ttimestamp?: string;\n\tcomplete: boolean;\n}\n\nexport interface OrderStatusStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Not rendered: the title badge states the status. Kept for existing overrides. */\n\tstatusLabel: string;\n\t/** Label of the delivery-estimate fact. */\n\teta: string;\n\t/** Not rendered: the timeline shows the latest event. Kept for existing overrides. */\n\tlatestEvent: string;\n\t/** Not rendered: the timeline marks the current step. Kept for existing overrides. */\n\tcurrentStep: string;\n}\n\nexport const defaultOrderStatusStrings: OrderStatusStrings = {\n\ttitle: 'Order status',\n\tstatusLabel: 'Current status',\n\teta: 'ETA',\n\tlatestEvent: 'Latest event',\n\tcurrentStep: 'Current step',\n};\n\nexport interface OrderStatusCardProps {\n\t/** Human-facing order reference. */\n\torderNumber: string;\n\t/** Current fulfilment stage. */\n\tstatus: OrderStatusKind;\n\t/** Badge tone for the status chip. */\n\tstatusTone?: BadgeTone;\n\t/** Timeline entries, oldest first. */\n\tevents: OrderStatusEvent[];\n\t/** Formatted delivery estimate. */\n\tcurrentEta?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OrderStatusStrings>;\n}\n","/**\n * OrderStatusCard — order number + status badge + readable event timeline.\n * Ideal for dashboards / receipt summaries. Strings overridable for i18n.\n *\n * The badge states the status and the timeline states every event, so the\n * only extra fact is the delivery estimate.\n */\nimport { CalendarClock, Check, Circle } from 'lucide-react';\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { ContentBlock } from '../../../base/display';\nimport { SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultOrderStatusStrings,\n\ttype OrderStatusCardProps,\n\ttype OrderStatusKind,\n} from './types';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\n// Every fulfilment stage is a status, so each maps to a status tone. Primary is\n// reserved for the main command and never paints a status chip.\nconst VARIANT_BY_STATUS: Record<OrderStatusKind, BadgeTone> = {\n\tpending: 'warning',\n\tpaid: 'info',\n\tfulfilled: 'info',\n\tshipped: 'info',\n\tdelivered: 'success',\n\tcancelled: 'destructive',\n};\n\nexport function OrderStatusCard({\n\torderNumber,\n\tstatus,\n\tstatusTone,\n\tevents,\n\tcurrentEta,\n\tclassName,\n\tstrings: stringsProp,\n}: OrderStatusCardProps) {\n\tconst strings = useStrings(defaultOrderStatusStrings, stringsProp);\n\tconst variant = statusTone ?? VARIANT_BY_STATUS[status];\n\tconst lastCompleteIdx = events.reduce((acc, e, i) => (e.complete ? i : acc), -1);\n\tconst nextEvent = events.find((event) => !event.complete);\n\n\treturn (\n\t\t<ContentBlock\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={<Badge tone={variant} className=\"capitalize\">{status}</Badge>}\n\t\t\tdescription={`#${orderNumber}`}\n\t\t\tcontentGap=\"xl\"\n\t\t\tclassName={cn('order-status--component w-full', className)}\n\t\t>\n\t\t\t{/* The order's one extra fact: a label/value row for its estimate. */}\n\t\t\t{!!currentEta && (\n\t\t\t\t<InlineStat\n\t\t\t\t\tlabel={strings.eta}\n\t\t\t\t\tvalue={currentEta}\n\t\t\t\t\tclassName=\"order-status--eta\"\n\t\t\t\t\tvalueWeight=\"medium\"\n\t\t\t\t\tvalueClassName=\"tabular-nums\"\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{events.length > 0 && (\n\t\t\t\t<ol className=\"m-0 p-0 list-none\">\n\t\t\t\t\t{events.map((event, index) => {\n\t\t\t\t\t\tconst isLast = index === events.length - 1;\n\t\t\t\t\t\tconst isCurrent = nextEvent ? event === nextEvent : index === lastCompleteIdx;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={`${event.label}-${index}`} className=\"relative flex gap-space-lg\">\n\t\t\t\t\t\t\t\t<div className=\"flex flex-col items-center\">\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'flex size-6 shrink-0 items-center justify-center rounded-full border',\n\t\t\t\t\t\t\t\t\t\t\tevent.complete\n\t\t\t\t\t\t\t\t\t\t\t\t? 'border-success bg-success text-success-foreground'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'border-border bg-card text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t\t// The up-next marker sits directly beneath success-filled steps,\n\t\t\t\t\t\t\t\t\t\t\t// and primary is a neighbouring hue to success in this theme, so a\n\t\t\t\t\t\t\t\t\t\t\t// 10% ring read as the same state at a glance. A tinted fill plus a\n\t\t\t\t\t\t\t\t\t\t\t// heavier border and ring separate it by weight rather than by hue,\n\t\t\t\t\t\t\t\t\t\t\t// which survives a retheme that moves primary closer to success.\n\t\t\t\t\t\t\t\t\t\t\tisCurrent && !event.complete && cn('border-2 border-primary-accent ring-4', toneRecipes.primary.tint, toneRecipes.primary.ink, toneRecipes.primary.halo),\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{event.complete ? (\n\t\t\t\t\t\t\t\t\t\t\t<Check className=\"size-icon-md\" strokeWidth={2.5} />\n\t\t\t\t\t\t\t\t\t\t) : isCurrent ? (\n\t\t\t\t\t\t\t\t\t\t\t<CalendarClock className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<Circle className=\"size-icon-sm\" />\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{!isLast && (\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t'min-h-6 w-px flex-1',\n\t\t\t\t\t\t\t\t\t\t\t\tindex < lastCompleteIdx ? 'bg-success' : 'bg-border',\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div className={cn('min-w-0 flex-1 pb-space-xl', isLast && 'pb-0')}>\n\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\tweight={event.complete || isCurrent ? 'semibold' : 'medium'}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(!event.complete && !isCurrent && 'text-muted-foreground')}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{event.label}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t{!!event.timestamp && (\n\t\t\t\t\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t\t{event.timestamp}\n\t\t\t\t\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</ol>\n\t\t\t)}\n\t\t</ContentBlock>\n\t);\n}\n\nOrderStatusCard.displayName = 'OrderStatusCard';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type PaymentBrand = 'visa' | 'mastercard' | 'amex' | 'paypal' | 'applepay' | 'googlepay' | 'unknown';\n\n/** `card` draws the card face; `row` the compact identity row. */\nexport type PaymentMethodVariant = 'card' | 'row';\n\nexport interface PaymentMethodStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tdefault: string;\n\tcardHolder: string;\n\texpires: string;\n\tchange: string;\n\t/** Each brand's name as it is read aloud and shown in the `row` form. */\n\tbrands: Record<PaymentBrand, string>;\n\t/** Names the method without reading the number aloud: \"Visa ending 4242\". */\n\tformatCard: (brand: string, last4: string) => string;\n}\n\nexport const defaultPaymentMethodStrings: PaymentMethodStrings = {\n\ttitle: 'Payment method',\n\tdefault: 'Default',\n\tcardHolder: 'Card holder',\n\texpires: 'Expires',\n\tchange: 'Change',\n\tbrands: {\n\t\tvisa: 'Visa',\n\t\tmastercard: 'Mastercard',\n\t\tamex: 'American Express',\n\t\tpaypal: 'PayPal',\n\t\tapplepay: 'Apple Pay',\n\t\tgooglepay: 'Google Pay',\n\t\tunknown: 'Card',\n\t},\n\tformatCard: (brand, last4) => `${brand} ending ${last4}`,\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface PaymentMethodProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title' | 'onChange'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Card network or wallet. */\n\tbrand: PaymentBrand;\n\t/** Last four digits, the only card number this component accepts. */\n\tlast4: string;\n\t/** Expiry in MM/YY form. */\n\texpiry?: string; // MM/YY\n\t/** Name printed on the card. */\n\tholderName?: string;\n\t/** Marks this as the account's default method. */\n\tdefault?: boolean;\n\t/**\n\t * Fired when the \"Change\" action is pressed. It carries no value — the\n\t * component never holds a payment method to hand back — so treat it as a\n\t * request to open your own method picker.\n\t */\n\tonChange?: () => void;\n\t/** `card` (default) draws the card face; `row` the compact identity row. */\n\tvariant?: PaymentMethodVariant;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<PaymentMethodStrings>;\n}\n\n/** Props of `PaymentMethodCard`: `PaymentMethod` with `variant` defaulting to `row`. */\nexport type PaymentMethodCardProps = PaymentMethodProps;\n","/**\n * PaymentMethod — saved payment-method surface, in two forms.\n *\n * - `card` (default): the hero block is a mini credit-card mock with real card\n * proportions, brand chip top-right, and holder + expiry on the bottom row.\n * The centre line is drawn as a full PAN but only `last4` is ever supplied:\n * the leading digits are decorative bullets, hidden from assistive\n * technology, and the card is named aloud through `strings.formatCard`\n * (\"Visa ending 4242\") instead.\n * - `row`: a compact identity row: that same spoken name, with the holder\n * and expiry beneath it. No glyph: one card icon would misname a wallet.\n *\n * The component neither accepts nor stores a full card number. `onChange` is\n * a request to open the consumer's own method picker; it carries no value.\n * `PaymentMethodCard` is this component defaulting to the `row` form.\n */\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { VisuallyHidden } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultPaymentMethodStrings, type PaymentBrand, type PaymentMethodProps } from './types';\n\n/** The brand chip as printed on a card face. The spoken name comes from `strings.brands`. */\nconst BRAND_LABEL: Record<PaymentBrand, string> = {\n\tvisa: 'VISA',\n\tmastercard: 'MasterCard',\n\tamex: 'AMEX',\n\tpaypal: 'PayPal',\n\tapplepay: 'Apple Pay',\n\tgooglepay: 'Google Pay',\n\tunknown: 'Card',\n};\n\n/**\n * The card face is an artwork-backed surface, which `--inverse-*` exists for.\n * Brands previously borrowed semantic state colours — a Visa painted `info`,\n * Google Pay `success` — so retheming an alert colour would have repainted\n * every stored card. Those tokens mean states, not brands. Identity comes from\n * the brand label and mark; the surface stays canonical, which also matches how\n * real cards read in an admin list.\n */\n// Translucent gloss composites over its explicit inverse base in both themes.\nconst BRAND_SURFACE = 'bg-inverse-background from-inverse-background via-inverse-surface-strong to-inverse-background';\n\nexport function PaymentMethod({\n\tbrand,\n\tlast4,\n\texpiry,\n\tholderName,\n\tdefault: defaultMethod = false,\n\tonChange,\n\tvariant = 'card',\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: PaymentMethodProps) {\n\tconst strings = useStrings(defaultPaymentMethodStrings, stringsProp);\n\tconst spokenName = strings.formatCard(strings.brands[brand], last4);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={defaultMethod ? <Badge tone=\"neutral\">{strings.default}</Badge> : null}\n\t\t\theaderAction={onChange ? (\n\t\t\t\t<Button buttonStyle=\"ghost\" tone=\"secondary\" onClick={onChange}>\n\t\t\t\t\t{strings.change}\n\t\t\t\t</Button>\n\t\t\t) : undefined}\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn('payment-method--component w-full', className)}\n\t\t>\n\t\t\t{variant === 'row' ? (\n\t\t\t\t<Stack gap=\"dense\" className=\"payment-method--identity min-w-0\">\n\t\t\t\t\t<Text type=\"inherit\" weight=\"semibold\" className=\"payment-method--name\">{spokenName}</Text>\n\t\t\t\t\t{!!holderName && (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"payment-method--holder truncate\">{holderName}</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!expiry && (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"payment-method--expiry\">\n\t\t\t\t\t\t\t{strings.expires} <Value type=\"inherit\" className=\"tabular-nums\">{expiry}</Value>\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t) : (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'payment-method--face relative flex aspect-[85.6/53.98] w-full max-w-[22rem] flex-col justify-between overflow-hidden rounded-surface bg-linear-to-br p-surface text-inverse-foreground shadow-sm ring-1 ring-inverse-border',\n\t\t\t\t\t\tBRAND_SURFACE,\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden>{spokenName}</VisuallyHidden>\n\t\t\t\t\t<div aria-hidden=\"true\" className=\"relative flex items-start justify-between\">\n\t\t\t\t\t\t<div className=\"flex size-7 items-center justify-center rounded-radius-md bg-gradient-to-br from-muted to-muted-foreground/60 shadow-sm\">\n\t\t\t\t\t\t\t<div className=\"size-icon rounded-radius-sm border border-warning-foreground/25 bg-warning-foreground/15\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\tweight=\"bold\"\n\t\t\t\t\t\t\tclassName=\"rounded-radius-xs bg-inverse-surface px-space-md py-space-2xs tracking-[0.15em] text-inverse-foreground\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{BRAND_LABEL[brand]}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div aria-hidden=\"true\" className=\"relative\">\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\tclassName=\"payment-method--number block whitespace-nowrap font-mono tracking-widest text-inverse-foreground\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t•••• •••• •••• {last4}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<Stack direction=\"horizontal\" align=\"end\" justify=\"between\" gap=\"lg\" className=\"relative\">\n\t\t\t\t\t\t<div className=\"min-w-0\">\n\t\t\t\t\t\t\t{!!holderName && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"block\">{strings.cardHolder}</DisplayLabel>\n\t\t\t\t\t\t\t\t\t<Text weight=\"semibold\" className=\"truncate text-inverse-foreground\">{holderName}</Text>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{!!expiry && (\n\t\t\t\t\t\t\t<div className=\"text-right shrink-0\">\n\t\t\t\t\t\t\t\t<DisplayLabel tone=\"inverse\" className=\"block\">{strings.expires}</DisplayLabel>\n\t\t\t\t\t\t\t\t<Value weight=\"semibold\" className=\"tabular-nums text-inverse-foreground\">{expiry}</Value>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nPaymentMethod.displayName = 'PaymentMethod';\n\n/**\n * The source kit's `PaymentMethodCard`: `PaymentMethod` defaulting to the\n * compact `row` identity form. Pass `variant=\"card\"` for the card face.\n */\nexport function PaymentMethodCard({ variant = 'row', ...props }: PaymentMethodProps) {\n\treturn <PaymentMethod variant={variant} {...props} />;\n}\n\nPaymentMethodCard.displayName = 'PaymentMethodCard';\n","import type {\n\tSeoListingCheckId,\n\tSeoListingCheckResult,\n\tSeoListingCheckStatus,\n\tSeoListingScoreInput,\n\tSeoListingScoreLimits,\n\tSeoListingScoreResult,\n} from './types';\n\nexport const DEFAULT_SEO_LISTING_LIMITS: Required<SeoListingScoreLimits> = {\n\ttitleMin: 35,\n\ttitleMax: 60,\n\tdescriptionMin: 120,\n\tdescriptionMax: 160,\n\tpermalinkMax: 75,\n};\n\nfunction resolveLimits(limits?: SeoListingScoreLimits): Required<SeoListingScoreLimits> {\n\treturn {\n\t\t...DEFAULT_SEO_LISTING_LIMITS,\n\t\t...limits,\n\t};\n}\n\nfunction clampScore(value: number): number {\n\tif (!Number.isFinite(value)) return 0;\n\treturn Math.max(0, Math.min(1, value));\n}\n\nfunction getCheckStatus(score: number, maxScore: number): SeoListingCheckStatus {\n\tif (maxScore <= 0) return 'missing';\n\tconst ratio = score / maxScore;\n\tif (ratio >= 0.9) return 'good';\n\tif (ratio >= 0.5) return 'review';\n\treturn 'missing';\n}\n\nfunction makeCheck(\n\tid: SeoListingCheckId,\n\tscoreRatio: number,\n\tmaxScore: number,\n\tactual: number,\n\trange?: Pick<SeoListingCheckResult, 'min' | 'max'>,\n): SeoListingCheckResult {\n\tconst score = Math.round(clampScore(scoreRatio) * maxScore);\n\treturn {\n\t\tid,\n\t\tscore,\n\t\tmaxScore,\n\t\tactual,\n\t\tstatus: getCheckStatus(score, maxScore),\n\t\t...range,\n\t};\n}\n\nfunction lengthScore(value: string, min: number, max: number): number {\n\tconst length = value.trim().length;\n\tif (length === 0) return 0;\n\tif (length >= min && length <= max) return 1;\n\tif (length < min) return Math.max(0.35, length / min);\n\tif (length > max * 2) return 0.35;\n\tconst overBy = length - max;\n\treturn Math.max(0.55, 1 - overBy / max);\n}\n\nexport function getSeoPermalinkPath(permalink?: string): string {\n\tconst value = permalink?.trim() ?? '';\n\tif (!value) return '';\n\n\tconst withoutHash = value.split('#')[0] ?? '';\n\tconst withoutQuery = withoutHash.split('?')[0] ?? '';\n\tconst withoutProtocol = withoutQuery.replace(/^https?:\\/\\/[^/]+/i, '');\n\n\treturn withoutProtocol.replace(/^\\/+|\\/+$/g, '');\n}\n\nexport function getSeoPermalinkSlug(permalink?: string): string {\n\tconst path = getSeoPermalinkPath(permalink);\n\tconst parts = path.split('/').filter(Boolean);\n\treturn parts.at(-1) ?? '';\n}\n\nfunction permalinkScore(permalink?: string, max = DEFAULT_SEO_LISTING_LIMITS.permalinkMax): number {\n\tconst path = getSeoPermalinkPath(permalink);\n\tif (!path) return 0;\n\tif (path.length <= max) return 1;\n\tif (path.length > max * 2) return 0.35;\n\treturn Math.max(0.55, 1 - (path.length - max) / max);\n}\n\nfunction slugScore(permalink?: string): number {\n\tconst slug = getSeoPermalinkSlug(permalink);\n\tif (!slug) return 0;\n\tif (/^[\\p{L}\\p{N}]+(?:-[\\p{L}\\p{N}]+)*$/u.test(slug) && slug === slug.toLowerCase()) {\n\t\treturn 1;\n\t}\n\tif (!/\\s/.test(slug) && !/[?#]/.test(slug)) return 0.65;\n\treturn 0.25;\n}\n\nfunction urlScore(baseUrl?: string): number {\n\tconst value = baseUrl?.trim() ?? '';\n\tif (!value) return 0;\n\tif (/^https:\\/\\//i.test(value)) return 1;\n\tif (/^http:\\/\\//i.test(value)) return 0.6;\n\treturn 0.45;\n}\n\nfunction keywordScore(input: SeoListingScoreInput): number | null {\n\tconst keyword = input.keyword?.trim().toLowerCase();\n\tif (!keyword) return null;\n\n\tconst haystack = [\n\t\tinput.title,\n\t\tinput.description,\n\t\tgetSeoPermalinkPath(input.permalink),\n\t]\n\t\t.filter(Boolean)\n\t\t.join(' ')\n\t\t.toLowerCase();\n\n\tif (!haystack) return 0;\n\treturn haystack.includes(keyword) ? 1 : 0.35;\n}\n\nexport function calculateSeoListingScore(input: SeoListingScoreInput): SeoListingScoreResult {\n\tconst limits = resolveLimits(input.limits);\n\tconst title = input.title?.trim() ?? '';\n\tconst description = input.description?.trim() ?? '';\n\tconst permalinkPath = getSeoPermalinkPath(input.permalink);\n\tconst slug = getSeoPermalinkSlug(input.permalink);\n\tconst checks: SeoListingCheckResult[] = [\n\t\tmakeCheck('title', lengthScore(title, limits.titleMin, limits.titleMax), 30, title.length, {\n\t\t\tmin: limits.titleMin,\n\t\t\tmax: limits.titleMax,\n\t\t}),\n\t\tmakeCheck(\n\t\t\t'description',\n\t\t\tlengthScore(description, limits.descriptionMin, limits.descriptionMax),\n\t\t\t30,\n\t\t\tdescription.length,\n\t\t\t{\n\t\t\t\tmin: limits.descriptionMin,\n\t\t\t\tmax: limits.descriptionMax,\n\t\t\t},\n\t\t),\n\t\tmakeCheck('permalink', permalinkScore(input.permalink, limits.permalinkMax), 15, permalinkPath.length, {\n\t\t\tmax: limits.permalinkMax,\n\t\t}),\n\t\tmakeCheck('slug', slugScore(input.permalink), 10, slug.length),\n\t\tmakeCheck('url', urlScore(input.baseUrl), 10, input.baseUrl?.trim().length ?? 0),\n\t];\n\n\tconst keyword = keywordScore(input);\n\tif (keyword !== null) {\n\t\tchecks.push(makeCheck('keyword', keyword, 5, input.keyword?.trim().length ?? 0));\n\t}\n\n\tconst score = Math.round(\n\t\t(checks.reduce((sum, check) => sum + check.score, 0) /\n\t\t\tchecks.reduce((sum, check) => sum + check.maxScore, 0)) *\n\t\t\t100,\n\t);\n\n\treturn {\n\t\tscore,\n\t\tstatus: getCheckStatus(score, 100),\n\t\tchecks,\n\t\tlimits,\n\t};\n}\n","import type { ReactNode } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type SeoListingCheckId =\n\t| 'title'\n\t| 'description'\n\t| 'permalink'\n\t| 'slug'\n\t| 'url'\n\t| 'keyword';\n\nexport type SeoListingCheckStatus = 'good' | 'review' | 'missing';\n\nexport interface SeoListingScoreLimits {\n\ttitleMin?: number;\n\ttitleMax?: number;\n\tdescriptionMin?: number;\n\tdescriptionMax?: number;\n\tpermalinkMax?: number;\n}\n\nexport interface SeoListingScoreInput {\n\t/** Surface title. */\n\ttitle?: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/** Full URL shown under the title. */\n\tpermalink?: string;\n\t/** Origin the permalink is built on. */\n\tbaseUrl?: string;\n\t/** Target keyword the copy is scored against. */\n\tkeyword?: string;\n\t/** Character caps for the title and description. */\n\tlimits?: SeoListingScoreLimits;\n}\n\nexport interface SeoListingCheckResult {\n\t/** Stable identity for this entry. */\n\tid: SeoListingCheckId;\n\tstatus: SeoListingCheckStatus;\n\t/** Overall SEO score, 0-100. */\n\tscore: number;\n\tmaxScore: number;\n\tactual: number;\n\tmin?: number;\n\tmax?: number;\n}\n\nexport interface SeoListingScoreResult {\n\t/** Overall SEO score, 0-100. */\n\tscore: number;\n\tstatus: SeoListingCheckStatus;\n\tchecks: SeoListingCheckResult[];\n\t/** Character caps for the title and description. */\n\tlimits: Required<SeoListingScoreLimits>;\n}\n\nexport interface SeoListingCardStrings {\n\t/** Surface title. */\n\ttitle: string;\n\teditLabel: string;\n\tscoreLabel: string;\n\tchecksLabel: string;\n\tsiteFallback: string;\n\ttitleFallback: string;\n\tdescriptionFallback: string;\n\turlFallback: string;\n\tcharacters: string;\n\tmaxLabel: string;\n\ttargetLabel: string;\n\tstatus: Record<SeoListingCheckStatus, string>;\n\tcheckLabels: Record<SeoListingCheckId, string>;\n\tcheckHints: Record<SeoListingCheckId, string>;\n}\n\nexport const defaultSeoListingCardStrings: SeoListingCardStrings = {\n\ttitle: 'Search engine listing',\n\teditLabel: 'Edit search listing',\n\tscoreLabel: 'SEO score',\n\tchecksLabel: 'SEO checks',\n\tsiteFallback: 'Website',\n\ttitleFallback: 'Add an SEO title',\n\tdescriptionFallback: 'Add a meta description to control the search snippet.',\n\turlFallback: 'https://example.com',\n\tcharacters: 'characters',\n\tmaxLabel: 'max',\n\ttargetLabel: 'target',\n\tstatus: {\n\t\tgood: 'Good',\n\t\treview: 'Review',\n\t\tmissing: 'Missing',\n\t},\n\tcheckLabels: {\n\t\ttitle: 'Title',\n\t\tdescription: 'Description',\n\t\tpermalink: 'Permalink',\n\t\tslug: 'Slug format',\n\t\turl: 'URL',\n\t\tkeyword: 'Keyword',\n\t},\n\tcheckHints: {\n\t\ttitle: 'Keep the title inside the target range.',\n\t\tdescription: 'Use a complete meta description inside the target range.',\n\t\tpermalink: 'Keep the permalink readable and below the maximum length.',\n\t\tslug: 'Use lowercase words separated by hyphens.',\n\t\turl: 'Prefer a secure canonical URL.',\n\t\tkeyword: 'Use the focus keyword in the title, description, or permalink.',\n\t},\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface SeoListingCardProps extends Pick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Site name shown in the search preview. */\n\tsiteName?: string;\n\t/** Origin the permalink is built on. */\n\tbaseUrl?: string;\n\t/** Path parts appended to the base URL. */\n\tpathSegments?: string[];\n\t/** Full URL shown under the title. */\n\tpermalink?: string;\n\t/** Surface title. */\n\ttitle?: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/** Formatted price shown in the rich result. */\n\tprice?: ReactNode;\n\t/** Target keyword the copy is scored against. */\n\tkeyword?: string;\n\t/** Overall SEO score, 0-100. */\n\tscore?: SeoListingScoreResult;\n\t/** Character caps for the title and description. */\n\tlimits?: SeoListingScoreLimits;\n\t/** Renders the checks. */\n\tshowChecks?: boolean;\n\t/** Fired when an entry is edited. */\n\tonEdit?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<SeoListingCardStrings>;\n}\n","/**\n * SeoListingCard — search-result preview with a reusable SEO score.\n *\n * The card is render-only: consumers own form state and call `onEdit` or\n * compose their own editor around the exported `calculateSeoListingScore`\n * helper. Scoring is intentionally configurable through `limits` so apps can\n * tune their own title, description, and permalink thresholds.\n */\nimport {\n\tCheckCircle2,\n\tCircleAlert,\n\tExternalLink,\n\tPencil,\n\tTriangleAlert,\n\ttype LucideIcon,\n} from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Progress } from '../../../base/feedback';\nimport { Stack } from '../../../base/structure';\nimport { Number as NumberValue, SecondaryValue, Value } from '../../../primitives';\nimport { Text, TextLink } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tcalculateSeoListingScore,\n\tgetSeoPermalinkPath,\n} from './seo-listing-score';\nimport {\n\tdefaultSeoListingCardStrings,\n\ttype SeoListingCardProps,\n\ttype SeoListingCardStrings,\n\ttype SeoListingCheckResult,\n\ttype SeoListingCheckStatus,\n} from './types';\n\n// `good` is success, not info: the row already carries a CheckCircle2, and\n// every other commerce surface (order status, inventory level, discount\n// stack, applied coupon, refund stages) signals a passing state in success\n// green. The review/missing rungs already matched the shared vocabulary.\nconst SCORE_BADGE_TONE: Record<SeoListingCheckStatus, BadgeTone> = {\n\tgood: 'success',\n\treview: 'warning',\n\tmissing: 'destructive',\n};\n\nconst SCORE_PROGRESS_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: '[&_[data-slot=progress-indicator]]:bg-success',\n\treview: '[&_[data-slot=progress-indicator]]:bg-warning',\n\tmissing: '[&_[data-slot=progress-indicator]]:bg-destructive',\n};\n\nconst CHECK_ICON: Record<SeoListingCheckStatus, LucideIcon> = {\n\tgood: CheckCircle2,\n\treview: TriangleAlert,\n\tmissing: CircleAlert,\n};\n\n// The glyph encodes the check's state, so it carries the status colour and\n// nothing else: no tinted square behind it and no tinted tile around the row.\nconst CHECK_ICON_CLASS: Record<SeoListingCheckStatus, string> = {\n\tgood: 'text-success',\n\treview: 'text-warning-accent',\n\tmissing: 'text-destructive',\n};\n\nfunction trimSlashes(value: string): string {\n\treturn value.replace(/^\\/+|\\/+$/g, '');\n}\n\nfunction buildUrlParts(baseUrl: string, pathSegments: string[], permalink?: string): string[] {\n\tconst path = getSeoPermalinkPath(permalink);\n\tconst permalinkParts = path.split('/').filter(Boolean);\n\treturn [\n\t\tbaseUrl,\n\t\t...pathSegments.map(trimSlashes).filter(Boolean),\n\t\t...permalinkParts,\n\t].filter(Boolean);\n}\n\nfunction buildHref(baseUrl: string, pathSegments: string[], permalink?: string): string | undefined {\n\tif (!baseUrl.trim()) return undefined;\n\tconst base = baseUrl.replace(/\\/+$/g, '');\n\tconst path = [\n\t\t...pathSegments.map(trimSlashes).filter(Boolean),\n\t\t...getSeoPermalinkPath(permalink).split('/').filter(Boolean),\n\t].join('/');\n\n\treturn path ? `${base}/${path}` : base;\n}\n\nfunction getCheckDetail(check: SeoListingCheckResult, strings: SeoListingCardStrings): string {\n\tif (check.id === 'title' || check.id === 'description') {\n\t\treturn `${check.actual}/${check.max} ${strings.characters} · ${strings.targetLabel} ${check.min}-${check.max}`;\n\t}\n\tif (check.id === 'permalink') {\n\t\treturn `${check.actual}/${check.max} ${strings.characters} ${strings.maxLabel}`;\n\t}\n\treturn strings.checkHints[check.id];\n}\n\nfunction SeoCheckRow({\n\tcheck,\n\tdetail,\n\tstrings,\n}: {\n\tcheck: SeoListingCheckResult;\n\tdetail: ReactNode;\n\tstrings: SeoListingCardStrings;\n}) {\n\tconst Icon = CHECK_ICON[check.status];\n\n\treturn (\n\t\t<div className=\"seo-listing-card--check min-w-0\">\n\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"start\" wrap={false}>\n\t\t\t\t{/* Same first-line offset the shared ItemMedia applies beside a description. */}\n\t\t\t\t<Icon\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'seo-listing-card--check-icon size-icon shrink-0 translate-y-0.5',\n\t\t\t\t\t\tCHECK_ICON_CLASS[check.status],\n\t\t\t\t\t)}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" justify=\"between\" wrap={false}>\n\t\t\t\t\t\t<Text type=\"inherit\" tag=\"span\" weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t\t\t{strings.checkLabels[check.id]}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\ttone={SCORE_BADGE_TONE[check.status]}\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tinline\n\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.status[check.status]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" lineHeight=\"snug\">\n\t\t\t\t\t\t{detail}\n\t\t\t\t\t</Text>\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t</div>\n\t);\n}\n\nexport function SeoListingCard({\n\tsiteName,\n\tbaseUrl,\n\tpathSegments = [],\n\tpermalink,\n\ttitle,\n\tdescription,\n\tprice,\n\tkeyword,\n\tscore,\n\tlimits,\n\tshowChecks = true,\n\tonEdit,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n}: SeoListingCardProps) {\n\tconst strings = useStrings(defaultSeoListingCardStrings, stringsProp);\n\tconst resolvedBaseUrl = baseUrl?.trim() || strings.urlFallback;\n\tconst resolvedSiteName = siteName?.trim() || strings.siteFallback;\n\tconst resolvedTitle = title?.trim() || strings.titleFallback;\n\tconst resolvedDescription = description?.trim() || strings.descriptionFallback;\n\tconst scoreResult = score ?? calculateSeoListingScore({\n\t\ttitle,\n\t\tdescription,\n\t\tpermalink,\n\t\tbaseUrl,\n\t\tkeyword,\n\t\tlimits,\n\t});\n\tconst href = buildHref(resolvedBaseUrl, pathSegments, permalink);\n\tconst urlParts = buildUrlParts(resolvedBaseUrl, pathSegments, permalink);\n\tconst statusTone = SCORE_BADGE_TONE[scoreResult.status];\n\n\treturn (\n\t\t<Card\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={(\n\t\t\t\t<Badge tone={statusTone} size=\"sm\" inline className=\"shrink-0\">\n\t\t\t\t\t{scoreResult.score}/100 {strings.status[scoreResult.status]}\n\t\t\t\t</Badge>\n\t\t\t)}\n\t\t\tclassName={cn('seo-listing-card--component @container/seo-listing-card w-full', className)}\n\t\t\tcontentGap=\"2xl\"\n\t\t\theaderAction={\n\t\t\t\tonEdit ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\taria-label={strings.editLabel}\n\t\t\t\t\t\tonClick={onEdit}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Pencil className=\"size-icon-sm\" />\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{/*\n\t\t\t\t\t`data-artwork` marks this subtree as a depiction of an external\n\t\t\t\t\tproduct rather than part of the consumer's theme. A search result\n\t\t\t\t\tmust look like a search result whatever colour the admin is themed,\n\t\t\t\t\tso the snippet title states Google's link blue outright instead of\n\t\t\t\t\tborrowing `--color-info`, which would have repainted the preview\n\t\t\t\t\twhenever someone retuned their informational-message colour.\n\t\t\t\t*/}\n\t\t\t\t<div data-artwork=\"serp\" className=\"seo-listing-card--preview min-w-0 rounded-radius border border-border/60 bg-background text-foreground p-surface shadow-xs\">\n\t\t\t\t<Stack gap=\"sm\" className=\"min-w-0\">\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false}>\n\t\t\t\t\t\t<Text type=\"inherit\" weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t\t\t{resolvedSiteName}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t{!!href && <ExternalLink className=\"size-icon-sm shrink-0 text-muted-foreground\" aria-hidden=\"true\" />}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<div className=\"seo-listing-card--url flex min-w-0 flex-wrap items-center gap-x-space-sm gap-y-space-2xs\">\n\t\t\t\t\t\t{urlParts.map((part, index) => (\n\t\t\t\t\t\t\t<span key={`${part}-${index}`} className=\"inline-flex min-w-0 items-center gap-space-sm\">\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t{index < urlParts.length - 1 && (\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t›\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t\t{href ? (\n\t\t\t\t\t\t<TextLink\n\t\t\t\t\t\t\thref={href}\n\t\t\t\t\t\t\tsize=\"base\"\n\t\t\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\t\t\tunderline={false}\n\t\t\t\t\t\t\tclassName=\"seo-listing-card--snippet-title block text-[#1a0dab] dark:text-[#8ab4f8]\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{resolvedTitle}\n\t\t\t\t\t\t</TextLink>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Text type=\"inherit\"\n\t\t\t\t\t\t\tsize=\"base\"\n\t\t\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\t\t\tclassName=\"seo-listing-card--snippet-title text-[#1a0dab] dark:text-[#8ab4f8]\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{resolvedTitle}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t<Text type=\"secondary\" lineHeight=\"relaxed\" className=\"seo-listing-card--description max-w-4xl\">\n\t\t\t\t\t\t{resolvedDescription}\n\t\t\t\t\t</Text>\n\t\t\t\t\t{!!price && (\n\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"seo-listing-card--price block tabular-nums\">\n\t\t\t\t\t\t\t{price}\n\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t{/*\n\t\t\t\tThe score is a section of this card, not a second card: no tinted\n\t\t\t\tpanel, no inner rule and no repeated status badge — the title suffix\n\t\t\t\talready states the status, and the bar and glyphs carry its colour.\n\t\t\t*/}\n\t\t\t<Stack gap=\"lg\" className=\"seo-listing-card--score\">\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" justify=\"between\" align=\"start\" wrap={false}>\n\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t\t<Text type=\"inherit\" weight=\"semibold\">{strings.scoreLabel}</Text>\n\t\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t<NumberValue value={scoreResult.checks.length} size=\"xs\" type=\"secondary\" align=\"left\" /> {strings.checksLabel}\n\t\t\t\t\t\t</SecondaryValue>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"shrink-0 tabular-nums\">\n\t\t\t\t\t\t{scoreResult.score}/100\n\t\t\t\t\t</Value>\n\t\t\t\t</Stack>\n\t\t\t\t<Progress\n\t\t\t\t\tvalue={scoreResult.score}\n\t\t\t\t\taria-label={strings.scoreLabel}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'seo-listing-card--score-progress',\n\t\t\t\t\t\t'[&_[data-slot=progress-track]]:h-space-md',\n\t\t\t\t\t\tSCORE_PROGRESS_CLASS[scoreResult.status],\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t\t{!!showChecks && (\n\t\t\t\t\t<div className=\"seo-listing-card--checks grid gap-x-space-2xl gap-y-space-lg @xl/seo-listing-card:grid-cols-2\">\n\t\t\t\t\t\t{scoreResult.checks.map((check) => (\n\t\t\t\t\t\t\t<SeoCheckRow\n\t\t\t\t\t\t\t\tkey={check.id}\n\t\t\t\t\t\t\t\tcheck={check}\n\t\t\t\t\t\t\t\tdetail={getCheckDetail(check, strings)}\n\t\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nSeoListingCard.displayName = 'SeoListingCard';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { StringsProp } from '../../../../lib/strings';\n\n/**\n * Where an invoice stands: `draft` (not yet issued), `pending` (issued, open,\n * not yet due), `overdue`, `disputed` (part of it is contested) or `paid`.\n */\nexport type InvoiceStatus = 'draft' | 'pending' | 'overdue' | 'disputed' | 'paid';\n\nexport interface InvoiceMiniData {\n\tinvoiceNumber: string;\n\tcustomerName: string;\n\tlineItemsCount: number;\n\ttotalAmount: string;\n\tstatus: InvoiceStatus;\n\tdueDate: string;\n}\n\nexport interface InvoiceMiniStrings {\n\tdraft: string;\n\tpaid: string;\n\tpending: string;\n\toverdue: string;\n\tdisputed: string;\n\titems: (count: number) => string;\n\tdue: string;\n}\n\nexport const defaultInvoiceMiniStrings: InvoiceMiniStrings = {\n\tdraft: 'Draft',\n\tpaid: 'Paid',\n\tpending: 'Pending',\n\toverdue: 'Overdue',\n\tdisputed: 'Disputed',\n\titems: (count) => (count === 1 ? '1 line item' : `${count} line items`),\n\tdue: 'Due',\n};\n\nexport interface InvoiceMiniProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {\n\t/** The invoice to summarise. */\n\tinvoice: InvoiceMiniData;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceMiniStrings>;\n}\n\nexport const invoiceStatusTone: Record<InvoiceStatus, BadgeTone> = {\n\tdraft: 'secondary',\n\tpaid: 'success',\n\tpending: 'warning',\n\toverdue: 'destructive',\n\tdisputed: 'warning',\n};\n","/**\n * InvoiceMini — compact invoice tile for lists / dashboards. Header\n * (number + status chip), customer name, footer split between items-count /\n * due date and the total amount. Strings (status labels, \"Due\", item count\n * pluralisation) overridable for i18n via the `strings` prop.\n */\nimport { Badge } from '../../../base/badge';\nimport { Stack } from '../../../base/structure';\nimport { MonoValue, SecondaryValue, Value } from '../../../primitives';\nimport { Text } from '../../../typography/text';\nimport { mergeStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInvoiceMiniStrings,\n\tinvoiceStatusTone,\n\ttype InvoiceMiniProps,\n\ttype InvoiceStatus,\n} from './types';\n\nexport function InvoiceMini({\n\tinvoice,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: InvoiceMiniProps) {\n\tconst strings = mergeStrings(defaultInvoiceMiniStrings, stringsProp);\n\tconst labelByStatus: Record<InvoiceStatus, string> = {\n\t\tdraft: strings.draft,\n\t\tpaid: strings.paid,\n\t\tpending: strings.pending,\n\t\toverdue: strings.overdue,\n\t\tdisputed: strings.disputed,\n\t};\n\n\treturn (\n\t\t<Stack\n\t\t\t{...props}\n\t\t\tgap=\"md\"\n\t\t\tdata-component=\"invoice-mini\"\n\t\t\tdata-slot=\"invoice-mini\"\n\t\t\tclassName={cn('invoice-mini--component', className)}\n\t\t>\n\t\t\t{/* The status belongs to the invoice number, as in InvoiceHeader: it\n\t\t\t sits beside it rather than at the far edge, and its tone alone\n\t\t\t states the status. */}\n\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap={false}>\n\t\t\t\t<MonoValue type=\"inherit\" className=\"min-w-0 truncate tracking-wide\">\n\t\t\t\t\t{invoice.invoiceNumber}\n\t\t\t\t</MonoValue>\n\t\t\t\t<Badge\n\t\t\t\t\ttone={invoiceStatusTone[invoice.status]}\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t>\n\t\t\t\t\t{labelByStatus[invoice.status]}\n\t\t\t\t</Badge>\n\t\t\t</Stack>\n\n\t\t\t<Text type=\"secondary\" className=\"truncate\">\n\t\t\t\t{invoice.customerName}\n\t\t\t</Text>\n\n\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" align=\"end\" justify=\"between\" className=\"pt-space-xs\">\n\t\t\t\t<Stack gap=\"2xs\" className=\"min-w-0\">\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.items(invoice.lineItemsCount)}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<SecondaryValue size=\"xs\" className=\"whitespace-nowrap tabular-nums\">\n\t\t\t\t\t\t{strings.due} {invoice.dueDate}\n\t\t\t\t\t</SecondaryValue>\n\t\t\t\t</Stack>\n\t\t\t\t<Value type=\"inherit\"\n\t\t\t\t\tsize=\"base\"\n\t\t\t\t\tweight=\"bold\"\n\t\t\t\t\tlineHeight=\"none\"\n\t\t\t\t\tclassName=\"ml-auto shrink-0 tabular-nums\"\n\t\t\t\t>\n\t\t\t\t\t{invoice.totalAmount}\n\t\t\t\t</Value>\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nInvoiceMini.displayName = 'InvoiceMini';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { BadgeTone } from '../../../base/badge';\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { InvoiceStatus } from '../invoice-mini/types';\n\nexport interface InvoiceParty {\n\t/** Display name, usually the legal name. */\n\tname: string;\n\t/** Where the party is: a city line, or a node such as a full address. */\n\tlocation?: ReactNode;\n\t/**\n\t * Further identity lines under the location in the same supporting role:\n\t * tax or VAT ID, company registration, billing contact.\n\t */\n\tdetails?: ReactNode;\n}\n\nexport interface InvoiceHeaderStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tbillFrom: string;\n\tbillTo: string;\n\tissued: string;\n\tdue: string;\n\tamountDue: string;\n\t/** Chip label for each `InvoiceStatus`. */\n\tdraft: string;\n\tpaid: string;\n\tpending: string;\n\toverdue: string;\n\tdisputed: string;\n}\n\nexport const defaultInvoiceHeaderStrings: InvoiceHeaderStrings = {\n\ttitle: 'Invoice',\n\tbillFrom: 'Bill from',\n\tbillTo: 'Bill to',\n\tissued: 'Issued',\n\tdue: 'Due',\n\tamountDue: 'Amount due',\n\tdraft: 'Draft',\n\tpaid: 'Paid',\n\tpending: 'Pending',\n\toverdue: 'Overdue',\n\tdisputed: 'Disputed',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface InvoiceHeaderProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Human-facing invoice reference. */\n\tinvoiceNumber: string;\n\t/**\n\t * Invoice state. Drives both the chip label (through `strings`) and its\n\t * tone, so the two can never disagree. Shares the `InvoiceStatus` union\n\t * with `InvoiceMini`. Omit it when the page header already states the\n\t * status, so the document shows no second chip.\n\t */\n\tstatus?: InvoiceStatus;\n\t/**\n\t * Overrides the badge tone derived from `status`. Reach for it only when\n\t * the surrounding surface needs a tone the status does not imply.\n\t */\n\tstatusTone?: BadgeTone;\n\t/** Issuing party. */\n\tfrom: InvoiceParty;\n\t/** Billed party. */\n\tto: InvoiceParty;\n\t/** Formatted issue date. */\n\tissuedDate?: string;\n\t/** Formatted due date. */\n\tdueDate?: string;\n\t/**\n\t * Formatted amount due: what the bill-to party still owes, shown as the\n\t * header's total row under `strings.amountDue`. Before any payment it\n\t * equals the invoice total; relabel through `strings` to show the total.\n\t */\n\tamount: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceHeaderStrings>;\n}\n","/**\n * InvoiceHeader — invoice document header.\n *\n * A real, visible title (\"Invoice\", a level-2 heading) with the status chip in\n * its suffix and the invoice number as the identifier beneath it. The\n * Bill-from / Bill-to parties sit side by side once the header's own width\n * allows (the grid follows its container, not the viewport) and stack below\n * that. The dates and the amount due close the header: the dates as plain\n * facts, the amount due as the shared commerce ledger's total row. The section\n * gap separates the three bands; there is no rule between them.\n *\n * Strings overridable for i18n via the `strings` prop.\n */\nimport type { ReactNode } from 'react';\n\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { AdaptiveGrid, Stack } from '../../../base/structure';\nimport { MonoValue } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { InlineStat } from '../../data-display';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { invoiceStatusTone, type InvoiceStatus } from '../invoice-mini/types';\nimport { AmountRow } from '../summary-panel';\nimport { defaultInvoiceHeaderStrings, type InvoiceHeaderProps } from './types';\n\nfunction PartyBlock({\n\teyebrow,\n\tname,\n\tlocation,\n\tdetails,\n}: {\n\teyebrow: string;\n\tname: string;\n\tlocation?: ReactNode;\n\tdetails?: ReactNode;\n}) {\n\treturn (\n\t\t<Stack gap=\"xs\" className=\"invoice-header--party\">\n\t\t\t<DisplayLabel tag=\"div\">{eyebrow}</DisplayLabel>\n\t\t\t<Text type=\"inherit\" weight=\"semibold\" lineHeight=\"snug\">\n\t\t\t\t{name}\n\t\t\t</Text>\n\t\t\t{!!location && (\n\t\t\t\t<Text tag=\"div\" size=\"xs\" type=\"secondary\" lineHeight=\"snug\">\n\t\t\t\t\t{location}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t\t{!!details && (\n\t\t\t\t<Text tag=\"div\" size=\"xs\" type=\"secondary\" lineHeight=\"snug\" className=\"invoice-header--party-details\">\n\t\t\t\t\t{details}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nexport function InvoiceHeader({\n\tinvoiceNumber,\n\tstatus,\n\tstatusTone,\n\tfrom,\n\tto,\n\tissuedDate,\n\tdueDate,\n\tamount,\n\tclassName,\n\tstrings: stringsProp,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\t...props\n}: InvoiceHeaderProps) {\n\tconst strings = useStrings(defaultInvoiceHeaderStrings, stringsProp);\n\tconst labelByStatus: Record<InvoiceStatus, string> = {\n\t\tdraft: strings.draft,\n\t\tpaid: strings.paid,\n\t\tpending: strings.pending,\n\t\toverdue: strings.overdue,\n\t\tdisputed: strings.disputed,\n\t};\n\t// The tone follows the status the same way `InvoiceMini` resolves it, so\n\t// an overdue invoice can no longer inherit a green chip from a default.\n\tconst resolvedStatusTone = statusTone ?? (status ? invoiceStatusTone[status] : undefined);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={status ? <Badge tone={resolvedStatusTone}>{labelByStatus[status]}</Badge> : undefined}\n\t\t\tdescription={<MonoValue type=\"inherit\" className=\"invoice-header--number tracking-wide\">{invoiceNumber}</MonoValue>}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-component=\"invoice-header\"\n\t\t\tdata-slot=\"invoice-header\"\n\t\t\tclassName={cn('invoice-header--component min-w-0', className)}\n\t\t>\n\t\t\t<AdaptiveGrid minColumnWidth=\"sm\" gap=\"xl\" className=\"invoice-header--parties\">\n\t\t\t\t<PartyBlock eyebrow={strings.billFrom} name={from.name} location={from.location} details={from.details} />\n\t\t\t\t<PartyBlock eyebrow={strings.billTo} name={to.name} location={to.location} details={to.details} />\n\t\t\t</AdaptiveGrid>\n\n\t\t\t{/* Dates are facts, not money: only the amount due is a ledger row. */}\n\t\t\t<Stack gap=\"sm\" className=\"invoice-header--amounts\">\n\t\t\t\t{!!issuedDate && (\n\t\t\t\t\t<InlineStat label={strings.issued} value={issuedDate} valueWeight=\"medium\" valueClassName=\"tabular-nums\" />\n\t\t\t\t)}\n\t\t\t\t{!!dueDate && (\n\t\t\t\t\t<InlineStat label={strings.due} value={dueDate} valueWeight=\"medium\" valueClassName=\"tabular-nums\" />\n\t\t\t\t)}\n\t\t\t\t<AmountRow label={strings.amountDue} amount={amount} total />\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\nInvoiceHeader.displayName = 'InvoiceHeader';\n","import type { ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\n\n/** Default line-item shape used by the concise InvoiceLineItems mode. */\nexport interface InvoiceLineItem {\n\t/** Purchased goods or service description for this line. */\n\tdescription: string;\n\tqty: number;\n\tprice: number;\n\t/** Accepted line amount, including any app-owned line adjustments. */\n\ttotal: number;\n}\n\n/**\n * Per-column definition. Each column declares how to render its header label\n * and a row's cell. Generic over the row type so consumers can pass arbitrary\n * data without losing type safety.\n */\nexport interface InvoiceColumn<TItem = InvoiceLineItem> {\n\t/** Stable identity for this entry. */\n\tid: string;\n\theader: ReactNode;\n\t/** CSS grid track value (e.g. `'minmax(0, 1fr)'`, `'80px'`), not a class name. */\n\twidth?: string;\n\talign?: 'left' | 'right' | 'center';\n\tcell: (item: TItem, index: number) => ReactNode;\n\t/**\n\t * Shows the column only when the table is at least its `@lg` container\n\t * width (32rem), the default recipe's breakpoint; narrower tables drop its\n\t * track instead of crushing the others. Repeat its value in another cell\n\t * with the `@lg/invoice-line-items:hidden` class so it stays readable.\n\t */\n\twideOnly?: boolean;\n\t/** Class names appended to header cell. */\n\theaderClassName?: string;\n\t/** Class names appended to each row cell of this column. */\n\tcellClassName?: string;\n}\n\n/** A footer row (totals, taxes, etc.). Ordered as written. */\nexport interface InvoiceLineItemsFooterRow {\n\t/** Display label. */\n\tlabel: ReactNode;\n\tvalue: ReactNode;\n\t/**\n\t * `total` adds top spacing and bolds the label and a plain-text value.\n\t * React-node values keep their own typography; set their weight explicitly.\n\t */\n\temphasis?: 'normal' | 'total';\n}\n\nexport interface InvoiceLineItemsStrings {\n\titem: string;\n\tquantity: string;\n\tprice: string;\n\tsubtotal: string;\n\ttax: string;\n\t/** Label for line totals and the financial grand total. */\n\ttotal: string;\n}\n\nexport const defaultInvoiceLineItemsStrings: InvoiceLineItemsStrings = {\n\titem: 'Item',\n\tquantity: 'Qty',\n\tprice: 'Price',\n\tsubtotal: 'Subtotal',\n\ttax: 'Tax',\n\ttotal: 'Total',\n};\n\nexport interface InvoiceLineItemsProps<TItem = InvoiceLineItem> {\n\t/** Line items on the invoice. */\n\titems: TItem[];\n\t/** Optional custom columns. Defaults to Description / Qty / Price / Total. */\n\tcolumns?: InvoiceColumn<TItem>[];\n\t/** Optional custom footer rows. React nodes own their typography, including\n\t * total-value weight. When omitted with the default columns, an auto-computed\n\t * subtotal / tax / total footer is used. */\n\tfooterRows?: InvoiceLineItemsFooterRow[];\n\t/** Tax ratio for the default footer (`0.2` means 20%). @default 0.2 */\n\ttaxRate?: number;\n\t/** ISO 4217 code for default monetary cells. Falls back to UIProvider. */\n\tcurrency?: string;\n\t/**\n\t * `card` paints the table's own framed surface. `flat` drops the frame,\n\t * striping and row insets so the table sits flush inside a parent Card,\n\t * ruled row from row. @default 'card'\n\t */\n\tsurface?: 'card' | 'flat';\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InvoiceLineItemsStrings>;\n}\n","/**\n * InvoiceLineItems — flexible invoice line-item table.\n *\n * Generic over the row type. Pass custom `columns` and `footerRows` for any\n * shape of data. Without those, uses the concise default\n * `InvoiceLineItem` shape (description / qty / price / total) with an\n * auto-computed subtotal / tax / total footer.\n *\n * The header and every row are subgrids of one body grid, so content-sized\n * tracks (`auto`, `max-content`) line up down the whole table. Below the\n * `@lg` container width the default recipe becomes two columns: the\n * description with a quiet `qty × price` line beneath it, and the line total.\n * Custom columns keep their tracks at every width and scroll horizontally\n * rather than crushing.\n */\nimport type { CSSProperties, ReactNode } from 'react';\n\nimport { DisplayLabel } from '../../../typography/display-label';\nimport { Text } from '../../../typography/text';\nimport { Separator } from '../../../base/display/separator';\nimport { Stack } from '../../../base/structure';\nimport { Money, Number as NumberValue, Percent, Value } from '../../../primitives';\nimport { useStrings } from '../../../../lib/strings';\nimport { useMoneyConfig } from '../../../../lib/ui-provider';\nimport { elevationRecipes, neutralFillRecipes } from '../../../../lib/surface-recipes';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInvoiceLineItemsStrings,\n\ttype InvoiceColumn,\n\ttype InvoiceLineItem,\n\ttype InvoiceLineItemsFooterRow,\n\ttype InvoiceLineItemsProps,\n} from './types';\n\n// `card` paints its own framed surface; `flat` sits on the surface that\n// places it, flush with its edges, and rules rows apart instead of striping.\nconst SURFACE_CLASS = {\n\tcard: cn('overflow-hidden rounded-surface border border-border bg-card text-card-foreground', elevationRecipes.card),\n\tflat: '',\n} as const;\n\nconst ALIGN_CLASS = {\n\tleft: 'text-left justify-start',\n\tright: 'text-right justify-end',\n\tcenter: 'text-center justify-center',\n} as const;\n\n// Default numeric tracks keep a minimum width that separates adjacent amounts\n// and grow to their widest value, so `1,275.00 EUR` never wraps or clips.\nconst QTY_TRACK = 'minmax(3rem,auto)';\nconst PRICE_TRACK = 'minmax(6.5rem,auto)';\nconst TOTAL_TRACK = 'minmax(7rem,auto)';\nconst DEFAULT_GRID = 'grid-cols-[minmax(0,1fr)_auto] @lg/invoice-line-items:grid-cols-[minmax(0,1fr)_minmax(3rem,auto)_minmax(6.5rem,auto)_minmax(7rem,auto)]';\nconst WIDE_ONLY = 'hidden @lg/invoice-line-items:flex';\n// Custom columns with `wideOnly` tracks switch templates at the same container\n// width as the default recipe; each template is an inline variable.\nconst RESPONSIVE_CUSTOM_GRID = 'grid-cols-(--invoice-line-items-columns) @lg/invoice-line-items:grid-cols-(--invoice-line-items-wide-columns)';\nconst NARROW_ONLY = '@lg/invoice-line-items:hidden';\nconst NUMERIC_CELL = 'whitespace-nowrap tabular-nums';\n\nfunction InvoiceCurrencyValue({\n\tamount,\n\tcurrency,\n\tweight = 'regular',\n}: {\n\tamount: number;\n\tcurrency: string;\n\tweight?: 'regular' | 'bold';\n}) {\n\treturn (\n\t\t<Money type=\"inherit\"\n\t\t\tamount={amount}\n\t\t\tcurrency={currency}\n\t\t\tminimumFractionDigits={2}\n\t\t\tmaximumFractionDigits={2}\n\t\t\tweight={weight}\n\t\t/>\n\t);\n}\n\nfunction buildDefaultColumns(\n\tcurrency: string,\n\tstrings: typeof defaultInvoiceLineItemsStrings,\n): InvoiceColumn<InvoiceLineItem>[] {\n\treturn [\n\t\t{\n\t\t\tid: 'description',\n\t\t\theader: strings.item,\n\t\t\twidth: 'minmax(0,1fr)',\n\t\t\tcell: (item) => (\n\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t<Text type=\"inherit\" className=\"break-words\">{item.description}</Text>\n\t\t\t\t\t{/* Narrow rows state quantity and unit price once, beneath the\n\t\t\t\t\t description, instead of repeating column labels per row. */}\n\t\t\t\t\t<Text tag=\"div\" size=\"xs\" type=\"secondary\" className={cn('invoice-line-items--calculation tabular-nums', NARROW_ONLY)}>\n\t\t\t\t\t\t<NumberValue type=\"inherit\" value={item.qty} /> × <InvoiceCurrencyValue amount={item.price} currency={currency} />\n\t\t\t\t\t</Text>\n\t\t\t\t</Stack>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tid: 'qty',\n\t\t\theader: strings.quantity,\n\t\t\twidth: QTY_TRACK,\n\t\t\talign: 'right',\n\t\t\theaderClassName: WIDE_ONLY,\n\t\t\tcellClassName: cn(NUMERIC_CELL, WIDE_ONLY),\n\t\t\tcell: (item) => <NumberValue type=\"inherit\" value={item.qty} />,\n\t\t},\n\t\t{\n\t\t\tid: 'price',\n\t\t\theader: strings.price,\n\t\t\twidth: PRICE_TRACK,\n\t\t\talign: 'right',\n\t\t\theaderClassName: WIDE_ONLY,\n\t\t\tcellClassName: cn(NUMERIC_CELL, WIDE_ONLY),\n\t\t\tcell: (item) => <InvoiceCurrencyValue amount={item.price} currency={currency} />,\n\t\t},\n\t\t{\n\t\t\tid: 'total',\n\t\t\theader: strings.total,\n\t\t\twidth: TOTAL_TRACK,\n\t\t\talign: 'right',\n\t\t\tcellClassName: NUMERIC_CELL,\n\t\t\tcell: (item) => <InvoiceCurrencyValue amount={item.total} currency={currency} />,\n\t\t},\n\t];\n}\n\nfunction buildDefaultFooterRows(\n\titems: InvoiceLineItem[],\n\ttaxRate: number,\n\tcurrency: string,\n\tstrings: typeof defaultInvoiceLineItemsStrings,\n): InvoiceLineItemsFooterRow[] {\n\tconst subtotal = items.reduce((s, i) => s + i.total, 0);\n\tconst tax = Math.round(subtotal * taxRate * 100) / 100;\n\tconst total = subtotal + tax;\n\treturn [\n\t\t{ label: strings.subtotal, value: <InvoiceCurrencyValue amount={subtotal} currency={currency} /> },\n\t\t{\n\t\t\tlabel: <>{strings.tax} (<Percent type=\"inherit\" value={taxRate} />)</>,\n\t\t\tvalue: <InvoiceCurrencyValue amount={tax} currency={currency} />,\n\t\t},\n\t\t{ label: strings.total, value: <InvoiceCurrencyValue amount={total} currency={currency} weight=\"bold\" />, emphasis: 'total' },\n\t];\n}\n\nexport function InvoiceLineItems<TItem = InvoiceLineItem>({\n\titems,\n\tcolumns,\n\tfooterRows,\n\ttaxRate = 0.2,\n\tcurrency,\n\tsurface = 'card',\n\tclassName,\n\tstrings: stringsProp,\n}: InvoiceLineItemsProps<TItem>) {\n\tconst strings = useStrings(defaultInvoiceLineItemsStrings, stringsProp);\n\tconst { defaultCurrency } = useMoneyConfig();\n\tconst resolvedCurrency = currency ?? defaultCurrency ?? '€';\n\tconst flat = surface === 'flat';\n\n\t// Boundary casts: the default builders are intentionally non-generic and\n\t// only run in concise default mode where the consumer didn't pass\n\t// `columns`. In that mode the runtime row shape IS `InvoiceLineItem` —\n\t// the cast is the documented bridge between the generic `<TItem>` API\n\t// and the concrete default shape.\n\tconst resolvedColumns: InvoiceColumn<TItem>[] =\n\t\tcolumns ?? (buildDefaultColumns(resolvedCurrency, strings) as unknown as InvoiceColumn<TItem>[]);\n\n\tconst resolvedFooterRows: InvoiceLineItemsFooterRow[] = footerRows\n\t\t?? (columns\n\t\t\t? []\n\t\t\t: buildDefaultFooterRows(items as unknown as InvoiceLineItem[], taxRate, resolvedCurrency, strings));\n\n\tconst template = (cols: InvoiceColumn<TItem>[]) => cols.map((c) => c.width ?? '1fr').join(' ');\n\tconst responsiveColumns = !!columns && resolvedColumns.some((c) => c.wideOnly);\n\tconst gridStyle: CSSProperties | undefined = !columns ? undefined\n\t\t: responsiveColumns\n\t\t\t? {\n\t\t\t\t'--invoice-line-items-columns': template(resolvedColumns.filter((c) => !c.wideOnly)),\n\t\t\t\t'--invoice-line-items-wide-columns': template(resolvedColumns),\n\t\t\t} as CSSProperties\n\t\t\t: { gridTemplateColumns: template(resolvedColumns) };\n\t// Flat tables align their text with the host's content edge.\n\tconst inset = flat ? 'py-row-y' : 'px-row-x py-row-y';\n\tconst subgridRow = 'col-span-full grid min-w-0 grid-cols-subgrid';\n\n\treturn (\n\t\t<div\n\t\t\tdata-surface={surface}\n\t\t\tclassName={cn('invoice-line-items--component', '@container/invoice-line-items box-border w-full min-w-0 max-w-full', SURFACE_CLASS[surface], className)}\n\t\t>\n\t\t\t{/* Custom tracks keep their width and scroll instead of crushing; the\n\t\t\t default recipe adapts to its container and never needs to. Flat\n\t\t\t rows have no inset, so the scroller lends its edge cells room for\n\t\t\t focus rings, as the tab scroll viewport does. */}\n\t\t\t<div className={cn('invoice-line-items--scroller w-full min-w-0', columns && 'overflow-x-auto', columns && flat && '-mx-space-xs w-auto px-space-xs')}>\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn('invoice-line-items--body grid min-w-min gap-x-space-md', !columns && DEFAULT_GRID, responsiveColumns && RESPONSIVE_CUSTOM_GRID)}\n\t\t\t\t\tstyle={gridStyle}\n\t\t\t\t>\n\t\t\t\t\t{/* Header */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'invoice-line-items--header',\n\t\t\t\t\t\t\tsubgridRow,\n\t\t\t\t\t\t\tinset,\n\t\t\t\t\t\t\tflat ? 'border-b border-border/60' : neutralFillRecipes.band,\n\t\t\t\t\t\t\t// The default narrow recipe needs no column labels.\n\t\t\t\t\t\t\t!columns && 'hidden @lg/invoice-line-items:grid',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{resolvedColumns.map((col) => (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tkey={col.id}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'flex min-w-0',\n\t\t\t\t\t\t\t\t\tALIGN_CLASS[col.align ?? 'left'],\n\t\t\t\t\t\t\t\t\tcolumns && col.wideOnly && WIDE_ONLY,\n\t\t\t\t\t\t\t\t\tcol.headerClassName,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DisplayLabel className=\"min-w-0 truncate\">\n\t\t\t\t\t\t\t\t\t{col.header}\n\t\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{/* Rows */}\n\t\t\t\t\t{items.map((item, i) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'invoice-line-items--row',\n\t\t\t\t\t\t\t\tsubgridRow,\n\t\t\t\t\t\t\t\tinset,\n\t\t\t\t\t\t\t\tflat\n\t\t\t\t\t\t\t\t\t? i > 0 && 'border-t border-border/60'\n\t\t\t\t\t\t\t\t\t: i % 2 === 1 && neutralFillRecipes.wash,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{resolvedColumns.map((col) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={col.id}\n\t\t\t\t\t\t\t\t\tdata-column={col.id}\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t// Cells align with the first line of a multi-line neighbour.\n\t\t\t\t\t\t\t\t\t\t'flex min-w-0 items-start',\n\t\t\t\t\t\t\t\t\t\tALIGN_CLASS[col.align ?? 'left'],\n\t\t\t\t\t\t\t\t\t\tcolumns && col.wideOnly && WIDE_ONLY,\n\t\t\t\t\t\t\t\t\t\tcol.cellClassName,\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{col.cell(item, i)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{/* Footer */}\n\t\t\t{resolvedFooterRows.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<Separator />\n\t\t\t\t\t<div className={cn('invoice-line-items--footer', flat ? 'pt-surface' : 'px-row-x py-surface')}>\n\t\t\t\t\t<Stack gap=\"sm\">\n\t\t\t\t\t\t{resolvedFooterRows.map((row, idx) => (\n\t\t\t\t\t\t\t<Stack\n\t\t\t\t\t\t\t\tkey={idx}\n\t\t\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\t\t\tjustify=\"between\"\n\t\t\t\t\t\t\t\talign=\"baseline\"\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\trow.emphasis === 'total' && 'pt-space-md',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\ttype={row.emphasis === 'total' ? 'inherit' : 'secondary'}\n\t\t\t\t\t\t\t\t\tweight={row.emphasis === 'total' ? 'bold' : 'regular'}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{row.label}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t{isSimpleText(row.value) ? (\n\t\t\t\t\t\t\t\t\t<Value type=\"inherit\" weight={row.emphasis === 'total' ? 'bold' : 'regular'}>\n\t\t\t\t\t\t\t\t\t\t{row.value}\n\t\t\t\t\t\t\t\t\t</Value>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<div className=\"invoice-line-items--footer-value shrink-0\">{row.value}</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nInvoiceLineItems.displayName = 'InvoiceLineItems';\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n","import { ContentBlock } from '../../../base/display';\nimport { cn } from '../../../../lib/utils';\n\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport type { OrderTimelineProps } from './types';\n\nexport function OrderTimeline({\n\ttitle,\n\tdescription,\n\tevents,\n\tfooterText,\n\tclassName,\n}: OrderTimelineProps) {\n\tconst items: TimelineItem[] = events.map((event) => ({\n\t\tid: event.id,\n\t\ttitle: event.title,\n\t\tdescription: event.description,\n\t\ttimestamp: event.timestamp,\n\t\tstatus: event.status,\n\t}));\n\n\treturn (\n\t\t<ContentBlock\n\t\t\tdata-component=\"order-timeline\"\n\t\t\tdata-slot=\"order-timeline\"\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tfooterText={footerText}\n\t\t\tclassName={cn('order-timeline--component', className)}\n\t\t>\n\t\t\t<Timeline items={items} />\n\t\t</ContentBlock>\n\t);\n}\n\nOrderTimeline.displayName = 'OrderTimeline';\n","import { Value } from '../../../primitives';\nimport { cn } from '../../../../lib/utils';\n\nimport { Timeline, type TimelineItem } from '../../timelines';\nimport type { PaymentTimelineProps } from './types';\n\nexport function PaymentTimeline({ events, className }: PaymentTimelineProps) {\n\tconst items: TimelineItem[] = events.map((event, index) => ({\n\t\tid: `${event.label}-${String(index)}`,\n\t\ttitle: event.label,\n\t\tdescription: event.date,\n\t\ticon: event.icon,\n\t\tstatus: event.done ? 'success' : 'pending',\n\t\tchildren: event.amount ? (\n\t\t\t// An event amount is an ordinary figure, not a signed delta: foreground.\n\t\t\t<Value type=\"inherit\" weight=\"medium\" className=\"tabular-nums\">\n\t\t\t\t{event.amount}\n\t\t\t</Value>\n\t\t) : undefined,\n\t}));\n\n\treturn (\n\t\t<div\n\t\t\tdata-component=\"payment-timeline\"\n\t\t\tdata-slot=\"payment-timeline\"\n\t\t\tclassName={cn('payment-timeline--component min-w-0', className)}\n\t\t>\n\t\t\t<Timeline items={items} dotSize=\"lg\" />\n\t\t</div>\n\t);\n}\n\nPaymentTimeline.displayName = 'PaymentTimeline';\n","import type { CardProps } from '../../../base/cards';\nimport type { SelectOption } from '../../../base/choice-inputs';\nimport type { WeightUnit } from '../../../base/forms-numeric';\nimport type { StringsProp } from '../../../../lib/strings';\n\nexport type InventoryPolicy = 'deny' | 'continue';\nexport type InventoryStatus = 'in_stock' | 'low_stock' | 'out_of_stock' | 'untracked';\n\nexport interface InventorySectionValue {\n\tsku?: string;\n\tbarcode?: string;\n\ttrackQuantity?: boolean;\n\tavailable?: string;\n\tcommitted?: string;\n\tincoming?: string;\n\tlowStockThreshold?: string;\n\tinventoryPolicy?: InventoryPolicy;\n\tlocationId?: string;\n\tbinLocation?: string;\n\trequiresShipping?: boolean;\n\tweight?: string;\n\tweightUnit?: WeightUnit;\n\tcountryOfOrigin?: string;\n\thsCode?: string;\n\ttags?: string[];\n}\n\nexport type InventorySectionField = keyof InventorySectionValue;\n\nexport type InventorySectionName =\n\t| 'summary'\n\t| 'identity'\n\t| 'tracking'\n\t| 'location'\n\t| 'shipping'\n\t| 'customs'\n\t| 'tags';\n\nexport interface InventorySectionChange {\n\tfield: InventorySectionField;\n\tvalue: InventorySectionValue[InventorySectionField];\n\tpreviousValue: InventorySectionValue[InventorySectionField];\n}\n\nexport interface InventorySectionMetric {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display label. */\n\tlabel: string;\n\tvalue: string;\n\t/** Supporting copy shown under the label. */\n\tdescription?: string;\n\t/**\n\t * Semantic tone of the entry. Not rendered by the summary: stats are plain\n\t * and the title badge carries the stock state. Kept for type compatibility.\n\t */\n\ttone?: 'default' | 'success' | 'warning' | 'error' | 'info';\n}\n\nexport interface InventorySectionStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\tstatus: Record<InventoryStatus, string>;\n\tsections: Record<Exclude<InventorySectionName, 'summary'>, string>;\n\tfields: Record<InventorySectionField, string>;\n\tplaceholders: Partial<Record<InventorySectionField, string>>;\n\thints: Partial<Record<InventorySectionField, string>>;\n\t/** Overflow menu for the surface as a whole. */\n\tactions: {\n\t\tgenerateSku: string;\n\t\trestock: string;\n\t};\n\tpolicyOptions: Record<InventoryPolicy, {\n\t\tlabel: string;\n\t\tdescription: string;\n\t}>;\n\tsummary: {\n\t\tavailable: string;\n\t\tcommitted: string;\n\t\tincoming: string;\n\t\tthreshold: string;\n\t\tuntracked: string;\n\t};\n\ttagInput: {\n\t\tplaceholder: string;\n\t\temptyRecommendations: string;\n\t\tclearAll: string;\n\t\tsummary: (current: number, max: number) => string;\n\t};\n}\n\nexport const defaultInventorySectionStrings: InventorySectionStrings = {\n\ttitle: 'Inventory',\n\tdescription: 'Manage stock tracking, availability, fulfillment, and compliance details.',\n\tstatus: {\n\t\tin_stock: 'In stock',\n\t\tlow_stock: 'Low stock',\n\t\tout_of_stock: 'Out of stock',\n\t\tuntracked: 'Not tracked',\n\t},\n\tsections: {\n\t\tidentity: 'Identifiers',\n\t\ttracking: 'Stock tracking',\n\t\tlocation: 'Location',\n\t\tshipping: 'Shipping',\n\t\tcustoms: 'Customs',\n\t\ttags: 'Tags',\n\t},\n\tfields: {\n\t\tsku: 'SKU',\n\t\tbarcode: 'Barcode',\n\t\ttrackQuantity: 'Track quantity',\n\t\tavailable: 'Available',\n\t\tcommitted: 'Committed',\n\t\tincoming: 'Incoming',\n\t\tlowStockThreshold: 'Low-stock threshold',\n\t\tinventoryPolicy: 'When sold out',\n\t\tlocationId: 'Stock location',\n\t\tbinLocation: 'Bin / shelf',\n\t\trequiresShipping: 'Requires shipping',\n\t\tweight: 'Weight',\n\t\tweightUnit: 'Weight unit',\n\t\tcountryOfOrigin: 'Country of origin',\n\t\thsCode: 'HS code',\n\t\ttags: 'Inventory tags',\n\t},\n\tplaceholders: {\n\t\tsku: 'BAL-750-CL',\n\t\tbarcode: 'Scan or enter barcode',\n\t\tavailable: '0',\n\t\tcommitted: '0',\n\t\tincoming: '0',\n\t\tlowStockThreshold: '5',\n\t\tlocationId: 'Select location',\n\t\tbinLocation: 'Aisle / shelf / bin',\n\t\tweight: '0.00',\n\t\tcountryOfOrigin: 'Country code or name',\n\t\thsCode: 'e.g. 2204.21',\n\t\ttags: 'Add tag...',\n\t},\n\thints: {\n\t\tsku: 'Internal stock keeping unit.',\n\t\tbarcode: 'GTIN, UPC, EAN, ISBN, or internal scan code.',\n\t\tavailable: 'Units currently sellable at this location.',\n\t\tcommitted: 'Units already reserved by open orders.',\n\t\tincoming: 'Units expected from transfers, suppliers, or production.',\n\t\tlowStockThreshold: 'Used for low-stock warnings.',\n\t\tinventoryPolicy: 'Choose whether checkout should block when inventory reaches zero.',\n\t\tlocationId: 'Where this inventory is stocked or fulfilled from.',\n\t\tbinLocation: 'Optional warehouse shelf, bay, or bin reference.',\n\t\tweight: 'Used for shipping rates and fulfillment labels.',\n\t\tcountryOfOrigin: 'Required for international customs in many markets.',\n\t\thsCode: 'Harmonized System tariff code for customs.',\n\t\ttags: 'Optional operational labels such as preorder, seasonal, or batch codes.',\n\t},\n\tactions: {\n\t\tgenerateSku: 'Generate SKU',\n\t\trestock: 'Restock',\n\t},\n\tpolicyOptions: {\n\t\tdeny: {\n\t\t\tlabel: 'Stop selling',\n\t\t\tdescription: 'Block checkout when available inventory reaches zero.',\n\t\t},\n\t\tcontinue: {\n\t\t\tlabel: 'Continue selling',\n\t\t\tdescription: 'Allow backorders or made-to-order fulfillment.',\n\t\t},\n\t},\n\tsummary: {\n\t\tavailable: 'Available',\n\t\tcommitted: 'Committed',\n\t\tincoming: 'Incoming',\n\t\tthreshold: 'Low-stock at',\n\t\tuntracked: 'Inventory is not tracked for this product.',\n\t},\n\ttagInput: {\n\t\tplaceholder: 'Add inventory tag...',\n\t\temptyRecommendations: 'No matching tags.',\n\t\tclearAll: 'Clear tags',\n\t\tsummary: (current, max) => `${current} / ${max} tags`,\n\t},\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface InventorySectionCardProps extends Pick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** Current field values for every inventory section. Controlled. */\n\tvalue: InventorySectionValue;\n\t/** Fired with the next value. */\n\tonValueChange?: (value: InventorySectionValue, change: InventorySectionChange) => void;\n\t/** Validation messages keyed by field, rendered under the matching control. */\n\terrors?: Partial<Record<InventorySectionField, string>>;\n\t/** Renders the entry as unselectable. */\n\tdisabled?: boolean;\n\t/**\n\t * Locks every field and command while keeping the current values visible,\n\t * for a reviewer without edit permission. Controls render disabled.\n\t */\n\treadOnly?: boolean;\n\t/** Which sections are shown. Omitted sections default to visible. */\n\tvisibleSections?: Partial<Record<InventorySectionName, boolean>>;\n\t/** Which individual fields are shown. Omitted fields default to visible. */\n\tvisibleFields?: Partial<Record<InventorySectionField, boolean>>;\n\t/** Choices for the stock-location select. */\n\tlocationOptions?: SelectOption[];\n\t/** Choices for the country-of-origin select. */\n\tcountryOptions?: SelectOption[];\n\t/** Suggested tags offered beneath the tag input. */\n\ttagRecommendations?: string[];\n\t/** Caps how many tags may be added. */\n\tmaxTags?: number;\n\tonGenerateSku?: (value: InventorySectionValue) => string | void;\n\tonRestock?: (value: InventorySectionValue) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<InventorySectionStrings>;\n}\n","/**\n * InventorySectionCard — controlled commerce inventory form card.\n *\n * The component owns no persistence and performs no routing. Consumers pass a\n * `value` object, receive field-level `onValueChange` updates, and decide how to\n * submit or validate. Section and field visibility props let apps reuse the\n * same surface for physical products, digital products, variants, and location\n * level inventory without forking the component.\n */\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { EMPTY } from '../../../../lib/format';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { CardRadioGroup, Select, ToggleField } from '../../../base/choice-inputs';\nimport { FormField } from '../../../base/forms';\nimport { Input } from '../../../base/text-inputs';\nimport { TagsInput } from '../../../base/value-inputs';\nimport { DecimalInput, WeightInput } from '../../../base/forms-numeric';\nimport { Grid, Stack } from '../../../base/structure';\nimport { Value } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultInventorySectionStrings,\n\ttype InventoryPolicy,\n\ttype InventorySectionCardProps,\n\ttype InventorySectionField,\n\ttype InventorySectionMetric,\n\ttype InventorySectionName,\n\ttype InventorySectionValue,\n\ttype InventoryStatus,\n} from './types';\n\nconst STATUS_VARIANT: Record<InventoryStatus, BadgeTone> = {\n\tin_stock: 'success',\n\tlow_stock: 'warning',\n\tout_of_stock: 'destructive',\n\tuntracked: 'secondary',\n};\n\nfunction parseQuantity(value?: string): number | undefined {\n\tif (value === undefined || value.trim() === '') return undefined;\n\tconst parsed = Number(value);\n\treturn Number.isFinite(parsed) ? parsed : undefined;\n}\n\nfunction getInventoryStatus(value: InventorySectionValue): InventoryStatus {\n\tconst isTracked = value.trackQuantity ?? true;\n\tif (!isTracked) return 'untracked';\n\n\tconst available = parseQuantity(value.available) ?? 0;\n\tif (available <= 0) return 'out_of_stock';\n\n\tconst threshold = parseQuantity(value.lowStockThreshold);\n\tif (threshold !== undefined && available <= threshold) return 'low_stock';\n\n\treturn 'in_stock';\n}\n\nfunction SectionHeading({ children, className }: { children: string; className?: string }) {\n\treturn (\n\t\t<Text type=\"inherit\" weight=\"semibold\" className={cn('inventory-section-card--section-title', className)}>\n\t\t\t{children}\n\t\t</Text>\n\t);\n}\n\n// A plain stat: no tile and no tint. Stock state is stated once, by the\n// status badge beside the title.\nfunction SummaryMetric({ metric }: { metric: InventorySectionMetric }) {\n\treturn (\n\t\t<div className=\"inventory-section-card--metric min-w-0\">\n\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t{metric.label}\n\t\t\t</Text>\n\t\t\t<Value type=\"inherit\" weight=\"semibold\" className=\"tabular-nums\">\n\t\t\t\t{metric.value}\n\t\t\t</Value>\n\t\t\t{!!metric.description && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\" lineHeight=\"snug\">\n\t\t\t\t\t{metric.description}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport function InventorySectionCard({\n\tvalue,\n\tonValueChange,\n\terrors,\n\tdisabled = false,\n\treadOnly = false,\n\tvisibleSections,\n\tvisibleFields,\n\tlocationOptions = [],\n\tcountryOptions = [],\n\ttagRecommendations,\n\tmaxTags,\n\tonGenerateSku,\n\tonRestock,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n}: InventorySectionCardProps) {\n\tconst strings = useStrings(defaultInventorySectionStrings, stringsProp);\n\tconst status = getInventoryStatus(value);\n\tconst isDisabled = disabled || readOnly;\n\tconst isTracked = value.trackQuantity ?? true;\n\tconst requiresShipping = value.requiresShipping ?? true;\n\tconst shippingFieldsDisabled = isDisabled || !requiresShipping;\n\n\tconst isSectionVisible = (section: InventorySectionName) => visibleSections?.[section] !== false;\n\tconst isFieldVisible = (field: InventorySectionField) => visibleFields?.[field] !== false;\n\n\tconst updateField = <TField extends InventorySectionField>(\n\t\tfield: TField,\n\t\tnextValue: InventorySectionValue[TField],\n\t) => {\n\t\tconst previousValue = value[field];\n\t\tconst next = {\n\t\t\t...value,\n\t\t\t[field]: nextValue,\n\t\t};\n\n\t\tonValueChange?.(next, {\n\t\t\tfield,\n\t\t\tvalue: nextValue,\n\t\t\tpreviousValue,\n\t\t});\n\t};\n\n\tconst handleGenerateSku = () => {\n\t\tif (!onGenerateSku || isDisabled) return;\n\t\tconst generatedSku = onGenerateSku(value);\n\t\tif (typeof generatedSku === 'string') {\n\t\t\tupdateField('sku', generatedSku);\n\t\t}\n\t};\n\n\tconst metrics: InventorySectionMetric[] = [\n\t\t{\n\t\t\tid: 'available',\n\t\t\tlabel: strings.summary.available,\n\t\t\tvalue: isTracked ? value.available || '0' : EMPTY,\n\t\t\t// `summary.threshold` is the *label* of the low-stock tile, not a\n\t\t\t// sentence — using it here rendered a dangling \"Low-stock at\" under\n\t\t\t// the available count with no number attached, duplicating a tile\n\t\t\t// that already carries both. Only the untracked case needs a caption,\n\t\t\t// to explain why the value reads \"-\".\n\t\t\tdescription: isTracked ? undefined : strings.summary.untracked,\n\t\t},\n\t\t{\n\t\t\tid: 'committed',\n\t\t\tlabel: strings.summary.committed,\n\t\t\tvalue: value.committed || '0',\n\t\t},\n\t\t{\n\t\t\tid: 'incoming',\n\t\t\tlabel: strings.summary.incoming,\n\t\t\tvalue: value.incoming || '0',\n\t\t},\n\t\t{\n\t\t\tid: 'threshold',\n\t\t\tlabel: strings.summary.threshold,\n\t\t\tvalue: value.lowStockThreshold || '-',\n\t\t},\n\t];\n\n\treturn (\n\t\t// Card (flat, no inset by default) instead of the deprecated ContentBlock\n\t\t// adapter so the region gap can replace the old header rule: the header\n\t\t// keeps the framed-card distance from its body, and sections sit a step\n\t\t// further apart than the rows inside them.\n\t\t<Card\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\tgap=\"xl\"\n\t\t\ttitle={strings.title}\n\t\t\tdescription={strings.description}\n\t\t\ttitleSuffix={<Badge tone={STATUS_VARIANT[status]}>{strings.status[status]}</Badge>}\n\t\t\theaderAction={\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\tclassName=\"w-full @md/inventory-section-card:w-auto @md/inventory-section-card:justify-end\"\n\t\t\t\t>\n\t\t\t\t\t{!!onGenerateSku && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={handleGenerateSku}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.actions.generateSku}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!onRestock && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={() => onRestock(value)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{strings.actions.restock}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t}\n\t\t\tclassName={cn('inventory-section-card--component @container/inventory-section-card w-full', className)}\n\t\t\tcontentGap=\"2xl\"\n\t\t>\n\t\t\t{!!isSectionVisible('summary') && (\n\t\t\t\t<div className=\"inventory-section-card--summary grid min-w-0 grid-cols-1 gap-space-xl @md/inventory-section-card:grid-cols-2 @3xl/inventory-section-card:grid-cols-4\">\n\t\t\t\t\t{metrics.map((metric) => (\n\t\t\t\t\t\t<SummaryMetric key={metric.id} metric={metric} />\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('identity') && (\n\t\t\t\t<Stack render={<section />} gap=\"md\" className=\"inventory-section-card--identity\">\n\t\t\t\t\t<SectionHeading>{strings.sections.identity}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('sku') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.sku} error={errors?.sku} hint={strings.hints.sku}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.sku ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('sku', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.sku}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.sku}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('barcode') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.barcode} error={errors?.barcode} hint={strings.hints.barcode}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.barcode ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('barcode', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.barcode}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.barcode}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('tracking') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--tracking\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.tracking}</SectionHeading>\n\t\t\t\t\t{!!isFieldVisible('trackQuantity') && (\n\t\t\t\t\t\t<ToggleField\n\t\t\t\t\t\t\tlabel={strings.fields.trackQuantity}\n\t\t\t\t\t\t\tdescription={strings.hints.available}\n\t\t\t\t\t\t\tvalue={isTracked}\n\t\t\t\t\t\t\tonValueChange={(checked) => updateField('trackQuantity', checked)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<div className=\"inventory-section-card--tracking-grid grid min-w-0 grid-cols-1 gap-space-xl @md/inventory-section-card:grid-cols-2 @3xl/inventory-section-card:grid-cols-4\">\n\t\t\t\t\t\t{!!isFieldVisible('available') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.available} error={errors?.available} hint={strings.hints.available}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.available ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('available', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.available}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.available}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('committed') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.committed} error={errors?.committed} hint={strings.hints.committed}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.committed ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('committed', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.committed}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.committed}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('incoming') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.incoming} error={errors?.incoming} hint={strings.hints.incoming}>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.incoming ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('incoming', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.incoming}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.incoming}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('lowStockThreshold') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.lowStockThreshold}\n\t\t\t\t\t\t\t\terror={errors?.lowStockThreshold}\n\t\t\t\t\t\t\t\thint={strings.hints.lowStockThreshold}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DecimalInput\n\t\t\t\t\t\t\t\t\tvalue={value.lowStockThreshold ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('lowStockThreshold', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.lowStockThreshold}\n\t\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\t\tdecimalPlaces={0}\n\t\t\t\t\t\t\t\t\tstep={1}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.lowStockThreshold}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!isFieldVisible('inventoryPolicy') && (\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tlabel={strings.fields.inventoryPolicy}\n\t\t\t\t\t\t\terror={errors?.inventoryPolicy}\n\t\t\t\t\t\t\thint={strings.hints.inventoryPolicy}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CardRadioGroup\n\t\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\t\tvalue={value.inventoryPolicy ?? 'deny'}\n\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('inventoryPolicy', nextValue as InventoryPolicy)}\n\t\t\t\t\t\t\t\tdisabled={isDisabled || !isTracked}\n\t\t\t\t\t\t\t\tinvalid={!!errors?.inventoryPolicy}\n\t\t\t\t\t\t\t\toptions={[\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvalue: 'deny',\n\t\t\t\t\t\t\t\t\t\tlabel: strings.policyOptions.deny.label,\n\t\t\t\t\t\t\t\t\t\tdescription: strings.policyOptions.deny.description,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvalue: 'continue',\n\t\t\t\t\t\t\t\t\t\tlabel: strings.policyOptions.continue.label,\n\t\t\t\t\t\t\t\t\t\tdescription: strings.policyOptions.continue.description,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FormField>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('location') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--location\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.location}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('locationId') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.locationId} error={errors?.locationId} hint={strings.hints.locationId}>\n\t\t\t\t\t\t\t\t{locationOptions.length > 0 ? (\n\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\tvalue={value.locationId ?? null}\n\t\t\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('locationId', nextValue)}\n\t\t\t\t\t\t\t\t\t\toptions={locationOptions}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.locationId}\n\t\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.locationId}\n\t\t\t\t\t\t\t\t\t\tallowClear\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\tvalue={value.locationId ?? ''}\n\t\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('locationId', event.target.value)}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.locationId}\n\t\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.locationId}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('binLocation') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.binLocation}\n\t\t\t\t\t\t\t\terror={errors?.binLocation}\n\t\t\t\t\t\t\t\thint={strings.hints.binLocation}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.binLocation ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('binLocation', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.binLocation}\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.binLocation}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('shipping') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--shipping\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.shipping}</SectionHeading>\n\t\t\t\t\t{!!isFieldVisible('requiresShipping') && (\n\t\t\t\t\t\t<ToggleField\n\t\t\t\t\t\t\tlabel={strings.fields.requiresShipping}\n\t\t\t\t\t\t\tdescription={strings.hints.weight}\n\t\t\t\t\t\t\tvalue={requiresShipping}\n\t\t\t\t\t\t\tonValueChange={(checked) => updateField('requiresShipping', checked)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!isFieldVisible('weight') && (\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tlabel={strings.fields.weight}\n\t\t\t\t\t\t\terror={errors?.weight ?? errors?.weightUnit}\n\t\t\t\t\t\t\thint={strings.hints.weight}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WeightInput\n\t\t\t\t\t\t\t\tvalue={value.weight ?? ''}\n\t\t\t\t\t\t\t\tunit={value.weightUnit ?? 'kg'}\n\t\t\t\t\t\t\t\tonChange={(event) => updateField('weight', event.target.value)}\n\t\t\t\t\t\t\t\tonUnitChange={(unit) => updateField('weightUnit', unit)}\n\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\tinvalid={!!errors?.weight || !!errors?.weightUnit}\n\t\t\t\t\t\t\t\tdecimalPlaces={2}\n\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FormField>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('customs') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--customs\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.customs}</SectionHeading>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t{!!isFieldVisible('countryOfOrigin') && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tlabel={strings.fields.countryOfOrigin}\n\t\t\t\t\t\t\t\terror={errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\thint={strings.hints.countryOfOrigin}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{countryOptions.length > 0 ? (\n\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\tvalue={value.countryOfOrigin ?? null}\n\t\t\t\t\t\t\t\t\t\tonValueChange={(nextValue) => updateField('countryOfOrigin', nextValue)}\n\t\t\t\t\t\t\t\t\t\toptions={countryOptions}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tallowClear\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\tvalue={value.countryOfOrigin ?? ''}\n\t\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('countryOfOrigin', event.target.value)}\n\t\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\t\tinvalid={!!errors?.countryOfOrigin}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!isFieldVisible('hsCode') && (\n\t\t\t\t\t\t\t<FormField label={strings.fields.hsCode} error={errors?.hsCode} hint={strings.hints.hsCode}>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tvalue={value.hsCode ?? ''}\n\t\t\t\t\t\t\t\t\tonChange={(event) => updateField('hsCode', event.target.value)}\n\t\t\t\t\t\t\t\t\tplaceholder={strings.placeholders.hsCode}\n\t\t\t\t\t\t\t\t\tdisabled={shippingFieldsDisabled}\n\t\t\t\t\t\t\t\t\tinvalid={!!errors?.hsCode}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FormField>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Grid>\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!isSectionVisible('tags') && !!isFieldVisible('tags') && (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<section />}\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"inventory-section-card--tags\"\n\t\t\t\t>\n\t\t\t\t\t<SectionHeading>{strings.sections.tags}</SectionHeading>\n\t\t\t\t\t<FormField label={strings.fields.tags} error={errors?.tags} hint={strings.hints.tags}>\n\t\t\t\t\t\t<TagsInput\n\t\t\t\t\t\t\tvalue={value.tags ?? []}\n\t\t\t\t\t\t\tonValueChange={(nextTags) => updateField('tags', nextTags)}\n\t\t\t\t\t\t\trecommendations={tagRecommendations}\n\t\t\t\t\t\t\tmaxTags={maxTags}\n\t\t\t\t\t\t\tshowMaxTags={maxTags !== undefined}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\tinvalid={!!errors?.tags}\n\t\t\t\t\t\t\tstrings={strings.tagInput}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FormField>\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nInventorySectionCard.displayName = 'InventorySectionCard';\n","/**\n * The order vocabularies the order surfaces share. Goods and money move\n * independently (\"refunded, still unfulfilled\"), so an order carries two status\n * axes. Each union has exactly one tone map, and no order surface takes a tone\n * prop that could disagree with its status.\n *\n * Primary stays off every status chip: it is the one main command. A state the\n * order is moving through reads `info`; a starting state that needs attention\n * reads `warning`, not `destructive`.\n */\nimport type { BadgeTone } from '../../../base/badge';\n\n/** Where the goods are. */\nexport type FulfillmentStatus =\n\t| 'unfulfilled'\n\t| 'partiallyFulfilled'\n\t| 'fulfilled'\n\t| 'scheduled'\n\t| 'onHold'\n\t| 'cancelled';\n\nexport const fulfillmentStatusTone: Record<FulfillmentStatus, BadgeTone> = {\n\t// Warning, not destructive: unfulfilled is the starting state, not a failure.\n\tunfulfilled: 'warning',\n\tpartiallyFulfilled: 'warning',\n\tfulfilled: 'success',\n\tscheduled: 'info',\n\tonHold: 'neutral',\n\tcancelled: 'destructive',\n};\n\n/** Where the money is. */\nexport type PaymentStatus =\n\t| 'pending'\n\t| 'authorized'\n\t| 'paid'\n\t| 'partiallyRefunded'\n\t| 'refunded'\n\t| 'voided';\n\nexport const paymentStatusTone: Record<PaymentStatus, BadgeTone> = {\n\tpending: 'warning',\n\t// Authorized is money promised, not money taken: information, not success.\n\tauthorized: 'info',\n\tpaid: 'success',\n\tpartiallyRefunded: 'neutral',\n\trefunded: 'neutral',\n\tvoided: 'neutral',\n};\n\n/** What was attempted against the payment method. */\nexport type TransactionKind =\n\t| 'authorization'\n\t| 'capture'\n\t| 'sale'\n\t| 'refund'\n\t| 'void'\n\t| 'chargeback';\n\n/** Whether the attempt worked. */\nexport type TransactionStatus = 'success' | 'pending' | 'failure';\n\nexport const transactionStatusTone: Record<TransactionStatus, BadgeTone> = {\n\tsuccess: 'success',\n\tpending: 'warning',\n\tfailure: 'destructive',\n};\n\n/** Kinds that take money out of the merchant. They set the sign; callers pass the magnitude. */\nexport const outgoingTransactionKinds: ReadonlySet<TransactionKind> = new Set<TransactionKind>([\n\t'refund',\n\t'void',\n\t'chargeback',\n]);\n\n/** A postal address as an order carries it. `AddressCard` keeps its own flat props. */\nexport interface OrderAddress {\n\t/** Recipient. */\n\tname?: string;\n\t/** Street address. */\n\tline1: string;\n\t/** Apartment, suite, or unit. */\n\tline2?: string;\n\t/** City or town. */\n\tcity: string;\n\t/** State, province, or region. */\n\tregion?: string;\n\t/** Postal or ZIP code. */\n\tpostalCode?: string;\n\t/** Country name or code. */\n\tcountry: string;\n\t/** Contact number for the delivery. */\n\tphone?: string;\n}\n\n/** The words for both status axes. Tones stay derived from the status. */\nexport interface OrderStatusVocabulary {\n\t/** Label for each `FulfillmentStatus`. */\n\tfulfillment: Record<FulfillmentStatus, string>;\n\t/** Label for each `PaymentStatus`. */\n\tpayment: Record<PaymentStatus, string>;\n}\n\nexport const defaultOrderStatusVocabulary: OrderStatusVocabulary = {\n\tfulfillment: {\n\t\tunfulfilled: 'Unfulfilled',\n\t\tpartiallyFulfilled: 'Partially fulfilled',\n\t\tfulfilled: 'Fulfilled',\n\t\tscheduled: 'Scheduled',\n\t\tonHold: 'On hold',\n\t\tcancelled: 'Cancelled',\n\t},\n\tpayment: {\n\t\tpending: 'Pending',\n\t\tauthorized: 'Authorized',\n\t\tpaid: 'Paid',\n\t\tpartiallyRefunded: 'Partially refunded',\n\t\trefunded: 'Refunded',\n\t\tvoided: 'Voided',\n\t},\n};\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { ActionMenuAction, ActionMenuProps } from '../../../base/action-menu';\nimport type { HeadingTag } from '../../../typography';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport {\n\tdefaultOrderStatusVocabulary,\n\ttype FulfillmentStatus,\n\ttype OrderStatusVocabulary,\n\ttype PaymentStatus,\n} from '../shared/order-status';\n\nexport interface OrderHeaderStrings extends OrderStatusVocabulary {\n\t/** Writes the order's own reference: \"#1036\". */\n\tformatOrderNumber: (orderNumber: string) => string;\n\t/** Joins when the order was placed to where it came from. */\n\tformatOrigin: (placedAt: string, source: string) => string;\n\t/** Accessible name of the actions menu trigger. */\n\tmoreActions: string;\n}\n\nexport const defaultOrderHeaderStrings: OrderHeaderStrings = {\n\t...defaultOrderStatusVocabulary,\n\tformatOrderNumber: (orderNumber) => `#${orderNumber}`,\n\tformatOrigin: (placedAt, source) => `${placedAt} from ${source}`,\n\tmoreActions: 'More actions',\n};\n\nexport interface OrderHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {\n\t/** The order's reference, without the leading sign `formatOrderNumber` adds. */\n\torderNumber: string;\n\t/** Where the goods are. Independent of payment. */\n\tfulfillmentStatus?: FulfillmentStatus;\n\t/**\n\t * Where the money is. Both statuses, one, or neither read correctly: an\n\t * order with nothing to ship has no fulfillment state to state.\n\t */\n\tpaymentStatus?: PaymentStatus;\n\t/** Already formatted. */\n\tplacedAt?: string;\n\t/** Where the order came from: a channel, an app, an import. */\n\tsource?: string;\n\t/** Order commands, offered from one actions menu at the end of the title row. */\n\tactions?: readonly ActionMenuAction[];\n\t/** Renders `href` actions through the consumer's router. */\n\trenderLink?: ActionMenuProps['renderLink'];\n\t/** Heading level of the order number. Defaults to `h1`: the order is the page's subject. */\n\theadingTag?: HeadingTag;\n\t/** Overrides this header's own copy, including the status words. */\n\tstrings?: StringsProp<OrderHeaderStrings>;\n}\n","/**\n * OrderHeader — the order page's title row: the order number as the page\n * heading, a status chip for each axis the order moves on, and the order's\n * commands in one actions menu, with where and when the order was placed\n * beneath.\n *\n * Goods and money move independently (\"refunded, still unfulfilled\"), so the\n * payment and fulfillment chips are separate, and each renders only when its\n * status is given. Their words come from `strings`; their tones are derived\n * from the status and cannot disagree with it.\n */\nimport { ActionMenu } from '../../../base/action-menu';\nimport { Badge } from '../../../base/badge';\nimport { Stack } from '../../../base/structure';\nimport { Heading, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { fulfillmentStatusTone, paymentStatusTone } from '../shared/order-status';\nimport { defaultOrderHeaderStrings, type OrderHeaderProps } from './types';\n\nexport function OrderHeader({\n\torderNumber,\n\tfulfillmentStatus,\n\tpaymentStatus,\n\tplacedAt,\n\tsource,\n\tactions,\n\trenderLink,\n\theadingTag = 'h1',\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderHeaderProps) {\n\tconst strings = useStrings(defaultOrderHeaderStrings, stringsProp);\n\n\t// Date, source, both or neither.\n\tconst origin =\n\t\tplacedAt && source\n\t\t\t? strings.formatOrigin(placedAt, source)\n\t\t\t: placedAt || source || undefined;\n\n\treturn (\n\t\t<Stack\n\t\t\t{...props}\n\t\t\tgap=\"xs\"\n\t\t\tdata-slot=\"order-header\"\n\t\t\tclassName={cn('order-header--component min-w-0', className)}\n\t\t>\n\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"center\" wrap={false} className=\"order-header--title-row min-w-0\">\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"center\" wrap className=\"order-header--title-line min-w-0 flex-1\">\n\t\t\t\t\t<Heading tag={headingTag} size=\"lg\" className=\"order-header--number text-inherit\">\n\t\t\t\t\t\t{strings.formatOrderNumber(orderNumber)}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{!!paymentStatus && (\n\t\t\t\t\t\t<Badge tone={paymentStatusTone[paymentStatus]} data-axis=\"payment\" className=\"order-header--payment\">\n\t\t\t\t\t\t\t{strings.payment[paymentStatus]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!fulfillmentStatus && (\n\t\t\t\t\t\t<Badge tone={fulfillmentStatusTone[fulfillmentStatus]} data-axis=\"fulfillment\" className=\"order-header--fulfillment\">\n\t\t\t\t\t\t\t{strings.fulfillment[fulfillmentStatus]}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\n\t\t\t\t{!!actions?.length && (\n\t\t\t\t\t<ActionMenu actions={actions} srText={strings.moreActions} renderLink={renderLink} />\n\t\t\t\t)}\n\t\t\t</Stack>\n\n\t\t\t{!!origin && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"order-header--origin\">\n\t\t\t\t\t{origin}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nOrderHeader.displayName = 'OrderHeader';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { StringsProp } from '../../../../lib/strings';\n\n/** A per-line fact the kit did not anticipate: a gift message, an engraving, an interval. */\nexport interface OrderLineProperty {\n\t/** What the fact is. */\n\tlabel: ReactNode;\n\t/** The fact itself. */\n\tvalue: ReactNode;\n}\n\n/** One line of ordered goods, as data. */\nexport interface OrderLine {\n\t/** Stable identity for this line. */\n\tid: string;\n\t/** Product name. */\n\ttitle: string;\n\t/** The chosen option: \"OS / blue\". */\n\tvariantTitle?: string;\n\t/** Stock-keeping unit, shown as an identifier. */\n\tsku?: string;\n\t/** Product image. Without one, or when it fails to load, the line's initials show. */\n\timageSrc?: string;\n\t/** Alternative text for the image. Defaults to the title. */\n\timageAlt?: string;\n\t/** Already formatted, including its currency. */\n\tunitPrice: string;\n\t/** Units ordered. */\n\tquantity: number;\n\t/**\n\t * Already formatted. Passed, never multiplied: discounts, tax and proration\n\t * break `unitPrice × quantity`.\n\t */\n\ttotal: string;\n\t/** Per-line custom data, rendered as label/value pairs under the title. */\n\tproperties?: OrderLineProperty[];\n\t/** Whatever `properties` cannot express, under them. */\n\tchildren?: ReactNode;\n}\n\nexport interface OrderLineItemStrings {\n\t/** Reads the price column aloud: \"€50.00 × 1\". */\n\tformatUnitPrice: (unitPrice: string, quantity: number) => string;\n}\n\nexport const defaultOrderLineItemStrings: OrderLineItemStrings = {\n\tformatUnitPrice: (unitPrice, quantity) => `${unitPrice} × ${quantity}`,\n};\n\n/* `id` and `title` are the line's, not the element's DOM id and tooltip. */\nexport interface OrderLineItemProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'id' | 'title'>,\n\t\tOrderLine {\n\t/** Overrides this row's own copy. */\n\tstrings?: StringsProp<OrderLineItemStrings>;\n}\n","/**\n * OrderLineItem — one row of ordered goods: thumbnail, title, variant, SKU,\n * per-line properties, `unit × quantity`, and the line total.\n *\n * Shared by fulfillment groups, refunds and packing slips. It never computes\n * the total: discounts, tax and proration break `unit × quantity`, so the\n * caller passes it. The row adapts to its own width, not the viewport: below\n * the container `md` step the price and total sit under the text, and from it\n * they take their own columns on the title's baseline: the money belongs to\n * the product line, not to the middle of its properties. The price column is read aloud as one phrase\n * (`strings.formatUnitPrice`) while its visible parts are hidden from\n * assistive technology.\n */\nimport { Badge } from '../../../base/badge';\nimport { VisuallyHidden } from '../../../base/display';\nimport { ItemMedia } from '../../../base/item';\nimport { MetadataList } from '../../../base/metadata-list';\nimport { Stack } from '../../../base/structure';\nimport { MonoValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { LineThumbnail } from '../shared/line-thumbnail';\nimport { defaultOrderLineItemStrings, type OrderLineItemProps } from './types';\n\nexport function OrderLineItem({\n\tid,\n\ttitle,\n\tvariantTitle,\n\tsku,\n\timageSrc,\n\timageAlt,\n\tunitPrice,\n\tquantity,\n\ttotal,\n\tproperties,\n\tchildren,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderLineItemProps) {\n\tconst strings = useStrings(defaultOrderLineItemStrings, stringsProp);\n\tconst hasMeta = !!variantTitle || !!sku;\n\n\treturn (\n\t\t<div\n\t\t\t{...props}\n\t\t\tdata-slot=\"order-line-item\"\n\t\t\tdata-line-id={id}\n\t\t\tclassName={cn('order-line-item--component @container/order-line-item min-w-0', className)}\n\t\t>\n\t\t\t<div className=\"flex min-w-0 items-start gap-space-lg\">\n\t\t\t\t<ItemMedia variant=\"image\" className=\"order-line-item--media\">\n\t\t\t\t\t<LineThumbnail src={imageSrc} alt={imageAlt} title={title} />\n\t\t\t\t</ItemMedia>\n\n\t\t\t\t<div className=\"order-line-item--layout grid min-w-0 flex-1 gap-space-sm @md/order-line-item:grid-cols-[minmax(0,1fr)_auto_minmax(5rem,auto)] @md/order-line-item:items-baseline @md/order-line-item:gap-x-space-xl\">\n\t\t\t\t\t<Stack gap=\"xs\" className=\"order-line-item--body min-w-0\">\n\t\t\t\t\t\t<Text type=\"inherit\" weight=\"medium\" className=\"order-line-item--title wrap-anywhere\">\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</Text>\n\n\t\t\t\t\t\t{!!hasMeta && (\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" wrap className=\"order-line-item--meta\">\n\t\t\t\t\t\t\t\t{!!variantTitle && <Badge tone=\"neutral\" size=\"sm\">{variantTitle}</Badge>}\n\t\t\t\t\t\t\t\t{/* An identifier, so monospace. */}\n\t\t\t\t\t\t\t\t{!!sku && <MonoValue size=\"xs\" type=\"secondary\">{sku}</MonoValue>}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!!properties?.length && (\n\t\t\t\t\t\t\t<MetadataList\n\t\t\t\t\t\t\t\tlayout=\"rows\"\n\t\t\t\t\t\t\t\tdensity=\"compact\"\n\t\t\t\t\t\t\t\tclassName=\"order-line-item--properties\"\n\t\t\t\t\t\t\t\titems={properties.map((property, index) => ({\n\t\t\t\t\t\t\t\t\tid: String(index),\n\t\t\t\t\t\t\t\t\tlabel: property.label,\n\t\t\t\t\t\t\t\t\tvalue: property.value,\n\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{/* Under the text in a narrow row; their own columns from the container's md step. */}\n\t\t\t\t\t<div className=\"order-line-item--figures flex min-w-0 items-baseline justify-between gap-space-md @md/order-line-item:contents\">\n\t\t\t\t\t\t<span className=\"order-line-item--price inline-flex items-baseline gap-space-xs @md/order-line-item:justify-end\">\n\t\t\t\t\t\t\t{/* One accessible phrase for the price column: an aria-label on a role-less\n\t\t\t\t\t\t\t span is ignored, so the phrase is hidden text and the parts are aria-hidden. */}\n\t\t\t\t\t\t\t<VisuallyHidden>{strings.formatUnitPrice(unitPrice, quantity)}</VisuallyHidden>\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" aria-hidden=\"true\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t{unitPrice}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t×\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text type=\"inherit\" tag=\"span\" size=\"xs\" weight=\"medium\" aria-hidden=\"true\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t{quantity}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t<Text type=\"inherit\" tag=\"span\" weight=\"medium\" className=\"order-line-item--total text-end tabular-nums\">\n\t\t\t\t\t\t\t{total}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nOrderLineItem.displayName = 'OrderLineItem';\n","import type { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';\n\nimport type { ActionMenuAction, ActionMenuProps } from '../../../base/action-menu';\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { OrderLine, OrderLineItemStrings } from '../order-line-item/types';\nimport { defaultOrderLineItemStrings } from '../order-line-item/types';\nimport { defaultOrderStatusVocabulary, type FulfillmentStatus } from '../shared/order-status';\n\nexport interface FulfillmentGroupStrings extends OrderLineItemStrings {\n\t/** Label for each `FulfillmentStatus`. The tone stays derived from the status. */\n\tfulfillment: Record<FulfillmentStatus, string>;\n\t/** Names the group by state and size: \"Unfulfilled (3)\". */\n\tformatHeading: (status: string, count: number) => string;\n\t/** Accessible name of the overflow menu holding every action after the first. */\n\tmoreActions: string;\n}\n\nexport const defaultFulfillmentGroupStrings: FulfillmentGroupStrings = {\n\t...defaultOrderLineItemStrings,\n\tfulfillment: defaultOrderStatusVocabulary.fulfillment,\n\tformatHeading: (status, count) => `${status} (${count})`,\n\tmoreActions: 'More actions',\n};\n\n/**\n * Framed by default. Set surface=\"flat\" to embed the group in an existing\n * surface without a second frame. Header and footer rules follow Card's\n * provider defaults; `headerDivider` / `footerDivider` override them per group.\n */\nexport interface FulfillmentGroupProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider' | 'footerDivider'> {\n\t/** Where these goods are. Drives the heading chip's label and tone. */\n\tstatus: FulfillmentStatus;\n\t/** Where the group ships from. */\n\tlocation?: ReactNode;\n\t/** A standing fact about the group: \"Shipping not required\". */\n\tnotice?: ReactNode;\n\t/**\n\t * Glyph beside the notice, sized by the group. A component rather than a\n\t * node, so it arrives at the icon size of the text it annotates.\n\t */\n\tnoticeIcon?: ComponentType<{ className?: string }>;\n\t/** The rows, as data. The heading counts them. */\n\titems?: OrderLine[];\n\t/**\n\t * Units in the group, for the heading's count when `children` replace the\n\t * `items` rows, such as a partial dispatch of a discounted line.\n\t */\n\tcount?: number;\n\t/** Replaces `items` wholesale, for a caller who needs control of a row. The heading then carries no count. */\n\tchildren?: ReactNode;\n\t/**\n\t * The group's commands. The first renders as a button and the rest collapse\n\t * into an overflow menu: one array, so the menu never repeats the button.\n\t * Mark the main command `tone: 'primary'`.\n\t */\n\tactions?: readonly ActionMenuAction[];\n\t/** Renders `href` actions through the consumer's router. */\n\trenderLink?: ActionMenuProps['renderLink'];\n\t/** Overrides this surface's own copy, including the status words. */\n\tstrings?: StringsProp<FulfillmentGroupStrings>;\n}\n","/**\n * FulfillmentGroup — one shipment's worth of an order: the goods that share a\n * fulfillment state and a location, and the commands that move them on.\n *\n * A card in three bands (or, with `surface=\"flat\"`, the same bands inside a\n * parent surface), using Card's shared spacing and divider defaults. The\n * header names the group by state and size (\"Unfulfilled (3)\", a level-2\n * heading carried by the status chip, so its tone and words come from\n * `status`) with the location and any standing notice beneath. The items band\n * lists `OrderLineItem` rows, ruled between each other because the lines are\n * tabular. The actions band shows the first action as a button and collapses\n * the rest into an overflow menu.\n */\nimport {compositionRhythm} from '../../../base/structure/composition.recipes';\nimport { useMemo } from 'react';\n\nimport { ActionButtons, ActionMenu } from '../../../base/action-menu';\nimport { Badge } from '../../../base/badge';\nimport { Card, hasRenderableContent } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { OrderLineItem } from '../order-line-item/order-line-item';\nimport { fulfillmentStatusTone } from '../shared/order-status';\nimport { defaultFulfillmentGroupStrings, type FulfillmentGroupProps } from './types';\n\nexport function FulfillmentGroup({\n\tstatus,\n\tlocation,\n\tnotice,\n\tnoticeIcon: NoticeIcon,\n\titems,\n\tcount,\n\tchildren,\n\tactions,\n\trenderLink,\n\tsurface = 'card',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: FulfillmentGroupProps) {\n\tconst strings = useStrings(defaultFulfillmentGroupStrings, stringsProp);\n\tconst lineStrings = useMemo(() => ({ formatUnitPrice: strings.formatUnitPrice }), [strings.formatUnitPrice]);\n\tconst statusLabel = strings.fulfillment[status];\n\t// Counts `items`; custom `children` rows are counted by the caller's `count`.\n\tconst headingCount = count ?? items?.length;\n\tconst heading = headingCount === undefined ? statusLabel : strings.formatHeading(statusLabel, headingCount);\n\n\tconst visibleActions = (actions ?? []).filter((action) => action.visible !== false);\n\tconst [firstAction, ...overflowActions] = visibleActions;\n\n\tconst hasLocation = location !== undefined && location !== null && location !== '';\n\tconst hasNotice = notice !== undefined && notice !== null && notice !== '';\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\tdata-status={status}\n\t\t\ttitle={(\n\t\t\t\t<span role=\"heading\" aria-level={2} className=\"fulfillment-group--heading inline-flex max-w-full\">\n\t\t\t\t\t<Badge tone={fulfillmentStatusTone[status]}>{heading}</Badge>\n\t\t\t\t</span>\n\t\t\t)}\n\t\t\tdescription={hasLocation || hasNotice ? (\n\t\t\t\t<Stack gap=\"2xs\" className=\"fulfillment-group--context\">\n\t\t\t\t\t{!!hasLocation && (\n\t\t\t\t\t\t<Text tag=\"div\" type=\"secondary\" className=\"fulfillment-group--location\">{location}</Text>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!hasNotice && (\n\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" wrap={false} className=\"fulfillment-group--notice text-muted-foreground\">\n\t\t\t\t\t\t\t{!!NoticeIcon && <NoticeIcon aria-hidden=\"true\" className=\"size-icon-sm shrink-0\" />}\n\t\t\t\t\t\t\t<Text tag=\"span\" type=\"secondary\">{notice}</Text>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t) : undefined}\n\t\t\tfooterSlot={firstAction ? (\n\t\t\t\t<Stack direction=\"horizontal\" gap={compositionRhythm.commands} justify=\"end\" className=\"fulfillment-group--actions\">\n\t\t\t\t\t<ActionButtons actions={[firstAction]} renderLink={renderLink} />\n\t\t\t\t\t{overflowActions.length > 0 && (\n\t\t\t\t\t\t<ActionMenu\n\t\t\t\t\t\t\tactions={overflowActions}\n\t\t\t\t\t\t\tcontext=\"commands\"\n\t\t\t\t\t\t\tsrText={strings.moreActions}\n\t\t\t\t\t\t\tbuttonProps={{ size: 'sm' }}\n\t\t\t\t\t\t\trenderLink={renderLink}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t) : undefined}\n\t\t\tclassName={cn('fulfillment-group--component w-full', className)}\n\t\t>\n\t\t\t{/* A conditional `children` that renders nothing leaves the `items` rows in place. */}\n\t\t\t{hasRenderableContent(children) ? (\n\t\t\t\t<div className=\"fulfillment-group--items min-w-0\">{children}</div>\n\t\t\t) : (\n\t\t\t\t<ul className=\"fulfillment-group--items m-0 min-w-0 list-none p-0\">\n\t\t\t\t\t{(items ?? []).map((line) => (\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={line.id}\n\t\t\t\t\t\t\tclassName=\"fulfillment-group--line border-t border-border/60 py-space-lg first:border-t-0 first:pt-0 last:pb-0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<OrderLineItem {...line} strings={lineStrings} />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t))}\n\t\t\t\t</ul>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nFulfillmentGroup.displayName = 'FulfillmentGroup';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport { defaultOrderStatusVocabulary, type PaymentStatus } from '../shared/order-status';\n\n/** One row of an order's money ledger. */\nexport interface SummaryLine {\n\t/** Stable identity. Falls back to the row's position. */\n\tid?: string;\n\t/** What the amount is: \"Subtotal\", \"Paid\". */\n\tlabel: ReactNode;\n\t/** A count or rate beside the amount: \"3 items\", \"20%\". */\n\tnote?: ReactNode;\n\t/** Already formatted, including its currency. */\n\tamount: string;\n\t/** Money off the customer's total, shown with one U+2212 in success ink. */\n\tdeduction?: boolean;\n}\n\nexport interface OrderSummaryStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Label for each `PaymentStatus`. The tone stays derived from the status. */\n\tpayment: Record<PaymentStatus, string>;\n}\n\nexport const defaultOrderSummaryStrings: OrderSummaryStrings = {\n\ttitle: 'Payment',\n\tpayment: defaultOrderStatusVocabulary.payment,\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface OrderSummaryProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** What was ordered: subtotal, discount, shipping, tax. */\n\tgoods: SummaryLine[];\n\t/** The line the eye should land on, closing the goods ledger. */\n\ttotal: SummaryLine;\n\t/** What has actually moved: paid, refunded, balance. A separate ledger from the goods. */\n\tpayments?: SummaryLine[];\n\t/** Where the money is, as a chip beside the title. */\n\tpaymentStatus?: PaymentStatus;\n\t/**\n\t * Standing information about the balance, below the ledgers as a warning\n\t * note (`role=\"note\"`): a caveat, not an error.\n\t */\n\talert?: ReactNode;\n\t/** Overrides this surface's own copy, including the status words. */\n\tstrings?: StringsProp<OrderSummaryStrings>;\n}\n","/**\n * OrderSummary — an order's money in two ledgers: what was ordered (ending in\n * the total) and what has actually moved (paid, refunded, balance). They are\n * different questions, so they are separate ledgers, separated by spacing\n * rather than a rule or a tinted box. The payment status chip sits beside the\n * title; standing information about the balance follows the ledgers as a\n * warning note. Every amount arrives formatted: the summary does no arithmetic,\n * and a refund in the payments ledger is money that moved, not a deduction.\n */\nimport { TriangleAlert } from 'lucide-react';\n\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { Alert, AlertDescription } from '../../../base/feedback';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { paymentStatusTone } from '../shared/order-status';\nimport { AmountRow, SummaryPanel } from '../summary-panel';\nimport { defaultOrderSummaryStrings, type OrderSummaryProps, type SummaryLine } from './types';\n\nfunction LedgerRow({ line, total = false, rollup = false }: { line: SummaryLine; total?: boolean; rollup?: boolean }) {\n\treturn (\n\t\t<AmountRow\n\t\t\tlabel={line.label}\n\t\t\tnote={line.note}\n\t\t\tamount={line.amount}\n\t\t\tdeduction={line.deduction}\n\t\t\ttotal={total}\n\t\t\trollup={rollup}\n\t\t/>\n\t);\n}\n\nexport function OrderSummary({\n\tgoods,\n\ttotal,\n\tpayments,\n\tpaymentStatus,\n\talert,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderSummaryProps) {\n\tconst strings = useStrings(defaultOrderSummaryStrings, stringsProp);\n\tconst hasAlert = alert !== undefined && alert !== null && alert !== false && alert !== '';\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\ttitleSuffix={paymentStatus ? (\n\t\t\t\t<Badge tone={paymentStatusTone[paymentStatus]} className=\"order-summary--status\">\n\t\t\t\t\t{strings.payment[paymentStatus]}\n\t\t\t\t</Badge>\n\t\t\t) : undefined}\n\t\t\tcontentGap=\"xl\"\n\t\t\tcontentBottom={hasAlert ? (\n\t\t\t\t// `note`: standing information, not an error that just happened.\n\t\t\t\t<Alert tone=\"warning\" role=\"note\" className=\"order-summary--alert\">\n\t\t\t\t\t<TriangleAlert aria-hidden=\"true\" />\n\t\t\t\t\t<AlertDescription>{alert}</AlertDescription>\n\t\t\t\t</Alert>\n\t\t\t) : undefined}\n\t\t\tdata-slot=\"order-summary\"\n\t\t\tclassName={cn('order-summary--component w-full', className)}\n\t\t>\n\t\t\t<SummaryPanel className=\"order-summary--goods\">\n\t\t\t\t{goods.map((line, index) => (\n\t\t\t\t\t<LedgerRow key={line.id ?? String(index)} line={line} />\n\t\t\t\t))}\n\t\t\t\t<LedgerRow line={total} total rollup={goods.length > 0} />\n\t\t\t</SummaryPanel>\n\n\t\t\t{!!payments?.length && (\n\t\t\t\t<SummaryPanel className=\"order-summary--payments\">\n\t\t\t\t\t{payments.map((line, index) => (\n\t\t\t\t\t\t<LedgerRow key={line.id ?? String(index)} line={line} />\n\t\t\t\t\t))}\n\t\t\t\t</SummaryPanel>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nOrderSummary.displayName = 'OrderSummary';\n","import type { ComponentPropsWithoutRef } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { TransactionKind, TransactionStatus } from '../shared/order-status';\n\n/** One attempt against a payment method. */\nexport interface Transaction {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** What was attempted. Sets the sign: refunds, voids and chargebacks take money out. */\n\tkind: TransactionKind;\n\t/** Whether it worked. */\n\tstatus: TransactionStatus;\n\t/** The magnitude, already formatted. The sign comes from `kind`. */\n\tamount: string;\n\t/** Already formatted. */\n\tprocessedAt: string;\n\t/** How it was taken: \"Visa ending 4417\", \"PayPal\". */\n\tmethod?: string;\n\t/** The gateway's own identifier. Monospace: it is compared and copied, not read. */\n\treference?: string;\n\t/** Which gateway processed it. */\n\tgateway?: string;\n}\n\nexport interface OrderTransactionsStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Label for each `TransactionKind`. */\n\tkind: Record<TransactionKind, string>;\n\t/** Chip label for each `TransactionStatus`. A successful attempt shows none. */\n\tstatus: Record<TransactionStatus, string>;\n\t/** Spoken before a gateway reference. */\n\treference: string;\n\t/** Shown, and announced, when there is nothing in the ledger. */\n\tempty: string;\n}\n\nexport const defaultOrderTransactionsStrings: OrderTransactionsStrings = {\n\ttitle: 'Transactions',\n\tkind: {\n\t\tauthorization: 'Authorization',\n\t\tcapture: 'Capture',\n\t\tsale: 'Sale',\n\t\trefund: 'Refund',\n\t\tvoid: 'Void',\n\t\tchargeback: 'Chargeback',\n\t},\n\tstatus: { success: 'Success', pending: 'Pending', failure: 'Failed' },\n\treference: 'Reference',\n\tempty: 'No transactions yet',\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface OrderTransactionsProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/**\n\t * Every attempt, oldest first. A failed attempt stays listed: an order that\n\t * shows only what worked cannot answer why it was never captured.\n\t */\n\ttransactions: Transaction[];\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OrderTransactionsStrings>;\n}\n","/**\n * OrderTransactions — the payment ledger: every attempt against the order's\n * payment methods, oldest first.\n *\n * Each row names its kind, says when and how the attempt was made, and\n * carries the gateway reference as an identifier. Success is the expected case\n * and shows no chip; a pending or failed attempt is why someone opened the\n * ledger, so it gets one. Unlike a cart's green deduction, a refund here is\n * money going out: its sign comes from the kind and the figure is never\n * tinted. A failed attempt moved no money, so its figure carries no sign and\n * recedes. The rows sit on the surface that places them, ruled apart because\n * the ledger is tabular. With nothing to list, the ledger says so as a status\n * region: one quiet line that starts where the title starts, not a centred\n * empty-state panel inside the ledger's own card.\n */\nimport { Badge } from '../../../base/badge';\nimport { Card } from '../../../base/cards';\nimport { VisuallyHidden } from '../../../base/display';\nimport { Stack } from '../../../base/structure';\nimport { MonoValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { MINUS_SIGN, stripLeadingMinus } from '../format-signed-amount';\nimport { outgoingTransactionKinds, transactionStatusTone } from '../shared/order-status';\nimport { defaultOrderTransactionsStrings, type OrderTransactionsProps } from './types';\n\nexport function OrderTransactions({\n\ttransactions,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderTransactionsProps) {\n\tconst strings = useStrings(defaultOrderTransactionsStrings, stringsProp);\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\tdata-slot=\"order-transactions\"\n\t\t\tclassName={cn('order-transactions--component w-full', className)}\n\t\t>\n\t\t\t{transactions.length === 0 ? (\n\t\t\t\t<Text role=\"status\" type=\"secondary\" data-slot=\"empty\" className=\"order-transactions--empty\">\n\t\t\t\t\t{strings.empty}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\t// No frame of its own: a bordered list inside a card is a box in a box.\n\t\t\t\t<ol className=\"order-transactions--list m-0 list-none p-0\">\n\t\t\t\t\t{transactions.map((transaction) => {\n\t\t\t\t\t\tconst outgoing = outgoingTransactionKinds.has(transaction.kind);\n\t\t\t\t\t\tconst failed = transaction.status === 'failure';\n\t\t\t\t\t\t// Only money that moved takes a sign.\n\t\t\t\t\t\tconst magnitude = stripLeadingMinus(transaction.amount);\n\t\t\t\t\t\tconst amount = outgoing && !failed ? `${MINUS_SIGN}${magnitude}` : magnitude;\n\t\t\t\t\t\tconst meta = [transaction.processedAt, transaction.method, transaction.gateway]\n\t\t\t\t\t\t\t.filter((part): part is string => !!part);\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tkey={transaction.id}\n\t\t\t\t\t\t\t\tdata-status={transaction.status}\n\t\t\t\t\t\t\t\tdata-kind={transaction.kind}\n\t\t\t\t\t\t\t\tdata-outgoing={outgoing ? '' : undefined}\n\t\t\t\t\t\t\t\tclassName=\"order-transactions--row flex min-w-0 items-start gap-space-lg border-t border-border/60 py-row-y-lg first:border-t-0 first:pt-0 last:pb-0\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\" className=\"order-transactions--body min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" wrap className=\"min-w-0\">\n\t\t\t\t\t\t\t\t\t\t<Text type=\"inherit\" tag=\"span\" weight=\"medium\">{strings.kind[transaction.kind]}</Text>\n\t\t\t\t\t\t\t\t\t\t{/* Success needs no chip; a pending or failed attempt is the reason to look. */}\n\t\t\t\t\t\t\t\t\t\t{transaction.status !== 'success' && (\n\t\t\t\t\t\t\t\t\t\t\t<Badge tone={transactionStatusTone[transaction.status]} size=\"sm\" className=\"order-transactions--status\">\n\t\t\t\t\t\t\t\t\t\t\t\t{strings.status[transaction.status]}\n\t\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</Stack>\n\n\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" wrap className=\"order-transactions--meta min-w-0\">\n\t\t\t\t\t\t\t\t\t\t{meta.map((part, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Text key={`${String(index)}-${part}`} tag=\"span\" size=\"xs\" type=\"secondary\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</Stack>\n\n\t\t\t\t\t\t\t\t\t{!!transaction.reference && (\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"order-transactions--reference min-w-0 break-all\">\n\t\t\t\t\t\t\t\t\t\t\t<VisuallyHidden>{`${strings.reference}: `}</VisuallyHidden>\n\t\t\t\t\t\t\t\t\t\t\t<MonoValue type=\"inherit\">{transaction.reference}</MonoValue>\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Stack>\n\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\t\ttype={failed ? 'secondary' : 'main'}\n\t\t\t\t\t\t\t\t\tclassName=\"order-transactions--amount shrink-0 text-end tabular-nums\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{amount}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</ol>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n\nOrderTransactions.displayName = 'OrderTransactions';\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { CardProps } from '../../../base/cards';\nimport type { StringsProp } from '../../../../lib/strings';\n\nimport type { OrderAddress } from '../shared/order-status';\n\nexport interface OrderCustomerStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tshippingAddress: string;\n\tbillingAddress: string;\n\t/**\n\t * One name per edit button: each is the accessible name of a glyph with no\n\t * text beside it, and a single \"Edit\" would announce two controls alike.\n\t */\n\teditShipping: string;\n\teditBilling: string;\n\t/** Shown in place of a repeated billing address. */\n\tsameAsShipping: string;\n\t/** Shown when an address is missing. */\n\tnoAddress: string;\n\t/** How many orders the customer has placed, this one included. */\n\tformatOrderCount: (count: number) => string;\n}\n\nexport const defaultOrderCustomerStrings: OrderCustomerStrings = {\n\ttitle: 'Customer',\n\tshippingAddress: 'Shipping address',\n\tbillingAddress: 'Billing address',\n\teditShipping: 'Edit shipping address',\n\teditBilling: 'Edit billing address',\n\tsameAsShipping: 'Same as shipping address',\n\tnoAddress: 'No address on file',\n\tformatOrderCount: (count) => (count === 1 ? '1 order' : `${count} orders`),\n};\n\n/** Unframed by default. Set surface=\"card\" to let this owner frame its heading and body. */\nexport interface OrderCustomerProps\n\textends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>,\n\t\tPick<CardProps, 'surface' | 'padding' | 'headerDivider'> {\n\t/** The customer's display name. */\n\tname: string;\n\t/** Contact email, rendered as a mail link. */\n\temail?: string;\n\t/** Contact number, rendered as a call link. */\n\tphone?: string;\n\t/** How many orders this customer has placed, this one included. */\n\torderCount?: number;\n\t/** Where the order ships. */\n\tshippingAddress?: OrderAddress;\n\t/** How it ships, such as \"Standard courier · 2–3 business days\", under the shipping address. */\n\tshippingMethod?: ReactNode;\n\t/**\n\t * Shows the shipping address section. Set `false` for a subject that never\n\t * ships, such as an invoice or a digital order, rather than stating that no\n\t * address is on file. @default true\n\t */\n\tshowShippingAddress?: boolean;\n\t/** Where the order is billed. */\n\tbillingAddress?: OrderAddress;\n\t/** Renders one line in place of a repeated billing address. */\n\tbillingSameAsShipping?: boolean;\n\t/** Turns the identity row into a button. The app decides whether it navigates or opens a panel. */\n\tonOpenCustomer?: () => void;\n\t/** Shows an edit button on the shipping address. */\n\tonEditShipping?: () => void;\n\t/** Shows an edit button on the billing address. */\n\tonEditBilling?: () => void;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OrderCustomerStrings>;\n}\n","/**\n * OrderCustomer — who bought the order and where it goes: a read-only panel,\n * unlike the editable `AddressCard`.\n *\n * The identity row (avatar and name, with the order count) becomes a button\n * when `onOpenCustomer` is given. Contact details follow as mail and call\n * links, then the shipping and billing addresses, side by side once the\n * panel's own width allows. Each address can carry an icon-only edit button\n * with its own accessible name. `billingSameAsShipping` renders one line\n * instead of a repeated address. Groups are separated by spacing, not rules.\n */\nimport type { ReactNode } from 'react';\nimport { Pencil } from 'lucide-react';\n\nimport { Avatar, AvatarFallback } from '../../../base/avatar';\nimport { Button } from '../../../base/buttons';\nimport { Card } from '../../../base/cards';\nimport { Item } from '../../../base/item';\nimport { AdaptiveGrid, Stack } from '../../../base/structure';\nimport { Email, formatInitials, Phone } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { AddressLines } from '../shared/address-lines';\nimport type { OrderAddress } from '../shared/order-status';\nimport { defaultOrderCustomerStrings, type OrderCustomerProps } from './types';\n\ninterface AddressSectionProps {\n\tlabel: string;\n\teditLabel: string;\n\taddress?: OrderAddress;\n\tonEdit?: () => void;\n\treplacement?: string;\n\temptyLabel: string;\n\tnote?: ReactNode;\n\tclassName: string;\n}\n\nfunction AddressSection({ label, editLabel, address, onEdit, replacement, emptyLabel, note, className }: AddressSectionProps) {\n\treturn (\n\t\t<Stack gap=\"sm\" className={cn('order-customer--address min-w-0', className)}>\n\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" align=\"center\" justify=\"between\" wrap={false} className=\"min-h-action-sm\">\n\t\t\t\t<DisplayLabel tag=\"div\">{label}</DisplayLabel>\n\t\t\t\t{/* Icon only; the accessible name says which address it edits. */}\n\t\t\t\t{!!onEdit && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\ticonOnly\n\t\t\t\t\t\taria-label={editLabel}\n\t\t\t\t\t\tonClick={onEdit}\n\t\t\t\t\t\tclassName=\"order-customer--edit\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Pencil aria-hidden=\"true\" className=\"size-icon-sm\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t\t{replacement ? (\n\t\t\t\t<Text type=\"secondary\">{replacement}</Text>\n\t\t\t) : address ? (\n\t\t\t\t<AddressLines address={address} />\n\t\t\t) : (\n\t\t\t\t<Text type=\"secondary\">{emptyLabel}</Text>\n\t\t\t)}\n\t\t\t{!!note && <Text tag=\"div\" size=\"xs\" type=\"secondary\" className=\"order-customer--address-note\">{note}</Text>}\n\t\t</Stack>\n\t);\n}\n\nexport function OrderCustomer({\n\tname,\n\temail,\n\tphone,\n\torderCount,\n\tshippingAddress,\n\tshippingMethod,\n\tshowShippingAddress = true,\n\tbillingAddress,\n\tbillingSameAsShipping = false,\n\tonOpenCustomer,\n\tonEditShipping,\n\tonEditBilling,\n\tsurface = 'flat',\n\tpadding = surface === 'flat' ? 'none' : 'md',\n\theaderDivider,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: OrderCustomerProps) {\n\tconst strings = useStrings(defaultOrderCustomerStrings, stringsProp);\n\tconst hasContact = !!email || !!phone;\n\n\treturn (\n\t\t<Card\n\t\t\t{...props}\n\t\t\tsurface={surface}\n\t\t\tpadding={padding}\n\t\t\theaderDivider={headerDivider}\n\t\t\ttitle={strings.title}\n\t\t\tcontentGap=\"2xl\"\n\t\t\tdata-slot=\"order-customer\"\n\t\t\tclassName={cn('order-customer--component w-full', className)}\n\t\t>\n\t\t\t{/* An identity (avatar and name), not a label and a value. A button when\n\t\t\t the app can open the customer: it decides whether that navigates. */}\n\t\t\t<Item\n\t\t\t\t// A clickable row pays its own inset and bleeds it back out, so the\n\t\t\t\t// avatar stays on the panel's edge while the hover fill has room.\n\t\t\t\t// The name stays beside its avatar in a narrow column instead of wrapping under it.\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'order-customer--identity flex-nowrap',\n\t\t\t\t\t!!onOpenCustomer && cn('-mx-row-x w-auto text-start', interactionRecipes.rowHover),\n\t\t\t\t)}\n\t\t\t\tpadding={onOpenCustomer ? 'default' : 'none'}\n\t\t\t\trender={onOpenCustomer ? <button type=\"button\" onClick={onOpenCustomer} /> : undefined}\n\t\t\t\tmedia={(\n\t\t\t\t\t<Avatar>\n\t\t\t\t\t\t<AvatarFallback>{formatInitials(name)}</AvatarFallback>\n\t\t\t\t\t</Avatar>\n\t\t\t\t)}\n\t\t\t\ttitle={name}\n\t\t\t\tdescription={orderCount !== undefined ? strings.formatOrderCount(orderCount) : undefined}\n\t\t\t/>\n\n\t\t\t{!!hasContact && (\n\t\t\t\t<Stack gap=\"xs\" className=\"order-customer--contact min-w-0\">\n\t\t\t\t\t{!!email && <Email value={email} className=\"self-start\" />}\n\t\t\t\t\t{!!phone && <Phone value={phone} className=\"self-start\" />}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{/* Side by side once the panel is wide enough, so the two compare at a glance. */}\n\t\t\t<AdaptiveGrid minColumnWidth=\"sm\" gap=\"xl\" className=\"order-customer--addresses\">\n\t\t\t\t{showShippingAddress && (\n\t\t\t\t\t<AddressSection\n\t\t\t\t\t\tlabel={strings.shippingAddress}\n\t\t\t\t\t\teditLabel={strings.editShipping}\n\t\t\t\t\t\taddress={shippingAddress}\n\t\t\t\t\t\tonEdit={onEditShipping}\n\t\t\t\t\t\temptyLabel={strings.noAddress}\n\t\t\t\t\t\tnote={shippingMethod}\n\t\t\t\t\t\tclassName=\"order-customer--shipping\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<AddressSection\n\t\t\t\t\tlabel={strings.billingAddress}\n\t\t\t\t\teditLabel={strings.editBilling}\n\t\t\t\t\taddress={billingAddress}\n\t\t\t\t\tonEdit={onEditBilling}\n\t\t\t\t\treplacement={billingSameAsShipping ? strings.sameAsShipping : undefined}\n\t\t\t\t\temptyLabel={strings.noAddress}\n\t\t\t\t\tclassName=\"order-customer--billing\"\n\t\t\t\t/>\n\t\t\t</AdaptiveGrid>\n\t\t</Card>\n\t);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