@eifi1/ui-kit 0.32.2 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. package/README.md +17 -9
  2. package/dist/account/delete-account-setting.d.ts +11 -10
  3. package/dist/account/delete-account-setting.js +2 -1
  4. package/dist/account/delete-account-setting.js.map +1 -1
  5. package/dist/account/email-change-setting.d.ts +5 -0
  6. package/dist/account/email-change-setting.js +4 -3
  7. package/dist/account/email-change-setting.js.map +1 -1
  8. package/dist/account/sessions-setting.d.ts +4 -0
  9. package/dist/account/sessions-setting.js +3 -2
  10. package/dist/account/sessions-setting.js.map +1 -1
  11. package/dist/admin/admin-action-confirm.d.ts +11 -10
  12. package/dist/admin/admin-action-confirm.js.map +1 -1
  13. package/dist/admin/invitations-panel.d.ts +11 -10
  14. package/dist/admin/invitations-panel.js +4 -3
  15. package/dist/admin/invitations-panel.js.map +1 -1
  16. package/dist/admin/plan-change.d.ts +101 -0
  17. package/dist/admin/plan-change.js +210 -0
  18. package/dist/admin/plan-change.js.map +1 -0
  19. package/dist/admin/reviewer-scope-editor.d.ts +11 -10
  20. package/dist/admin/reviewer-scope-editor.js.map +1 -1
  21. package/dist/admin/role-select.d.ts +8 -7
  22. package/dist/admin/role-select.js.map +1 -1
  23. package/dist/admin/transfer-ownership-dialog.d.ts +11 -10
  24. package/dist/admin/user-roster.d.ts +8 -7
  25. package/dist/admin/user-roster.js +2 -2
  26. package/dist/admin/user-roster.js.map +1 -1
  27. package/dist/auth/auth-errors.d.ts +13 -2
  28. package/dist/auth/auth-errors.js +5 -1
  29. package/dist/auth/auth-errors.js.map +1 -1
  30. package/dist/auth/complete-name-dialog.d.ts +4 -1
  31. package/dist/auth/complete-name-dialog.js +2 -1
  32. package/dist/auth/complete-name-dialog.js.map +1 -1
  33. package/dist/auth/register-form.d.ts +11 -10
  34. package/dist/billing/billing-banner.d.ts +14 -11
  35. package/dist/billing/billing-banner.js.map +1 -1
  36. package/dist/billing/billing-labels.d.ts +11 -10
  37. package/dist/billing/billing-labels.js +10 -1
  38. package/dist/billing/billing-labels.js.map +1 -1
  39. package/dist/billing/billing-lock.d.ts +40 -12
  40. package/dist/billing/billing-lock.js +9 -3
  41. package/dist/billing/billing-lock.js.map +1 -1
  42. package/dist/billing/billing-overview.d.ts +155 -0
  43. package/dist/billing/billing-overview.js +2 -0
  44. package/dist/billing/billing-overview.js.map +1 -0
  45. package/dist/billing/billing-standing.d.ts +11 -10
  46. package/dist/billing/checkout-processing.d.ts +218 -0
  47. package/dist/billing/checkout-processing.js +198 -0
  48. package/dist/billing/checkout-processing.js.map +1 -0
  49. package/dist/billing/checkout-return.d.ts +51 -0
  50. package/dist/billing/checkout-return.js +43 -0
  51. package/dist/billing/checkout-return.js.map +1 -0
  52. package/dist/billing/pay-page.d.ts +215 -0
  53. package/dist/billing/pay-page.js +113 -0
  54. package/dist/billing/pay-page.js.map +1 -0
  55. package/dist/billing/plan-card.d.ts +11 -10
  56. package/dist/billing/plan-limit-notice.d.ts +11 -10
  57. package/dist/billing/plan-limit-toast.d.ts +144 -0
  58. package/dist/billing/plan-limit-toast.js +40 -0
  59. package/dist/billing/plan-limit-toast.js.map +1 -0
  60. package/dist/billing/subscription-actions.d.ts +39 -15
  61. package/dist/billing/subscription-actions.js +9 -2
  62. package/dist/billing/subscription-actions.js.map +1 -1
  63. package/dist/billing/subscription-status-chip.d.ts +10 -9
  64. package/dist/bin/eifi1-pay-page.mjs +166 -0
  65. package/dist/chart.d.ts +11 -10
  66. package/dist/components/account-chips.d.ts +6 -1
  67. package/dist/components/account-settings.d.ts +4 -1
  68. package/dist/components/account-settings.js +2 -1
  69. package/dist/components/account-settings.js.map +1 -1
  70. package/dist/components/amount-input.d.ts +11 -10
  71. package/dist/components/autocomplete.d.ts +2 -1
  72. package/dist/components/autocomplete.js +5 -3
  73. package/dist/components/autocomplete.js.map +1 -1
  74. package/dist/components/button-group.d.ts +11 -10
  75. package/dist/components/button-group.js +1 -1
  76. package/dist/components/button-group.js.map +1 -1
  77. package/dist/components/calculator.d.ts +11 -10
  78. package/dist/components/calculator.js +3 -3
  79. package/dist/components/calculator.js.map +1 -1
  80. package/dist/components/checkbox-group.d.ts +2 -1
  81. package/dist/components/checkbox-group.js.map +1 -1
  82. package/dist/components/checkbox.d.ts +2 -1
  83. package/dist/components/checkbox.js.map +1 -1
  84. package/dist/components/chip.d.ts +2 -1
  85. package/dist/components/chip.js +19 -17
  86. package/dist/components/chip.js.map +1 -1
  87. package/dist/components/choice-card.d.ts +3 -1
  88. package/dist/components/choice-card.js +1 -1
  89. package/dist/components/choice-card.js.map +1 -1
  90. package/dist/components/combobox-core.js +2 -1
  91. package/dist/components/combobox-core.js.map +1 -1
  92. package/dist/components/combobox.d.ts +4 -3
  93. package/dist/components/combobox.js +2 -2
  94. package/dist/components/combobox.js.map +1 -1
  95. package/dist/components/confirm-dialog.d.ts +11 -10
  96. package/dist/components/confirm-dialog.js +6 -3
  97. package/dist/components/confirm-dialog.js.map +1 -1
  98. package/dist/components/copy-button.d.ts +12 -11
  99. package/dist/components/country-select.d.ts +2 -1
  100. package/dist/components/country-select.js.map +1 -1
  101. package/dist/components/danger-confirm.d.ts +11 -10
  102. package/dist/components/danger-confirm.js.map +1 -1
  103. package/dist/components/data-table-cells.d.ts +12 -1
  104. package/dist/components/data-table-filter-popover.d.ts +12 -1
  105. package/dist/components/data-table-filters.d.ts +12 -1
  106. package/dist/components/data-table-labels.d.ts +12 -1
  107. package/dist/components/data-table-pagination.d.ts +12 -1
  108. package/dist/components/data-table.d.ts +12 -1
  109. package/dist/components/data-table.js +3 -3
  110. package/dist/components/data-table.js.map +1 -1
  111. package/dist/components/date-picker.js +6 -4
  112. package/dist/components/date-picker.js.map +1 -1
  113. package/dist/components/dropdown.js +9 -1
  114. package/dist/components/dropdown.js.map +1 -1
  115. package/dist/components/entity-combobox.d.ts +3 -2
  116. package/dist/components/entity-combobox.js.map +1 -1
  117. package/dist/components/facing-pair.d.ts +11 -10
  118. package/dist/components/field-parts.d.ts +32 -4
  119. package/dist/components/field-parts.js +54 -19
  120. package/dist/components/field-parts.js.map +1 -1
  121. package/dist/components/file-button.d.ts +11 -10
  122. package/dist/components/file-button.js +3 -2
  123. package/dist/components/file-button.js.map +1 -1
  124. package/dist/components/file-dropzone.d.ts +12 -11
  125. package/dist/components/file-dropzone.js.map +1 -1
  126. package/dist/components/floating-panel.js +5 -5
  127. package/dist/components/floating-panel.js.map +1 -1
  128. package/dist/components/form-actions.d.ts +10 -9
  129. package/dist/components/form-actions.js +3 -3
  130. package/dist/components/form-actions.js.map +1 -1
  131. package/dist/components/full-bleed-dialog.js.map +1 -1
  132. package/dist/components/iban-input.d.ts +11 -10
  133. package/dist/components/inline-edit-field.d.ts +2 -1
  134. package/dist/components/inline-edit-field.js +6 -6
  135. package/dist/components/inline-edit-field.js.map +1 -1
  136. package/dist/components/language-select.d.ts +11 -10
  137. package/dist/components/legal-page.d.ts +11 -10
  138. package/dist/components/legal.d.ts +11 -10
  139. package/dist/components/list.d.ts +2 -1
  140. package/dist/components/list.js +4 -5
  141. package/dist/components/list.js.map +1 -1
  142. package/dist/components/modal.js.map +1 -1
  143. package/dist/components/money-field.d.ts +11 -10
  144. package/dist/components/month-picker.js +54 -44
  145. package/dist/components/month-picker.js.map +1 -1
  146. package/dist/components/multi-entity-combobox.d.ts +3 -2
  147. package/dist/components/multi-entity-combobox.js.map +1 -1
  148. package/dist/components/number-field.d.ts +18 -10
  149. package/dist/components/number-field.js.map +1 -1
  150. package/dist/components/number-input.d.ts +37 -10
  151. package/dist/components/number-input.js +27 -12
  152. package/dist/components/number-input.js.map +1 -1
  153. package/dist/components/numpad-sheet.d.ts +11 -10
  154. package/dist/components/numpad-sheet.js +2 -2
  155. package/dist/components/numpad-sheet.js.map +1 -1
  156. package/dist/components/phone-input.d.ts +11 -10
  157. package/dist/components/popover.js +6 -2
  158. package/dist/components/popover.js.map +1 -1
  159. package/dist/components/row-actions.d.ts +6 -5
  160. package/dist/components/row-actions.js +130 -32
  161. package/dist/components/row-actions.js.map +1 -1
  162. package/dist/components/series-chart.d.ts +11 -10
  163. package/dist/components/settings-fields.d.ts +11 -10
  164. package/dist/components/share-card.d.ts +8 -7
  165. package/dist/components/share-card.js +26 -10
  166. package/dist/components/share-card.js.map +1 -1
  167. package/dist/components/skeleton.d.ts +10 -2
  168. package/dist/components/skeleton.js.map +1 -1
  169. package/dist/components/status-dot.d.ts +1 -0
  170. package/dist/components/status-dot.js +2 -2
  171. package/dist/components/status-dot.js.map +1 -1
  172. package/dist/components/swatch-picker.d.ts +2 -1
  173. package/dist/components/swatch-picker.js.map +1 -1
  174. package/dist/components/swipeable-row.d.ts +88 -17
  175. package/dist/components/swipeable-row.js +46 -9
  176. package/dist/components/swipeable-row.js.map +1 -1
  177. package/dist/components/switch.d.ts +2 -1
  178. package/dist/components/switch.js.map +1 -1
  179. package/dist/components/table.d.ts +2 -1
  180. package/dist/components/table.js +6 -0
  181. package/dist/components/table.js.map +1 -1
  182. package/dist/components/text-link.d.ts +10 -9
  183. package/dist/components/time-input.d.ts +11 -10
  184. package/dist/components/toggle-group.d.ts +2 -1
  185. package/dist/components/toggle-group.js +1 -1
  186. package/dist/components/toggle-group.js.map +1 -1
  187. package/dist/components/translation-review-editor.d.ts +4 -0
  188. package/dist/components/translation-review-editor.js +4 -3
  189. package/dist/components/translation-review-editor.js.map +1 -1
  190. package/dist/components/translation-review-parts.d.ts +1 -0
  191. package/dist/components/translation-review.d.ts +1 -0
  192. package/dist/components/translation-review.js +15 -18
  193. package/dist/components/translation-review.js.map +1 -1
  194. package/dist/components/ui.d.ts +10 -9
  195. package/dist/components/ui.js +47 -27
  196. package/dist/components/ui.js.map +1 -1
  197. package/dist/components/use-table-state.d.ts +12 -1
  198. package/dist/components/user-avatar.d.ts +1 -0
  199. package/dist/components/write-lock.d.ts +101 -13
  200. package/dist/components/write-lock.js +37 -13
  201. package/dist/components/write-lock.js.map +1 -1
  202. package/dist/{data-table-labels-kpAAVi6g.d.ts → data-table-labels-BJ5JE_X2.d.ts} +17 -0
  203. package/dist/data-table.d.ts +12 -1
  204. package/dist/{delete-account-setting-Dy4kJgUm.d.ts → delete-account-setting-DAgGBrbn.d.ts} +393 -42
  205. package/dist/feedback/feedback-attachment.d.ts +11 -10
  206. package/dist/feedback/feedback-attachment.js +7 -7
  207. package/dist/feedback/feedback-attachment.js.map +1 -1
  208. package/dist/feedback/feedback-context.d.ts +11 -10
  209. package/dist/feedback/feedback-crash.d.ts +11 -10
  210. package/dist/feedback/feedback-dialog.d.ts +11 -10
  211. package/dist/feedback/feedback-inbox.d.ts +10 -9
  212. package/dist/feedback/feedback-inbox.js +7 -3
  213. package/dist/feedback/feedback-inbox.js.map +1 -1
  214. package/dist/feedback/feedback-labels.d.ts +11 -10
  215. package/dist/feedback/feedback-menu.d.ts +4 -3
  216. package/dist/feedback/feedback-record.d.ts +11 -10
  217. package/dist/feedback/feedback-row-detail.d.ts +11 -10
  218. package/dist/feedback/feedback-row-detail.js.map +1 -1
  219. package/dist/feedback/feedback-status-undo.d.ts +11 -10
  220. package/dist/feedback/feedback-submit.d.ts +11 -10
  221. package/dist/feedback/feedback-swipe.d.ts +11 -10
  222. package/dist/feedback/feedback-swipe.js +3 -6
  223. package/dist/feedback/feedback-swipe.js.map +1 -1
  224. package/dist/feedback/feedback-table.d.ts +11 -10
  225. package/dist/feedback/feedback-table.js.map +1 -1
  226. package/dist/feedback/feedback-thread.d.ts +11 -10
  227. package/dist/feedback/feedback-thread.js +5 -1
  228. package/dist/feedback/feedback-thread.js.map +1 -1
  229. package/dist/feedback.d.ts +11 -10
  230. package/dist/hooks/use-anchored-panel.d.ts +37 -7
  231. package/dist/hooks/use-anchored-panel.js +6 -7
  232. package/dist/hooks/use-anchored-panel.js.map +1 -1
  233. package/dist/hooks/use-file-drop.d.ts +11 -10
  234. package/dist/hooks/use-focus-trap.d.ts +8 -0
  235. package/dist/hooks/use-focus-trap.js +17 -11
  236. package/dist/hooks/use-focus-trap.js.map +1 -1
  237. package/dist/i18n/defaults.d.ts +11 -10
  238. package/dist/i18n/defaults.js +2 -0
  239. package/dist/i18n/defaults.js.map +1 -1
  240. package/dist/i18n/german.d.ts +11 -10
  241. package/dist/i18n/german.js +37 -1
  242. package/dist/i18n/german.js.map +1 -1
  243. package/dist/i18n/kit-labels.d.ts +5 -4
  244. package/dist/i18n/kit-labels.js.map +1 -1
  245. package/dist/i18n/languages.d.ts +11 -10
  246. package/dist/i18n/locales/de-CH.d.ts +11 -10
  247. package/dist/i18n/locales/en.d.ts +11 -10
  248. package/dist/i18n/locales/es.d.ts +11 -10
  249. package/dist/i18n/locales/es.js +35 -1
  250. package/dist/i18n/locales/es.js.map +1 -1
  251. package/dist/i18n/locales/fr.d.ts +11 -10
  252. package/dist/i18n/locales/fr.js +37 -1
  253. package/dist/i18n/locales/fr.js.map +1 -1
  254. package/dist/i18n/locales/hu.d.ts +11 -10
  255. package/dist/i18n/locales/hu.js +38 -1
  256. package/dist/i18n/locales/hu.js.map +1 -1
  257. package/dist/i18n/locales/it.d.ts +11 -10
  258. package/dist/i18n/locales/it.js +35 -1
  259. package/dist/i18n/locales/it.js.map +1 -1
  260. package/dist/i18n/locales/zh.d.ts +11 -10
  261. package/dist/i18n/locales/zh.js +35 -1
  262. package/dist/i18n/locales/zh.js.map +1 -1
  263. package/dist/i18n/plurals.d.ts +20 -1
  264. package/dist/i18n/plurals.js +11 -0
  265. package/dist/i18n/plurals.js.map +1 -1
  266. package/dist/i18n/review.d.ts +11 -10
  267. package/dist/i18n/review.js +8 -1
  268. package/dist/i18n/review.js.map +1 -1
  269. package/dist/index.d.ts +11 -6
  270. package/dist/index.js +40 -2
  271. package/dist/index.js.map +1 -1
  272. package/dist/landing/landing-actions.d.ts +11 -10
  273. package/dist/landing/landing-sections.d.ts +11 -10
  274. package/dist/landing/public-header.d.ts +11 -10
  275. package/dist/landing/routing.d.ts +11 -10
  276. package/dist/pay/.well-known/apple-developer-merchantid-domain-association +1 -0
  277. package/dist/pay/index.html +30 -0
  278. package/dist/pay/pay.css +126 -0
  279. package/dist/pay/pay.js +198 -0
  280. package/dist/rhf/fields.d.ts +11 -10
  281. package/dist/rhf/form.d.ts +11 -10
  282. package/dist/rhf.d.ts +11 -10
  283. package/dist/settings/settings-section.d.ts +11 -10
  284. package/dist/shell/app-shell.d.ts +10 -9
  285. package/dist/shell/top-bar-brand.d.ts +11 -10
  286. package/dist/shell/topbar-action-menu.d.ts +1 -0
  287. package/dist/shell.d.ts +11 -10
  288. package/dist/testing/css-variables.d.ts +74 -0
  289. package/dist/testing/css-variables.generated.d.ts +7 -0
  290. package/dist/testing/css-variables.generated.js +8 -0
  291. package/dist/testing/css-variables.generated.js.map +1 -0
  292. package/dist/testing/css-variables.js +93 -0
  293. package/dist/testing/css-variables.js.map +1 -0
  294. package/dist/testing/index.d.ts +1 -0
  295. package/dist/testing/index.js +12 -0
  296. package/dist/testing/index.js.map +1 -0
  297. package/dist/theme/contrast-tokens.d.ts +44 -1
  298. package/dist/theme/contrast-tokens.js +21 -0
  299. package/dist/theme/contrast-tokens.js.map +1 -1
  300. package/dist/theme/contrast.d.ts +2 -2
  301. package/dist/theme/palette-derive.js +60 -11
  302. package/dist/theme/palette-derive.js.map +1 -1
  303. package/dist/theme/palette-presets.js +45 -43
  304. package/dist/theme/palette-presets.js.map +1 -1
  305. package/dist/wizard/stepper-nav.d.ts +12 -11
  306. package/dist/wizard/stepper-nav.js.map +1 -1
  307. package/dist/wizard.d.ts +11 -10
  308. package/package.json +10 -2
  309. package/src/account/delete-account-setting.tsx +6 -1
  310. package/src/account/email-change-setting.tsx +9 -3
  311. package/src/account/sessions-setting.tsx +7 -2
  312. package/src/admin/admin-action-confirm.tsx +2 -1
  313. package/src/admin/invitations-panel.tsx +9 -3
  314. package/src/admin/plan-change.tsx +487 -0
  315. package/src/admin/reviewer-scope-editor.tsx +2 -1
  316. package/src/admin/role-select.tsx +2 -1
  317. package/src/admin/user-roster.tsx +5 -3
  318. package/src/auth/auth-errors.ts +25 -2
  319. package/src/auth/complete-name-dialog.tsx +6 -2
  320. package/src/billing/billing-banner.tsx +3 -1
  321. package/src/billing/billing-labels.ts +45 -0
  322. package/src/billing/billing-lock.ts +36 -3
  323. package/src/billing/billing-overview.ts +58 -0
  324. package/src/billing/checkout-processing.ts +391 -0
  325. package/src/billing/checkout-return.ts +90 -0
  326. package/src/billing/pay-page.ts +246 -0
  327. package/src/billing/plan-limit-toast.tsx +91 -0
  328. package/src/billing/subscription-actions.tsx +41 -8
  329. package/src/components/account-settings.tsx +6 -2
  330. package/src/components/autocomplete.tsx +10 -4
  331. package/src/components/button-group.tsx +4 -1
  332. package/src/components/calculator.tsx +10 -6
  333. package/src/components/checkbox-group.tsx +2 -2
  334. package/src/components/checkbox.tsx +2 -1
  335. package/src/components/chip.tsx +37 -32
  336. package/src/components/choice-card.tsx +4 -2
  337. package/src/components/combobox-core.tsx +5 -2
  338. package/src/components/combobox.tsx +8 -6
  339. package/src/components/confirm-dialog.tsx +13 -6
  340. package/src/components/country-select.tsx +2 -2
  341. package/src/components/danger-confirm.tsx +2 -2
  342. package/src/components/data-table.tsx +20 -9
  343. package/src/components/date-picker.tsx +10 -7
  344. package/src/components/dropdown.tsx +12 -2
  345. package/src/components/entity-combobox.tsx +3 -3
  346. package/src/components/field-parts.tsx +61 -14
  347. package/src/components/file-button.tsx +5 -4
  348. package/src/components/file-dropzone.tsx +2 -2
  349. package/src/components/floating-panel.tsx +7 -5
  350. package/src/components/form-actions.tsx +12 -5
  351. package/src/components/full-bleed-dialog.tsx +6 -0
  352. package/src/components/inline-edit-field.tsx +13 -13
  353. package/src/components/list.tsx +10 -9
  354. package/src/components/modal.tsx +5 -0
  355. package/src/components/month-picker.tsx +8 -2
  356. package/src/components/multi-entity-combobox.tsx +3 -3
  357. package/src/components/number-field.tsx +7 -0
  358. package/src/components/number-input.tsx +71 -11
  359. package/src/components/numpad-sheet.tsx +8 -4
  360. package/src/components/popover.tsx +6 -2
  361. package/src/components/row-actions.tsx +208 -58
  362. package/src/components/share-card.tsx +67 -13
  363. package/src/components/skeleton.tsx +10 -2
  364. package/src/components/status-dot.tsx +7 -7
  365. package/src/components/swatch-picker.tsx +2 -2
  366. package/src/components/swipeable-row.tsx +138 -27
  367. package/src/components/switch.tsx +2 -1
  368. package/src/components/table.tsx +8 -1
  369. package/src/components/toggle-group.tsx +5 -3
  370. package/src/components/translation-review-editor.tsx +8 -3
  371. package/src/components/translation-review.tsx +18 -22
  372. package/src/components/ui.tsx +92 -43
  373. package/src/components/write-lock.tsx +150 -24
  374. package/src/feedback/feedback-attachment.tsx +13 -9
  375. package/src/feedback/feedback-inbox.tsx +10 -6
  376. package/src/feedback/feedback-row-detail.tsx +3 -2
  377. package/src/feedback/feedback-swipe.tsx +6 -11
  378. package/src/feedback/feedback-table.tsx +2 -1
  379. package/src/feedback/feedback-thread.tsx +20 -1
  380. package/src/hooks/use-anchored-panel.ts +60 -14
  381. package/src/hooks/use-focus-trap.ts +55 -12
  382. package/src/i18n/defaults.ts +2 -0
  383. package/src/i18n/german.ts +41 -0
  384. package/src/i18n/kit-labels.tsx +4 -0
  385. package/src/i18n/locales/es.ts +35 -0
  386. package/src/i18n/locales/fr.ts +41 -0
  387. package/src/i18n/locales/hu.ts +39 -0
  388. package/src/i18n/locales/it.ts +36 -0
  389. package/src/i18n/locales/zh.ts +34 -0
  390. package/src/i18n/plurals.ts +29 -0
  391. package/src/i18n/review.ts +7 -0
  392. package/src/index.ts +51 -5
  393. package/src/testing/css-variables.generated.ts +112 -0
  394. package/src/testing/css-variables.ts +191 -0
  395. package/src/testing/index.ts +13 -0
  396. package/src/theme/contrast-tokens.ts +53 -2
  397. package/src/theme/palette-derive.ts +87 -10
  398. package/src/theme/palette-presets.ts +45 -43
  399. package/src/wizard/stepper-nav.tsx +2 -1
  400. package/tokens.css +324 -46
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/feedback/feedback-table.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport type { MouseEvent, ReactElement, ReactNode } from \"react\";\nimport { ExternalLink } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { toLocalIso } from \"../lib/dates\";\nimport { EMPTY_FORMATTED_VALUE, formatDate, toDate } from \"../lib/format\";\nimport { useKitDateFormatter, useKitLabels, useKitLink, useKitLocale } from \"../i18n/kit-labels\";\nimport type { KitLinkProps } from \"../i18n/kit-labels\";\nimport { Chip } from \"../components/chip\";\nimport { FloatingAction, FloatingActionGroup } from \"../components/floating-panel\";\nimport type { FloatingCorner } from \"../components/floating-panel\";\nimport { pickLinkRenderer } from \"../components/text-link\";\nimport type { DataTableColumn } from \"../components/data-table\";\nimport {\n FEEDBACK_CATEGORY_ORDER,\n FEEDBACK_STATUS_META,\n FEEDBACK_STATUS_ORDER,\n FeedbackCategoryBadge,\n FeedbackStatusBadge,\n FeedbackStatusTransitions,\n feedbackCategoryRank,\n visibleFeedbackStatuses,\n type FeedbackStatus,\n} from \"./feedback-inbox\";\nimport {\n useFeedbackCategoryLabels,\n useFeedbackStatusLabels,\n type FeedbackCategoryLabels,\n type FeedbackStatusLabels,\n} from \"./feedback-labels\";\nimport { FEEDBACK_AWAITING_STATUSES, reworkCount, type FeedbackContext, type FeedbackRecord } from \"./feedback-record\";\nimport type { FeedbackStatusChange } from \"./feedback-status-undo\";\nimport { feedbackPageHref, feedbackPagePath } from \"./feedback-row-detail\";\n\n/**\n * The two feedback pages' TABLE — `/feedback` (the admin inbox) and `/my-feedback` (the\n * user's own) — as the kit's parts: §4.3 of the feedback contract\n * (docs/feedback-harmonization.md), lifted from keksdose\n * `frontend/src/features/feedback/feedback-page.tsx` (columns :711–963, the phone card\n * :1038–1065, the awaiting toggle :689–709 and :1086–1101).\n *\n * Until 0.27 each app wrote this table itself, and the three had drifted exactly where a\n * table drifts: kastlan's showed five statuses and no environment, Kurvenschmiede's one\n * page served both audiences, and keksdose's — the canon, argued over a year of feedback\n * items — had a latent bug of its own: its subject cell carries the environment and\n * rework chips \"so a second attempt is marked on every surface at once\" (:760), but the\n * phone card is a `mobileCard`, and `DataTable` never renders the `mobilePrimary` cell\n * when `mobileCard` is set (data-table.tsx, `cardInner`). Its phone cards showed neither\n * chip. {@link FeedbackMobileCard} draws both itself, from the same\n * {@link FeedbackSubject} the column uses, so the two surfaces cannot part again.\n *\n * What stays the app's: the rows (its API client), who is an admin, the routes and the\n * `/feedback` → `/my-feedback` redirect, the `?row=` deep link and the row detail. What\n * is here: the nine columns ({@link feedbackColumns} / {@link useFeedbackColumns}), the\n * phone card and its day headers ({@link FeedbackMobileCard},\n * {@link feedbackMobileGroupBy}), the phone's \"Only what is waiting for you\" toggle\n * ({@link FeedbackAwaitingToggle}), the empty state ({@link FeedbackEmptyState}) and the\n * `feedbackPage` words. The swipes are `feedbackSwipePlan` (feedback-swipe.tsx), passed\n * by the app because whether the page may write is the app's call.\n */\n\n/* ── Labels ─────────────────────────────────────────────────────────────────── */\n\n/**\n * `feedbackPage` — the words of the two feedback pages (§4.3). The English is keksdose's\n * `en.json` (`feedback.*`, `common.none`); the de-CH canon is noted on each key (keksdose\n * `de-CH.json`, ss never ß).\n */\nexport interface FeedbackPageLabels {\n /** The admin inbox's page title, `/feedback`. de-CH: \"Feedback\" */\n title: string;\n /** The user's own list, `/my-feedback`. de-CH: \"Mein Feedback\" */\n myTitle: string;\n /** Column 1, the id. de-CH: \"#\" */\n columnId: string;\n /** Column 2, when it was filed. de-CH: \"Datum\" */\n columnDate: string;\n /** Column 3. de-CH: \"Kategorie\" */\n columnCategory: string;\n /** Column 4, the title with its chips. de-CH: \"Betreff\" */\n columnSubject: string;\n /** Column 5, who filed it. de-CH: \"Nutzer\" */\n columnUser: string;\n /** Column 6. de-CH: \"E-Mail\" */\n columnEmail: string;\n /** Column 7, the page it was filed from. de-CH: \"URL\" */\n columnUrl: string;\n /** Column 8. de-CH: \"Status\" */\n columnStatus: string;\n /** Column 9, when it was settled. de-CH: \"Erledigt am\" */\n columnResolved: string;\n /** What the URL cell's link does, said before the path to a screen reader.\n * de-CH: \"Seite öffnen\" */\n openPage: string;\n /** The table with nothing to show, on both pages (§7.13) — keksdose's `common.none`.\n * de-CH: \"Keine\" */\n empty: string;\n /** The submitter of a report whose account was erased (`user_id: null`, keksdose live\n * #275). de-CH: \"<gelöschter Nutzer>\" */\n deletedUser: string;\n /** The submitter when neither a name nor an email is known — `id` is `user_id`.\n * de-CH: \"Nutzer #{{id}}\" */\n userFallback: (id: number) => string;\n /** The chip for a report filed from a copy of the app that is not production —\n * `environment` is `context.environment` as filed (\"dev\", \"local\", or the app's own\n * word). Upper-cased like the top bar's environment badge, so the marker the tester saw\n * is the marker triage sees. Guarded: a context is untyped JSON, so a value that is no\n * string (an app calling it with `context.environment` as stored) is printed, never\n * thrown on. de-CH: the same. */\n environment: (environment: string) => string;\n /** The chip for a report sent back for rework — `count` ≥ 1 is how many times\n * (`reworkCount`, keksdose live #331). de-CH: \"Nacharbeit\" / \"Nacharbeit ×{{count}}\" */\n reworkChip: (count: number) => string;\n /** The phone toggle narrowing the inbox to IN_EVALUATION + NEEDS_LIVE_TEST.\n * de-CH: \"Nur was auf Sie wartet\" */\n awaitingFilter: string;\n /** The name of the phone's floating group that holds it. de-CH: \"Feedback-Aktionen\" */\n phoneActions: string;\n}\n\nexport const DEFAULT_FEEDBACK_PAGE_LABELS: FeedbackPageLabels = {\n title: \"Feedback\",\n myTitle: \"My feedback\",\n columnId: \"#\",\n columnDate: \"Date\",\n columnCategory: \"Category\",\n columnSubject: \"Subject\",\n columnUser: \"User\",\n columnEmail: \"Email\",\n columnUrl: \"URL\",\n columnStatus: \"Status\",\n columnResolved: \"Resolved\",\n openPage: \"Open page\",\n empty: \"None\",\n deletedUser: \"<deleted user>\",\n userFallback: (id) => `user #${id}`,\n environment: (environment) => String(environment ?? \"\").toUpperCase(),\n reworkChip: (count) => (count === 1 ? \"Rework\" : `Rework ×${count}`),\n awaitingFilter: \"Only what is waiting for you\",\n phoneActions: \"Feedback actions\",\n};\n\n/** `feedbackPage` resolved: English, then `<UiKitProvider labels>`, then `labels`. The\n * page's title comes from here too: `mine ? labels.myTitle : labels.title`. */\nexport function useFeedbackPageLabels(labels?: Partial<FeedbackPageLabels>): FeedbackPageLabels {\n return useKitLabels(\"feedbackPage\", DEFAULT_FEEDBACK_PAGE_LABELS, labels);\n}\n\n/* ── Reading a row ──────────────────────────────────────────────────────────── */\n\n/** What the table reads off a report — {@link FeedbackRecord}'s fields, so an app's own\n * row type with more of them passes as it is. */\nexport type FeedbackTableRow = Pick<\n FeedbackRecord,\n \"id\" | \"user_id\" | \"user_email\" | \"title\" | \"body\" | \"category\" | \"status\" | \"context\" | \"resolved_at\" | \"created_at\"\n>;\n\n/** A context value as a trimmed string, or `\"\"` — every key is optional on read (§3.2)\n * and an app's own context type may say `unknown`. */\nfunction text(value: unknown): string {\n return typeof value === \"string\" ? value.trim() : \"\";\n}\n\n/**\n * The environment a report was filed from when it is NOT production, as filed — or\n * `null` (keksdose `environmentLabel`, :142). Production is silent, as the top bar's\n * badge is: the marker earns attention by being rare. A missing value is production too —\n * every row filed before a test copy existed, and crash rows filed before the crash\n * payload carried `environment` (§3.2, §3.6). An unknown value is shown rather than swallowed: an environment\n * nobody recognises is exactly when triage needs to see one.\n */\nexport function feedbackEnvironment(context: FeedbackContext | null | undefined): string | null {\n const env = text(context?.environment);\n return !env || env.toLowerCase() === \"prod\" ? null : env;\n}\n\n/**\n * Who filed a report, as one string (keksdose `submitterLabel`, :163): the display name,\n * else the email, else `userFallback(user_id)`. An erased account (`user_id: null`) is\n * `deletedUser` FIRST, ahead of the context: the server scrubs the name with the account,\n * but a row that somehow kept one must still not go on naming somebody who asked to be\n * forgotten. The joined `user_email` (admin list) is preferred to the context snapshot.\n */\nexport function feedbackSubmitter(\n row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">,\n labels: Pick<FeedbackPageLabels, \"deletedUser\" | \"userFallback\">,\n): string {\n if (row.user_id == null) return labels.deletedUser;\n return (\n text(row.context?.user_display_name) ||\n text(row.user_email) ||\n text(row.context?.user_email) ||\n labels.userFallback(row.user_id)\n );\n}\n\n/**\n * The submitter's email (keksdose `submitterEmail`, :175): the joined `user_email` —\n * authoritative, the display name is self-chosen (feedback #108) — else the context\n * snapshot, which is what `/my-feedback` has (`GET /feedback/my` sends no join). `\"\"`\n * for an erased account, for the reason {@link feedbackSubmitter} gives.\n */\nexport function feedbackSubmitterEmail(row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">): string {\n if (row.user_id == null) return \"\";\n return text(row.user_email) || text(row.context?.user_email);\n}\n\n/** Whether a status is one the phone's awaiting toggle keeps — `FEEDBACK_AWAITING_STATUSES`,\n * the two that wait on the person triaging. `rows.filter((r) => isFeedbackAwaiting(r.status))`. */\nexport function isFeedbackAwaiting(status: FeedbackStatus): boolean {\n return FEEDBACK_AWAITING_STATUSES.includes(status);\n}\n\n/* ── Dates ──────────────────────────────────────────────────────────────────── */\n\n/**\n * How the pages write a date: an ISO timestamp in, one string out. keksdose passes its\n * `useDateCell()` (the app's date-format preference, weekday and all — dev#546), which\n * fits as it is.\n *\n * ONE function for the date column, the resolved column, the phone card and the phone's\n * day headers, so the four cannot disagree (keksdose dev#546 round 3: the header is a\n * string and must say what the card says).\n */\nexport type FeedbackRenderDate = (iso: string) => string;\n\n/** The kit's own date, weekday included: \"Sun, 4 Oct 2026\" / \"So., 4. Okt. 2026\". A date\n * in a column carries its weekday (keksdose's rule, date-cell.tsx). */\nconst FEEDBACK_DATE_STYLE: Intl.DateTimeFormatOptions = {\n weekday: \"short\",\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n};\n\n/**\n * `renderDate` when the app gave one, else the kit's: the `<UiKitProvider formatDate>`\n * when the app set one (called with the LOCAL calendar day and `weekday: true`, as\n * `DateMark` calls it), else `Intl` in the provider's locale with the weekday. An\n * unparseable value is passed through rather than hidden.\n */\nexport function useFeedbackRenderDate(renderDate?: FeedbackRenderDate, locale?: string): FeedbackRenderDate {\n const kitLocale = useKitLocale(locale);\n const fromProvider = useKitDateFormatter();\n return useMemo<FeedbackRenderDate>(() => {\n if (renderDate) return renderDate;\n return (iso) => {\n const date = toDate(iso);\n if (!date) return iso || EMPTY_FORMATTED_VALUE;\n const own = fromProvider\n ? fromProvider(toLocalIso(date), { unit: \"day\", source: \"dateMark\", locale: kitLocale, weekday: true })\n : \"\";\n return own || formatDate(date, FEEDBACK_DATE_STYLE, { locale: kitLocale });\n };\n }, [renderDate, fromProvider, kitLocale]);\n}\n\n/** A date in a cell: `<time>`, nowrap, tabular figures; \"—\" when there is none. */\nfunction FeedbackDate({ value, renderDate }: { value: string | null | undefined; renderDate: FeedbackRenderDate }) {\n if (!value) return <span className=\"text-[var(--text-placeholder)]\">{EMPTY_FORMATTED_VALUE}</span>;\n return (\n <time dateTime={value} className=\"whitespace-nowrap tabular-nums text-[var(--text-muted)]\">\n {renderDate(value)}\n </time>\n );\n}\n\n/** An instant for sorting; a value that does not parse sorts with the empty ones. */\nfunction instant(value: string | null | undefined): number | null {\n const ms = value ? Date.parse(value) : NaN;\n return Number.isNaN(ms) ? null : ms;\n}\n\n/* ── The subject: title + environment chip + rework chip ───────────────────── */\n\nexport interface FeedbackSubjectProps {\n row: Pick<FeedbackRecord, \"title\" | \"body\" | \"context\">;\n /**\n * `false` (default): one line — the title truncates and the chips stay whole, as a\n * table cell wants. `true`: the title wraps and the chips flow after its last word, as\n * the phone card wants (a phone shows the whole title or nothing useful).\n */\n wrap?: boolean;\n /** Over the `feedbackPage` namespace. */\n labels?: Partial<FeedbackPageLabels>;\n className?: string;\n}\n\n/**\n * A report's title with its two chips (§4.3, column 4): the environment when it is not\n * production (keksdose's amber outline, the top bar's environment badge — the marker the\n * tester saw is the marker triage sees) and **Rework** / **Rework ×n** when the author has\n * sent it back (keksdose live #331: *\"have a new category for items in rework\"*, as a fact\n * derived from the body rather than a seventh status).\n *\n * No tooltip on either chip (keksdose dev#523): each already says what it means.\n */\nexport function FeedbackSubject({ row, wrap = false, labels: labelsProp, className }: FeedbackSubjectProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const env = feedbackEnvironment(row.context);\n const rounds = reworkCount(row.body ?? \"\");\n const chipClass = wrap ? \"ms-1.5 align-middle\" : \"shrink-0\";\n const chips = (\n <>\n {env && (\n <Chip size=\"sm\" variant=\"outline\" shape=\"square\" tone=\"warning\" caps className={chipClass} data-feedback-env=\"\">\n {labels.environment(env)}\n </Chip>\n )}\n {rounds > 0 && (\n <Chip size=\"sm\" tone=\"warning\" caps className={chipClass} data-feedback-rework={rounds}>\n {labels.reworkChip(rounds)}\n </Chip>\n )}\n </>\n );\n if (wrap) {\n return (\n <span className={cn(\"min-w-0 font-medium [overflow-wrap:anywhere]\", className)}>\n {row.title}\n {chips}\n </span>\n );\n }\n return (\n <span className={cn(\"inline-flex min-w-0 max-w-full items-center gap-1.5\", className)}>\n <span className=\"min-w-0 truncate font-medium\">{row.title}</span>\n {chips}\n </span>\n );\n}\n\n/* ── The URL cell ───────────────────────────────────────────────────────────── */\n\n/**\n * The page a report was filed from, as a link — the cell keksdose's column 7 draws\n * (:850): the path as text, path + query + hash as the `href`, read from `context.url`\n * else `context.route` by the row detail's own readers (`feedbackPagePath` /\n * `feedbackPageHref`, feedback-row-detail.tsx), so the column and the detail link the\n * same page the same way. A real link through the `<UiKitProvider linkComponent>` (the app's router, so it\n * does not reload the app; keksdose's plain `<a>` did), and its click stops at the cell so\n * the row does not open as well.\n *\n * Its name is the path, as on screen, with \"Open page\" said before it — keksdose's\n * `aria-label=\"Open page\"` replaced the path, so a screen reader heard forty identical\n * links down the column.\n */\nfunction FeedbackPageLinkCell({ context, openPage }: { context: FeedbackContext | null; openPage: string }) {\n const kitLink = useKitLink();\n const href = feedbackPageHref(context);\n const path = feedbackPagePath(context);\n if (!href || !path) return <span className=\"text-[var(--text-placeholder)]\">{EMPTY_FORMATTED_VALUE}</span>;\n const className =\n \"inline-flex min-w-0 max-w-full items-center gap-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:underline\";\n const children = (\n <>\n {/* The space outside the hidden span: a flex container drops it from the layout,\n and the accessible name keeps it (\"Open page /accounts\"). */}\n <span className=\"sr-only\">{openPage}</span>{\" \"}\n <code className=\"min-w-0 truncate text-xs\">{path}</code>\n <ExternalLink className=\"size-3 shrink-0\" aria-hidden />\n </>\n );\n const onClick = (event: MouseEvent<HTMLAnchorElement>) => event.stopPropagation();\n const render = pickLinkRenderer<KitLinkProps>(undefined, kitLink, href);\n return render ? (\n <RenderedLink render={render} href={href} className={className} onClick={onClick}>\n {children}\n </RenderedLink>\n ) : (\n <a href={href} className={className} onClick={onClick}>\n {children}\n </a>\n );\n}\n\n/** The provider's link, drawn by a component declared once (as FloatingAction's). */\nfunction RenderedLink({ render, ...props }: KitLinkProps & { render: (props: KitLinkProps) => ReactElement }) {\n return render(props);\n}\n\n/* ── The columns ────────────────────────────────────────────────────────────── */\n\n/** What {@link feedbackColumns} takes — every word already resolved (see\n * {@link useFeedbackColumns}, which resolves them from the provider). */\nexport interface FeedbackColumnsOptions {\n /** `/my-feedback`. The same nine columns (one page component, §4.3), but the status\n * cell is read-only there whatever `canEdit` says — \"no status or outcome editing\n * there (also for an admin)\". */\n mine?: boolean;\n /** The admin on `/feedback` — the status cell offers its steps. Otherwise it shows them\n * read-only. */\n canEdit: boolean;\n /** The undoable status change, `useFeedbackStatusUndo(update.mutate)` (§4.5) — the\n * same one the row detail and the swipes use. */\n onStatus: FeedbackStatusChange;\n /** See {@link FeedbackRenderDate}. */\n renderDate: FeedbackRenderDate;\n /** The status buttons SAVE when pressed: pass `true` to put them under the page's\n * `WriteLockProvider` (FeedbackStatusTransitions' `commit`). Off by default — a\n * feedback inbox is rarely what an app's lock is about. */\n commit?: boolean;\n labels: FeedbackPageLabels;\n statusLabels: FeedbackStatusLabels;\n categoryLabels: FeedbackCategoryLabels;\n}\n\n/** A status's place in the chain, unknown ones last (as `feedbackCategoryRank`). */\nfunction statusRank(status: FeedbackStatus): number {\n const at = FEEDBACK_STATUS_ORDER.indexOf(status);\n return at === -1 ? FEEDBACK_STATUS_ORDER.length : at;\n}\n\n/**\n * The nine columns of §4.3, in the contract's order, for `DataTable` — keksdose's\n * (:711–963) with the contract's changes:\n *\n * | # | key | cell | filter | phone |\n * |---|---|---|---|---|\n * | 1 | `id` | id, mono | number | hidden |\n * | 2 | `date` | `created_at`, weekday ({@link FeedbackRenderDate}) | date | |\n * | 3 | `category` | `FeedbackCategoryBadge`, sorted CRASH first | select, all five | |\n * | 4 | `title` | {@link FeedbackSubject} | text: title + environment | card heading |\n * | 5 | `user` | {@link feedbackSubmitter} | text: name + email, or \"deleted user\" | |\n * | 6 | `email` | {@link feedbackSubmitterEmail} | text | hidden |\n * | 7 | `url` | the page, a link (`noRowLink`) | text: path | hidden |\n * | 8 | `status` | `FeedbackStatusTransitions variant=\"icon\"`, `visibleFeedbackStatuses` | select, chain order | |\n * | 9 | `resolved` | `resolved_at` | date | hidden |\n *\n * - Both select filters list the WHOLE vocabulary in its own order, translated —\n * without `options` the popover lists the bare enum values found in the rows\n * (keksdose feedback #160), and kastlan's first CRASH row would otherwise appear in a\n * filter that never offered it.\n * - The status column owns the status filter, and only it (keksdose live #330's revert:\n * the phone's filter sheet already exposes every column filter).\n * - `/my-feedback` shows the same nine: the Email cell's context fallback exists for it\n * (the admin list's join is absent there, §3.1), and its phone card drops the submitter\n * instead ({@link FeedbackMobileCardProps.showSubmitter}).\n *\n * Pure: hand it resolved words, or use {@link useFeedbackColumns}. Keys are stable, so\n * an app may drop or add a column (`columns.filter((c) => c.key !== \"email\")`).\n */\nexport function feedbackColumns<T extends FeedbackTableRow>({\n mine = false,\n canEdit,\n onStatus,\n renderDate,\n commit,\n labels,\n statusLabels,\n categoryLabels,\n}: FeedbackColumnsOptions): DataTableColumn<T>[] {\n const editable = canEdit && !mine;\n return [\n {\n key: \"id\",\n header: labels.columnId,\n cell: (row) => <span className=\"font-mono text-xs text-[var(--text-muted)]\">{row.id}</span>,\n sortBy: (row) => row.id,\n filter: { type: \"number\", getValue: (row) => row.id },\n mobileHidden: true,\n },\n {\n key: \"date\",\n header: labels.columnDate,\n cell: (row) => <FeedbackDate value={row.created_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.created_at),\n filter: { type: \"date\", getValue: (row) => row.created_at },\n },\n {\n key: \"category\",\n header: labels.columnCategory,\n cell: (row) => <FeedbackCategoryBadge category={row.category} label={categoryLabels[row.category]} />,\n sortBy: (row) => feedbackCategoryRank(row.category),\n filter: {\n type: \"select\",\n getValue: (row) => row.category,\n options: FEEDBACK_CATEGORY_ORDER.map((value) => ({ value, label: categoryLabels[value] })),\n },\n },\n {\n key: \"title\",\n header: labels.columnSubject,\n cell: (row) => <FeedbackSubject row={row} labels={labels} />,\n sortBy: (row) => row.title,\n // Searchable by the environment too, so \"dev\" narrows to the test copy's reports —\n // a chip you can see but not filter by makes you read every row (keksdose :804).\n filterBy: (row) => {\n const env = feedbackEnvironment(row.context);\n return env ? `${row.title} ${labels.environment(env)}` : row.title;\n },\n mobilePrimary: true,\n },\n {\n key: \"user\",\n header: labels.columnUser,\n cell: (row) => <span className=\"text-[var(--text-secondary)]\">{feedbackSubmitter(row, labels)}</span>,\n sortBy: (row) => feedbackSubmitter(row, labels),\n // Name AND email, so either finds the person; the erased ones by the placeholder\n // (their context holds no name any more).\n filterBy: (row) =>\n row.user_id == null\n ? labels.deletedUser\n : `${feedbackSubmitter(row, labels)} ${feedbackSubmitterEmail(row)}`,\n },\n {\n key: \"email\",\n header: labels.columnEmail,\n // One line, like the URL beside it: keksdose's `break-all` let the browser squeeze\n // the column to its header and broke every address in two (\"user@exam / ple.test\"),\n // which made every row taller. Unbroken, a resized (pinned) column ellipsises it.\n className: \"whitespace-nowrap\",\n cell: (row) => {\n const email = feedbackSubmitterEmail(row);\n return email ? (\n <span className=\"text-[var(--text-secondary)]\">{email}</span>\n ) : (\n <span className=\"text-[var(--text-placeholder)]\">{EMPTY_FORMATTED_VALUE}</span>\n );\n },\n sortBy: feedbackSubmitterEmail,\n filterBy: feedbackSubmitterEmail,\n mobileHidden: true,\n },\n {\n key: \"url\",\n header: labels.columnUrl,\n // A cell only ellipsises what it is told not to wrap (keksdose live #348: the path\n // clipped mid-character \"behind the next column\").\n className: \"whitespace-nowrap\",\n // The cell IS a link, so the row's own permalink must never wrap it (keksdose\n // feedback #451: <a> in <a>, and \"open the page\" silently did nothing).\n noRowLink: true,\n cell: (row) => <FeedbackPageLinkCell context={row.context} openPage={labels.openPage} />,\n sortBy: (row) => feedbackPagePath(row.context) ?? \"\",\n filterBy: (row) => feedbackPagePath(row.context) ?? \"\",\n mobileHidden: true,\n },\n {\n key: \"status\",\n header: labels.columnStatus,\n // A KNOWN width: at most six 28px icon buttons (from IN_PROGRESS or IN_EVALUATION:\n // one step either way and the three off the chain) — keksdose live #348 sized it\n // for five and the sixth pushed the column wider.\n className: \"w-[13.5rem] whitespace-nowrap\",\n cell: (row) => (\n <FeedbackStatusTransitions\n status={row.status}\n statuses={visibleFeedbackStatuses(row.status)}\n canEdit={editable}\n commit={commit}\n onPick={(status) => onStatus(row, status)}\n variant=\"icon\"\n label={(status) => statusLabels[status]}\n />\n ),\n sortBy: (row) => statusRank(row.status),\n filter: {\n type: \"select\",\n getValue: (row) => row.status,\n options: FEEDBACK_STATUS_ORDER.map((value) => ({ value, label: statusLabels[value] })),\n },\n },\n {\n key: \"resolved\",\n header: labels.columnResolved,\n cell: (row) => <FeedbackDate value={row.resolved_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.resolved_at),\n filter: { type: \"date\", getValue: (row) => row.resolved_at },\n mobileHidden: true,\n },\n ];\n}\n\n/** What {@link useFeedbackColumns} takes: {@link FeedbackColumnsOptions} with the words\n * read from the provider, and `renderDate` optional. */\nexport interface UseFeedbackColumnsOptions\n extends Omit<FeedbackColumnsOptions, \"renderDate\" | \"labels\" | \"statusLabels\" | \"categoryLabels\"> {\n /** Default: the kit's date with the weekday ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** Over the `feedbackPage` namespace. Keep it stable (module scope or memoised): it is\n * a dependency of the memo. */\n labels?: Partial<FeedbackPageLabels>;\n}\n\n/**\n * {@link feedbackColumns} with the `feedbackPage`, `feedbackStatus` and\n * `feedbackCategory` words from the provider, memoised on what it reads — pass\n * `update.mutate` through `useFeedbackStatusUndo` (stable) rather than a fresh function\n * per render, or every row's columns are rebuilt on each render (keksdose :667).\n */\nexport function useFeedbackColumns<T extends FeedbackTableRow>({\n mine,\n canEdit,\n onStatus,\n renderDate: renderDateProp,\n commit,\n labels: labelsProp,\n}: UseFeedbackColumnsOptions): DataTableColumn<T>[] {\n const labels = useFeedbackPageLabels(labelsProp);\n const statusLabels = useFeedbackStatusLabels();\n const categoryLabels = useFeedbackCategoryLabels();\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return useMemo(\n () =>\n feedbackColumns<T>({ mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels }),\n [mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels],\n );\n}\n\n/* ── The phone ──────────────────────────────────────────────────────────────── */\n\n/**\n * The phone list's day headers (keksdose feedback #325: the list \"grouped by date, like\n * the transactions list\"): `DataTable mobileGroupBy={feedbackMobileGroupBy(renderDate)}`.\n *\n * The key IS the header — the same string the card's date says. DataTable groups runs of\n * equal keys, so the rows must come newest first, as `GET /feedback` and\n * `GET /feedback/my` send them (§3.3).\n */\nexport function feedbackMobileGroupBy(\n renderDate: FeedbackRenderDate,\n): (row: Pick<FeedbackRecord, \"created_at\">) => string {\n return (row) => renderDate(row.created_at);\n}\n\nexport interface FeedbackMobileCardProps {\n row: FeedbackTableRow;\n /** Add the submitter after the date — the admin inbox (`canEdit`). On `/my-feedback`\n * every row is the viewer's own and the name would repeat down the list. */\n showSubmitter?: boolean;\n /** See {@link FeedbackRenderDate}; the same function as the columns' and the day\n * headers'. Default: the kit's ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** Over the `feedbackPage` namespace. */\n labels?: Partial<FeedbackPageLabels>;\n}\n\n/**\n * One report as a phone card (§4.3; keksdose :1042, feedback #325 rework: *\"compact card\n * instead of a wasteful label/value row per field\"*): the title with its environment and\n * rework chips and the status badge on one line, then the compact category badge, the\n * date and (admin) the submitter beneath.\n *\n * `DataTable mobileCard={(row) => <FeedbackMobileCard row={row} … />}`. It draws the\n * chips itself: with a `mobileCard`, DataTable never renders the `mobilePrimary` cell,\n * which is how keksdose's cards lost them.\n */\nexport function FeedbackMobileCard({ row, showSubmitter = false, renderDate: renderDateProp, labels: labelsProp }: FeedbackMobileCardProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return (\n <div className=\"min-w-0 space-y-1\">\n <div className=\"flex items-start justify-between gap-2\">\n <FeedbackSubject row={row} wrap labels={labels} className=\"flex-1\" />\n {/* The pill the desktop status column draws, so a status is the same colour and\n glyph on both layouts. */}\n <FeedbackStatusBadge status={row.status} className=\"shrink-0\" />\n </div>\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-[var(--text-muted)]\">\n <FeedbackCategoryBadge category={row.category} compact />\n <FeedbackDate value={row.created_at} renderDate={renderDate} />\n {showSubmitter && (\n // The short id form: \"#7\" says enough on a card that has room for little.\n <span className=\"min-w-0 truncate\">\n · {feedbackSubmitter(row, { deletedUser: labels.deletedUser, userFallback: (id) => `#${id}` })}\n </span>\n )}\n </div>\n </div>\n );\n}\n\nexport interface FeedbackAwaitingToggleProps {\n /** Narrowed to what waits on the triager. Page state, not the URL (keksdose :699): a\n * thumb gesture on one screen, not a view worth linking to. */\n pressed: boolean;\n onPressedChange: (pressed: boolean) => void;\n /** Further `FloatingAction`s, after the toggle — the group is what makes them free. */\n children?: ReactNode;\n /** Default `bottom-end`, the register's corner. */\n corner?: FloatingCorner;\n /** Over the group's default distance from the bottom. */\n offset?: string;\n /** On the group. It is `md:hidden` already: the desktop has the status column's\n * filter, the same question asked where there is room for it. */\n className?: string;\n /** Over the `feedbackPage` namespace. */\n labels?: Partial<FeedbackPageLabels>;\n}\n\n/**\n * The phone inbox's one filter button — **\"Only what is waiting for you\"** (§4.3;\n * keksdose live #330 rework: *\"a button that toggles the evaluation items (in evaluation,\n * test when live) as toggle button similar to the show/hide upcoming/scheduled for the tx\n * page\"*).\n *\n * It narrows TO `FEEDBACK_AWAITING_STATUSES` rather than hiding them: after a loop run\n * those ARE the queue — the rows handed back for a verdict — and everything else is\n * history. A `FloatingActionGroup` with one member anyway, in the register's corner and\n * shape (keksdose feedback #58), so a second action costs nothing; the glyph is\n * IN_EVALUATION's own, so the button reads in the vocabulary of the badges it filters on.\n *\n * Admin inbox only: on `/my-feedback` the author is not waiting on their own verdict.\n * The filtering is the page's — `rows.filter((r) => isFeedbackAwaiting(r.status))` —\n * so the table's own filters, sort and URL stay untouched.\n */\nexport function FeedbackAwaitingToggle({\n pressed,\n onPressedChange,\n children,\n corner,\n offset,\n className,\n labels: labelsProp,\n}: FeedbackAwaitingToggleProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const Icon = FEEDBACK_STATUS_META.IN_EVALUATION.icon;\n return (\n <FloatingActionGroup\n aria-label={labels.phoneActions}\n corner={corner}\n offset={offset}\n className={cn(\"md:hidden\", className)}\n >\n <FloatingAction\n label={labels.awaitingFilter}\n icon={<Icon aria-hidden />}\n pressed={pressed}\n onClick={() => onPressedChange(!pressed)}\n />\n {children}\n </FloatingActionGroup>\n );\n}\n\n/* ── Empty ──────────────────────────────────────────────────────────────────── */\n\nexport interface FeedbackEmptyStateProps {\n /** Over the `feedbackPage` namespace. */\n labels?: Partial<FeedbackPageLabels>;\n}\n\n/**\n * The table with nothing to show (§7.13): the one word **None** / **Keine**, on both\n * pages — keksdose's `empty={t(\"common.none\")}` (`feedback-page.tsx:982`). No hint\n * beneath it: where reports are sent from is the feedback menu's business, and the inbox\n * needs no sentence to say it is empty.\n *\n * For `DataTable empty`, which sits in a centred, muted cell — so no box of its own.\n * keksdose passes it unconditionally, so a filter (or the awaiting toggle) that leaves\n * nothing says \"None\" too: `empty={<FeedbackEmptyState />}`.\n */\nexport function FeedbackEmptyState({ labels: labelsProp }: FeedbackEmptyStateProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n return <span data-feedback-empty=\"\">{labels.empty}</span>;\n}\n"],"mappings":";AAmQqB,SA4CjB,UA5CiB,KA4CjB,YA5CiB;AAnQrB,SAAS,eAAe;AAExB,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB,YAAY,cAAc;AAC1D,SAAS,qBAAqB,cAAc,YAAY,oBAAoB;AAE5E,SAAS,YAAY;AACrB,SAAS,gBAAgB,2BAA2B;AAEpD,SAAS,wBAAwB;AAEjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,4BAA4B,mBAA8D;AAEnG,SAAS,kBAAkB,wBAAwB;AAwF5C,MAAM,+BAAmD;AAAA,EAC9D,OAAO;AAAA,EACP,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc,CAAC,OAAO,SAAS,EAAE;AAAA,EACjC,aAAa,CAAC,gBAAgB,OAAO,eAAe,EAAE,EAAE,YAAY;AAAA,EACpE,YAAY,CAAC,UAAW,UAAU,IAAI,WAAW,cAAW,KAAK;AAAA,EACjE,gBAAgB;AAAA,EAChB,cAAc;AAChB;AAIO,SAAS,sBAAsB,QAA0D;AAC9F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AAO,IAAI,YAAY,YAAwB;AAAA,MAC5D;AAAA,MAEC,qBAAC,UAAK,WAAU,oBAAmB;AAAA;AAAA,QAC9B,kBAAkB,KAAK,EAAE,aAAa,OAAO,aAAa,cAAc,CAAC,OAAO,IAAI,EAAE,GAAG,CAAC;AAAA,SAC/F;AAAA,OAEJ;AAAA,KACF;AAEJ;AAoCO,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,GAAgC;AAC9B,QAAM,SAAS,sBAAsB,UAAU;AAC/C,QAAM,OAAO,qBAAqB,cAAc;AAChD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA,WAAW,GAAG,aAAa,SAAS;AAAA,MAEpC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,OAAO;AAAA,YACd,MAAM,oBAAC,QAAK,eAAW,MAAC;AAAA,YACxB;AAAA,YACA,SAAS,MAAM,gBAAgB,CAAC,OAAO;AAAA;AAAA,QACzC;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;AAmBO,SAAS,mBAAmB,EAAE,QAAQ,WAAW,GAA4B;AAClF,QAAM,SAAS,sBAAsB,UAAU;AAC/C,SAAO,oBAAC,UAAK,uBAAoB,IAAI,iBAAO,OAAM;AACpD;","names":[]}
1
+ {"version":3,"sources":["../../src/feedback/feedback-table.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport type { MouseEvent, ReactElement, ReactNode } from \"react\";\nimport { ExternalLink } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { toLocalIso } from \"../lib/dates\";\nimport { EMPTY_FORMATTED_VALUE, formatDate, toDate } from \"../lib/format\";\nimport { useKitDateFormatter, useKitLabels, useKitLink, useKitLocale } from \"../i18n/kit-labels\";\nimport type { KitLinkProps } from \"../i18n/kit-labels\";\nimport { Chip } from \"../components/chip\";\nimport { FloatingAction, FloatingActionGroup } from \"../components/floating-panel\";\nimport type { FloatingCorner } from \"../components/floating-panel\";\nimport { pickLinkRenderer } from \"../components/text-link\";\nimport type { DataTableColumn } from \"../components/data-table\";\nimport {\n FEEDBACK_CATEGORY_ORDER,\n FEEDBACK_STATUS_META,\n FEEDBACK_STATUS_ORDER,\n FeedbackCategoryBadge,\n FeedbackStatusBadge,\n FeedbackStatusTransitions,\n feedbackCategoryRank,\n visibleFeedbackStatuses,\n type FeedbackStatus,\n} from \"./feedback-inbox\";\nimport {\n useFeedbackCategoryLabels,\n useFeedbackStatusLabels,\n type FeedbackCategoryLabels,\n type FeedbackStatusLabels,\n} from \"./feedback-labels\";\nimport { FEEDBACK_AWAITING_STATUSES, reworkCount, type FeedbackContext, type FeedbackRecord } from \"./feedback-record\";\nimport type { FeedbackStatusChange } from \"./feedback-status-undo\";\nimport { feedbackPageHref, feedbackPagePath } from \"./feedback-row-detail\";\nimport type { CommitScope } from \"../components/write-lock\";\n\n/**\n * The two feedback pages' TABLE — `/feedback` (the admin inbox) and `/my-feedback` (the\n * user's own) — as the kit's parts: §4.3 of the feedback contract\n * (docs/feedback-harmonization.md), lifted from keksdose\n * `frontend/src/features/feedback/feedback-page.tsx` (columns :711–963, the phone card\n * :1038–1065, the awaiting toggle :689–709 and :1086–1101).\n *\n * Until 0.27 each app wrote this table itself, and the three had drifted exactly where a\n * table drifts: kastlan's showed five statuses and no environment, Kurvenschmiede's one\n * page served both audiences, and keksdose's — the canon, argued over a year of feedback\n * items — had a latent bug of its own: its subject cell carries the environment and\n * rework chips \"so a second attempt is marked on every surface at once\" (:760), but the\n * phone card is a `mobileCard`, and `DataTable` never renders the `mobilePrimary` cell\n * when `mobileCard` is set (data-table.tsx, `cardInner`). Its phone cards showed neither\n * chip. {@link FeedbackMobileCard} draws both itself, from the same\n * {@link FeedbackSubject} the column uses, so the two surfaces cannot part again.\n *\n * What stays the app's: the rows (its API client), who is an admin, the routes and the\n * `/feedback` → `/my-feedback` redirect, the `?row=` deep link and the row detail. What\n * is here: the nine columns ({@link feedbackColumns} / {@link useFeedbackColumns}), the\n * phone card and its day headers ({@link FeedbackMobileCard},\n * {@link feedbackMobileGroupBy}), the phone's \"Only what is waiting for you\" toggle\n * ({@link FeedbackAwaitingToggle}), the empty state ({@link FeedbackEmptyState}) and the\n * `feedbackPage` words. The swipes are `feedbackSwipePlan` (feedback-swipe.tsx), passed\n * by the app because whether the page may write is the app's call.\n */\n\n/* ── Labels ─────────────────────────────────────────────────────────────────── */\n\n/**\n * `feedbackPage` — the words of the two feedback pages (§4.3). The English is keksdose's\n * `en.json` (`feedback.*`, `common.none`); the de-CH canon is noted on each key (keksdose\n * `de-CH.json`, ss never ß).\n */\nexport interface FeedbackPageLabels {\n /** The admin inbox's page title, `/feedback`. de-CH: \"Feedback\" */\n title: string;\n /** The user's own list, `/my-feedback`. de-CH: \"Mein Feedback\" */\n myTitle: string;\n /** Column 1, the id. de-CH: \"#\" */\n columnId: string;\n /** Column 2, when it was filed. de-CH: \"Datum\" */\n columnDate: string;\n /** Column 3. de-CH: \"Kategorie\" */\n columnCategory: string;\n /** Column 4, the title with its chips. de-CH: \"Betreff\" */\n columnSubject: string;\n /** Column 5, who filed it. de-CH: \"Nutzer\" */\n columnUser: string;\n /** Column 6. de-CH: \"E-Mail\" */\n columnEmail: string;\n /** Column 7, the page it was filed from. de-CH: \"URL\" */\n columnUrl: string;\n /** Column 8. de-CH: \"Status\" */\n columnStatus: string;\n /** Column 9, when it was settled. de-CH: \"Erledigt am\" */\n columnResolved: string;\n /** What the URL cell's link does, said before the path to a screen reader.\n * de-CH: \"Seite öffnen\" */\n openPage: string;\n /** The table with nothing to show, on both pages (§7.13) — keksdose's `common.none`.\n * de-CH: \"Keine\" */\n empty: string;\n /** The submitter of a report whose account was erased (`user_id: null`, keksdose live\n * #275). de-CH: \"<gelöschter Nutzer>\" */\n deletedUser: string;\n /** The submitter when neither a name nor an email is known — `id` is `user_id`.\n * de-CH: \"Nutzer #{{id}}\" */\n userFallback: (id: number) => string;\n /** The chip for a report filed from a copy of the app that is not production —\n * `environment` is `context.environment` as filed (\"dev\", \"local\", or the app's own\n * word). Upper-cased like the top bar's environment badge, so the marker the tester saw\n * is the marker triage sees. Guarded: a context is untyped JSON, so a value that is no\n * string (an app calling it with `context.environment` as stored) is printed, never\n * thrown on. de-CH: the same. */\n environment: (environment: string) => string;\n /** The chip for a report sent back for rework — `count` ≥ 1 is how many times\n * (`reworkCount`, keksdose live #331). de-CH: \"Nacharbeit\" / \"Nacharbeit ×{{count}}\" */\n reworkChip: (count: number) => string;\n /** The phone toggle narrowing the inbox to IN_EVALUATION + NEEDS_LIVE_TEST.\n * de-CH: \"Nur was auf Sie wartet\" */\n awaitingFilter: string;\n /** The name of the phone's floating group that holds it. de-CH: \"Feedback-Aktionen\" */\n phoneActions: string;\n}\n\nexport const DEFAULT_FEEDBACK_PAGE_LABELS: FeedbackPageLabels = {\n title: \"Feedback\",\n myTitle: \"My feedback\",\n columnId: \"#\",\n columnDate: \"Date\",\n columnCategory: \"Category\",\n columnSubject: \"Subject\",\n columnUser: \"User\",\n columnEmail: \"Email\",\n columnUrl: \"URL\",\n columnStatus: \"Status\",\n columnResolved: \"Resolved\",\n openPage: \"Open page\",\n empty: \"None\",\n deletedUser: \"<deleted user>\",\n userFallback: (id) => `user #${id}`,\n environment: (environment) => String(environment ?? \"\").toUpperCase(),\n reworkChip: (count) => (count === 1 ? \"Rework\" : `Rework ×${count}`),\n awaitingFilter: \"Only what is waiting for you\",\n phoneActions: \"Feedback actions\",\n};\n\n/** `feedbackPage` resolved: English, then `<UiKitProvider labels>`, then `labels`. The\n * page's title comes from here too: `mine ? labels.myTitle : labels.title`. */\nexport function useFeedbackPageLabels(labels?: Partial<FeedbackPageLabels>): FeedbackPageLabels {\n return useKitLabels(\"feedbackPage\", DEFAULT_FEEDBACK_PAGE_LABELS, labels);\n}\n\n/* ── Reading a row ──────────────────────────────────────────────────────────── */\n\n/** What the table reads off a report — {@link FeedbackRecord}'s fields, so an app's own\n * row type with more of them passes as it is. */\nexport type FeedbackTableRow = Pick<\n FeedbackRecord,\n \"id\" | \"user_id\" | \"user_email\" | \"title\" | \"body\" | \"category\" | \"status\" | \"context\" | \"resolved_at\" | \"created_at\"\n>;\n\n/** A context value as a trimmed string, or `\"\"` — every key is optional on read (§3.2)\n * and an app's own context type may say `unknown`. */\nfunction text(value: unknown): string {\n return typeof value === \"string\" ? value.trim() : \"\";\n}\n\n/**\n * The environment a report was filed from when it is NOT production, as filed — or\n * `null` (keksdose `environmentLabel`, :142). Production is silent, as the top bar's\n * badge is: the marker earns attention by being rare. A missing value is production too —\n * every row filed before a test copy existed, and crash rows filed before the crash\n * payload carried `environment` (§3.2, §3.6). An unknown value is shown rather than swallowed: an environment\n * nobody recognises is exactly when triage needs to see one.\n */\nexport function feedbackEnvironment(context: FeedbackContext | null | undefined): string | null {\n const env = text(context?.environment);\n return !env || env.toLowerCase() === \"prod\" ? null : env;\n}\n\n/**\n * Who filed a report, as one string (keksdose `submitterLabel`, :163): the display name,\n * else the email, else `userFallback(user_id)`. An erased account (`user_id: null`) is\n * `deletedUser` FIRST, ahead of the context: the server scrubs the name with the account,\n * but a row that somehow kept one must still not go on naming somebody who asked to be\n * forgotten. The joined `user_email` (admin list) is preferred to the context snapshot.\n */\nexport function feedbackSubmitter(\n row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">,\n labels: Pick<FeedbackPageLabels, \"deletedUser\" | \"userFallback\">,\n): string {\n if (row.user_id == null) return labels.deletedUser;\n return (\n text(row.context?.user_display_name) ||\n text(row.user_email) ||\n text(row.context?.user_email) ||\n labels.userFallback(row.user_id)\n );\n}\n\n/**\n * The submitter's email (keksdose `submitterEmail`, :175): the joined `user_email` —\n * authoritative, the display name is self-chosen (feedback #108) — else the context\n * snapshot, which is what `/my-feedback` has (`GET /feedback/my` sends no join). `\"\"`\n * for an erased account, for the reason {@link feedbackSubmitter} gives.\n */\nexport function feedbackSubmitterEmail(row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">): string {\n if (row.user_id == null) return \"\";\n return text(row.user_email) || text(row.context?.user_email);\n}\n\n/** Whether a status is one the phone's awaiting toggle keeps — `FEEDBACK_AWAITING_STATUSES`,\n * the two that wait on the person triaging. `rows.filter((r) => isFeedbackAwaiting(r.status))`. */\nexport function isFeedbackAwaiting(status: FeedbackStatus): boolean {\n return FEEDBACK_AWAITING_STATUSES.includes(status);\n}\n\n/* ── Dates ──────────────────────────────────────────────────────────────────── */\n\n/**\n * How the pages write a date: an ISO timestamp in, one string out. keksdose passes its\n * `useDateCell()` (the app's date-format preference, weekday and all — dev#546), which\n * fits as it is.\n *\n * ONE function for the date column, the resolved column, the phone card and the phone's\n * day headers, so the four cannot disagree (keksdose dev#546 round 3: the header is a\n * string and must say what the card says).\n */\nexport type FeedbackRenderDate = (iso: string) => string;\n\n/** The kit's own date, weekday included: \"Sun, 4 Oct 2026\" / \"So., 4. Okt. 2026\". A date\n * in a column carries its weekday (keksdose's rule, date-cell.tsx). */\nconst FEEDBACK_DATE_STYLE: Intl.DateTimeFormatOptions = {\n weekday: \"short\",\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n};\n\n/**\n * `renderDate` when the app gave one, else the kit's: the `<UiKitProvider formatDate>`\n * when the app set one (called with the LOCAL calendar day and `weekday: true`, as\n * `DateMark` calls it), else `Intl` in the provider's locale with the weekday. An\n * unparseable value is passed through rather than hidden.\n */\nexport function useFeedbackRenderDate(renderDate?: FeedbackRenderDate, locale?: string): FeedbackRenderDate {\n const kitLocale = useKitLocale(locale);\n const fromProvider = useKitDateFormatter();\n return useMemo<FeedbackRenderDate>(() => {\n if (renderDate) return renderDate;\n return (iso) => {\n const date = toDate(iso);\n if (!date) return iso || EMPTY_FORMATTED_VALUE;\n const own = fromProvider\n ? fromProvider(toLocalIso(date), { unit: \"day\", source: \"dateMark\", locale: kitLocale, weekday: true })\n : \"\";\n return own || formatDate(date, FEEDBACK_DATE_STYLE, { locale: kitLocale });\n };\n }, [renderDate, fromProvider, kitLocale]);\n}\n\n/** A date in a cell: `<time>`, nowrap, tabular figures; \"—\" when there is none. */\nfunction FeedbackDate({ value, renderDate }: { value: string | null | undefined; renderDate: FeedbackRenderDate }) {\n if (!value) return <span className=\"text-[var(--text-placeholder)]\">{EMPTY_FORMATTED_VALUE}</span>;\n return (\n <time dateTime={value} className=\"whitespace-nowrap tabular-nums text-[var(--text-muted)]\">\n {renderDate(value)}\n </time>\n );\n}\n\n/** An instant for sorting; a value that does not parse sorts with the empty ones. */\nfunction instant(value: string | null | undefined): number | null {\n const ms = value ? Date.parse(value) : NaN;\n return Number.isNaN(ms) ? null : ms;\n}\n\n/* ── The subject: title + environment chip + rework chip ───────────────────── */\n\nexport interface FeedbackSubjectProps {\n row: Pick<FeedbackRecord, \"title\" | \"body\" | \"context\">;\n /**\n * `false` (default): one line — the title truncates and the chips stay whole, as a\n * table cell wants. `true`: the title wraps and the chips flow after its last word, as\n * the phone card wants (a phone shows the whole title or nothing useful).\n */\n wrap?: boolean;\n /** Over the `feedbackPage` namespace. */\n labels?: Partial<FeedbackPageLabels>;\n className?: string;\n}\n\n/**\n * A report's title with its two chips (§4.3, column 4): the environment when it is not\n * production (keksdose's amber outline, the top bar's environment badge — the marker the\n * tester saw is the marker triage sees) and **Rework** / **Rework ×n** when the author has\n * sent it back (keksdose live #331: *\"have a new category for items in rework\"*, as a fact\n * derived from the body rather than a seventh status).\n *\n * No tooltip on either chip (keksdose dev#523): each already says what it means.\n */\nexport function FeedbackSubject({ row, wrap = false, labels: labelsProp, className }: FeedbackSubjectProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const env = feedbackEnvironment(row.context);\n const rounds = reworkCount(row.body ?? \"\");\n const chipClass = wrap ? \"ms-1.5 align-middle\" : \"shrink-0\";\n const chips = (\n <>\n {env && (\n <Chip size=\"sm\" variant=\"outline\" shape=\"square\" tone=\"warning\" caps className={chipClass} data-feedback-env=\"\">\n {labels.environment(env)}\n </Chip>\n )}\n {rounds > 0 && (\n <Chip size=\"sm\" tone=\"warning\" caps className={chipClass} data-feedback-rework={rounds}>\n {labels.reworkChip(rounds)}\n </Chip>\n )}\n </>\n );\n if (wrap) {\n return (\n <span className={cn(\"min-w-0 font-medium [overflow-wrap:anywhere]\", className)}>\n {row.title}\n {chips}\n </span>\n );\n }\n return (\n <span className={cn(\"inline-flex min-w-0 max-w-full items-center gap-1.5\", className)}>\n <span className=\"min-w-0 truncate font-medium\">{row.title}</span>\n {chips}\n </span>\n );\n}\n\n/* ── The URL cell ───────────────────────────────────────────────────────────── */\n\n/**\n * The page a report was filed from, as a link — the cell keksdose's column 7 draws\n * (:850): the path as text, path + query + hash as the `href`, read from `context.url`\n * else `context.route` by the row detail's own readers (`feedbackPagePath` /\n * `feedbackPageHref`, feedback-row-detail.tsx), so the column and the detail link the\n * same page the same way. A real link through the `<UiKitProvider linkComponent>` (the app's router, so it\n * does not reload the app; keksdose's plain `<a>` did), and its click stops at the cell so\n * the row does not open as well.\n *\n * Its name is the path, as on screen, with \"Open page\" said before it — keksdose's\n * `aria-label=\"Open page\"` replaced the path, so a screen reader heard forty identical\n * links down the column.\n */\nfunction FeedbackPageLinkCell({ context, openPage }: { context: FeedbackContext | null; openPage: string }) {\n const kitLink = useKitLink();\n const href = feedbackPageHref(context);\n const path = feedbackPagePath(context);\n if (!href || !path) return <span className=\"text-[var(--text-placeholder)]\">{EMPTY_FORMATTED_VALUE}</span>;\n const className =\n \"inline-flex min-w-0 max-w-full items-center gap-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:underline\";\n const children = (\n <>\n {/* The space outside the hidden span: a flex container drops it from the layout,\n and the accessible name keeps it (\"Open page /accounts\"). */}\n <span className=\"sr-only\">{openPage}</span>{\" \"}\n <code className=\"min-w-0 truncate text-xs\">{path}</code>\n <ExternalLink className=\"size-3 shrink-0\" aria-hidden />\n </>\n );\n const onClick = (event: MouseEvent<HTMLAnchorElement>) => event.stopPropagation();\n const render = pickLinkRenderer<KitLinkProps>(undefined, kitLink, href);\n return render ? (\n <RenderedLink render={render} href={href} className={className} onClick={onClick}>\n {children}\n </RenderedLink>\n ) : (\n <a href={href} className={className} onClick={onClick}>\n {children}\n </a>\n );\n}\n\n/** The provider's link, drawn by a component declared once (as FloatingAction's). */\nfunction RenderedLink({ render, ...props }: KitLinkProps & { render: (props: KitLinkProps) => ReactElement }) {\n return render(props);\n}\n\n/* ── The columns ────────────────────────────────────────────────────────────── */\n\n/** What {@link feedbackColumns} takes — every word already resolved (see\n * {@link useFeedbackColumns}, which resolves them from the provider). */\nexport interface FeedbackColumnsOptions {\n /** `/my-feedback`. The same nine columns (one page component, §4.3), but the status\n * cell is read-only there whatever `canEdit` says — \"no status or outcome editing\n * there (also for an admin)\". */\n mine?: boolean;\n /** The admin on `/feedback` — the status cell offers its steps. Otherwise it shows them\n * read-only. */\n canEdit: boolean;\n /** The undoable status change, `useFeedbackStatusUndo(update.mutate)` (§4.5) — the\n * same one the row detail and the swipes use. */\n onStatus: FeedbackStatusChange;\n /** See {@link FeedbackRenderDate}. */\n renderDate: FeedbackRenderDate;\n /** The status buttons SAVE when pressed: pass `true` to put them under the page's\n * `WriteLockProvider` (FeedbackStatusTransitions' `commit`). Off by default — a\n * feedback inbox is rarely what an app's lock is about. */\n commit?: CommitScope;\n labels: FeedbackPageLabels;\n statusLabels: FeedbackStatusLabels;\n categoryLabels: FeedbackCategoryLabels;\n}\n\n/** A status's place in the chain, unknown ones last (as `feedbackCategoryRank`). */\nfunction statusRank(status: FeedbackStatus): number {\n const at = FEEDBACK_STATUS_ORDER.indexOf(status);\n return at === -1 ? FEEDBACK_STATUS_ORDER.length : at;\n}\n\n/**\n * The nine columns of §4.3, in the contract's order, for `DataTable` — keksdose's\n * (:711–963) with the contract's changes:\n *\n * | # | key | cell | filter | phone |\n * |---|---|---|---|---|\n * | 1 | `id` | id, mono | number | hidden |\n * | 2 | `date` | `created_at`, weekday ({@link FeedbackRenderDate}) | date | |\n * | 3 | `category` | `FeedbackCategoryBadge`, sorted CRASH first | select, all five | |\n * | 4 | `title` | {@link FeedbackSubject} | text: title + environment | card heading |\n * | 5 | `user` | {@link feedbackSubmitter} | text: name + email, or \"deleted user\" | |\n * | 6 | `email` | {@link feedbackSubmitterEmail} | text | hidden |\n * | 7 | `url` | the page, a link (`noRowLink`) | text: path | hidden |\n * | 8 | `status` | `FeedbackStatusTransitions variant=\"icon\"`, `visibleFeedbackStatuses` | select, chain order | |\n * | 9 | `resolved` | `resolved_at` | date | hidden |\n *\n * - Both select filters list the WHOLE vocabulary in its own order, translated —\n * without `options` the popover lists the bare enum values found in the rows\n * (keksdose feedback #160), and kastlan's first CRASH row would otherwise appear in a\n * filter that never offered it.\n * - The status column owns the status filter, and only it (keksdose live #330's revert:\n * the phone's filter sheet already exposes every column filter).\n * - `/my-feedback` shows the same nine: the Email cell's context fallback exists for it\n * (the admin list's join is absent there, §3.1), and its phone card drops the submitter\n * instead ({@link FeedbackMobileCardProps.showSubmitter}).\n *\n * Pure: hand it resolved words, or use {@link useFeedbackColumns}. Keys are stable, so\n * an app may drop or add a column (`columns.filter((c) => c.key !== \"email\")`).\n */\nexport function feedbackColumns<T extends FeedbackTableRow>({\n mine = false,\n canEdit,\n onStatus,\n renderDate,\n commit,\n labels,\n statusLabels,\n categoryLabels,\n}: FeedbackColumnsOptions): DataTableColumn<T>[] {\n const editable = canEdit && !mine;\n return [\n {\n key: \"id\",\n header: labels.columnId,\n cell: (row) => <span className=\"font-mono text-xs text-[var(--text-muted)]\">{row.id}</span>,\n sortBy: (row) => row.id,\n filter: { type: \"number\", getValue: (row) => row.id },\n mobileHidden: true,\n },\n {\n key: \"date\",\n header: labels.columnDate,\n cell: (row) => <FeedbackDate value={row.created_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.created_at),\n filter: { type: \"date\", getValue: (row) => row.created_at },\n },\n {\n key: \"category\",\n header: labels.columnCategory,\n cell: (row) => <FeedbackCategoryBadge category={row.category} label={categoryLabels[row.category]} />,\n sortBy: (row) => feedbackCategoryRank(row.category),\n filter: {\n type: \"select\",\n getValue: (row) => row.category,\n options: FEEDBACK_CATEGORY_ORDER.map((value) => ({ value, label: categoryLabels[value] })),\n },\n },\n {\n key: \"title\",\n header: labels.columnSubject,\n cell: (row) => <FeedbackSubject row={row} labels={labels} />,\n sortBy: (row) => row.title,\n // Searchable by the environment too, so \"dev\" narrows to the test copy's reports —\n // a chip you can see but not filter by makes you read every row (keksdose :804).\n filterBy: (row) => {\n const env = feedbackEnvironment(row.context);\n return env ? `${row.title} ${labels.environment(env)}` : row.title;\n },\n mobilePrimary: true,\n },\n {\n key: \"user\",\n header: labels.columnUser,\n cell: (row) => <span className=\"text-[var(--text-secondary)]\">{feedbackSubmitter(row, labels)}</span>,\n sortBy: (row) => feedbackSubmitter(row, labels),\n // Name AND email, so either finds the person; the erased ones by the placeholder\n // (their context holds no name any more).\n filterBy: (row) =>\n row.user_id == null\n ? labels.deletedUser\n : `${feedbackSubmitter(row, labels)} ${feedbackSubmitterEmail(row)}`,\n },\n {\n key: \"email\",\n header: labels.columnEmail,\n // One line, like the URL beside it: keksdose's `break-all` let the browser squeeze\n // the column to its header and broke every address in two (\"user@exam / ple.test\"),\n // which made every row taller. Unbroken, a resized (pinned) column ellipsises it.\n className: \"whitespace-nowrap\",\n cell: (row) => {\n const email = feedbackSubmitterEmail(row);\n return email ? (\n <span className=\"text-[var(--text-secondary)]\">{email}</span>\n ) : (\n <span className=\"text-[var(--text-placeholder)]\">{EMPTY_FORMATTED_VALUE}</span>\n );\n },\n sortBy: feedbackSubmitterEmail,\n filterBy: feedbackSubmitterEmail,\n mobileHidden: true,\n },\n {\n key: \"url\",\n header: labels.columnUrl,\n // A cell only ellipsises what it is told not to wrap (keksdose live #348: the path\n // clipped mid-character \"behind the next column\").\n className: \"whitespace-nowrap\",\n // The cell IS a link, so the row's own permalink must never wrap it (keksdose\n // feedback #451: <a> in <a>, and \"open the page\" silently did nothing).\n noRowLink: true,\n cell: (row) => <FeedbackPageLinkCell context={row.context} openPage={labels.openPage} />,\n sortBy: (row) => feedbackPagePath(row.context) ?? \"\",\n filterBy: (row) => feedbackPagePath(row.context) ?? \"\",\n mobileHidden: true,\n },\n {\n key: \"status\",\n header: labels.columnStatus,\n // A KNOWN width: at most six 28px icon buttons (from IN_PROGRESS or IN_EVALUATION:\n // one step either way and the three off the chain) — keksdose live #348 sized it\n // for five and the sixth pushed the column wider.\n className: \"w-[13.5rem] whitespace-nowrap\",\n cell: (row) => (\n <FeedbackStatusTransitions\n status={row.status}\n statuses={visibleFeedbackStatuses(row.status)}\n canEdit={editable}\n commit={commit}\n onPick={(status) => onStatus(row, status)}\n variant=\"icon\"\n label={(status) => statusLabels[status]}\n />\n ),\n sortBy: (row) => statusRank(row.status),\n filter: {\n type: \"select\",\n getValue: (row) => row.status,\n options: FEEDBACK_STATUS_ORDER.map((value) => ({ value, label: statusLabels[value] })),\n },\n },\n {\n key: \"resolved\",\n header: labels.columnResolved,\n cell: (row) => <FeedbackDate value={row.resolved_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.resolved_at),\n filter: { type: \"date\", getValue: (row) => row.resolved_at },\n mobileHidden: true,\n },\n ];\n}\n\n/** What {@link useFeedbackColumns} takes: {@link FeedbackColumnsOptions} with the words\n * read from the provider, and `renderDate` optional. */\nexport interface UseFeedbackColumnsOptions\n extends Omit<FeedbackColumnsOptions, \"renderDate\" | \"labels\" | \"statusLabels\" | \"categoryLabels\"> {\n /** Default: the kit's date with the weekday ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** Over the `feedbackPage` namespace. Keep it stable (module scope or memoised): it is\n * a dependency of the memo. */\n labels?: Partial<FeedbackPageLabels>;\n}\n\n/**\n * {@link feedbackColumns} with the `feedbackPage`, `feedbackStatus` and\n * `feedbackCategory` words from the provider, memoised on what it reads — pass\n * `update.mutate` through `useFeedbackStatusUndo` (stable) rather than a fresh function\n * per render, or every row's columns are rebuilt on each render (keksdose :667).\n */\nexport function useFeedbackColumns<T extends FeedbackTableRow>({\n mine,\n canEdit,\n onStatus,\n renderDate: renderDateProp,\n commit,\n labels: labelsProp,\n}: UseFeedbackColumnsOptions): DataTableColumn<T>[] {\n const labels = useFeedbackPageLabels(labelsProp);\n const statusLabels = useFeedbackStatusLabels();\n const categoryLabels = useFeedbackCategoryLabels();\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return useMemo(\n () =>\n feedbackColumns<T>({ mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels }),\n [mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels],\n );\n}\n\n/* ── The phone ──────────────────────────────────────────────────────────────── */\n\n/**\n * The phone list's day headers (keksdose feedback #325: the list \"grouped by date, like\n * the transactions list\"): `DataTable mobileGroupBy={feedbackMobileGroupBy(renderDate)}`.\n *\n * The key IS the header — the same string the card's date says. DataTable groups runs of\n * equal keys, so the rows must come newest first, as `GET /feedback` and\n * `GET /feedback/my` send them (§3.3).\n */\nexport function feedbackMobileGroupBy(\n renderDate: FeedbackRenderDate,\n): (row: Pick<FeedbackRecord, \"created_at\">) => string {\n return (row) => renderDate(row.created_at);\n}\n\nexport interface FeedbackMobileCardProps {\n row: FeedbackTableRow;\n /** Add the submitter after the date — the admin inbox (`canEdit`). On `/my-feedback`\n * every row is the viewer's own and the name would repeat down the list. */\n showSubmitter?: boolean;\n /** See {@link FeedbackRenderDate}; the same function as the columns' and the day\n * headers'. Default: the kit's ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** Over the `feedbackPage` namespace. */\n labels?: Partial<FeedbackPageLabels>;\n}\n\n/**\n * One report as a phone card (§4.3; keksdose :1042, feedback #325 rework: *\"compact card\n * instead of a wasteful label/value row per field\"*): the title with its environment and\n * rework chips and the status badge on one line, then the compact category badge, the\n * date and (admin) the submitter beneath.\n *\n * `DataTable mobileCard={(row) => <FeedbackMobileCard row={row} … />}`. It draws the\n * chips itself: with a `mobileCard`, DataTable never renders the `mobilePrimary` cell,\n * which is how keksdose's cards lost them.\n */\nexport function FeedbackMobileCard({ row, showSubmitter = false, renderDate: renderDateProp, labels: labelsProp }: FeedbackMobileCardProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return (\n <div className=\"min-w-0 space-y-1\">\n <div className=\"flex items-start justify-between gap-2\">\n <FeedbackSubject row={row} wrap labels={labels} className=\"flex-1\" />\n {/* The pill the desktop status column draws, so a status is the same colour and\n glyph on both layouts. */}\n <FeedbackStatusBadge status={row.status} className=\"shrink-0\" />\n </div>\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-[var(--text-muted)]\">\n <FeedbackCategoryBadge category={row.category} compact />\n <FeedbackDate value={row.created_at} renderDate={renderDate} />\n {showSubmitter && (\n // The short id form: \"#7\" says enough on a card that has room for little.\n <span className=\"min-w-0 truncate\">\n · {feedbackSubmitter(row, { deletedUser: labels.deletedUser, userFallback: (id) => `#${id}` })}\n </span>\n )}\n </div>\n </div>\n );\n}\n\nexport interface FeedbackAwaitingToggleProps {\n /** Narrowed to what waits on the triager. Page state, not the URL (keksdose :699): a\n * thumb gesture on one screen, not a view worth linking to. */\n pressed: boolean;\n onPressedChange: (pressed: boolean) => void;\n /** Further `FloatingAction`s, after the toggle — the group is what makes them free. */\n children?: ReactNode;\n /** Default `bottom-end`, the register's corner. */\n corner?: FloatingCorner;\n /** Over the group's default distance from the bottom. */\n offset?: string;\n /** On the group. It is `md:hidden` already: the desktop has the status column's\n * filter, the same question asked where there is room for it. */\n className?: string;\n /** Over the `feedbackPage` namespace. */\n labels?: Partial<FeedbackPageLabels>;\n}\n\n/**\n * The phone inbox's one filter button — **\"Only what is waiting for you\"** (§4.3;\n * keksdose live #330 rework: *\"a button that toggles the evaluation items (in evaluation,\n * test when live) as toggle button similar to the show/hide upcoming/scheduled for the tx\n * page\"*).\n *\n * It narrows TO `FEEDBACK_AWAITING_STATUSES` rather than hiding them: after a loop run\n * those ARE the queue — the rows handed back for a verdict — and everything else is\n * history. A `FloatingActionGroup` with one member anyway, in the register's corner and\n * shape (keksdose feedback #58), so a second action costs nothing; the glyph is\n * IN_EVALUATION's own, so the button reads in the vocabulary of the badges it filters on.\n *\n * Admin inbox only: on `/my-feedback` the author is not waiting on their own verdict.\n * The filtering is the page's — `rows.filter((r) => isFeedbackAwaiting(r.status))` —\n * so the table's own filters, sort and URL stay untouched.\n */\nexport function FeedbackAwaitingToggle({\n pressed,\n onPressedChange,\n children,\n corner,\n offset,\n className,\n labels: labelsProp,\n}: FeedbackAwaitingToggleProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const Icon = FEEDBACK_STATUS_META.IN_EVALUATION.icon;\n return (\n <FloatingActionGroup\n aria-label={labels.phoneActions}\n corner={corner}\n offset={offset}\n className={cn(\"md:hidden\", className)}\n >\n <FloatingAction\n label={labels.awaitingFilter}\n icon={<Icon aria-hidden />}\n pressed={pressed}\n onClick={() => onPressedChange(!pressed)}\n />\n {children}\n </FloatingActionGroup>\n );\n}\n\n/* ── Empty ──────────────────────────────────────────────────────────────────── */\n\nexport interface FeedbackEmptyStateProps {\n /** Over the `feedbackPage` namespace. */\n labels?: Partial<FeedbackPageLabels>;\n}\n\n/**\n * The table with nothing to show (§7.13): the one word **None** / **Keine**, on both\n * pages — keksdose's `empty={t(\"common.none\")}` (`feedback-page.tsx:982`). No hint\n * beneath it: where reports are sent from is the feedback menu's business, and the inbox\n * needs no sentence to say it is empty.\n *\n * For `DataTable empty`, which sits in a centred, muted cell — so no box of its own.\n * keksdose passes it unconditionally, so a filter (or the awaiting toggle) that leaves\n * nothing says \"None\" too: `empty={<FeedbackEmptyState />}`.\n */\nexport function FeedbackEmptyState({ labels: labelsProp }: FeedbackEmptyStateProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n return <span data-feedback-empty=\"\">{labels.empty}</span>;\n}\n"],"mappings":";AAoQqB,SA4CjB,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AAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,GAAgC;AAC9B,QAAM,SAAS,sBAAsB,UAAU;AAC/C,QAAM,OAAO,qBAAqB,cAAc;AAChD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA,WAAW,GAAG,aAAa,SAAS;AAAA,MAEpC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,OAAO;AAAA,YACd,MAAM,oBAAC,QAAK,eAAW,MAAC;AAAA,YACxB;AAAA,YACA,SAAS,MAAM,gBAAgB,CAAC,OAAO;AAAA;AAAA,QACzC;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;AAmBO,SAAS,mBAAmB,EAAE,QAAQ,WAAW,GAA4B;AAClF,QAAM,SAAS,sBAAsB,UAAU;AAC/C,SAAO,oBAAC,UAAK,uBAAoB,IAAI,iBAAO,OAAM;AACpD;","names":[]}
@@ -1,18 +1,23 @@
1
1
  import 'react';
