@alfadocs/ui-kit-debug 1.121.0 → 1.122.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/_chunks/addDays-CuE8wLqb.js +9 -0
  2. package/dist/_chunks/addDays-CuE8wLqb.js.map +1 -0
  3. package/dist/_chunks/{anamnesis-summary-rows-BbAREK-3.js → anamnesis-summary-rows-CtcULkvc.js} +2 -2
  4. package/dist/_chunks/{anamnesis-summary-rows-BbAREK-3.js.map → anamnesis-summary-rows-CtcULkvc.js.map} +1 -1
  5. package/dist/_chunks/{antenatal-schedule-timeline-86YVlMYJ.js → antenatal-schedule-timeline-XHbig8On.js} +3 -3
  6. package/dist/_chunks/{antenatal-schedule-timeline-86YVlMYJ.js.map → antenatal-schedule-timeline-XHbig8On.js.map} +1 -1
  7. package/dist/_chunks/{appointment-timeline-CC7nmBOH.js → appointment-timeline-Czd4PBkF.js} +2 -2
  8. package/dist/_chunks/{appointment-timeline-CC7nmBOH.js.map → appointment-timeline-Czd4PBkF.js.map} +1 -1
  9. package/dist/_chunks/{balance-badge-cell-DPjab0eJ.js → balance-badge-cell-DtxbGJcA.js} +2 -2
  10. package/dist/_chunks/{balance-badge-cell-DPjab0eJ.js.map → balance-badge-cell-DtxbGJcA.js.map} +1 -1
  11. package/dist/_chunks/{bill-line-table-DUMEHnQ4.js → bill-line-table-HrynB7ND.js} +2 -2
  12. package/dist/_chunks/{bill-line-table-DUMEHnQ4.js.map → bill-line-table-HrynB7ND.js.map} +1 -1
  13. package/dist/_chunks/{calendar-appointment-editor-dialog-rw02sXGw.js → calendar-appointment-editor-dialog-CiCmsBCH.js} +5 -5
  14. package/dist/_chunks/{calendar-appointment-editor-dialog-rw02sXGw.js.map → calendar-appointment-editor-dialog-CiCmsBCH.js.map} +1 -1
  15. package/dist/_chunks/{cycle-calculator-C8nWAeTk.js → cycle-calculator-WFhMfJHt.js} +4 -3
  16. package/dist/_chunks/{cycle-calculator-C8nWAeTk.js.map → cycle-calculator-WFhMfJHt.js.map} +1 -1
  17. package/dist/_chunks/{data-grid-Bbf8t4z3.js → data-grid-C71BhGDw.js} +2 -2
  18. package/dist/_chunks/{data-grid-Bbf8t4z3.js.map → data-grid-C71BhGDw.js.map} +1 -1
  19. package/dist/_chunks/{date-picker-DBVTj6lO.js → date-picker-BmVBVpVu.js} +3 -3
  20. package/dist/_chunks/{date-picker-DBVTj6lO.js.map → date-picker-BmVBVpVu.js.map} +1 -1
  21. package/dist/_chunks/{date-picker-variants-J1EeAhIH.js → date-picker-variants-DmfVRNDB.js} +184 -188
  22. package/dist/_chunks/date-picker-variants-DmfVRNDB.js.map +1 -0
  23. package/dist/_chunks/{date-range-panel-CT6nXjRM.js → date-range-panel-CT9Pk-HF.js} +2 -2
  24. package/dist/_chunks/{date-range-panel-CT6nXjRM.js.map → date-range-panel-CT9Pk-HF.js.map} +1 -1
  25. package/dist/_chunks/{date-range-picker-PTRpDkXT.js → date-range-picker-2Up_FRrM.js} +40 -39
  26. package/dist/_chunks/{date-range-picker-PTRpDkXT.js.map → date-range-picker-2Up_FRrM.js.map} +1 -1
  27. package/dist/_chunks/{date-time-picker-CJnqiQoT.js → date-time-picker-C6b_Vymc.js} +2 -2
  28. package/dist/_chunks/{date-time-picker-CJnqiQoT.js.map → date-time-picker-C6b_Vymc.js.map} +1 -1
  29. package/dist/_chunks/{default-tabs-Cxkw1Ws0.js → default-tabs-RvCI5uN0.js} +3 -3
  30. package/dist/_chunks/{default-tabs-Cxkw1Ws0.js.map → default-tabs-RvCI5uN0.js.map} +1 -1
  31. package/dist/_chunks/{due-date-calculator-c1NJPw9F.js → due-date-calculator-CALlODZe.js} +4 -4
  32. package/dist/_chunks/{due-date-calculator-c1NJPw9F.js.map → due-date-calculator-CALlODZe.js.map} +1 -1
  33. package/dist/_chunks/{gestational-age-calculator-Cg4Gq42R.js → gestational-age-calculator-mB6brTlp.js} +5 -5
  34. package/dist/_chunks/{gestational-age-calculator-Cg4Gq42R.js.map → gestational-age-calculator-mB6brTlp.js.map} +1 -1
  35. package/dist/_chunks/{hcg-doubling-BjTa_77t.js → hcg-doubling-Dhdt3Jyd.js} +3 -3
  36. package/dist/_chunks/{hcg-doubling-BjTa_77t.js.map → hcg-doubling-Dhdt3Jyd.js.map} +1 -1
  37. package/dist/_chunks/{invoice-upload-list-CsFsRgbt.js → invoice-upload-list-C95s5Q7m.js} +3 -3
  38. package/dist/_chunks/{invoice-upload-list-CsFsRgbt.js.map → invoice-upload-list-C95s5Q7m.js.map} +1 -1
  39. package/dist/_chunks/{kit-extensions-C3oL0WTp.js → kit-extensions-DUaIYyMD.js} +4 -4
  40. package/dist/_chunks/{kit-extensions-C3oL0WTp.js.map → kit-extensions-DUaIYyMD.js.map} +1 -1
  41. package/dist/_chunks/{link-cell-renderer-NFNGdAGt.js → link-cell-renderer-BEaLczk2.js} +2 -2
  42. package/dist/_chunks/{link-cell-renderer-NFNGdAGt.js.map → link-cell-renderer-BEaLczk2.js.map} +1 -1
  43. package/dist/_chunks/{map-view-h6ngp2xi.js → map-view-QWdQLHi9.js} +543 -495
  44. package/dist/_chunks/map-view-QWdQLHi9.js.map +1 -0
  45. package/dist/_chunks/{parse-BLBWPIgE.js → parse-BFur8Byx.js} +2 -2
  46. package/dist/_chunks/{parse-BLBWPIgE.js.map → parse-BFur8Byx.js.map} +1 -1
  47. package/dist/_chunks/{patient-details-C4dHR4iu.js → patient-details-Cba9HQj_.js} +2 -2
  48. package/dist/_chunks/{patient-details-C4dHR4iu.js.map → patient-details-Cba9HQj_.js.map} +1 -1
  49. package/dist/_chunks/{patient-field-row-0QP8KCVp.js → patient-field-row-CtDihADs.js} +2 -2
  50. package/dist/_chunks/{patient-field-row-0QP8KCVp.js.map → patient-field-row-CtDihADs.js.map} +1 -1
  51. package/dist/_chunks/{patient-summary-card-x0-AhCyC.js → patient-summary-card-DnLdbtsw.js} +2 -2
  52. package/dist/_chunks/{patient-summary-card-x0-AhCyC.js.map → patient-summary-card-DnLdbtsw.js.map} +1 -1
  53. package/dist/_chunks/practice-results-BCLqPdgn.js +2683 -0
  54. package/dist/_chunks/practice-results-BCLqPdgn.js.map +1 -0
  55. package/dist/_chunks/{pregnancy-dating-BO6diQMZ.js → pregnancy-dating-BNI32qNw.js} +5 -5
  56. package/dist/_chunks/{pregnancy-dating-BO6diQMZ.js.map → pregnancy-dating-BNI32qNw.js.map} +1 -1
  57. package/dist/_chunks/{radiograph-panel.agent-Dcv16n7u.js → radiograph-panel.agent-B-r3BoqU.js} +3 -3
  58. package/dist/_chunks/{radiograph-panel.agent-Dcv16n7u.js.map → radiograph-panel.agent-B-r3BoqU.js.map} +1 -1
  59. package/dist/_chunks/{reserved.agent-DRSZ8UcL.js → reserved.agent-CCwsOb3M.js} +8 -7
  60. package/dist/_chunks/{reserved.agent-DRSZ8UcL.js.map → reserved.agent-CCwsOb3M.js.map} +1 -1
  61. package/dist/_chunks/{send-registration-link-form-DuZQuKnI.js → send-registration-link-form-BjkXr0TD.js} +3 -3
  62. package/dist/_chunks/{send-registration-link-form-DuZQuKnI.js.map → send-registration-link-form-BjkXr0TD.js.map} +1 -1
  63. package/dist/_chunks/{slot-grid-b4eZXokb.js → slot-grid-DEZRB4Yb.js} +234 -207
  64. package/dist/_chunks/slot-grid-DEZRB4Yb.js.map +1 -0
  65. package/dist/_chunks/subDays-DC99JK7a.js +8 -0
  66. package/dist/_chunks/{subDays-Bsoy023P.js.map → subDays-DC99JK7a.js.map} +1 -1
  67. package/dist/_chunks/{task-editor-Czcx9B-3.js → task-editor-C05yx7JJ.js} +2 -2
  68. package/dist/_chunks/{task-editor-Czcx9B-3.js.map → task-editor-C05yx7JJ.js.map} +1 -1
  69. package/dist/_chunks/{toolbar-DoKcoE2q.js → toolbar-Dznu_Dou.js} +2 -2
  70. package/dist/_chunks/{toolbar-DoKcoE2q.js.map → toolbar-Dznu_Dou.js.map} +1 -1
  71. package/dist/_chunks/{use-appointment-details-read-B-SXnszJ.js → use-appointment-details-read-Bm408XzX.js} +2 -2
  72. package/dist/_chunks/{use-appointment-details-read-B-SXnszJ.js.map → use-appointment-details-read-Bm408XzX.js.map} +1 -1
  73. package/dist/agent-catalog.json +3 -3
  74. package/dist/agent-i18n/en.json +1 -1
  75. package/dist/browser-support.js +1 -1
  76. package/dist/components/appointment-details-panel/index.js +1 -1
  77. package/dist/components/appointment-timeline/index.js +1 -1
  78. package/dist/components/bill-line-table/index.js +1 -1
  79. package/dist/components/bill-table/index.js +1 -1
  80. package/dist/components/booking/index.js +1 -1
  81. package/dist/components/cycle-calculator/index.js +1 -1
  82. package/dist/components/data-grid/index.js +2 -2
  83. package/dist/components/data-table/index.js +1 -1
  84. package/dist/components/date-picker/index.js +1 -1
  85. package/dist/components/date-range-picker/index.js +1 -1
  86. package/dist/components/date-time-picker/index.js +1 -1
  87. package/dist/components/due-date-calculator/index.js +2 -2
  88. package/dist/components/gestational-age-calculator/index.js +1 -1
  89. package/dist/components/hcg-doubling/index.js +1 -1
  90. package/dist/components/invoice-upload-list/index.js +1 -1
  91. package/dist/components/map-view/index.d.ts +1 -1
  92. package/dist/components/map-view/index.d.ts.map +1 -1
  93. package/dist/components/map-view/index.js +1 -1
  94. package/dist/components/map-view/map-view.d.ts +18 -0
  95. package/dist/components/map-view/map-view.d.ts.map +1 -1
  96. package/dist/components/patient-details/index.js +1 -1
  97. package/dist/components/patient-summary-card/index.js +1 -1
  98. package/dist/components/patient-table/index.js +1 -1
  99. package/dist/components/practice-results/index.js +1 -1
  100. package/dist/components/practice-results/practice-results-slot-card.d.ts +38 -0
  101. package/dist/components/practice-results/practice-results-slot-card.d.ts.map +1 -0
  102. package/dist/components/practice-results/practice-results.d.ts +32 -2
  103. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  104. package/dist/components/pregnancy-dating/index.js +1 -1
  105. package/dist/components/radiograph-panel/index.js +1 -1
  106. package/dist/components/rich-text-editor/index.js +1 -1
  107. package/dist/components/slot-grid/index.js +1 -1
  108. package/dist/components/slot-grid/slot-grid.d.ts +19 -0
  109. package/dist/components/slot-grid/slot-grid.d.ts.map +1 -1
  110. package/dist/components/task-editor/index.js +1 -1
  111. package/dist/core.css +1 -1
  112. package/dist/host-compat.css +9 -1
  113. package/dist/i18n/locales/ar.d.ts +5 -0
  114. package/dist/i18n/locales/ar.d.ts.map +1 -1
  115. package/dist/i18n/locales/ar.js +6 -1
  116. package/dist/i18n/locales/ar.js.map +1 -1
  117. package/dist/i18n/locales/de.d.ts +5 -0
  118. package/dist/i18n/locales/de.d.ts.map +1 -1
  119. package/dist/i18n/locales/de.js +6 -1
  120. package/dist/i18n/locales/de.js.map +1 -1
  121. package/dist/i18n/locales/el.d.ts +5 -0
  122. package/dist/i18n/locales/el.d.ts.map +1 -1
  123. package/dist/i18n/locales/el.js +6 -1
  124. package/dist/i18n/locales/el.js.map +1 -1
  125. package/dist/i18n/locales/en.d.ts +5 -0
  126. package/dist/i18n/locales/en.d.ts.map +1 -1
  127. package/dist/i18n/locales/en.js +5 -0
  128. package/dist/i18n/locales/en.js.map +1 -1
  129. package/dist/i18n/locales/es.d.ts +5 -0
  130. package/dist/i18n/locales/es.d.ts.map +1 -1
  131. package/dist/i18n/locales/es.js +6 -1
  132. package/dist/i18n/locales/es.js.map +1 -1
  133. package/dist/i18n/locales/fr.d.ts +5 -0
  134. package/dist/i18n/locales/fr.d.ts.map +1 -1
  135. package/dist/i18n/locales/fr.js +6 -1
  136. package/dist/i18n/locales/fr.js.map +1 -1
  137. package/dist/i18n/locales/hi.d.ts +5 -0
  138. package/dist/i18n/locales/hi.d.ts.map +1 -1
  139. package/dist/i18n/locales/hi.js +6 -1
  140. package/dist/i18n/locales/hi.js.map +1 -1
  141. package/dist/i18n/locales/it.d.ts +5 -0
  142. package/dist/i18n/locales/it.d.ts.map +1 -1
  143. package/dist/i18n/locales/it.js +6 -1
  144. package/dist/i18n/locales/it.js.map +1 -1
  145. package/dist/i18n/locales/ja.d.ts +5 -0
  146. package/dist/i18n/locales/ja.d.ts.map +1 -1
  147. package/dist/i18n/locales/ja.js +6 -1
  148. package/dist/i18n/locales/ja.js.map +1 -1
  149. package/dist/i18n/locales/nl.d.ts +5 -0
  150. package/dist/i18n/locales/nl.d.ts.map +1 -1
  151. package/dist/i18n/locales/nl.js +6 -1
  152. package/dist/i18n/locales/nl.js.map +1 -1
  153. package/dist/i18n/locales/pl.d.ts +5 -0
  154. package/dist/i18n/locales/pl.d.ts.map +1 -1
  155. package/dist/i18n/locales/pl.js +6 -1
  156. package/dist/i18n/locales/pl.js.map +1 -1
  157. package/dist/i18n/locales/pt.d.ts +5 -0
  158. package/dist/i18n/locales/pt.d.ts.map +1 -1
  159. package/dist/i18n/locales/pt.js +6 -1
  160. package/dist/i18n/locales/pt.js.map +1 -1
  161. package/dist/i18n/locales/ro.d.ts +5 -0
  162. package/dist/i18n/locales/ro.d.ts.map +1 -1
  163. package/dist/i18n/locales/ro.js +6 -1
  164. package/dist/i18n/locales/ro.js.map +1 -1
  165. package/dist/i18n/locales/ru.d.ts +5 -0
  166. package/dist/i18n/locales/ru.d.ts.map +1 -1
  167. package/dist/i18n/locales/ru.js +6 -1
  168. package/dist/i18n/locales/ru.js.map +1 -1
  169. package/dist/i18n/locales/sq.d.ts +5 -0
  170. package/dist/i18n/locales/sq.d.ts.map +1 -1
  171. package/dist/i18n/locales/sq.js +6 -1
  172. package/dist/i18n/locales/sq.js.map +1 -1
  173. package/dist/i18n/locales/sv.d.ts +5 -0
  174. package/dist/i18n/locales/sv.d.ts.map +1 -1
  175. package/dist/i18n/locales/sv.js +6 -1
  176. package/dist/i18n/locales/sv.js.map +1 -1
  177. package/dist/i18n/locales/tr.d.ts +5 -0
  178. package/dist/i18n/locales/tr.d.ts.map +1 -1
  179. package/dist/i18n/locales/tr.js +6 -1
  180. package/dist/i18n/locales/tr.js.map +1 -1
  181. package/dist/i18n/locales/zh.d.ts +5 -0
  182. package/dist/i18n/locales/zh.d.ts.map +1 -1
  183. package/dist/i18n/locales/zh.js +6 -1
  184. package/dist/i18n/locales/zh.js.map +1 -1
  185. package/dist/index.js +30 -30
  186. package/dist/locales/ar.json +6 -1
  187. package/dist/locales/de.json +6 -1
  188. package/dist/locales/el.json +6 -1
  189. package/dist/locales/en.json +5 -0
  190. package/dist/locales/es.json +6 -1
  191. package/dist/locales/fr.json +6 -1
  192. package/dist/locales/hi.json +6 -1
  193. package/dist/locales/it.json +6 -1
  194. package/dist/locales/ja.json +6 -1
  195. package/dist/locales/nl.json +6 -1
  196. package/dist/locales/pl.json +6 -1
  197. package/dist/locales/pt.json +6 -1
  198. package/dist/locales/ro.json +6 -1
  199. package/dist/locales/ru.json +6 -1
  200. package/dist/locales/sq.json +6 -1
  201. package/dist/locales/sv.json +6 -1
  202. package/dist/locales/tr.json +6 -1
  203. package/dist/locales/zh.json +6 -1
  204. package/dist/patterns/anamnesis/index.js +1 -1
  205. package/dist/patterns/calendar/index.js +1 -1
  206. package/dist/patterns/send-registration-link-form/index.js +1 -1
  207. package/dist/tokens.css +1 -1
  208. package/package.json +1 -1
  209. package/dist/_chunks/date-picker-variants-J1EeAhIH.js.map +0 -1
  210. package/dist/_chunks/map-view-h6ngp2xi.js.map +0 -1
  211. package/dist/_chunks/practice-results-yCresv86.js +0 -2326
  212. package/dist/_chunks/practice-results-yCresv86.js.map +0 -1
  213. package/dist/_chunks/slot-grid-b4eZXokb.js.map +0 -1
  214. package/dist/_chunks/subDays-Bsoy023P.js +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"invoice-upload-list-CsFsRgbt.js","sources":["../../node_modules/lucide-react/dist/esm/icons/scan-search.mjs","../../src/components/invoice-upload-list/invoice-upload-list.agent.ts","../../src/components/invoice-upload-list/invoice-upload-list.variants.ts","../../src/components/invoice-upload-list/types.ts","../../src/components/invoice-upload-list/model.ts","../../src/components/invoice-upload-list/cells.tsx","../../src/components/invoice-upload-list/columns.tsx","../../src/components/invoice-upload-list/handle.ts","../../src/components/invoice-upload-list/invoice-upload-list.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 7V5a2 2 0 0 1 2-2h2\", key: \"aa7l1z\" }],\n [\"path\", { d: \"M17 3h2a2 2 0 0 1 2 2v2\", key: \"4qcy5o\" }],\n [\"path\", { d: \"M21 17v2a2 2 0 0 1-2 2h-2\", key: \"6vwrx8\" }],\n [\"path\", { d: \"M7 21H5a2 2 0 0 1-2-2v-2\", key: \"ioqczr\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }],\n [\"path\", { d: \"m16 16-1.9-1.9\", key: \"1dq9hf\" }]\n];\nconst ScanSearch = createLucideIcon(\"scan-search\", __iconNode);\n\nexport { __iconNode, ScanSearch as default };\n//# sourceMappingURL=scan-search.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter: InvoiceUploadList. */\n/* */\n/* Works against the curated `InvoiceUploadListHandle`: ids and kit */\n/* shapes only, never the DataGrid handle, a TanStack object, a row */\n/* object or a DOM node. It is the list's only agent surface: the */\n/* DataGrid inside registers none (`registerAgent={false}`). */\n/* */\n/* Safety: selecting, sorting and scrolling change the view (`read`). */\n/* Review opens the host's review dialog and changes nothing by itself */\n/* (`read` + `openWorld`). Load all ready and Load selected hand invoices */\n/* to the host, which loads them into the warehouse (`write` + */\n/* `openWorld`). Supplier invoices are not patient data. Agent state */\n/* carries no host text: a supplier name is read only when it is not */\n/* masked (a person under privacy mode is not), and an error reads as */\n/* `hasError`, never as the platform's message. */\n/* */\n/* Literal enums, not imports: the catalog build loads this file in plain */\n/* Node, where only type imports are erased. A test keeps the literals */\n/* equal to the constants in types.ts. */\n/* See src/docs/26-agent-readiness.mdx. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type {\n InvoiceUploadListHandle,\n InvoiceUploadListSortEntry,\n} from './types';\n\nconst SORT_COLUMNS = [\n 'fileName',\n 'supplier',\n 'invoiceNumber',\n 'date',\n 'lineCount',\n 'total',\n 'status',\n] as const;\n\ntype InvoiceUploadListAgentErrorCode =\n | 'UNKNOWN_ROW'\n | 'ROW_FILTERED_OUT'\n | 'COLUMN_MASKED'\n | 'SELECTION_DISABLED';\n\nfunction refuse(code: InvoiceUploadListAgentErrorCode, detail: string): never {\n throw new Error(`${code}: ${detail}`);\n}\n\nfunction knownRow(handle: InvoiceUploadListHandle, id: string): void {\n // Every invoice, not only the rows the search and filters leave showing.\n if (!handle.hasRow(id)) {\n refuse('UNKNOWN_ROW', `no invoice \"${id}\" in the list.`);\n }\n}\n\nconst ROW_ID_SCHEMA = {\n type: 'object',\n properties: { id: { type: 'string', description: 'An invoice id (rows).' } },\n required: ['id'],\n additionalProperties: false,\n};\n\nexport const invoiceUploadListAgent: AgentAdapter<InvoiceUploadListHandle> = {\n id: 'invoice-upload-list',\n capabilities: [\n 'select_multiple',\n 'sort',\n 'scroll',\n // review opens the host's review dialog (`open`: a Dialog).\n 'open',\n // load_all_ready and load_selected commit invoices to the warehouse.\n 'submit',\n ],\n state: {\n features: {\n type: '{ privacyMode, status, selectable, readyCount }',\n descriptionKey: 'ui.agent.invoiceUploadList.state.features',\n description:\n 'What the list can do now: privacy mode, loading status, whether rows can be selected, and how many invoices are ready to load.',\n read: (handle) => handle.getFeatures(),\n },\n rows: {\n type: 'Array<{ id, fileId, fileName, status, supplierKind, supplierName?, invoiceNumber, date, lineCount, loading, hasError, selectable, review }>',\n descriptionKey: 'ui.agent.invoiceUploadList.state.rows',\n description:\n 'The uploaded invoices. A supplier name is given only when it is not hidden; a person is never named under privacy mode. An error row reads hasError, not its message.',\n read: (handle) => handle.getRowSummaries(),\n },\n counts: {\n type: 'Record<status, number>',\n descriptionKey: 'ui.agent.invoiceUploadList.state.counts',\n description:\n 'How many invoices have each status: readyToLoad, toReview, alreadyLoaded, loaded and error.',\n read: (handle) => handle.getCounts(),\n },\n selection: {\n type: 'string[]',\n descriptionKey: 'ui.agent.invoiceUploadList.state.selection',\n description: 'Ids of the selected invoices.',\n read: (handle) => handle.getSelection(),\n },\n sort: {\n type: 'Array<{ colId, sort }>',\n descriptionKey: 'ui.agent.invoiceUploadList.state.sort',\n description: 'The active sort.',\n read: (handle) => handle.getSort(),\n },\n columns: {\n type: 'Array<{ id, label, visible, canHide, sortable, masked }>',\n descriptionKey: 'ui.agent.invoiceUploadList.state.columns',\n description: 'The columns, in display order.',\n read: (handle) => handle.getColumns(),\n },\n },\n actions: {\n select_ready: {\n safety: 'read',\n returns: 'string[]',\n idempotent: true,\n errors: ['SELECTION_DISABLED: the list has no selection.'],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.selectReady',\n description:\n 'Select every invoice that is ready to load and not being loaded. Nothing loads until load_selected.',\n invoke: (handle) => {\n if (!handle.getFeatures().selectable) {\n refuse('SELECTION_DISABLED', 'this list has no selection.');\n }\n return handle.selectReady();\n },\n },\n select_rows: {\n safety: 'read',\n argsType: '{ ids: string[] }',\n argsSchema: {\n type: 'object',\n properties: { ids: { type: 'array', items: { type: 'string' } } },\n required: ['ids'],\n additionalProperties: false,\n },\n returns: 'string[]',\n idempotent: true,\n errors: ['SELECTION_DISABLED: the list has no selection.'],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.selectRows',\n description:\n 'Replace the selection with the given invoice ids. Only invoices that are ready to load can be selected; others are ignored.',\n invoke: (handle, args: { ids: string[] }) => {\n if (!handle.getFeatures().selectable) {\n refuse('SELECTION_DISABLED', 'this list has no selection.');\n }\n handle.setSelection(args.ids);\n return handle.getSelection();\n },\n },\n clear_selection: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.invoiceUploadList.actions.clearSelection',\n description: 'Clear the selection.',\n invoke: (handle) => handle.clearSelection(),\n },\n sort_by: {\n safety: 'read',\n argsType:\n '{ colId: \"fileName\" | \"supplier\" | \"invoiceNumber\" | \"date\" | \"lineCount\" | \"total\" | \"status\", sort: \"asc\" | \"desc\" }',\n argsSchema: {\n type: 'object',\n properties: {\n colId: { enum: [...SORT_COLUMNS] },\n sort: { enum: ['asc', 'desc'] },\n },\n required: ['colId', 'sort'],\n additionalProperties: false,\n },\n idempotent: true,\n errors: [\n 'COLUMN_MASKED: supplier cannot be sorted while privacy mode is on.',\n ],\n examples: [{ args: { colId: 'status', sort: 'asc' } }],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.sortBy',\n description: 'Sort the invoices by one column. The selection is kept.',\n invoke: (handle, args: InvoiceUploadListSortEntry) => {\n const column = handle.getColumns().find((c) => c.id === args.colId);\n if (column?.masked) {\n refuse('COLUMN_MASKED', `\"${args.colId}\" is hidden by privacy mode.`);\n }\n handle.setSort([{ colId: args.colId, sort: args.sort }]);\n },\n },\n scroll_to_row: {\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: ROW_ID_SCHEMA,\n idempotent: true,\n errors: [\n 'UNKNOWN_ROW: the id is not in the list.',\n 'ROW_FILTERED_OUT: the search or a filter hides the invoice.',\n ],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.scrollToRow',\n description: 'Scroll one invoice into view.',\n invoke: (handle, args: { id: string }) => {\n knownRow(handle, args.id);\n handle.scrollToRow(args.id);\n },\n },\n open_review: {\n safety: 'read',\n openWorld: true,\n argsType: '{ id: string }',\n argsSchema: ROW_ID_SCHEMA,\n errors: [\n 'UNKNOWN_ROW: the id is not in the list.',\n 'ACTION_UNAVAILABLE: the list offers no review.',\n 'ACTION_DISABLED: error, the file could not be read.',\n ],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.openReview',\n description:\n 'Open one invoice for review. The host shows its lines. Nothing loads until the user confirms there.',\n invoke: (handle, args: { id: string }) => {\n knownRow(handle, args.id);\n handle.review(args.id);\n },\n },\n load_all_ready: {\n safety: 'write',\n openWorld: true,\n returns: 'string[]',\n errors: [\n 'ACTION_UNAVAILABLE: the list offers no \"load all ready\".',\n 'ACTION_DISABLED: noReadyInvoices.',\n ],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.loadAllReady',\n description:\n 'Hand every invoice that is ready to load to the host, which loads it into the warehouse. Returns the ids sent.',\n invoke: (handle) => handle.loadAllReady(),\n },\n load_selected: {\n safety: 'write',\n openWorld: true,\n returns: 'string[]',\n errors: [\n 'ACTION_UNAVAILABLE: the list offers no bulk load.',\n 'ACTION_DISABLED: emptySelection.',\n ],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.loadSelected',\n description:\n 'Hand the selected invoices to the host, which loads them into the warehouse. Returns the ids sent.',\n invoke: (handle) => handle.loadSelected(),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'invoice-upload-list',\n description: 'Marks the element as a kit InvoiceUploadList.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from id (default warehouse-invoice-upload-list).',\n },\n item: {\n attr: 'data-row-id',\n description:\n 'Opaque invoice id on each row (DataGrid). Act through the handle, not the DOM.',\n },\n },\n};\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: CVA for the root, the cells and the count footer. */\n/* Tokens only, logical properties only. DataGrid owns the table chrome; */\n/* these classes lay out what sits inside one cell. */\n/* -------------------------------------------------------------------- */\n\nimport { cva } from 'class-variance-authority';\n\n/** The root around the DataGrid frame and the count footer. With\n * `height: 'fill'` it is a flex column that fills its flex parent, so the\n * grid becomes the bounded scroll container (virtualised rows). */\nexport const invoiceUploadListVariants = cva('ds:w-full ds:min-w-0', {\n variants: {\n height: {\n auto: 'ds:block',\n fill: 'ds:flex ds:min-h-0 ds:flex-auto ds:flex-col',\n },\n },\n defaultVariants: { height: 'auto' },\n});\n\n/** Lines stacked in one cell (a value and its muted second line). */\nexport const cellStackVariants = cva(\n 'ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]',\n {\n variants: {\n align: { start: 'ds:items-start', end: 'ds:items-end' },\n },\n defaultVariants: { align: 'start' },\n },\n);\n\n/** A muted second line (\"Credit note\"). */\nexport const secondaryTextVariants = cva(\n 'type-meta ds:text-[color:var(--muted-foreground)]',\n);\n\n/** The error message under the Error badge. It wraps: a platform message\n * is a sentence, not a word. */\nexport const errorTextVariants = cva(\n 'type-meta ds:text-[color:var(--destructive)] ds:[overflow-wrap:anywhere]',\n);\n\n/** One line of text that truncates; the full text stays in the DOM. */\nexport const truncatedTextVariants = cva(\n 'ds:block ds:min-w-0 ds:max-w-full ds:truncate',\n);\n\n/** The file name: the row header. */\nexport const fileNameVariants = cva(\n 'ds:block ds:min-w-0 ds:max-w-full ds:truncate ds:font-medium',\n);\n\n/** Digits that line up. */\nexport const figureVariants = cva('ds:tabular-nums');\n\n/** A spinner beside its words. */\nexport const loadingGroupVariants = cva(\n 'ds:inline-flex ds:min-w-0 ds:items-center ds:gap-[var(--spacing-xs)]',\n);\n\n/** The decorative spinner of a loading row. */\nexport const loadingSpinnerVariants = cva('ds:inline-flex ds:shrink-0');\n\n/** The count footer under the grid: counts per status. */\nexport const countsFooterVariants = cva(\n 'type-meta ds:m-0 ds:px-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)] ds:text-[color:var(--muted-foreground)]',\n);\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: public types (warehouse supplier invoices). */\n/* */\n/* Display and emit only. The platform reads the XML, decides the status */\n/* and matches the lines; the kit shows what it is given and reports */\n/* what the person chose. Only ids reach the DOM (`data-row-id`). */\n/* -------------------------------------------------------------------- */\n\nimport type { DecimalString } from '../_shared/decimal';\nimport type {\n WarehouseBadgeVariant,\n WarehouseInvoiceStatus,\n} from '../_shared/warehouse-load';\n\nexport type { DecimalString, WarehouseBadgeVariant, WarehouseInvoiceStatus };\n\n/** Column ids, in display order. `select` is the grid's own checkbox. */\nexport const INVOICE_UPLOAD_LIST_COLUMNS = [\n 'fileName',\n 'supplier',\n 'invoiceNumber',\n 'date',\n 'lineCount',\n 'total',\n 'status',\n 'actions',\n] as const;\nexport type InvoiceUploadListColumnId =\n (typeof INVOICE_UPLOAD_LIST_COLUMNS)[number];\n\n/** Columns the list sorts by. */\nexport const INVOICE_UPLOAD_LIST_SORT_COLUMNS = [\n 'fileName',\n 'supplier',\n 'invoiceNumber',\n 'date',\n 'lineCount',\n 'total',\n 'status',\n] as const satisfies readonly InvoiceUploadListColumnId[];\nexport type InvoiceUploadListSortColumn =\n (typeof INVOICE_UPLOAD_LIST_SORT_COLUMNS)[number];\n\nexport const INVOICE_SUPPLIER_KINDS = ['company', 'person'] as const;\nexport type InvoiceSupplierKind = (typeof INVOICE_SUPPLIER_KINDS)[number];\n\nexport const INVOICE_DOCUMENT_KINDS = ['invoice', 'creditNote'] as const;\nexport type InvoiceDocumentKind = (typeof INVOICE_DOCUMENT_KINDS)[number];\n\n/** One invoice body. A file may hold several, so a file name can repeat. */\nexport interface UploadedInvoice {\n /** The only row value in the DOM (`data-row-id`). Unique per invoice. */\n id: string;\n /** The `InvoiceUpload` file id this invoice came from. */\n fileId: string;\n /** File name as chosen; shown, never parsed. Names the row. */\n fileName: string;\n /** Who issued it. `person` is masked under privacy mode; a company\n * stays visible. `null` when the platform found no supplier. */\n supplier: { name: string; kind: InvoiceSupplierKind } | null;\n invoiceNumber: string | null;\n /** Calendar day `YYYY-MM-DD` of this invoice body; shown in UTC. */\n date: string | null;\n lineCount: number | null;\n /** FatturaPA `ImportoTotaleDocumento` as decimal text (\"1234.50\"). */\n total: DecimalString | null;\n /** ISO 4217 code for `total`. */\n currency: string;\n /** Default `invoice`. A credit note shows a muted \"Credit note\" line. */\n documentKind?: InvoiceDocumentKind;\n status: WarehouseInvoiceStatus;\n /** Platform text for status `error`, already translated. It is host\n * text: under privacy mode it gives way to kit copy on a row whose\n * supplier is a person. */\n error?: string;\n}\n\n/** Error panel copy and retry for `status=\"error\"`. */\nexport interface InvoiceUploadListError {\n title?: string;\n description?: string;\n onRetry?: () => void;\n}\n\nexport interface InvoiceUploadListProps {\n /** Instance id: the saved column state key and `data-component-id`. */\n id?: string;\n invoices: readonly UploadedInvoice[];\n /** `loading` with no invoices shows skeleton rows. Default `ready`. */\n status?: 'ready' | 'loading' | 'error';\n error?: InvoiceUploadListError;\n /** Ids of the selected invoices. Only `readyToLoad` rows are selectable.\n * Checkboxes show when any selection prop or `onLoadSelected` is set. */\n selection?: readonly string[];\n defaultSelection?: readonly string[];\n onSelectionChange?: (ids: string[]) => void;\n /** Row action \"Review\". Disabled, with a reason, on error rows. */\n onReview?: (invoice: UploadedInvoice) => void;\n /** Toolbar \"Load all ready (N)\": every `readyToLoad` invoice that is not\n * already loading, whatever the search or sort. */\n onLoadAllReady?: (ids: string[]) => void;\n /** Bulk action on the selection. */\n onLoadSelected?: (ids: string[]) => void;\n /** Invoices being loaded now: a spinner, and not selectable. */\n loadingIds?: readonly string[];\n /** Hides the supplier of every `person`; companies stay visible. */\n privacyMode?: boolean;\n /** Table caption. Default \"Uploaded invoices\". */\n caption?: string;\n density?: 'default' | 'compact';\n /** `fill` makes the grid the bounded scroll container of a flex column\n * parent (200 invoices virtualise). Default `auto`. */\n height?: 'auto' | 'fill';\n persistColumnState?: boolean;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n}\n\n/* ---------------- the curated handle ---------------- */\n\nexport interface InvoiceUploadListSortEntry {\n colId: InvoiceUploadListSortColumn;\n sort: 'asc' | 'desc';\n}\n\nexport interface InvoiceUploadListFeatureInfo {\n privacyMode: boolean;\n status: 'ready' | 'loading' | 'error';\n selectable: boolean;\n readyCount: number;\n}\n\nexport interface InvoiceUploadListColumnInfo {\n id: InvoiceUploadListColumnId;\n label: string;\n visible: boolean;\n canHide: boolean;\n sortable: boolean;\n masked: boolean;\n}\n\n/** Why Review is off. `error`: the file could not be read. */\nexport type InvoiceUploadReviewDisabledReason = 'error';\n\n/** The agent-safe projection of one row: ids, enums and counts. A supplier\n * name is given only when it is not masked; a host error text is never\n * given (`hasError` instead). */\nexport interface InvoiceUploadRowSummary {\n id: string;\n fileId: string;\n fileName: string;\n status: WarehouseInvoiceStatus;\n supplierKind: InvoiceSupplierKind | null;\n supplierName?: string;\n invoiceNumber: string | null;\n date: string | null;\n lineCount: number | null;\n loading: boolean;\n hasError: boolean;\n selectable: boolean;\n review: 'enabled' | { disabled: InvoiceUploadReviewDisabledReason } | null;\n}\n\n/** The `ref` of InvoiceUploadList. Ids and kit shapes only: never the\n * DataGrid handle, a row object or a DOM node. A refused call throws an\n * Error whose message starts with its code. */\nexport interface InvoiceUploadListHandle {\n getFeatures(): InvoiceUploadListFeatureInfo;\n /** Ids of the rows showing now: the search and filters apply. */\n getRowIds(): string[];\n /** Is this invoice in the list at all, shown or not? */\n hasRow(id: string): boolean;\n getRowSummaries(): InvoiceUploadRowSummary[];\n /** Invoices per status, every status present. */\n getCounts(): Record<WarehouseInvoiceStatus, number>;\n getSelection(): string[];\n setSelection(ids: readonly string[]): void;\n /** Selects every ready, not-loading invoice; returns the selection. */\n selectReady(): string[];\n clearSelection(): void;\n getSort(): InvoiceUploadListSortEntry[];\n setSort(model: readonly InvoiceUploadListSortEntry[]): void;\n getColumns(): InvoiceUploadListColumnInfo[];\n scrollToRow(id: string): void;\n focusRow(id: string): void;\n /** Same host callback as the Review button. */\n review(id: string): void;\n /** Same host callback as \"Load all ready\". Returns the ids sent. */\n loadAllReady(): string[];\n /** Same host callback as the bulk action. Returns the ids sent. */\n loadSelected(): string[];\n}\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: pure helpers shared by the component, the handle */\n/* and the agent projection. No React, no translation. */\n/* -------------------------------------------------------------------- */\n\nimport { FATTURAPA_VALUE, parseDecimal } from '../_shared/decimal';\nimport type { ScaledDecimal } from '../_shared/decimal';\nimport { formatLocale } from '../_shared/intl-locale';\nimport {\n countInvoicesByStatus,\n type WarehouseInvoiceStatus,\n} from '../_shared/warehouse-load';\nimport type {\n InvoiceUploadRowSummary,\n UploadedInvoice,\n InvoiceUploadListSortEntry,\n InvoiceUploadListSortColumn,\n} from './types';\nimport { INVOICE_UPLOAD_LIST_SORT_COLUMNS } from './types';\n\nexport const INVOICE_UPLOAD_LIST_DEFAULT_ID = 'warehouse-invoice-upload-list';\n\n/** Reading order of the statuses: work to do first. Used to sort. */\nexport const INVOICE_STATUS_RANK: Record<WarehouseInvoiceStatus, number> = {\n readyToLoad: 0,\n toReview: 1,\n error: 2,\n alreadyLoaded: 3,\n loaded: 4,\n};\n\n/** Amounts here arrive as decimal text, signed (a credit note is negative),\n * up to 11 integer digits and 8 decimals. `null` when it does not parse. */\nexport function readInvoiceTotal(total: string | null): ScaledDecimal | null {\n if (total === null) return null;\n const parsed = parseDecimal(total, FATTURAPA_VALUE.lineTotal);\n return parsed.ok ? parsed.value : null;\n}\n\n/** Is this supplier masked right now? Only people, only in privacy mode. */\nexport function isSupplierMasked(\n invoice: Pick<UploadedInvoice, 'supplier'>,\n privacyMode: boolean,\n): boolean {\n return privacyMode && invoice.supplier?.kind === 'person';\n}\n\nexport function isPersonSupplier(invoice: UploadedInvoice): boolean {\n return invoice.supplier?.kind === 'person';\n}\n\n/** A row can be ticked when it is ready and not being loaded. */\nexport function isInvoiceSelectable(\n invoice: UploadedInvoice,\n loading: ReadonlySet<string>,\n): boolean {\n return invoice.status === 'readyToLoad' && !loading.has(invoice.id);\n}\n\n/** Ids a \"load all ready\" sends: ready and not already loading, in the\n * order given. */\nexport function readyInvoiceIds(\n invoices: readonly UploadedInvoice[],\n loading: ReadonlySet<string>,\n): string[] {\n return invoices\n .filter((invoice) => isInvoiceSelectable(invoice, loading))\n .map((invoice) => invoice.id);\n}\n\nexport function countByStatus(\n invoices: readonly UploadedInvoice[],\n): Record<WarehouseInvoiceStatus, number> {\n return countInvoicesByStatus(invoices);\n}\n\n/** Row name for row-scoped controls: the file, then the invoice number\n * when the file holds more than one. Not personal data. */\nexport function invoiceRowLabel(invoice: UploadedInvoice): string {\n return invoice.invoiceNumber\n ? `${invoice.fileName} · ${invoice.invoiceNumber}`\n : invoice.fileName;\n}\n\n/** The agent-safe projection of one invoice. */\nexport function summariseInvoice(\n invoice: UploadedInvoice,\n privacyMode: boolean,\n loading: ReadonlySet<string>,\n canReview: boolean,\n): InvoiceUploadRowSummary {\n const masked = isSupplierMasked(invoice, privacyMode);\n const summary: InvoiceUploadRowSummary = {\n id: invoice.id,\n fileId: invoice.fileId,\n fileName: invoice.fileName,\n status: invoice.status,\n supplierKind: invoice.supplier?.kind ?? null,\n invoiceNumber: invoice.invoiceNumber,\n date: invoice.date,\n lineCount: invoice.lineCount,\n loading: loading.has(invoice.id),\n hasError: invoice.status === 'error',\n selectable: isInvoiceSelectable(invoice, loading),\n review: !canReview\n ? null\n : invoice.status === 'error'\n ? { disabled: 'error' }\n : 'enabled',\n };\n if (invoice.supplier && !masked) summary.supplierName = invoice.supplier.name;\n return summary;\n}\n\n/* Building an `Intl.DateTimeFormat` costs far more than using one. */\nconst dayFormatters = new Map<string, Intl.DateTimeFormat>();\nconst CALENDAR_DAY = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\n/** A calendar day `YYYY-MM-DD` in the UI language, medium style, read and\n * formatted in UTC so it never moves with the time zone. Other text is\n * returned as given. */\nexport function formatInvoiceDay(day: string, language: string): string {\n const match = CALENDAR_DAY.exec(day);\n if (!match) return day;\n const [, year, month, date] = match;\n const instant = new Date(\n Date.UTC(Number(year), Number(month) - 1, Number(date)),\n );\n if (Number.isNaN(instant.getTime())) return day;\n const locale = formatLocale(language);\n let formatter = dayFormatters.get(locale);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, {\n dateStyle: 'medium',\n timeZone: 'UTC',\n });\n dayFormatters.set(locale, formatter);\n }\n return formatter.format(instant);\n}\n\nconst SORT_COLUMNS: ReadonlySet<string> = new Set(\n INVOICE_UPLOAD_LIST_SORT_COLUMNS,\n);\n\nexport function isInvoiceSortColumn(\n id: string,\n): id is InvoiceUploadListSortColumn {\n return SORT_COLUMNS.has(id);\n}\n\n/** DataGrid sort entries to the list's own, dropping other columns. */\nexport function toInvoiceSortEntries(\n entries: ReadonlyArray<{ colId: string; sort: 'asc' | 'desc' }>,\n): InvoiceUploadListSortEntry[] {\n const out: InvoiceUploadListSortEntry[] = [];\n for (const entry of entries) {\n if (isInvoiceSortColumn(entry.colId)) {\n out.push({ colId: entry.colId, sort: entry.sort });\n }\n }\n return out;\n}\n\n/** Callbacks the handle and the UI share. */\nexport interface InvoiceUploadListCallbacks {\n onReview?: (invoice: UploadedInvoice) => void;\n onLoadAllReady?: (ids: string[]) => void;\n onLoadSelected?: (ids: string[]) => void;\n}\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: what each cell shows. */\n/* */\n/* Always rendered inside the InvoiceUploadList root through its */\n/* DataGrid. Kit leaves only (Badge, Money, Spinner); no row datum goes */\n/* into an attribute: names are text. */\n/* -------------------------------------------------------------------- */\n\nimport { useTranslation } from 'react-i18next';\nimport { Check } from 'lucide-react';\n\nimport { Badge } from '../badge/badge';\nimport { Money } from '../money/money';\nimport { Spinner } from '../spinner/spinner';\nimport { formatNumber } from '../_shared/format-number';\nimport { WAREHOUSE_INVOICE_STATUS_COPY } from '../_shared/warehouse-load';\nimport {\n cellStackVariants,\n errorTextVariants,\n figureVariants,\n fileNameVariants,\n loadingGroupVariants,\n loadingSpinnerVariants,\n secondaryTextVariants,\n truncatedTextVariants,\n} from './invoice-upload-list.variants';\nimport { formatInvoiceDay, isPersonSupplier, readInvoiceTotal } from './model';\nimport type { UploadedInvoice } from './types';\n\nexport function FileNameCell({ invoice }: { invoice: UploadedInvoice }) {\n return (\n <span dir=\"auto\" className={fileNameVariants()}>\n {invoice.fileName}\n </span>\n );\n}\n\nfunction NotFound() {\n const { t } = useTranslation('ui');\n return (\n <span className={secondaryTextVariants()}>\n {t('invoiceUploadList.cell.notFound', 'Not found')}\n </span>\n );\n}\n\n/** Never rendered for a masked cell: under privacy mode DataGrid shows its\n * mask instead. */\nexport function SupplierCell({ invoice }: { invoice: UploadedInvoice }) {\n if (invoice.supplier === null) return <NotFound />;\n return (\n <span dir=\"auto\" className={truncatedTextVariants()}>\n {invoice.supplier.name}\n </span>\n );\n}\n\nexport function InvoiceNumberCell({ invoice }: { invoice: UploadedInvoice }) {\n const { t } = useTranslation('ui');\n if (invoice.invoiceNumber === null) return <NotFound />;\n return (\n <span className={cellStackVariants()}>\n <span dir=\"auto\" className={truncatedTextVariants()}>\n {invoice.invoiceNumber}\n </span>\n {invoice.documentKind === 'creditNote' ? (\n <span className={secondaryTextVariants()}>\n {t('invoiceUploadList.documentKind.creditNote', 'Credit note')}\n </span>\n ) : null}\n </span>\n );\n}\n\nexport function DateCell({ invoice }: { invoice: UploadedInvoice }) {\n const { i18n } = useTranslation('ui');\n if (invoice.date === null) return <NotFound />;\n return <>{formatInvoiceDay(invoice.date, i18n.language)}</>;\n}\n\nexport function LineCountCell({ invoice }: { invoice: UploadedInvoice }) {\n const { i18n } = useTranslation('ui');\n if (invoice.lineCount === null) return <NotFound />;\n return (\n <span className={figureVariants()}>\n {formatNumber(invoice.lineCount, i18n.language)}\n </span>\n );\n}\n\n/** Money on its exact decimal path. Text that does not parse shows as\n * written, never as a rounded figure. */\nexport function TotalCell({ invoice }: { invoice: UploadedInvoice }) {\n if (invoice.total === null) return <NotFound />;\n const amount = readInvoiceTotal(invoice.total);\n if (!amount) {\n return (\n <span dir=\"ltr\" className={figureVariants()}>\n {invoice.total.trim()}\n </span>\n );\n }\n return (\n <Money\n size=\"sm\"\n value={amount.units}\n scale={amount.scale}\n currency={invoice.currency}\n minimumFractionDigits={Math.min(2, amount.scale)}\n maximumFractionDigits={Math.max(2, amount.scale)}\n />\n );\n}\n\nexport interface StatusCellProps {\n invoice: UploadedInvoice;\n loading: boolean;\n privacyMode: boolean;\n}\n\n/**\n * The status badge. An error row shows its message as a second line and\n * blocks nothing else. A loading row shows a spinner with its words in\n * place of the badge. Under privacy mode a person-supplier row never shows\n * the host's error text (it may name the person); kit copy stands in.\n */\nexport function StatusCell({ invoice, loading, privacyMode }: StatusCellProps) {\n const { t } = useTranslation('ui');\n if (loading) {\n const label = t('invoiceUploadList.loading', 'Loading');\n return (\n <span className={loadingGroupVariants()}>\n {/* decorative: a live region per loading row would chatter */}\n <span aria-hidden=\"true\" className={loadingSpinnerVariants()}>\n <Spinner size=\"sm\" label={label} />\n </span>\n <span>{label}</span>\n </span>\n );\n }\n const copy = WAREHOUSE_INVOICE_STATUS_COPY[invoice.status];\n let message: string | null = null;\n if (invoice.status === 'error') {\n message =\n privacyMode && isPersonSupplier(invoice)\n ? t(\n 'invoiceUploadList.errorHidden',\n 'This file could not be read (details hidden in privacy mode)',\n )\n : (invoice.error ?? null);\n }\n return (\n <span className={cellStackVariants()}>\n <Badge\n size=\"sm\"\n variant={copy.variant}\n withDot={!copy.check}\n leading={copy.check ? <Check aria-hidden=\"true\" /> : undefined}\n >\n {t(copy.key, copy.en)}\n </Badge>\n {message ? (\n <span dir=\"auto\" className={errorTextVariants()}>\n {message}\n </span>\n ) : null}\n </span>\n );\n}\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: the column definitions on the DataGrid column API. */\n/* */\n/* Client mode: sorting, search and the status filter run in the grid. */\n/* The file name is the row header. Widths are initial px; tiers show a */\n/* column from 640, 900 or 1,200 px of grid width, and a user's own */\n/* choice in ColumnToggle always wins. Only `invoice.id` reaches the DOM. */\n/* -------------------------------------------------------------------- */\n\nimport { createElement, useMemo, type MutableRefObject } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { ScanSearch } from 'lucide-react';\n\nimport type { DataGridColumn, DataGridOption } from '../data-grid/types';\nimport { RowActions, type RowActionDef } from '../row-actions/row-actions';\nimport { VisuallyHidden } from '../visually-hidden/visually-hidden';\nimport {\n WAREHOUSE_INVOICE_STATUSES,\n WAREHOUSE_INVOICE_STATUS_COPY,\n type WarehouseInvoiceStatus,\n} from '../_shared/warehouse-load';\nimport {\n DateCell,\n FileNameCell,\n InvoiceNumberCell,\n LineCountCell,\n StatusCell,\n SupplierCell,\n TotalCell,\n} from './cells';\nimport {\n INVOICE_STATUS_RANK,\n isPersonSupplier,\n readInvoiceTotal,\n type InvoiceUploadListCallbacks,\n} from './model';\nimport type { UploadedInvoice } from './types';\nimport { decimalToNumber } from '../_shared/decimal';\n\n/** The Review row action: one inline button, off on an error row. */\nexport function useInvoiceRowActions(\n callbacksRef: MutableRefObject<InvoiceUploadListCallbacks>,\n available: boolean,\n): RowActionDef<UploadedInvoice>[] {\n const { t } = useTranslation('ui');\n return useMemo(() => {\n if (!available) return [];\n return [\n {\n // Developer constant: React key and `data-action-id`.\n id: 'review',\n icon: createElement(ScanSearch, { 'aria-hidden': true }),\n label: t('invoiceUploadList.action.review', 'Review'),\n onClick: (invoice) => callbacksRef.current.onReview?.(invoice),\n disabled: (invoice) => invoice.status === 'error',\n disabledReason: (invoice) =>\n invoice.status === 'error'\n ? t(\n 'invoiceUploadList.action.reviewDisabledError',\n 'This file has an error, so there is nothing to review',\n )\n : undefined,\n },\n ];\n }, [t, callbacksRef, available]);\n}\n\nexport interface UseInvoiceUploadListColumnsOptions {\n privacyMode: boolean;\n loadingIds: ReadonlySet<string>;\n rowActions: readonly RowActionDef<UploadedInvoice>[];\n}\n\nexport function useInvoiceUploadListColumns({\n privacyMode,\n loadingIds,\n rowActions,\n}: UseInvoiceUploadListColumnsOptions): DataGridColumn<UploadedInvoice>[] {\n const { t } = useTranslation('ui');\n\n return useMemo(() => {\n const statusLabel = (status: WarehouseInvoiceStatus): string => {\n const copy = WAREHOUSE_INVOICE_STATUS_COPY[status];\n return t(copy.key, copy.en);\n };\n const statusOptions: DataGridOption[] = WAREHOUSE_INVOICE_STATUSES.map(\n (status) => ({ value: status, label: statusLabel(status) }),\n );\n const actionsLabel = t('dataTable.actions', 'Actions');\n\n const columns: DataGridColumn<UploadedInvoice>[] = [\n {\n id: 'fileName',\n header: t('invoiceUploadList.column.fileName', 'File'),\n rowHeader: true,\n pin: 'start',\n hideable: false,\n reorderable: false,\n pinnable: false,\n size: 240,\n minSize: 160,\n value: (invoice) => invoice.fileName,\n exportValue: (invoice) => invoice.fileName,\n sort: 'text',\n cell: (invoice) => <FileNameCell invoice={invoice} />,\n },\n {\n id: 'supplier',\n header: t('invoiceUploadList.column.supplier', 'Supplier'),\n size: 240,\n minSize: 160,\n value: (invoice) => invoice.supplier?.name ?? null,\n // Off while privacy mode is on: the whole column leaves sorting.\n sort: 'text',\n // People are masked; companies stay visible.\n privacy: { mode: 'mask', appliesTo: isPersonSupplier },\n cell: (invoice) => <SupplierCell invoice={invoice} />,\n },\n {\n id: 'invoiceNumber',\n header: t('invoiceUploadList.column.invoiceNumber', 'Invoice number'),\n size: 160,\n responsiveTier: 1,\n value: (invoice) => invoice.invoiceNumber,\n exportValue: (invoice) => invoice.invoiceNumber,\n sort: 'text',\n cell: (invoice) => <InvoiceNumberCell invoice={invoice} />,\n },\n {\n id: 'date',\n header: t('invoiceUploadList.column.date', 'Date'),\n size: 128,\n responsiveTier: 1,\n // A calendar day `YYYY-MM-DD`; DataGrid formats it for export.\n value: (invoice) => invoice.date,\n sort: 'date',\n sortDescFirst: true,\n search: false,\n cell: (invoice) => <DateCell invoice={invoice} />,\n },\n {\n id: 'lineCount',\n header: t('invoiceUploadList.column.lineCount', 'Lines'),\n align: 'end',\n size: 96,\n responsiveTier: 2,\n value: (invoice) => invoice.lineCount,\n sort: 'number',\n sortDescFirst: true,\n search: false,\n cell: (invoice) => <LineCountCell invoice={invoice} />,\n },\n {\n id: 'total',\n header: t('invoiceUploadList.column.total', 'Total'),\n align: 'end',\n size: 136,\n responsiveTier: 1,\n value: (invoice) => {\n const amount = readInvoiceTotal(invoice.total);\n return amount ? decimalToNumber(amount) : null;\n },\n exportValue: (invoice) => invoice.total,\n sort: 'number',\n sortDescFirst: true,\n search: false,\n cell: (invoice) => <TotalCell invoice={invoice} />,\n },\n {\n id: 'status',\n header: t('invoiceUploadList.column.status', 'Status'),\n size: 224,\n minSize: 160,\n wrap: true,\n value: (invoice) => invoice.status,\n exportValue: (invoice) => statusLabel(invoice.status),\n // Work to do first: ready, to review, error, then the rest.\n sort: (a, b) =>\n INVOICE_STATUS_RANK[a.status] - INVOICE_STATUS_RANK[b.status],\n filter: { kind: 'select', options: statusOptions },\n search: false,\n cell: (invoice) => (\n <StatusCell\n invoice={invoice}\n loading={loadingIds.has(invoice.id)}\n privacyMode={privacyMode}\n />\n ),\n },\n {\n id: 'actions',\n header: <VisuallyHidden>{actionsLabel}</VisuallyHidden>,\n headerLabel: actionsLabel,\n pin: 'end',\n size: 120,\n hideable: false,\n reorderable: false,\n pinnable: false,\n resizable: false,\n exportable: false,\n printable: false,\n search: false,\n // Kit RowActions, named by reference (\"Actions, invoice.xml\"),\n // never by row data in an attribute.\n cell: (invoice, context) => (\n <RowActions\n row={invoice}\n actions={rowActions}\n aria-labelledby={context.inputLabelledBy}\n />\n ),\n },\n ];\n return columns;\n }, [t, privacyMode, loadingIds, rowActions]);\n}\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: the curated handle (`ref`). */\n/* */\n/* Built over the inner DataGrid's handle and the props of the last */\n/* render. It hands out ids and kit shapes only: never the DataGrid */\n/* handle, a TanStack object, a row object or a DOM node. Review and */\n/* load call the same host callbacks as the UI, after the same checks; */\n/* a refused call throws an Error whose message starts with its code. */\n/* -------------------------------------------------------------------- */\n\nimport type { DataGridHandle } from '../data-grid/types';\nimport {\n countByStatus,\n isInvoiceSortColumn,\n readyInvoiceIds,\n summariseInvoice,\n toInvoiceSortEntries,\n type InvoiceUploadListCallbacks,\n} from './model';\nimport {\n INVOICE_UPLOAD_LIST_COLUMNS,\n type InvoiceUploadListColumnId,\n type InvoiceUploadListColumnInfo,\n type InvoiceUploadListFeatureInfo,\n type InvoiceUploadListHandle,\n type UploadedInvoice,\n} from './types';\n\n/** What the handle reads from the last render. */\nexport interface InvoiceUploadListLive {\n invoices: readonly UploadedInvoice[];\n callbacks: InvoiceUploadListCallbacks;\n loadingIds: ReadonlySet<string>;\n privacyMode: boolean;\n status: InvoiceUploadListFeatureInfo['status'];\n selectable: boolean;\n}\n\ntype InvoiceUploadListHandleErrorCode =\n | 'UNKNOWN_ROW'\n | 'ROW_FILTERED_OUT'\n | 'ACTION_UNAVAILABLE'\n | 'ACTION_DISABLED';\n\nfunction refuse(code: InvoiceUploadListHandleErrorCode, detail: string): never {\n throw new Error(`${code}: ${detail}`);\n}\n\nconst COLUMN_IDS: ReadonlySet<string> = new Set(INVOICE_UPLOAD_LIST_COLUMNS);\n\nfunction isColumnId(id: string): id is InvoiceUploadListColumnId {\n return COLUMN_IDS.has(id);\n}\n\nexport function createInvoiceUploadListHandle(\n gridRef: { readonly current: DataGridHandle | null },\n liveRef: { readonly current: InvoiceUploadListLive },\n): InvoiceUploadListHandle {\n const grid = (): DataGridHandle | null => gridRef.current;\n const live = (): InvoiceUploadListLive => liveRef.current;\n\n function find(id: string): UploadedInvoice {\n const invoice = live().invoices.find((candidate) => candidate.id === id);\n return invoice ?? refuse('UNKNOWN_ROW', `no invoice \"${id}\" in the list.`);\n }\n\n /** The row is in the list and the search and filters leave it showing. */\n function findShown(id: string): UploadedInvoice {\n const invoice = find(id);\n const shown = grid()?.getRowIds();\n if (shown && !shown.includes(id)) {\n refuse(\n 'ROW_FILTERED_OUT',\n `invoice \"${id}\" is hidden by the search or a filter.`,\n );\n }\n return invoice;\n }\n\n function readyIds(): string[] {\n const { invoices, loadingIds } = live();\n return readyInvoiceIds(invoices, loadingIds);\n }\n\n return {\n getFeatures() {\n const { privacyMode, status, selectable } = live();\n return { privacyMode, status, selectable, readyCount: readyIds().length };\n },\n\n getRowIds() {\n return grid()?.getRowIds() ?? live().invoices.map((i) => i.id);\n },\n\n getRowSummaries() {\n const { invoices, privacyMode, loadingIds, callbacks } = live();\n const canReview = Boolean(callbacks.onReview);\n return invoices.map((invoice) =>\n summariseInvoice(invoice, privacyMode, loadingIds, canReview),\n );\n },\n\n getCounts() {\n return countByStatus(live().invoices);\n },\n\n getSelection() {\n return grid()?.getSelection() ?? [];\n },\n\n setSelection(ids) {\n grid()?.setSelection(ids);\n },\n\n selectReady() {\n const handle = grid();\n if (!handle) return [];\n handle.setSelection(readyIds());\n return handle.getSelection();\n },\n\n clearSelection() {\n grid()?.clearSelection();\n },\n\n getSort() {\n return toInvoiceSortEntries(grid()?.getSort() ?? []);\n },\n\n setSort(model) {\n const handle = grid();\n if (!handle) return;\n const masked = new Set(\n handle\n .getColumns()\n .filter((column) => column.masked === true)\n .map((column) => column.id),\n );\n for (const entry of model) {\n if (!isInvoiceSortColumn(entry.colId) || masked.has(entry.colId))\n return;\n }\n handle.setSort(model);\n },\n\n getColumns() {\n const handle = grid();\n if (!handle) return [];\n const { privacyMode } = live();\n const columns: InvoiceUploadListColumnInfo[] = [];\n for (const column of handle.getColumns()) {\n if (!isColumnId(column.id)) continue;\n columns.push({\n id: column.id,\n label: column.label,\n visible: column.visible,\n canHide: column.canHide,\n sortable: column.sortable,\n masked: column.masked ?? (privacyMode && column.id === 'supplier'),\n });\n }\n return columns;\n },\n\n hasRow(id) {\n return live().invoices.some((candidate) => candidate.id === id);\n },\n\n scrollToRow(id) {\n findShown(id);\n grid()?.scrollToRow(id);\n },\n\n focusRow(id) {\n findShown(id);\n grid()?.focusRow(id, 'fileName');\n },\n\n review(id) {\n const invoice = find(id);\n const { callbacks } = live();\n if (!callbacks.onReview) {\n refuse('ACTION_UNAVAILABLE', 'this list offers no review.');\n }\n if (invoice.status === 'error') {\n refuse('ACTION_DISABLED', 'error');\n }\n callbacks.onReview(invoice);\n },\n\n loadAllReady() {\n const { callbacks } = live();\n if (!callbacks.onLoadAllReady) {\n refuse('ACTION_UNAVAILABLE', 'this list offers no \"load all ready\".');\n }\n const ids = readyIds();\n if (ids.length === 0) {\n refuse('ACTION_DISABLED', 'noReadyInvoices');\n }\n callbacks.onLoadAllReady(ids);\n return ids;\n },\n\n loadSelected() {\n const { callbacks } = live();\n if (!callbacks.onLoadSelected) {\n refuse('ACTION_UNAVAILABLE', 'this list offers no bulk load.');\n }\n const ids = grid()?.getSelection() ?? [];\n if (ids.length === 0) {\n refuse('ACTION_DISABLED', 'emptySelection');\n }\n callbacks.onLoadSelected(ids);\n return ids;\n },\n };\n}\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: the uploaded supplier invoices, one row per invoice */\n/* body, on the kit DataGrid in client mode. */\n/* */\n/* Displays and emits. It never reads a file, calls a server or decides */\n/* a status: the platform does, and passes `invoices`. Sorting, search */\n/* and the status filter run in the grid; rows virtualise past 100. Only */\n/* `readyToLoad` rows can be ticked. An error row shows its message and */\n/* blocks nothing. Privacy mode hides person suppliers; companies stay. */\n/* One agent surface per list: `invoiceUploadListAgent` over the curated */\n/* handle; the inner DataGrid registers none. */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { PackagePlus } from 'lucide-react';\n\nimport { useAgentRegistration } from '../../agent';\nimport { Button } from '../button/button';\nimport { VisuallyHidden } from '../visually-hidden/visually-hidden';\nimport { DataGrid } from '../data-grid/data-grid';\nimport { DataGridToolbar } from '../data-grid/toolbar';\nimport type {\n DataGridHandle,\n DataGridRowSelectability,\n} from '../data-grid/types';\nimport { formatNumber } from '../_shared/format-number';\nimport {\n WAREHOUSE_INVOICE_STATUSES,\n WAREHOUSE_INVOICE_STATUS_COPY,\n warehouseInvoiceStatusCountLabel,\n} from '../_shared/warehouse-load';\nimport { invoiceUploadListAgent } from './invoice-upload-list.agent';\nimport {\n countsFooterVariants,\n invoiceUploadListVariants,\n} from './invoice-upload-list.variants';\nimport { useInvoiceRowActions, useInvoiceUploadListColumns } from './columns';\nimport {\n createInvoiceUploadListHandle,\n type InvoiceUploadListLive,\n} from './handle';\nimport {\n INVOICE_UPLOAD_LIST_DEFAULT_ID,\n countByStatus,\n invoiceRowLabel,\n isInvoiceSelectable,\n readyInvoiceIds,\n type InvoiceUploadListCallbacks,\n} from './model';\nimport type {\n InvoiceUploadListHandle,\n InvoiceUploadListProps,\n UploadedInvoice,\n} from './types';\n\nexport type { InvoiceUploadListProps, InvoiceUploadListHandle } from './types';\n\nconst NO_IDS: readonly string[] = [];\nconst getInvoiceId = (invoice: UploadedInvoice): string => invoice.id;\nconst getInvoiceLabel = (invoice: UploadedInvoice): string =>\n invoiceRowLabel(invoice);\n\n/**\n * The uploaded invoices of a warehouse load. Pass `invoices` with the\n * status the platform worked out for each; react to `onReview`,\n * `onLoadAllReady` and `onLoadSelected`. `ref` gives the curated\n * `InvoiceUploadListHandle`.\n */\nexport const InvoiceUploadList = forwardRef<\n InvoiceUploadListHandle,\n InvoiceUploadListProps\n>(function InvoiceUploadList(props, ref) {\n const {\n id = INVOICE_UPLOAD_LIST_DEFAULT_ID,\n invoices,\n status = 'ready',\n error,\n selection,\n defaultSelection,\n onSelectionChange,\n onReview,\n onLoadAllReady,\n onLoadSelected,\n loadingIds = NO_IDS,\n privacyMode = false,\n caption,\n density = 'default',\n height = 'auto',\n persistColumnState = true,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...rest\n } = props;\n\n const { t, i18n } = useTranslation('ui');\n const gridRef = useRef<DataGridHandle | null>(null);\n\n const loadingSet = useMemo(() => new Set(loadingIds), [loadingIds]);\n // Any selection prop turns the checkboxes on, so `defaultSelection` and\n // `onSelectionChange` alone are never silently ignored.\n const selectable =\n Boolean(onLoadSelected) ||\n selection !== undefined ||\n defaultSelection !== undefined ||\n onSelectionChange !== undefined;\n\n /* ---------------- what the handle reads ---------------- */\n\n const noneReadyId = useId();\n const callbacks: InvoiceUploadListCallbacks = {\n onReview,\n onLoadAllReady,\n onLoadSelected,\n };\n // Read when an action runs, so a host's inline functions never rebuild\n // the columns.\n const callbacksRef = useRef(callbacks);\n callbacksRef.current = callbacks;\n\n const live: InvoiceUploadListLive = {\n invoices,\n callbacks,\n loadingIds: loadingSet,\n privacyMode,\n status,\n selectable,\n };\n const liveRef = useRef(live);\n liveRef.current = live;\n\n const [handle] = useState(() =>\n createInvoiceUploadListHandle(gridRef, liveRef),\n );\n useImperativeHandle(ref, () => handle, [handle]);\n // `id` is the instance id. The DataGrid inside gets\n // `registerAgent={false}`, so one list exposes one agent surface.\n useAgentRegistration(invoiceUploadListAgent, handle, id);\n\n /* ---------------- derived ---------------- */\n\n const readyIds = useMemo(\n () => readyInvoiceIds(invoices, loadingSet),\n [invoices, loadingSet],\n );\n const counts = useMemo(() => countByStatus(invoices), [invoices]);\n\n const rowActions = useInvoiceRowActions(callbacksRef, Boolean(onReview));\n const columns = useInvoiceUploadListColumns({\n privacyMode,\n loadingIds: loadingSet,\n rowActions,\n });\n\n const getRowSelectability = useMemo(\n () =>\n (invoice: UploadedInvoice): DataGridRowSelectability => {\n if (isInvoiceSelectable(invoice, loadingSet)) return 'selectable';\n if (loadingSet.has(invoice.id)) {\n return {\n state: 'none',\n reason: t(\n 'invoiceUploadList.selection.loadingReason',\n 'This invoice is being loaded',\n ),\n };\n }\n const reasons = {\n toReview: t(\n 'invoiceUploadList.selection.toReviewReason',\n 'Review this invoice before you load it',\n ),\n alreadyLoaded: t(\n 'invoiceUploadList.selection.alreadyLoadedReason',\n 'This invoice is already in the warehouse',\n ),\n loaded: t(\n 'invoiceUploadList.selection.loadedReason',\n 'This invoice is loaded',\n ),\n error: t(\n 'invoiceUploadList.selection.errorReason',\n 'This file has an error',\n ),\n } as const;\n return {\n state: 'none',\n reason:\n invoice.status === 'readyToLoad'\n ? reasons.toReview\n : reasons[invoice.status],\n };\n },\n [loadingSet, t],\n );\n\n /* The bulk button leaves the toolbar when the selection empties (the\n rows turn to loading). If focus fell to the page, put it on the first\n row that was sent. */\n const keepFocusAfterBulk = (firstId: string | undefined): void => {\n if (!firstId) return;\n requestAnimationFrame(() => {\n const active = document.activeElement;\n if (!active || active === document.body) {\n gridRef.current?.focusRow(firstId, 'fileName');\n }\n });\n };\n\n /* ---------------- toolbar ---------------- */\n\n const statusPills = WAREHOUSE_INVOICE_STATUSES.map((value) => {\n const copy = WAREHOUSE_INVOICE_STATUS_COPY[value];\n return { value, label: t(copy.key, copy.en) };\n });\n\n const toolbar = (\n <DataGridToolbar>\n <DataGridToolbar.FilterBar>\n <DataGridToolbar.QuickSearch\n placeholder={t(\n 'invoiceUploadList.search.placeholder',\n 'Search by file, supplier or invoice number',\n )}\n />\n <DataGridToolbar.FacetFilter\n field=\"status\"\n label={t('invoiceUploadList.column.status', 'Status')}\n options={[\n { value: null, label: t('dataTable.selectFilter.all', 'All') },\n ...statusPills,\n ]}\n />\n <DataGridToolbar.FilterChips />\n </DataGridToolbar.FilterBar>\n <DataGridToolbar.Actions>\n {onLoadSelected ? (\n <DataGridToolbar.BulkAction\n label={t('invoiceUploadList.bulk.loadSelected', 'Load selected')}\n icon={<PackagePlus aria-hidden=\"true\" />}\n onAction={({ selectedRowIds }) => {\n const ids = [...selectedRowIds];\n onLoadSelected(ids);\n keepFocusAfterBulk(ids[0]);\n }}\n />\n ) : null}\n {onLoadAllReady ? (\n <>\n {/* aria-disabled, not disabled: the button keeps focus when the\n last ready invoice starts loading (WCAG 2.4.3). */}\n <Button\n intent=\"primary\"\n size=\"sm\"\n startIcon={<PackagePlus aria-hidden=\"true\" />}\n aria-disabled={readyIds.length === 0 ? true : undefined}\n aria-describedby={readyIds.length === 0 ? noneReadyId : undefined}\n onClick={() => {\n if (readyIds.length === 0) return;\n onLoadAllReady(readyIds);\n }}\n >\n {t(\n 'invoiceUploadList.loadAllReady',\n 'Load all ready ({{countText}})',\n {\n countText: formatNumber(readyIds.length, i18n.language),\n },\n )}\n </Button>\n <VisuallyHidden id={noneReadyId}>\n {t(\n 'invoiceUploadList.loadAllReadyNone',\n 'No invoice is ready to load',\n )}\n </VisuallyHidden>\n </>\n ) : null}\n <DataGridToolbar.ColumnToggle />\n </DataGridToolbar.Actions>\n </DataGridToolbar>\n );\n\n /* ---------------- render ---------------- */\n\n const shownCounts = WAREHOUSE_INVOICE_STATUSES.filter(\n (value) => counts[value] > 0,\n );\n const countLabels = shownCounts.map((value) =>\n warehouseInvoiceStatusCountLabel(t, i18n.language, value, counts[value]),\n );\n\n // One announcement when a load finishes, never row by row. The region is\n // always mounted so the first message is heard.\n const [announcement, setAnnouncement] = useState('');\n const wasLoading = useRef(false);\n const countsSentence = countLabels.join(', ');\n const countsSentenceRef = useRef(countsSentence);\n countsSentenceRef.current = countsSentence;\n const isLoading = loadingSet.size > 0;\n useEffect(() => {\n if (wasLoading.current && !isLoading) {\n setAnnouncement(countsSentenceRef.current);\n }\n wasLoading.current = isLoading;\n }, [isLoading]);\n\n return (\n <div\n data-component=\"invoice-upload-list\"\n data-component-id={id}\n className={invoiceUploadListVariants({ height, className })}\n {...rest}\n >\n <DataGrid<UploadedInvoice>\n ref={gridRef}\n columns={columns}\n rows={invoices}\n getRowId={getInvoiceId}\n caption={caption ?? t('invoiceUploadList.caption', 'Uploaded invoices')}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n /* identity: storage key only; the list is the agent surface */\n gridId={id}\n registerAgent={false}\n persistColumnState={persistColumnState}\n dataMode=\"client\"\n /* selection: ready rows only; survives sorting and search */\n selectionMode={selectable ? 'multiple' : 'none'}\n rowSelection={selection}\n defaultRowSelection={defaultSelection}\n onRowSelectionChange={onSelectionChange}\n getRowSelectability={getRowSelectability}\n selectAllScope=\"all\"\n rangeSelection\n columnResizing\n responsiveColumns\n getRowLabel={getInvoiceLabel}\n rowLabelPrivacySafe\n /* states */\n status={status}\n error={{\n title:\n error?.title ??\n t(\n 'invoiceUploadList.error.title',\n 'The uploaded invoices could not be shown',\n ),\n description: error?.description,\n onRetry: error?.onRetry,\n }}\n empty={{\n title: t('invoiceUploadList.empty.title', 'No invoices uploaded yet'),\n description: t(\n 'invoiceUploadList.empty.description',\n 'Invoices from the files you upload appear here.',\n ),\n noResultsTitle: t(\n 'invoiceUploadList.empty.noResultsTitle',\n 'No invoices match your search',\n ),\n }}\n toolbar={toolbar}\n density={density}\n height={height}\n privacyMode={privacyMode}\n /* every selectability reason is translated kit copy, no row data */\n hostTextPrivacySafe\n />\n {countLabels.length > 0 ? (\n <p className={countsFooterVariants()}>\n {countLabels.map((label, index) => (\n <span key={shownCounts[index]}>\n {index > 0 ? (\n <>\n {' '}\n <span aria-hidden=\"true\">·</span>{' '}\n </>\n ) : null}\n {label}\n </span>\n ))}\n </p>\n ) : null}\n <VisuallyHidden role=\"status\" aria-atomic=\"true\">\n {announcement}\n </VisuallyHidden>\n </div>\n );\n});\n\nInvoiceUploadList.displayName = 'InvoiceUploadList';\n"],"names":["__iconNode","ScanSearch","createLucideIcon","SORT_COLUMNS","refuse","code","detail","knownRow","handle","id","ROW_ID_SCHEMA","invoiceUploadListAgent","args","column","c","invoiceUploadListVariants","cva","cellStackVariants","secondaryTextVariants","errorTextVariants","truncatedTextVariants","fileNameVariants","figureVariants","loadingGroupVariants","loadingSpinnerVariants","countsFooterVariants","INVOICE_UPLOAD_LIST_COLUMNS","INVOICE_UPLOAD_LIST_SORT_COLUMNS","INVOICE_SUPPLIER_KINDS","INVOICE_DOCUMENT_KINDS","INVOICE_UPLOAD_LIST_DEFAULT_ID","INVOICE_STATUS_RANK","readInvoiceTotal","total","parsed","parseDecimal","FATTURAPA_VALUE","isSupplierMasked","invoice","privacyMode","_a","isPersonSupplier","isInvoiceSelectable","loading","readyInvoiceIds","invoices","countByStatus","countInvoicesByStatus","invoiceRowLabel","summariseInvoice","canReview","masked","summary","dayFormatters","CALENDAR_DAY","formatInvoiceDay","day","language","match","year","month","date","instant","locale","formatLocale","formatter","isInvoiceSortColumn","toInvoiceSortEntries","entries","out","entry","FileNameCell","jsx","NotFound","t","useTranslation","SupplierCell","InvoiceNumberCell","jsxs","DateCell","i18n","LineCountCell","TotalCell","amount","Money","StatusCell","label","Spinner","copy","WAREHOUSE_INVOICE_STATUS_COPY","message","Badge","Check","useInvoiceRowActions","callbacksRef","available","useMemo","createElement","_b","useInvoiceUploadListColumns","loadingIds","rowActions","statusLabel","status","statusOptions","WAREHOUSE_INVOICE_STATUSES","actionsLabel","decimalToNumber","a","b","VisuallyHidden","context","RowActions","COLUMN_IDS","isColumnId","createInvoiceUploadListHandle","gridRef","liveRef","grid","live","find","candidate","findShown","shown","readyIds","selectable","i","callbacks","ids","model","columns","NO_IDS","getInvoiceId","getInvoiceLabel","InvoiceUploadList","forwardRef","props","ref","error","selection","defaultSelection","onSelectionChange","onReview","onLoadAllReady","onLoadSelected","caption","density","height","persistColumnState","className","ariaLabel","ariaLabelledBy","ariaDescribedBy","rest","useRef","loadingSet","noneReadyId","useId","useState","useImperativeHandle","useAgentRegistration","counts","getRowSelectability","reasons","keepFocusAfterBulk","firstId","active","statusPills","value","toolbar","DataGridToolbar","PackagePlus","selectedRowIds","Fragment","Button","formatNumber","shownCounts","countLabels","warehouseInvoiceStatusCountLabel","announcement","setAnnouncement","wasLoading","countsSentence","countsSentenceRef","isLoading","useEffect","DataGrid","index"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,0BAA0B,KAAK,SAAQ,CAAE;AAAA,EACvD,CAAC,QAAQ,EAAE,GAAG,2BAA2B,KAAK,SAAQ,CAAE;AAAA,EACxD,CAAC,QAAQ,EAAE,GAAG,6BAA6B,KAAK,SAAQ,CAAE;AAAA,EAC1D,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,UAAU;AAAA,EACxD,CAAC,QAAQ,EAAE,GAAG,kBAAkB,KAAK,SAAQ,CAAE;AACjD,GACMC,KAAaC,GAAiB,eAAeF,EAAU,GCYvDG,KAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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a7B;AAAA,YACb,qBAAmB;AAAA,YAEnB,QAAA9B;AAAA,YACA,OAAO;AAAA,cACL,QACEmC,KAAA,gBAAAA,EAAO,UACPhE;AAAA,gBACE;AAAA,gBACA;AAAA,cAAA;AAAA,cAEJ,aAAagE,KAAA,gBAAAA,EAAO;AAAA,cACpB,SAASA,KAAA,gBAAAA,EAAO;AAAA,YAAA;AAAA,YAElB,OAAO;AAAA,cACL,OAAOhE,EAAE,iCAAiC,0BAA0B;AAAA,cACpE,aAAaA;AAAA,gBACX;AAAA,gBACA;AAAA,cAAA;AAAA,cAEF,gBAAgBA;AAAA,gBACd;AAAA,gBACA;AAAA,cAAA;AAAA,YACF;AAAA,YAEF,SAAA+F;AAAA,YACA,SAAAvB;AAAA,YACA,QAAAC;AAAA,YACA,aAAA5G;AAAA,YAEA,qBAAmB;AAAA,UAAA;AAAA,QAAA;AAAA,QAEpB0I,EAAY,SAAS,IACpB,gBAAAzG,EAAC,OAAE,WAAW/C,GAAA,GACX,UAAAwJ,EAAY,IAAI,CAAC3F,GAAOqG,wBACtB,QAAA,EACE,UAAA;AAAA,UAAAA,IAAQ,IACP,gBAAA7G,EAAA+F,GAAA,EACG,UAAA;AAAA,YAAA;AAAA,YACD,gBAAArG,EAAC,QAAA,EAAK,eAAY,QAAO,UAAA,KAAC;AAAA,YAAQ;AAAA,UAAA,EAAA,CACpC,IACE;AAAA,UACHc;AAAA,QAAA,EAAA,GAPQ0F,EAAYW,CAAK,CAQ5B,CACD,GACH,IACE;AAAA,0BACH7E,GAAA,EAAe,MAAK,UAAS,eAAY,QACvC,UAAAqE,GAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AAED7C,GAAkB,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"invoice-upload-list-C95s5Q7m.js","sources":["../../node_modules/lucide-react/dist/esm/icons/scan-search.mjs","../../src/components/invoice-upload-list/invoice-upload-list.agent.ts","../../src/components/invoice-upload-list/invoice-upload-list.variants.ts","../../src/components/invoice-upload-list/types.ts","../../src/components/invoice-upload-list/model.ts","../../src/components/invoice-upload-list/cells.tsx","../../src/components/invoice-upload-list/columns.tsx","../../src/components/invoice-upload-list/handle.ts","../../src/components/invoice-upload-list/invoice-upload-list.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 7V5a2 2 0 0 1 2-2h2\", key: \"aa7l1z\" }],\n [\"path\", { d: \"M17 3h2a2 2 0 0 1 2 2v2\", key: \"4qcy5o\" }],\n [\"path\", { d: \"M21 17v2a2 2 0 0 1-2 2h-2\", key: \"6vwrx8\" }],\n [\"path\", { d: \"M7 21H5a2 2 0 0 1-2-2v-2\", key: \"ioqczr\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }],\n [\"path\", { d: \"m16 16-1.9-1.9\", key: \"1dq9hf\" }]\n];\nconst ScanSearch = createLucideIcon(\"scan-search\", __iconNode);\n\nexport { __iconNode, ScanSearch as default };\n//# sourceMappingURL=scan-search.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter: InvoiceUploadList. */\n/* */\n/* Works against the curated `InvoiceUploadListHandle`: ids and kit */\n/* shapes only, never the DataGrid handle, a TanStack object, a row */\n/* object or a DOM node. It is the list's only agent surface: the */\n/* DataGrid inside registers none (`registerAgent={false}`). */\n/* */\n/* Safety: selecting, sorting and scrolling change the view (`read`). */\n/* Review opens the host's review dialog and changes nothing by itself */\n/* (`read` + `openWorld`). Load all ready and Load selected hand invoices */\n/* to the host, which loads them into the warehouse (`write` + */\n/* `openWorld`). Supplier invoices are not patient data. Agent state */\n/* carries no host text: a supplier name is read only when it is not */\n/* masked (a person under privacy mode is not), and an error reads as */\n/* `hasError`, never as the platform's message. */\n/* */\n/* Literal enums, not imports: the catalog build loads this file in plain */\n/* Node, where only type imports are erased. A test keeps the literals */\n/* equal to the constants in types.ts. */\n/* See src/docs/26-agent-readiness.mdx. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type {\n InvoiceUploadListHandle,\n InvoiceUploadListSortEntry,\n} from './types';\n\nconst SORT_COLUMNS = [\n 'fileName',\n 'supplier',\n 'invoiceNumber',\n 'date',\n 'lineCount',\n 'total',\n 'status',\n] as const;\n\ntype InvoiceUploadListAgentErrorCode =\n | 'UNKNOWN_ROW'\n | 'ROW_FILTERED_OUT'\n | 'COLUMN_MASKED'\n | 'SELECTION_DISABLED';\n\nfunction refuse(code: InvoiceUploadListAgentErrorCode, detail: string): never {\n throw new Error(`${code}: ${detail}`);\n}\n\nfunction knownRow(handle: InvoiceUploadListHandle, id: string): void {\n // Every invoice, not only the rows the search and filters leave showing.\n if (!handle.hasRow(id)) {\n refuse('UNKNOWN_ROW', `no invoice \"${id}\" in the list.`);\n }\n}\n\nconst ROW_ID_SCHEMA = {\n type: 'object',\n properties: { id: { type: 'string', description: 'An invoice id (rows).' } },\n required: ['id'],\n additionalProperties: false,\n};\n\nexport const invoiceUploadListAgent: AgentAdapter<InvoiceUploadListHandle> = {\n id: 'invoice-upload-list',\n capabilities: [\n 'select_multiple',\n 'sort',\n 'scroll',\n // review opens the host's review dialog (`open`: a Dialog).\n 'open',\n // load_all_ready and load_selected commit invoices to the warehouse.\n 'submit',\n ],\n state: {\n features: {\n type: '{ privacyMode, status, selectable, readyCount }',\n descriptionKey: 'ui.agent.invoiceUploadList.state.features',\n description:\n 'What the list can do now: privacy mode, loading status, whether rows can be selected, and how many invoices are ready to load.',\n read: (handle) => handle.getFeatures(),\n },\n rows: {\n type: 'Array<{ id, fileId, fileName, status, supplierKind, supplierName?, invoiceNumber, date, lineCount, loading, hasError, selectable, review }>',\n descriptionKey: 'ui.agent.invoiceUploadList.state.rows',\n description:\n 'The uploaded invoices. A supplier name is given only when it is not hidden; a person is never named under privacy mode. An error row reads hasError, not its message.',\n read: (handle) => handle.getRowSummaries(),\n },\n counts: {\n type: 'Record<status, number>',\n descriptionKey: 'ui.agent.invoiceUploadList.state.counts',\n description:\n 'How many invoices have each status: readyToLoad, toReview, alreadyLoaded, loaded and error.',\n read: (handle) => handle.getCounts(),\n },\n selection: {\n type: 'string[]',\n descriptionKey: 'ui.agent.invoiceUploadList.state.selection',\n description: 'Ids of the selected invoices.',\n read: (handle) => handle.getSelection(),\n },\n sort: {\n type: 'Array<{ colId, sort }>',\n descriptionKey: 'ui.agent.invoiceUploadList.state.sort',\n description: 'The active sort.',\n read: (handle) => handle.getSort(),\n },\n columns: {\n type: 'Array<{ id, label, visible, canHide, sortable, masked }>',\n descriptionKey: 'ui.agent.invoiceUploadList.state.columns',\n description: 'The columns, in display order.',\n read: (handle) => handle.getColumns(),\n },\n },\n actions: {\n select_ready: {\n safety: 'read',\n returns: 'string[]',\n idempotent: true,\n errors: ['SELECTION_DISABLED: the list has no selection.'],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.selectReady',\n description:\n 'Select every invoice that is ready to load and not being loaded. Nothing loads until load_selected.',\n invoke: (handle) => {\n if (!handle.getFeatures().selectable) {\n refuse('SELECTION_DISABLED', 'this list has no selection.');\n }\n return handle.selectReady();\n },\n },\n select_rows: {\n safety: 'read',\n argsType: '{ ids: string[] }',\n argsSchema: {\n type: 'object',\n properties: { ids: { type: 'array', items: { type: 'string' } } },\n required: ['ids'],\n additionalProperties: false,\n },\n returns: 'string[]',\n idempotent: true,\n errors: ['SELECTION_DISABLED: the list has no selection.'],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.selectRows',\n description:\n 'Replace the selection with the given invoice ids. Only invoices that are ready to load can be selected; others are ignored.',\n invoke: (handle, args: { ids: string[] }) => {\n if (!handle.getFeatures().selectable) {\n refuse('SELECTION_DISABLED', 'this list has no selection.');\n }\n handle.setSelection(args.ids);\n return handle.getSelection();\n },\n },\n clear_selection: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.invoiceUploadList.actions.clearSelection',\n description: 'Clear the selection.',\n invoke: (handle) => handle.clearSelection(),\n },\n sort_by: {\n safety: 'read',\n argsType:\n '{ colId: \"fileName\" | \"supplier\" | \"invoiceNumber\" | \"date\" | \"lineCount\" | \"total\" | \"status\", sort: \"asc\" | \"desc\" }',\n argsSchema: {\n type: 'object',\n properties: {\n colId: { enum: [...SORT_COLUMNS] },\n sort: { enum: ['asc', 'desc'] },\n },\n required: ['colId', 'sort'],\n additionalProperties: false,\n },\n idempotent: true,\n errors: [\n 'COLUMN_MASKED: supplier cannot be sorted while privacy mode is on.',\n ],\n examples: [{ args: { colId: 'status', sort: 'asc' } }],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.sortBy',\n description: 'Sort the invoices by one column. The selection is kept.',\n invoke: (handle, args: InvoiceUploadListSortEntry) => {\n const column = handle.getColumns().find((c) => c.id === args.colId);\n if (column?.masked) {\n refuse('COLUMN_MASKED', `\"${args.colId}\" is hidden by privacy mode.`);\n }\n handle.setSort([{ colId: args.colId, sort: args.sort }]);\n },\n },\n scroll_to_row: {\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: ROW_ID_SCHEMA,\n idempotent: true,\n errors: [\n 'UNKNOWN_ROW: the id is not in the list.',\n 'ROW_FILTERED_OUT: the search or a filter hides the invoice.',\n ],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.scrollToRow',\n description: 'Scroll one invoice into view.',\n invoke: (handle, args: { id: string }) => {\n knownRow(handle, args.id);\n handle.scrollToRow(args.id);\n },\n },\n open_review: {\n safety: 'read',\n openWorld: true,\n argsType: '{ id: string }',\n argsSchema: ROW_ID_SCHEMA,\n errors: [\n 'UNKNOWN_ROW: the id is not in the list.',\n 'ACTION_UNAVAILABLE: the list offers no review.',\n 'ACTION_DISABLED: error, the file could not be read.',\n ],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.openReview',\n description:\n 'Open one invoice for review. The host shows its lines. Nothing loads until the user confirms there.',\n invoke: (handle, args: { id: string }) => {\n knownRow(handle, args.id);\n handle.review(args.id);\n },\n },\n load_all_ready: {\n safety: 'write',\n openWorld: true,\n returns: 'string[]',\n errors: [\n 'ACTION_UNAVAILABLE: the list offers no \"load all ready\".',\n 'ACTION_DISABLED: noReadyInvoices.',\n ],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.loadAllReady',\n description:\n 'Hand every invoice that is ready to load to the host, which loads it into the warehouse. Returns the ids sent.',\n invoke: (handle) => handle.loadAllReady(),\n },\n load_selected: {\n safety: 'write',\n openWorld: true,\n returns: 'string[]',\n errors: [\n 'ACTION_UNAVAILABLE: the list offers no bulk load.',\n 'ACTION_DISABLED: emptySelection.',\n ],\n descriptionKey: 'ui.agent.invoiceUploadList.actions.loadSelected',\n description:\n 'Hand the selected invoices to the host, which loads them into the warehouse. Returns the ids sent.',\n invoke: (handle) => handle.loadSelected(),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'invoice-upload-list',\n description: 'Marks the element as a kit InvoiceUploadList.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from id (default warehouse-invoice-upload-list).',\n },\n item: {\n attr: 'data-row-id',\n description:\n 'Opaque invoice id on each row (DataGrid). Act through the handle, not the DOM.',\n },\n },\n};\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: CVA for the root, the cells and the count footer. */\n/* Tokens only, logical properties only. DataGrid owns the table chrome; */\n/* these classes lay out what sits inside one cell. */\n/* -------------------------------------------------------------------- */\n\nimport { cva } from 'class-variance-authority';\n\n/** The root around the DataGrid frame and the count footer. With\n * `height: 'fill'` it is a flex column that fills its flex parent, so the\n * grid becomes the bounded scroll container (virtualised rows). */\nexport const invoiceUploadListVariants = cva('ds:w-full ds:min-w-0', {\n variants: {\n height: {\n auto: 'ds:block',\n fill: 'ds:flex ds:min-h-0 ds:flex-auto ds:flex-col',\n },\n },\n defaultVariants: { height: 'auto' },\n});\n\n/** Lines stacked in one cell (a value and its muted second line). */\nexport const cellStackVariants = cva(\n 'ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]',\n {\n variants: {\n align: { start: 'ds:items-start', end: 'ds:items-end' },\n },\n defaultVariants: { align: 'start' },\n },\n);\n\n/** A muted second line (\"Credit note\"). */\nexport const secondaryTextVariants = cva(\n 'type-meta ds:text-[color:var(--muted-foreground)]',\n);\n\n/** The error message under the Error badge. It wraps: a platform message\n * is a sentence, not a word. */\nexport const errorTextVariants = cva(\n 'type-meta ds:text-[color:var(--destructive)] ds:[overflow-wrap:anywhere]',\n);\n\n/** One line of text that truncates; the full text stays in the DOM. */\nexport const truncatedTextVariants = cva(\n 'ds:block ds:min-w-0 ds:max-w-full ds:truncate',\n);\n\n/** The file name: the row header. */\nexport const fileNameVariants = cva(\n 'ds:block ds:min-w-0 ds:max-w-full ds:truncate ds:font-medium',\n);\n\n/** Digits that line up. */\nexport const figureVariants = cva('ds:tabular-nums');\n\n/** A spinner beside its words. */\nexport const loadingGroupVariants = cva(\n 'ds:inline-flex ds:min-w-0 ds:items-center ds:gap-[var(--spacing-xs)]',\n);\n\n/** The decorative spinner of a loading row. */\nexport const loadingSpinnerVariants = cva('ds:inline-flex ds:shrink-0');\n\n/** The count footer under the grid: counts per status. */\nexport const countsFooterVariants = cva(\n 'type-meta ds:m-0 ds:px-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)] ds:text-[color:var(--muted-foreground)]',\n);\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: public types (warehouse supplier invoices). */\n/* */\n/* Display and emit only. The platform reads the XML, decides the status */\n/* and matches the lines; the kit shows what it is given and reports */\n/* what the person chose. Only ids reach the DOM (`data-row-id`). */\n/* -------------------------------------------------------------------- */\n\nimport type { DecimalString } from '../_shared/decimal';\nimport type {\n WarehouseBadgeVariant,\n WarehouseInvoiceStatus,\n} from '../_shared/warehouse-load';\n\nexport type { DecimalString, WarehouseBadgeVariant, WarehouseInvoiceStatus };\n\n/** Column ids, in display order. `select` is the grid's own checkbox. */\nexport const INVOICE_UPLOAD_LIST_COLUMNS = [\n 'fileName',\n 'supplier',\n 'invoiceNumber',\n 'date',\n 'lineCount',\n 'total',\n 'status',\n 'actions',\n] as const;\nexport type InvoiceUploadListColumnId =\n (typeof INVOICE_UPLOAD_LIST_COLUMNS)[number];\n\n/** Columns the list sorts by. */\nexport const INVOICE_UPLOAD_LIST_SORT_COLUMNS = [\n 'fileName',\n 'supplier',\n 'invoiceNumber',\n 'date',\n 'lineCount',\n 'total',\n 'status',\n] as const satisfies readonly InvoiceUploadListColumnId[];\nexport type InvoiceUploadListSortColumn =\n (typeof INVOICE_UPLOAD_LIST_SORT_COLUMNS)[number];\n\nexport const INVOICE_SUPPLIER_KINDS = ['company', 'person'] as const;\nexport type InvoiceSupplierKind = (typeof INVOICE_SUPPLIER_KINDS)[number];\n\nexport const INVOICE_DOCUMENT_KINDS = ['invoice', 'creditNote'] as const;\nexport type InvoiceDocumentKind = (typeof INVOICE_DOCUMENT_KINDS)[number];\n\n/** One invoice body. A file may hold several, so a file name can repeat. */\nexport interface UploadedInvoice {\n /** The only row value in the DOM (`data-row-id`). Unique per invoice. */\n id: string;\n /** The `InvoiceUpload` file id this invoice came from. */\n fileId: string;\n /** File name as chosen; shown, never parsed. Names the row. */\n fileName: string;\n /** Who issued it. `person` is masked under privacy mode; a company\n * stays visible. `null` when the platform found no supplier. */\n supplier: { name: string; kind: InvoiceSupplierKind } | null;\n invoiceNumber: string | null;\n /** Calendar day `YYYY-MM-DD` of this invoice body; shown in UTC. */\n date: string | null;\n lineCount: number | null;\n /** FatturaPA `ImportoTotaleDocumento` as decimal text (\"1234.50\"). */\n total: DecimalString | null;\n /** ISO 4217 code for `total`. */\n currency: string;\n /** Default `invoice`. A credit note shows a muted \"Credit note\" line. */\n documentKind?: InvoiceDocumentKind;\n status: WarehouseInvoiceStatus;\n /** Platform text for status `error`, already translated. It is host\n * text: under privacy mode it gives way to kit copy on a row whose\n * supplier is a person. */\n error?: string;\n}\n\n/** Error panel copy and retry for `status=\"error\"`. */\nexport interface InvoiceUploadListError {\n title?: string;\n description?: string;\n onRetry?: () => void;\n}\n\nexport interface InvoiceUploadListProps {\n /** Instance id: the saved column state key and `data-component-id`. */\n id?: string;\n invoices: readonly UploadedInvoice[];\n /** `loading` with no invoices shows skeleton rows. Default `ready`. */\n status?: 'ready' | 'loading' | 'error';\n error?: InvoiceUploadListError;\n /** Ids of the selected invoices. Only `readyToLoad` rows are selectable.\n * Checkboxes show when any selection prop or `onLoadSelected` is set. */\n selection?: readonly string[];\n defaultSelection?: readonly string[];\n onSelectionChange?: (ids: string[]) => void;\n /** Row action \"Review\". Disabled, with a reason, on error rows. */\n onReview?: (invoice: UploadedInvoice) => void;\n /** Toolbar \"Load all ready (N)\": every `readyToLoad` invoice that is not\n * already loading, whatever the search or sort. */\n onLoadAllReady?: (ids: string[]) => void;\n /** Bulk action on the selection. */\n onLoadSelected?: (ids: string[]) => void;\n /** Invoices being loaded now: a spinner, and not selectable. */\n loadingIds?: readonly string[];\n /** Hides the supplier of every `person`; companies stay visible. */\n privacyMode?: boolean;\n /** Table caption. Default \"Uploaded invoices\". */\n caption?: string;\n density?: 'default' | 'compact';\n /** `fill` makes the grid the bounded scroll container of a flex column\n * parent (200 invoices virtualise). Default `auto`. */\n height?: 'auto' | 'fill';\n persistColumnState?: boolean;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n}\n\n/* ---------------- the curated handle ---------------- */\n\nexport interface InvoiceUploadListSortEntry {\n colId: InvoiceUploadListSortColumn;\n sort: 'asc' | 'desc';\n}\n\nexport interface InvoiceUploadListFeatureInfo {\n privacyMode: boolean;\n status: 'ready' | 'loading' | 'error';\n selectable: boolean;\n readyCount: number;\n}\n\nexport interface InvoiceUploadListColumnInfo {\n id: InvoiceUploadListColumnId;\n label: string;\n visible: boolean;\n canHide: boolean;\n sortable: boolean;\n masked: boolean;\n}\n\n/** Why Review is off. `error`: the file could not be read. */\nexport type InvoiceUploadReviewDisabledReason = 'error';\n\n/** The agent-safe projection of one row: ids, enums and counts. A supplier\n * name is given only when it is not masked; a host error text is never\n * given (`hasError` instead). */\nexport interface InvoiceUploadRowSummary {\n id: string;\n fileId: string;\n fileName: string;\n status: WarehouseInvoiceStatus;\n supplierKind: InvoiceSupplierKind | null;\n supplierName?: string;\n invoiceNumber: string | null;\n date: string | null;\n lineCount: number | null;\n loading: boolean;\n hasError: boolean;\n selectable: boolean;\n review: 'enabled' | { disabled: InvoiceUploadReviewDisabledReason } | null;\n}\n\n/** The `ref` of InvoiceUploadList. Ids and kit shapes only: never the\n * DataGrid handle, a row object or a DOM node. A refused call throws an\n * Error whose message starts with its code. */\nexport interface InvoiceUploadListHandle {\n getFeatures(): InvoiceUploadListFeatureInfo;\n /** Ids of the rows showing now: the search and filters apply. */\n getRowIds(): string[];\n /** Is this invoice in the list at all, shown or not? */\n hasRow(id: string): boolean;\n getRowSummaries(): InvoiceUploadRowSummary[];\n /** Invoices per status, every status present. */\n getCounts(): Record<WarehouseInvoiceStatus, number>;\n getSelection(): string[];\n setSelection(ids: readonly string[]): void;\n /** Selects every ready, not-loading invoice; returns the selection. */\n selectReady(): string[];\n clearSelection(): void;\n getSort(): InvoiceUploadListSortEntry[];\n setSort(model: readonly InvoiceUploadListSortEntry[]): void;\n getColumns(): InvoiceUploadListColumnInfo[];\n scrollToRow(id: string): void;\n focusRow(id: string): void;\n /** Same host callback as the Review button. */\n review(id: string): void;\n /** Same host callback as \"Load all ready\". Returns the ids sent. */\n loadAllReady(): string[];\n /** Same host callback as the bulk action. Returns the ids sent. */\n loadSelected(): string[];\n}\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: pure helpers shared by the component, the handle */\n/* and the agent projection. No React, no translation. */\n/* -------------------------------------------------------------------- */\n\nimport { FATTURAPA_VALUE, parseDecimal } from '../_shared/decimal';\nimport type { ScaledDecimal } from '../_shared/decimal';\nimport { formatLocale } from '../_shared/intl-locale';\nimport {\n countInvoicesByStatus,\n type WarehouseInvoiceStatus,\n} from '../_shared/warehouse-load';\nimport type {\n InvoiceUploadRowSummary,\n UploadedInvoice,\n InvoiceUploadListSortEntry,\n InvoiceUploadListSortColumn,\n} from './types';\nimport { INVOICE_UPLOAD_LIST_SORT_COLUMNS } from './types';\n\nexport const INVOICE_UPLOAD_LIST_DEFAULT_ID = 'warehouse-invoice-upload-list';\n\n/** Reading order of the statuses: work to do first. Used to sort. */\nexport const INVOICE_STATUS_RANK: Record<WarehouseInvoiceStatus, number> = {\n readyToLoad: 0,\n toReview: 1,\n error: 2,\n alreadyLoaded: 3,\n loaded: 4,\n};\n\n/** Amounts here arrive as decimal text, signed (a credit note is negative),\n * up to 11 integer digits and 8 decimals. `null` when it does not parse. */\nexport function readInvoiceTotal(total: string | null): ScaledDecimal | null {\n if (total === null) return null;\n const parsed = parseDecimal(total, FATTURAPA_VALUE.lineTotal);\n return parsed.ok ? parsed.value : null;\n}\n\n/** Is this supplier masked right now? Only people, only in privacy mode. */\nexport function isSupplierMasked(\n invoice: Pick<UploadedInvoice, 'supplier'>,\n privacyMode: boolean,\n): boolean {\n return privacyMode && invoice.supplier?.kind === 'person';\n}\n\nexport function isPersonSupplier(invoice: UploadedInvoice): boolean {\n return invoice.supplier?.kind === 'person';\n}\n\n/** A row can be ticked when it is ready and not being loaded. */\nexport function isInvoiceSelectable(\n invoice: UploadedInvoice,\n loading: ReadonlySet<string>,\n): boolean {\n return invoice.status === 'readyToLoad' && !loading.has(invoice.id);\n}\n\n/** Ids a \"load all ready\" sends: ready and not already loading, in the\n * order given. */\nexport function readyInvoiceIds(\n invoices: readonly UploadedInvoice[],\n loading: ReadonlySet<string>,\n): string[] {\n return invoices\n .filter((invoice) => isInvoiceSelectable(invoice, loading))\n .map((invoice) => invoice.id);\n}\n\nexport function countByStatus(\n invoices: readonly UploadedInvoice[],\n): Record<WarehouseInvoiceStatus, number> {\n return countInvoicesByStatus(invoices);\n}\n\n/** Row name for row-scoped controls: the file, then the invoice number\n * when the file holds more than one. Not personal data. */\nexport function invoiceRowLabel(invoice: UploadedInvoice): string {\n return invoice.invoiceNumber\n ? `${invoice.fileName} · ${invoice.invoiceNumber}`\n : invoice.fileName;\n}\n\n/** The agent-safe projection of one invoice. */\nexport function summariseInvoice(\n invoice: UploadedInvoice,\n privacyMode: boolean,\n loading: ReadonlySet<string>,\n canReview: boolean,\n): InvoiceUploadRowSummary {\n const masked = isSupplierMasked(invoice, privacyMode);\n const summary: InvoiceUploadRowSummary = {\n id: invoice.id,\n fileId: invoice.fileId,\n fileName: invoice.fileName,\n status: invoice.status,\n supplierKind: invoice.supplier?.kind ?? null,\n invoiceNumber: invoice.invoiceNumber,\n date: invoice.date,\n lineCount: invoice.lineCount,\n loading: loading.has(invoice.id),\n hasError: invoice.status === 'error',\n selectable: isInvoiceSelectable(invoice, loading),\n review: !canReview\n ? null\n : invoice.status === 'error'\n ? { disabled: 'error' }\n : 'enabled',\n };\n if (invoice.supplier && !masked) summary.supplierName = invoice.supplier.name;\n return summary;\n}\n\n/* Building an `Intl.DateTimeFormat` costs far more than using one. */\nconst dayFormatters = new Map<string, Intl.DateTimeFormat>();\nconst CALENDAR_DAY = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\n/** A calendar day `YYYY-MM-DD` in the UI language, medium style, read and\n * formatted in UTC so it never moves with the time zone. Other text is\n * returned as given. */\nexport function formatInvoiceDay(day: string, language: string): string {\n const match = CALENDAR_DAY.exec(day);\n if (!match) return day;\n const [, year, month, date] = match;\n const instant = new Date(\n Date.UTC(Number(year), Number(month) - 1, Number(date)),\n );\n if (Number.isNaN(instant.getTime())) return day;\n const locale = formatLocale(language);\n let formatter = dayFormatters.get(locale);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, {\n dateStyle: 'medium',\n timeZone: 'UTC',\n });\n dayFormatters.set(locale, formatter);\n }\n return formatter.format(instant);\n}\n\nconst SORT_COLUMNS: ReadonlySet<string> = new Set(\n INVOICE_UPLOAD_LIST_SORT_COLUMNS,\n);\n\nexport function isInvoiceSortColumn(\n id: string,\n): id is InvoiceUploadListSortColumn {\n return SORT_COLUMNS.has(id);\n}\n\n/** DataGrid sort entries to the list's own, dropping other columns. */\nexport function toInvoiceSortEntries(\n entries: ReadonlyArray<{ colId: string; sort: 'asc' | 'desc' }>,\n): InvoiceUploadListSortEntry[] {\n const out: InvoiceUploadListSortEntry[] = [];\n for (const entry of entries) {\n if (isInvoiceSortColumn(entry.colId)) {\n out.push({ colId: entry.colId, sort: entry.sort });\n }\n }\n return out;\n}\n\n/** Callbacks the handle and the UI share. */\nexport interface InvoiceUploadListCallbacks {\n onReview?: (invoice: UploadedInvoice) => void;\n onLoadAllReady?: (ids: string[]) => void;\n onLoadSelected?: (ids: string[]) => void;\n}\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: what each cell shows. */\n/* */\n/* Always rendered inside the InvoiceUploadList root through its */\n/* DataGrid. Kit leaves only (Badge, Money, Spinner); no row datum goes */\n/* into an attribute: names are text. */\n/* -------------------------------------------------------------------- */\n\nimport { useTranslation } from 'react-i18next';\nimport { Check } from 'lucide-react';\n\nimport { Badge } from '../badge/badge';\nimport { Money } from '../money/money';\nimport { Spinner } from '../spinner/spinner';\nimport { formatNumber } from '../_shared/format-number';\nimport { WAREHOUSE_INVOICE_STATUS_COPY } from '../_shared/warehouse-load';\nimport {\n cellStackVariants,\n errorTextVariants,\n figureVariants,\n fileNameVariants,\n loadingGroupVariants,\n loadingSpinnerVariants,\n secondaryTextVariants,\n truncatedTextVariants,\n} from './invoice-upload-list.variants';\nimport { formatInvoiceDay, isPersonSupplier, readInvoiceTotal } from './model';\nimport type { UploadedInvoice } from './types';\n\nexport function FileNameCell({ invoice }: { invoice: UploadedInvoice }) {\n return (\n <span dir=\"auto\" className={fileNameVariants()}>\n {invoice.fileName}\n </span>\n );\n}\n\nfunction NotFound() {\n const { t } = useTranslation('ui');\n return (\n <span className={secondaryTextVariants()}>\n {t('invoiceUploadList.cell.notFound', 'Not found')}\n </span>\n );\n}\n\n/** Never rendered for a masked cell: under privacy mode DataGrid shows its\n * mask instead. */\nexport function SupplierCell({ invoice }: { invoice: UploadedInvoice }) {\n if (invoice.supplier === null) return <NotFound />;\n return (\n <span dir=\"auto\" className={truncatedTextVariants()}>\n {invoice.supplier.name}\n </span>\n );\n}\n\nexport function InvoiceNumberCell({ invoice }: { invoice: UploadedInvoice }) {\n const { t } = useTranslation('ui');\n if (invoice.invoiceNumber === null) return <NotFound />;\n return (\n <span className={cellStackVariants()}>\n <span dir=\"auto\" className={truncatedTextVariants()}>\n {invoice.invoiceNumber}\n </span>\n {invoice.documentKind === 'creditNote' ? (\n <span className={secondaryTextVariants()}>\n {t('invoiceUploadList.documentKind.creditNote', 'Credit note')}\n </span>\n ) : null}\n </span>\n );\n}\n\nexport function DateCell({ invoice }: { invoice: UploadedInvoice }) {\n const { i18n } = useTranslation('ui');\n if (invoice.date === null) return <NotFound />;\n return <>{formatInvoiceDay(invoice.date, i18n.language)}</>;\n}\n\nexport function LineCountCell({ invoice }: { invoice: UploadedInvoice }) {\n const { i18n } = useTranslation('ui');\n if (invoice.lineCount === null) return <NotFound />;\n return (\n <span className={figureVariants()}>\n {formatNumber(invoice.lineCount, i18n.language)}\n </span>\n );\n}\n\n/** Money on its exact decimal path. Text that does not parse shows as\n * written, never as a rounded figure. */\nexport function TotalCell({ invoice }: { invoice: UploadedInvoice }) {\n if (invoice.total === null) return <NotFound />;\n const amount = readInvoiceTotal(invoice.total);\n if (!amount) {\n return (\n <span dir=\"ltr\" className={figureVariants()}>\n {invoice.total.trim()}\n </span>\n );\n }\n return (\n <Money\n size=\"sm\"\n value={amount.units}\n scale={amount.scale}\n currency={invoice.currency}\n minimumFractionDigits={Math.min(2, amount.scale)}\n maximumFractionDigits={Math.max(2, amount.scale)}\n />\n );\n}\n\nexport interface StatusCellProps {\n invoice: UploadedInvoice;\n loading: boolean;\n privacyMode: boolean;\n}\n\n/**\n * The status badge. An error row shows its message as a second line and\n * blocks nothing else. A loading row shows a spinner with its words in\n * place of the badge. Under privacy mode a person-supplier row never shows\n * the host's error text (it may name the person); kit copy stands in.\n */\nexport function StatusCell({ invoice, loading, privacyMode }: StatusCellProps) {\n const { t } = useTranslation('ui');\n if (loading) {\n const label = t('invoiceUploadList.loading', 'Loading');\n return (\n <span className={loadingGroupVariants()}>\n {/* decorative: a live region per loading row would chatter */}\n <span aria-hidden=\"true\" className={loadingSpinnerVariants()}>\n <Spinner size=\"sm\" label={label} />\n </span>\n <span>{label}</span>\n </span>\n );\n }\n const copy = WAREHOUSE_INVOICE_STATUS_COPY[invoice.status];\n let message: string | null = null;\n if (invoice.status === 'error') {\n message =\n privacyMode && isPersonSupplier(invoice)\n ? t(\n 'invoiceUploadList.errorHidden',\n 'This file could not be read (details hidden in privacy mode)',\n )\n : (invoice.error ?? null);\n }\n return (\n <span className={cellStackVariants()}>\n <Badge\n size=\"sm\"\n variant={copy.variant}\n withDot={!copy.check}\n leading={copy.check ? <Check aria-hidden=\"true\" /> : undefined}\n >\n {t(copy.key, copy.en)}\n </Badge>\n {message ? (\n <span dir=\"auto\" className={errorTextVariants()}>\n {message}\n </span>\n ) : null}\n </span>\n );\n}\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: the column definitions on the DataGrid column API. */\n/* */\n/* Client mode: sorting, search and the status filter run in the grid. */\n/* The file name is the row header. Widths are initial px; tiers show a */\n/* column from 640, 900 or 1,200 px of grid width, and a user's own */\n/* choice in ColumnToggle always wins. Only `invoice.id` reaches the DOM. */\n/* -------------------------------------------------------------------- */\n\nimport { createElement, useMemo, type MutableRefObject } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { ScanSearch } from 'lucide-react';\n\nimport type { DataGridColumn, DataGridOption } from '../data-grid/types';\nimport { RowActions, type RowActionDef } from '../row-actions/row-actions';\nimport { VisuallyHidden } from '../visually-hidden/visually-hidden';\nimport {\n WAREHOUSE_INVOICE_STATUSES,\n WAREHOUSE_INVOICE_STATUS_COPY,\n type WarehouseInvoiceStatus,\n} from '../_shared/warehouse-load';\nimport {\n DateCell,\n FileNameCell,\n InvoiceNumberCell,\n LineCountCell,\n StatusCell,\n SupplierCell,\n TotalCell,\n} from './cells';\nimport {\n INVOICE_STATUS_RANK,\n isPersonSupplier,\n readInvoiceTotal,\n type InvoiceUploadListCallbacks,\n} from './model';\nimport type { UploadedInvoice } from './types';\nimport { decimalToNumber } from '../_shared/decimal';\n\n/** The Review row action: one inline button, off on an error row. */\nexport function useInvoiceRowActions(\n callbacksRef: MutableRefObject<InvoiceUploadListCallbacks>,\n available: boolean,\n): RowActionDef<UploadedInvoice>[] {\n const { t } = useTranslation('ui');\n return useMemo(() => {\n if (!available) return [];\n return [\n {\n // Developer constant: React key and `data-action-id`.\n id: 'review',\n icon: createElement(ScanSearch, { 'aria-hidden': true }),\n label: t('invoiceUploadList.action.review', 'Review'),\n onClick: (invoice) => callbacksRef.current.onReview?.(invoice),\n disabled: (invoice) => invoice.status === 'error',\n disabledReason: (invoice) =>\n invoice.status === 'error'\n ? t(\n 'invoiceUploadList.action.reviewDisabledError',\n 'This file has an error, so there is nothing to review',\n )\n : undefined,\n },\n ];\n }, [t, callbacksRef, available]);\n}\n\nexport interface UseInvoiceUploadListColumnsOptions {\n privacyMode: boolean;\n loadingIds: ReadonlySet<string>;\n rowActions: readonly RowActionDef<UploadedInvoice>[];\n}\n\nexport function useInvoiceUploadListColumns({\n privacyMode,\n loadingIds,\n rowActions,\n}: UseInvoiceUploadListColumnsOptions): DataGridColumn<UploadedInvoice>[] {\n const { t } = useTranslation('ui');\n\n return useMemo(() => {\n const statusLabel = (status: WarehouseInvoiceStatus): string => {\n const copy = WAREHOUSE_INVOICE_STATUS_COPY[status];\n return t(copy.key, copy.en);\n };\n const statusOptions: DataGridOption[] = WAREHOUSE_INVOICE_STATUSES.map(\n (status) => ({ value: status, label: statusLabel(status) }),\n );\n const actionsLabel = t('dataTable.actions', 'Actions');\n\n const columns: DataGridColumn<UploadedInvoice>[] = [\n {\n id: 'fileName',\n header: t('invoiceUploadList.column.fileName', 'File'),\n rowHeader: true,\n pin: 'start',\n hideable: false,\n reorderable: false,\n pinnable: false,\n size: 240,\n minSize: 160,\n value: (invoice) => invoice.fileName,\n exportValue: (invoice) => invoice.fileName,\n sort: 'text',\n cell: (invoice) => <FileNameCell invoice={invoice} />,\n },\n {\n id: 'supplier',\n header: t('invoiceUploadList.column.supplier', 'Supplier'),\n size: 240,\n minSize: 160,\n value: (invoice) => invoice.supplier?.name ?? null,\n // Off while privacy mode is on: the whole column leaves sorting.\n sort: 'text',\n // People are masked; companies stay visible.\n privacy: { mode: 'mask', appliesTo: isPersonSupplier },\n cell: (invoice) => <SupplierCell invoice={invoice} />,\n },\n {\n id: 'invoiceNumber',\n header: t('invoiceUploadList.column.invoiceNumber', 'Invoice number'),\n size: 160,\n responsiveTier: 1,\n value: (invoice) => invoice.invoiceNumber,\n exportValue: (invoice) => invoice.invoiceNumber,\n sort: 'text',\n cell: (invoice) => <InvoiceNumberCell invoice={invoice} />,\n },\n {\n id: 'date',\n header: t('invoiceUploadList.column.date', 'Date'),\n size: 128,\n responsiveTier: 1,\n // A calendar day `YYYY-MM-DD`; DataGrid formats it for export.\n value: (invoice) => invoice.date,\n sort: 'date',\n sortDescFirst: true,\n search: false,\n cell: (invoice) => <DateCell invoice={invoice} />,\n },\n {\n id: 'lineCount',\n header: t('invoiceUploadList.column.lineCount', 'Lines'),\n align: 'end',\n size: 96,\n responsiveTier: 2,\n value: (invoice) => invoice.lineCount,\n sort: 'number',\n sortDescFirst: true,\n search: false,\n cell: (invoice) => <LineCountCell invoice={invoice} />,\n },\n {\n id: 'total',\n header: t('invoiceUploadList.column.total', 'Total'),\n align: 'end',\n size: 136,\n responsiveTier: 1,\n value: (invoice) => {\n const amount = readInvoiceTotal(invoice.total);\n return amount ? decimalToNumber(amount) : null;\n },\n exportValue: (invoice) => invoice.total,\n sort: 'number',\n sortDescFirst: true,\n search: false,\n cell: (invoice) => <TotalCell invoice={invoice} />,\n },\n {\n id: 'status',\n header: t('invoiceUploadList.column.status', 'Status'),\n size: 224,\n minSize: 160,\n wrap: true,\n value: (invoice) => invoice.status,\n exportValue: (invoice) => statusLabel(invoice.status),\n // Work to do first: ready, to review, error, then the rest.\n sort: (a, b) =>\n INVOICE_STATUS_RANK[a.status] - INVOICE_STATUS_RANK[b.status],\n filter: { kind: 'select', options: statusOptions },\n search: false,\n cell: (invoice) => (\n <StatusCell\n invoice={invoice}\n loading={loadingIds.has(invoice.id)}\n privacyMode={privacyMode}\n />\n ),\n },\n {\n id: 'actions',\n header: <VisuallyHidden>{actionsLabel}</VisuallyHidden>,\n headerLabel: actionsLabel,\n pin: 'end',\n size: 120,\n hideable: false,\n reorderable: false,\n pinnable: false,\n resizable: false,\n exportable: false,\n printable: false,\n search: false,\n // Kit RowActions, named by reference (\"Actions, invoice.xml\"),\n // never by row data in an attribute.\n cell: (invoice, context) => (\n <RowActions\n row={invoice}\n actions={rowActions}\n aria-labelledby={context.inputLabelledBy}\n />\n ),\n },\n ];\n return columns;\n }, [t, privacyMode, loadingIds, rowActions]);\n}\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: the curated handle (`ref`). */\n/* */\n/* Built over the inner DataGrid's handle and the props of the last */\n/* render. It hands out ids and kit shapes only: never the DataGrid */\n/* handle, a TanStack object, a row object or a DOM node. Review and */\n/* load call the same host callbacks as the UI, after the same checks; */\n/* a refused call throws an Error whose message starts with its code. */\n/* -------------------------------------------------------------------- */\n\nimport type { DataGridHandle } from '../data-grid/types';\nimport {\n countByStatus,\n isInvoiceSortColumn,\n readyInvoiceIds,\n summariseInvoice,\n toInvoiceSortEntries,\n type InvoiceUploadListCallbacks,\n} from './model';\nimport {\n INVOICE_UPLOAD_LIST_COLUMNS,\n type InvoiceUploadListColumnId,\n type InvoiceUploadListColumnInfo,\n type InvoiceUploadListFeatureInfo,\n type InvoiceUploadListHandle,\n type UploadedInvoice,\n} from './types';\n\n/** What the handle reads from the last render. */\nexport interface InvoiceUploadListLive {\n invoices: readonly UploadedInvoice[];\n callbacks: InvoiceUploadListCallbacks;\n loadingIds: ReadonlySet<string>;\n privacyMode: boolean;\n status: InvoiceUploadListFeatureInfo['status'];\n selectable: boolean;\n}\n\ntype InvoiceUploadListHandleErrorCode =\n | 'UNKNOWN_ROW'\n | 'ROW_FILTERED_OUT'\n | 'ACTION_UNAVAILABLE'\n | 'ACTION_DISABLED';\n\nfunction refuse(code: InvoiceUploadListHandleErrorCode, detail: string): never {\n throw new Error(`${code}: ${detail}`);\n}\n\nconst COLUMN_IDS: ReadonlySet<string> = new Set(INVOICE_UPLOAD_LIST_COLUMNS);\n\nfunction isColumnId(id: string): id is InvoiceUploadListColumnId {\n return COLUMN_IDS.has(id);\n}\n\nexport function createInvoiceUploadListHandle(\n gridRef: { readonly current: DataGridHandle | null },\n liveRef: { readonly current: InvoiceUploadListLive },\n): InvoiceUploadListHandle {\n const grid = (): DataGridHandle | null => gridRef.current;\n const live = (): InvoiceUploadListLive => liveRef.current;\n\n function find(id: string): UploadedInvoice {\n const invoice = live().invoices.find((candidate) => candidate.id === id);\n return invoice ?? refuse('UNKNOWN_ROW', `no invoice \"${id}\" in the list.`);\n }\n\n /** The row is in the list and the search and filters leave it showing. */\n function findShown(id: string): UploadedInvoice {\n const invoice = find(id);\n const shown = grid()?.getRowIds();\n if (shown && !shown.includes(id)) {\n refuse(\n 'ROW_FILTERED_OUT',\n `invoice \"${id}\" is hidden by the search or a filter.`,\n );\n }\n return invoice;\n }\n\n function readyIds(): string[] {\n const { invoices, loadingIds } = live();\n return readyInvoiceIds(invoices, loadingIds);\n }\n\n return {\n getFeatures() {\n const { privacyMode, status, selectable } = live();\n return { privacyMode, status, selectable, readyCount: readyIds().length };\n },\n\n getRowIds() {\n return grid()?.getRowIds() ?? live().invoices.map((i) => i.id);\n },\n\n getRowSummaries() {\n const { invoices, privacyMode, loadingIds, callbacks } = live();\n const canReview = Boolean(callbacks.onReview);\n return invoices.map((invoice) =>\n summariseInvoice(invoice, privacyMode, loadingIds, canReview),\n );\n },\n\n getCounts() {\n return countByStatus(live().invoices);\n },\n\n getSelection() {\n return grid()?.getSelection() ?? [];\n },\n\n setSelection(ids) {\n grid()?.setSelection(ids);\n },\n\n selectReady() {\n const handle = grid();\n if (!handle) return [];\n handle.setSelection(readyIds());\n return handle.getSelection();\n },\n\n clearSelection() {\n grid()?.clearSelection();\n },\n\n getSort() {\n return toInvoiceSortEntries(grid()?.getSort() ?? []);\n },\n\n setSort(model) {\n const handle = grid();\n if (!handle) return;\n const masked = new Set(\n handle\n .getColumns()\n .filter((column) => column.masked === true)\n .map((column) => column.id),\n );\n for (const entry of model) {\n if (!isInvoiceSortColumn(entry.colId) || masked.has(entry.colId))\n return;\n }\n handle.setSort(model);\n },\n\n getColumns() {\n const handle = grid();\n if (!handle) return [];\n const { privacyMode } = live();\n const columns: InvoiceUploadListColumnInfo[] = [];\n for (const column of handle.getColumns()) {\n if (!isColumnId(column.id)) continue;\n columns.push({\n id: column.id,\n label: column.label,\n visible: column.visible,\n canHide: column.canHide,\n sortable: column.sortable,\n masked: column.masked ?? (privacyMode && column.id === 'supplier'),\n });\n }\n return columns;\n },\n\n hasRow(id) {\n return live().invoices.some((candidate) => candidate.id === id);\n },\n\n scrollToRow(id) {\n findShown(id);\n grid()?.scrollToRow(id);\n },\n\n focusRow(id) {\n findShown(id);\n grid()?.focusRow(id, 'fileName');\n },\n\n review(id) {\n const invoice = find(id);\n const { callbacks } = live();\n if (!callbacks.onReview) {\n refuse('ACTION_UNAVAILABLE', 'this list offers no review.');\n }\n if (invoice.status === 'error') {\n refuse('ACTION_DISABLED', 'error');\n }\n callbacks.onReview(invoice);\n },\n\n loadAllReady() {\n const { callbacks } = live();\n if (!callbacks.onLoadAllReady) {\n refuse('ACTION_UNAVAILABLE', 'this list offers no \"load all ready\".');\n }\n const ids = readyIds();\n if (ids.length === 0) {\n refuse('ACTION_DISABLED', 'noReadyInvoices');\n }\n callbacks.onLoadAllReady(ids);\n return ids;\n },\n\n loadSelected() {\n const { callbacks } = live();\n if (!callbacks.onLoadSelected) {\n refuse('ACTION_UNAVAILABLE', 'this list offers no bulk load.');\n }\n const ids = grid()?.getSelection() ?? [];\n if (ids.length === 0) {\n refuse('ACTION_DISABLED', 'emptySelection');\n }\n callbacks.onLoadSelected(ids);\n return ids;\n },\n };\n}\n","/* -------------------------------------------------------------------- */\n/* InvoiceUploadList: the uploaded supplier invoices, one row per invoice */\n/* body, on the kit DataGrid in client mode. */\n/* */\n/* Displays and emits. It never reads a file, calls a server or decides */\n/* a status: the platform does, and passes `invoices`. Sorting, search */\n/* and the status filter run in the grid; rows virtualise past 100. Only */\n/* `readyToLoad` rows can be ticked. An error row shows its message and */\n/* blocks nothing. Privacy mode hides person suppliers; companies stay. */\n/* One agent surface per list: `invoiceUploadListAgent` over the curated */\n/* handle; the inner DataGrid registers none. */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { PackagePlus } from 'lucide-react';\n\nimport { useAgentRegistration } from '../../agent';\nimport { Button } from '../button/button';\nimport { VisuallyHidden } from '../visually-hidden/visually-hidden';\nimport { DataGrid } from '../data-grid/data-grid';\nimport { DataGridToolbar } from '../data-grid/toolbar';\nimport type {\n DataGridHandle,\n DataGridRowSelectability,\n} from '../data-grid/types';\nimport { formatNumber } from '../_shared/format-number';\nimport {\n WAREHOUSE_INVOICE_STATUSES,\n WAREHOUSE_INVOICE_STATUS_COPY,\n warehouseInvoiceStatusCountLabel,\n} from '../_shared/warehouse-load';\nimport { invoiceUploadListAgent } from './invoice-upload-list.agent';\nimport {\n countsFooterVariants,\n invoiceUploadListVariants,\n} from './invoice-upload-list.variants';\nimport { useInvoiceRowActions, useInvoiceUploadListColumns } from './columns';\nimport {\n createInvoiceUploadListHandle,\n type InvoiceUploadListLive,\n} from './handle';\nimport {\n INVOICE_UPLOAD_LIST_DEFAULT_ID,\n countByStatus,\n invoiceRowLabel,\n isInvoiceSelectable,\n readyInvoiceIds,\n type InvoiceUploadListCallbacks,\n} from './model';\nimport type {\n InvoiceUploadListHandle,\n InvoiceUploadListProps,\n UploadedInvoice,\n} from './types';\n\nexport type { InvoiceUploadListProps, InvoiceUploadListHandle } from './types';\n\nconst NO_IDS: readonly string[] = [];\nconst getInvoiceId = (invoice: UploadedInvoice): string => invoice.id;\nconst getInvoiceLabel = (invoice: UploadedInvoice): string =>\n invoiceRowLabel(invoice);\n\n/**\n * The uploaded invoices of a warehouse load. Pass `invoices` with the\n * status the platform worked out for each; react to `onReview`,\n * `onLoadAllReady` and `onLoadSelected`. `ref` gives the curated\n * `InvoiceUploadListHandle`.\n */\nexport const InvoiceUploadList = forwardRef<\n InvoiceUploadListHandle,\n InvoiceUploadListProps\n>(function InvoiceUploadList(props, ref) {\n const {\n id = INVOICE_UPLOAD_LIST_DEFAULT_ID,\n invoices,\n status = 'ready',\n error,\n selection,\n defaultSelection,\n onSelectionChange,\n onReview,\n onLoadAllReady,\n onLoadSelected,\n loadingIds = NO_IDS,\n privacyMode = false,\n caption,\n density = 'default',\n height = 'auto',\n persistColumnState = true,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...rest\n } = props;\n\n const { t, i18n } = useTranslation('ui');\n const gridRef = useRef<DataGridHandle | null>(null);\n\n const loadingSet = useMemo(() => new Set(loadingIds), [loadingIds]);\n // Any selection prop turns the checkboxes on, so `defaultSelection` and\n // `onSelectionChange` alone are never silently ignored.\n const selectable =\n Boolean(onLoadSelected) ||\n selection !== undefined ||\n defaultSelection !== undefined ||\n onSelectionChange !== undefined;\n\n /* ---------------- what the handle reads ---------------- */\n\n const noneReadyId = useId();\n const callbacks: InvoiceUploadListCallbacks = {\n onReview,\n onLoadAllReady,\n onLoadSelected,\n };\n // Read when an action runs, so a host's inline functions never rebuild\n // the columns.\n const callbacksRef = useRef(callbacks);\n callbacksRef.current = callbacks;\n\n const live: InvoiceUploadListLive = {\n invoices,\n callbacks,\n loadingIds: loadingSet,\n privacyMode,\n status,\n selectable,\n };\n const liveRef = useRef(live);\n liveRef.current = live;\n\n const [handle] = useState(() =>\n createInvoiceUploadListHandle(gridRef, liveRef),\n );\n useImperativeHandle(ref, () => handle, [handle]);\n // `id` is the instance id. The DataGrid inside gets\n // `registerAgent={false}`, so one list exposes one agent surface.\n useAgentRegistration(invoiceUploadListAgent, handle, id);\n\n /* ---------------- derived ---------------- */\n\n const readyIds = useMemo(\n () => readyInvoiceIds(invoices, loadingSet),\n [invoices, loadingSet],\n );\n const counts = useMemo(() => countByStatus(invoices), [invoices]);\n\n const rowActions = useInvoiceRowActions(callbacksRef, Boolean(onReview));\n const columns = useInvoiceUploadListColumns({\n privacyMode,\n loadingIds: loadingSet,\n rowActions,\n });\n\n const getRowSelectability = useMemo(\n () =>\n (invoice: UploadedInvoice): DataGridRowSelectability => {\n if (isInvoiceSelectable(invoice, loadingSet)) return 'selectable';\n if (loadingSet.has(invoice.id)) {\n return {\n state: 'none',\n reason: t(\n 'invoiceUploadList.selection.loadingReason',\n 'This invoice is being loaded',\n ),\n };\n }\n const reasons = {\n toReview: t(\n 'invoiceUploadList.selection.toReviewReason',\n 'Review this invoice before you load it',\n ),\n alreadyLoaded: t(\n 'invoiceUploadList.selection.alreadyLoadedReason',\n 'This invoice is already in the warehouse',\n ),\n loaded: t(\n 'invoiceUploadList.selection.loadedReason',\n 'This invoice is loaded',\n ),\n error: t(\n 'invoiceUploadList.selection.errorReason',\n 'This file has an error',\n ),\n } as const;\n return {\n state: 'none',\n reason:\n invoice.status === 'readyToLoad'\n ? reasons.toReview\n : reasons[invoice.status],\n };\n },\n [loadingSet, t],\n );\n\n /* The bulk button leaves the toolbar when the selection empties (the\n rows turn to loading). If focus fell to the page, put it on the first\n row that was sent. */\n const keepFocusAfterBulk = (firstId: string | undefined): void => {\n if (!firstId) return;\n requestAnimationFrame(() => {\n const active = document.activeElement;\n if (!active || active === document.body) {\n gridRef.current?.focusRow(firstId, 'fileName');\n }\n });\n };\n\n /* ---------------- toolbar ---------------- */\n\n const statusPills = WAREHOUSE_INVOICE_STATUSES.map((value) => {\n const copy = WAREHOUSE_INVOICE_STATUS_COPY[value];\n return { value, label: t(copy.key, copy.en) };\n });\n\n const toolbar = (\n <DataGridToolbar>\n <DataGridToolbar.FilterBar>\n <DataGridToolbar.QuickSearch\n placeholder={t(\n 'invoiceUploadList.search.placeholder',\n 'Search by file, supplier or invoice number',\n )}\n />\n <DataGridToolbar.FacetFilter\n field=\"status\"\n label={t('invoiceUploadList.column.status', 'Status')}\n options={[\n { value: null, label: t('dataTable.selectFilter.all', 'All') },\n ...statusPills,\n ]}\n />\n <DataGridToolbar.FilterChips />\n </DataGridToolbar.FilterBar>\n <DataGridToolbar.Actions>\n {onLoadSelected ? (\n <DataGridToolbar.BulkAction\n label={t('invoiceUploadList.bulk.loadSelected', 'Load selected')}\n icon={<PackagePlus aria-hidden=\"true\" />}\n onAction={({ selectedRowIds }) => {\n const ids = [...selectedRowIds];\n onLoadSelected(ids);\n keepFocusAfterBulk(ids[0]);\n }}\n />\n ) : null}\n {onLoadAllReady ? (\n <>\n {/* aria-disabled, not disabled: the button keeps focus when the\n last ready invoice starts loading (WCAG 2.4.3). */}\n <Button\n intent=\"primary\"\n size=\"sm\"\n startIcon={<PackagePlus aria-hidden=\"true\" />}\n aria-disabled={readyIds.length === 0 ? true : undefined}\n aria-describedby={readyIds.length === 0 ? noneReadyId : undefined}\n onClick={() => {\n if (readyIds.length === 0) return;\n onLoadAllReady(readyIds);\n }}\n >\n {t(\n 'invoiceUploadList.loadAllReady',\n 'Load all ready ({{countText}})',\n {\n countText: formatNumber(readyIds.length, i18n.language),\n },\n )}\n </Button>\n <VisuallyHidden id={noneReadyId}>\n {t(\n 'invoiceUploadList.loadAllReadyNone',\n 'No invoice is ready to load',\n )}\n </VisuallyHidden>\n </>\n ) : null}\n <DataGridToolbar.ColumnToggle />\n </DataGridToolbar.Actions>\n </DataGridToolbar>\n );\n\n /* ---------------- render ---------------- */\n\n const shownCounts = WAREHOUSE_INVOICE_STATUSES.filter(\n (value) => counts[value] > 0,\n );\n const countLabels = shownCounts.map((value) =>\n warehouseInvoiceStatusCountLabel(t, i18n.language, value, counts[value]),\n );\n\n // One announcement when a load finishes, never row by row. The region is\n // always mounted so the first message is heard.\n const [announcement, setAnnouncement] = useState('');\n const wasLoading = useRef(false);\n const countsSentence = countLabels.join(', ');\n const countsSentenceRef = useRef(countsSentence);\n countsSentenceRef.current = countsSentence;\n const isLoading = loadingSet.size > 0;\n useEffect(() => {\n if (wasLoading.current && !isLoading) {\n setAnnouncement(countsSentenceRef.current);\n }\n wasLoading.current = isLoading;\n }, [isLoading]);\n\n return (\n <div\n data-component=\"invoice-upload-list\"\n data-component-id={id}\n className={invoiceUploadListVariants({ height, className })}\n {...rest}\n >\n <DataGrid<UploadedInvoice>\n ref={gridRef}\n columns={columns}\n rows={invoices}\n getRowId={getInvoiceId}\n caption={caption ?? t('invoiceUploadList.caption', 'Uploaded invoices')}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n /* identity: storage key only; the list is the agent surface */\n gridId={id}\n registerAgent={false}\n persistColumnState={persistColumnState}\n dataMode=\"client\"\n /* selection: ready rows only; survives sorting and search */\n selectionMode={selectable ? 'multiple' : 'none'}\n rowSelection={selection}\n defaultRowSelection={defaultSelection}\n onRowSelectionChange={onSelectionChange}\n getRowSelectability={getRowSelectability}\n selectAllScope=\"all\"\n rangeSelection\n columnResizing\n responsiveColumns\n getRowLabel={getInvoiceLabel}\n rowLabelPrivacySafe\n /* states */\n status={status}\n error={{\n title:\n error?.title ??\n t(\n 'invoiceUploadList.error.title',\n 'The uploaded invoices could not be shown',\n ),\n description: error?.description,\n onRetry: error?.onRetry,\n }}\n empty={{\n title: t('invoiceUploadList.empty.title', 'No invoices uploaded yet'),\n description: t(\n 'invoiceUploadList.empty.description',\n 'Invoices from the files you upload appear here.',\n ),\n noResultsTitle: t(\n 'invoiceUploadList.empty.noResultsTitle',\n 'No invoices match your search',\n ),\n }}\n toolbar={toolbar}\n density={density}\n height={height}\n privacyMode={privacyMode}\n /* every selectability reason is translated kit copy, no row data */\n hostTextPrivacySafe\n />\n {countLabels.length > 0 ? (\n <p className={countsFooterVariants()}>\n {countLabels.map((label, index) => (\n <span key={shownCounts[index]}>\n {index > 0 ? (\n <>\n {' '}\n <span aria-hidden=\"true\">·</span>{' '}\n </>\n ) : null}\n {label}\n </span>\n ))}\n </p>\n ) : null}\n <VisuallyHidden role=\"status\" aria-atomic=\"true\">\n {announcement}\n </VisuallyHidden>\n </div>\n );\n});\n\nInvoiceUploadList.displayName = 'InvoiceUploadList';\n"],"names":["__iconNode","ScanSearch","createLucideIcon","SORT_COLUMNS","refuse","code","detail","knownRow","handle","id","ROW_ID_SCHEMA","invoiceUploadListAgent","args","column","c","invoiceUploadListVariants","cva","cellStackVariants","secondaryTextVariants","errorTextVariants","truncatedTextVariants","fileNameVariants","figureVariants","loadingGroupVariants","loadingSpinnerVariants","countsFooterVariants","INVOICE_UPLOAD_LIST_COLUMNS","INVOICE_UPLOAD_LIST_SORT_COLUMNS","INVOICE_SUPPLIER_KINDS","INVOICE_DOCUMENT_KINDS","INVOICE_UPLOAD_LIST_DEFAULT_ID","INVOICE_STATUS_RANK","readInvoiceTotal","total","parsed","parseDecimal","FATTURAPA_VALUE","isSupplierMasked","invoice","privacyMode","_a","isPersonSupplier","isInvoiceSelectable","loading","readyInvoiceIds","invoices","countByStatus","countInvoicesByStatus","invoiceRowLabel","summariseInvoice","canReview","masked","summary","dayFormatters","CALENDAR_DAY","formatInvoiceDay","day","language","match","year","month","date","instant","locale","formatLocale","formatter","isInvoiceSortColumn","toInvoiceSortEntries","entries","out","entry","FileNameCell","jsx","NotFound","t","useTranslation","SupplierCell","InvoiceNumberCell","jsxs","DateCell","i18n","LineCountCell","TotalCell","amount","Money","StatusCell","label","Spinner","copy","WAREHOUSE_INVOICE_STATUS_COPY","message","Badge","Check","useInvoiceRowActions","callbacksRef","available","useMemo","createElement","_b","useInvoiceUploadListColumns","loadingIds","rowActions","statusLabel","status","statusOptions","WAREHOUSE_INVOICE_STATUSES","actionsLabel","decimalToNumber","a","b","VisuallyHidden","context","RowActions","COLUMN_IDS","isColumnId","createInvoiceUploadListHandle","gridRef","liveRef","grid","live","find","candidate","findShown","shown","readyIds","selectable","i","callbacks","ids","model","columns","NO_IDS","getInvoiceId","getInvoiceLabel","InvoiceUploadList","forwardRef","props","ref","error","selection","defaultSelection","onSelectionChange","onReview","onLoadAllReady","onLoadSelected","caption","density","height","persistColumnState","className","ariaLabel","ariaLabelledBy","ariaDescribedBy","rest","useRef","loadingSet","noneReadyId","useId","useState","useImperativeHandle","useAgentRegistration","counts","getRowSelectability","reasons","keepFocusAfterBulk","firstId","active","statusPills","value","toolbar","DataGridToolbar","PackagePlus","selectedRowIds","Fragment","Button","formatNumber","shownCounts","countLabels","warehouseInvoiceStatusCountLabel","announcement","setAnnouncement","wasLoading","countsSentence","countsSentenceRef","isLoading","useEffect","DataGrid","index"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,0BAA0B,KAAK,SAAQ,CAAE;AAAA,EACvD,CAAC,QAAQ,EAAE,GAAG,2BAA2B,KAAK,SAAQ,CAAE;AAAA,EACxD,CAAC,QAAQ,EAAE,GAAG,6BAA6B,KAAK,SAAQ,CAAE;AAAA,EAC1D,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,UAAU;AAAA,EACxD,CAAC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AAkB,cAAc;","x_google_ignoreList":[0]}
@@ -1,9 +1,9 @@
1
1
  import { createElement as e } from "react";
2
2
  import { B as i } from "./bmi-calculator-rri5vvMt.js";
3
- import { P as o } from "./pregnancy-dating-BO6diQMZ.js";
3
+ import { P as o } from "./pregnancy-dating-BNI32qNw.js";
4
4
  import { P as r } from "./pregnancy-weight-gain-DkGcEc_l.js";
5
- import { G as c } from "./gestational-age-calculator-Cg4Gq42R.js";
6
- import { C as s } from "./cycle-calculator-C8nWAeTk.js";
5
+ import { G as c } from "./gestational-age-calculator-mB6brTlp.js";
6
+ import { C as s } from "./cycle-calculator-WFhMfJHt.js";
7
7
  import { F as d } from "./fetal-weight-D0KofJJw.js";
8
8
  import { c as n } from "./createLucideIcon-DhHxpK9K.js";
9
9
  import { B as a } from "./baby-Dku-Xvg9.js";
@@ -116,4 +116,4 @@ const h = [
116
116
  export {
117
117
  w as k
118
118
  };
119
- //# sourceMappingURL=kit-extensions-C3oL0WTp.js.map
119
+ //# sourceMappingURL=kit-extensions-DUaIYyMD.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kit-extensions-C3oL0WTp.js","sources":["../../node_modules/lucide-react/dist/esm/icons/calendar-heart.mjs","../../node_modules/lucide-react/dist/esm/icons/scale.mjs","../../node_modules/lucide-react/dist/esm/icons/weight.mjs","../../src/components/rich-text-editor/kit-extensions.ts"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n { d: \"M12.127 22H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5.125\", key: \"vxdnp4\" }\n ],\n [\n \"path\",\n {\n d: \"M14.62 18.8A2.25 2.25 0 1 1 18 15.836a2.25 2.25 0 1 1 3.38 2.966l-2.626 2.856a.998.998 0 0 1-1.507 0z\",\n key: \"15cy7q\"\n }\n ],\n [\"path\", { d: \"M16 2v4\", key: \"4m81vk\" }],\n [\"path\", { d: \"M3 10h18\", key: \"8toen8\" }],\n [\"path\", { d: \"M8 2v4\", key: \"1cmpym\" }]\n];\nconst CalendarHeart = createLucideIcon(\"calendar-heart\", __iconNode);\n\nexport { __iconNode, CalendarHeart as default };\n//# sourceMappingURL=calendar-heart.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 3v18\", key: \"108xh3\" }],\n [\"path\", { d: \"m19 8 3 8a5 5 0 0 1-6 0zV7\", key: \"zcdpyk\" }],\n [\"path\", { d: \"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1\", key: \"1yorad\" }],\n [\"path\", { d: \"m5 8 3 8a5 5 0 0 1-6 0zV7\", key: \"eua70x\" }],\n [\"path\", { d: \"M7 21h10\", key: \"1b0cd5\" }]\n];\nconst Scale = createLucideIcon(\"scale\", __iconNode);\n\nexport { __iconNode, Scale as default };\n//# sourceMappingURL=scale.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"5\", r: \"3\", key: \"rqqgnr\" }],\n [\n \"path\",\n {\n d: \"M6.5 8a2 2 0 0 0-1.905 1.46L2.1 18.5A2 2 0 0 0 4 21h16a2 2 0 0 0 1.925-2.54L19.4 9.5A2 2 0 0 0 17.48 8Z\",\n key: \"56o5sh\"\n }\n ]\n];\nconst Weight = createLucideIcon(\"weight\", __iconNode);\n\nexport { __iconNode, Weight as default };\n//# sourceMappingURL=weight.mjs.map\n","import { createElement } from 'react';\nimport { Baby, CalendarHeart, Heart, Scale, Weight } from 'lucide-react';\nimport { BmiCalculator } from '../bmi-calculator';\nimport { PregnancyDating } from '../pregnancy-dating';\nimport { PregnancyWeightGain } from '../pregnancy-weight-gain';\nimport { GestationalAgeCalculator } from '../gestational-age-calculator';\nimport { CycleCalculator } from '../cycle-calculator';\nimport { FetalWeight } from '../fetal-weight';\nimport type { EditorExtension } from './editor-extensions';\n\n/** Labels are resolved by the editor's useTranslation, including live locale changes. */\nexport const kitEditorExtensions: EditorExtension[] = [\n {\n id: 'bmi-calculator',\n label: 'insert.title.bmi',\n icon: createElement(Weight),\n kind: 'panel',\n source: { kind: 'kit' },\n render: ({ insert }) => createElement(BmiCalculator, { onInsert: insert }),\n },\n {\n id: 'pregnancy-dating',\n label: 'insert.title.pregnancyDating',\n icon: createElement(CalendarHeart),\n kind: 'panel',\n contexts: ['note', 'diagnosis'],\n source: { kind: 'kit' },\n render: ({ insert }) =>\n createElement(PregnancyDating, { onInsert: insert }),\n },\n {\n id: 'pregnancy-weight-gain',\n label: 'insert.title.weightGain',\n icon: createElement(Baby),\n kind: 'panel',\n contexts: ['note', 'diagnosis'],\n source: { kind: 'kit' },\n render: ({ insert }) =>\n createElement(PregnancyWeightGain, { onInsert: insert }),\n },\n {\n id: 'gestational-age-calculator',\n label: 'insert.title.gestationalAge',\n icon: createElement(Baby),\n kind: 'panel',\n contexts: ['note', 'diagnosis'],\n source: { kind: 'kit' },\n render: ({ insert }) =>\n createElement(GestationalAgeCalculator, { onInsert: insert }),\n },\n {\n id: 'cycle-calculator',\n label: 'insert.title.cycle',\n icon: createElement(Heart),\n kind: 'panel',\n contexts: ['note', 'diagnosis'],\n source: { kind: 'kit' },\n render: ({ insert }) =>\n createElement(CycleCalculator, { onInsert: insert }),\n },\n {\n id: 'fetal-weight',\n label: 'insert.title.fetalWeight',\n icon: createElement(Scale),\n kind: 'panel',\n contexts: ['note', 'diagnosis'],\n source: { kind: 'kit' },\n render: ({ insert }) => createElement(FetalWeight, { onInsert: insert }),\n },\n];\n"],"names":["__iconNode","CalendarHeart","createLucideIcon","Scale","Weight","kitEditorExtensions","createElement","insert","BmiCalculator","PregnancyDating","Baby","PregnancyWeightGain","GestationalAgeCalculator","Heart","CycleCalculator","FetalWeight"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA,EAAE,GAAG,qEAAqE,KAAK,SAAQ;AAAA,EAC3F;AAAA,EACE;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,UAAU,KAAK,SAAQ,CAAE;AACzC,GACMC,IAAgBC,EAAiB,kBAAkBF,CAAU;ACzBnE;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,8BAA8B,KAAK,SAAQ,CAAE;AAAA,EAC3D,CAAC,QAAQ,EAAE,GAAG,4CAA4C,KAAK,SAAQ,CAAE;AAAA,EACzE,CAAC,QAAQ,EAAE,GAAG,6BAA6B,KAAK,SAAQ,CAAE;AAAA,EAC1D,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAC3C,GACMG,IAAQD,EAAiB,SAASF,CAAU;AChBlD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,KAAK,GAAG,KAAK,KAAK,UAAU;AAAA,EACvD;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IAC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A,IACN,UAAU,CAAC,QAAQ,WAAW;AAAA,IAC9B,QAAQ,EAAE,MAAM,MAAA;AAAA,IAChB,QAAQ,CAAC,EAAE,QAAAN,EAAA,MACTD,EAAcQ,GAAiB,EAAE,UAAUP,EAAA,CAAQ;AAAA,EAAA;AAAA,EAEvD;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAMD,EAAcH,CAAK;AAAA,IACzB,MAAM;AAAA,IACN,UAAU,CAAC,QAAQ,WAAW;AAAA,IAC9B,QAAQ,EAAE,MAAM,MAAA;AAAA,IAChB,QAAQ,CAAC,EAAE,QAAAI,EAAA,MAAaD,EAAcS,GAAa,EAAE,UAAUR,EAAA,CAAQ;AAAA,EAAA;AAE3E;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"kit-extensions-DUaIYyMD.js","sources":["../../node_modules/lucide-react/dist/esm/icons/calendar-heart.mjs","../../node_modules/lucide-react/dist/esm/icons/scale.mjs","../../node_modules/lucide-react/dist/esm/icons/weight.mjs","../../src/components/rich-text-editor/kit-extensions.ts"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n { d: \"M12.127 22H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5.125\", key: \"vxdnp4\" }\n ],\n [\n \"path\",\n {\n d: \"M14.62 18.8A2.25 2.25 0 1 1 18 15.836a2.25 2.25 0 1 1 3.38 2.966l-2.626 2.856a.998.998 0 0 1-1.507 0z\",\n key: \"15cy7q\"\n }\n ],\n [\"path\", { d: \"M16 2v4\", key: \"4m81vk\" }],\n [\"path\", { d: \"M3 10h18\", key: \"8toen8\" }],\n [\"path\", { d: \"M8 2v4\", key: \"1cmpym\" }]\n];\nconst CalendarHeart = createLucideIcon(\"calendar-heart\", __iconNode);\n\nexport { __iconNode, CalendarHeart as default };\n//# sourceMappingURL=calendar-heart.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 3v18\", key: \"108xh3\" }],\n [\"path\", { d: \"m19 8 3 8a5 5 0 0 1-6 0zV7\", key: \"zcdpyk\" }],\n [\"path\", { d: \"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1\", key: \"1yorad\" }],\n [\"path\", { d: \"m5 8 3 8a5 5 0 0 1-6 0zV7\", key: \"eua70x\" }],\n [\"path\", { d: \"M7 21h10\", key: \"1b0cd5\" }]\n];\nconst Scale = createLucideIcon(\"scale\", __iconNode);\n\nexport { __iconNode, Scale as default };\n//# sourceMappingURL=scale.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"5\", r: \"3\", key: \"rqqgnr\" }],\n [\n \"path\",\n {\n d: \"M6.5 8a2 2 0 0 0-1.905 1.46L2.1 18.5A2 2 0 0 0 4 21h16a2 2 0 0 0 1.925-2.54L19.4 9.5A2 2 0 0 0 17.48 8Z\",\n key: \"56o5sh\"\n }\n ]\n];\nconst Weight = createLucideIcon(\"weight\", __iconNode);\n\nexport { __iconNode, Weight as default };\n//# sourceMappingURL=weight.mjs.map\n","import { createElement } from 'react';\nimport { Baby, CalendarHeart, Heart, Scale, Weight } from 'lucide-react';\nimport { BmiCalculator } from '../bmi-calculator';\nimport { PregnancyDating } from '../pregnancy-dating';\nimport { PregnancyWeightGain } from '../pregnancy-weight-gain';\nimport { GestationalAgeCalculator } from '../gestational-age-calculator';\nimport { CycleCalculator } from '../cycle-calculator';\nimport { FetalWeight } from '../fetal-weight';\nimport type { EditorExtension } from './editor-extensions';\n\n/** Labels are resolved by the editor's useTranslation, including live locale changes. */\nexport const kitEditorExtensions: EditorExtension[] = [\n {\n id: 'bmi-calculator',\n label: 'insert.title.bmi',\n icon: createElement(Weight),\n kind: 'panel',\n source: { kind: 'kit' },\n render: ({ insert }) => createElement(BmiCalculator, { onInsert: insert }),\n },\n {\n id: 'pregnancy-dating',\n label: 'insert.title.pregnancyDating',\n icon: createElement(CalendarHeart),\n kind: 'panel',\n contexts: ['note', 'diagnosis'],\n source: { kind: 'kit' },\n render: ({ insert }) =>\n createElement(PregnancyDating, { onInsert: insert }),\n },\n {\n id: 'pregnancy-weight-gain',\n label: 'insert.title.weightGain',\n icon: createElement(Baby),\n kind: 'panel',\n contexts: ['note', 'diagnosis'],\n source: { kind: 'kit' },\n render: ({ insert }) =>\n createElement(PregnancyWeightGain, { onInsert: insert }),\n },\n {\n id: 'gestational-age-calculator',\n label: 'insert.title.gestationalAge',\n icon: createElement(Baby),\n kind: 'panel',\n contexts: ['note', 'diagnosis'],\n source: { kind: 'kit' },\n render: ({ insert }) =>\n createElement(GestationalAgeCalculator, { onInsert: insert }),\n },\n {\n id: 'cycle-calculator',\n label: 'insert.title.cycle',\n icon: createElement(Heart),\n kind: 'panel',\n contexts: ['note', 'diagnosis'],\n source: { kind: 'kit' },\n render: ({ insert }) =>\n createElement(CycleCalculator, { onInsert: insert }),\n },\n {\n id: 'fetal-weight',\n label: 'insert.title.fetalWeight',\n icon: createElement(Scale),\n kind: 'panel',\n contexts: ['note', 'diagnosis'],\n source: { kind: 'kit' },\n render: ({ insert }) => createElement(FetalWeight, { onInsert: insert }),\n },\n];\n"],"names":["__iconNode","CalendarHeart","createLucideIcon","Scale","Weight","kitEditorExtensions","createElement","insert","BmiCalculator","PregnancyDating","Baby","PregnancyWeightGain","GestationalAgeCalculator","Heart","CycleCalculator","FetalWeight"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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EAEvD;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAMD,EAAcH,CAAK;AAAA,IACzB,MAAM;AAAA,IACN,UAAU,CAAC,QAAQ,WAAW;AAAA,IAC9B,QAAQ,EAAE,MAAM,MAAA;AAAA,IAChB,QAAQ,CAAC,EAAE,QAAAI,EAAA,MAAaD,EAAcS,GAAa,EAAE,UAAUR,EAAA,CAAQ;AAAA,EAAA;AAE3E;","x_google_ignoreList":[0,1,2]}
@@ -1,7 +1,7 @@
1
1
  import { jsx as c, jsxs as z } from "react/jsx-runtime";
2
2
  import { useState as x, useEffect as w, useCallback as ee, useMemo as k, useRef as te } from "react";
3
3
  import { useGridFilter as B } from "ag-grid-react";
4
- import { D as ae } from "./date-range-picker-PTRpDkXT.js";
4
+ import { D as ae } from "./date-range-picker-2Up_FRrM.js";
5
5
  import { f as L, d as le, t as q, b as se, c as oe, g as ie, n as ce, i as ue } from "./export-files-BByoK9Cg.js";
6
6
  import { r as I } from "./data-table-DhYx-hCD.js";
7
7
  import { useTranslation as M } from "react-i18next";
@@ -797,4 +797,4 @@ export {
797
797
  Ce as f,
798
798
  Xe as g
799
799
  };
800
- //# sourceMappingURL=link-cell-renderer-NFNGdAGt.js.map
800
+ //# sourceMappingURL=link-cell-renderer-BEaLczk2.js.map