2
- export { C as ChatComposer, a as ChatComposerHandle, b as ChatComposerLabels, c as ChatComposerProps, d as ChatComposerSlotContext, g as DEFAULT_FEEDBACK_COMPOSER_LABELS, n as DEFAULT_FEEDBACK_THREAD_LABELS, V as FeedbackComposer, W as FeedbackComposerAttachment, X as FeedbackComposerHandle, Y as FeedbackComposerLabels, Z as FeedbackComposerProps, _ as FeedbackComposerSlotContext, aO as FeedbackThread, aP as FeedbackThreadAttachment, aQ as FeedbackThreadEvent, aR as FeedbackThreadItem, aS as FeedbackThreadLabels, aT as FeedbackThreadMessage, aU as FeedbackThreadProps } from '../delete-account-setting-Dy4kJgUm.js';
2
+ export { C as ChatComposer, a as ChatComposerHandle, b as ChatComposerLabels, c as ChatComposerProps, d as ChatComposerSlotContext, g as DEFAULT_FEEDBACK_COMPOSER_LABELS, n as DEFAULT_FEEDBACK_THREAD_LABELS, V as FeedbackComposer, W as FeedbackComposerAttachment, X as FeedbackComposerHandle, Y as FeedbackComposerLabels, Z as FeedbackComposerProps, _ as FeedbackComposerSlotContext, aO as FeedbackThread, aP as FeedbackThreadAttachment, aQ as FeedbackThreadEvent, aR as FeedbackThreadItem, aS as FeedbackThreadLabels, aT as FeedbackThreadMessage, aU as FeedbackThreadProps } from '../delete-account-setting-DAgGBrbn.js';
3
+ import '../components/write-lock.js';
3
4
  import '../components/tooltip.js';
4
5
  import '../hooks/use-anchored-rect.js';
5
6
  import '../lib/clipping.js';
6
- import '../data-table-labels-kpAAVi6g.js';
7
+ import '../data-table-labels-BJ5JE_X2.js';
7
8
  import '../components/data-table-sort.js';
8
9
  import '../components/swipeable-row.js';
10
+ import '../components/status-dot.js';
11
+ import '../components/progress-bar.js';
12
+ import '../components/signed-amount.js';
13
+ import '../components/stat-tile.js';
14
+ import '../components/chip.js';
15
+ import 'lucide-react';
16
+ import '../components/field-parts.js';
9
17
  import '../components/mini-calendar.js';
10
18
  import '../components/calendar-heatmap.js';
11
19
  import '../components/popover.js';
12
20
  import '../hooks/use-breakpoint.js';
13
- import '../components/chip.js';
14
- import 'lucide-react';
15
- import '../components/field-parts.js';
16
21
  import '../components/field-sync.js';
17
22
  import '../wizard/types.js';
18
23
  import '../tour/tour.js';
@@ -24,7 +29,6 @@ import '../components/page-contents.js';
24
29
  import '../components/series-chart-labels.js';
25
30
  import '../components/pie-chart-labels.js';
26
31
  import '../components/sparkline.js';
27
- import '../components/stat-tile.js';
28
32
  import '../components/signature-pad.js';
29
33
  import '../components/password-strength.js';
30
34
  import '../components/swatch-picker.js';
@@ -36,9 +40,6 @@ import '../hooks/use-search-param-state.js';
36
40
  import '../components/measured-grid.js';
37
41
  import '../components/user-avatar.js';
38
42
  import '../lib/person-name.js';
39
- import '../components/status-dot.js';
40
- import '../components/progress-bar.js';
41
- import '../components/signed-amount.js';
42
43
  import '../shell/topbar-action-menu.js';
43
44
  import '../components/menu-item.js';
44
45
  import '../components/floating-panel.js';
@@ -54,7 +55,6 @@ import '../components/error-boundary.js';
54
55
  import '../components/authed-image.js';
55
56
  import '../components/image-grid.js';
56
57
  import '../components/lightbox.js';
57
- import '../components/write-lock.js';
58
58
  import '../auth/sign-in-form.js';
59
59
  import '../landing/access.js';
60
60
  import '../landing/landing-labels.js';
@@ -81,6 +81,7 @@ import '../admin/admin-parts.js';
81
81
  import '../admin/admin-action-log.js';
82
82
  import '../settings/settings-labels.js';
83
83
  import '../demo/demo-labels.js';
84
+ import '../i18n/plurals.js';
84
85
  import '../components/appearance-labels.js';
85
86
  import '../theme/contrast.js';
86
87
  import '../theme/text-size.js';
@@ -7,6 +7,7 @@ import { formatDate, formatRelativeTime } from "../lib/format.js";
7
7
  import { Button, EmptyState, Spinner, Textarea } from "../components/ui.js";
8
8
  import { Skeleton } from "../components/skeleton.js";
9
9
  import { Tooltip } from "../components/tooltip.js";
10
+ import { useWriteLock } from "../components/write-lock.js";
10
11
  import { useKitFileLabels, useKitLabels, useKitLocale } from "../i18n/kit-labels.js";
11
12
  import { FeedbackAttachmentField } from "./feedback-attachment.js";
12
13
  const DEFAULT_FEEDBACK_THREAD_LABELS = {
@@ -236,6 +237,7 @@ function FeedbackComposer({
236
237
  canSend: canSendProp,
237
238
  sendOn = "mod-enter",
238
239
  disabledReason,
240
+ commit,
239
241
  rows = 3,
240
242
  maxLength,
241
243
  showCount,
@@ -251,6 +253,7 @@ function FeedbackComposer({
251
253
  ...rest
252
254
  }) {
253
255
  const labels = useKitLabels("feedbackComposer", DEFAULT_FEEDBACK_COMPOSER_LABELS, labelsProp);
256
+ const lock = useWriteLock(commit ?? false);
254
257
  const rootAttributes = { id, ...dataAttributes(rest) };
255
258
  const hintId = useId();
256
259
  const [ownDraft, setOwnDraft] = useState("");
@@ -298,7 +301,7 @@ function FeedbackComposer({
298
301
  return /* @__PURE__ */ jsx("p", { ...rootAttributes, className: cn("text-xs text-[var(--text-muted)]", className), children: disabledReason });
299
302
  }
300
303
  const tooLong = maxLength !== void 0 && draft.length > maxLength;
301
- const canSend = (canSendProp ?? draft.trim().length > 0) && !pending && !tooLong;
304
+ const canSend = (canSendProp ?? draft.trim().length > 0) && !pending && !tooLong && !lock.locked;
302
305
  const send = () => {
303
306
  if (!canSend) return;
304
307
  const sentDraft = draft;
@@ -373,6 +376,7 @@ function FeedbackComposer({
373
376
  {
374
377
  onClick: send,
375
378
  disabled: !canSend,
379
+ commit,
376
380
  "aria-busy": pending || void 0,
377
381
  size: size === "sm" ? "sm" : void 0,
378
382
  children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/feedback/feedback-thread.tsx"],"sourcesContent":["import { useEffect, useId, useImperativeHandle, useLayoutEffect, useRef, useState, useSyncExternalStore } from \"react\";\nimport type { ReactNode, Ref, RefObject } from \"react\";\nimport { ImageIcon, ImageOff, Paperclip, Send } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { formatDate, formatRelativeTime } from \"../lib/format\";\nimport { Button, EmptyState, Spinner, Textarea } from \"../components/ui\";\nimport type { CharacterCountLabels } from \"../components/ui\";\nimport { Skeleton } from \"../components/skeleton\";\nimport { Tooltip } from \"../components/tooltip\";\nimport { useKitFileLabels, useKitLabels, useKitLocale } from \"../i18n/kit-labels\";\nimport { FeedbackAttachmentField } from \"./feedback-attachment\";\nimport type { FeedbackAttachmentFieldSingleProps } from \"./feedback-attachment\";\nimport type { FeedbackNoteAttachment } from \"./feedback-inbox\";\nimport type { FeedbackAttachmentLabels } from \"./feedback-dialog\";\n\n/**\n * The conversation under a report: who said what, when, with what attached — and the\n * box to answer in.\n *\n * Both apps had written it by hand. kastlan's feedback page grew a comment list of\n * bordered boxes with `slate-*` literals (feedback-page.tsx, \"keksdose left this\n * unbuilt\"), and keksdose built the same thing a second time for support\n * (support-thread.tsx) with sides, bubbles and a composer that clears only what it\n * sent. This is that second one, generalised: the kit owns the look and the\n * behaviour, the app owns the data, the upload and every word it does not share.\n *\n * **Own vs other** is the caller's per message (`own`), not a comparison the kit makes\n * against a user id: whose message sits at the END side depends on who is reading,\n * and only the app knows that (keksdose's support thread labelled a member's question\n * \"Du\" in the admin panel the first time round, by reading the wrong field).\n *\n * **Redaction.** A thread is somebody's words about their own data — exactly what a\n * host's demo / screen-share mode blurs. Bodies, authors and attachments carry\n * `data-private` (the attribute `Tooltip redact` and `StatTile sensitive` use) unless\n * `redact={false}`.\n *\n * **RTL.** Sides are logical — `justify-end` is the reading end, and the bubble's\n * tucked corner is `rounded-ee` / `rounded-es` — and each body is `dir=\"auto\"`, so a\n * Hebrew reply in an English thread (or the reverse) lays out as its own language.\n *\n * **A chat, too** (keksdose G4/G5). keksdose's support chat is the same conversation\n * read the chat way: status lines between the messages (\"Closed automatically\",\n * \"Reopened\"), a day line where the date changes, clock times under it, Enter to send\n * and several files uploaded ahead of the send. Each of those is an opt-in here\n * (`kind: \"event\"`, `daySeparators`, `timeFormat=\"clock\"`, `sendOn=\"enter\"`,\n * `attachmentSlot` + `canSend`), so the feedback thread's defaults stay as they were.\n */\n\n/* ── Labels ───────────────────────────────────────────────────────────────── */\n\n/** The `feedbackThread` namespace of `<UiKitProvider labels>`. */\nexport interface FeedbackThreadLabels {\n /** Accessible name of the message list. */\n thread: string;\n empty: string;\n loading: string;\n /** Author line of an `own` message that has no `author` of its own. */\n you: string;\n /** The badge beside a `staff` author. */\n staff: string;\n /** Accessible name of a message's attachment list. */\n attachments: string;\n}\n\nexport const DEFAULT_FEEDBACK_THREAD_LABELS: FeedbackThreadLabels = {\n thread: \"Comments\",\n empty: \"No comments yet\",\n loading: \"Loading comments…\",\n you: \"You\",\n staff: \"Staff\",\n attachments: \"Attachments\",\n};\n\n/** The `feedbackComposer` namespace of `<UiKitProvider labels>`. The attach buttons'\n * words are `feedbackAttachment`'s, shared with the dialog and the note editor. */\nexport interface FeedbackComposerLabels {\n /** Accessible name of the text box. */\n field: string;\n placeholder: string;\n send: string;\n /** The shortcut line, given the platform's modifier (\"Ctrl\" or \"⌘\"). */\n sendHint: (modifier: string) => string;\n /** The shortcut line under `sendOn=\"enter\"` (keksdose G5): Enter sends, so say how a\n * new line is made. */\n sendHintEnter: string;\n}\n\nexport const DEFAULT_FEEDBACK_COMPOSER_LABELS: FeedbackComposerLabels = {\n field: \"Write a comment\",\n placeholder: \"Write a comment…\",\n send: \"Send\",\n sendHint: (modifier) => `${modifier} + Enter to send`,\n sendHintEnter: \"Enter to send, Shift + Enter for a new line\",\n};\n\n/* ── Thread ───────────────────────────────────────────────────────────────── */\n\nexport interface FeedbackThreadAttachment {\n id?: string | number;\n name: string;\n /** Where to open it. Left out, the attachment is listed by name only. */\n url?: string;\n /** MIME type; an `image/*` with a `url` is shown as a thumbnail. */\n type?: string;\n /** Bytes, shown beside a non-image. */\n size?: number;\n}\n\nexport interface FeedbackThreadMessage {\n /** Leave out, or `\"message\"`. `\"event\"` is a {@link FeedbackThreadEvent}. */\n kind?: \"message\";\n id: string | number;\n /** Who wrote it. Left out on an `own` message, it reads \"You\". */\n author?: ReactNode;\n /** A `Date`, an ISO string or epoch ms. */\n createdAt: Date | string | number;\n body: string;\n attachments?: readonly FeedbackThreadAttachment[];\n /** Written by whoever is reading: sits at the end side, in the brand tint. */\n own?: boolean;\n /** Written by the team rather than a user: gets the \"Staff\" badge. */\n staff?: boolean;\n}\n\n/**\n * A line in the thread that nobody wrote — \"Closed automatically\", \"Marked as\n * resolved\", \"Reopened\" — drawn centred and muted with its time, no author, no side,\n * no bubble.\n *\n * keksdose G4: its support chat interleaves these with the messages, and as a message\n * they came out as a bubble from nobody at the start side, which reads as the member\n * having said \"resolved\". Word it for the READER, as with `own`: the app knows whether\n * \"you reopened it\" or \"Anna reopened it\" is true for the person looking.\n *\n * The text is the app's, not somebody's words about their data, so it is NOT tagged\n * `data-private`; one that names a person can wrap the name in its own\n * `<span data-private>` (`body` is a node for that reason).\n */\nexport interface FeedbackThreadEvent {\n kind: \"event\";\n id: string | number;\n /** A `Date`, an ISO string or epoch ms. */\n createdAt: Date | string | number;\n body: ReactNode;\n}\n\n/** One row of a {@link FeedbackThread}: a message, or an event line between them. */\nexport type FeedbackThreadItem = FeedbackThreadMessage | FeedbackThreadEvent;\n\nexport interface FeedbackThreadProps {\n /** Oldest first. Event lines ({@link FeedbackThreadEvent}) sit among the messages. */\n messages: readonly FeedbackThreadItem[];\n loading?: boolean;\n /** Replaces the default \"No comments yet\". */\n empty?: ReactNode;\n /**\n * Draw one attachment yourself — for files behind auth, which a plain `<img src>`\n * cannot fetch (kastlan's `AuthedImage`), or a lightbox. The default is a thumbnail\n * link for an image with a `url`, a file link otherwise.\n */\n renderAttachment?: (attachment: FeedbackThreadAttachment, message: FeedbackThreadMessage) => ReactNode;\n /** Tag bodies, authors and attachments `data-private`. Default true. */\n redact?: boolean;\n /**\n * How a row's time reads. `\"relative\"` (default): \"5 minutes ago\", a date past six\n * days — right for a report's comments, read days apart. `\"clock\"`: the time of day\n * in the locale (\"14:05\", \"2:05 PM\") — the chat look, keksdose G4; pair it with\n * `daySeparators`, which say which day that clock time is on. Either way the full\n * date and time is in the Tooltip.\n */\n timeFormat?: \"relative\" | \"clock\";\n /**\n * A centred day line before the first row and wherever the next row is on another\n * calendar day (the device's zone): \"Today\", \"Yesterday\", else the date — keksdose\n * G4. \"Today\" / \"Yesterday\" are `Intl.RelativeTimeFormat`'s own words in the kit\n * locale, so there is no label to translate. Default false.\n */\n daySeparators?: boolean;\n /** \"Now\" for the relative times and the day lines — pin it in tests and stories.\n * Default: the clock. */\n now?: Date | number;\n /** Overrides the provider's locale for the times. */\n locale?: string;\n labels?: Partial<FeedbackThreadLabels>;\n className?: string;\n}\n\nexport function FeedbackThread({\n messages,\n loading = false,\n empty,\n renderAttachment,\n redact = true,\n now,\n locale: localeProp,\n timeFormat = \"relative\",\n daySeparators = false,\n labels: labelsProp,\n className,\n}: FeedbackThreadProps) {\n const labels = useKitLabels(\"feedbackThread\", DEFAULT_FEEDBACK_THREAD_LABELS, labelsProp);\n const locale = useKitLocale(localeProp);\n const file = useKitFileLabels();\n const priv = redact ? \"\" : undefined;\n const clock = useMinuteClock(now === undefined);\n const reference = now === undefined ? clock : +now;\n\n if (loading && messages.length === 0) {\n return <Skeleton lines={3} label={labels.loading} className={className} />;\n }\n if (messages.length === 0) {\n return (\n <EmptyState\n variant=\"inline\"\n size=\"sm\"\n title={empty ?? labels.empty}\n className={cn(\"justify-start\", className)}\n />\n );\n }\n\n // Per row, the calendar day of the last readable date up to it — what a day line\n // compares against.\n const days: (number | null)[] = [];\n for (const message of messages) {\n const date = toDate(message.createdAt);\n days.push(date ? dayNumber(date) : (days.at(-1) ?? null));\n }\n\n return (\n <ol aria-label={labels.thread} aria-busy={loading || undefined} className={cn(\"space-y-3\", className)}>\n {messages.flatMap((message, index) => {\n const date = toDate(message.createdAt);\n const time = date && (\n // The kit's Tooltip, not a native title: one tooltip look app-wide\n // (keksdose F0 / dev#523).\n <Tooltip label={new Intl.DateTimeFormat(locale, { dateStyle: \"full\", timeStyle: \"short\" }).format(date)}>\n <time dateTime={date.toISOString()} className=\"tabular-nums\">\n {timeFormat === \"clock\"\n ? formatDate(date, \"time\", { locale })\n : formatRelativeTime(date, {\n now: reference,\n locale,\n // Past the kit's day steps it is a date: \"2 weeks ago\" makes\n // the reader do arithmetic the date already did.\n absoluteAfterDays: 6.5,\n })}\n </time>\n </Tooltip>\n );\n const rows: ReactNode[] = [];\n const day = date && dayNumber(date);\n // Against the last row WITH a readable date: an unparseable one neither starts\n // a day nor hides the next change.\n if (daySeparators && date && day !== days[index - 1]) {\n rows.push(<DaySeparator key={`day-${message.id}`} date={date} now={reference} locale={locale} />);\n }\n if (message.kind === \"event\") {\n // A list item like the rest, so \"Reopened\" is read in its place, but not an\n // article: an article is somebody's post, and this has no author.\n rows.push(\n <li\n key={message.id}\n data-event=\"\"\n className=\"flex flex-wrap items-baseline justify-center gap-x-2 px-4 text-center text-xs text-[var(--text-muted)]\"\n >\n <span>{message.body}</span>\n {time && <span className=\"text-caption\">{time}</span>}\n </li>,\n );\n return rows;\n }\n const author = message.author ?? (message.own ? labels.you : null);\n const attachments = message.attachments ?? [];\n rows.push(\n <li\n key={message.id}\n className={cn(\"flex\", message.own ? \"justify-end\" : \"justify-start\")}\n data-own={message.own ? \"\" : undefined}\n >\n <article\n className={cn(\n \"max-w-[85%] min-w-0 rounded-lg px-3 py-2 text-sm\",\n message.own\n ? \"rounded-ee-sm bg-[var(--brand-bg)]\"\n : \"rounded-es-sm bg-[var(--bg-surface-2)]\",\n )}\n >\n <header className=\"mb-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-caption text-[var(--text-muted)]\">\n {author != null && (\n <span data-private={priv} className=\"font-medium text-[var(--text-secondary)]\">\n {author}\n </span>\n )}\n {message.staff && (\n <span className=\"rounded border border-[var(--border)] bg-[var(--bg-surface)] px-1 text-micro font-medium uppercase tracking-wide text-[var(--text-secondary)]\">\n {labels.staff}\n </span>\n )}\n {time}\n </header>\n {message.body && (\n <p\n data-private={priv}\n dir=\"auto\"\n className=\"whitespace-pre-wrap break-words text-start text-[var(--text-primary)]\"\n >\n {message.body}\n </p>\n )}\n {attachments.length > 0 && (\n <ul aria-label={labels.attachments} data-private={priv} className=\"mt-2 flex flex-wrap gap-2\">\n {attachments.map((attachment, index) => (\n <li key={attachment.id ?? `${index}-${attachment.name}`} className=\"min-w-0\">\n {renderAttachment ? (\n renderAttachment(attachment, message)\n ) : (\n <DefaultAttachment attachment={attachment} size={file.size} />\n )}\n </li>\n ))}\n </ul>\n )}\n </article>\n </li>,\n );\n return rows;\n })}\n </ol>\n );\n}\n\nfunction DefaultAttachment({\n attachment,\n size,\n}: {\n attachment: FeedbackThreadAttachment;\n size: (bytes: number) => string;\n}) {\n const { name, url, type } = attachment;\n if (url && type?.startsWith(\"image/\")) return <ImageThumbnail url={url} name={name} />;\n const content = (\n <>\n <Paperclip className=\"size-3.5 shrink-0\" aria-hidden />\n <span className=\"truncate\">{name}</span>\n {attachment.size !== undefined && (\n <span className=\"shrink-0 text-[var(--text-muted)]\">{size(attachment.size)}</span>\n )}\n </>\n );\n const chip =\n \"inline-flex max-w-full items-center gap-1 rounded border border-[var(--border)] bg-[var(--bg-surface)] px-2 py-1 text-xs text-[var(--text-secondary)]\";\n return url ? (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\" className={cn(chip, \"hover:bg-[var(--bg-hover)]\")}>\n {content}\n </a>\n ) : (\n <span className={chip}>{content}</span>\n );\n}\n\n/** An image attachment's thumbnail. The box is drawn before the picture arrives —\n * `loading=\"lazy\"` leaves it empty until it nears the viewport, and a URL that has\n * expired never fills it — and an empty bordered square read as a broken layout, not\n * as a picture. So the box carries an image glyph underneath until the picture\n * covers it, and swaps it for a broken-image glyph when the load fails. */\nfunction ImageThumbnail({ url, name }: { url: string; name: string }) {\n // Keyed on the URL, so a message whose attachment is replaced tries the new one.\n const [failedUrl, setFailedUrl] = useState<string | null>(null);\n const failed = failedUrl === url;\n const Glyph = failed ? ImageOff : ImageIcon;\n return (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"relative block h-20 w-20 overflow-hidden rounded border border-[var(--border)] bg-[var(--bg-surface-2)]\"\n >\n <Glyph aria-hidden className=\"absolute inset-0 m-auto size-6 text-[var(--text-muted)]\" />\n {!failed && (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- load/error are resource events, not interactions\n <img\n src={url}\n alt={name}\n loading=\"lazy\"\n onError={() => setFailedUrl(url)}\n className=\"relative h-full w-full object-cover\"\n />\n )}\n {/* The <img> and its alt are gone once it failed; the link still needs a name. */}\n {failed && <span className=\"sr-only\">{name}</span>}\n </a>\n );\n}\n\n/** The time, refreshed once a minute while `active`, so \"2 minutes ago\" does not stay\n * \"just now\" on a page left open. Read in state rather than in render, which must be\n * pure. */\nfunction useMinuteClock(active: boolean): number {\n const [time, setTime] = useState(() => Date.now());\n useEffect(() => {\n if (!active) return;\n const id = setInterval(() => setTime(Date.now()), 60_000);\n return () => clearInterval(id);\n }, [active]);\n return time;\n}\n\n/** The local calendar day as one number (20260926), for \"same day?\" and keys. */\nfunction dayNumber(date: Date): number {\n return date.getFullYear() * 10_000 + (date.getMonth() + 1) * 100 + date.getDate();\n}\n\n/**\n * The day line of `daySeparators` (keksdose G4): \"Today\" / \"Yesterday\" from\n * `Intl.RelativeTimeFormat` (`numeric: \"auto\"`) — the locale's own words, capitalised\n * for a line that stands alone (\"heute\" → \"Heute\"; a script without case is left as\n * is) — else the weekday and date, with the year only when it is not this one.\n *\n * Counted in calendar days, not 24-hour spans: 23:50 yesterday is \"Yesterday\" at\n * 00:10 today.\n */\nfunction DaySeparator({ date, now, locale }: { date: Date; now: number; locale: string | undefined }) {\n const today = new Date(now);\n const days = Math.round(\n (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) -\n Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())) /\n 86_400_000,\n );\n let label: string;\n if (days === 0 || days === -1) {\n const word = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" }).format(days + 0, \"day\");\n label = word.charAt(0).toLocaleUpperCase(locale) + word.slice(1);\n } else {\n label = formatDate(\n date,\n {\n weekday: \"long\",\n day: \"numeric\",\n month: \"long\",\n ...(date.getFullYear() === today.getFullYear() ? null : { year: \"numeric\" }),\n },\n { locale },\n );\n }\n const y = String(date.getFullYear()).padStart(4, \"0\");\n const m = String(date.getMonth() + 1).padStart(2, \"0\");\n const d = String(date.getDate()).padStart(2, \"0\");\n return (\n <li data-day-separator=\"\" className=\"flex items-center gap-3 py-1 text-xs text-[var(--text-muted)]\">\n <span aria-hidden className=\"h-px flex-1 bg-[var(--border)]\" />\n <time dateTime={`${y}-${m}-${d}`} className=\"font-medium\">\n {label}\n </time>\n <span aria-hidden className=\"h-px flex-1 bg-[var(--border)]\" />\n </li>\n );\n}\n\nfunction toDate(value: Date | string | number): Date | null {\n const date = value instanceof Date ? value : new Date(value);\n return Number.isNaN(date.getTime()) ? null : date;\n}\n\n/* ── Composer ─────────────────────────────────────────────────────────────── */\n\n/** What the composer's attach control takes — {@link FeedbackNoteAttachment} with the\n * labels optional, since the field reads `feedbackAttachment` from the provider, and\n * `onError` the field's own (0.23.0): it is handed the refused file and the limit too\n * (`FeedbackAttachmentErrorInfo`), and a `(kind) => …` handler still fits. Since\n * 0.24.0 also the field's `buttonVariant` / `buttonSize`, for a composer whose row\n * wants smaller or quieter attach buttons than the bordered `md` default. */\nexport type FeedbackComposerAttachment = Omit<FeedbackNoteAttachment, \"labels\" | \"onError\"> & {\n labels?: Partial<FeedbackAttachmentLabels>;\n onError?: FeedbackAttachmentFieldSingleProps[\"onError\"];\n} & Pick<FeedbackAttachmentFieldSingleProps, \"buttonVariant\" | \"buttonSize\">;\n\n/**\n * What a render-prop {@link FeedbackComposerProps.attachmentSlot} is handed (0.24.0,\n * keksdose).\n *\n * keksdose's support chat put `<FeedbackAttachmentField refs>` in the slot and a\n * screenshot pasted into the reply box never reached it: the box is the field's\n * sibling, so the paste bubbles to their common parent — the composer's root — and the\n * field hears it only through `pasteFrom`, which needs that root. The composer kept it\n * to itself, so keksdose wrapped the whole composer in a ref'd `<div>` of its own just\n * to have an element to hand over.\n */\nexport interface FeedbackComposerSlotContext {\n /**\n * The composer's root, round the text box and this slot — the field's `pasteFrom`,\n * as it is: `pasteFrom={slot.root}`.\n *\n * A ref, not the element, because `pasteFrom` is one: the field reads `.current` in\n * an effect, and the slot renders INSIDE this root, so the two are committed together\n * and React attaches the root before any effect of the slot's runs — the first paste\n * after the first paint already lands. The element itself would be `null` on the\n * first render (it does not exist yet) and could only arrive by a second render\n * through state; the ref is the same object every render, so the field's listener is\n * added once and never re-added.\n *\n * With the built-in `attachment` on as well, it listens on this root too: hand the\n * root to one field only, or an image pasted once is attached twice.\n */\n root: RefObject<HTMLElement | null>;\n /** The composer's `pending` — a send is in flight. For the field's `disabled`\n * (keksdose G5b): the message carries the attachments as they were at the press. */\n pending: boolean;\n}\n\nexport interface FeedbackComposerProps {\n /**\n * Send the comment. Return the promise: the box clears when it RESOLVES, and only of\n * what was sent — text typed while it was in flight stays. A rejection keeps\n * everything for a retry (surface the error yourself; the composer stays quiet).\n *\n * `attachment` is the built-in field's one picture. Files the host uploaded ahead\n * (`attachmentSlot`) are the host's state, read by the host here — and `body` may be\n * `\"\"` when `canSend` let an attachments-only message go.\n */\n onSend: (body: string, attachment: File | null) => void | Promise<unknown>;\n /** The send is in flight: a spinner on the button and no second send. */\n pending?: boolean;\n /** Offer one picture with the comment (file, paste or `onCaptureScreenshot`).\n * `true` for the defaults. Left out, the composer is text only. */\n attachment?: boolean | FeedbackComposerAttachment;\n /**\n * The host's own attach control, in the row with Send where the built-in field sits\n * (after it, if both are on) — keksdose G5: its support chat uploads up to N files\n * AHEAD of the send and sends their refs, which one `File` in `onSend` cannot carry.\n * The slot is the host's picker plus the chips of what is uploaded; the upload, the\n * refs and clearing them once `onSend` resolves stay with the host. Pair it with\n * `canSend`.\n *\n * A node, or (0.24.0) a function of {@link FeedbackComposerSlotContext} that returns\n * one — for a field that wants the composer's root as its `pasteFrom`, so a\n * screenshot pasted into the box reaches it, and `pending` for its `disabled`:\n *\n * ```tsx\n * attachmentSlot={({ root, pending }) => (\n * <FeedbackAttachmentField refs pasteFrom={root} disabled={pending} … />\n * )}\n * ```\n *\n * Called once per render of the composer, and not at all while `disabledReason`\n * stands in for it.\n */\n attachmentSlot?: ReactNode | ((slot: FeedbackComposerSlotContext) => ReactNode);\n /**\n * Whether Send is enabled, over the composer's own rule (some text in the box) —\n * for state the composer cannot see, i.e. `attachmentSlot`'s (keksdose G5): `true`\n * with files ready makes an empty draft sendable (`onSend(\"\", null)`), `false` while\n * an upload is still running holds even a written reply back. Left out, the text\n * decides. `pending` blocks a send either way, as does a draft past `maxLength`.\n */\n canSend?: boolean;\n /**\n * Which key sends. `\"mod-enter\"` (default): Ctrl/⌘+Enter, the report dialog's and\n * note editor's shortcut, with plain Enter a new line — feedback is written in\n * paragraphs. `\"enter\"`: the chat way (keksdose G5) — Enter sends, Shift+Enter is a\n * new line, Ctrl/⌘+Enter still sends; an Enter that confirms an IME composition\n * (Japanese, Chinese input) is the IME's, never a send.\n */\n sendOn?: \"mod-enter\" | \"enter\";\n /** Rendered INSTEAD of the composer — the thread is closed, or read-only for this\n * reader. */\n disabledReason?: ReactNode;\n rows?: number;\n /**\n * The longest draft the box takes, in UTF-16 code units as the browser counts — the\n * server's limit, so a reply too long for it is cut off while it is typed rather than\n * refused by a 422 after the press (keksdose G6: its support replies are capped at\n * 4,000 on the server, and its other text fields already count against that with\n * Textarea's `maxLength` + `showCount` since 0.22; the reply box, a composer, could\n * not). The box's own `maxLength`, so typing and pasting stop at it.\n *\n * {@link FeedbackComposerHandle.insertText} is not stopped by it — the browser limits\n * typing, not a script — and a canned reply is not cut mid-sentence to fit. A draft\n * past the limit therefore holds Send back (whatever `canSend` says, as `pending`\n * does) until it is trimmed; with `showCount` the counter, red at the limit, says by\n * how much.\n */\n maxLength?: number;\n /**\n * A live \"12/4000\" under the box, with `maxLength` — Textarea's `showCount`, the same\n * counter (keksdose G6): the count is part of the box's description, read with it on\n * focus, and a polite live region speaks only on entering the last stretch and at the\n * limit, never per keystroke. Under `size=\"sm\"` the hidden send hint stays the box's\n * description too, before the count. Ignored without `maxLength`.\n */\n showCount?: boolean;\n /** The counter's words — the `characterCount` namespace, as on Textarea. */\n countLabels?: Partial<CharacterCountLabels>;\n /**\n * The box's hint, over the `placeholder` label — keksdose F9: an admin answering a\n * support ticket is asked something else (\"Reply to Anna…\") than a member adding to\n * their own report, and one provider-wide label cannot say both.\n */\n placeholder?: string;\n /**\n * The draft, controlled — for a host that keeps it itself (saves it per ticket,\n * prefills a template). Left out, the composer keeps its own. Either way a send\n * that resolves clears only what was sent: controlled, that is an\n * `onValueChange(\"\")` the host receives like any keystroke, and only if the draft\n * is still the one that went out.\n */\n value?: string;\n /** Every change to the draft — typing, {@link FeedbackComposerHandle.insertText}, the\n * clear after a send. Required to change a controlled `value`. */\n onValueChange?: (value: string) => void;\n /** {@link FeedbackComposerHandle}: put text into the draft from outside (canned-reply\n * chips) or focus the box. */\n ref?: Ref<FeedbackComposerHandle>;\n labels?: Partial<FeedbackComposerLabels>;\n className?: string;\n /**\n * `\"sm\"` for a narrow host — keksdose's assistant launcher, a small floating panel\n * (0.22): a small Send button, and the send hint (\"Enter to send, Shift + Enter for a\n * new line\") hidden from view but kept as the box's description, so a keyboard or\n * screen-reader user still learns the shortcut. Default `\"md\"`.\n */\n size?: \"md\" | \"sm\";\n /**\n * On the composer's root — the box, or the `disabledReason` line in its place —\n * with any `data-*` attribute beside it (keksdose K17). keksdose's assistant tour\n * points at the chat box with `[data-tour=\"assistant-ask\"]`, and a composer that\n * dropped every attribute it was not told about left the anchor nowhere: the\n * assistant kept its hand-built box rather than lose the tour step.\n */\n id?: string;\n /** `data-*` attributes for the root, as `id` — a tour anchor, a test id. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n}\n\n/**\n * What a {@link FeedbackComposer} `ref` holds.\n *\n * keksdose F9: the support admin answers the same five questions all day and wants\n * chips above the box (\"Thanks, fixed in the next release\") that drop their text in\n * where the caret is. A controlled `value` alone cannot do that well — the host sees\n * the string, not the caret, so it could only append — so the composer, which owns\n * the textarea, does the splice.\n */\nexport interface FeedbackComposerHandle {\n /**\n * Insert `text` at the caret, replacing any selection (the caret the box last had:\n * a click on a chip blurs it, and the selection survives the blur), then focus the\n * box with the caret after the inserted text so the reply can go on. Nothing is\n * added around it — put a space or a newline in `text` if the reply needs one. A\n * no-op while `disabledReason` replaces the box.\n */\n insertText: (text: string) => void;\n focus: () => void;\n}\n\nconst noSubscribe = () => () => {};\nconst isApple = () =>\n typeof navigator !== \"undefined\" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform || navigator.userAgent);\n\n/**\n * The answer box under a {@link FeedbackThread}: a textarea, an optional picture,\n * and Send — Ctrl/⌘+Enter sends, the shortcut the report dialog and the note editor\n * use, so the habit carries across the feature. Plain Enter is a new line: feedback is\n * written in paragraphs, unlike a chat — which `sendOn=\"enter\"` is for (keksdose G5).\n */\nexport function FeedbackComposer({\n onSend,\n pending = false,\n attachment,\n attachmentSlot,\n canSend: canSendProp,\n sendOn = \"mod-enter\",\n disabledReason,\n rows = 3,\n maxLength,\n showCount,\n countLabels,\n placeholder,\n value,\n onValueChange,\n ref,\n labels: labelsProp,\n className,\n id,\n size = \"md\",\n ...rest\n}: FeedbackComposerProps) {\n const labels = useKitLabels(\"feedbackComposer\", DEFAULT_FEEDBACK_COMPOSER_LABELS, labelsProp);\n const rootAttributes = { id, ...dataAttributes(rest) };\n const hintId = useId();\n const [ownDraft, setOwnDraft] = useState(\"\");\n const controlled = value !== undefined;\n const draft = controlled ? value : ownDraft;\n const [file, setFile] = useState<File | null>(null);\n const root = useRef<HTMLDivElement>(null);\n const box = useRef<HTMLTextAreaElement>(null);\n // The draft as of the last commit. The send's `.then` and `insertText` run after\n // renders their closure did not see — text typed while the send was in flight, a\n // second chip clicked before the first one's render — and must not act on a stale\n // string (for a controlled draft there is no updater function to lean on).\n const latest = useRef(draft);\n useLayoutEffect(() => {\n latest.current = draft;\n });\n // Where the caret goes once an inserted text has rendered.\n const caret = useRef<number | null>(null);\n useLayoutEffect(() => {\n const el = box.current;\n if (caret.current === null || !el) return;\n el.focus();\n el.setSelectionRange(caret.current, caret.current);\n caret.current = null;\n });\n\n const setDraft = (next: string) => {\n latest.current = next;\n if (!controlled) setOwnDraft(next);\n onValueChange?.(next);\n };\n\n useImperativeHandle(ref, () => ({\n insertText: (text) => {\n const el = box.current;\n if (!el) return;\n const current = latest.current;\n // A second insert before the first has rendered goes after the first, not at the\n // textarea's not-yet-moved caret. Otherwise the textarea's selection, which may\n // be past the end of a controlled value the host has just shortened: clamp it.\n const pending = caret.current;\n const start = Math.min(pending ?? el.selectionStart ?? current.length, current.length);\n const end = pending ?? Math.max(start, Math.min(el.selectionEnd ?? start, current.length));\n caret.current = start + text.length;\n setDraft(current.slice(0, start) + text + current.slice(end));\n },\n focus: () => box.current?.focus(),\n }));\n // The server snapshot is \"Ctrl\"; the client corrects it after hydration.\n const modifier = useSyncExternalStore(\n noSubscribe,\n () => (isApple() ? \"⌘\" : \"Ctrl\"),\n () => \"Ctrl\",\n );\n\n if (disabledReason != null && disabledReason !== false) {\n return (\n <p {...rootAttributes} className={cn(\"text-xs text-[var(--text-muted)]\", className)}>\n {disabledReason}\n </p>\n );\n }\n\n // Longer than `maxLength` only through `insertText` or a controlled value (typing\n // stops at it): the server would refuse it, so it does not go.\n const tooLong = maxLength !== undefined && draft.length > maxLength;\n const canSend = (canSendProp ?? draft.trim().length > 0) && !pending && !tooLong;\n const send = () => {\n if (!canSend) return;\n const sentDraft = draft;\n const sentFile = file;\n Promise.resolve(onSend(draft.trim(), file))\n .then(() => {\n if (latest.current === sentDraft) setDraft(\"\");\n setFile((current) => (current === sentFile ? null : current));\n })\n .catch(() => {});\n };\n\n const config = attachment === true ? {} : attachment || null;\n // The slot is handed the ref OBJECT, for a field's `pasteFrom`, which reads `.current`\n // in an effect once the root is attached — nothing reads it during this render (see\n // FeedbackComposerSlotContext.root).\n const slot =\n typeof attachmentSlot === \"function\"\n ? // eslint-disable-next-line react-hooks/refs -- handed on for an effect, not read here\n attachmentSlot({ root, pending })\n : attachmentSlot;\n\n return (\n <div {...rootAttributes} ref={root} className={cn(\"space-y-2\", className)}>\n <Textarea\n rows={rows}\n dir=\"auto\"\n aria-label={labels.field}\n // Textarea puts the counter's description after this one, so under \"sm\" the box\n // reads \"Enter to send… 12 of 4000 characters\".\n aria-describedby={size === \"sm\" ? hintId : undefined}\n maxLength={maxLength}\n // Passed only when given: Textarea keeps a wrapper for a `showCount` it was\n // handed at all, and a composer without one keeps the DOM it had.\n {...(showCount !== undefined ? { showCount } : null)}\n countLabels={countLabels}\n ref={box}\n placeholder={placeholder ?? labels.placeholder}\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\") return;\n const mod = event.ctrlKey || event.metaKey;\n // Under \"enter\": plain Enter sends, Shift+Enter falls through to the\n // textarea's new line, and an Enter that ends an IME composition is the\n // IME's (keyCode 229 is how Safari reports it after the composition ended).\n const chat =\n sendOn === \"enter\" &&\n !event.shiftKey &&\n !event.altKey &&\n !event.nativeEvent.isComposing &&\n event.keyCode !== 229;\n if (mod || chat) {\n event.preventDefault();\n send();\n }\n }}\n />\n <div className=\"flex flex-wrap items-end justify-between gap-2\">\n {config || slot != null ? (\n <div className=\"flex min-w-0 flex-wrap items-end gap-2\">\n {config && (\n <FeedbackAttachmentField\n value={file}\n onChange={setFile}\n labels={config.labels}\n accept={config.accept}\n maxBytes={config.maxBytes}\n onError={config.onError}\n onCaptureScreenshot={config.onCaptureScreenshot}\n buttonVariant={config.buttonVariant}\n buttonSize={config.buttonSize}\n // The box is this field's sibling; a paste in it bubbles to `root`.\n pasteFrom={root}\n />\n )}\n {slot}\n </div>\n ) : (\n <span />\n )}\n <div className=\"ms-auto flex items-center gap-2\">\n <span\n id={hintId}\n className={size === \"sm\" ? \"sr-only\" : \"text-xs text-[var(--text-placeholder)]\"}\n >\n {sendOn === \"enter\" ? labels.sendHintEnter : labels.sendHint(modifier)}\n </span>\n <Button\n onClick={send}\n disabled={!canSend}\n aria-busy={pending || undefined}\n size={size === \"sm\" ? \"sm\" : undefined}\n >\n {pending ? (\n <Spinner label={null} className=\"size-4\" />\n ) : (\n <Send className=\"size-4 rtl:-scale-x-100\" aria-hidden />\n )}\n {labels.send}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/** The `data-*` entries of a rest-props object, and nothing else: whatever a caller\n * spread in that the composer does not know is not the root's to receive. */\nfunction dataAttributes(props: object): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(props)) if (key.startsWith(\"data-\")) out[key] = value;\n return out;\n}\n\n/**\n * {@link FeedbackComposer} under a name that is not about feedback (keksdose K17).\n *\n * The component was never feedback-specific: a textarea, an optional picture or a\n * host's upload slot, Send, `sendOn=\"enter\"` for the chat way. keksdose's assistant\n * and support chat are chats, not reports, and an import of `FeedbackComposer` there\n * reads as a mistake to the next person. The same function, not a wrapper, so the\n * two names cannot drift.\n */\nexport const ChatComposer = FeedbackComposer;\n/** {@link FeedbackComposerProps}, for {@link ChatComposer}. */\nexport type ChatComposerProps = FeedbackComposerProps;\n/** {@link FeedbackComposerHandle}, for {@link ChatComposer}. */\nexport type ChatComposerHandle = FeedbackComposerHandle;\n/** {@link FeedbackComposerLabels}, for {@link ChatComposer} — still the `feedbackComposer`\n * namespace of the provider. */\nexport type ChatComposerLabels = FeedbackComposerLabels;\n/** {@link FeedbackComposerSlotContext}, for {@link ChatComposer}'s `attachmentSlot`. */\nexport type ChatComposerSlotContext = FeedbackComposerSlotContext;\n"],"mappings":";AAgNW,SAsIP,UAtIO,KAqDC,YArDD;AAhNX,SAAS,WAAW,OAAO,qBAAqB,iBAAiB,QAAQ,UAAU,4BAA4B;AAE/G,SAAS,WAAW,UAAU,WAAW,YAAY;AACrD,SAAS,UAAU;AACnB,SAAS,YAAY,0BAA0B;AAC/C,SAAS,QAAQ,YAAY,SAAS,gBAAgB;AAEtD,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,kBAAkB,cAAc,oBAAoB;AAC7D,SAAS,+BAA+B;AAsDjC,MAAM,iCAAuD;AAAA,EAClE,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,aAAa;AACf;AAgBO,MAAM,mCAA2D;AAAA,EACtE,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,UAAU,CAAC,aAAa,GAAG,QAAQ;AAAA,EACnC,eAAe;AACjB;AA8FO,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR;AACF,GAAwB;AACtB,QAAM,SAAS,aAAa,kBA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AW,OAAO,EAAG,KAAI,GAAG,IAAI;AAC1F,SAAO;AACT;AAWO,MAAM,eAAe;","names":["index","pending"]}
1
+ {"version":3,"sources":["../../src/feedback/feedback-thread.tsx"],"sourcesContent":["import { useEffect, useId, useImperativeHandle, useLayoutEffect, useRef, useState, useSyncExternalStore } from \"react\";\nimport type { ReactNode, Ref, RefObject } from \"react\";\nimport { ImageIcon, ImageOff, Paperclip, Send } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { formatDate, formatRelativeTime } from \"../lib/format\";\nimport { Button, EmptyState, Spinner, Textarea } from \"../components/ui\";\nimport type { CharacterCountLabels } from \"../components/ui\";\nimport { Skeleton } from \"../components/skeleton\";\nimport { Tooltip } from \"../components/tooltip\";\nimport { useWriteLock } from \"../components/write-lock\";\nimport type { CommitScope } from \"../components/write-lock\";\nimport { useKitFileLabels, useKitLabels, useKitLocale } from \"../i18n/kit-labels\";\nimport { FeedbackAttachmentField } from \"./feedback-attachment\";\nimport type { FeedbackAttachmentFieldSingleProps } from \"./feedback-attachment\";\nimport type { FeedbackNoteAttachment } from \"./feedback-inbox\";\nimport type { FeedbackAttachmentLabels } from \"./feedback-dialog\";\n\n/**\n * The conversation under a report: who said what, when, with what attached — and the\n * box to answer in.\n *\n * Both apps had written it by hand. kastlan's feedback page grew a comment list of\n * bordered boxes with `slate-*` literals (feedback-page.tsx, \"keksdose left this\n * unbuilt\"), and keksdose built the same thing a second time for support\n * (support-thread.tsx) with sides, bubbles and a composer that clears only what it\n * sent. This is that second one, generalised: the kit owns the look and the\n * behaviour, the app owns the data, the upload and every word it does not share.\n *\n * **Own vs other** is the caller's per message (`own`), not a comparison the kit makes\n * against a user id: whose message sits at the END side depends on who is reading,\n * and only the app knows that (keksdose's support thread labelled a member's question\n * \"Du\" in the admin panel the first time round, by reading the wrong field).\n *\n * **Redaction.** A thread is somebody's words about their own data — exactly what a\n * host's demo / screen-share mode blurs. Bodies, authors and attachments carry\n * `data-private` (the attribute `Tooltip redact` and `StatTile sensitive` use) unless\n * `redact={false}`.\n *\n * **RTL.** Sides are logical — `justify-end` is the reading end, and the bubble's\n * tucked corner is `rounded-ee` / `rounded-es` — and each body is `dir=\"auto\"`, so a\n * Hebrew reply in an English thread (or the reverse) lays out as its own language.\n *\n * **A chat, too** (keksdose G4/G5). keksdose's support chat is the same conversation\n * read the chat way: status lines between the messages (\"Closed automatically\",\n * \"Reopened\"), a day line where the date changes, clock times under it, Enter to send\n * and several files uploaded ahead of the send. Each of those is an opt-in here\n * (`kind: \"event\"`, `daySeparators`, `timeFormat=\"clock\"`, `sendOn=\"enter\"`,\n * `attachmentSlot` + `canSend`), so the feedback thread's defaults stay as they were.\n */\n\n/* ── Labels ───────────────────────────────────────────────────────────────── */\n\n/** The `feedbackThread` namespace of `<UiKitProvider labels>`. */\nexport interface FeedbackThreadLabels {\n /** Accessible name of the message list. */\n thread: string;\n empty: string;\n loading: string;\n /** Author line of an `own` message that has no `author` of its own. */\n you: string;\n /** The badge beside a `staff` author. */\n staff: string;\n /** Accessible name of a message's attachment list. */\n attachments: string;\n}\n\nexport const DEFAULT_FEEDBACK_THREAD_LABELS: FeedbackThreadLabels = {\n thread: \"Comments\",\n empty: \"No comments yet\",\n loading: \"Loading comments…\",\n you: \"You\",\n staff: \"Staff\",\n attachments: \"Attachments\",\n};\n\n/** The `feedbackComposer` namespace of `<UiKitProvider labels>`. The attach buttons'\n * words are `feedbackAttachment`'s, shared with the dialog and the note editor. */\nexport interface FeedbackComposerLabels {\n /** Accessible name of the text box. */\n field: string;\n placeholder: string;\n send: string;\n /** The shortcut line, given the platform's modifier (\"Ctrl\" or \"⌘\"). */\n sendHint: (modifier: string) => string;\n /** The shortcut line under `sendOn=\"enter\"` (keksdose G5): Enter sends, so say how a\n * new line is made. */\n sendHintEnter: string;\n}\n\nexport const DEFAULT_FEEDBACK_COMPOSER_LABELS: FeedbackComposerLabels = {\n field: \"Write a comment\",\n placeholder: \"Write a comment…\",\n send: \"Send\",\n sendHint: (modifier) => `${modifier} + Enter to send`,\n sendHintEnter: \"Enter to send, Shift + Enter for a new line\",\n};\n\n/* ── Thread ───────────────────────────────────────────────────────────────── */\n\nexport interface FeedbackThreadAttachment {\n id?: string | number;\n name: string;\n /** Where to open it. Left out, the attachment is listed by name only. */\n url?: string;\n /** MIME type; an `image/*` with a `url` is shown as a thumbnail. */\n type?: string;\n /** Bytes, shown beside a non-image. */\n size?: number;\n}\n\nexport interface FeedbackThreadMessage {\n /** Leave out, or `\"message\"`. `\"event\"` is a {@link FeedbackThreadEvent}. */\n kind?: \"message\";\n id: string | number;\n /** Who wrote it. Left out on an `own` message, it reads \"You\". */\n author?: ReactNode;\n /** A `Date`, an ISO string or epoch ms. */\n createdAt: Date | string | number;\n body: string;\n attachments?: readonly FeedbackThreadAttachment[];\n /** Written by whoever is reading: sits at the end side, in the brand tint. */\n own?: boolean;\n /** Written by the team rather than a user: gets the \"Staff\" badge. */\n staff?: boolean;\n}\n\n/**\n * A line in the thread that nobody wrote — \"Closed automatically\", \"Marked as\n * resolved\", \"Reopened\" — drawn centred and muted with its time, no author, no side,\n * no bubble.\n *\n * keksdose G4: its support chat interleaves these with the messages, and as a message\n * they came out as a bubble from nobody at the start side, which reads as the member\n * having said \"resolved\". Word it for the READER, as with `own`: the app knows whether\n * \"you reopened it\" or \"Anna reopened it\" is true for the person looking.\n *\n * The text is the app's, not somebody's words about their data, so it is NOT tagged\n * `data-private`; one that names a person can wrap the name in its own\n * `<span data-private>` (`body` is a node for that reason).\n */\nexport interface FeedbackThreadEvent {\n kind: \"event\";\n id: string | number;\n /** A `Date`, an ISO string or epoch ms. */\n createdAt: Date | string | number;\n body: ReactNode;\n}\n\n/** One row of a {@link FeedbackThread}: a message, or an event line between them. */\nexport type FeedbackThreadItem = FeedbackThreadMessage | FeedbackThreadEvent;\n\nexport interface FeedbackThreadProps {\n /** Oldest first. Event lines ({@link FeedbackThreadEvent}) sit among the messages. */\n messages: readonly FeedbackThreadItem[];\n loading?: boolean;\n /** Replaces the default \"No comments yet\". */\n empty?: ReactNode;\n /**\n * Draw one attachment yourself — for files behind auth, which a plain `<img src>`\n * cannot fetch (kastlan's `AuthedImage`), or a lightbox. The default is a thumbnail\n * link for an image with a `url`, a file link otherwise.\n */\n renderAttachment?: (attachment: FeedbackThreadAttachment, message: FeedbackThreadMessage) => ReactNode;\n /** Tag bodies, authors and attachments `data-private`. Default true. */\n redact?: boolean;\n /**\n * How a row's time reads. `\"relative\"` (default): \"5 minutes ago\", a date past six\n * days — right for a report's comments, read days apart. `\"clock\"`: the time of day\n * in the locale (\"14:05\", \"2:05 PM\") — the chat look, keksdose G4; pair it with\n * `daySeparators`, which say which day that clock time is on. Either way the full\n * date and time is in the Tooltip.\n */\n timeFormat?: \"relative\" | \"clock\";\n /**\n * A centred day line before the first row and wherever the next row is on another\n * calendar day (the device's zone): \"Today\", \"Yesterday\", else the date — keksdose\n * G4. \"Today\" / \"Yesterday\" are `Intl.RelativeTimeFormat`'s own words in the kit\n * locale, so there is no label to translate. Default false.\n */\n daySeparators?: boolean;\n /** \"Now\" for the relative times and the day lines — pin it in tests and stories.\n * Default: the clock. */\n now?: Date | number;\n /** Overrides the provider's locale for the times. */\n locale?: string;\n labels?: Partial<FeedbackThreadLabels>;\n className?: string;\n}\n\nexport function FeedbackThread({\n messages,\n loading = false,\n empty,\n renderAttachment,\n redact = true,\n now,\n locale: localeProp,\n timeFormat = \"relative\",\n daySeparators = false,\n labels: labelsProp,\n className,\n}: FeedbackThreadProps) {\n const labels = useKitLabels(\"feedbackThread\", DEFAULT_FEEDBACK_THREAD_LABELS, labelsProp);\n const locale = useKitLocale(localeProp);\n const file = useKitFileLabels();\n const priv = redact ? \"\" : undefined;\n const clock = useMinuteClock(now === undefined);\n const reference = now === undefined ? clock : +now;\n\n if (loading && messages.length === 0) {\n return <Skeleton lines={3} label={labels.loading} className={className} />;\n }\n if (messages.length === 0) {\n return (\n <EmptyState\n variant=\"inline\"\n size=\"sm\"\n title={empty ?? labels.empty}\n className={cn(\"justify-start\", className)}\n />\n );\n }\n\n // Per row, the calendar day of the last readable date up to it — what a day line\n // compares against.\n const days: (number | null)[] = [];\n for (const message of messages) {\n const date = toDate(message.createdAt);\n days.push(date ? dayNumber(date) : (days.at(-1) ?? null));\n }\n\n return (\n <ol aria-label={labels.thread} aria-busy={loading || undefined} className={cn(\"space-y-3\", className)}>\n {messages.flatMap((message, index) => {\n const date = toDate(message.createdAt);\n const time = date && (\n // The kit's Tooltip, not a native title: one tooltip look app-wide\n // (keksdose F0 / dev#523).\n <Tooltip label={new Intl.DateTimeFormat(locale, { dateStyle: \"full\", timeStyle: \"short\" }).format(date)}>\n <time dateTime={date.toISOString()} className=\"tabular-nums\">\n {timeFormat === \"clock\"\n ? formatDate(date, \"time\", { locale })\n : formatRelativeTime(date, {\n now: reference,\n locale,\n // Past the kit's day steps it is a date: \"2 weeks ago\" makes\n // the reader do arithmetic the date already did.\n absoluteAfterDays: 6.5,\n })}\n </time>\n </Tooltip>\n );\n const rows: ReactNode[] = [];\n const day = date && dayNumber(date);\n // Against the last row WITH a readable date: an unparseable one neither starts\n // a day nor hides the next change.\n if (daySeparators && date && day !== days[index - 1]) {\n rows.push(<DaySeparator key={`day-${message.id}`} date={date} now={reference} locale={locale} />);\n }\n if (message.kind === \"event\") {\n // A list item like the rest, so \"Reopened\" is read in its place, but not an\n // article: an article is somebody's post, and this has no author.\n rows.push(\n <li\n key={message.id}\n data-event=\"\"\n className=\"flex flex-wrap items-baseline justify-center gap-x-2 px-4 text-center text-xs text-[var(--text-muted)]\"\n >\n <span>{message.body}</span>\n {time && <span className=\"text-caption\">{time}</span>}\n </li>,\n );\n return rows;\n }\n const author = message.author ?? (message.own ? labels.you : null);\n const attachments = message.attachments ?? [];\n rows.push(\n <li\n key={message.id}\n className={cn(\"flex\", message.own ? \"justify-end\" : \"justify-start\")}\n data-own={message.own ? \"\" : undefined}\n >\n <article\n className={cn(\n \"max-w-[85%] min-w-0 rounded-lg px-3 py-2 text-sm\",\n message.own\n ? \"rounded-ee-sm bg-[var(--brand-bg)]\"\n : \"rounded-es-sm bg-[var(--bg-surface-2)]\",\n )}\n >\n <header className=\"mb-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-caption text-[var(--text-muted)]\">\n {author != null && (\n <span data-private={priv} className=\"font-medium text-[var(--text-secondary)]\">\n {author}\n </span>\n )}\n {message.staff && (\n <span className=\"rounded border border-[var(--border)] bg-[var(--bg-surface)] px-1 text-micro font-medium uppercase tracking-wide text-[var(--text-secondary)]\">\n {labels.staff}\n </span>\n )}\n {time}\n </header>\n {message.body && (\n <p\n data-private={priv}\n dir=\"auto\"\n className=\"whitespace-pre-wrap break-words text-start text-[var(--text-primary)]\"\n >\n {message.body}\n </p>\n )}\n {attachments.length > 0 && (\n <ul aria-label={labels.attachments} data-private={priv} className=\"mt-2 flex flex-wrap gap-2\">\n {attachments.map((attachment, index) => (\n <li key={attachment.id ?? `${index}-${attachment.name}`} className=\"min-w-0\">\n {renderAttachment ? (\n renderAttachment(attachment, message)\n ) : (\n <DefaultAttachment attachment={attachment} size={file.size} />\n )}\n </li>\n ))}\n </ul>\n )}\n </article>\n </li>,\n );\n return rows;\n })}\n </ol>\n );\n}\n\nfunction DefaultAttachment({\n attachment,\n size,\n}: {\n attachment: FeedbackThreadAttachment;\n size: (bytes: number) => string;\n}) {\n const { name, url, type } = attachment;\n if (url && type?.startsWith(\"image/\")) return <ImageThumbnail url={url} name={name} />;\n const content = (\n <>\n <Paperclip className=\"size-3.5 shrink-0\" aria-hidden />\n <span className=\"truncate\">{name}</span>\n {attachment.size !== undefined && (\n <span className=\"shrink-0 text-[var(--text-muted)]\">{size(attachment.size)}</span>\n )}\n </>\n );\n const chip =\n \"inline-flex max-w-full items-center gap-1 rounded border border-[var(--border)] bg-[var(--bg-surface)] px-2 py-1 text-xs text-[var(--text-secondary)]\";\n return url ? (\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\" className={cn(chip, \"hover:bg-[var(--bg-hover)]\")}>\n {content}\n </a>\n ) : (\n <span className={chip}>{content}</span>\n );\n}\n\n/** An image attachment's thumbnail. The box is drawn before the picture arrives —\n * `loading=\"lazy\"` leaves it empty until it nears the viewport, and a URL that has\n * expired never fills it — and an empty bordered square read as a broken layout, not\n * as a picture. So the box carries an image glyph underneath until the picture\n * covers it, and swaps it for a broken-image glyph when the load fails. */\nfunction ImageThumbnail({ url, name }: { url: string; name: string }) {\n // Keyed on the URL, so a message whose attachment is replaced tries the new one.\n const [failedUrl, setFailedUrl] = useState<string | null>(null);\n const failed = failedUrl === url;\n const Glyph = failed ? ImageOff : ImageIcon;\n return (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"relative block h-20 w-20 overflow-hidden rounded border border-[var(--border)] bg-[var(--bg-surface-2)]\"\n >\n <Glyph aria-hidden className=\"absolute inset-0 m-auto size-6 text-[var(--text-muted)]\" />\n {!failed && (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- load/error are resource events, not interactions\n <img\n src={url}\n alt={name}\n loading=\"lazy\"\n onError={() => setFailedUrl(url)}\n className=\"relative h-full w-full object-cover\"\n />\n )}\n {/* The <img> and its alt are gone once it failed; the link still needs a name. */}\n {failed && <span className=\"sr-only\">{name}</span>}\n </a>\n );\n}\n\n/** The time, refreshed once a minute while `active`, so \"2 minutes ago\" does not stay\n * \"just now\" on a page left open. Read in state rather than in render, which must be\n * pure. */\nfunction useMinuteClock(active: boolean): number {\n const [time, setTime] = useState(() => Date.now());\n useEffect(() => {\n if (!active) return;\n const id = setInterval(() => setTime(Date.now()), 60_000);\n return () => clearInterval(id);\n }, [active]);\n return time;\n}\n\n/** The local calendar day as one number (20260926), for \"same day?\" and keys. */\nfunction dayNumber(date: Date): number {\n return date.getFullYear() * 10_000 + (date.getMonth() + 1) * 100 + date.getDate();\n}\n\n/**\n * The day line of `daySeparators` (keksdose G4): \"Today\" / \"Yesterday\" from\n * `Intl.RelativeTimeFormat` (`numeric: \"auto\"`) — the locale's own words, capitalised\n * for a line that stands alone (\"heute\" → \"Heute\"; a script without case is left as\n * is) — else the weekday and date, with the year only when it is not this one.\n *\n * Counted in calendar days, not 24-hour spans: 23:50 yesterday is \"Yesterday\" at\n * 00:10 today.\n */\nfunction DaySeparator({ date, now, locale }: { date: Date; now: number; locale: string | undefined }) {\n const today = new Date(now);\n const days = Math.round(\n (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) -\n Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())) /\n 86_400_000,\n );\n let label: string;\n if (days === 0 || days === -1) {\n const word = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" }).format(days + 0, \"day\");\n label = word.charAt(0).toLocaleUpperCase(locale) + word.slice(1);\n } else {\n label = formatDate(\n date,\n {\n weekday: \"long\",\n day: \"numeric\",\n month: \"long\",\n ...(date.getFullYear() === today.getFullYear() ? null : { year: \"numeric\" }),\n },\n { locale },\n );\n }\n const y = String(date.getFullYear()).padStart(4, \"0\");\n const m = String(date.getMonth() + 1).padStart(2, \"0\");\n const d = String(date.getDate()).padStart(2, \"0\");\n return (\n <li data-day-separator=\"\" className=\"flex items-center gap-3 py-1 text-xs text-[var(--text-muted)]\">\n <span aria-hidden className=\"h-px flex-1 bg-[var(--border)]\" />\n <time dateTime={`${y}-${m}-${d}`} className=\"font-medium\">\n {label}\n </time>\n <span aria-hidden className=\"h-px flex-1 bg-[var(--border)]\" />\n </li>\n );\n}\n\nfunction toDate(value: Date | string | number): Date | null {\n const date = value instanceof Date ? value : new Date(value);\n return Number.isNaN(date.getTime()) ? null : date;\n}\n\n/* ── Composer ─────────────────────────────────────────────────────────────── */\n\n/** What the composer's attach control takes — {@link FeedbackNoteAttachment} with the\n * labels optional, since the field reads `feedbackAttachment` from the provider, and\n * `onError` the field's own (0.23.0): it is handed the refused file and the limit too\n * (`FeedbackAttachmentErrorInfo`), and a `(kind) => …` handler still fits. Since\n * 0.24.0 also the field's `buttonVariant` / `buttonSize`, for a composer whose row\n * wants smaller or quieter attach buttons than the bordered `md` default. */\nexport type FeedbackComposerAttachment = Omit<FeedbackNoteAttachment, \"labels\" | \"onError\"> & {\n labels?: Partial<FeedbackAttachmentLabels>;\n onError?: FeedbackAttachmentFieldSingleProps[\"onError\"];\n} & Pick<FeedbackAttachmentFieldSingleProps, \"buttonVariant\" | \"buttonSize\">;\n\n/**\n * What a render-prop {@link FeedbackComposerProps.attachmentSlot} is handed (0.24.0,\n * keksdose).\n *\n * keksdose's support chat put `<FeedbackAttachmentField refs>` in the slot and a\n * screenshot pasted into the reply box never reached it: the box is the field's\n * sibling, so the paste bubbles to their common parent — the composer's root — and the\n * field hears it only through `pasteFrom`, which needs that root. The composer kept it\n * to itself, so keksdose wrapped the whole composer in a ref'd `<div>` of its own just\n * to have an element to hand over.\n */\nexport interface FeedbackComposerSlotContext {\n /**\n * The composer's root, round the text box and this slot — the field's `pasteFrom`,\n * as it is: `pasteFrom={slot.root}`.\n *\n * A ref, not the element, because `pasteFrom` is one: the field reads `.current` in\n * an effect, and the slot renders INSIDE this root, so the two are committed together\n * and React attaches the root before any effect of the slot's runs — the first paste\n * after the first paint already lands. The element itself would be `null` on the\n * first render (it does not exist yet) and could only arrive by a second render\n * through state; the ref is the same object every render, so the field's listener is\n * added once and never re-added.\n *\n * With the built-in `attachment` on as well, it listens on this root too: hand the\n * root to one field only, or an image pasted once is attached twice.\n */\n root: RefObject<HTMLElement | null>;\n /** The composer's `pending` — a send is in flight. For the field's `disabled`\n * (keksdose G5b): the message carries the attachments as they were at the press. */\n pending: boolean;\n}\n\nexport interface FeedbackComposerProps {\n /**\n * Send the comment. Return the promise: the box clears when it RESOLVES, and only of\n * what was sent — text typed while it was in flight stays. A rejection keeps\n * everything for a retry (surface the error yourself; the composer stays quiet).\n *\n * `attachment` is the built-in field's one picture. Files the host uploaded ahead\n * (`attachmentSlot`) are the host's state, read by the host here — and `body` may be\n * `\"\"` when `canSend` let an attachments-only message go.\n */\n onSend: (body: string, attachment: File | null) => void | Promise<unknown>;\n /** The send is in flight: a spinner on the button and no second send. */\n pending?: boolean;\n /** Offer one picture with the comment (file, paste or `onCaptureScreenshot`).\n * `true` for the defaults. Left out, the composer is text only. */\n attachment?: boolean | FeedbackComposerAttachment;\n /**\n * The host's own attach control, in the row with Send where the built-in field sits\n * (after it, if both are on) — keksdose G5: its support chat uploads up to N files\n * AHEAD of the send and sends their refs, which one `File` in `onSend` cannot carry.\n * The slot is the host's picker plus the chips of what is uploaded; the upload, the\n * refs and clearing them once `onSend` resolves stay with the host. Pair it with\n * `canSend`.\n *\n * A node, or (0.24.0) a function of {@link FeedbackComposerSlotContext} that returns\n * one — for a field that wants the composer's root as its `pasteFrom`, so a\n * screenshot pasted into the box reaches it, and `pending` for its `disabled`:\n *\n * ```tsx\n * attachmentSlot={({ root, pending }) => (\n * <FeedbackAttachmentField refs pasteFrom={root} disabled={pending} … />\n * )}\n * ```\n *\n * Called once per render of the composer, and not at all while `disabledReason`\n * stands in for it.\n */\n attachmentSlot?: ReactNode | ((slot: FeedbackComposerSlotContext) => ReactNode);\n /**\n * Whether Send is enabled, over the composer's own rule (some text in the box) —\n * for state the composer cannot see, i.e. `attachmentSlot`'s (keksdose G5): `true`\n * with files ready makes an empty draft sendable (`onSend(\"\", null)`), `false` while\n * an upload is still running holds even a written reply back. Left out, the text\n * decides. `pending` blocks a send either way, as does a draft past `maxLength`.\n */\n canSend?: boolean;\n /**\n * Which key sends. `\"mod-enter\"` (default): Ctrl/⌘+Enter, the report dialog's and\n * note editor's shortcut, with plain Enter a new line — feedback is written in\n * paragraphs. `\"enter\"`: the chat way (keksdose G5) — Enter sends, Shift+Enter is a\n * new line, Ctrl/⌘+Enter still sends; an Enter that confirms an IME composition\n * (Japanese, Chinese input) is the IME's, never a send.\n */\n sendOn?: \"mod-enter\" | \"enter\";\n /** Rendered INSTEAD of the composer — the thread is closed, or read-only for this\n * reader. */\n disabledReason?: ReactNode;\n /**\n * Send COMMITS (0.33.1, kastlan's assistant): under a locked {@link WriteLockProvider}\n * Send is disabled the `disabledReason` way — focusable, the lock's reason in its\n * tooltip and description, as on {@link Button}'s `commit` — and neither Enter nor\n * Ctrl/⌘+Enter sends. The box stays editable and the draft stays: nothing in it\n * reaches the server until Send, and the lock may lift. No provider, or an unlocked\n * one: no effect. A {@link CommitScope}: kastlan's assistant answers under the demo\n * and not under a lapsed plan (its backend's 402), so it passes\n * `commit={{ except: [\"demo\"] }}` where it read `useWriteLock` and fed `canSend` and a\n * reason by hand. Not the prop above: that one replaces the box, this one keeps it.\n */\n commit?: CommitScope;\n rows?: number;\n /**\n * The longest draft the box takes, in UTF-16 code units as the browser counts — the\n * server's limit, so a reply too long for it is cut off while it is typed rather than\n * refused by a 422 after the press (keksdose G6: its support replies are capped at\n * 4,000 on the server, and its other text fields already count against that with\n * Textarea's `maxLength` + `showCount` since 0.22; the reply box, a composer, could\n * not). The box's own `maxLength`, so typing and pasting stop at it.\n *\n * {@link FeedbackComposerHandle.insertText} is not stopped by it — the browser limits\n * typing, not a script — and a canned reply is not cut mid-sentence to fit. A draft\n * past the limit therefore holds Send back (whatever `canSend` says, as `pending`\n * does) until it is trimmed; with `showCount` the counter, red at the limit, says by\n * how much.\n */\n maxLength?: number;\n /**\n * A live \"12/4000\" under the box, with `maxLength` — Textarea's `showCount`, the same\n * counter (keksdose G6): the count is part of the box's description, read with it on\n * focus, and a polite live region speaks only on entering the last stretch and at the\n * limit, never per keystroke. Under `size=\"sm\"` the hidden send hint stays the box's\n * description too, before the count. Ignored without `maxLength`.\n */\n showCount?: boolean;\n /** The counter's words — the `characterCount` namespace, as on Textarea. */\n countLabels?: Partial<CharacterCountLabels>;\n /**\n * The box's hint, over the `placeholder` label — keksdose F9: an admin answering a\n * support ticket is asked something else (\"Reply to Anna…\") than a member adding to\n * their own report, and one provider-wide label cannot say both.\n */\n placeholder?: string;\n /**\n * The draft, controlled — for a host that keeps it itself (saves it per ticket,\n * prefills a template). Left out, the composer keeps its own. Either way a send\n * that resolves clears only what was sent: controlled, that is an\n * `onValueChange(\"\")` the host receives like any keystroke, and only if the draft\n * is still the one that went out.\n */\n value?: string;\n /** Every change to the draft — typing, {@link FeedbackComposerHandle.insertText}, the\n * clear after a send. Required to change a controlled `value`. */\n onValueChange?: (value: string) => void;\n /** {@link FeedbackComposerHandle}: put text into the draft from outside (canned-reply\n * chips) or focus the box. */\n ref?: Ref<FeedbackComposerHandle>;\n labels?: Partial<FeedbackComposerLabels>;\n className?: string;\n /**\n * `\"sm\"` for a narrow host — keksdose's assistant launcher, a small floating panel\n * (0.22): a small Send button, and the send hint (\"Enter to send, Shift + Enter for a\n * new line\") hidden from view but kept as the box's description, so a keyboard or\n * screen-reader user still learns the shortcut. Default `\"md\"`.\n */\n size?: \"md\" | \"sm\";\n /**\n * On the composer's root — the box, or the `disabledReason` line in its place —\n * with any `data-*` attribute beside it (keksdose K17). keksdose's assistant tour\n * points at the chat box with `[data-tour=\"assistant-ask\"]`, and a composer that\n * dropped every attribute it was not told about left the anchor nowhere: the\n * assistant kept its hand-built box rather than lose the tour step.\n */\n id?: string;\n /** `data-*` attributes for the root, as `id` — a tour anchor, a test id. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n}\n\n/**\n * What a {@link FeedbackComposer} `ref` holds.\n *\n * keksdose F9: the support admin answers the same five questions all day and wants\n * chips above the box (\"Thanks, fixed in the next release\") that drop their text in\n * where the caret is. A controlled `value` alone cannot do that well — the host sees\n * the string, not the caret, so it could only append — so the composer, which owns\n * the textarea, does the splice.\n */\nexport interface FeedbackComposerHandle {\n /**\n * Insert `text` at the caret, replacing any selection (the caret the box last had:\n * a click on a chip blurs it, and the selection survives the blur), then focus the\n * box with the caret after the inserted text so the reply can go on. Nothing is\n * added around it — put a space or a newline in `text` if the reply needs one. A\n * no-op while `disabledReason` replaces the box.\n */\n insertText: (text: string) => void;\n focus: () => void;\n}\n\nconst noSubscribe = () => () => {};\nconst isApple = () =>\n typeof navigator !== \"undefined\" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform || navigator.userAgent);\n\n/**\n * The answer box under a {@link FeedbackThread}: a textarea, an optional picture,\n * and Send — Ctrl/⌘+Enter sends, the shortcut the report dialog and the note editor\n * use, so the habit carries across the feature. Plain Enter is a new line: feedback is\n * written in paragraphs, unlike a chat — which `sendOn=\"enter\"` is for (keksdose G5).\n */\nexport function FeedbackComposer({\n onSend,\n pending = false,\n attachment,\n attachmentSlot,\n canSend: canSendProp,\n sendOn = \"mod-enter\",\n disabledReason,\n commit,\n rows = 3,\n maxLength,\n showCount,\n countLabels,\n placeholder,\n value,\n onValueChange,\n ref,\n labels: labelsProp,\n className,\n id,\n size = \"md\",\n ...rest\n}: FeedbackComposerProps) {\n const labels = useKitLabels(\"feedbackComposer\", DEFAULT_FEEDBACK_COMPOSER_LABELS, labelsProp);\n // The lock as Send sees it, with its scope (§12.36). Send's Button reads the same\n // through its own `commit`; this holds the keyboard's send back with it.\n const lock = useWriteLock(commit ?? false);\n const rootAttributes = { id, ...dataAttributes(rest) };\n const hintId = useId();\n const [ownDraft, setOwnDraft] = useState(\"\");\n const controlled = value !== undefined;\n const draft = controlled ? value : ownDraft;\n const [file, setFile] = useState<File | null>(null);\n const root = useRef<HTMLDivElement>(null);\n const box = useRef<HTMLTextAreaElement>(null);\n // The draft as of the last commit. The send's `.then` and `insertText` run after\n // renders their closure did not see — text typed while the send was in flight, a\n // second chip clicked before the first one's render — and must not act on a stale\n // string (for a controlled draft there is no updater function to lean on).\n const latest = useRef(draft);\n useLayoutEffect(() => {\n latest.current = draft;\n });\n // Where the caret goes once an inserted text has rendered.\n const caret = useRef<number | null>(null);\n useLayoutEffect(() => {\n const el = box.current;\n if (caret.current === null || !el) return;\n el.focus();\n el.setSelectionRange(caret.current, caret.current);\n caret.current = null;\n });\n\n const setDraft = (next: string) => {\n latest.current = next;\n if (!controlled) setOwnDraft(next);\n onValueChange?.(next);\n };\n\n useImperativeHandle(ref, () => ({\n insertText: (text) => {\n const el = box.current;\n if (!el) return;\n const current = latest.current;\n // A second insert before the first has rendered goes after the first, not at the\n // textarea's not-yet-moved caret. Otherwise the textarea's selection, which may\n // be past the end of a controlled value the host has just shortened: clamp it.\n const pending = caret.current;\n const start = Math.min(pending ?? el.selectionStart ?? current.length, current.length);\n const end = pending ?? Math.max(start, Math.min(el.selectionEnd ?? start, current.length));\n caret.current = start + text.length;\n setDraft(current.slice(0, start) + text + current.slice(end));\n },\n focus: () => box.current?.focus(),\n }));\n // The server snapshot is \"Ctrl\"; the client corrects it after hydration.\n const modifier = useSyncExternalStore(\n noSubscribe,\n () => (isApple() ? \"⌘\" : \"Ctrl\"),\n () => \"Ctrl\",\n );\n\n if (disabledReason != null && disabledReason !== false) {\n return (\n <p {...rootAttributes} className={cn(\"text-xs text-[var(--text-muted)]\", className)}>\n {disabledReason}\n </p>\n );\n }\n\n // Longer than `maxLength` only through `insertText` or a controlled value (typing\n // stops at it): the server would refuse it, so it does not go.\n const tooLong = maxLength !== undefined && draft.length > maxLength;\n const canSend = (canSendProp ?? draft.trim().length > 0) && !pending && !tooLong && !lock.locked;\n const send = () => {\n if (!canSend) return;\n const sentDraft = draft;\n const sentFile = file;\n Promise.resolve(onSend(draft.trim(), file))\n .then(() => {\n if (latest.current === sentDraft) setDraft(\"\");\n setFile((current) => (current === sentFile ? null : current));\n })\n .catch(() => {});\n };\n\n const config = attachment === true ? {} : attachment || null;\n // The slot is handed the ref OBJECT, for a field's `pasteFrom`, which reads `.current`\n // in an effect once the root is attached — nothing reads it during this render (see\n // FeedbackComposerSlotContext.root).\n const slot =\n typeof attachmentSlot === \"function\"\n ? // eslint-disable-next-line react-hooks/refs -- handed on for an effect, not read here\n attachmentSlot({ root, pending })\n : attachmentSlot;\n\n return (\n <div {...rootAttributes} ref={root} className={cn(\"space-y-2\", className)}>\n <Textarea\n rows={rows}\n dir=\"auto\"\n aria-label={labels.field}\n // Textarea puts the counter's description after this one, so under \"sm\" the box\n // reads \"Enter to send… 12 of 4000 characters\".\n aria-describedby={size === \"sm\" ? hintId : undefined}\n maxLength={maxLength}\n // Passed only when given: Textarea keeps a wrapper for a `showCount` it was\n // handed at all, and a composer without one keeps the DOM it had.\n {...(showCount !== undefined ? { showCount } : null)}\n countLabels={countLabels}\n ref={box}\n placeholder={placeholder ?? labels.placeholder}\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\") return;\n const mod = event.ctrlKey || event.metaKey;\n // Under \"enter\": plain Enter sends, Shift+Enter falls through to the\n // textarea's new line, and an Enter that ends an IME composition is the\n // IME's (keyCode 229 is how Safari reports it after the composition ended).\n const chat =\n sendOn === \"enter\" &&\n !event.shiftKey &&\n !event.altKey &&\n !event.nativeEvent.isComposing &&\n event.keyCode !== 229;\n if (mod || chat) {\n event.preventDefault();\n send();\n }\n }}\n />\n <div className=\"flex flex-wrap items-end justify-between gap-2\">\n {config || slot != null ? (\n <div className=\"flex min-w-0 flex-wrap items-end gap-2\">\n {config && (\n <FeedbackAttachmentField\n value={file}\n onChange={setFile}\n labels={config.labels}\n accept={config.accept}\n maxBytes={config.maxBytes}\n onError={config.onError}\n onCaptureScreenshot={config.onCaptureScreenshot}\n buttonVariant={config.buttonVariant}\n buttonSize={config.buttonSize}\n // The box is this field's sibling; a paste in it bubbles to `root`.\n pasteFrom={root}\n />\n )}\n {slot}\n </div>\n ) : (\n <span />\n )}\n <div className=\"ms-auto flex items-center gap-2\">\n <span\n id={hintId}\n className={size === \"sm\" ? \"sr-only\" : \"text-xs text-[var(--text-placeholder)]\"}\n >\n {sendOn === \"enter\" ? labels.sendHintEnter : labels.sendHint(modifier)}\n </span>\n <Button\n onClick={send}\n disabled={!canSend}\n commit={commit}\n aria-busy={pending || undefined}\n size={size === \"sm\" ? \"sm\" : undefined}\n >\n {pending ? (\n <Spinner label={null} className=\"size-4\" />\n ) : (\n <Send className=\"size-4 rtl:-scale-x-100\" aria-hidden />\n )}\n {labels.send}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/** The `data-*` entries of a rest-props object, and nothing else: whatever a caller\n * spread in that the composer does not know is not the root's to receive. */\nfunction dataAttributes(props: object): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(props)) if (key.startsWith(\"data-\")) out[key] = value;\n return out;\n}\n\n/**\n * {@link FeedbackComposer} under a name that is not about feedback (keksdose K17).\n *\n * The component was never feedback-specific: a textarea, an optional picture or a\n * host's upload slot, Send, `sendOn=\"enter\"` for the chat way. keksdose's assistant\n * and support chat are chats, not reports, and an import of `FeedbackComposer` there\n * reads as a mistake to the next person. The same function, not a wrapper, so the\n * two names cannot drift.\n */\nexport const ChatComposer = FeedbackComposer;\n/** {@link FeedbackComposerProps}, for {@link ChatComposer}. */\nexport type ChatComposerProps = FeedbackComposerProps;\n/** {@link FeedbackComposerHandle}, for {@link ChatComposer}. */\nexport type ChatComposerHandle = FeedbackComposerHandle;\n/** {@link FeedbackComposerLabels}, for {@link ChatComposer} — still the `feedbackComposer`\n * namespace of the provider. */\nexport type ChatComposerLabels = FeedbackComposerLabels;\n/** {@link FeedbackComposerSlotContext}, for {@link ChatComposer}'s `attachmentSlot`. */\nexport type ChatComposerSlotContext = FeedbackComposerSlotContext;\n"],"mappings":";AAkNW,SAsIP,UAtIO,KAqDC,YArDD;AAlNX,SAAS,WAAW,OAAO,qBAAqB,iBAAiB,QAAQ,UAAU,4BAA4B;AAE/G,SAAS,WAAW,UAAU,WAAW,YAAY;AACrD,SAAS,UAAU;AACnB,SAAS,YAAY,0BAA0B;AAC/C,SAAS,QAAQ,YAAY,SAAS,gBAAgB;AAEtD,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAE7B,SAAS,kBAAkB,cAAc,oBAAoB;AAC7D,SAAS,+BAA+B;AAsDjC,MAAM,iCAAuD;AAAA,EAClE,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,aAAa;AAC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