@mistriwork/mistri 1.0.0-rc.12 → 1.0.0-rc.13

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 (221) hide show
  1. package/README.md +4 -3
  2. package/dist/client/assets/LayoutBuilder-MPzkVU2e.js.map +1 -1
  3. package/dist/client/assets/index-D2dHI6hR.js.map +1 -1
  4. package/dist/client/assets/shell-TreN_uLs.js.map +1 -1
  5. package/dist/docs/access-model.md +1 -1
  6. package/dist/docs/build-and-deploy.md +0 -1
  7. package/dist/docs/cli.md +1 -1
  8. package/dist/docs/glossary.md +3 -3
  9. package/dist/docs/query.md +9 -21
  10. package/dist/docs/status.md +3 -3
  11. package/dist/embed/react/chunks/LayoutBuilder-Cbxa_wve.js.map +1 -1
  12. package/dist/embed/react/chunks/app-0UZ1Re1k.js.map +1 -1
  13. package/dist/embed/react/chunks/page-Bx4o1kpQ.js.map +1 -1
  14. package/dist/embed/react/chunks/palette-Bb7Lf6eo.js.map +1 -1
  15. package/dist/embed/react/chunks/shell-DZRACiB9.js.map +1 -1
  16. package/dist/embed/react/chunks/write-BQO4CFc9.js.map +1 -1
  17. package/dist/embed/react/index.js +1 -1
  18. package/dist/server/build/dockerfile.js +1 -1
  19. package/dist/server/cli/usage.js +2 -2
  20. package/dist/ui/index.js +2 -2
  21. package/dist/ui/page.js +2 -2
  22. package/dist/ui/{shared-N4Ej8yRD.js → shared-1PD7TOTJ.js} +5 -5
  23. package/dist/ui/{shared-N4Ej8yRD.js.map → shared-1PD7TOTJ.js.map} +1 -1
  24. package/dist/ui/{shared-D5m86-4o.js → shared-1gMnOu9J.js} +6 -6
  25. package/dist/ui/{shared-D5m86-4o.js.map → shared-1gMnOu9J.js.map} +1 -1
  26. package/dist/ui/{shared-Ctaj8mR2.js → shared-5RQMi4BR.js} +3 -3
  27. package/dist/ui/{shared-Ctaj8mR2.js.map → shared-5RQMi4BR.js.map} +1 -1
  28. package/dist/ui/{shared-DpLeIATZ.js → shared-B-BUF9fx.js} +2 -2
  29. package/dist/ui/{shared-DpLeIATZ.js.map → shared-B-BUF9fx.js.map} +1 -1
  30. package/dist/ui/{shared-DWYnjItP.js → shared-B-MhiPIN.js} +9 -9
  31. package/dist/ui/{shared-DWYnjItP.js.map → shared-B-MhiPIN.js.map} +1 -1
  32. package/dist/ui/{shared-0fNuhSbG.js → shared-B07qIMlE.js} +5 -5
  33. package/dist/ui/{shared-0fNuhSbG.js.map → shared-B07qIMlE.js.map} +1 -1
  34. package/dist/ui/{shared-lYtMadRU.js → shared-B1SAS_J-.js} +3 -3
  35. package/dist/ui/{shared-lYtMadRU.js.map → shared-B1SAS_J-.js.map} +1 -1
  36. package/dist/ui/{shared-CpI0Y8M5.js → shared-B4jgU8h9.js} +6 -6
  37. package/dist/ui/{shared-CpI0Y8M5.js.map → shared-B4jgU8h9.js.map} +1 -1
  38. package/dist/ui/{shared-Cxu1c35l.js → shared-B5aBCUi7.js} +30 -30
  39. package/dist/ui/{shared-Cxu1c35l.js.map → shared-B5aBCUi7.js.map} +1 -1
  40. package/dist/ui/{shared-CAe-US1q.js → shared-B9H7_Pji.js} +5 -5
  41. package/dist/ui/{shared-CAe-US1q.js.map → shared-B9H7_Pji.js.map} +1 -1
  42. package/dist/ui/{shared-Q2bgBaYo.js → shared-BAXr20S-.js} +4 -4
  43. package/dist/ui/{shared-Q2bgBaYo.js.map → shared-BAXr20S-.js.map} +1 -1
  44. package/dist/ui/{shared-CyEefFFb.js → shared-BDDUzH-f.js} +19 -19
  45. package/dist/ui/{shared-CyEefFFb.js.map → shared-BDDUzH-f.js.map} +1 -1
  46. package/dist/ui/{shared-BdhPI6dq.js → shared-BGmkeDeW.js} +3 -3
  47. package/dist/ui/{shared-BdhPI6dq.js.map → shared-BGmkeDeW.js.map} +1 -1
  48. package/dist/ui/{shared-DONIpq2q.js → shared-BHCQ60yN.js} +2 -2
  49. package/dist/ui/{shared-DONIpq2q.js.map → shared-BHCQ60yN.js.map} +1 -1
  50. package/dist/ui/{shared-CNmaAv64.js → shared-BHsjawAG.js} +8 -8
  51. package/dist/ui/{shared-CNmaAv64.js.map → shared-BHsjawAG.js.map} +1 -1
  52. package/dist/ui/{shared-DgjU9kOy.js → shared-BIQuK_nq.js} +4 -4
  53. package/dist/ui/{shared-DgjU9kOy.js.map → shared-BIQuK_nq.js.map} +1 -1
  54. package/dist/ui/{shared-icSQAj21.js → shared-BOe4W2FI.js} +3 -3
  55. package/dist/ui/{shared-icSQAj21.js.map → shared-BOe4W2FI.js.map} +1 -1
  56. package/dist/ui/{shared-BlxoOJSk.js → shared-BPpC08ip.js} +3 -3
  57. package/dist/ui/{shared-BlxoOJSk.js.map → shared-BPpC08ip.js.map} +1 -1
  58. package/dist/ui/{shared-BtiFL37J.js → shared-BdA3LPCB.js} +2 -2
  59. package/dist/ui/{shared-BtiFL37J.js.map → shared-BdA3LPCB.js.map} +1 -1
  60. package/dist/ui/{shared-CvR94vn4.js → shared-Be3nbWsd.js} +11 -11
  61. package/dist/ui/{shared-CvR94vn4.js.map → shared-Be3nbWsd.js.map} +1 -1
  62. package/dist/ui/{shared-Bl_nF_IH.js → shared-Bf30ZLoS.js} +8 -4
  63. package/dist/ui/shared-Bf30ZLoS.js.map +1 -0
  64. package/dist/ui/{shared-DijrJ_V-.js → shared-BguP_BaR.js} +7 -7
  65. package/dist/ui/{shared-DijrJ_V-.js.map → shared-BguP_BaR.js.map} +1 -1
  66. package/dist/ui/{shared-DPAVoWY0.js → shared-BoLbc2WD.js} +17 -2
  67. package/dist/ui/{shared-DPAVoWY0.js.map → shared-BoLbc2WD.js.map} +1 -1
  68. package/dist/ui/{shared-BkdBTYwx.js → shared-BttyOW4W.js} +3 -3
  69. package/dist/ui/{shared-BkdBTYwx.js.map → shared-BttyOW4W.js.map} +1 -1
  70. package/dist/ui/{shared-CQWLz8uT.js → shared-BumxsBlA.js} +10 -10
  71. package/dist/ui/{shared-CQWLz8uT.js.map → shared-BumxsBlA.js.map} +1 -1
  72. package/dist/ui/{shared-Dzu7tFiC.js → shared-Bw73ktBk.js} +3 -3
  73. package/dist/ui/{shared-Dzu7tFiC.js.map → shared-Bw73ktBk.js.map} +1 -1
  74. package/dist/ui/{shared-BhAYErSx.js → shared-C1B0GH0e.js} +4 -4
  75. package/dist/ui/{shared-BhAYErSx.js.map → shared-C1B0GH0e.js.map} +1 -1
  76. package/dist/ui/{shared-BQJQcGgj.js → shared-C2FsyYr7.js} +4 -4
  77. package/dist/ui/{shared-BQJQcGgj.js.map → shared-C2FsyYr7.js.map} +1 -1
  78. package/dist/ui/{shared-B9lw2Ryh.js → shared-C2RU1qjv.js} +4 -4
  79. package/dist/ui/{shared-B9lw2Ryh.js.map → shared-C2RU1qjv.js.map} +1 -1
  80. package/dist/ui/{shared-DQYNI9wO.js → shared-C42f07hJ.js} +5 -5
  81. package/dist/ui/{shared-DQYNI9wO.js.map → shared-C42f07hJ.js.map} +1 -1
  82. package/dist/ui/{shared-CqCZ8wMY.js → shared-C4LkPCU4.js} +3 -3
  83. package/dist/ui/{shared-CqCZ8wMY.js.map → shared-C4LkPCU4.js.map} +1 -1
  84. package/dist/ui/{shared-BhtpgOpa.js → shared-C4wSfz6k.js} +9 -9
  85. package/dist/ui/{shared-BhtpgOpa.js.map → shared-C4wSfz6k.js.map} +1 -1
  86. package/dist/ui/{shared-BHc2Izkj.js → shared-C9DZtSFH.js} +2 -2
  87. package/dist/ui/{shared-BHc2Izkj.js.map → shared-C9DZtSFH.js.map} +1 -1
  88. package/dist/ui/{shared-DW1YuiNS.js → shared-CA52ClGo.js} +2 -2
  89. package/dist/ui/{shared-DW1YuiNS.js.map → shared-CA52ClGo.js.map} +1 -1
  90. package/dist/ui/{shared-BbSbilkh.js → shared-CBciTwm6.js} +9 -9
  91. package/dist/ui/{shared-BbSbilkh.js.map → shared-CBciTwm6.js.map} +1 -1
  92. package/dist/ui/{shared-C-J32eBn.js → shared-CL3RLKDA.js} +16 -16
  93. package/dist/ui/{shared-C-J32eBn.js.map → shared-CL3RLKDA.js.map} +1 -1
  94. package/dist/ui/{shared-Ck8S4OxW.js → shared-CLq3-_hW.js} +3 -3
  95. package/dist/ui/{shared-Ck8S4OxW.js.map → shared-CLq3-_hW.js.map} +1 -1
  96. package/dist/ui/{shared-Q5WefT7G.js → shared-CMjK-Ucd.js} +3 -3
  97. package/dist/ui/{shared-Q5WefT7G.js.map → shared-CMjK-Ucd.js.map} +1 -1
  98. package/dist/ui/{shared-D3MAuEA3.js → shared-CPjpSFGh.js} +2 -2
  99. package/dist/ui/{shared-D3MAuEA3.js.map → shared-CPjpSFGh.js.map} +1 -1
  100. package/dist/ui/{shared-VshXGwXP.js → shared-CSPhENq3.js} +2 -2
  101. package/dist/ui/{shared-VshXGwXP.js.map → shared-CSPhENq3.js.map} +1 -1
  102. package/dist/ui/{shared-DJrJaE73.js → shared-CZJE4Bmp.js} +3 -3
  103. package/dist/ui/{shared-DJrJaE73.js.map → shared-CZJE4Bmp.js.map} +1 -1
  104. package/dist/ui/{shared-D7ONOwI7.js → shared-C_BhUL2I.js} +7 -7
  105. package/dist/ui/{shared-D7ONOwI7.js.map → shared-C_BhUL2I.js.map} +1 -1
  106. package/dist/ui/{shared-j-2peBIB.js → shared-CbeujwdU.js} +4 -4
  107. package/dist/ui/{shared-j-2peBIB.js.map → shared-CbeujwdU.js.map} +1 -1
  108. package/dist/ui/{shared-D5GrOEa2.js → shared-Cbf-o4Dt.js} +4 -4
  109. package/dist/ui/{shared-D5GrOEa2.js.map → shared-Cbf-o4Dt.js.map} +1 -1
  110. package/dist/ui/{shared-HwiPIajr.js → shared-CdNmeNHh.js} +3 -3
  111. package/dist/ui/{shared-HwiPIajr.js.map → shared-CdNmeNHh.js.map} +1 -1
  112. package/dist/ui/{shared-ZCFt-CPb.js → shared-CdQOMD8J.js} +3 -3
  113. package/dist/ui/{shared-ZCFt-CPb.js.map → shared-CdQOMD8J.js.map} +1 -1
  114. package/dist/ui/{shared-ClhXSGGK.js → shared-CdiPYlTh.js} +2 -2
  115. package/dist/ui/{shared-ClhXSGGK.js.map → shared-CdiPYlTh.js.map} +1 -1
  116. package/dist/ui/{shared-DA8_pVRZ.js → shared-CepLAhwm.js} +2 -2
  117. package/dist/ui/{shared-DA8_pVRZ.js.map → shared-CepLAhwm.js.map} +1 -1
  118. package/dist/ui/{shared-BrYKjrnM.js → shared-Ch82h_Fu.js} +6 -6
  119. package/dist/ui/{shared-BrYKjrnM.js.map → shared-Ch82h_Fu.js.map} +1 -1
  120. package/dist/ui/{shared-C4UrE8Fb.js → shared-Chp88all.js} +3 -3
  121. package/dist/ui/{shared-C4UrE8Fb.js.map → shared-Chp88all.js.map} +1 -1
  122. package/dist/ui/{shared-CWa80DTO.js → shared-Ci16s2rN.js} +9 -9
  123. package/dist/ui/{shared-CWa80DTO.js.map → shared-Ci16s2rN.js.map} +1 -1
  124. package/dist/ui/{shared-tksTLD6Q.js → shared-CiqNkoE1.js} +5 -5
  125. package/dist/ui/{shared-tksTLD6Q.js.map → shared-CiqNkoE1.js.map} +1 -1
  126. package/dist/ui/{shared-yt7DjSrq.js → shared-CpMhOq8F.js} +2 -2
  127. package/dist/ui/{shared-yt7DjSrq.js.map → shared-CpMhOq8F.js.map} +1 -1
  128. package/dist/ui/{shared-Dm0z5WUl.js → shared-CrWv5JKH.js} +6 -6
  129. package/dist/ui/{shared-Dm0z5WUl.js.map → shared-CrWv5JKH.js.map} +1 -1
  130. package/dist/ui/{shared-CQL3FGHc.js → shared-Csfi3Pti.js} +2 -2
  131. package/dist/ui/{shared-CQL3FGHc.js.map → shared-Csfi3Pti.js.map} +1 -1
  132. package/dist/ui/{shared-BKNRbm-V.js → shared-CuZt26rm.js} +2 -2
  133. package/dist/ui/{shared-BKNRbm-V.js.map → shared-CuZt26rm.js.map} +1 -1
  134. package/dist/ui/{shared-Guq3upiR.js → shared-Cws_z-TS.js} +2 -2
  135. package/dist/ui/{shared-Guq3upiR.js.map → shared-Cws_z-TS.js.map} +1 -1
  136. package/dist/ui/{shared-Bw_qZeIj.js → shared-D1KWuCg6.js} +2 -2
  137. package/dist/ui/{shared-Bw_qZeIj.js.map → shared-D1KWuCg6.js.map} +1 -1
  138. package/dist/ui/{shared-CuCZKwXW.js → shared-D66ju_Cb.js} +23 -23
  139. package/dist/ui/{shared-CuCZKwXW.js.map → shared-D66ju_Cb.js.map} +1 -1
  140. package/dist/ui/{shared-DYfX7NSM.js → shared-DGaQZXnw.js} +2 -2
  141. package/dist/ui/{shared-DYfX7NSM.js.map → shared-DGaQZXnw.js.map} +1 -1
  142. package/dist/ui/{shared-B3Hp8tOv.js → shared-DHy41sET.js} +6 -6
  143. package/dist/ui/{shared-B3Hp8tOv.js.map → shared-DHy41sET.js.map} +1 -1
  144. package/dist/ui/{shared-CXyd7IKi.js → shared-DKEOMQ6l.js} +2 -2
  145. package/dist/ui/{shared-CXyd7IKi.js.map → shared-DKEOMQ6l.js.map} +1 -1
  146. package/dist/ui/{shared-Ccmc8YO0.js → shared-DSUICuaJ.js} +33 -33
  147. package/dist/ui/{shared-Ccmc8YO0.js.map → shared-DSUICuaJ.js.map} +1 -1
  148. package/dist/ui/{shared-CL2iw_js.js → shared-DUPMRoO0.js} +13 -13
  149. package/dist/ui/{shared-CL2iw_js.js.map → shared-DUPMRoO0.js.map} +1 -1
  150. package/dist/ui/{shared-Dtp4eRul.js → shared-DVfdm6ah.js} +2 -2
  151. package/dist/ui/{shared-Dtp4eRul.js.map → shared-DVfdm6ah.js.map} +1 -1
  152. package/dist/ui/{shared-BJ5Ex32G.js → shared-DXM7d7lJ.js} +3 -3
  153. package/dist/ui/{shared-BJ5Ex32G.js.map → shared-DXM7d7lJ.js.map} +1 -1
  154. package/dist/ui/{shared-BFr6ld0e.js → shared-DXbMlcev.js} +2 -2
  155. package/dist/ui/{shared-BFr6ld0e.js.map → shared-DXbMlcev.js.map} +1 -1
  156. package/dist/ui/{shared-BUp3jv-N.js → shared-D_SkPtJ9.js} +6 -6
  157. package/dist/ui/{shared-BUp3jv-N.js.map → shared-D_SkPtJ9.js.map} +1 -1
  158. package/dist/ui/{shared-CdNomVzH.js → shared-Dd21k2ic.js} +4 -4
  159. package/dist/ui/{shared-CdNomVzH.js.map → shared-Dd21k2ic.js.map} +1 -1
  160. package/dist/ui/{shared-gRMbxmpu.js → shared-Dh0nHtLZ.js} +8 -8
  161. package/dist/ui/{shared-gRMbxmpu.js.map → shared-Dh0nHtLZ.js.map} +1 -1
  162. package/dist/ui/{shared-BKGJgjog.js → shared-DkOdSpSK.js} +3 -3
  163. package/dist/ui/{shared-BKGJgjog.js.map → shared-DkOdSpSK.js.map} +1 -1
  164. package/dist/ui/{shared-BMsh72Uq.js → shared-Dkph5ckT.js} +2 -2
  165. package/dist/ui/{shared-BMsh72Uq.js.map → shared-Dkph5ckT.js.map} +1 -1
  166. package/dist/ui/{shared-Be1HpDOB.js → shared-Dl1_Nx--.js} +3 -3
  167. package/dist/ui/{shared-Be1HpDOB.js.map → shared-Dl1_Nx--.js.map} +1 -1
  168. package/dist/ui/{shared-BQIZWOoJ.js → shared-Dm0IGbAf.js} +2 -2
  169. package/dist/ui/{shared-BQIZWOoJ.js.map → shared-Dm0IGbAf.js.map} +1 -1
  170. package/dist/ui/{shared-DSUtcU5S.js → shared-DnIkTpPr.js} +5 -5
  171. package/dist/ui/{shared-DSUtcU5S.js.map → shared-DnIkTpPr.js.map} +1 -1
  172. package/dist/ui/{shared-DsxGbYlV.js → shared-Docl_0tq.js} +3 -3
  173. package/dist/ui/{shared-DsxGbYlV.js.map → shared-Docl_0tq.js.map} +1 -1
  174. package/dist/ui/{shared-DZskrV26.js → shared-DprrHC72.js} +2 -2
  175. package/dist/ui/{shared-DZskrV26.js.map → shared-DprrHC72.js.map} +1 -1
  176. package/dist/ui/{shared-Bmw43Hwf.js → shared-DyKsJTZs.js} +2 -2
  177. package/dist/ui/{shared-Bmw43Hwf.js.map → shared-DyKsJTZs.js.map} +1 -1
  178. package/dist/ui/{shared-BLG88Pya.js → shared-FO7vfI3F.js} +4 -4
  179. package/dist/ui/{shared-BLG88Pya.js.map → shared-FO7vfI3F.js.map} +1 -1
  180. package/dist/ui/{shared-DLSd80D1.js → shared-HalAVHjv.js} +3 -3
  181. package/dist/ui/{shared-DLSd80D1.js.map → shared-HalAVHjv.js.map} +1 -1
  182. package/dist/ui/{shared-D1mMBLdj.js → shared-JvcI-LWp.js} +15 -15
  183. package/dist/ui/{shared-D1mMBLdj.js.map → shared-JvcI-LWp.js.map} +1 -1
  184. package/dist/ui/{shared-C6Hv_4O0.js → shared-K7Ym27yg.js} +2 -2
  185. package/dist/ui/{shared-C6Hv_4O0.js.map → shared-K7Ym27yg.js.map} +1 -1
  186. package/dist/ui/{shared-B39ln7oi.js → shared-SzlnwfJO.js} +3 -3
  187. package/dist/ui/{shared-B39ln7oi.js.map → shared-SzlnwfJO.js.map} +1 -1
  188. package/dist/ui/{shared-DgPn_Jll.js → shared-TrGbd1FY.js} +3 -3
  189. package/dist/ui/{shared-DgPn_Jll.js.map → shared-TrGbd1FY.js.map} +1 -1
  190. package/dist/ui/{shared-DrFb-XtA.js → shared-WhbuObEW.js} +2 -2
  191. package/dist/ui/{shared-DrFb-XtA.js.map → shared-WhbuObEW.js.map} +1 -1
  192. package/dist/ui/{shared-DiFQljcq.js → shared-XcSKDp6N.js} +11 -11
  193. package/dist/ui/{shared-DiFQljcq.js.map → shared-XcSKDp6N.js.map} +1 -1
  194. package/dist/ui/{shared-CMAg58rY.js → shared-Z4uBJU6I.js} +7 -6
  195. package/dist/ui/shared-Z4uBJU6I.js.map +1 -0
  196. package/dist/ui/{shared-BnUptuUp.js → shared-bAgeiRa5.js} +2 -2
  197. package/dist/ui/{shared-BnUptuUp.js.map → shared-bAgeiRa5.js.map} +1 -1
  198. package/dist/ui/{shared-BxMvSjey.js → shared-cgXG7OgZ.js} +5 -5
  199. package/dist/ui/{shared-BxMvSjey.js.map → shared-cgXG7OgZ.js.map} +1 -1
  200. package/dist/ui/{shared-u4CG2kQJ.js → shared-eZ0SB_zm.js} +2 -2
  201. package/dist/ui/{shared-u4CG2kQJ.js.map → shared-eZ0SB_zm.js.map} +1 -1
  202. package/dist/ui/{shared-L90bWW8e.js → shared-frKFb79C.js} +2 -2
  203. package/dist/ui/{shared-L90bWW8e.js.map → shared-frKFb79C.js.map} +1 -1
  204. package/dist/ui/{shared-Dd34nhkw.js → shared-hAayNSRA.js} +3 -3
  205. package/dist/ui/{shared-Dd34nhkw.js.map → shared-hAayNSRA.js.map} +1 -1
  206. package/dist/ui/{shared-DzC64cpp.js → shared-j_J16p2B.js} +2 -2
  207. package/dist/ui/{shared-DzC64cpp.js.map → shared-j_J16p2B.js.map} +1 -1
  208. package/dist/ui/{shared-DX7HRIV-.js → shared-tqpl5N3g.js} +6 -6
  209. package/dist/ui/{shared-DX7HRIV-.js.map → shared-tqpl5N3g.js.map} +1 -1
  210. package/dist/ui/{shared-BS5dBMpA.js → shared-y-6_ZDts.js} +2 -2
  211. package/dist/ui/{shared-BS5dBMpA.js.map → shared-y-6_ZDts.js.map} +1 -1
  212. package/dist/ui/{shared-Cv5v_MP1.js → shared-zG6e1Rhz.js} +13 -13
  213. package/dist/ui/{shared-Cv5v_MP1.js.map → shared-zG6e1Rhz.js.map} +1 -1
  214. package/dist/ui/testing.js +1 -1
  215. package/package.json +4 -4
  216. package/dist/docs/cli-browser.md +0 -232
  217. package/dist/docs/database-browser.md +0 -115
  218. package/dist/docs/keyboard.md +0 -63
  219. package/dist/docs/mcp.md +0 -86
  220. package/dist/ui/shared-Bl_nF_IH.js.map +0 -1
  221. package/dist/ui/shared-CMAg58rY.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"shared-DiFQljcq.js","names":["say","say","memo","memo","useIsomorphicLayoutEffect","React","say","say","say","say","say","_Fragment","sayCopy","_Fragment","say","say","Menu.Root","Menu.Portal","Menu.Positioner","Menu.Popup","Menu.Separator","Menu.Item","memo","say","say","_Fragment","say","say","say","JsonView","_Fragment","say","say","say","_Fragment","namingColumn","say","say","_Fragment","_Fragment"],"sources":["../../../../node_modules/@base-ui/react/separator/Separator.mjs","../../../kit/src/client/pins.js","../../../kit/src/client/components/columnPresentation.ts","../../../kit/src/client/copy/lists/components/placeOrder.ts","../../../kit/src/client/components/placeOrder.ts","../../../kit/src/client/components/RowHost.tsx","../../../../node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js","../../../../node_modules/@tanstack/virtual-core/dist/esm/utils.js","../../../../node_modules/@tanstack/virtual-core/dist/esm/index.js","../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js","../../../engine/src/shared/dashboardAsks.ts","../../../kit/src/client/copy/dashboards/components/dashboardModel.ts","../../../kit/src/client/components/dashboardModel.ts","../../../kit/src/client/components/textMeasure.ts","../../../kit/src/client/copy/dashboards/breakdownBatch.ts","../../../kit/src/client/breakdownBatch.ts","../../../kit/src/client/copy/columnMenu/components/AppColumnMenu.ts","../../../kit/src/client/components/AppColumnMenu.tsx","../../../kit/src/client/nested.js","../../../kit/src/client/components/PresentationSwitch.tsx","../../../kit/src/client/compose.js","../../../kit/src/client/copy/columnMenu/components/ThMenu.ts","../../../kit/src/client/components/ThMenu.tsx","../../../kit/src/client/thmenu.js","../../../../node_modules/@tanstack/react-table/dist/FlexRender.js","../../../../node_modules/@tanstack/store/dist/shallow.js","../../../../node_modules/@tanstack/react-table/dist/Subscribe.js","../../../../node_modules/@tanstack/table-core/dist/core/reactivity/coreReactivityFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/reactivity/renderPhaseReactivity.js","../../../../node_modules/@tanstack/react-table/dist/reactivity.js","../../../../node_modules/@tanstack/table-core/dist/utils.js","../../../../node_modules/@tanstack/table-core/dist/core/cells/coreCellsFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/cells/coreCellsFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/headers/constructHeader.js","../../../../node_modules/@tanstack/table-core/dist/features/column-pinning/columnPinningFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/features/column-visibility/columnVisibilityFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/headers/buildHeaderGroups.js","../../../../node_modules/@tanstack/table-core/dist/core/columns/constructColumn.js","../../../../node_modules/@tanstack/table-core/dist/features/column-ordering/columnOrderingFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/columns/coreColumnsFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/columns/coreColumnsFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/headers/coreHeadersFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/headers/coreHeadersFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/rows/constructRow.js","../../../../node_modules/@tanstack/table-core/dist/features/cell-selection/cellSelectionFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/features/row-expanding/rowExpandingFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/features/row-pagination/rowPaginationFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/features/row-sorting/rowSortingFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/row-models/createCoreRowModel.js","../../../../node_modules/@tanstack/table-core/dist/core/row-models/coreRowModelsFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/row-models/coreRowModelsFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/cells/constructCell.js","../../../../node_modules/@tanstack/table-core/dist/core/rows/coreRowsFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/rows/coreRowsFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/table/coreTablesFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/table/coreTablesFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/coreFeatures.js","../../../../node_modules/@tanstack/table-core/dist/helpers/columnHelper.js","../../../../node_modules/@tanstack/table-core/dist/helpers/tableFeatures.js","../../../../node_modules/@tanstack/table-core/dist/core/table/constructTable.js","../../../../node_modules/@tanstack/react-table/dist/useTable.js","../../../kit/src/client/copy/lists/components/Nested.ts","../../../kit/src/client/components/Nested.tsx","../../../kit/src/client/components/useGridKeyboard.ts","../../../kit/src/client/components/usePins.ts","../../../kit/src/client/components/useStickyHead.ts","../../../kit/src/client/components/gridSizing.ts","../../../kit/src/client/components/gridArrange.ts","../../../kit/src/client/copy/shell/visualTheme.ts","../../../engine/src/shared/themeFaces.ts","../../../kit/src/client/visualTheme.ts","../../../kit/src/client/copy/record/components/JsonPreview.ts","../../../kit/src/client/components/JsonPreview.tsx","../../../kit/src/client/copy/lists/components/Grid.ts","../../../kit/src/client/components/rowOpens.ts","../../../kit/src/client/components/Grid.tsx","../../../kit/src/client/copy/record/components/RecordSummaries.ts","../../../kit/src/client/components/RecordSummaries.tsx","../../../kit/src/client/copy/lists/components/RowActions.ts","../../../kit/src/client/components/RowActions.tsx","../../../kit/src/client/components/ListEmpty.tsx","../../../kit/src/client/components/viewLink.ts","../../../kit/src/client/components/DashboardNote.tsx"],"sourcesContent":[null,"/**\n * Columns that stay put when a wide table scrolls sideways.\n *\n * A twenty-seven column table is wider than any window, so reading the right\n * of it means scrolling the left of it away — and the left of it is where the\n * key and the name live. Three columns in you are looking at values with\n * nothing to attach them to, and the only way back is to scroll left, read the\n * name, and scroll right again holding it in your head.\n *\n * Pinning is the fix every spreadsheet arrived at, and the reason it belongs\n * here rather than in a preference nobody finds is that tablewalk already knows\n * which columns identify a row: the primary key, and the label column it uses\n * for breadcrumbs. Those are pinned without being asked for, on tables wide\n * enough to need it, and anything else is one click in the column menu.\n *\n * What is pinned lives here; how it is frozen in place is the grid's\n * (components/usePins.ts), which measures the columns after layout.\n */\nimport { labelColumn, loadJson, primaryKey, saveJson, state } from './core.js';\n\nconst KEY = 'mistri.pins.v1';\n\n/**\n * Below this many columns, pinning is a border and a shadow for no gain.\n *\n * The number is about the *window* rather than the table: eight columns of\n * ordinary width fit, and the ones that do not are exactly the tables where\n * losing the key hurts.\n */\nconst WIDE_ENOUGH = 8;\n\nconst connectionKey = () => state.activeConnection ?? 'default';\n\n/* An App list keeps its own pins, apart from its table's: two views over one\n table are two lists a reader arranges separately. The store is the\n browser's, scoped to the signed-in account (captureScopedStorage), so a\n pin is one reader's arrangement and never what another reader sees. */\nconst storeKey = (table, list) => (list ? `list:${list}` : table.id);\n\nfunction stored() {\n return loadJson(KEY, {})[connectionKey()] ?? {};\n}\n\n/* A pin changed: the grid that reads them draws again (useSyncExternalStore). */\nlet version = 0;\nconst listeners = new Set();\nexport const pinsVersion = () => version;\n/** @param {() => void} listener */\nexport function subscribePins(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\n/**\n * The columns pinned for a table: what was chosen, or what identifies a row.\n *\n * The derived default is not written to storage. Storing it would freeze\n * today's guess against a schema that may gain a better label column, and it\n * would make \"I have never touched this\" indistinguishable from \"I chose\n * exactly this\".\n *\n * @param {any} table\n * @param {string[]} columns\n * @param {string} [list] An App list's key: its own pins rather than its table's.\n * @returns {string[]}\n */\nexport function pinnedFor(table, columns, list) {\n if (!table) return [];\n const chosen = stored()[storeKey(table, list)];\n if (chosen) return chosen.filter((c) => columns.includes(c));\n if (columns.length < WIDE_ENOUGH) return [];\n\n const key = primaryKey(table);\n const label = labelColumn(table);\n const wanted = [...key, ...(label && !key.includes(label) ? [label] : [])];\n return wanted.filter((c) => columns.includes(c));\n}\n\n/**\n * @param {any} table\n * @param {string[]} columns\n * @param {string} name\n * @param {string} [list]\n */\nexport function togglePin(table, columns, name, list) {\n if (!table) return;\n const current = pinnedFor(table, columns, list);\n const next = current.includes(name) ? current.filter((c) => c !== name) : [...current, name];\n\n /* Kept in column order rather than the order they were pinned in. Pinned\n columns are rendered as a block on the left, and a block whose internal\n order differs from the table's is a second thing to reconcile every time\n you read it. */\n const ordered = columns.filter((c) => next.includes(c));\n\n const all = loadJson(KEY, {});\n all[connectionKey()] = { ...(all[connectionKey()] ?? {}), [storeKey(table, list)]: ordered };\n saveJson(KEY, all);\n version += 1;\n for (const listener of [...listeners]) listener();\n}\n","import { TAGS_COLUMN, tagsColumnMeta } from '@mistriwork/engine/shared/tagLists.js';\nimport type { ColumnMeta, DatabaseSchema, TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport { resolvePath } from '@mistriwork/engine/shared/view.js';\nimport { rollupColumnMeta } from '@mistriwork/engine/shared/rollups.js';\nimport { computedColumnMeta } from '@mistriwork/engine/shared/computed.js';\n\ntype PresentationColumn = ColumnMeta & { sourceName?: string; identifier?: boolean };\n\n/** Dotted projections retain their source type without becoming the base row's key. */\nexport function presentationColumns(\n schema: DatabaseSchema | undefined,\n table: TableMeta | undefined,\n paths: readonly string[],\n): Map<string, PresentationColumn> {\n const columns = new Map<string, PresentationColumn>((table?.columns ?? []).map((column) => [column.name, column]));\n if (!schema || !table) return columns;\n for (const path of paths) {\n /* A rollup of the table itself (rollups.ts) is named without a dot, and\n read-only like every summary: its type is how it dresses. */\n const rollup = !path.includes('.') && table.rollups && Object.hasOwn(table.rollups, path) ? table.rollups[path] : undefined;\n if (rollup && !columns.has(path)) {\n columns.set(path, { ...rollupColumnMeta(path, rollup), identifier: false });\n continue;\n }\n // A computed column of the table, likewise (computed.ts).\n const computed = !path.includes('.') && table.computed && Object.hasOwn(table.computed, path) ? table.computed[path] : undefined;\n if (computed && !columns.has(path)) {\n columns.set(path, { ...computedColumnMeta(path, computed), identifier: false });\n continue;\n }\n // A record's tags (tagLists.ts): chips in a cell, a checklist in a facet.\n if (path === TAGS_COLUMN && table.tags && !columns.has(path)) {\n columns.set(path, { ...tagsColumnMeta(), identifier: false });\n continue;\n }\n if (columns.has(path) || !path.includes('.')) continue;\n try {\n const resolved = resolvePath(schema, table.id, path);\n columns.set(path, {\n ...resolved.column,\n name: path,\n sourceName: resolved.column.name,\n identifier: Boolean(resolved.column.primaryKey || resolved.column.references),\n primaryKey: false,\n nullable: true,\n });\n } catch {\n // An arbitrary result alias is not necessarily a schema path.\n }\n }\n return columns;\n}\n","/** What placeOrder says, in the lists and grid room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n moveToTop: 'Move to top',\n moveToBottom: 'Move to bottom',\n});\n","/**\n * A record's place among its neighbors, for every run a reader arranges by\n * hand — a board's lane (BoardList) and a list with an `order` column\n * (useListOrder) — so the two can never number, or save, differently.\n */\n\n/* A run renumbered is numbered this far apart, so the next many moves each\n find a number between their neighbors and write the one record. */\nimport { say } from '../copy/lists/components/placeOrder.js';\n\nexport const STEP = 1024;\n\n/**\n * The writes that give a record its new place, as few as the numbers allow:\n * the one record, halfway between its new neighbors (a step past the end one\n * at either end of the run). Only when there is no number between them — two\n * whole numbers side by side, a fraction halved away to nothing, or a\n * neighbor with no place yet — is the run numbered again, a step apart with\n * the record in its place, skipping every record already on its number.\n */\nexport function placements<Item extends { id: string; position?: number }>(\n item: Item,\n others: Item[],\n index: number,\n whole: boolean,\n): Array<[Item, number]> {\n const above = others[index - 1],\n below = others[index];\n const a = above?.position,\n b = below?.position;\n if ((above || below) && (!above || a !== undefined) && (!below || b !== undefined)) {\n const value =\n a !== undefined && b !== undefined ? (whole ? Math.floor((a + b) / 2) : (a + b) / 2) : a !== undefined ? a + STEP : b! - STEP;\n if ((a === undefined || value > a) && (b === undefined || value < b)) return value === item.position ? [] : [[item, value]];\n }\n const run = [...others.slice(0, index), item, ...others.slice(index)];\n return run.flatMap((each, i): Array<[Item, number]> => (each.position === (i + 1) * STEP ? [] : [[each, (i + 1) * STEP]]));\n}\n\n/** A stored place as a number: absent where the record has none yet, or its value is not one. */\nexport function positionOf(value: unknown): number | undefined {\n if (value === null || value === undefined || value === '') return undefined;\n const n = typeof value === 'number' ? value : typeof value === 'string' ? Number(value.trim() || NaN) : NaN;\n return Number.isFinite(n) ? n : undefined;\n}\n\n/** Whether a place column holds whole numbers only, so a midpoint is rounded down rather than halved. */\nexport const wholeColumn = (type: string | undefined) => /int|serial/i.test(type ?? '');\n\n/** The places a record's menu names, in the order it names them. */\nexport type Place = 'up' | 'down' | 'top' | 'bottom';\nexport const PLACES: Array<[Place, string]> = [\n ['up', say('common.moveUp')],\n ['down', say('common.moveDown')],\n ['top', say('moveToTop')],\n ['bottom', say('moveToBottom')],\n];\n\n/**\n * Where one of the menu's places puts a record: its index among the others\n * as they will be, 0 at the top — or undefined where it already stands\n * there, so the menu leaves that place out.\n */\nexport function placeIndex(ids: readonly string[], id: string, place: Place): number | undefined {\n const at = ids.indexOf(id);\n const index = place === 'up' ? at - 1 : place === 'down' ? at + 1 : place === 'top' ? 0 : ids.length - 1;\n return at >= 0 && index !== at && index >= 0 && index < ids.length ? index : undefined;\n}\n\n/** A write that did not apply: what it said, and whether that was a refusal (an uncertain write says so on its record). */\nexport interface PlaceFailure {\n message: string;\n refused: boolean;\n}\n\n/**\n * The writes, one ordinary update each and in order, so each is checked,\n * recorded and undoable on its own. The first that does not apply stops the\n * rest; a page that has gone (another connection, a signed-out session)\n * stops them too, and says so as `stale`.\n */\nexport async function savePlaces<Item>(\n writes: Array<[Item, number]>,\n write: (item: Item, value: number) => Promise<PlaceFailure | null>,\n isCurrent: () => boolean,\n): Promise<{ applied: number; failed?: PlaceFailure; stale: boolean }> {\n let applied = 0;\n for (const [item, value] of writes) {\n const failed = await write(item, value);\n if (!isCurrent()) return { applied, stale: true };\n if (failed) return { applied, failed, stale: false };\n applied++;\n }\n return { applied, stale: false };\n}\n","/**\n * One host per grid row, so a presentation can decorate a row without\n * replacing the grid.\n *\n * The queue's selection had to be a list of its own because nothing could\n * put a control *into* a grid row from outside the grid: the rows are the\n * grid's, drawn from its own row model, and the only way in was another\n * prop threaded through TableRoom, Rows and TableView into Grid for every\n * new kind of decoration. This is the other way in. The grid gives each\n * row it can identify one element — the leading cell, the column the\n * expander already occupies, so nothing shifts — and publishes them in a\n * store keyed by the row's primary key. A decoration anywhere under the\n * same scope portals into the host for its key, and its state, its\n * queries and its context stay where it was declared.\n *\n * Keys are strings, spelled exactly as `bulkKey` spells them, so a\n * selection made on the grid and a selection made in a queue are the same\n * set. A value is never run through `Number()`: an id past 2^53 arrives as\n * a string and a rounded one would name a different row.\n *\n * A host keeps its identity for as long as its row does. The grid keys its\n * rows by the same string, so a refetch that reorders, adds or drops rows\n * moves the surviving rows' elements instead of redrawing them, and a\n * portal into a surviving row is never unmounted. A row that leaves the\n * result takes its host with it, and the decoration's portal goes too.\n */\nimport { createContext, useContext, useLayoutEffect, useState, type ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\nimport { primaryKey, type TableMeta } from '@mistriwork/engine/shared/schema.js';\n\ntype RowHostMap = ReadonlyMap<string, HTMLElement>;\n\nexport interface RowHostStore {\n /** The hosts drawn now. The same object until one arrives or leaves. */\n hosts(): RowHostMap;\n subscribe(listener: () => void): () => void;\n /** The grid's side: a stable ref callback for the host of one row. */\n ref(key: string): (element: HTMLElement | null) => (() => void) | undefined;\n /** The header row's leading cell, where what speaks for every row goes (select all). */\n head(): HTMLElement | null;\n /** The grid's side of it: one stable ref callback. Not a key in `hosts()`, which is rows only. */\n headRef(element: HTMLElement | null): (() => void) | undefined;\n}\n\nconst NONE: RowHostMap = new Map();\n\n/**\n * A row's identity as a string, or null when the row cannot say which row\n * it is: no table, no key, a projection that dropped a key column, or a\n * null in the key (NULL is equal to nothing in SQL, so it identifies\n * nothing here either, and must not collide with the text 'null').\n */\nexport function rowKeyString(table: TableMeta | undefined, row: Record<string, unknown>): string | null {\n if (!table) return null;\n const columns = primaryKey(table);\n if (!columns.length) return null;\n const parts: Array<[string, string]> = [];\n for (const column of columns) {\n const value = row[column];\n if (value === undefined || value === null) return null;\n parts.push([column, String(value)]);\n }\n return JSON.stringify(parts);\n}\n\nexport function createRowHosts(): RowHostStore {\n const live = new Map<string, HTMLElement>();\n const refs = new Map<string, (element: HTMLElement | null) => (() => void) | undefined>();\n const listeners = new Set<() => void>();\n let snapshot: RowHostMap | null = NONE;\n let head: HTMLElement | null = null;\n const tell = () => {\n for (const listener of [...listeners]) listener();\n };\n const changed = () => {\n snapshot = null;\n tell();\n };\n return {\n hosts: () => (snapshot ??= new Map(live)),\n head: () => head,\n /* The rows' snapshot is left alone: the header arriving is no reason for\n every row's decoration to be handed a new map. */\n headRef(element) {\n if (!element) return undefined;\n if (head !== element) {\n head = element;\n tell();\n }\n return () => {\n if (head !== element) return;\n head = null;\n tell();\n };\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n ref(key) {\n /* Stable per key: a fresh callback on every render would make React\n detach and re-attach every host on every paint, and every\n decoration would be told about it. */\n let callback = refs.get(key);\n if (!callback) {\n callback = (element) => {\n if (!element) return undefined;\n if (live.get(key) !== element) {\n live.set(key, element);\n changed();\n }\n return () => {\n /* Only this element's own departure: a remounted row may already\n have put its new host under the same key. */\n if (live.get(key) !== element) return;\n live.delete(key);\n refs.delete(key);\n changed();\n };\n };\n refs.set(key, callback);\n }\n return callback;\n },\n };\n}\n\nconst Scope = createContext<RowHostStore | null>(null);\n\n/**\n * Where a grid publishes its hosts. A grid under a scope registers its rows\n * in it and draws the leading cell on every row; one without draws the cell\n * only when it has something of its own to put there (the expander). A grid\n * hands its own subtree — the rows it opens in place — a null scope, so a\n * nested grid never publishes into its parent's.\n */\nexport function RowHostScope({ store, children }: { store: RowHostStore | null; children: ReactNode }) {\n return <Scope.Provider value={store}>{children}</Scope.Provider>;\n}\n\n/** A scope with its own store, for a presentation that decorates the grid under it. */\nexport function RowHosts({ children }: { children: ReactNode }) {\n const [store] = useState(createRowHosts);\n return <RowHostScope store={store}>{children}</RowHostScope>;\n}\n\nexport const useRowHostScope = (): RowHostStore | null => useContext(Scope);\n\nconst TrailScope = createContext<RowHostStore | null>(null);\n\n/**\n * The second host a row can have: its trailing cell, at the far end, where a\n * row's own menu sits. The same store and the same keys as the leading host;\n * a grid draws the cell only under a trailing scope, and hands the rows it\n * opens in place a null one, as it does the leading scope.\n */\nexport function RowTrailScope({ store, children }: { store: RowHostStore | null; children: ReactNode }) {\n return <TrailScope.Provider value={store}>{children}</TrailScope.Provider>;\n}\n\n/** A trailing scope with its own store, for a decoration at the end of each row. */\nexport function RowTrailHosts({ children }: { children: ReactNode }) {\n const [store] = useState(createRowHosts);\n return <RowTrailScope store={store}>{children}</RowTrailScope>;\n}\n\nexport const useRowTrailScope = (): RowHostStore | null => useContext(TrailScope);\n\n/**\n * The hosts a grid has drawn, re-read whenever one arrives or leaves.\n *\n * Subscribed in a layout effect rather than through useSyncExternalStore,\n * which subscribes after paint: the hosts are attached in the grid's commit,\n * and a decoration that learnt of them a frame later would paint the rows\n * without it first. Grids paint complete (docs/design.md, \"data does not\n * dance\"), so the decoration lands in the same frame as its row.\n */\nexport function useRowHosts(store?: RowHostStore | null): RowHostMap {\n const scoped = useRowHostScope();\n const source = store === undefined ? scoped : store;\n const [hosts, setHosts] = useState<RowHostMap>(() => source?.hosts() ?? NONE);\n useLayoutEffect(() => {\n if (!source) {\n setHosts(NONE);\n return undefined;\n }\n const read = () => setHosts(source.hosts());\n read();\n return source.subscribe(read);\n }, [source]);\n return source ? hosts : NONE;\n}\n\n/**\n * Children drawn into one row's host, for as long as that row is in the\n * result. Nothing is drawn while the row is not (yet) on screen — a\n * windowed grid draws only the rows in view — and the children arrive when\n * it scrolls in.\n */\nexport function RowDecoration({ rowKey, store, children }: { rowKey: string; store?: RowHostStore | null; children: ReactNode }) {\n const host = useRowHosts(store).get(rowKey);\n return host ? createPortal(children, host, rowKey) : null;\n}\n\n/** The header's leading cell, re-read as it arrives or leaves — in a layout effect, as the rows' hosts are. */\nfunction useRowHead(store?: RowHostStore | null): HTMLElement | null {\n const scoped = useRowHostScope();\n const source = store === undefined ? scoped : store;\n const [head, setHead] = useState<HTMLElement | null>(() => source?.head() ?? null);\n useLayoutEffect(() => {\n if (!source) {\n setHead(null);\n return undefined;\n }\n const read = () => setHead(source.head());\n read();\n return source.subscribe(read);\n }, [source]);\n return source ? head : null;\n}\n\n/**\n * Children drawn into the header row's leading cell: the one place a\n * decoration speaks for every row, as the select-all box every table has\n * does, above the rows' own boxes in the same column.\n */\nexport function RowHeadDecoration({ store, children }: { store?: RowHostStore | null; children: ReactNode }) {\n const head = useRowHead(store);\n return head ? createPortal(children, head, 'head') : null;\n}\n",null,null,null,null,"/**\n * What a dashboard's sections ask, in the words they ask it: a metric's\n * figure and its compare window's (its trend's are dashboardTrend.ts), a breakdown's groups, a chart's\n * and a matrix's crosses, a board's lanes, a list's first rows, a pick's\n * choices. The client's sections build their requests from these\n * (client/components/Dashboard.tsx, dashboardModel.ts), and the server\n * builds a first page's from them too (server/http/firstPaintRooms.ts), so\n * the answers it carries are for the requests the sections then make.\n */\nimport { andQuery } from './query.js';\nimport { labelColumn, primaryKey, type ForeignKey, type TableMeta } from './schema.js';\nimport { listPresentationColumns } from './appListColumns.js';\nimport type { AppListPresentation } from './listPresentations.js';\n\n/**\n * How the asks read the schema: the client through the walk's own helpers\n * (core.js), the server over the schema it answered with (listQuestion.ts\n * `referenceNames` names the references either way).\n */\nexport interface AskLookups {\n table(id: string): TableMeta | undefined;\n references(id: string): readonly ForeignKey[];\n referenceNames(tableId: string, names: readonly string[]): Record<string, string>;\n /** Where a table's records are named, as a view path (schema.ts labelPath, by the App's record label). */\n naming(table: TableMeta): string | undefined;\n}\n\n/** What of a section its asks are made from. */\nexport interface AskedSection {\n kind: string;\n table?: string;\n query?: string;\n measure?: string;\n /** A scatter's second measure, which places its dots across. */\n x?: string;\n by?: string;\n lanes?: string[];\n limit?: number;\n over?: string;\n compare?: string;\n windowBase?: string;\n /** The reader's window, where one stands in the author's (`windowed`): the window a metric's trend is drawn over. */\n windowPhrase?: string;\n comparePeriod?: boolean;\n spark?: boolean;\n shape?: string;\n show?: string[];\n sort?: string;\n view?: string;\n windows?: string[];\n windowKey?: string;\n /** A goal: a number, or read from data — per group where it names a `by` (a breakdown's, G76). */\n target?: number | { table: string; query?: string; measure: string; by?: string; over?: string; windowBase?: string };\n /** The target is the whole this metric is a share of, not a goal (it follows the metric's window and picks). */\n targetWhole?: true;\n error?: string;\n}\n\n/** A breakdown's goals, a row per group: the target table's measure by its own `by`, within its query. */\nexport function targetText(section: Pick<AskedSection, 'target' | 'limit'>): string | null {\n const goal = section.target;\n if (typeof goal !== 'object' || !goal.by) return null;\n return [goal.table, goal.query, `${goal.measure} by ${goal.by}`, `limit ${groupsAskedFor(section)}`].filter(Boolean).join(' ');\n}\n\n/** The breakdown a section asks for: its measure by its key, within its query. */\nexport function breakdownText(section: Pick<AskedSection, 'table' | 'query' | 'measure' | 'by' | 'x'>, limit?: number | string): string {\n /* A scatter asks its two measures in one line: the answer is its key, then `x`, then the measure. */\n const measured = `${section.x ? `${section.x}, ` : ''}${section.measure ?? 'count'}`;\n return [section.table, section.query, `${measured} by ${section.by}`, limit ? `limit ${limit}` : ''].filter(Boolean).join(' ');\n}\n\n/**\n * A section with the reader's window in place of the author's. The server\n * hands sections whose query already windows the `over` column a\n * `windowBase` without that phrase, so the reader's phrase stands where\n * the author's did rather than intersecting it. A compare derived from\n * \"previous period\" is re-derived against the reader's window — `last 30\n * days` picked compares against `previous 30 days`; a hand-written compare,\n * or a window phrase with no \"previous\" (this month), hides the delta rather\n * than compare the reader's window to the author's.\n */\nexport function windowed<S extends AskedSection>(section: S, windowNow: string | null): S {\n if (!section.over || !windowNow) return section;\n const base = section.windowBase ?? section.query;\n const out: S = { ...section, query: andQuery(base, `${section.over} = ${windowNow}`), windowPhrase: windowNow };\n /* A goal per group follows the reader's window by its own clock: this quarter's quotas beside this quarter's wins. */\n const goal = section.target;\n if (typeof goal === 'object' && goal.over)\n out.target = {\n ...goal,\n query: andQuery(section.targetWhole ? (goal.windowBase ?? goal.query) : goal.query, `${goal.over} = ${windowNow}`),\n };\n /* A metric with no window of its own is served `comparePeriod` and no\n compare at all: it has a change only once a window is picked. */\n if (section.compare || section.comparePeriod) {\n const m = /^last\\s+(\\d+)\\s+(minute|hour|day|week|month|year)s?$/i.exec(windowNow.trim());\n out.compare =\n section.comparePeriod && m ? andQuery(base, `${section.over} = previous ${m[1]} ${m[2]}${m[1] === '1' ? '' : 's'}`) : undefined;\n }\n return out;\n}\n\n/** The period a section with windows of its own is over: the reader's pick, else its first. */\nexport const sectionPeriod = (\n section: Pick<AskedSection, 'windows' | 'windowKey'>,\n periods: Readonly<Record<string, string>>,\n): string | null => (section.windows?.length ? (section.windowKey && periods[section.windowKey]) || section.windows[0] : null);\n\n/** A metric's figure over `query` — its own, or its compare window's. */\nexport const measureText = (section: Pick<AskedSection, 'table' | 'measure'>, query: string | undefined): string =>\n [section.table, query, section.measure ?? 'count'].filter(Boolean).join(' ');\n\n/**\n * How many groups a breakdown asks for before it orders them itself. The\n * grammar answers groups in the engine's order — the alphabet, on SQLite —\n * so a section's `limit` asked of the server kept the first groups by name,\n * not the biggest. The groups are fetched, ordered on the client and then\n * cut to the section's limit.\n */\nconst GROUPS_ASKED = 200;\nexport const groupsAskedFor = (section: Pick<AskedSection, 'limit'>): number => Math.max(section.limit ?? 0, GROUPS_ASKED);\n\n/** The groups a chart asks for: stacked bars cross two keys, and bars and a donut order their groups themselves. */\nexport function chartLimit(section: Pick<AskedSection, 'shape' | 'limit' | 'by'>): number | undefined {\n /* A heat map's grid is every cross of its keys: a week of hours is 168. */\n if (section.shape === 'stacked' || section.shape === 'heatmap') return 400;\n /* A waterfall's and a treemap's groups are all drawn, as a donut's slices: `limit` keeps the largest. */\n if (section.shape === 'waterfall' || section.shape === 'treemap' || section.shape === 'scatter') return groupsAskedFor(section);\n /* A line (or the default chart) over two keys draws one line per second key: every period crossed with every series is a\n row, and the server's twenty-row default dropped the later periods, so each line fell to zero where the rows ran out. */\n if (section.shape === 'line' && (section.by ?? '').includes(',')) return 400;\n return section.shape === 'donut' || section.shape === 'bar' ? groupsAskedFor(section) : section.limit;\n}\n\n/** A board's lane counts. */\nexport const boardCountText = (section: Pick<AskedSection, 'table' | 'query' | 'by'>): string =>\n [section.table, section.query, `count by ${section.by}`].filter(Boolean).join(' ');\n\n/**\n * A dashboard list's question: its rows with the columns it draws, the names\n * its references are read by and the keys a row opens by, kept out of sight,\n * up to its limit. `presentation` is the embedded view's, whose dress reads\n * columns of its own.\n */\nexport function dashboardListQuery(\n lookups: AskLookups,\n section: Pick<AskedSection, 'table' | 'query' | 'sort' | 'show' | 'limit'>,\n presentation?: AppListPresentation,\n): { query: string; keys: string[]; named: string[]; referenceLabels: Record<string, string> } {\n const table = section.table ? lookups.table(section.table) : undefined;\n const shown = [...new Set([...(section.show ?? []), ...(presentation ? listPresentationColumns(presentation) : [])])];\n const keys = shown.length ? (table ? primaryKey(table) : []).filter((key) => !shown.includes(key)) : [];\n const referenceLabels = shown.length ? lookups.referenceNames(section.table as string, shown) : {};\n /* The record's own name rides along unseen as its key does: on a phone a\n row is a card titled by it, and without it a lease was titled \"21\". */\n const naming = shown.length && table ? lookups.naming(table) : undefined;\n const titled = naming && !primaryKey(table as TableMeta).includes(naming) ? [naming] : [];\n const named = [...new Set([...Object.values(referenceLabels), ...titled])].filter((name) => !shown.includes(name));\n const query = [\n section.table,\n section.query,\n section.sort ? `sort ${section.sort}` : '',\n shown.length ? `show ${[...shown, ...named, ...keys].join(', ')}` : '',\n `limit ${section.limit ?? 5}`,\n ]\n .filter(Boolean)\n .join(' ');\n return { query, keys, named, referenceLabels };\n}\n\n/**\n * A pick's choices, where its column is a whole single-column reference: the\n * records it points at, by name, fifty at most. Null where the column is a\n * vocabulary (its values are the choices) or no section's table has it.\n */\nexport function pickQuery(lookups: AskLookups, sections: readonly Pick<AskedSection, 'table'>[], column: string): string | null {\n const home = sections.find((section) => section.table && lookups.table(section.table)?.columns.some((c) => c.name === column));\n const table: TableMeta | undefined = home?.table ? lookups.table(home.table) : undefined;\n const meta = table?.columns.find((c) => c.name === column) as { allowed?: string[] } | undefined;\n const fk =\n table && !meta?.allowed?.length\n ? lookups.references(table.id).find((f) => f.from.columns.length === 1 && f.from.columns[0] === column)\n : undefined;\n const target = fk ? lookups.table(fk.to.table) : undefined;\n const naming = target ? labelColumn(target) : undefined;\n const pk = target ? primaryKey(target)[0] : undefined;\n return target && naming ? `${target.id} show ${[...new Set([naming, pk])].join(', ')} sort ${naming}` : null;\n}\n","/** What dashboardModel says, in the dashboards room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n allTime: '{title} (all time)',\n});\n","/**\n * What a dashboard is made of, before anything is drawn.\n *\n * The reader's window and picks folded into a section's query, the slot\n * they ride the address in, the breakdown text a section asks the server\n * for, and how a measured figure is said. Pure, so the components and\n * the vanilla entry read one rule.\n */\nimport { andQuery } from '@mistriwork/engine/shared/query.js';\nimport type { FigureFormat } from '@mistriwork/engine/shared/model.js';\nimport { breakdownText, sectionPeriod, windowed } from '@mistriwork/engine/shared/dashboardAsks.js';\nimport { columnDisplay, findTable, quote } from '../core.js';\nimport { defaultCurrency, formatLocale, formatMoney, formatNumber, formatPercent, formatWholeMoney } from '../locale.js';\nimport { currencyDigits, currencyPath, minorFigure } from '@mistriwork/engine/shared/money.js';\nimport { DURATION_STEPS } from '@mistriwork/engine/shared/niceTicks.js';\nimport { sayDuration, withUnit } from './valueModel.js';\nimport { say } from '../copy/dashboards/components/dashboardModel.js';\nimport { ALL_TIME, readPeriod } from '@mistriwork/engine/shared/addressParams.js';\n\ninterface DisplayRule {\n format?: string;\n currency?: string;\n minor?: true;\n whole?: true;\n /** Each row says its own currency in this column (`currency: { column }`). */\n currencyColumn?: string;\n}\n\n/**\n * A money measure summed apart per currency, where each row says its own\n * (`currency: { column }`): one figure per currency, never one sum of yen\n * and dollars. As a number it is its figure when there is one currency and\n * NaN when there are several, so a change or a goal is said only where it\n * means something. A class, so the query cache keeps it as it is.\n */\nexport class CurrencyFigures {\n constructor(readonly figures: ReadonlyArray<readonly [currency: string, value: unknown]>) {}\n valueOf(): number {\n return this.figures.length === 1 ? Number(this.figures[0][1]) : NaN;\n }\n}\n\n/** The one currency a query keeps its rows to (`currency = JPY`), if it does. */\nexport function pinnedCurrency(query: string | undefined, path: string): string | undefined {\n const escaped = path.replace(/[.]/g, '\\\\.');\n return new RegExp(`(?:^|\\\\s)${escaped}\\\\s*=\\\\s*\"?([A-Za-z]{3})\"?(?:\\\\s|$)`).exec(query ?? '')?.[1]?.toUpperCase();\n}\n\nexport interface Section {\n /** A stat card's window, said under its figure (metricWindow). Set on the client, never served. */\n windowNote?: string;\n sizing?: import('@mistriwork/engine/shared/tableSizing.js').TableSizing;\n kind: string;\n /** custom: the author's component, its named reads (each a rows section's words) and its props. */\n component?: import('@mistriwork/engine/shared/appComponents.js').ComponentDecl;\n reads?: Record<string, import('@mistriwork/engine/shared/appComponents.js').DashCustomRead>;\n aggregates?: Record<string, import('@mistriwork/engine/shared/appComponents.js').DashCustomTotal>;\n props?: Record<string, unknown>;\n table?: string;\n query?: string;\n measure?: string;\n by?: string;\n lanes?: string[];\n limit?: number;\n title?: string;\n width?: string;\n /** The area of the dashboard's `layout` the section stands in. */\n area?: string;\n over?: string;\n compare?: string;\n windowBase?: string;\n comparePeriod?: boolean;\n better?: 'up' | 'down';\n spark?: boolean;\n /** metric: how its figure is said, and the word after it, where its measure has no column's rule to say it. */\n format?: FigureFormat;\n unit?: string;\n /** metric: money said exact, to the currency's minor digits at any size (the default), or compact from a thousand. */\n figure?: 'exact' | 'compact';\n shape?: string;\n /** funnel: the stages a row reaches in order (shared/funnel.ts). */\n stages?: import('@mistriwork/engine/shared/funnel.js').FunnelStage[];\n /** chart: a scatter's across measure, its `measure` the up one. */\n x?: string;\n /** breakdown, steps: a line under a step, by its value. */\n notes?: Record<string, string>;\n /** chart: a line's curve, and a donut's words for its middle figure. */\n curve?: 'smooth' | 'straight';\n total?: string;\n height?: number;\n /** metric and chart: a goal, drawn as a meter or a rule and said; a metric's may be a measure read from data. */\n target?: number | { table: string; query?: string; measure: string; by?: string; over?: string; windowBase?: string };\n targetWhole?: true;\n show?: string[];\n labels?: Record<string, string>;\n sort?: string;\n text?: string;\n icon?: import('@mistriwork/engine/shared/appIcons.js').AppIconName;\n action?: { label: string; view: string };\n /** note: the dashboard's banner, its tag and its picture. */\n variant?: 'banner';\n eyebrow?: string;\n image?: import('@mistriwork/engine/shared/servedApp.js').LandingImage;\n error?: string;\n /** An embed: the key of the list view it draws, whose room \"open →\" opens. */\n view?: string;\n /** metric, breakdown, chart, matrix, funnel: its authored `to: false`, a card or groups that are text. */\n noDrill?: true;\n /** Authored `empty: 'hide'`: the section is left out of the dashboard while it has nothing to draw. */\n emptyMode?: 'hide';\n /** The section's own windows, the first where it starts; `windowKey` names it in the address. */\n windows?: string[];\n windowKey?: string;\n /** An embed that works as its room: search, filters, selection with the room's bulk actions. */\n interactive?: true;\n /** A ⋯ menu on each row with the record's own verbs, as the list over the table offers them (the assistant's tables). */\n rowActions?: true;\n /** activity: the resources whose changes it lists, each with its mark and its word. */\n resources?: Record<string, { icon?: import('@mistriwork/engine/shared/appIcons.js').AppIconName; label?: string }>;\n /** A first run's steps, each served with its view's table (FirstRun.tsx). */\n steps?: import('@mistriwork/engine/shared/servedApp.js').AppFirstRunStep[];\n /** find: the tables its box searches (DashboardFind.tsx), and the box's words before anything is typed. */\n searched?: string[];\n placeholder?: string;\n}\n\n/** The chart shapes a part on demand draws (ChartShapes.tsx), so a dashboard of lines and bars never fetches it. */\nexport const EXTRA_SHAPES: readonly string[] = ['scatter', 'heatmap', 'waterfall', 'treemap'];\n\nexport interface DashboardDef {\n /** The view carries a Favorites star. */\n favorite?: true;\n /** The dashboard's view key; its address is `dash-<key>`. */\n id: string;\n label: string;\n /** The words over the sections when they are not the label, the reader already greeted by the server. */\n heading?: string;\n /** The title is not drawn; it stays for a screen reader. */\n headingHidden?: true;\n /** Plain text, authored with the dashboard and served only with it. */\n description?: string;\n sections: Section[];\n /** A separate context flow beside the main dashboard sections. */\n aside?: Section[];\n /** Sections on a grid: a row of cells each, an area's name or `.` (shared/dashLayout.ts). Never with an aside. */\n areas?: string[];\n windows?: string[];\n /** The window it opens on, one of `windows`: unpicked is this, and all time is said `all-time`. */\n window?: string;\n /** The window picked from one date-range button rather than a row of them. */\n windowControl?: 'segmented' | 'button';\n filters?: string[];\n refresh?: number;\n /** A free-form page (definePage): what its component reads and runs, the address parameters it keeps its place in, and its loader. */\n page?: { reads: string[]; commands: string[]; params: string[]; loader?: string; public?: true };\n error?: string;\n}\n\nexport type Picks = Record<string, string>;\n/** The periods the reader picked on sections with windows of their own: the section's `windowKey` → its phrase. */\nexport type Periods = Record<string, string>;\n\n/** What the dashboard room hands the dashboard it draws (Rooms.tsx, through the shell's `rooms`; Dashboard.tsx). */\nexport interface DashboardProps {\n dashboard: DashboardDef;\n /** The reader's time window: null is all time. */\n window?: string | null;\n picks?: Picks;\n /** The periods picked on sections with windows of their own, by section. */\n periods?: Periods;\n onWindow?: (w: string | null) => void;\n onPick?: (picks: Picks) => void;\n onPeriods?: (periods: Periods) => void;\n}\n\n/** How a section's own window rides the address: `period.<windowKey>` beside the dashboard's `period`. */\nconst PERIOD_PREFIX = 'period.';\n\n/** The number, spoken the way the grid speaks numbers: the reader's\n separators, and an integer past 2^53 digit for digit. */\nexport function figure(value: unknown): string {\n if (value === undefined || value === null) return '0';\n if (typeof value === 'string' && /^-?\\d+$/.test(value)) return formatNumber(value);\n const n = typeof value === 'string' && /^-?\\d+(\\.\\d+)?$/.test(value) ? Number(value) : value;\n return typeof n === 'number' && Number.isFinite(n) && Number.isSafeInteger(Math.trunc(n)) ? formatNumber(n) : String(value);\n}\n\n/**\n * The display rule behind a measured number, read off the measure's own\n * column — \"sum amount as pipeline\" is dressed by whatever dresses\n * `amount`. A bare \"count\" measures rows, not a column, so it has none.\n * A computed measure that multiplies or divides — a ratio — is a plain\n * number: dollars over dollars are not dollars. One that adds or\n * subtracts keeps its first term's dress.\n */\nfunction measureRule(section: Section): DisplayRule | null {\n /* The author's word for the figure stands over the column's: \"avg resolution_met * 100\" is a share. */\n if (section.format) return { format: section.format };\n if (/\\s[*/]\\s/.test(section.measure ?? '')) return null;\n const m = /^(?:sum|avg|min|max|median)\\s+([A-Za-z0-9_.]+)/i.exec(section.measure ?? '');\n const rule = m && section.table ? (columnDisplay(section.table, m[1]) as DisplayRule | null) : null;\n /* A query kept to one currency says its figures in it. */\n const path = rule?.format === 'money' ? currencyPath(rule, m![1]) : undefined;\n const pinned = path ? pinnedCurrency(section.query, path) : undefined;\n return pinned ? { ...rule, currency: pinned } : rule;\n}\n\n/** Where money goes compact: a hundred thousand in a table or a breakdown, where a figure is read whole; a\n thousand on a metric card that says `figure: 'compact'` (CARD_COMPACT). */\nconst COMPACT_FROM = 100_000;\n/* A strip of compact cards said \"$414.1K\" beside \"$27,300\": each card measures alone, so no rule over its neighbours\n could hold before every one had answered, and a card that changed its figure's form as they did would shift. One\n rule a compact card keeps by itself — compact from a thousand, as its axis and its change say it — reads one way\n across any strip (docs/design.md, stat cards). */\nconst CARD_COMPACT = 1000;\n/** Never compact: money to the currency's minor digits at any size. A metric's figure by default, a card's title,\n what a screen reader hears, and a record page's metric. */\nexport const EXACT = Infinity;\n\n/** A stored decimal's digits, or a finite number: what money can be said exactly from (formatMoney). */\nconst DECIMAL = /^\\s*[+-]?\\d+(\\.\\d+)?\\s*$/;\n\n/** A measured figure in its dress: compact money reads as \"$27.9M\" from\n `compactFrom`, and exact below it — to the currency's minor digits, a\n figure past 2^53 digit for digit — save in a set whose figures are all\n whole (`cents: false`, a breakdown's `among`). */\nfunction dressedFigure(rule: DisplayRule | null, value: unknown, cents?: boolean, compactFrom = COMPACT_FROM): string | null {\n if (value instanceof CurrencyFigures)\n return value.figures\n .map(([currency, each]) => dressedFigure({ ...rule, format: 'money', currency }, each, cents, compactFrom) ?? figure(each))\n .join(' · ');\n if (rule?.format !== 'money') return null;\n const currency = rule.currency || defaultCurrency();\n /* A sum of minor units is said in the major unit, exactly: 1999 cents is $19.99, as text. */\n const major = rule.minor ? minorFigure(value, currency) : value;\n const exact = (typeof major === 'number' && Number.isFinite(major)) || (typeof major === 'string' && DECIMAL.test(major));\n if (!exact) return null;\n const n = Number(major);\n if (Math.abs(n) >= compactFrom) return formatMoney(n, rule.currency, { notation: 'compact', maximumFractionDigits: 1 });\n if (rule.whole && cents !== false) return formatWholeMoney(major as number | string, rule.currency);\n return formatMoney(\n major as number | string,\n rule.currency,\n cents === false ? { minimumFractionDigits: 0, maximumFractionDigits: 0 } : {},\n );\n}\n\n/**\n * A measured fraction, said to a headline's precision. An average or a ratio\n * comes back from the database to every digit it has, and the number\n * formatter's default three places put \"78.261\" on a card whose measure was\n * \"avg resolution_met * 100\": noise, not news. One place at or past 1, and\n * three significant digits below it, so a ratio such as 0.0345 does not\n * round to 0.\n */\nfunction measuredFraction(value: unknown): string | null {\n const n = typeof value === 'number' ? value : typeof value === 'string' && /^-?\\d+\\.\\d+$/.test(value) ? Number(value) : NaN;\n if (!Number.isFinite(n) || Number.isInteger(n)) return null;\n return formatNumber(n, Math.abs(n) >= 1 ? { maximumFractionDigits: 1 } : { maximumSignificantDigits: 3 });\n}\n\n/**\n * A stacked chart's visible figures (its legend's totals, each bar's pill and its target), said by one rule decided from\n * all of them: money compact from a thousand for every one where any reaches a hundred thousand, exact for every one\n * else, so \"$45,230\" never stands beside \"$451.2K\" on one chart. The figures arrive as stored, so a sum of cents is read\n * in the major unit before it is held to the threshold: a hundred thousand cents is a thousand dollars, not compact.\n */\nexport function legendSayer(section: Section, figures: readonly number[]): (value: unknown) => string {\n const rule = measureRule(section);\n const major = rule?.format === 'money' && rule.minor ? 10 ** currencyDigits(rule.currency || defaultCurrency()) : 1;\n return sayer(section, undefined, { compact: figures.some((n) => Math.abs(n) / major >= COMPACT_FROM) });\n}\n\n/** How a section says a figure: in its measure's dress, else as a number. */\nexport function sayer(\n section: Section,\n measured?: unknown,\n /* A metric card's own figure, its change and its goal: money exact, or compact from a thousand (CARD_COMPACT) where\n the metric says `figure: 'compact'`; `whole`, exact at any size, for the card's title; `compact`, a legend's\n figures compact from a thousand. */\n { card = false, whole = false, compact = false }: { card?: boolean; whole?: boolean; compact?: boolean } = {},\n): ((value: unknown) => string) & { tick: (value: unknown) => string; among: (values: readonly unknown[]) => (value: unknown) => string } {\n const rule = measureRule(section);\n /* Figures in one currency, read apart per currency: its change and its goal are said in it too. */\n const one = measured instanceof CurrencyFigures && measured.figures.length === 1 ? measured.figures[0][0] : undefined;\n const dress = one && rule ? { ...rule, currency: one } : rule;\n const said = figureSayer(\n dress,\n section.unit,\n whole ? EXACT : compact ? CARD_COMPACT : card ? (section.figure === 'compact' ? CARD_COMPACT : EXACT) : COMPACT_FROM,\n );\n /* Figures said side by side, in one form: where every one is a thousand or more, money drops its cents, so\n \"$67,713.40\" never stands beside \"$17,970\" in one breakdown; else every figure says cents if one has some. */\n const among = (values: readonly unknown[]) => {\n if (dress?.format !== 'money') return said;\n const minor = dress.minor ? 10 ** currencyDigits(dress.currency || defaultCurrency()) : 1;\n const majors = values.filter((v) => v !== null && v !== undefined && v !== '').map((v) => Number(v) / minor);\n const large = majors.length > 0 && majors.every((n) => Math.abs(n) >= 1000);\n /* Cents for every figure where one has some and none is large; else none. */\n const cents = !large && majors.some((n) => Number.isFinite(n) && Math.round(n * 100) % 100 !== 0);\n const one = (v: unknown) => dressedFigure(dress, v, cents) ?? said(v);\n return section.unit ? (v: unknown) => withUnit(one(v), section.unit!) : one;\n };\n return Object.assign(said, { tick: tickSayer(dress, section.unit), among });\n}\n\n/**\n * How an axis says one of its round levels (shared/niceTicks.ts): compact\n * from a thousand up and never to the cent, so a money axis reads \"$0 / $2K /\n * $4K\" where the figure itself is said whole. A share and a time taken keep\n * their own words, which are short already.\n */\nfunction tickSayer(rule: DisplayRule | null, unit?: string): ((value: unknown) => string) & { steps?: readonly number[] } {\n const said = figureSayer(rule, unit);\n const tick = (value: unknown) => {\n const stored = Number(value);\n if (value === null || value === '' || !Number.isFinite(stored) || rule?.format === 'percent' || rule?.format === 'duration')\n return said(value);\n const compact = { notation: 'compact', maximumFractionDigits: 1, minimumFractionDigits: 0 } as const;\n if (rule?.format === 'money') {\n const n = rule.minor ? stored / 10 ** currencyDigits(rule.currency || defaultCurrency()) : stored;\n const text = formatMoney(\n n,\n rule.currency,\n Math.abs(n) >= 1000 ? compact : { minimumFractionDigits: 0, maximumFractionDigits: Number.isInteger(n) ? 0 : 2 },\n );\n return unit ? withUnit(text, unit) : text;\n }\n if (Math.abs(stored) < 1000) return said(value);\n const text = formatNumber(stored, compact);\n return unit ? withUnit(text, unit) : text;\n };\n /* A time taken is ruled in days and hours, not in round numbers of seconds. */\n return rule?.format === 'duration' ? Object.assign(tick, { steps: DURATION_STEPS }) : tick;\n}\n\n/**\n * A measured figure said in a rule's dress — money, a share (`percent` reads\n * the figure as 0–100: 53.8 is \"53.8%\", never 0.538) — else as a number, an\n * average or a ratio to a headline's precision; then the unit. A dashboard's\n * metric and a record page's say a figure the same way.\n */\nexport function figureSayer(rule: DisplayRule | null, unit?: string, compactFrom = COMPACT_FROM): (value: unknown) => string {\n const said = (v: unknown) =>\n dressedFigure(rule, v, undefined, compactFrom) ?? sharedFigure(rule, v) ?? durationFigure(rule, v) ?? measuredFraction(v) ?? figure(v);\n return unit ? (v) => withUnit(said(v), unit) : said;\n}\n\n/** A share said as one: 78.261 is \"78.3%\". */\nfunction sharedFigure(rule: DisplayRule | null, value: unknown): string | null {\n const n = Number(value);\n if (rule?.format !== 'percent' || value === null || value === '' || !Number.isFinite(n)) return null;\n return formatPercent(n, { maximumFractionDigits: 1 });\n}\n\n/** A figure of seconds said as a time taken: 36120 is \"10h 2m\", as a `duration` column says it. */\nfunction durationFigure(rule: DisplayRule | null, value: unknown): string | null {\n const n = Number(value);\n if (rule?.format !== 'duration' || value === null || value === '' || !Number.isFinite(n)) return null;\n return sayDuration(n, formatLocale());\n}\n\n/* What a section asks is shared (shared/dashboardAsks.ts): a first page's\n dashboard is asked by the server in the same words. */\nexport { breakdownText, sectionPeriod, windowed };\n\n/** The section's whole query, as the list page would take it. */\nexport function fullQuery(section: Section): string {\n return [section.table, section.query].filter(Boolean).join(' ');\n}\n\n/** Authored lane visibility narrows every board read and drilldown alike. */\nexport function boardSection(section: Section): Section {\n if (section.kind !== 'board' || !section.lanes?.length) return section;\n return {\n ...section,\n query: andQuery(section.query, section.lanes.map((value) => `${section.by} = ${quote(value)}`).join(' or ')),\n };\n}\n\n/**\n * A windowed section's title, saying the window its figure is over. A title\n * that names the author's own window (\"Won, last 90 days\") has the reader's\n * picked window stand in its place — \"Won, last 30 days\" — where appending\n * it read \"Won, last 90 days (last 30 days)\", two windows for one figure.\n * A title that names none says the window after it. With nothing picked, a\n * section the author windowed says the author's window — \"Won (last 90\n * days)\", unless its title already names it — and any other says it is over\n * all time: under \"All time\" a bare \"Won\" counted ninety days and said so\n * nowhere.\n */\nexport function windowTitle(title: string, section: Pick<Section, 'query' | 'over' | 'windowBase'>, windowNow: string | null): string {\n if (!section.over) return title;\n const authored = section.windowBase === undefined ? undefined : authoredWindow(section.query ?? '', section.over);\n const at = authored ? title.toLowerCase().indexOf(authored.toLowerCase()) : -1;\n if (!windowNow)\n return section.windowBase === undefined ? say('allTime', { title }) : authored && at < 0 ? `${title} (${authored})` : title;\n if (authored && at >= 0) {\n const said = at === 0 && /^[A-Z]/.test(title) ? windowNow.charAt(0).toUpperCase() + windowNow.slice(1) : windowNow;\n return title.slice(0, at) + said + title.slice(at + authored.length);\n }\n return `${title} (${windowNow})`;\n}\n\n/**\n * A stat card's title and the window said under its figure. A card's label is\n * one line over a number, and \"Won (all time)\" or \"Won (last 90 days)\" wrapped\n * it, so a card never has the window appended: a title that names the\n * author's window has the reader's pick stand in its place, as a section's\n * does (windowTitle), and one that names none says the author's window\n * quietly under the figure until the reader picks one — then the picker above\n * says it, and a card it does not move says \"Right now\". Under All time\n * nothing is narrowed and nothing is said.\n */\nexport function metricWindow(\n title: string,\n section: Pick<Section, 'query' | 'over' | 'windowBase'>,\n windowNow: string | null,\n): { title: string; note?: string } {\n if (!section.over) return { title };\n const authored = section.windowBase === undefined ? undefined : authoredWindow(section.query ?? '', section.over);\n const named = authored !== undefined && title.toLowerCase().includes(authored.toLowerCase());\n if (named) return { title: windowNow ? windowTitle(title, section, windowNow) : title };\n if (!windowNow && authored) return { title, note: authored.charAt(0).toUpperCase() + authored.slice(1) };\n return { title };\n}\n\n/** The window phrase a query gives its `over` column (`close_date = last 90 days` → \"last 90 days\"). */\nfunction authoredWindow(query: string, over: string): string | undefined {\n const column = over.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const match = new RegExp(`\\\\b${column}\\\\s*=\\\\s*(.+?)(?=\\\\s+(?:and|or|sort|show|limit)\\\\b|\\\\s*\\\\)|\\\\s*$)`, 'i').exec(query);\n return match?.[1].trim();\n}\n\n/**\n * The window a section's own query sets on its `over` column — \"last 90\n * days\" — which its title says while the reader has picked none, so a card\n * titled \"Won\" reads \"Won (last 90 days)\" under All time and \"Won (last 30\n * days)\" once the reader picks that, never both windows at once.\n */\nexport function ownWindow(section: Section): string | undefined {\n if (!section.over || section.windowBase === undefined || !section.query) return undefined;\n const over = section.over.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const m = new RegExp(`(?:^|[\\\\s(])${over}\\\\s*=\\\\s*(last\\\\s+\\\\d+\\\\s+(?:day|week|month|year)s?)\\\\b`, 'i').exec(section.query);\n return m?.[1].replace(/\\s+/g, ' ').toLowerCase();\n}\n\n/** A section with the reader's picks folded in — only the columns its\n own table actually has; the rest pass it over, like the window. */\nexport function picked(section: Section, picks: Picks): Section {\n if (!section.table) return section;\n const table = findTable(section.table) as { columns: Array<{ name: string }> } | undefined;\n const conds = Object.entries(picks)\n .filter(([column]) => table?.columns.some((c) => c.name === column))\n .map(([column, value]) => `${column} = ${quote(String(value))}`);\n if (!conds.length) return section;\n /* The unwindowed query takes the picks too: a card's trend is drawn over\n it (Dashboard.tsx, Metric), and a picked owner's trend is theirs. */\n const goal = section.target;\n return {\n ...section,\n query: andQuery(section.query, ...conds),\n ...(section.windowBase !== undefined ? { windowBase: andQuery(section.windowBase, ...conds) } : {}),\n /* A whole is the same cohort as the figure: a picked owner's share is of that owner's rows. */\n ...(section.targetWhole && typeof goal === 'object'\n ? {\n target: {\n ...goal,\n query: andQuery(goal.query, ...conds),\n ...(goal.windowBase !== undefined ? { windowBase: andQuery(goal.windowBase, ...conds) } : {}),\n },\n }\n : {}),\n };\n}\n\n/** A window phrase as it rides the page token: spaces become hyphens, and\n matching happens slug-to-slug so nothing needs a lossless inverse. */\nexport const windowSlug = (w: string): string => w.replace(/\\s+/g, '-');\n\n/** The root slot, written: the window slug, then `column=value` per pick and\n `period.<section>=<slug>` per section's own window, `;`-separated. Empty\n when there is nothing to say. A dashboard that opens on a window (`opensOn`)\n leaves that one unsaid and says all time as `all-time`. */\nexport function rootSlot(windowNow: string | null, picks: Picks, periods: Periods = {}, opensOn?: string): string {\n const parts = [windowNow === (opensOn ?? null) ? '' : windowNow ? windowSlug(windowNow) : ALL_TIME];\n for (const [column, value] of Object.entries(picks ?? {})) parts.push(`${column}=${value}`);\n for (const [key, phrase] of Object.entries(periods)) parts.push(`${PERIOD_PREFIX}${key}=${windowSlug(phrase)}`);\n return parts.filter((p, i) => p || (i === 0 && parts.length > 1)).join(';');\n}\n\n/** The root slot, read: whatever is not `name=value` is the window; a `period.` name is a section's own. */\nexport function parseRootSlot(body: unknown): { window: string; picks: Picks; periods?: Periods } {\n const picks: Picks = {};\n const periods: Periods = {};\n let window = '';\n for (const part of String(body ?? '').split(';')) {\n const eq = part.indexOf('=');\n if (eq > 0 && part.startsWith(PERIOD_PREFIX)) periods[part.slice(PERIOD_PREFIX.length, eq)] = part.slice(eq + 1);\n else if (eq > 0) picks[part.slice(0, eq)] = part.slice(eq + 1);\n else if (part) window = readPeriod(part);\n }\n return { window, picks, ...(Object.keys(periods).length ? { periods } : {}) };\n}\n\n/** A free-form page's place, read from its slot: the parameters it declares, and nothing else a link carried. */\nexport function pagePlace(dashboard: DashboardDef, body: unknown): Picks {\n const params = dashboard.page?.params ?? [];\n return Object.fromEntries(Object.entries(parseRootSlot(body).picks).filter(([name]) => params.includes(name)));\n}\n\n/** Every section of a dashboard, main flow and aside. */\nexport const allSections = (dashboard: DashboardDef): Section[] => [...dashboard.sections, ...(dashboard.aside ?? [])];\n\n/** Ignore selections the current dashboard no longer offers: a window, a pick or a section's period it does not have. */\nexport function dashboardSelection(dashboard: DashboardDef, body: unknown): { window: string | null; picks: Picks; periods: Periods } {\n const linked = parseRootSlot(body);\n const periods: Periods = {};\n for (const section of allSections(dashboard)) {\n const slug = section.windowKey ? linked.periods?.[section.windowKey] : undefined;\n const phrase = slug ? section.windows?.find((w) => windowSlug(w) === slug) : undefined;\n if (phrase) periods[section.windowKey!] = phrase;\n }\n /* What the address says wins; unsaid, or a window no longer offered, is the one the dashboard opens on. */\n const offered = dashboard.windows?.find((w) => windowSlug(w) === linked.window);\n return {\n window: dashboard.window && linked.window === ALL_TIME ? null : (offered ?? dashboard.window ?? null),\n picks: Object.fromEntries(Object.entries(linked.picks).filter(([column]) => (dashboard.filters ?? []).includes(column))),\n periods,\n };\n}\n\n/**\n * Groups in the order a reader expects them: a column with a vocabulary (a\n * CHECK list, an enum) in that vocabulary's order — a pipeline reads\n * Prospecting, Qualification, Proposal, Negotiation, never the alphabet —\n * and anything else biggest first. Groups the vocabulary does not name (an\n * empty one, a stray value) come after it, biggest first.\n */\nexport function orderGroups<T extends Record<string, unknown>>(\n rows: readonly T[],\n key: string,\n value: string,\n vocabulary?: readonly string[],\n): T[] {\n const rank = new Map((vocabulary ?? []).map((word, at) => [word, at]));\n const place = (row: T) => (row[key] == null ? undefined : rank.get(String(row[key]))) ?? Number.POSITIVE_INFINITY;\n return [...rows].sort((a, b) => {\n const first = place(a),\n second = place(b);\n if (first !== second) return first - second;\n return (Number(b[value]) || 0) - (Number(a[value]) || 0);\n });\n}\n\n/**\n * A bar's length as a share of the largest group, not of the whole: three\n * equal groups each fill the track, rather than a third of it each, and the\n * biggest group always reaches the end. Never under 2%, so a group is seen.\n */\nexport function barShare(value: unknown, largest: number): number {\n return Math.max(2, Math.round((100 * (Number(value) || 0)) / Math.max(largest, 1)));\n}\n\n/**\n * A group's key said by the name of the record it is, where the answer names\n * it (a breakdown by a reference, `names` beside its rows: breakdown.ts,\n * withGroupNames), else as `sayKey` says the key: \"Ada Park\", not \"17\", as\n * the grid's cell says the same reference. Not called `say`: the build reads\n * every `say` in a module as the catalog's (vite.config.ts, short-catalog-keys).\n */\nexport function namedGroups(\n answer: { names?: Record<string, Record<string, string>> } | undefined,\n keyName: string | undefined,\n sayKey: (key: unknown) => string,\n): (key: unknown) => string {\n const names = keyName ? answer?.names?.[keyName] : undefined;\n if (!names) return sayKey;\n return (key) => (key != null && Object.hasOwn(names, String(key)) ? names[String(key)] : sayKey(key));\n}\n","import type { TextMeasure } from './gridSizing.js';\n\n/** Text widths in one font, from a shared canvas; `undefined` where there is\n no 2D context (the component tests), which falls back to counting. */\nlet measuringContext: CanvasRenderingContext2D | null | undefined;\nconst measures = new Map<string, TextMeasure>();\nexport function textMeasure(font: string): TextMeasure | undefined {\n if (measuringContext === undefined) {\n try {\n measuringContext = document.createElement('canvas').getContext('2d');\n } catch {\n measuringContext = null;\n }\n }\n const context = measuringContext;\n if (!context) return undefined;\n const known = measures.get(font);\n if (known) return known;\n const cache = new Map<string, number>();\n const measure: TextMeasure = (text) => {\n const seen = cache.get(text);\n if (seen !== undefined) return seen;\n context.font = font;\n /* Cells set their figures tabular (themeFamilies.css), and a canvas cannot: measured proportional,\n \"$105,828\" came out a few pixels short and its cell cut it to \"$105,8…\". A tabular figure is as wide\n as a zero, so every figure is measured as one. */\n const width = context.measureText(text.replace(/[0-9]/g, '0')).width;\n cache.set(text, width);\n return width;\n };\n measures.set(font, measure);\n return measure;\n}\n","/** What breakdownBatch says, in the dashboards room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../messages.js';\n\nexport const say = defineMessages({\n theBreakdownBatchCame: 'The breakdown batch came back the wrong length.',\n});\n","/**\n * A dashboard's breakdowns, and its lists, asked for together.\n *\n * Every card on a home asks for its number, a compare window's number and a\n * spark, and every chart and table once more: about thirty requests for eight\n * cards, queued behind one active connection and six browser sockets. The\n * cards still each ask for what they need (React Query keys, caches and\n * refetches each one); this only carries the questions that are asked in the\n * same moment in one request (`/api/breakdowns`) and hands each card its own\n * answer, or its own error. A dashboard's lists (its tables, the aside's\n * rows) are carried the same way (`batchedRun`): on a home, they were eight\n * requests of their own, each a round trip for a statement or two.\n *\n * A server that does not take a batch — a support session inside a tenant,\n * whose every read is ledgered as the one read it is, answers 404, and so does\n * an older server — is asked one at a time for the rest of the page's life.\n * A tenant or platform lease takes it: one admission for the cards, not one each.\n */\nimport { api } from './core.js';\nimport { sameReads } from './liveReads.js';\nimport { composedReply, mayBeComposed } from './composedReads.js';\nimport { composedConnection } from './composedHook.js';\nimport { firstPaintItem } from './firstPaint.js';\nimport type { HttpBreakdownDefinition } from '@mistriwork/engine/shared/resourceHttp.js';\nimport { say } from './copy/dashboards/breakdownBatch.js';\n\n/** A line of the language, or the structured breakdown a page's plan built;\n * `owner` routes it as `ownedBy` would (a page's own connection), and only\n * asks that go to the same owner share a request. */\ntype BreakdownAsk = (\n | { text: string; def?: never; run?: never }\n | { def: HttpBreakdownDefinition; text?: never; run?: never }\n /* A list's first page, as `/api/run` takes it. */\n | { run: RunAsk; text?: never; def?: never }\n) & { limit?: number; owner?: Record<string, string> };\ninterface RunAsk {\n q: string;\n limit: number;\n offset?: number;\n count?: 'none';\n exactCount?: boolean;\n}\n\ninterface Pending {\n ask: BreakdownAsk;\n resolve: (value: unknown) => void;\n reject: (error: unknown) => void;\n}\n\n/* The server's own ceiling (resourceReadHttp.ts, BREAKDOWN_BATCH). */\nconst MOST = 48;\nlet queue: Pending[] = [];\nlet scheduled = false;\n/* Set once a server says it has no such route; the rest of the page's life\n asks one at a time rather than being refused again. */\nlet unsupported = false;\n\nconst item = (ask: BreakdownAsk) =>\n ask.run ? { run: ask.run } : { ...(ask.def ? { def: ask.def } : { text: ask.text }), ...(ask.limit ? { limit: ask.limit } : {}) };\nconst single = (ask: BreakdownAsk) =>\n ask.run\n ? api('/api/run', { ...ask.run, ...ask.owner } as Parameters<typeof api<'/api/run'>>[1])\n : api('/api/breakdown', { ...item(ask), ...ask.owner } as Parameters<typeof api<'/api/breakdown'>>[1]);\n\n/** A list's first page, answered as `/api/run` would answer it, asked with the breakdowns of the same moment. */\nexport function batchedRun<T = unknown>(run: RunAsk, owner?: Record<string, string>): Promise<T> {\n return batchedBreakdown<T>({ run, ...(owner ? { owner } : {}) });\n}\n\n/** One breakdown, answered as `/api/breakdown` would answer it. */\nexport async function batchedBreakdown<T = unknown>(ask: BreakdownAsk): Promise<T> {\n /* A record page's figures come with its compose (composedReads.ts). */\n if (mayBeComposed('/api/breakdown')) {\n const composed = await composedReply('/api/breakdown', { ...item(ask), ...ask.owner });\n if (composed !== undefined) return composed as T;\n }\n /* A first page's sections come with the page (firstPaint.ts), each by what it asks. */\n const carried = firstPaintItem(ask.run ? 'run' : 'breakdown', ask.owner?.app ?? ask.owner?.conn ?? composedConnection(), item(ask));\n if (carried !== undefined) return carried as T;\n if (unsupported) return single(ask) as Promise<T>;\n return new Promise<T>((resolve, reject) => {\n queue.push({ ask, resolve: resolve as (value: unknown) => void, reject });\n if (scheduled) return;\n scheduled = true;\n /* A macrotask, not a microtask: the cards of one render mount their\n queries across several microtasks, and a timer is after all of them. */\n setTimeout(flush, 0);\n });\n}\n\nasync function flush() {\n scheduled = false;\n const waiting = queue;\n queue = [];\n const owners = new Map<string, Pending[]>();\n for (const pending of waiting) {\n const key = JSON.stringify(pending.ask.owner ?? {});\n owners.set(key, [...(owners.get(key) ?? []), pending]);\n }\n for (const group of owners.values()) {\n for (let start = 0; start < group.length; start += MOST) void send(group.slice(start, start + MOST));\n }\n}\n\nasync function send(batch: Pending[]) {\n if (batch.length === 1) {\n const [only] = batch;\n return single(only!.ask).then(only!.resolve, only!.reject);\n }\n let results: Array<{ status: number; body: unknown }>;\n let reply: unknown;\n try {\n reply = await api('/api/breakdowns', { items: batch.map(({ ask }) => item(ask)), ...batch[0]!.ask.owner });\n const said = reply as { results?: typeof results } | undefined;\n results = Array.isArray(said?.results) && said.results.length === batch.length ? said.results : [];\n if (!results.length) throw Object.assign(new Error(say('theBreakdownBatchCame')), { status: 404 });\n } catch (error) {\n const status = (error as { status?: number }).status;\n if (status === 404 || status === 405) unsupported = true;\n /* Whatever refused the batch, each card is owed its own answer: asked\n alone, a card gets the error its own read would, not the batch's. */\n for (const { ask, resolve, reject } of batch) single(ask).then(resolve, reject);\n return;\n }\n batch.forEach(({ resolve, reject }, index) => {\n const { status, body } = results[index]!;\n if (status < 400) return resolve(sameReads(body, reply));\n const said = body as { error?: string; message?: string } | null;\n reject(Object.assign(new Error(said?.message ?? said?.error ?? say('common.requestFailed', { status })), { status }));\n });\n}\n\n/** For tests: forget that a server refused the batch. */\nexport function resetBreakdownBatch() {\n queue = [];\n scheduled = false;\n unsupported = false;\n}\n","/** What AppColumnMenu says, in the column menu room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n columnOptions: '{label} column options',\n sortFilterPin: '{label}: sort, filter, pin',\n});\n","/**\n * An App list's column menu: the header's ⌄ with at most five entries.\n *\n * The Workbench keeps its power menu (ThMenu.tsx). In an App the reader\n * gets the two sorts in the column's own words, one Filter… that opens the\n * control the filter rail draws for the column (FilterRail.tsx's facet,\n * through the list bar's picker, so the three look and behave alike), Clear\n * filter while the column is narrowed, and Pin column, last. Where the list's\n * rail is beside the rows and already shows the column, Filter… goes to that\n * facet rather than opening a second one over it.\n *\n * What an open menu says and does is its own part (AppColumnMenuPopups.tsx),\n * loaded the first time a ⌄ is hovered, focused or opened.\n *\n * The list (AppList.tsx) provides what the menu writes through, as a ref\n * read when the menu is used: a context value that changed with every\n * keystroke in the search box would redraw the whole grid under it.\n */\nimport { createContext, useContext, useEffect, useRef, useState, type ComponentType, type RefObject } from 'react';\nimport type { ColumnMeta, TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport { onDemand } from './onDemand.js';\nimport type { Box } from './FilterBoxes.js';\nimport type { FacetUnit } from './FilterRail.js';\nimport type { FilterPickerProps } from './ListFilterBar.js';\nimport { say as sayCopy } from '../copy/columnMenu/components/AppColumnMenu.js';\n\n/** What an App list lends its grid's column menus. */\nexport interface AppColumnMenuHost {\n table: TableMeta;\n /** The whole question on screen, sort and all. */\n query: string;\n /** The reader's part of it, as the list's controls read it. */\n refinement: string;\n tabQuery: string;\n standing: string;\n /** The list's own key: its pins are its own, not its table's. */\n listKey: string;\n boxFor: (column: string) => Box | undefined;\n unitOf: (column: string) => FacetUnit | undefined;\n /** A new refinement, with the header whose menu asked for it taking the focus back. */\n apply: (refinement: string, column: string) => void;\n /** A new whole question (a sort), likewise. */\n navigate: (query: string, column: string) => void;\n /* Lent rather than imported, so the grid, which every surface draws, does\n not carry the list bar's pickers into rooms that have no App list. */\n /** The list bar's picker (ListFilterBar.tsx), which Filter… opens. */\n Picker: ComponentType<FilterPickerProps>;\n /** The rail's facet for the column, where a rail beside the rows shows it. */\n railFacet: (column: string) => HTMLElement | null;\n}\n\n/* The ⌄ a choice was made from, to take the focus back once the list has\n redrawn under it: the rows of a new question arrive after the navigation,\n and the header with them. A few seconds, not forever — a question that\n lands on no rows draws no header to come back to. */\nlet comeBack: { column: string; at: number } | null = null;\n/** Say which column's ⌄ takes the focus when the grid next draws. */\nexport function returnFocusTo(column: string): void {\n comeBack = { column, at: Date.now() };\n}\n\nexport const AppColumnMenuContext = createContext<RefObject<AppColumnMenuHost | null> | null>(null);\nexport const useAppColumnMenu = () => useContext(AppColumnMenuContext);\n\nconst Popups = onDemand(() => import('./AppColumnMenuPopups.js'), 'AppColumnMenuPopups', { quiet: true });\n\n/** What a column's ⌄ is told of its column. */\nexport interface ColumnMenuProps {\n name: string;\n /** The column's caption, for the button's name and the popover's. */\n label: string;\n kind: string;\n meta: ColumnMeta | undefined;\n sortable: boolean;\n current: 'asc' | 'desc' | null;\n /** The path a reference is drawn by (`owner_id.name`), where the list names it. */\n drawnBy?: string;\n /** The columns as drawn, for the pin store's order. */\n columns: string[];\n}\n\nexport function AppColumnMenuButton({ host, ...column }: ColumnMenuProps & { host: RefObject<AppColumnMenuHost | null> }) {\n const { name, label } = column;\n const button = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState<'menu' | 'filter' | null>(null);\n /* Where the focus goes as the menu closes: back to the ⌄, or on into the\n popover or the rail, which take it themselves. */\n const handBack = useRef(true);\n useEffect(() => {\n if (!comeBack || comeBack.column !== name) return;\n if (Date.now() - comeBack.at < 3000) button.current?.focus();\n comeBack = null;\n });\n if (!host.current) return null;\n const soon = () => {\n void Popups.ready();\n };\n return (\n <>\n <button\n ref={button}\n type=\"button\"\n className=\"th-filter\"\n data-column={name}\n aria-label={sayCopy('columnOptions', { label })}\n title={sayCopy('sortFilterPin', { label })}\n aria-haspopup=\"menu\"\n aria-expanded={open === 'menu'}\n onPointerEnter={soon}\n onFocus={soon}\n onClick={(e) => {\n e.stopPropagation();\n handBack.current = true;\n setOpen(open === 'menu' ? null : 'menu');\n }}\n >\n <span className=\"th-filter-icon\" aria-hidden=\"true\" />\n </button>\n {open && <Popups host={host} button={button} open={open} setOpen={setOpen} handBack={handBack} {...column} />}\n </>\n );\n}\n","/**\n * A row's children, opened in place — the vanilla client's view of it.\n *\n * The expander and the detail row are components (components/Nested.tsx) and\n * their answers live in the Query cache; what stays here is what the rest\n * of the client asks: whether a table has children at all, and the reset a\n * new result calls for.\n */\nimport { refsTo } from './core.js';\nimport { queryClient } from './components/mount.js';\n\n/** A new result means new rows; answers cached against the old ones are\n answers to a question nobody is asking any more. A row still open on\n screen is still asking — a sort or a page re-asks the table in place and\n keeps it open — so its answer is refreshed where it stands rather than\n pulled from under it. */\nexport function resetNested() {\n const cache = queryClient.getQueryCache();\n for (const query of cache.findAll({ queryKey: ['nested'] })) {\n if (query.getObserversCount() > 0) void queryClient.invalidateQueries({ queryKey: query.queryKey, exact: true });\n else cache.remove(query);\n }\n}\n\n/** Whether expanding would show anything at all. */\nexport const hasChildren = (table) => Boolean(table) && refsTo(table.id).length > 0;\n","/**\n * How the same rows are read on a phone — as records or as the table — as a\n * two-icon segmented control at the row's end, not a second row of tabs\n * under the list's own view tabs (which it matched word for word and\n * underline for underline). The names stay on the buttons for a screen reader.\n */\nexport function PresentationSwitch({\n layout,\n onChange,\n label,\n records,\n table,\n}: {\n layout: string;\n onChange: (mode: string) => void;\n label: string;\n records: string;\n table: string;\n}) {\n return (\n <div className=\"record-presentation\" role=\"group\" aria-label={label}>\n {(['records', 'table'] as const).map((mode) => (\n <button\n key={mode}\n type=\"button\"\n className=\"presentation-seg\"\n aria-pressed={layout === mode}\n aria-label={mode === 'records' ? records : table}\n title={mode === 'records' ? records : table}\n onClick={() => onChange(mode)}\n >\n <svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.4\">\n {mode === 'records' ? (\n <path d=\"M2 4h12M2 8h12M2 12h12\" />\n ) : (\n <>\n <rect x=\"2\" y=\"3\" width=\"12\" height=\"10\" rx=\"1\" />\n <path d=\"M2 7h12M6.5 3v10\" />\n </>\n )}\n </svg>\n </button>\n ))}\n </div>\n );\n}\n","/**\n * Folding a filter into an existing query.\n *\n * Pure — no DOM, no state — so the rules can be tested directly rather than\n * through a browser. They are fiddly enough to deserve it: the naive version\n * of this produces queries that silently match nothing.\n */\n\n/**\n * Fold a new condition into an existing query, following the grammar.\n *\n * The naive version — append \" and <condition>\" — produces\n * `status = scheduled and status = scheduled`, and picking a second value for\n * the same column gives `status = a and status = b`, which matches nothing.\n * Neither is what anyone means by clicking two values in a list.\n *\n * The rule that matches intent: conditions on *different* columns combine\n * with AND, conditions on the *same* column combine with OR — and the\n * language already has a word for OR within one column, so repeat equality\n * folds into `in (…)` rather than growing a chain of ors. That keeps the\n * query readable, which matters because the query is the thing you save,\n * share and edit by hand.\n */\nimport { splitConditions, splitQuery } from './clauses.js';\n\nexport function composeFilter(query, table, column, condition) {\n /* Clauses have to stay at the end for the parser to read them as clauses,\n so a new condition is inserted before them, never appended.\n \n Split by the shared splitter rather than by a regex of its own. The regex\n was blind to quotes, so `customer note = \"sort me\"` split at the `sort`\n inside the value: everything from that word became a clause, the\n condition was cut in half, and adding a filter destroyed the query it was\n added to. `splitQuery` masks quoted spans and sorts boundaries by\n position, which is the behaviour the query bar has always had — there was\n no reason for this file to have a second, worse one. */\n const parts = splitQuery(query);\n const head = `${parts.table}${parts.filter ? ` ${parts.filter}` : ''}`.trim();\n const tailPieces = [parts.show ? ` ${parts.show}` : '', parts.sort ? ` ${parts.sort}` : '', parts.limit ? ` ${parts.limit}` : ''];\n const tail = tailPieces.join('');\n\n const equality = condition.match(new RegExp(`^${escapeRe(column)}\\\\s*=\\\\s*(.+)$`));\n if (equality) {\n const value = equality[1].trim();\n /* Found by splitting the conditions rather than by matching a value with\n a regex. The regex read a value as `\\\\S+` — one token — which is most\n values and not all of them: `hired_on = this year` matched `this`, and\n folding it into a list replaced only that much, leaving\n\n employee hired_on in (this, last 7 days) year\n\n — text the parser cannot read, which came back as \"0 rows\" rather than\n as an error. A filter UI that silently empties the table is the thing\n this module exists to prevent, and it was doing it. */\n const existing = conditionOn(head, column, table);\n\n if (existing && existing.op === 'in') {\n if (existing.values.includes(value)) return `${head}${tail}`;\n /* A value that cannot sit in a list does not join one. */\n if (!listable(value)) return `${replaceCondition(head, table, existing, condition)}${tail}`;\n const merged = `${column} in (${[...existing.values, value].join(', ')})`;\n return `${replaceCondition(head, table, existing, merged)}${tail}`;\n }\n if (existing && existing.op === '=') {\n if (existing.value === value) return `${head}${tail}`;\n /* Two values fold into `in (…)` only when both are things a list can\n hold. A relative date phrase is not one: `last 7 days` is a *range*,\n and \"hired in this year or in the last seven days\" is not what\n picking a second period from a menu of periods means — picking one\n replaces the last. It is also not expressible, which is how the bug\n above announced itself. */\n if (!listable(value) || !listable(existing.value)) {\n return `${replaceCondition(head, table, existing, condition)}${tail}`;\n }\n const merged = `${column} in (${existing.value}, ${value})`;\n return `${replaceCondition(head, table, existing, merged)}${tail}`;\n }\n }\n\n /* A null check replaces any other condition on the same column: `x is\n empty and x = 3` is a contradiction, not a refinement. */\n const nullCheck = condition.match(new RegExp(`^${escapeRe(column)}\\\\s+is\\\\s+(not\\\\s+)?empty$`, 'i'));\n if (nullCheck) {\n const stripped = stripConditionsOn(head, column, table);\n return `${stripped}${stripped.trim() === table ? '' : ' and'} ${condition}${tail}`;\n }\n\n if (head === table) return `${head} ${condition}${tail}`;\n return `${head} and ${condition}${tail}`;\n}\n\n/**\n * Can this value sit inside `in (…)`?\n *\n * A bare token or a quoted string. Anything else — a relative date phrase, a\n * range, an unquoted value with a space in it — is not a list member, and the\n * list it would be written into is text no parser here accepts.\n */\nfunction listable(value) {\n const text = String(value ?? '').trim();\n if (!text) return false;\n /* Spelled out rather than as one regex: a quote character inside a regex\n literal is indistinguishable from the start of a string to anything\n reading this file with a tokenizer simpler than a parser, and\n `check-client-imports` is exactly that. */\n const quote = String.fromCharCode(34);\n if (text.startsWith(quote) && text.endsWith(quote) && text.length > 1) {\n return !text.slice(1, -1).includes(quote);\n }\n return !/[\\s,()]/.test(text);\n}\n\n/**\n * The one top-level condition on `column`, split the way the parser splits.\n *\n * Returns its exact text, so it can be swapped out without a regex having to\n * work out where a value ends — which is the mistake this file has now made\n * twice, once on quotes and once on multi-word values.\n */\nfunction conditionOn(head, column, table) {\n const body = head.slice(table.length).trim();\n const on = new RegExp(`^${escapeRe(column)}\\\\s*(=|\\\\bin\\\\b)`, 'i');\n for (const part of splitConditions(body)) {\n const text = part.trim();\n if (!on.test(text)) continue;\n const list = text.match(new RegExp(`^${escapeRe(column)}\\\\s+in\\\\s*\\\\(([^)]*)\\\\)$`, 'i'));\n if (list) {\n return {\n text,\n op: 'in',\n values: list[1]\n .split(',')\n .map((v) => v.trim())\n .filter(Boolean),\n };\n }\n const eq = text.match(new RegExp(`^${escapeRe(column)}\\\\s*=\\\\s*(.+)$`, 'i'));\n if (eq) return { text, op: '=', value: eq[1].trim() };\n }\n return null;\n}\n\n/** Swap one condition for another, leaving every other condition alone. */\nfunction replaceCondition(head, table, existing, next) {\n const body = head.slice(table.length).trim();\n const parts = splitConditions(body).map((part) => (part.trim() === existing.text ? next : part.trim()));\n return `${table} ${parts.join(' and ')}`.trim();\n}\n\n/**\n * Remove every top-level condition mentioning `column`.\n *\n * Split by `splitConditions`, which tracks quotes and parentheses. Splitting\n * on `\\s+and\\s+` took `name = \"a and b\"` apart in the middle of a value, and\n * took `(a = 1 and b = 2)` apart inside a group it was supposed to leave\n * whole — turning one condition the reader wrote into two the parser could\n * not read.\n */\nfunction stripConditionsOn(head, column, table) {\n const body = head.slice(table.length).trim();\n const kept = splitConditions(body).filter((part) => !new RegExp(`^${escapeRe(column)}\\\\b`, 'i').test(part.trim()));\n return kept.length ? `${table} ${kept.join(' and ')}` : table;\n}\n\nfunction escapeRe(text) {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n","/** What ThMenu says, in the column menu room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n greaterThan: 'greater than {mid}',\n lessThan: 'less than {mid}',\n ofTheFirst: 'of the first {rowsCount}',\n ofHere: 'of {rowsCount} here',\n equalsAValue: 'equals a value…',\n value: 'Value',\n greaterThanMore: 'greater than…',\n minimum: 'Minimum',\n lessThanMore: 'less than…',\n maximum: 'Maximum',\n onOrAfter: 'on or after…',\n date: 'Date',\n before: 'before…',\n contains: 'contains…',\n textToLook: 'Text to look for',\n starts: 'starts with…',\n prefix: 'Prefix',\n matchesAPattern: 'matches a pattern…',\n between: 'between…',\n noIndexAFull: 'no index — a full scan',\n filter: 'Filter {name}',\n addsAConditionToTheQuery: 'Adds a condition to the query, which you can edit afterwards.',\n bothEndsAreIncluded: 'Both ends are included. Adds a condition you can edit afterwards.',\n unpinThisColumn: 'Unpin this column',\n pinThisColumn: 'Pin this column',\n letItScrollAway: 'let it scroll away',\n keepItInView: 'keep it in view',\n sortAscending: 'Sort ascending',\n sortDescending: 'Sort descending',\n thenByAscending: 'Then by, ascending',\n thenByDescending: 'Then by, descending',\n fieldFrom: '{fieldLabel} from',\n fieldTo: '{fieldLabel} to',\n});\n","/**\n * The column header's ⌄ menu: pin, sort, and a filter built from what the\n * column holds — sampled values where the column repeats, typed conditions\n * always, ranges where a range means anything. The sampling round trip\n * stays in `thmenu.js`; this is the menu, and the rule for what it offers.\n */\nimport { Menu } from '@base-ui/react/menu';\nimport { layoutViewport, zoomAnchor } from '@mistriwork/ui/internal/anchor.js';\nimport { go, quote, refine, render, tableView } from '../core.js';\nimport { addSort, nextSort, sortCount, sortDirection } from '../clauses.js';\nimport { SORT_SCAN_BELOW } from '../columns.js';\nimport { composeFilter } from '../compose.js';\nimport { promptFor, promptForRange } from '../prompt.js';\nimport { pinnedFor, togglePin } from '../pins.js';\nimport type { TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport { formatNumber } from '../locale.js';\nimport { say } from '../copy/columnMenu/components/ThMenu.js';\nimport { popupContainer } from '../shellHost.js';\n\nexport type Kind = 'boolean' | 'date' | 'number' | 'text' | string;\ntype Row = Record<string, unknown>;\nexport interface Typed {\n label: string;\n build: (value: string) => string;\n placeholder: string;\n type: string;\n}\nexport interface Offer {\n options: Array<[string, string]>;\n typed: Typed[];\n ranges: Array<[string, string, string]>;\n asStamp: (v: string) => string;\n}\n\n/** Quote a typed value only when the grammar needs it. Trimmed, then handed to the one quoter. */\nconst quoteValue = (text: string) => quote(String(text).trim()) as string;\n\n/**\n * What the menu offers a column of this kind, given a sample of its rows.\n * Dates get ranges, not equality; sampled values only where the column\n * repeats; typed conditions always, because on a key the sample is a list\n * of arbitrary values and the thing wanted is to name one.\n */\nexport function offersFor(name: string, kind: Kind, dateish: boolean, rows: Row[], metaType?: string): Offer {\n const options: Array<[string, string]> = [];\n if (kind === 'boolean') {\n options.push(['is true', `${name} = true`], ['is false', `${name} = false`]);\n } else if (kind === 'date' || dateish) {\n for (const phrase of ['today', 'last 7 days', 'last 30 days', 'this month', 'last month', 'this year'])\n options.push([phrase, `${name} = ${phrase}`]);\n } else if (kind === 'number') {\n const values = rows.map((r) => Number(r[name])).filter((n) => Number.isFinite(n));\n if (values.length) {\n const mid = Math.round((Math.min(...values) + Math.max(...values)) / 2);\n options.push(\n [say('greaterThan', { mid: formatNumber(mid) }), `${name} > ${mid}`],\n [say('lessThan', { mid: formatNumber(mid) }), `${name} < ${mid}`],\n );\n }\n }\n const counts = new Map<unknown, number>();\n for (const row of rows) {\n const value = row[name];\n if (value === null || value === undefined) continue;\n counts.set(value, (counts.get(value) ?? 0) + 1);\n }\n const distinct = [...counts.entries()].sort((a, b) => b[1] - a[1]);\n if (distinct.length && distinct.length <= Math.max(3, rows.length / 2)) {\n /* The counts are honest about their sample: bare numbers read as table totals. */\n const sampled = rows.length >= 400 ? say('ofTheFirst', { rowsCount: rows.length }) : say('ofHere', { rowsCount: rows.length });\n for (const [value, count] of distinct.slice(0, 8)) {\n const text = String(value);\n const quoted = /^[\\w.-]+$/.test(text) ? text : `\"${text.replace(/\"/g, '')}\"`;\n options.push([`${text} · ${count} ${sampled}`, `${name} = ${quoted}`]);\n }\n }\n options.push(['is empty', `${name} is empty`], ['is not empty', `${name} is not empty`]);\n\n /* A timestamp gets a time in its picker and a date does not, read off the declared type so the answer is the same before the table has rows. */\n const hasTime = /time|timestamp/i.test(metaType ?? '');\n const dateInput = hasTime ? 'datetime-local' : 'date';\n /* `2026-01-01T09:30` is what the control hands back and not what any of these databases write. */\n const asStamp = (v: string) => String(v).replace('T', ' ');\n const typed: Typed[] =\n kind === 'number'\n ? [\n { label: say('equalsAValue'), build: (v) => `${name} = ${v}`, placeholder: say('value'), type: 'text' },\n { label: say('greaterThanMore'), build: (v) => `${name} > ${v}`, placeholder: say('minimum'), type: 'text' },\n { label: say('lessThanMore'), build: (v) => `${name} < ${v}`, placeholder: say('maximum'), type: 'text' },\n ]\n : kind === 'date'\n ? [\n { label: say('onOrAfter'), build: (v) => `${name} >= ${quoteValue(asStamp(v))}`, placeholder: say('date'), type: dateInput },\n { label: say('before'), build: (v) => `${name} < ${quoteValue(asStamp(v))}`, placeholder: say('date'), type: dateInput },\n ]\n : [\n { label: say('equalsAValue'), build: (v) => `${name} = ${quoteValue(v)}`, placeholder: say('value'), type: 'text' },\n { label: say('contains'), build: (v) => `${name} contains ${quoteValue(v)}`, placeholder: say('textToLook'), type: 'text' },\n { label: say('starts'), build: (v) => `${name} startswith ${quoteValue(v)}`, placeholder: say('prefix'), type: 'text' },\n /* The escape hatch from the three above, which all escape `%`. Here the wildcards are the question. */\n {\n label: say('matchesAPattern'),\n build: (v) => `${name} like ${quoteValue(v)}`,\n placeholder: say('common.patternEGWh'),\n type: 'text',\n },\n ];\n const ranges: Array<[string, string, string]> =\n kind === 'date' ? [[say('between'), dateInput, say('date')]] : kind === 'number' ? [[say('between'), 'text', say('value')]] : [];\n return { options, typed, ranges, asStamp };\n}\n\ninterface FilterMenuProps {\n anchor: HTMLElement;\n name: string;\n kind: Kind;\n metaType?: string;\n dateish: boolean;\n rows: Row[];\n table: TableMeta | undefined;\n /** The columns as drawn, for the pin store's order. */\n columns: string[];\n entry: { table: string; query: string } | null;\n onClose: () => void;\n}\n\nexport function FilterMenu({ anchor, name, kind, metaType, dateish, rows, table, columns, entry, onClose }: FilterMenuProps) {\n const offer = offersFor(name, kind, dateish, rows, metaType);\n const pinned = table ? (pinnedFor(table, columns) as string[]) : [];\n /* Sort and filter from a header refine the room on screen rather than\n starting it over (core.js `refine`): the grid is re-asked in place. */\n const apply = (condition: string) => {\n if (entry) refine(() => go(tableView(entry.table, composeFilter(entry.query, entry.table, name, condition)), 'replace'));\n };\n const add = (condition: string) => {\n apply(condition);\n onClose();\n };\n /* Sorting always offered, whatever the index says, and the cost stated rather than the action withheld. */\n const indexLeads = !table?.indexed || table.indexed.includes(name);\n const bigTable =\n (table as { approxRows?: number } | undefined)?.approxRows != null &&\n (table as { approxRows: number }).approxRows >= (SORT_SCAN_BELOW as number);\n const sortsAlready = Boolean(entry) && (sortCount(entry!.query) as number) > 0 && sortDirection(entry!.query, name) === null;\n const sortItem = (label: string, direction: 'asc' | 'desc', append = false) =>\n entry ? (\n <Item\n key={label}\n onClick={() => {\n refine(() => go(tableView(entry.table, (append ? addSort : nextSort)(entry.query, name, direction)), 'replace'));\n onClose();\n }}\n >\n <span className=\"th-menu-label\">{label}</span>\n <span className=\"th-menu-cond\">{indexLeads || !bigTable ? `sort ${name}` : say('noIndexAFull')}</span>\n </Item>\n ) : null;\n\n const ask = async (typed: Typed) => {\n onClose();\n const value = await promptFor({\n title: say('filter', { name }),\n label: typed.label,\n placeholder: typed.placeholder,\n type: typed.type,\n confirmLabel: say('common.apply'),\n hint: say('addsAConditionToTheQuery'),\n });\n if (value) apply(typed.build(value));\n };\n const askRange = async ([, inputType, fieldLabel]: [string, string, string]) => {\n onClose();\n const range = await promptForRange({\n title: say('filter', { name }),\n fromLabel: say('fieldFrom', { fieldLabel }),\n toLabel: say('fieldTo', { fieldLabel }),\n type: inputType,\n hint: say('bothEndsAreIncluded'),\n placeholder: undefined,\n });\n if (range) apply(`${name} between ${quoteValue(offer.asStamp(range.from))} and ${quoteValue(offer.asStamp(range.to))}`);\n };\n /* Base UI owns the menu's keyboard and its dismissal: focus moves in on\n open, arrows walk the items, Escape and a click outside close only this\n layer, and focus goes back to the ⌄ that opened it. Placed under the\n header on the zoom-aware ruler, flipped or shifted when it would run\n off an edge — which happens constantly on a wide table scrolled to the end. */\n return (\n <Menu.Root\n open\n onOpenChange={(next) => {\n if (next) return;\n /* Dismissed rather than used: the keyboard goes back to the ⌄. */\n if (anchor.isConnected) anchor.focus();\n onClose();\n }}\n >\n <Menu.Portal container={popupContainer()}>\n <Menu.Positioner\n anchor={() => zoomAnchor(anchor)}\n positionMethod=\"fixed\"\n side=\"bottom\"\n align=\"start\"\n sideOffset={4}\n collisionBoundary={layoutViewport()}\n collisionPadding={12}\n style={{ zIndex: 40 }}\n >\n <Menu.Popup className=\"th-menu\" finalFocus={() => (anchor.isConnected ? anchor : false)}>\n {/* First, because it is the one item about *reading* the table rather than narrowing it. */}\n {table ? (\n <Item\n onClick={() => {\n togglePin(table, columns, name);\n onClose();\n render();\n }}\n >\n <span className=\"th-menu-label\">{pinned.includes(name) ? say('unpinThisColumn') : say('pinThisColumn')}</span>\n <span className=\"th-menu-cond\">{pinned.includes(name) ? say('letItScrollAway') : say('keepItInView')}</span>\n </Item>\n ) : null}\n {sortItem(say('sortAscending'), 'asc')}\n {sortItem(say('sortDescending'), 'desc')}\n {/* \"Then by\" appears only once there is something to be *after*. */}\n {sortsAlready ? sortItem(say('thenByAscending'), 'asc', true) : null}\n {sortsAlready ? sortItem(say('thenByDescending'), 'desc', true) : null}\n {table ? <Menu.Separator className=\"th-menu-sep\" /> : null}\n {offer.typed.map((typed) => (\n <Item key={typed.label} className=\"th-menu-item th-menu-typed\" onClick={() => void ask(typed)}>\n <span className=\"th-menu-label\">{typed.label}</span>\n </Item>\n ))}\n {offer.ranges.map((range) => (\n <Item key={range[0]} className=\"th-menu-item th-menu-typed\" onClick={() => void askRange(range)}>\n <span className=\"th-menu-label\">{range[0]}</span>\n </Item>\n ))}\n {offer.typed.length ? <Menu.Separator className=\"th-menu-sep\" /> : null}\n {offer.options.map(([label, condition]) => (\n <Item key={condition + label} onClick={() => add(condition)}>\n <span className=\"th-menu-label\">{label}</span>\n <span className=\"th-menu-cond\">{condition}</span>\n </Item>\n ))}\n </Menu.Popup>\n </Menu.Positioner>\n </Menu.Portal>\n </Menu.Root>\n );\n}\n\n/** One row of the menu, drawn as the button it always was. */\nfunction Item({ className = 'th-menu-item', onClick, children }: { className?: string; onClick: () => void; children: React.ReactNode }) {\n /* The handlers close the menu themselves (onClose unmounts it), so the\n item does not also ask Base UI to — that told the caller twice. */\n return (\n <Menu.Item render={<button type=\"button\" className={className} />} nativeButton closeOnClick={false} onClick={onClick}>\n {children}\n </Menu.Item>\n );\n}\n","/**\n * The per-column filter menu of the grid, and the sort it rewrites.\n *\n * Its own module: the grid is a component now, and this menu is the one\n * piece of it that stays a transient vanilla surface — appended to the\n * body, driven by the keyboard, gone on Escape — the way the palette and\n * the topbar's ··· menu are.\n */\nimport { createElement } from 'react';\nimport { api, currentEntry, findTable, go, looksLikeDateColumn, quote, refine, state, tableView } from './core.js';\nimport { addSort, nextSort } from './clauses.js';\nimport { mount, unmount } from './components/mount.js';\nimport { FilterMenu } from './components/ThMenu.js';\nimport { portalRoot, shellQueryAll } from './shellHost.js';\n\nlet host = null;\n\nfunction closeMenu() {\n if (!host) return;\n unmount(host);\n host.remove();\n host = null;\n}\n\n/**\n * Open the header menu for a column — `components/ThMenu.tsx`. What stays here is\n * the sampling: values come from the *unfiltered* table, not the visible\n * page, because once you have filtered to status = scheduled the page offers\n * exactly the filter you already applied.\n */\nexport async function openFilterMenu(anchor, meta, name, rows, plan) {\n closeMenu();\n const entryNow = currentEntry();\n let sample = rows;\n if (entryNow && entryNow.kind === 'table' && entryNow.query.trim() !== entryNow.table) {\n try {\n const unfiltered = await api('/api/run', { q: `${entryNow.table} show ${name}`, limit: 400, count: 'none' });\n if (unfiltered.rows?.length) sample = unfiltered.rows;\n } catch {\n // Sampling is a nicety; the rest of the menu still works without it.\n }\n }\n /* The header this menu belongs to may be gone: the sample takes a round\n trip, and navigating during it leaves the anchor detached. */\n if (!anchor.isConnected) return;\n\n const table = findTable(currentEntry()?.table ?? '');\n const columns = [...shellQueryAll('.table-wrap thead th')].map((th) => th.querySelector('.th-sort')?.firstChild?.textContent ?? '');\n host = document.createElement('div');\n host.className = 'host-contents';\n portalRoot().append(host);\n mount(\n host,\n createElement(FilterMenu, {\n anchor,\n name,\n kind: plan.kind,\n metaType: meta?.type,\n dateish: dateish(meta, name),\n rows: sample,\n table,\n columns,\n entry: entryNow && entryNow.kind === 'table' ? entryNow : null,\n onClose: closeMenu,\n }),\n );\n}\n\n/**\n * The date test from core.js, applied to the name the *result set* used.\n *\n * A joined column arrives under its path — `customer_id.opened_on` — and the\n * column meta beside it still calls itself `opened_on`, so the name has to be\n * passed in rather than read off the meta.\n *\n * The copy that used to be written out here had lost `timestamp`, `datetime`\n * and `deleted` from the name pattern, so the filter menu offered `=` on an\n * `event_timestamp TEXT` column and hid the relative-date phrases that are\n * the only sensible thing to say about a date.\n */\nconst dateish = (meta, name) => Boolean(meta) && looksLikeDateColumn({ type: meta.type, name });\n\n/**\n * `append` adds a level to the sort instead of replacing it — shift-click,\n * which is the gesture every grid uses for exactly this.\n */\nexport function sortBy(column, direction, append = false) {\n const entry = state.stack[state.stack.length - 1];\n if (!entry || entry.kind !== 'table') return;\n /* `nextSort` must keep receiving `undefined` when no direction was named:\n an explicit direction means \"write down what is already happening\" and\n deliberately skips the ascending → descending cycle. Defaulting it here\n cost the header its second click. `addSort` has no cycle to skip, so it\n takes a direction. */\n /* A refinement: the same table room re-asks in place (core.js `refine`),\n so the header that was clicked, the rows' decorations and the focus stay. */\n refine(() =>\n go(\n tableView(entry.table, append ? addSort(entry.query, column, direction ?? 'asc') : nextSort(entry.query, column, direction)),\n 'replace',\n ),\n );\n}\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/** What Nested says, in the lists and grid room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n showWhatPointsAtThisRow: 'Show what points at this row',\n looking: 'Looking…',\n nothingPointsAtThisRow: 'Nothing points at this row.',\n viaColumns: 'via {columns}',\n seeAll: 'See all →',\n});\n","/**\n * A row's children, opened in place.\n *\n * The view composer answers \"how many\" with an aggregate and deliberately\n * refuses to LEFT JOIN a has-many, because that multiplies the base row.\n * Expanding a row is the answer that does not multiply it: the children\n * live in their own row underneath, one query per relationship keyed on\n * that row, so the base row remains one row and its numbers its own.\n *\n * Fetched when opened rather than with the page, and kept by Query so that\n * closing and reopening is free; a new result clears the cache (see\n * `resetNested` in nested.js).\n */\nimport { useQuery } from '@tanstack/react-query';\nimport { api, findTable, go, keyOf, openRecord, quote, refsTo, tableView } from '../core.js';\nimport { equalityFilter } from '../resourceRequests.js';\nimport type { TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport type { Grid as GridComponent, GridData, Row } from './Grid.js';\nimport { formatApprox, formatNumber } from '../locale.js';\nimport { say } from '../copy/lists/components/Nested.js';\n\n/** Rows of a child table shown inline before it needs its own page. */\nconst INLINE = 5;\n\ninterface Fk {\n name: string;\n from: { table: string; columns: string[] };\n to: { table: string; columns: string[] };\n}\n\ninterface Section {\n fk: Fk;\n child: TableMeta;\n data?: GridData;\n total?: number;\n exact?: boolean;\n error?: string;\n}\n\nasync function fetchChildren(table: TableMeta, key: Record<string, unknown>): Promise<Section[]> {\n const sections = await Promise.all(\n (refsTo(table.id) as Fk[]).map(async (fk): Promise<Section | null> => {\n const child = findTable(fk.from.table) as TableMeta | undefined;\n if (!child) return null;\n /* Every column of the key has to match, which is what makes this correct\n for a composite key and not only for a single-column one. */\n const conditions = fk.to.columns.map((parentColumn, i) => ({\n column: fk.from.columns[i] ?? fk.from.columns[0],\n op: '=',\n value: key[parentColumn],\n }));\n if (conditions.some((c) => c.value === undefined || c.value === null)) return null;\n try {\n const filter = equalityFilter(Object.fromEntries(conditions.map((condition) => [condition.column, condition.value])));\n // A source that reports no totals (an API) is not asked for one it would refuse.\n const counted = child.countable !== false;\n const [data, total] = await Promise.all([\n api('/api/query', { table: child.id, filter, limit: INLINE, offset: 0 }),\n counted ? api('/api/count', { table: child.id, filter }) : Promise.resolve(undefined),\n ]);\n return { fk, child, data, total: total?.count, exact: total?.exact };\n } catch (err) {\n return { fk, child, error: (err as Error).message };\n }\n }),\n );\n return sections.filter((s): s is Section => Boolean(s)).filter((s) => s.error || (s.data?.rows.length ?? 0) > 0);\n}\n\n/** The little triangle, drawn into its row's host (components/RowHost.tsx).\n The row itself navigates; opening the detail is a different intent and\n must not also walk away from the table — or out of whatever holds it. */\nexport function Expander({ open, onToggle }: { open: boolean; onToggle: () => void }) {\n return (\n <button\n type=\"button\"\n className=\"expander\"\n aria-expanded={open}\n aria-label={say('showWhatPointsAtThisRow')}\n title={say('showWhatPointsAtThisRow')}\n onClick={(e) => {\n e.stopPropagation();\n onToggle();\n }}\n >\n {open ? '▾' : '▸'}\n </button>\n );\n}\n\n/**\n * The detail, in a sibling `<tr>` rather than inside the row's own cell,\n * because a table row cannot contain another table without the inner one\n * inheriting the outer one's column widths.\n */\nexport function DetailRow({\n table,\n row,\n colSpan,\n grid: Grid,\n}: {\n table: TableMeta;\n row: Row;\n colSpan: number;\n /** The grid that draws a child's rows: handed in, since a nested grid is a Grid and an import would loop. */\n grid: typeof GridComponent;\n}) {\n const key = keyOf(table, row) as Record<string, unknown>;\n const children = useQuery({\n queryKey: ['nested', table.id, key],\n queryFn: () => fetchChildren(table, key),\n staleTime: Infinity,\n });\n return (\n <tr className=\"detail-row\">\n <td className=\"detail-cell\" colSpan={colSpan}>\n {children.isPending && <p className=\"loading\">{say('looking')}</p>}\n {children.data && !children.data.length && <p className=\"note\">{say('nothingPointsAtThisRow')}</p>}\n {children.data?.map((section) => (\n <div key={section.fk.name} className=\"detail-section\">\n {section.error ? (\n <>\n <h4>{section.child.name}</h4>\n <p className=\"sql-error\" role=\"alert\">\n {section.error}\n </p>\n </>\n ) : (\n <>\n <div className=\"detail-head\">\n <h4>{section.child.name}</h4>\n <span className=\"detail-via\">{say('viaColumns', { columns: section.fk.from.columns.join(', ') })}</span>\n {section.total !== undefined && (\n <span className=\"detail-count\">\n {section.exact === false ? `~${formatApprox(section.total)}` : formatNumber(section.total)}\n </span>\n )}\n {/* Without a total (an API), a full inline page is the sign that more follow. */}\n {(section.total === undefined\n ? (section.data?.rows.length ?? 0) >= INLINE\n : section.total > (section.data?.rows.length ?? 0)) && (\n <button\n type=\"button\"\n className=\"ghost detail-all\"\n onClick={() => {\n const conditions = section.fk.from.columns\n .map((col, i) => `${col} = ${quote(key[section.fk.to.columns[i]])}`)\n .join(' and ');\n go(tableView(section.child.id, `${section.child.id} ${conditions}`), 'push');\n }}\n >\n {say('seeAll')}\n </button>\n )}\n </div>\n <Grid\n table={section.child}\n data={section.data!}\n interactive={false}\n virtual={false}\n onRowClick={(childRow) => {\n const childKey = keyOf(section.child, childRow) as Record<string, unknown> | null;\n // Through openRecord: in app mode a nested row opens as a page too.\n if (childKey) void openRecord(section.child.id, childKey, String(Object.values(childKey).join('/')));\n }}\n />\n </>\n )}\n </div>\n ))}\n </td>\n </tr>\n );\n}\n","/**\n * Moving around a result without a mouse.\n *\n * Arrow keys move a cell cursor, Enter opens the row's record — which is\n * the walk, done from the keyboard. Everything else follows from those two\n * and from the grid pattern people already know from a spreadsheet.\n *\n * The position is held as `(row, column)` indices, not elements. Above a\n * few hundred rows the table is virtualised and the `<tr>` under the cursor\n * is destroyed the moment it scrolls out of the window; indices survive\n * that, the element is looked up again on every move, and when the row has\n * not been painted yet the scroller is moved and the lookup retried.\n *\n * The hook version of grid.js: the same contract, with the listeners taken\n * down when the table or its shape changes rather than stacked on the\n * element by every repaint.\n */\nimport { useEffect, useRef, type RefObject } from 'react';\nimport { viewportBox } from '../core.js';\nimport { shellById, shellQuery } from '../shellHost.js';\n\n/** Rows moved by PageUp/PageDown when the viewport cannot be measured. */\nconst PAGE_FALLBACK = 20;\n/** How many frames to wait for the virtualiser to paint a row we scrolled to. */\nconst PAINT_TRIES = 4;\n\ninterface GridKeyboardOptions {\n rowCount: number;\n columnCount: number;\n /** Leading cells before the first data column (an expander). */\n offset: number;\n onOpen?: (index: number) => void;\n /** Space: a glance at the row's record without leaving the list. */\n onPeek?: (index: number) => void;\n /** So a screen reader hears \"of 63,010\" rather than \"of 20\". */\n totalRows?: number;\n firstRow: number;\n}\n\nexport function useGridKeyboard(\n tableRef: RefObject<HTMLTableElement | null>,\n wrapRef: RefObject<HTMLElement | null>,\n opts: GridKeyboardOptions,\n): void {\n /* The cursor survives repaints: a sort that redraws the rows should not\n send the reader back to the top-left corner. */\n const cursor = useRef({ row: -1, col: 0 });\n const { rowCount, columnCount, offset, onOpen, onPeek, totalRows, firstRow } = opts;\n\n useEffect(() => {\n const table = tableRef.current;\n const wrap = wrapRef.current;\n if (!table || !wrap || !rowCount || !columnCount) return;\n const tbody = table.tBodies[0];\n if (!tbody) return;\n\n table.setAttribute('role', 'grid');\n table.setAttribute('aria-colcount', String(columnCount + offset));\n if (typeof totalRows === 'number') {\n table.setAttribute('aria-rowcount', String(totalRows));\n table.querySelector('thead tr')?.setAttribute('aria-rowindex', '1');\n for (const tr of tbody.querySelectorAll<HTMLTableRowElement>('tr[data-row]')) {\n tr.setAttribute('aria-rowindex', String(firstRow + Number(tr.dataset.row) + 2));\n }\n } else {\n table.removeAttribute('aria-rowcount');\n }\n\n const scrollerOf = () => (wrap.closest('.content') as HTMLElement | null) ?? (document.scrollingElement as HTMLElement | null);\n const rowAt = (i: number) => tbody.querySelector<HTMLTableRowElement>(`tr[data-row=\"${i}\"]`);\n const cellAt = (i: number, c: number) => (rowAt(i)?.children[c + offset] as HTMLElement | undefined) ?? null;\n\n const pageSize = () => {\n const sample = tbody.querySelector('tr[data-row]');\n const height = sample ? viewportBox(sample).height : 0;\n const view = scrollerOf()?.clientHeight;\n if (!height || !view) return PAGE_FALLBACK;\n return Math.max(1, Math.floor(view / height) - 1);\n };\n\n const focusCell = (tries = PAINT_TRIES) => {\n const { row, col } = cursor.current;\n const cell = cellAt(row, col);\n if (!cell) {\n if (tries <= 0) return;\n const sample = tbody.querySelector('tr[data-row]');\n const height = sample ? viewportBox(sample).height : 0;\n const scroller = scrollerOf();\n if (scroller && height) scroller.scrollTop = Math.max(0, row * height - scroller.clientHeight / 2);\n requestAnimationFrame(() => focusCell(tries - 1));\n return;\n }\n for (const stale of tbody.querySelectorAll<HTMLElement>('.cell-cursor')) {\n stale.classList.remove('cell-cursor');\n stale.removeAttribute('tabindex');\n }\n cell.classList.add('cell-cursor');\n cell.tabIndex = 0;\n /* The grid's tab stop moves to the cell, so tabbing in returns to\n where the cursor was left, and the table and the cell are never\n both stops. */\n table.tabIndex = -1;\n cell.focus({ preventScroll: true });\n cell.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n };\n\n const moveTo = (nextRow: number, nextCol: number) => {\n cursor.current = {\n row: Math.max(0, Math.min(rowCount - 1, nextRow)),\n col: Math.max(0, Math.min(columnCount - 1, nextCol)),\n };\n focusCell();\n };\n\n /* One stop for the whole grid, not one per cell. */\n table.tabIndex = 0;\n const onFocus = (e: FocusEvent) => {\n if (e.target !== table) return;\n const { row, col } = cursor.current;\n moveTo(row < 0 ? 0 : row, col);\n };\n // A click is also a way of saying where the cursor is.\n const onMouseDown = (e: MouseEvent) => {\n const cell = (e.target as Element).closest('td');\n const tr = cell?.closest<HTMLTableRowElement>('tr[data-row]');\n if (!cell || !tr) return;\n cursor.current = { row: Number(tr.dataset.row), col: Math.max(0, [...tr.children].indexOf(cell) - offset) };\n };\n const onKey = (e: KeyboardEvent) => {\n if ((e.target as Element).closest('input, textarea, select, [contenteditable]')) return;\n if (e.altKey) return;\n /* A control inside the grid — a header's sort, a row's expander, what a\n decoration puts in a row — answers its own Enter. The cursor's Enter\n opens a row from a cell; taken from a button it opened whichever row\n was last clicked instead of pressing the button, and a header that\n keeps its focus across a sort is exactly where a second Enter lands. */\n if ((e.key === 'Enter' || e.key === ' ') && (e.target as Element).closest('button, a')) return;\n const jump = e.metaKey || e.ctrlKey;\n const { row, col } = cursor.current;\n switch (e.key) {\n case 'ArrowDown':\n moveTo(jump ? rowCount - 1 : row + 1, col);\n break;\n case 'ArrowUp':\n moveTo(jump ? 0 : row - 1, col);\n break;\n case 'ArrowRight':\n moveTo(row, jump ? columnCount - 1 : col + 1);\n break;\n case 'ArrowLeft':\n moveTo(row, jump ? 0 : col - 1);\n break;\n case 'Home':\n moveTo(jump ? 0 : row, 0);\n break;\n case 'End':\n moveTo(jump ? rowCount - 1 : row, columnCount - 1);\n break;\n case 'PageDown':\n moveTo(row + pageSize(), col);\n break;\n case 'PageUp':\n moveTo(row - pageSize(), col);\n break;\n case 'Enter': {\n /* A cell holding more than its line — a JSON document — opens\n that, and a cell the list edits in place opens its editor; the\n row is a cell away. */\n const opener = cellAt(row, col)?.querySelector<HTMLElement>('[data-cell-opens]');\n if (opener) opener.click();\n else if (row >= 0 && onOpen) onOpen(row);\n break;\n }\n case 'F2': {\n /* A spreadsheet's edit key: a cell the list edits in place opens its\n editor (GridCellEditor.tsx), which Enter also does from the cell. */\n const editor = cellAt(row, col)?.querySelector<HTMLElement>('[data-cell-edits]');\n if (!editor) return;\n editor.click();\n break;\n }\n case ' ':\n /* A glance, as a file list's Space: the record over the list, J and\n K through its neighbors, Escape back to this cell. */\n if (row < 0 || !onPeek) return;\n onPeek(row);\n break;\n case 'Escape': {\n /* Back to the filter you would type into rather than nowhere. App\n mode hides the query bar, so there the landing is the list's own\n filter row. */\n table.blur();\n const query = shellById('query') as HTMLElement | null;\n if (query && query.offsetParent) query.focus();\n else (shellQuery('.applist-fields input, .applist-fields button') as HTMLElement | null)?.focus();\n break;\n }\n case 'c':\n if (!jump) return;\n void copyCell(cellAt(row, col));\n break;\n default:\n return;\n }\n e.preventDefault();\n };\n table.addEventListener('focus', onFocus);\n tbody.addEventListener('mousedown', onMouseDown);\n table.addEventListener('keydown', onKey);\n return () => {\n table.removeEventListener('focus', onFocus);\n tbody.removeEventListener('mousedown', onMouseDown);\n table.removeEventListener('keydown', onKey);\n };\n }, [tableRef, wrapRef, rowCount, columnCount, offset, onOpen, onPeek, totalRows, firstRow]);\n}\n\n/** Copy one cell: `title` before `textContent`, because a shortened value\n keeps the whole thing in its tooltip. */\nasync function copyCell(cell: HTMLElement | null): Promise<void> {\n if (!cell) return;\n const text = cell.getAttribute('title') ?? cell.textContent ?? '';\n try {\n await navigator.clipboard.writeText(text);\n cell.classList.add('cell-copied');\n setTimeout(() => cell.classList.remove('cell-copied'), 400);\n } catch {\n /* Clipboard access can be refused; the value is on screen. */\n }\n}\n","/**\n * Columns that stay put when a wide table scrolls sideways.\n *\n * `position: sticky` needs a `left` for each pinned column, and the offsets\n * are the widths of the columns before it — not known until the browser\n * has laid the table out. So they are measured after layout, again on\n * resize, and again when the rows are repainted under them, and handed\n * back as numbers for the cells to wear. Rounded *down*, so consecutive\n * frozen columns overlap by a fraction of a pixel rather than leaving a\n * hairline through which the scrolling content shows.\n */\nimport { useEffect, useLayoutEffect, useState, type RefObject } from 'react';\nimport { viewportBox } from '../core.js';\n\n/** Column name → sticky left, in layout pixels. */\ntype PinOffsets = Map<string, number>;\n\nexport function usePins(\n wrapRef: RefObject<HTMLElement | null>,\n drawn: string[],\n pinned: string[],\n /** Cell offset: an expander column shifts every data cell right by one. */\n shift: number,\n /** Anything whose change moves the columns — the rows painted. */\n repaintKey: unknown,\n): PinOffsets {\n const [lefts, setLefts] = useState<PinOffsets>(new Map());\n\n const measure = () => {\n const wrap = wrapRef.current;\n const head = wrap?.querySelector('thead tr') as HTMLTableRowElement | null;\n if (!wrap || !head || !pinned.length) {\n setLefts((m) => (m.size ? new Map() : m));\n return;\n }\n const indexes = pinned\n .map((name) => drawn.indexOf(name))\n .filter((i) => i >= 0)\n .sort((a, b) => a - b);\n let offset = 0;\n const next: PinOffsets = new Map();\n for (const i of indexes) {\n next.set(drawn[i], Math.floor(offset));\n const cell = head.cells[i + shift];\n offset += cell ? viewportBox(cell).width : 0;\n }\n setLefts((m) => {\n if (m.size === next.size && [...next].every(([k, v]) => m.get(k) === v)) return m;\n return next;\n });\n };\n\n useLayoutEffect(measure, [drawn.join(','), pinned.join(','), shift, repaintKey]); // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n const wrap = wrapRef.current;\n if (!wrap || !pinned.length) return;\n const size = new ResizeObserver(() => measure());\n size.observe(wrap);\n /* The seam appears only once there is something behind it. */\n const mark = () => {\n if (wrap.scrollLeft > 0) wrap.dataset.scrolled = '1';\n else delete wrap.dataset.scrolled;\n };\n wrap.addEventListener('scroll', mark, { passive: true });\n mark();\n return () => {\n size.disconnect();\n wrap.removeEventListener('scroll', mark);\n };\n }, [wrapRef, pinned.join(',')]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return lefts;\n}\n","/**\n * A table's head that stays in view while the page scrolls past its rows.\n *\n * `position: sticky` sticks to the nearest scroller, and a grid's wrap is one\n * (it scrolls sideways), so the head stuck to a box that never scrolls up and\n * went off the top with the page. Where the table fits its width the wrap has\n * nothing to scroll, so it is marked `data-fits` and stops being a scroller\n * (style.css); the head then sticks to the page's scroller, under its sticky\n * trail (`--head-top`, the trail's height). `data-stuck` says the head is\n * stuck, for its soft ground. A table wider than its wrap keeps the sideways\n * scroll and its head scrolls with the page, as before.\n *\n * Panes draw no scroll bar (docs/design.md), so a table that does overflow says so itself: `data-more` names\n * the sides with columns past them (\"start\", \"end\", \"start end\") and style.css fades those edges.\n */\nimport { useEffect, type RefObject } from 'react';\n\nexport function useStickyHead(wrapRef: RefObject<HTMLElement | null>, repaintKey: unknown): void {\n useEffect(() => {\n const wrap = wrapRef.current;\n const table = wrap?.querySelector(':scope > table');\n const scroller = wrap?.closest<HTMLElement>('.content');\n if (!wrap || !table || !scroller) return;\n const trail = [...scroller.querySelectorAll<HTMLElement>('.crumbs')].find((el) => getComputedStyle(el).position === 'sticky');\n const head = table.querySelector('thead');\n const fit = () => {\n /* The table's own width against the wrap's, which holds whichever way the wrap overflows. */\n const fits = table.scrollWidth <= wrap.clientWidth + 1;\n wrap.toggleAttribute('data-fits', fits);\n wrap.style.setProperty('--head-top', `${trail?.offsetHeight ?? 0}px`);\n more();\n stuck();\n };\n const more = () => {\n const past = wrap.scrollWidth - wrap.clientWidth - wrap.scrollLeft;\n const sides = [wrap.scrollLeft > 1 ? 'start' : '', past > 1 ? 'end' : ''].filter(Boolean).join(' ');\n if (sides) wrap.dataset.more = sides;\n else delete wrap.dataset.more;\n };\n const stuck = () => {\n if (!head || !wrap.hasAttribute('data-fits')) return wrap.removeAttribute('data-stuck');\n /* All in the window's pixels: under the density zoom an offsetHeight is the layout's, a rect the window's. */\n const top = trail ? trail.getBoundingClientRect().bottom : scroller.getBoundingClientRect().top;\n const box = table.getBoundingClientRect();\n wrap.toggleAttribute('data-stuck', box.top < top - 0.5 && box.bottom > top + head.getBoundingClientRect().height);\n };\n const size = new ResizeObserver(fit);\n size.observe(wrap);\n size.observe(table);\n if (trail) size.observe(trail);\n scroller.addEventListener('scroll', stuck, { passive: true });\n wrap.addEventListener('scroll', more, { passive: true });\n fit();\n return () => {\n size.disconnect();\n wrap.removeEventListener('scroll', more);\n delete wrap.dataset.more;\n scroller.removeEventListener('scroll', stuck);\n };\n }, [wrapRef, repaintKey]);\n}\n","/**\n * How a grid's columns share their room: each column's floor from its head and its values, the width it would like,\n * and which give way first when the room is short. An App's head may wrap to two lines, so its floor is its widest\n * line, and the wrap is taken only when the heads set on one line would run past the room.\n */\ninterface GridColumnSize {\n label: string;\n /** The label as the head sets it, measured in the head's own font, case and tracking; absent, its characters are counted. */\n headWidth?: number;\n /** An App's head may wrap to two lines, so its floor is the label's widest line when broken at the best word, not the whole label. `headWrap` is that line measured like `headWidth`; absent, its characters are counted. */\n wrapHead?: boolean;\n headWrap?: number;\n /** An App's text column whose values may wrap at their words: where the heads wrapped still run past the room, its\n floor is its widest value's two-line width rather than its whole width, so the value is kept whole on two lines\n rather than cut or scrolled to. The row's name is the first to take it (sizeHints); never a chip or a figure. */\n wrapValues?: boolean;\n kind: string;\n values: unknown[];\n /** The second line a display rule draws under each value, in the smaller type. */\n subValues?: unknown[];\n /** Values drawn as tone chips: the dot, padding and border are width too. */\n chip?: boolean;\n /** Measured in the first row: what a chip draws beyond its words (the dot, gap and padding of the look wearing it). */\n chipExtra?: number;\n controls?: boolean;\n /** What the sort draws beside the label on its line, the gap before it included: a reference's arrow. A head that\n wraps keeps it beside the label's line, so it is room on both floors. */\n mark?: number;\n showTime?: boolean;\n /** The column that names the row: it is read whole before the others are. */\n title?: boolean;\n /** Values drawn beside an initials disc: the disc and its gap are width too. */\n avatar?: boolean;\n /** The row's state (a tone chip, or a vocabulary named status or stage): kept with the name when columns are left out. */\n status?: boolean;\n /** Every value is the words the cell draws (\"4 weeks ago\", \"$22,495\"), not a raw value it formats, and nothing beside them (a bar, a ring, an App's own renderer). */\n dressed?: boolean;\n}\n\nexport const GRID_SIZE_SAMPLE = 40;\nexport const GRID_EXPANDER_WIDTH = 32;\n/** The trailing cell a row's own menu sits in. */\nexport const GRID_TRAIL_WIDTH = 44;\n\n/** A long title is read up to about this wide before it earns an ellipsis. */\nconst READABLE_TEXT = 360;\n/** The name of a row keeps about this much before any other text column\n grows past SECONDARY_TEXT: an issue's name was cut at 155px while Project\n and Cycle kept their whole words as their minimum. */\nconst TITLE_TEXT = 240;\nconst SECONDARY_TEXT = 120;\n/** An avatar's disc (24px) and the gap before its name. */\nconst AVATAR_WIDTH = 32;\n/** How wide a head's characters set: a sentence-case label in the interface\n face. A look whose heads are capitals sets wider — small capitals' and Mono's\n clipped their last head into a stray \"…\" — and says by how much through\n `--grid-head-char` (themeFamilies.css), which the grid reads where it\n measures its room. */\nexport const GRID_HEAD_CHAR = 7;\n\n/**\n * The width of a label's widest line when it is broken into two at the best word: the narrowest a head can be\n * and still read as at most two lines. One word cannot break, so it is its own width. `width` measures a piece.\n */\nexport function twoLineWidth(label: string, width: (text: string) => number): number {\n const words = label.split(/\\s+/).filter(Boolean);\n if (words.length < 2) return width(label);\n let best = width(label);\n for (let at = 1; at < words.length; at++)\n best = Math.min(best, Math.max(width(words.slice(0, at).join(' ')), width(words.slice(at).join(' '))));\n return best;\n}\n\n/** Measures a text in the grid's cell font, in pixels (Grid.tsx, a canvas). */\nexport type TextMeasure = (text: string) => number;\n\n/** Bounded hints: readable minima survive small containers. Text is measured in\n the cells' own font where the grid can (`measure`); without it, a character\n counts 8px, which ran a 14px sans 20–40% wide — five short columns held a\n third of the room while the title beside them was cut to \"Preserve filt…\". */\nexport function columnSizeHint(\n column: GridColumnSize,\n headChar = GRID_HEAD_CHAR,\n measure?: TextMeasure,\n squeezeName = false,\n): { minimum: number; wanted: number; least: number; whole?: number; twoLines?: number } {\n /* A head with controls keeps room for its sort's leading padding, its arrow and the resizer's 12px at its trailing\n edge, which the sort never reaches under (style.css); a reference's arrow beside the label is room too (`mark`).\n Its menu caret and its move buttons stand past the label's end where a pointer hovers, so they are not reserved. */\n const counted = Math.min(column.label.length, 22) * headChar;\n const around = (column.controls ? 34 : 28) + (column.mark ?? 0);\n const header = Math.ceil(column.headWidth === undefined ? counted : Math.min(column.headWidth, counted * 1.15)) + around;\n /* An App's head wraps before it widens its column: the floor is its two-line width, and the whole label stays\n what the column wants, so a table with room for it still draws every head on one line. */\n const countedWrap = twoLineWidth(column.label, (text) => Math.min(text.length, 22) * headChar);\n const headLeast = column.wrapHead\n ? Math.min(header, Math.ceil(column.headWrap === undefined ? countedWrap : Math.min(column.headWrap, countedWrap * 1.15)) + around)\n : header;\n const sample = (values: unknown[] = []) =>\n values\n .slice(0, GRID_SIZE_SAMPLE)\n .filter((value) => value != null)\n .map(String);\n const longest = (values: unknown[] = []) => sample(values).reduce<number>((max, text) => Math.max(max, text.length), 0);\n const widest = (values: unknown[] = [], scale = 1) =>\n sample(values).reduce<number>((max, text) => Math.max(max, measure!(text) * scale), 0);\n /* An \"In progress\" chip is its words plus a dot, a gap, padding and a\n border; sized as bare text it spilled over the next column's edge once\n spare room stopped arriving evenly. Counted as five more characters, or\n measured, 40px: Lumen's \"In progress\" chip draws 41px past its words (dot,\n gap, 8px and 10px of padding), and at 22 its cell cut it to \"In progress …\"\n in Thread's issues and Compass's ratings. */\n const length = longest(column.values) + (column.chip ? 5 : 0);\n const textWidth =\n (measure ? Math.ceil(widest(column.values)) + (column.chip ? (column.chipExtra ?? CHIP_EXTRA) : 0) : length * 8) +\n (column.avatar ? AVATAR_WIDTH : 0);\n /* A second line asks for room, never lowers the floor: an email under a\n name wants its width, but a narrow panel still keeps the name's minimum.\n It is set a size down (12.5px under 14px). */\n const under = (measure ? Math.ceil(widest(column.subValues, 0.9)) : longest(column.subValues) * 7) + 24;\n const fixed = (\n minimum: number,\n wanted = minimum,\n ): { minimum: number; wanted: number; least: number; whole?: number; twoLines?: number } => ({\n minimum,\n wanted,\n least: minimum,\n });\n /* A date or a number said in a display rule's own words — \"4 weeks ago\", a priority's chip — is as wide as\n those words measure. Its usual width held a relative date at 112px and a one-digit chip at 97px while the\n name and the owner beside them were cut: the room went to the columns that could not use it. A date or a\n number the cell formats itself keeps its width, since the raw value is not what is drawn. */\n const measured = measure && sample(column.values).length > 0;\n /* A yes-or-no is a mark, 64px, unless its display says it in words: an SLA's \"On track\" and \"Breached\" in tone\n chips were held to the mark's width and cut to \"On trac…\" (G187). Said in words, it is as wide as they are. */\n if (column.kind === 'boolean') {\n const width = (column.chip || column.dressed) && sample(column.values).length > 0 ? Math.min(264, textWidth + 24) : 64;\n return fixed(Math.max(headLeast, width), Math.max(header, width));\n }\n if (column.kind === 'date') {\n const width = measured && column.dressed ? Math.min(column.showTime ? 176 : 112, textWidth + 24) : column.showTime ? 176 : 112;\n return fixed(Math.max(headLeast, width), Math.max(header, width));\n }\n /* A number measured as it is drawn (\"$22,495\", \"18,340 mi\") is as wide as\n those figures: counted at 8px a character with four to spare, Forecourt's\n price, miles and days held 56px each past their figures while the car's\n name beside them was cut to \"2024 Toyota C…\". */\n if (column.kind === 'number') {\n const width =\n measured && (column.chip || column.dressed) ? Math.min(264, textWidth + 24) : Math.min(264, Math.max(88, (length + 4) * 8 + 24));\n return fixed(Math.max(headLeast, width), Math.max(header, width));\n }\n /* Past about 24 characters a text is a sentence that may be cut, not a name\n that must be whole: 24 characters of a 14px sans measure about 168px. At\n 190 a 25-character name in a heavier first column kept its whole width\n and four columns of minima ran past a half-width panel. */\n const verbose = measure ? textWidth > 168 : length > 24;\n /* Its values on two lines, each broken at its best word: the widest of them is the floor it may take. */\n const wrapped =\n column.wrapValues && !column.chip\n ? (measure\n ? Math.ceil(sample(column.values).reduce<number>((max, text) => Math.max(max, twoLineWidth(text, measure)), 0))\n : sample(column.values).reduce<number>(\n (max, text) =>\n Math.max(\n max,\n twoLineWidth(text, (part) => part.length * 8),\n ),\n 0,\n )) +\n 24 +\n (column.avatar ? AVATAR_WIDTH : 0)\n : undefined;\n /* The row's name holds up to TITLE_TEXT as its floor; every other text\n column holds at most SECONDARY_TEXT and asks for the rest as room it\n wants, so when a table is tight the secondary columns are the ones cut.\n The name never gives way below its floor: where the minima run past the\n room, the table scrolls (or an embedded one leaves columns out). Giving\n way first cut \"2024 Toyota C…\" and \"Frame Bag…\" in tables that scrolled\n sideways anyway, so nothing was gained for the cut. */\n // A tone chip is a short word that is never cut; it keeps its whole width.\n const floor = (title: boolean) => (title ? TITLE_TEXT : column.chip ? 216 : verbose ? 128 : SECONDARY_TEXT);\n const minimum = Math.max(headLeast, Math.min(floor(Boolean(column.title)), Math.max(80, Math.min(textWidth + 24, wrapped ?? Infinity))));\n /* What a secondary text column gives way to before the table scrolls: its\n head. A dealer's name cut at the head's width reads better than a table\n that scrolls 45px to show the rest of it at the edge. */\n /* In a column of its own (an aside's list, a half-width block) the name is the last to give way, not a floor under\n the table: where the kept columns still run past the room, the name is cut to an ellipsis at its head's width\n rather than the table scrolled sideways under cut-off heads. */\n const least = column.chip\n ? minimum\n : column.title\n ? squeezeName\n ? Math.max(headLeast, Math.min(minimum, SECONDARY_TEXT - 24))\n : minimum\n : Math.max(headLeast, Math.min(minimum, 80));\n return {\n minimum,\n least,\n wanted: Math.max(minimum, header, Math.min(READABLE_TEXT, Math.max(textWidth + 24, under))),\n /* What its widest value needs on one line, and on two: a column given less than the one and at least the other\n wraps its values rather than cutting them (fitGridColumns). */\n ...(wrapped !== undefined ? { whole: textWidth + 24, twoLines: wrapped } : {}),\n };\n}\n\n/**\n * The hints for a grid's columns, and whether its values wrap. A table is fitted to its room in this order, each\n * step taken only where the one before still runs past it (docs/design.md, Standing layout rules): every head and\n * value whole on one line; an App's heads on two lines at their words; the row's name on two lines, kept whole;\n * the other text values on two lines too; and only then the secondary text given way to its head, cut. A table whose heads fit whole keeps them on\n * one line, as it always did, and a value is cut only where nothing else spares the sideways scroll.\n */\nfunction sizeHints(\n columns: GridColumnSize[],\n room: number,\n headChar: number,\n measure?: (text: string, column: number) => number,\n squeezeName = false,\n): ReturnType<typeof columnSizeHint>[] {\n /* `values` says whose words may take their two-line floor: nobody's, only the row's name, or every text column's. */\n const hints = (heads: boolean, values: 'none' | 'title' | 'all') =>\n columns.map((column, index) =>\n columnSizeHint(\n {\n ...column,\n wrapHead: heads && column.wrapHead,\n wrapValues: column.wrapValues && (values === 'all' || (values === 'title' && Boolean(column.title))),\n },\n headChar,\n measure && ((text) => measure(text, index)),\n squeezeName,\n ),\n );\n const fits = (list: { minimum: number }[]) => list.reduce((sum, hint) => sum + hint.minimum, 0) <= room;\n const whole = hints(false, 'none');\n if (fits(whole) || !columns.some((column) => column.wrapHead || column.wrapValues)) return giveWay(whole, room);\n const heads = hints(true, 'none');\n if (fits(heads) || !columns.some((column) => column.wrapValues)) return giveWay(heads, room);\n /* The row's name is the most important text in the row, so it takes its second line before a short secondary value\n (a person's two-word name) is given one: the others keep their floors while the name's alone still spares the room. */\n const named = hints(true, 'title');\n if (columns.some((column) => column.title && column.wrapValues) && fits(named)) return giveWay(named, room);\n return giveWay(hints(true, 'all'), room);\n}\n\n/* Where the minima together run past the room, the secondary text columns\n give way, the last first, down to their heads; the name, the chips and the\n figures never do. Where giving way would not spare the scroll, nothing is\n cut for it: a phone's table cut a SKU to \"BAG-FRB-…\" and scrolled anyway. */\nfunction giveWay<T extends { minimum: number; least: number }>(hints: T[], room: number): T[] {\n let over = hints.reduce((sum, hint) => sum + hint.minimum, 0) - room;\n if (over <= 0 || hints.reduce((sum, hint) => sum + hint.least, 0) > room) return hints;\n const given = [...hints];\n for (let i = given.length - 1; i >= 0 && over > 0; i--) {\n const less = Math.min(over, given[i]!.minimum - given[i]!.least);\n given[i] = { ...given[i]!, minimum: given[i]!.minimum - less };\n over -= less;\n }\n return given;\n}\n\n/**\n * The columns an embedded grid keeps in its width: a dashboard's list in half\n * a row cut \"Sep 22, 202\" behind a scroll bar. Past the width, columns are\n * left out from the end, as an aside's list says names rather than a table;\n * the row's name, the first column and its status always stay — a related\n * list beside an aside cut its status first, as the last column written,\n * which was the one a reader came to it for. Null when all fit, or before\n * the room is measured.\n */\nexport function keepFitting(\n columns: GridColumnSize[],\n available: number,\n expandable = false,\n trailing = false,\n headChar = GRID_HEAD_CHAR,\n measure?: (text: string, column: number) => number,\n): boolean[] | null {\n if (!(available > 0)) return null;\n let room = available - (expandable ? GRID_EXPANDER_WIDTH : 0) - (trailing ? GRID_TRAIL_WIDTH : 0);\n const hints = sizeHints(columns, room, headChar, measure);\n if (hints.reduce((sum, hint) => sum + hint.minimum, 0) <= room) return null;\n const kept = columns.map((column, index) => index === 0 || Boolean(column.title) || Boolean(column.status));\n room -= hints.reduce((sum, hint, index) => sum + (kept[index] ? hint.minimum : 0), 0);\n // In order, until one does not fit: a narrower column after it is not a reason to leave a gap.\n let full = false;\n hints.forEach((hint, index) => {\n if (kept[index] || full) return;\n if (hint.minimum > room) {\n full = true;\n return;\n }\n kept[index] = true;\n room -= hint.minimum;\n });\n return kept;\n}\n\n/* Room past the minima goes first to the columns still cut short — an issue\n title at \"Preserve filters when op…\" beside a \"Cycle 18\" column holding\n twice its text's width — and only then, evenly, to everyone. Long text\n used to take a double share of all of it, and grew past its sentence\n while the name beside it lost its second line. Among the columns cut\n short, the one that needs least is made whole first: shared in proportion\n to what each wanted, a deal's committee gave \"Karen Olstad\" five of the\n twenty pixels her name lacked and a note the rest, so both were cut. */\n/* Short of its whole width by no more than this, a column is made whole before the name grows. */\nconst NEARLY_WHOLE = 40;\n/* What a tone chip draws beyond its words, measured (see columnSizeHint). */\nconst CHIP_EXTRA = 40;\n\nexport function fitGridColumns(\n columns: GridColumnSize[],\n available: number,\n expandable = false,\n trailing = false,\n headChar = GRID_HEAD_CHAR,\n measure?: (text: string, column: number) => number,\n squeezeName = false,\n): { width: number; columns: number[]; wraps: boolean[] } {\n const gutter = (expandable ? GRID_EXPANDER_WIDTH : 0) + (trailing ? GRID_TRAIL_WIDTH : 0);\n const hints = sizeHints(columns, Number.isFinite(available) ? Math.floor(available) - gutter : Infinity, headChar, measure, squeezeName);\n const minimum = hints.reduce((sum, hint) => sum + hint.minimum, gutter);\n const width = Math.max(minimum, Number.isFinite(available) ? Math.floor(available) : 0);\n const extra = width - minimum;\n const short = hints.reduce((sum, hint) => sum + hint.wanted - hint.minimum, 0);\n const filling = Math.min(extra, short);\n const spare = extra - filling;\n /* A column a few pixels short of whole is made whole first — an owner's\n \"Karen Olstad\" short by 20px — then the row's name, up to its readable\n width: Thread's issues cut every name at 274px while Status, Project and\n Cycle shared the room. Then each in turn, least wanting first, takes what\n it lacks or an even share of what is left, whichever is less. */\n const given = hints.map(() => 0);\n let left = filling;\n const lacking = hints\n .map((hint, index) => ({ index, lacks: hint.wanted - hint.minimum }))\n .filter(({ lacks }) => lacks > 0)\n .sort((a, b) => a.lacks - b.lacks);\n const named = columns.findIndex((column) => column.title);\n for (const { index, lacks } of lacking) {\n if (index === named || lacks > NEARLY_WHOLE || lacks > left) continue;\n given[index] = lacks;\n left -= lacks;\n }\n if (named >= 0) {\n given[named] = Math.min(left, hints[named]!.wanted - hints[named]!.minimum);\n left -= given[named]!;\n }\n const wanting = lacking.filter(({ index }) => given[index] === 0 && index !== named);\n wanting.forEach(({ index, lacks }, turn) => {\n const share = Math.min(lacks, Math.floor(left / (wanting.length - turn)));\n given[index] = share;\n left -= share;\n });\n let remaining = extra;\n const sizes = hints.map((hint, index) => {\n const share = index === hints.length - 1 ? remaining : given[index]! + Math.floor(spare / hints.length);\n remaining -= share;\n return hint.minimum + share;\n });\n /* A column given less than its widest value and enough for it on two lines wraps at its words (Grid.tsx, style.css\n `td.wraps`): the value stays whole rather than cut. One given less than that is a sentence, and is cut. */\n const wraps = columns.map((column, index) => {\n if (!column.wrapValues) return false;\n const { whole, twoLines } = columnSizeHint({ ...column, wrapHead: false }, headChar, measure && ((text) => measure(text, index)));\n return whole !== undefined && twoLines !== undefined && sizes[index]! < whole && sizes[index]! >= twoLines;\n });\n return { width, columns: sizes, wraps };\n}\n\n/**\n * How many of a cell's tag chips are drawn whole in `room`: as many as fit\n * beside the \"+N\" that counts the rest, and at least one. `widths` are the\n * chips that may be drawn (the first few of `total`); `more` measures the\n * count for so many left out.\n */\nexport function tagsThatFit(widths: number[], total: number, gap: number, room: number, more: (rest: number) => number): number {\n const needs = (count: number) =>\n widths.slice(0, count).reduce((sum, width) => sum + width, 0) + gap * (count - 1) + (count < total ? gap + more(total - count) : 0);\n let count = Math.min(widths.length, total);\n while (count > 1 && needs(count) > room) count -= 1;\n return count;\n}\n","/**\n * A grid's own arrangement: the order its reader put its columns in, and\n * the widths they dragged them to. Both live only in the grid that drew\n * them — a reader's arrangement, never the query's, so a refetch, a sort\n * or a page never moves a column the reader placed, and another reader\n * never sees it. The query's columns stay the source of truth: an order\n * that names a column no longer drawn is dropped, and a column the order\n * never named stands after the arranged ones, in the query's order.\n *\n * Widths are layout pixels, the units a column's `width` style speaks\n * (Grid.tsx divides the pointer's screen pixels by the zoom-aware ruler\n * before they arrive here). A column narrower than this does not take a\n * head: its label would be a sliver and its sort a guess.\n */\nexport const MIN_COLUMN_WIDTH = 48;\n\n/** One arrow-key step on a column's resizer, and the step with Shift held. */\nconst RESIZE_STEP = 16;\nconst RESIZE_SHIFT_STEP = 64;\n\n/** The step an arrow key moves a resizer, larger with Shift held. */\nexport function columnResizeStep(shiftKey: boolean): number {\n return shiftKey ? RESIZE_SHIFT_STEP : RESIZE_STEP;\n}\n\n/** A width a column may actually be given: whole pixels, never below its floor. */\nexport function clampColumnWidth(width: number): number {\n if (!Number.isFinite(width)) return MIN_COLUMN_WIDTH;\n return Math.max(MIN_COLUMN_WIDTH, Math.round(width));\n}\n\n/**\n * The columns as drawn, in the reader's order: the order's names first,\n * in the order's order, then every drawn column the order never named,\n * in the order they were drawn. With no order, the drawn order stands.\n */\nexport function applyColumnOrder(drawn: readonly string[], order: readonly string[] | null): string[] {\n if (!order) return [...drawn];\n const kept = order.filter((name) => drawn.includes(name));\n const placed = new Set(kept);\n return [...kept, ...drawn.filter((name) => !placed.has(name))];\n}\n\n/**\n * The order with one column stepped one place left or right, as the\n * header's move buttons and Alt+arrows ask. At either edge, or naming a\n * column the order does not hold, the order stands unchanged.\n */\nexport function moveColumn(order: readonly string[], name: string, direction: 'left' | 'right'): string[] {\n const at = order.indexOf(name);\n const to = direction === 'left' ? at - 1 : at + 1;\n if (at < 0 || to < 0 || to >= order.length) return [...order];\n const next = [...order];\n const [moved] = next.splice(at, 1);\n next.splice(to, 0, moved!);\n return next;\n}\n\n/** The fitted widths, with every width the reader dragged standing in place of its fitted one. */\nexport function applyColumnWidths(\n fitted: readonly number[],\n columns: readonly string[],\n overrides: Readonly<Record<string, number>>,\n): number[] {\n return columns.map((name, index) => {\n const override = overrides[name];\n return override === undefined ? (fitted[index] ?? 0) : clampColumnWidth(override);\n });\n}\n","/** What visualTheme says, in the shell room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../messages.js';\n\nexport const say = defineMessages({\n default: 'Default',\n workbenchDefault: 'Workbench default',\n});\n","/**\n * A theme's own font files (`type.faces`) as a page declares them: the\n * `@font-face` rules, the face its headings are drawn in, and the families a\n * stack names. Shared by the server's first paint (clientSurface.ts) and the\n * browser's look (client visualTheme.ts), so a face is declared the same way\n * before the script runs and after; the files themselves are the server's\n * (server/app/appFonts.ts).\n */\nimport type { ThemeDefinition, ThemeFaceDefinition } from '../../schema/theme.js';\n\n/** The path segment an App's fonts are served under, beside its `_components`. */\nexport const FONTS_SEGMENT = '_fonts';\n\n/** A stack's families, unquoted. */\nexport function families(stack: string): string[] {\n return stack\n .split(',')\n .map((family) => family.trim().replace(/^[\"']|[\"']$/g, ''))\n .filter(Boolean);\n}\n\n/**\n * The face a theme's headings are drawn in, preloaded on first paint: the\n * first served face of the family its heading stack leads with, at the\n * heading weight where it ships one. A theme whose headings lead with a\n * family it does not ship has none: nothing is fetched for a face the page\n * would not draw a line in.\n */\nexport function headingFace(theme: ThemeDefinition): ThemeFaceDefinition | undefined {\n const lead = families(theme.fonts?.heading ?? theme.fonts?.ui ?? '')[0]?.toLowerCase();\n if (!lead) return undefined;\n const faces = (theme.faces ?? []).filter((face) => face.family.toLowerCase() === lead && face.style === 'normal' && face.href);\n const weight = theme.type?.roles?.title?.weight ?? 700;\n return (\n faces.find((face) => {\n const [low, high = low] = face.weight.split(' ').map(Number);\n return weight >= low! && weight <= high!;\n }) ?? faces[0]\n );\n}\n\n/**\n * The `@font-face` rules for a theme's served faces, each `url()` the\n * browser's own form of its address (`shown`). `swap`, as Inter's is\n * (lumenLook.css): the text is drawn at once in the stack's next family and\n * set again when the face lands, never held invisible. The family and the\n * address are both checked to a character set that cannot close the rule\n * (themeSpec.ts, appFonts.ts), so nothing a theme says becomes a stylesheet.\n */\nexport function faceRules(theme: ThemeDefinition | undefined, shown: (href: string) => string = (href) => href): string {\n return (theme?.faces ?? [])\n .filter((face) => face.href && /^[\\w/.%-]+$/.test(face.href))\n .map(\n (face) =>\n `@font-face{font-family:\"${face.family}\";src:url(\"${shown(face.href!)}\") format(\"${face.href!.endsWith('.woff') ? 'woff' : 'woff2'}\");` +\n `font-weight:${face.weight};font-style:${face.style};font-display:swap}`,\n )\n .join('\\n');\n}\n","import type { ThemeDefinition, ThemePalette } from '@mistriwork/engine/schema/theme.js';\nimport { FONT_TOKENS, PALETTE_TOKENS, ROUND, ROUND_BOX, shapeTokens } from '@mistriwork/engine/shared/themeTokens.js';\nimport { partTokens } from '@mistriwork/engine/shared/themeParts.js';\nimport { wearIconWeight } from './iconWeight.js';\nimport { typeTokens } from '@mistriwork/engine/shared/themeType.js';\nimport {\n effectiveThemeDefinition,\n headingWeight,\n inheritThemePreset,\n lookNavRole,\n themePreset,\n THEME_PRESETS,\n} from '@mistriwork/engine/shared/themePresets.js';\nimport { lookAttribute, RECIPE_PARTS, recipeAttributes, TYPE_ATTRIBUTES } from '@mistriwork/engine/shared/themeRecipes.js';\nimport { say } from './copy/shell/visualTheme.js';\nimport { shellById, shellRoot } from './shellHost.js';\nimport { faceRules } from '@mistriwork/engine/shared/themeFaces.js';\nimport { appFile } from './addressMount.js';\n\nexport const VISUAL_THEME_KEY = 'mistri.visual-theme';\nexport const WORKBENCH_VISUAL_THEME_KEY = 'mistri.workbench-visual-theme';\nexport const VISUAL_PALETTE_KEY = 'mistri.visual-palettes';\nconst CUSTOM_THEME_KEY = 'mistri.custom-theme-choices';\nexport const VISUAL_THEME_EVENT = 'mistri:visual-theme-change';\nexport const VISUAL_THEME_REGISTRY_EVENT = 'mistri:visual-theme-registry-change';\n/** The look inside an App when neither the reader nor the App names one.\n Workbench instead defaults to its native tokens in style.css. */\nexport const DEFAULT_VISUAL_THEME = 'workshop';\nconst SANS = 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif';\n/** The reader's own pick, kept only while it names a theme this screen offers. */\nlet preferred: unknown = null;\nlet workbenchPreferred: string | undefined;\nlet customPreferences = new Map<string, string>();\nlet registered: readonly ThemeDefinition[] = [];\nlet authoredPreset: string | undefined;\nlet authoredPalette: string | undefined;\nlet appScope = '';\nlet palettePreferences = new Map<string, string>();\n/** App defaults and policy never become Workbench's explicit reader choice. */\nlet inApp = false;\nlet locked = false;\nlet isolated = false;\n\nconst swatches = (theme: ThemeDefinition) =>\n [theme.light.navGround ?? theme.light.surface, theme.light.accent, theme.light.chart2 ?? theme.light.ink] as const;\n\n/** The built-in looks, then the App's own themes. */\nexport function visualThemeOptions(): Array<{ value: string; label: string; swatches: readonly string[] }> {\n const themes = [...THEME_PRESETS, ...registered]\n .filter((theme) => !locked || theme.id === authoredPreset)\n .map((theme) => ({\n value: theme.id,\n label: theme.label,\n swatches: swatches(effectiveThemeDefinition(theme, paletteChoiceFor(theme))),\n }));\n return inApp ? themes : [{ value: 'default', label: say('workbenchDefault'), swatches: [] }, ...themes];\n}\n\nconst offered = (value: unknown): value is string =>\n typeof value === 'string' && visualThemeOptions().some((theme) => theme.value === value);\n\n/** The look in force: the reader's pick, else the App's preset, else Workshop. */\nexport function visualThemeChoice(): string {\n if (!inApp) return workbenchPreferred ?? 'default';\n if (locked && offered(authoredPreset)) return authoredPreset;\n const scoped = appScope ? customPreferences.get(appScope) : undefined;\n // A retired custom choice belongs to this App, not to the global look.\n // Keep it for a later registry reload while falling back to the App default.\n if (scoped !== undefined) {\n if (registered.some((theme) => theme.id === scoped) || (isolated && offered(scoped))) return scoped;\n } else if (!isolated && offered(preferred) && (!appScope || themePreset(preferred))) return preferred;\n if (offered(authoredPreset)) return authoredPreset;\n return DEFAULT_VISUAL_THEME;\n}\n\nfunction selectedThemeBase(): ThemeDefinition {\n const id = visualThemeChoice();\n const custom = registered.find((theme) => theme.id === id);\n return custom ? inheritThemePreset(custom) : (themePreset(id) ?? themePreset(DEFAULT_VISUAL_THEME)!);\n}\n\n// A different tuple shape keeps Workbench separate even from an App named \"workbench\".\nconst paletteScope = (theme = visualThemeChoice()) => JSON.stringify(inApp ? [appScope, theme] : ['workbench', null, theme]);\n\n/** The theme the App itself wears, where this screen is an App's and the reader may pick another: what the picker marks and what a reset returns to. */\nexport function appVisualTheme(): string | undefined {\n return inApp && !locked && offered(authoredPreset) ? authoredPreset : undefined;\n}\n\n/** Whether the reader's own pick (a theme, or a palette of the App's theme) is what is worn instead of the App's. */\nexport function readerOverridesAppTheme(): boolean {\n const own = appVisualTheme();\n return own !== undefined && (visualThemeChoice() !== own || palettePreferences.has(paletteScope(own)));\n}\n\n/** Back to the App's own theme and palette: the reader's picks for this App are forgotten, not replaced by new ones. */\nexport function resetVisualTheme() {\n const own = appVisualTheme();\n if (own === undefined) return;\n setVisualTheme(own);\n if (palettePreferences.delete(paletteScope(own))) {\n try {\n window.localStorage.setItem(VISUAL_PALETTE_KEY, JSON.stringify([...palettePreferences]));\n } catch {\n /* Tab-local choice still applies. */\n }\n apply();\n window.dispatchEvent(new Event(VISUAL_THEME_EVENT));\n }\n}\n\n/** A built-in look's own colors are one of its palettes (its `defaultPalette`, lookPalettes.ts), so it offers no\n \"Default\" beside them: the same palette twice under two names. A theme of the App's own keeps its Default. */\nconst ownColorsArePalette = (theme: ThemeDefinition) =>\n themePreset(theme.id) === theme && Boolean(theme.palettes?.some((palette) => palette.id === theme.defaultPalette));\n\n/** Palette choices belong to their theme, not to an unrelated App using the same slug. */\nexport function visualPaletteOptions(): Array<{ value: string; label: string; swatches: readonly string[] }> {\n if (!inApp && !workbenchPreferred) return [];\n const theme = selectedThemeBase();\n return [\n ...(ownColorsArePalette(theme) ? [] : [{ value: 'default', label: say('default'), swatches: swatches(theme) }]),\n ...(theme.palettes ?? []).map((palette) => ({\n value: palette.id,\n label: palette.label,\n swatches: swatches(effectiveThemeDefinition(theme, palette.id)),\n })),\n ];\n}\n\nfunction paletteChoiceFor(theme: ThemeDefinition): string {\n /* A built-in's \"default\" is its own palette by name, so a pick or an App's `palette: 'default'` marks that one. */\n const named = (value: string | undefined) => (value === 'default' && ownColorsArePalette(theme) ? theme.defaultPalette : value);\n const offered = (value: string | undefined): value is string =>\n value === 'default' || Boolean(theme.palettes?.some((palette) => palette.id === value));\n const preferred = named(palettePreferences.get(paletteScope(theme.id)));\n if (!locked && offered(preferred)) return preferred;\n const authored = named(authoredPalette);\n if (theme.id === authoredPreset && offered(authored)) return authored;\n const fallback = theme.defaultPalette;\n return offered(fallback) ? fallback : 'default';\n}\n\nexport function visualPaletteChoice(): string {\n if (!inApp && !workbenchPreferred) return 'default';\n return paletteChoiceFor(selectedThemeBase());\n}\n\nfunction selectedThemeDefinition(): ThemeDefinition {\n return effectiveThemeDefinition(selectedThemeBase(), visualPaletteChoice());\n}\n\nexport function setVisualPalette(value: string) {\n if (locked || !visualPaletteOptions().some((palette) => palette.value === value)) return;\n palettePreferences.set(paletteScope(), value);\n // Bound retained preferences while keeping the current tab independent of storage availability.\n if (palettePreferences.size > 200) palettePreferences.delete(palettePreferences.keys().next().value!);\n try {\n window.localStorage.setItem(VISUAL_PALETTE_KEY, JSON.stringify([...palettePreferences]));\n } catch {\n /* Tab-local choice still applies. */\n }\n apply();\n window.dispatchEvent(new Event(VISUAL_THEME_EVENT));\n}\n\n/** Called by the app-theme owner after load, reload, workspace changes and every\n flip between an App and its Workbench; `app` says which this screen is. */\nexport function configureVisualThemes(\n themes: readonly ThemeDefinition[] = [],\n preset?: string,\n app = false,\n palette?: string,\n scope = '',\n policy: { locked?: boolean; isolated?: boolean } = {},\n) {\n if (!app) {\n themes = [];\n preset = undefined;\n palette = undefined;\n scope = '';\n policy = {};\n }\n const changed =\n registered.length !== themes.length ||\n registered.some((theme, index) => theme !== themes[index]) ||\n authoredPreset !== preset ||\n inApp !== app ||\n authoredPalette !== palette ||\n appScope !== scope ||\n locked !== Boolean(policy.locked) ||\n isolated !== Boolean(policy.isolated);\n registered = themes;\n authoredPreset = preset;\n authoredPalette = palette;\n appScope = scope;\n inApp = app;\n locked = Boolean(policy.locked);\n isolated = Boolean(policy.isolated);\n apply();\n if (changed) window.dispatchEvent(new Event(VISUAL_THEME_REGISTRY_EVENT));\n}\n\n/** Workbench always offers its own looks; an App may lock its authored branding. */\nexport function visualThemesOffered(): boolean {\n return !locked;\n}\n\n/** A theme this screen offers, or the default look. */\nexport function validVisualTheme(value: unknown): string {\n return offered(value) ? value : inApp ? DEFAULT_VISUAL_THEME : 'default';\n}\n\n/* The look sheets fetched when a worn theme picks one of their recipes rather\n than carried in every first paint (brandLook.css says why). Mono's and the\n defaults' rules are in the first stylesheet (themeFamilies.css); which sheet\n answers which recipe is the menu's (themeRecipes.ts RECIPE_MENU). */\n/* A stylesheet is a module to Vite, which splits it into a file of its own; its type is packages/mistri/schema/css.d.ts's. */\nconst LOOK_SHEETS: Readonly<Record<string, () => Promise<unknown>>> = {\n workshop: () => import('./workshopLook.css'),\n lumen: () => import('./lumenLook.css'),\n sage: () => import('./sageLook.css'),\n ledger: () => import('./ledgerLook.css'),\n brand: () => import('./brandLook.css'),\n /* What a theme says beyond the menu: its parts' own styles and its patterns (themeParts.ts). */\n parts: () => import('./partsLook.css'),\n surfaces: () => import('./surfacesLook.css'),\n};\nconst lookSheets = new Map<string, Promise<void>>();\nlet lookSheet: Promise<void> = Promise.resolve();\n\n/** Settles once the worn look's own sheets have arrived (or could not), so boot\n reveals the page in its look rather than a moment before it. */\nexport function lookSheetReady(): Promise<void> {\n return lookSheet;\n}\n\nfunction sheet(style: string): Promise<void> | undefined {\n const load = LOOK_SHEETS[style];\n if (!load) return undefined;\n let arriving = lookSheets.get(style);\n if (!arriving) {\n /* A sheet that cannot come leaves the look's tokens on the page, which read; it is not worth a failed boot. */\n arriving = load().then(\n () => undefined,\n (error: unknown) => {\n console.error(`The ${style} look's sheet did not load.`, error);\n },\n );\n lookSheets.set(style, arriving);\n }\n return arriving;\n}\n\n/* A theme's own stylesheet, as the server read and scoped it (appBrand.ts): only an address of that shape is linked,\n so nothing a payload carries can link another site's sheet. Every rule in it is scoped to its theme's root\n attribute, so a sheet left linked after another theme is worn draws nothing. */\nconst THEME_SHEET = /^\\/[^/?#]+\\/_brand\\/[a-z0-9][a-z0-9-]*\\.css$/;\nconst themeSheets = new Map<string, Promise<void>>();\nfunction themeSheet(href: string | undefined): Promise<void> | undefined {\n if (!href || !THEME_SHEET.test(href)) return undefined;\n let arriving = themeSheets.get(href);\n if (!arriving) {\n const link = document.createElement('link');\n link.rel = 'stylesheet';\n /* An inside address, as the faces are: `/acme/_brand/…` is `/_brand/…` with the App at the root, and the\n Provider's endpoint's in an embed, never the host's address (addressMount appFile). */\n link.href = appFile(href);\n link.dataset.themeSheet = '';\n arriving = new Promise<void>((settle) => {\n link.addEventListener('load', () => settle(), { once: true });\n /* A sheet that cannot come leaves the theme its look and parts, which read; it is not worth a failed boot. */\n link.addEventListener(\n 'error',\n () => {\n console.error(`The theme's stylesheet ${href} did not load.`);\n settle();\n },\n { once: true },\n );\n });\n document.head.append(link);\n themeSheets.set(href, arriving);\n }\n return arriving;\n}\n\nfunction wearSheets(styles: readonly string[], ...also: (Promise<void> | undefined)[]) {\n const arriving = [...styles.map(sheet), ...also].filter((value): value is Promise<void> => value !== undefined);\n lookSheet = arriving.length ? Promise.all(arriving).then(() => undefined) : Promise.resolve();\n}\n\n/** The attributes a worn theme sets only when it says something there, so one the last theme set goes. */\nconst OPTIONAL_ATTRIBUTES = [\n ...TYPE_ATTRIBUTES,\n 'data-bar-ground',\n 'data-parts',\n 'data-surface-ground',\n 'data-surface-nav',\n 'data-icons',\n] as const;\n\n/** Every attribute a worn look sets on the root: its name, palette and each recipe. */\nconst LOOK_ATTRIBUTES = [\n 'data-custom-theme',\n 'data-visual-theme',\n 'data-theme-style',\n 'data-theme-palette',\n ...RECIPE_PARTS.map(lookAttribute),\n 'data-look-elevation',\n 'data-look-motion',\n 'data-look-rhythm',\n 'data-look-card',\n 'data-look-float',\n ...OPTIONAL_ATTRIBUTES,\n] as const;\n\nfunction apply() {\n const root = shellRoot();\n /* Native Workbench has no look attributes. Explicit picks use the same\n definitions, token owner and sheets as the App looks. */\n if (!inApp && !workbenchPreferred) {\n for (const name of LOOK_ATTRIBUTES) root.removeAttribute(name);\n void wearIconWeight(undefined);\n facesStyle?.remove();\n facesStyle = undefined;\n return;\n }\n const definition = selectedThemeDefinition();\n root.setAttribute('data-custom-theme', '');\n root.dataset.visualTheme = definition.id;\n root.dataset.themeStyle = definition.base ?? '';\n root.dataset.themePalette = visualPaletteChoice();\n const { attributes, sheets } = recipeAttributes(definition, lookNavRole(definition));\n /* A role the worn theme leaves to the look has no attribute, so one the last theme set goes. */\n for (const name of OPTIONAL_ATTRIBUTES) if (!(name in attributes)) root.removeAttribute(name);\n for (const [name, value] of Object.entries(attributes)) root.setAttribute(name, value);\n wearSheets(sheets, wearIconWeight(definition.icons), themeSheet(definition.stylesheet?.href));\n wearFaces(definition);\n}\n\n/**\n * The worn theme's own font files (`type.faces`) as `@font-face` rules, in the\n * one style element the server's first paint writes them in\n * (clientSurface.ts appFaceHead) — replaced, not added to, when the reader\n * picks another theme or the App's theme is edited and reloads. A rule costs\n * nothing until a line is drawn in its family.\n */\nfunction wearFaces(definition: ThemeDefinition) {\n /* Each face where its App serves it: the endpoint's in an embed, where `shown` would be the host's address. */\n const rules = faceRules(definition, appFile);\n /* A theme without faces leaves the first paint's rules where they are: a rule for a family no stack names is never\n fetched, and the page then needs no DOM at all for a theme that ships no fonts. */\n if (!rules) {\n facesStyle?.remove();\n facesStyle = undefined;\n return;\n }\n facesStyle ??= (shellById('mistri-theme-faces') as HTMLStyleElement | null) ?? undefined;\n if (!facesStyle) {\n facesStyle = document.createElement('style');\n facesStyle.id = 'mistri-theme-faces';\n document.head.append(facesStyle);\n }\n if (facesStyle.textContent !== rules) facesStyle.textContent = rules;\n}\nlet facesStyle: HTMLStyleElement | undefined;\n\nexport function initVisualTheme() {\n try {\n preferred = window.localStorage.getItem(VISUAL_THEME_KEY);\n } catch {\n preferred = null; /* The default needs no storage. */\n }\n try {\n const value = window.localStorage.getItem(WORKBENCH_VISUAL_THEME_KEY);\n workbenchPreferred = value && themePreset(value) ? value : undefined;\n } catch {\n workbenchPreferred = undefined; /* Native Workbench needs no storage. */\n }\n customPreferences = new Map();\n try {\n const entries: unknown = JSON.parse(window.localStorage.getItem(CUSTOM_THEME_KEY) ?? '[]');\n if (Array.isArray(entries))\n for (const entry of entries.slice(-200)) {\n if (\n Array.isArray(entry) &&\n entry.length === 2 &&\n typeof entry[0] === 'string' &&\n entry[0].length > 0 &&\n entry[0].length <= 256 &&\n typeof entry[1] === 'string' &&\n /^[a-z][a-z0-9-]{0,47}$/.test(entry[1]) &&\n (!themePreset(entry[1]) || entry[0].startsWith('[\"branding\",'))\n )\n customPreferences.set(entry[0], entry[1]);\n }\n } catch {\n /* Missing or malformed custom choices do not prevent boot. */\n }\n palettePreferences = new Map();\n try {\n const entries: unknown = JSON.parse(window.localStorage.getItem(VISUAL_PALETTE_KEY) ?? '[]');\n if (Array.isArray(entries))\n for (const entry of entries.slice(-200)) {\n if (\n Array.isArray(entry) &&\n entry.length === 2 &&\n typeof entry[0] === 'string' &&\n entry[0].length <= 256 &&\n typeof entry[1] === 'string' &&\n /^[a-z][a-z0-9-]{0,47}$/.test(entry[1])\n )\n palettePreferences.set(entry[0], entry[1]);\n }\n } catch {\n /* Invalid or unavailable storage cannot prevent boot. */\n }\n apply();\n}\n\n/** The reader's pick. Choosing what the App or the default would have given anyway keeps no preference. */\nexport function setVisualTheme(value: string) {\n if (locked || !offered(value)) return;\n if (!inApp) {\n workbenchPreferred = value === 'default' ? undefined : value;\n try {\n if (workbenchPreferred) window.localStorage.setItem(WORKBENCH_VISUAL_THEME_KEY, workbenchPreferred);\n else window.localStorage.removeItem(WORKBENCH_VISUAL_THEME_KEY);\n } catch {\n /* A Workbench choice is still usable in this tab. */\n }\n apply();\n window.dispatchEvent(new Event(VISUAL_THEME_EVENT));\n return;\n }\n if (appScope) {\n const fallback = offered(authoredPreset) ? authoredPreset : DEFAULT_VISUAL_THEME;\n const custom = registered.some((theme) => theme.id === value);\n if ((custom || isolated) && value !== fallback) {\n customPreferences.set(appScope, value);\n if (customPreferences.size > 200) customPreferences.delete(customPreferences.keys().next().value!);\n } else {\n customPreferences.delete(appScope);\n if (!isolated) preferred = value === fallback ? null : value;\n try {\n if (!isolated && preferred === null) window.localStorage.removeItem(VISUAL_THEME_KEY);\n else if (!isolated) window.localStorage.setItem(VISUAL_THEME_KEY, preferred as string);\n } catch {\n /* The global choice remains usable in this tab. */\n }\n }\n try {\n window.localStorage.setItem(CUSTOM_THEME_KEY, JSON.stringify([...customPreferences]));\n } catch {\n /* Keep the scoped choice in this tab. */\n }\n apply();\n window.dispatchEvent(new Event(VISUAL_THEME_EVENT));\n return;\n }\n const before = preferred;\n preferred = null;\n const fallback = visualThemeChoice();\n preferred = offered(value) && value !== fallback ? value : null;\n if (!offered(value)) preferred = before;\n apply();\n try {\n if (preferred === null) window.localStorage.removeItem(VISUAL_THEME_KEY);\n else window.localStorage.setItem(VISUAL_THEME_KEY, preferred as string);\n } catch {\n /* Keep the current tab usable when preferences cannot be saved. */\n }\n window.dispatchEvent(new Event(VISUAL_THEME_EVENT));\n}\n\n/** The look's own radius and data face; an App's authored values win over them in appnav. */\nexport function visualThemeOverrides(): { radius?: string; font: string; square: boolean; density?: string } {\n if (!inApp && !workbenchPreferred) return { font: 'var(--code)', square: false };\n const definition = selectedThemeDefinition();\n return {\n ...(definition.density ? { density: definition.density } : {}),\n /* Round controls are a pill only where a control is drawn (--control-radius): every other box keeps a box's corner. */\n ...(definition.radius?.control ? { radius: definition.radius.control === ROUND ? ROUND_BOX : definition.radius.control } : {}),\n font: definition.fonts?.data ?? SANS,\n square: definition.radius?.control === '0px',\n };\n}\n\n/** The worn theme's `scheme`: dark until the reader picks a mode, or dark only (theme.js). */\nexport function visualThemeScheme(): ThemeDefinition['scheme'] {\n return selectedThemeDefinition().scheme;\n}\n\nexport function visualThemePalette(dark: boolean): ThemePalette {\n return selectedThemeDefinition()[dark ? 'dark' : 'light'];\n}\n\n/** The worn theme's part styles as custom properties, written where the App's accent is (appTheme.js) so a part in\n `accent` is the App's own accent; none outside an App or for a theme without parts. */\nexport function customThemePartTokens(): Record<string, string> {\n if (!inApp && !workbenchPreferred) return {};\n return partTokens(selectedThemeDefinition().parts);\n}\n\n/** Values only; appnav remains the sole writer of inline theme tokens. */\nexport function customThemeTokens(dark: boolean): Record<string, string> {\n if (!inApp && !workbenchPreferred) return {};\n const definition = selectedThemeDefinition();\n const tokens: Record<string, string> = {};\n for (const [key, value] of Object.entries(definition[dark ? 'dark' : 'light'])) {\n tokens[PALETTE_TOKENS[key as keyof ThemePalette]] = value;\n }\n for (const [key, value] of Object.entries(definition.fonts ?? {})) {\n if (key !== 'data') tokens[FONT_TOKENS[key as keyof typeof FONT_TOKENS]] = value;\n }\n /* The corners and widths but the control's own, which appnav writes as --radius (visualThemeOverrides). */\n const { '--radius': _control, ...shape } = shapeTokens(definition);\n Object.assign(tokens, shape, typeTokens(definition.type));\n tokens['--heading-weight'] = String(headingWeight(definition));\n return tokens;\n}\n","/** What JsonPreview says, in the record page room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n openName: 'Open {name}',\n});\n","/**\n * A JSON document in a grid cell: one line that says its shape, and the\n * whole document laid out in an overlay, on a click or on Enter.\n *\n * The line is a button, so a click on it opens the document rather than\n * the row. It is out of the tab order because the grid is one tab stop:\n * the cell cursor's Enter presses it instead (`data-cell-opens`, read by\n * useGridKeyboard), and the row is a cell away.\n */\nimport { useRef, useState } from 'react';\nimport { Modal, type ModalHandle } from '@mistriwork/ui/Modal.js';\nimport { JsonValue as JsonView } from './JsonValue.js';\nimport { useArrived } from './onDemand.js';\nimport { previewOf } from './jsonModel.js';\nimport { say } from '../copy/record/components/JsonPreview.js';\n\nexport function JsonPreview({ value, name, type }: { value: object; name: string; type?: string }) {\n const [open, setOpen] = useState(false);\n const here = useArrived(JsonView, open);\n const modal = useRef<ModalHandle>(null);\n return (\n <>\n <button\n type=\"button\"\n className=\"json-preview\"\n data-cell-opens=\"\"\n tabIndex={-1}\n aria-haspopup=\"dialog\"\n title={say('openName', { name })}\n onClick={(e) => {\n e.stopPropagation();\n setOpen(true);\n }}\n >\n {previewOf(value)}\n </button>\n {open && here && (\n <Modal ref={modal} className=\"confirm json-overlay\" ariaLabel={`${name} (JSON)`} onClose={() => setOpen(false)}>\n <header className=\"json-overlay-head\">\n <h2>{name}</h2>\n {type && <span className=\"json-overlay-type\">{type.toLowerCase()}</span>}\n <button type=\"button\" className=\"ghost json-overlay-close\" onClick={() => modal.current?.close()}>\n {say('common.close')}\n </button>\n </header>\n <JsonView value={value} />\n </Modal>\n )}\n </>\n );\n}\n","/** What Grid says, in the lists and grid room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n moreTags: '+{count}',\n moreCharactersOpenTheRow: {\n one: '{count} more character — open the row to read it',\n other: '{count} more characters — open the row to read it',\n },\n summing: 'Summing',\n total: 'Total',\n noRowsMatch: 'No rows match.',\n thisTableIsEmpty: 'This table is empty.',\n sortingAResultLike: '{name} — sorting a result like this one means editing the statement that produced it',\n notSortableHere: '{name} — this list cannot be sorted from its header.',\n sortBy: 'Sort by {name}',\n theApiDocumentsNoSort: '{name} — the API documents no sort by it.',\n isNotIndexedSorting: '{name} is not indexed — sorting it would scan the whole table. Type \"sort {name}\" in the query bar if you mean it.',\n isNotIndexedSortingInApp: '{name} is not indexed — sorting it would scan the whole table.',\n filterOn: 'Filter on {name}',\n expandEveryRow: 'Expand every row',\n collapseEveryRow: 'Collapse every row',\n moveColumnLeft: 'Move {name} left',\n moveColumnRight: 'Move {name} right',\n resizeColumn: 'Resize {name} column',\n resizeColumnHint: 'Drag or use arrow keys to resize {name}; double-click or Alt+Backspace to restore its fitted width',\n actions: 'Actions',\n rowsDrawnAsYouScroll: { one: '{count} row, drawn as you scroll.', other: '{count} rows, drawn as you scroll.' },\n defaultOrderRowsHaveToCome: 'default order — rows have to come back in some order, and this is the one tablewalk chose',\n});\n","/**\n * A list whose rows open another record (a view's `opens`): a join table's list, `ticket_watcher`,\n * opens the ticket each row is about rather than the watcher row, a page with nothing to do on it. Given by the App's\n * list (AppList.tsx) to the two places a grid's row is opened from — the grid and, on a phone, its summaries — so no\n * prop has to be threaded through the rooms between them.\n */\nimport { createContext, useContext } from 'react';\nimport type { TableMeta } from '@mistriwork/engine/shared/schema.js';\n\ninterface RowOpens {\n /** The reference column whose record a row opens. */\n column: string;\n /** The fetched path its record's name is read from, when the list shows it by name. */\n label?: string;\n}\n\nexport const RowOpensContext = createContext<RowOpens | null>(null);\n\nexport const useRowOpens = () => useContext(RowOpensContext);\n\n/**\n * The record a row opens under `opens`: the referenced table, keyed by the row's value. `null` when the row names\n * none — an empty reference opens nothing, rather than the row it was asked not to open.\n */\nexport function rowOpensTarget(\n table: TableMeta,\n row: Record<string, unknown>,\n opens: RowOpens,\n): { table: string; key: Record<string, unknown>; label: string } | null {\n const ref = table.columns.find((column) => column.name === opens.column)?.references;\n const value = row[opens.column];\n if (!ref || value === null || value === undefined || value === '') return null;\n const named = opens.label ? row[opens.label] : undefined;\n return {\n table: ref.table,\n key: { [ref.column]: value },\n label: named == null || named === '' ? String(value) : String(named),\n };\n}\n","/**\n * A result grid, for anything that has rows and columns.\n *\n * One grid for the explorer's table view, an app's list, a record's related\n * rows, a dashboard's list card and an expanded row's children — two\n * renderers would drift, and a work order's parts showing `1`/`0` where\n * the table above shows ✓/✗ is the kind of small inconsistency that makes a\n * tool feel assembled rather than built.\n *\n * Sorting and filtering here work by rewriting the query text — that is\n * the design, and it is why a filter built by clicking can be edited by\n * typing, saved, shared as a link and read back later. So the grid holds\n * no sort state of its own: the walk's query is read for what is sorted,\n * and the header's clicks write to it.\n *\n * TanStack Table holds the column and row model; TanStack Virtual does the\n * window arithmetic for a long result, rendered as a real table with two\n * spacer rows, so column widths, sticky headers, text selection and\n * Find-in-page all keep working. Below a few hundred rows windowing costs\n * more than it saves and every row is drawn.\n *\n * The reader arranges the columns they see (gridArrange.ts): each head\n * carries move buttons and a resizer, one step or one drag at a time,\n * and the arrangement lives only in this grid — a refetch never moves a\n * column the reader placed, and another reader never sees it.\n */\nimport { useMessageLanguage } from './useMessageLanguage.js';\nimport {\n cloneElement,\n isValidElement,\n memo,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type ReactNode,\n} from 'react';\nimport { createColumnHelper, tableFeatures, useTable } from '@tanstack/react-table';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport {\n columnDisplay,\n columnLabel,\n currentEntry,\n emptyWord,\n keyOf,\n openRecord,\n peekRecord,\n prefersPages,\n primaryKey,\n rowLabel,\n state,\n viewportBox,\n viewportScale,\n} from '../core.js';\nimport { opensRecord } from '../recordIntent.js';\nimport { labelColumn as namingColumn } from '@mistriwork/engine/shared/schema.js';\nimport { datesAmong, dressFor, leadTonePath, maskedText, ruleSays, subtitlePath, type DisplayRule } from './valueModel.js';\nimport { currencyPath } from '@mistriwork/engine/shared/money.js';\nimport { dueOpen } from './dueOpen.js';\nimport { LeadMark } from './Dressed.js';\nimport { formatDate, formatDateTime, formatNumber, sayNearDay } from '../locale.js';\nimport { AvatarText, Dressed } from './Value.js';\nimport { ValueSlot } from './valueRenderers.js';\nimport { sortDirection } from '../clauses.js';\nimport { planColumn, sortableFromHeader } from '../columns.js';\nimport { pinnedFor, pinsVersion, subscribePins } from '../pins.js';\nimport { hasChildren } from '../nested.js';\nimport { openFilterMenu, sortBy } from '../thmenu.js';\nimport { AppColumnMenuButton, useAppColumnMenu } from './AppColumnMenu.js';\nimport type { ColumnMeta, TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport { DetailRow, Expander } from './Nested.js';\nimport {\n createRowHosts,\n RowDecoration,\n RowHostScope,\n RowTrailScope,\n rowKeyString,\n useRowHostScope,\n useRowTrailScope,\n type RowHostStore,\n} from './RowHost.js';\nimport type { TrailList } from '../recordTrail.js';\nimport { useGridKeyboard } from './useGridKeyboard.js';\nimport { useChangedRows } from '../liveState.js';\nimport { textMeasure } from './textMeasure.js';\nimport { presentationColumns } from './columnPresentation.js';\nimport { usePins } from './usePins.js';\nimport { useStickyHead } from './useStickyHead.js';\nimport type { TableSizing } from '@mistriwork/engine/shared/tableSizing.js';\nimport {\n fitGridColumns,\n keepFitting,\n tagsThatFit,\n twoLineWidth,\n GRID_EXPANDER_WIDTH,\n GRID_HEAD_CHAR,\n GRID_SIZE_SAMPLE,\n GRID_TRAIL_WIDTH,\n} from './gridSizing.js';\nimport { applyColumnOrder, applyColumnWidths, clampColumnWidth, columnResizeStep, MIN_COLUMN_WIDTH, moveColumn } from './gridArrange.js';\nimport { VISUAL_THEME_EVENT } from '../visualTheme.js';\nimport { JsonPreview } from './JsonPreview.js';\nimport { AvatarPhotoContext, AvatarPhotos, avatarOwner } from './avatarPhotos.js';\nimport { jsonValueOf, previewOf } from './jsonModel.js';\nimport { vocabularyWord } from '@mistriwork/engine/shared/model.js';\nimport { shell } from '../shellMode.js';\nimport type { CellDraw } from './gridCellModel.js';\nimport { parseLabelTemplate } from '@mistriwork/engine/shared/recordLabel.js';\nimport { say } from '../copy/lists/components/Grid.js';\nimport { TAGS_TYPE, tagChips } from '@mistriwork/engine/shared/tagLists.js';\nimport { addHostListener, removeHostListener, shellBody } from '../shellHost.js';\nimport { rowOpensTarget, useRowOpens } from './rowOpens.js';\n\n/* A column narrower than this does not take a folded detail line: it would wrap inside it. */\nconst FOLD_ROOM = 150;\n\n/* How many of a record's tags a list's cell draws before it says how many more. */\nconst TAGS_SHOWN = 3;\n/* The mark a reference's head draws after its label, and its sizing counts. */\nconst REFERENCE_MARK = '→';\n\nexport type Row = Record<string, unknown>;\n\nexport interface GridData {\n table?: string;\n columns?: string[];\n rows: Row[];\n total?: number;\n exactTotal?: boolean;\n /** The total stopped at its bound: at least `total` rows, not exactly. */\n cappedTotal?: boolean;\n /** The page this is, as the run answered it; a record opened from it steps through the list with them (recordTrail.ts). */\n limit?: number;\n offset?: number;\n ms?: number;\n order?: {\n implicit?: boolean;\n order: Array<{ column: string; direction: 'asc' | 'desc' }>;\n };\n /** The first and last rows' order values, where the list pages by key (pageStep.ts). */\n bounds?: {\n first: Record<string, string | number | boolean | null>;\n last: Record<string, string | number | boolean | null>;\n };\n errors?: unknown[];\n}\n\ninterface GridProps {\n sizing?: TableSizing;\n table?: TableMeta;\n data: GridData;\n /** Ride-along columns — the keys a list fetches so rows can open — dropped from the drawing only. */\n hide?: string[];\n /** A caller's own words over columns; the label seam answers otherwise. */\n labels?: Record<string, string>;\n /** Column → its total over the whole query, drawn in a footer row; undefined while it is asked. */\n totals?: Record<string, unknown>;\n /** The footer's caption: \"Total\", or what it is a total of when the grid shows fewer rows than it sums. */\n totalsLabel?: string;\n /** Row height: 'compact' tightens the rows of a list read as a ledger. */\n density?: 'comfortable' | 'compact';\n /** Visible raw-key column -> hidden joined label column. Keys remain untouched. */\n referenceLabels?: Record<string, string>;\n /** Whether this grid may navigate the walk: header sort, filter menus, expanders. */\n interactive?: boolean;\n /** Whether a long result is windowed. */\n virtual?: boolean;\n onRowClick?: (row: Row) => void;\n /** The list this grid's rows are a page of, when it is a room's own list: a record opened from it steps past the page (recordTrail.ts). An embedded grid hands its rows only. */\n list?: TrailList;\n /** The record the reader is on beside this list — a split's detail — marked and kept in view as it steps. */\n current?: Record<string, unknown>;\n emptyText?: string;\n compact?: boolean;\n /** The result's first row number in the whole, for the keyboard's aria. */\n firstRow?: number;\n /** An embedded grid keeps to its width: columns past it are left out rather than scrolled to. */\n dropColumns?: boolean;\n /** A cell's editor in place of its value, where the list edits it (GridCellEditor.tsx); undefined leaves the cell as drawn. */\n /** `label` is the reference's name the cell already draws, so an editor opens on it rather than on the key. */\n editCell?: (row: Row, column: string, draw: CellDraw, label?: unknown) => ReactNode | undefined;\n /** What the host draws in an empty cell in place of its empty mark (a suggestion waiting on it); undefined leaves the mark. One line: no row grows. */\n adornCell?: (row: Row, column: string) => ReactNode | undefined;\n}\n\n/** Beyond a few hundred rows the DOM, not the database, is the bottleneck. */\nconst VIRTUAL_THRESHOLD = 300;\nconst OVERSCAN = 12;\n/** The most a single grid cell will put in the DOM. Well past what 30rem shows. */\nconst CELL_MAX = 300;\n/** Rows started per batch when every row is expanded at once, and the pause between. */\nconst BATCH = 4;\nconst BREATH_MS = 60;\n\ninterface Plan {\n align: string;\n kind: string;\n mono: boolean;\n /** A text column of keys, references or codes: the data face stays for it in an App, where other short text is read. */\n idLike?: boolean;\n decimals?: number;\n group?: boolean;\n showTime?: boolean;\n}\n\nconst features = tableFeatures({});\nconst helper = createColumnHelper<typeof features, Row>();\nconst NO_ROWS: Row[] = [];\n\ntype RowHostRef = ReturnType<RowHostStore['ref']>;\n\nfunction clampCell(raw: string): { text: string; title?: string } {\n /* Not clamped, the cell has nothing to add on hover unless its column clips\n it, which onMouseOver decides from the cell's own overflow: a title on\n every value past 40 characters repeated a name the reader could read, in a\n native tooltip drawn over whatever sat under it. */\n if (raw.length <= CELL_MAX) return { text: raw };\n const more = raw.length - CELL_MAX;\n return {\n text: `${raw.slice(0, CELL_MAX)}…`,\n title: say('moreCharactersOpenTheRow', { count: more }),\n };\n}\n\n/**\n * One cell, rendered by what it holds. A reference is marked on the way\n * out: a foreign key can be a number, a string or a code, so the branch\n * that draws it is decided by its type while whether it points somewhere\n * is decided by the schema.\n */\n/** A total, dressed as its column is; a sum past 2^53 is shown as the server sent it. */\nfunction TotalValue({ value, display }: { value: unknown; display: DisplayRule | null }) {\n if (value === undefined)\n return (\n <span className=\"grid-totals-pending\" aria-label={say('summing')}>\n …\n </span>\n );\n if (value === null) return <span className=\"null\">{emptyWord()}</span>;\n const dress = dressFor(display, value);\n if (dress && dress.kind !== 'meter') return <Dressed dress={dress} compact={dress.kind === 'richText'} />;\n return <span className=\"num-value\">{formatNumber(value)}</span>;\n}\n\n/** The words a plain cell draws for a value, which the grid sizes a column by and a folded detail line tests its head\n against: a reference's label, a display rule's own words, a number as formatted, else the raw value. */\nfunction drawnWords(display: DisplayRule | null, plan: Plan, value: unknown, label?: unknown): unknown {\n if (label !== null && label !== undefined && String(label) !== '') return label;\n const dress = dressFor(display, value);\n if (!dress && plan.kind === 'number' && value != null) return numberShown(value, plan) ?? value;\n return (dress?.kind === 'tone' || dress?.kind === 'word' || dress?.kind === 'mark' ? dress.label : dress?.text) ?? value;\n}\n\n/** A row's folded columns, each drawn as its own cell would draw it, for the detail line under the row's name. */\nexport function foldedOf(more: NonNullable<CellColumn['more']>, record: Row): { name: string; head: string; body: ReactNode }[] {\n /* Empty says nothing, and a yes-or-no says its head where it is yes (\"Listed online\") and nothing where it is no. */\n const yes = (value: unknown) => value === true || value === 1 || value === '1' || value === 't' || value === 'true';\n return more\n .filter((column) => record[column.name] !== null && record[column.name] !== undefined && record[column.name] !== '')\n .filter((column) => column.plan.kind !== 'boolean' || yes(record[column.name]))\n .map((column) => {\n if (column.plan.kind === 'boolean') return { name: column.name, head: column.head, body: null };\n const td = CellBody({\n meta: column.meta,\n plan: column.plan,\n value: record[column.name],\n label: column.label ? record[column.label] : undefined,\n display: column.display,\n pin: undefined,\n edge: false,\n });\n /* A value that already says its head (\"Cycle 19\" under Cycle) is not told it twice: tested against the words\n the cell draws, which a display rule or a reference's label may set apart from the stored value. */\n const said = String(\n drawnWords(\n column.display as DisplayRule | null,\n column.plan,\n record[column.name],\n column.label ? record[column.label] : undefined,\n ) ?? '',\n ).toLowerCase();\n return {\n name: column.name,\n head: said.startsWith(column.head.toLowerCase()) ? '' : column.head,\n body: isValidElement<{ children?: ReactNode }>(td) ? td.props.children : null,\n };\n });\n}\n\n/** A cell, and under it the second line its column's display rule names.\n Memoized, as its row is: every prop is a value or a per-column object\n the grid keeps (`useKeptColumns`), so an unchanged cell is not redrawn.\n An editable cell is handed the grid's one `editCell` and its row, not a\n closure made per paint, for the same reason. */\nconst Cell = memo(function Cell({\n sub,\n more,\n editCell,\n adornCell,\n record,\n name,\n lead,\n ...props\n}: Parameters<typeof CellBody>[0] & {\n sub?: unknown;\n editCell?: GridProps['editCell'];\n adornCell?: GridProps['adornCell'];\n record?: Row;\n name?: string;\n /** The mark in a tinted square before the value, and the tone its square takes from the row. */\n lead?: { mark: string; tone?: string };\n /** The folded columns' heads and values, drawn under the value as one detail line. */\n more?: { name: string; head: string; body: ReactNode }[];\n}) {\n const edit = editCell && record && name !== undefined ? (draw: CellDraw) => editCell(record, name, draw, props.label) : undefined;\n const td = CellBody(props);\n const empty = props.value === null || props.value === undefined || props.value === '';\n const adorned = adornCell && record && name !== undefined && empty ? adornCell(record, name) : undefined;\n if (adorned !== undefined && isValidElement<{ children?: ReactNode }>(td)) return cloneElement(td, {}, adorned);\n /* An edited cell keeps its own <td> — alignment, pin, dress — and hands its\n editor a way to draw any value as this cell would. */\n if (edit && isValidElement<{ children?: ReactNode; className?: string }>(td)) {\n const draw: CellDraw = (next) => {\n const drawn = next ? CellBody({ ...props, value: next.value, label: next.label }) : td;\n return isValidElement<{ children?: ReactNode }>(drawn) ? drawn.props.children : null;\n };\n const editor = edit(draw);\n /* The whole cell is the editor's, its padding too: a click there edits\n rather than opening the row, as a click on the value does. */\n if (editor !== undefined)\n return cloneElement(\n td,\n {\n className: `${td.props.className ?? ''} cell-editable`,\n onClick: (event: React.MouseEvent<HTMLElement>) => {\n event.stopPropagation();\n if (event.target === event.currentTarget) event.currentTarget.querySelector<HTMLElement>('[data-cell-edits]')?.click();\n },\n } as Record<string, unknown>,\n editor,\n );\n }\n const hasSub = !(sub === null || sub === undefined || sub === '');\n const hasMore = Boolean(more?.length);\n if ((!hasSub && !lead && !hasMore) || !isValidElement<{ children?: ReactNode; className?: string }>(td)) return td;\n const body =\n hasSub || hasMore ? (\n <span className=\"cell-stack\">\n <span className=\"cell-main\">{td.props.children}</span>\n {hasSub && <span className=\"cell-sub\">{String(sub)}</span>}\n {hasMore && (\n <span className=\"cell-more\">\n {more!.map((item) => (\n <span key={item.name} className=\"cell-more-item\">\n {item.head && <span className={item.body === null ? 'cell-more-flag' : 'cell-more-head'}>{item.head}</span>}\n {item.body !== null && <> {item.body}</>}\n </span>\n ))}\n </span>\n )}\n </span>\n ) : (\n td.props.children\n );\n return cloneElement(\n td,\n hasMore ? ({ className: `${td.props.className ?? ''} has-more` } as Record<string, unknown>) : undefined,\n lead ? (\n <span className=\"cell-lead\">\n <LeadMark mark={lead.mark} tone={lead.tone} />\n <span className=\"cell-lead-body\">{body}</span>\n </span>\n ) : (\n body\n ),\n );\n});\n\n/* The lead icon a column's rule puts before its value, tinted by the tone its tone column's rule gives the row. Kept\n per row as one object per mark and tone, so the memoized cell sees the same prop until the row changes. */\nconst leads = new Map<string, { mark: string; tone?: string }>();\nfunction leadOf(column: CellColumn, record: Row): { mark: string; tone?: string } | undefined {\n const mark = column.display?.icon?.mark;\n if (!mark) return undefined;\n const raw = column.leadTone && Object.hasOwn(record, column.leadTone.path) ? record[column.leadTone.path] : undefined;\n const said = column.leadTone && raw != null ? ruleSays(column.leadTone.rule, raw).tone : undefined;\n /* A value the rule does not name is \"neutral\" as a chip, but a grey square on every ordinary row reads as disabled:\n only a tone the rule says (by name or by \"*\") takes the accent's place. */\n const named = column.leadTone?.rule?.tone ?? {};\n const tone = said === 'neutral' && !Object.hasOwn(named, String(raw)) && !Object.hasOwn(named, '*') ? undefined : said;\n const key = `${mark}\\u0000${tone ?? ''}`;\n if (!leads.has(key)) leads.set(key, { mark, ...(tone ? { tone } : {}) });\n return leads.get(key);\n}\n\n/* A key the App names in its own words ('SO-{id}'): the template filled\n with the key as it came, never through Number(), so a key past 2^53\n reads whole. The cell's data is untouched: sort, filter and export read the key. */\nfunction keyName(template: string, value: unknown): unknown {\n if (value === null || value === undefined || value === '') return value;\n const parsed = parseLabelTemplate(template);\n return 'problem' in parsed ? value : parsed.parts.map((part) => ('text' in part ? part.text : String(value))).join('');\n}\n\n/** What a row needs to draw one column's cells. */\ninterface CellColumn {\n name: string;\n meta: ColumnMeta | undefined;\n plan: Plan;\n display: DisplayRule | null;\n /** The hidden column that holds a reference's label, when this column is one. */\n label: string | undefined;\n /** The row field its second line is read from, when the display rule names one. */\n subtitle: string | undefined;\n /** The row field a money column's currency code is read from, when its rule says `currency: { column }`. */\n currency?: string;\n /** The row field a lead icon's tone is read from, and the rule that says that field's tone. */\n leadTone?: { path: string; rule: DisplayRule | null };\n /** The App's name for a record keyed by this column ('SO-{id}'), drawn in place of the bare key. */\n named?: string;\n /** The row column holding the key of the record this column's avatar photo is of (avatarPhotos.tsx). */\n photoOwner: string | undefined;\n pin: number | undefined;\n edge: boolean;\n wraps?: boolean;\n /** The columns the room could not hold, drawn under this one's value as a detail line (an App's list). */\n more?: { name: string; head: string; meta: ColumnMeta | undefined; plan: Plan; display: DisplayRule | null; label: string | undefined }[];\n}\n\n/**\n * The columns as the rows draw them, the same array for as long as nothing\n * in it changed. The grid redraws whenever the room around it does — a\n * keystroke in the list's search box was one — and a fresh array every time\n * handed every memoized row a new prop, so each keystroke redrew every cell\n * on the page: 250 rows, 250 times the work of 20.\n */\nfunction useKeptColumns(columns: CellColumn[]): CellColumn[] {\n const kept = useRef(columns);\n const was = kept.current;\n /* A plan is remade from the rows (planColumn reads their decimals), so a\n refetch with one changed row compares it by what it says. */\n const samePlan = (a: Plan, b: Plan) =>\n (Object.keys(a) as Array<keyof Plan>).every((key) => a[key] === b[key]) && Object.keys(a).length === Object.keys(b).length;\n const same =\n was.length === columns.length &&\n columns.every((column, i) =>\n (Object.keys(column) as Array<keyof CellColumn>).every(\n (key) => column[key] === was[i][key] || (key === 'plan' && samePlan(column.plan, was[i].plan)),\n ),\n );\n if (!same) kept.current = columns;\n return kept.current;\n}\n\n/** What a number cell draws for a value, or null where it draws the raw text.\n A value the server sent as a string because it is past 2^53 must not be\n run back through Number(): formatNumber keeps every digit. */\nfunction numberShown(value: unknown, plan: { decimals?: number; group?: boolean }): string | null {\n const n = Number(value);\n if (typeof value === 'string' && /^-?\\d+$/.test(value) && !Number.isSafeInteger(n)) return formatNumber(value);\n return Number.isFinite(n)\n ? formatNumber(n, {\n minimumFractionDigits: plan.decimals,\n maximumFractionDigits: plan.decimals,\n useGrouping: plan.group,\n })\n : null;\n}\n\n/* A dress that draws only its words: a meter's bar and a percent's bar or ring are width the words do not\n measure. (Only a number's or a date's dress is read for this: an avatar or a signature is text's.) */\nconst drawsWords = (dress: NonNullable<ReturnType<typeof dressFor>>) =>\n dress.kind !== 'meter' && !('bar' in dress && dress.bar) && !('ring' in dress && dress.ring);\n\n/* A record's tags in a list's cell: as many whole chips as the cell holds\n (at most TAGS_SHOWN, at least one), then how many more. Clipped by the\n cell, Thread's issues read \"accessibility perfo\"; a chip is a word, and a\n cut one is no word at all. The chips that do not fit are hidden, not\n unmounted, so a wider cell shows them again; the count is written into a\n span React leaves empty. */\nfunction TagsCellList({ chips }: { chips: ReturnType<typeof tagChips> }) {\n const ref = useRef<HTMLSpanElement>(null);\n const shown = chips.slice(0, TAGS_SHOWN);\n const labels = chips.map((chip) => chip.label).join('\\n');\n useLayoutEffect(() => {\n const list = ref.current;\n const cell = list?.parentElement;\n if (!list || !cell) return;\n const tags = [...list.querySelectorAll<HTMLElement>(':scope > .record-tag')];\n const more = list.querySelector<HTMLElement>(':scope > .tags-cell-more')!;\n const sayMore = (count: number) => {\n more.textContent = count > 0 ? say('moreTags', { count }) : '';\n more.style.display = count > 0 ? '' : 'none';\n };\n const fit = () => {\n tags.forEach((tag) => (tag.style.display = ''));\n sayMore(chips.length - tags.length);\n const box = getComputedStyle(cell);\n const room = cell.clientWidth - parseFloat(box.paddingLeft) - parseFloat(box.paddingRight);\n if (!(room > 0)) return;\n const gap = parseFloat(getComputedStyle(list).columnGap) || 0;\n const widths = tags.map((tag) => tag.offsetWidth);\n const count = tagsThatFit(widths, chips.length, gap, room, (rest) => {\n sayMore(rest);\n return more.offsetWidth;\n });\n sayMore(chips.length - count);\n tags.forEach((tag, index) => (tag.style.display = index < count ? '' : 'none'));\n };\n fit();\n const observer = new ResizeObserver(() => fit());\n observer.observe(cell);\n return () => observer.disconnect();\n }, [labels]); // eslint-disable-line react-hooks/exhaustive-deps\n return (\n <span ref={ref} className=\"tags-cell-list\">\n {shown.map((chip) => (\n <span key={chip.label} className={`record-tag tone tone-${chip.tone ?? 'neutral'}`}>\n {chip.label}\n </span>\n ))}\n <span className=\"tags-cell-more\" />\n </span>\n );\n}\n\nfunction CellBody(\n props: Parameters<typeof PlatformCell>[0] & {\n row?: Record<string, unknown>;\n table?: string;\n currency?: unknown;\n /** A due date's row is still open (dueOpen.ts): one that has passed is drawn in the warning tone. */\n open?: boolean;\n },\n) {\n const { row, table, currency, open, ...cell } = props;\n if (open) cell.display = { ...(cell.display as DisplayRule), open: true };\n /* A money column whose currency is the row's own: the code the row holds, where it holds one. */\n if (typeof currency === 'string' && /^[A-Za-z]{3}$/.test(currency))\n cell.display = {\n ...(cell.display as DisplayRule),\n currency: currency.toUpperCase(),\n };\n const rule = cell.display as DisplayRule | null;\n /* The App's own renderer draws the value inside the platform's cell — its\n class, alignment and pin kept — and the platform's own drawing stands in\n until it arrives. The cell's data is untouched: sort, filter and export\n read the value, never what a renderer drew. */\n if (\n rule?.component &&\n table &&\n maskedText(rule, cell.value) === undefined &&\n cell.value !== null &&\n cell.value !== undefined &&\n shellBody().classList.contains('app-mode')\n ) {\n const { component: _component, ...rest } = rule;\n const td = PlatformCell({ ...cell, display: rest });\n if (!isValidElement<{ children?: ReactNode }>(td)) return td;\n return cloneElement(\n td,\n undefined,\n <ValueSlot\n id={rule.component.id}\n value={cell.value}\n row={row}\n column={{ name: cell.meta?.name ?? '', resource: table }}\n context=\"grid\"\n compact\n {...ruleSays(rest, cell.value)}\n fallback={td.props.children}\n />,\n );\n }\n return PlatformCell(cell);\n}\n\nfunction PlatformCell({\n meta,\n plan,\n value,\n label,\n display,\n pin,\n edge,\n photo,\n wraps,\n}: {\n meta: ColumnMeta | undefined;\n plan: Plan;\n value: unknown;\n label?: unknown;\n display: unknown;\n pin: number | undefined;\n edge: boolean;\n /** The room set this column's values on two lines (gridSizing.ts): the cell wraps at words, kept whole. */\n wraps?: boolean;\n /** The avatar's photo, where the column draws one and the record has one. */\n photo?: string;\n}) {\n const classes: string[] = [`align-${plan.align}`];\n const peek =\n meta?.references && value !== null && value !== undefined && value !== ''\n ? {\n 'data-ref-table': meta.references.table,\n 'data-ref-column': meta.references.column,\n 'data-ref-value': String(value),\n }\n : {};\n const pinAttrs = pin !== undefined ? { style: { left: `${pin}px` } } : {};\n /* The face the rule asks for wins; unasked, an App sets short text in the reading face unless it is a key or a code. */\n const face = (display as DisplayRule | null)?.face;\n const app = shellBody().classList.contains('app-mode');\n const pinClass =\n (pin !== undefined ? ` pinned${edge ? ' pinned-edge' : ''}` : '') + (face ? ` face-${face}` : '') + (wraps ? ' wraps' : '');\n\n /* A record's tags (tagLists.ts): a few chips, and how many more there are. */\n if (meta?.type === TAGS_TYPE) {\n const chips = tagChips(value);\n return (\n <td className={`align-left tags-cell${pinClass}`} title={chips.map((chip) => chip.label).join(', ') || undefined} {...pinAttrs}>\n {chips.length ? <TagsCellList chips={chips} /> : emptyWord()}\n </td>\n );\n }\n if (value === null || value === undefined) {\n return (\n <td className={`null align-${plan.align}${pinClass}`} title=\"null\" {...pinAttrs}>\n {emptyWord()}\n </td>\n );\n }\n const json = jsonValueOf(meta, value);\n if (json)\n return (\n <td className={`align-left json-cell${pinClass}`} {...pinAttrs}>\n <JsonPreview value={json.value} name={meta?.name ?? 'Value'} type={meta?.type} />\n </td>\n );\n const raw = String(value);\n if (label !== null && label !== undefined && String(label) !== '') {\n return (\n <td className={`align-left reflink${pinClass}`} title={`${String(label)} (${raw})`} {...peek} {...pinAttrs}>\n {(display as DisplayRule | null)?.avatar ? (\n <AvatarText text={clampCell(String(label)).text} photo={photo} />\n ) : (\n clampCell(String(label)).text\n )}\n </td>\n );\n }\n const dress = dressFor(display as DisplayRule | null, value);\n if (dress) {\n return (\n <td className={`align-${plan.align} dressed${pinClass}`} {...peek} {...pinAttrs}>\n {/* A cell is one line: rich text is its excerpt there, read whole on its record. */}\n <Dressed dress={dress.kind === 'avatar' && photo ? { ...dress, photo } : dress} compact={dress.kind === 'richText'} />\n </td>\n );\n }\n if (!face && (plan.kind === 'number' || (plan.mono && (!app || plan.kind !== 'text' || plan.idLike)))) classes.push('mono');\n\n if (plan.kind === 'boolean') {\n const on = value === true || value === 1 || value === '1' || value === 't';\n return (\n <td className={`${classes.join(' ')} bool${pinClass}`} title={raw} {...peek} {...pinAttrs}>\n <span className={on ? 'yes' : 'no'}>{on ? '✓' : '✗'}</span>\n </td>\n );\n }\n if (plan.kind === 'number') {\n const shown = numberShown(value, plan) ?? raw;\n return (\n <td\n className={`${classes.join(' ')} num${meta?.references ? ' reflink' : ''}${pinClass}`}\n title={shown === raw ? undefined : raw}\n {...peek}\n {...pinAttrs}\n >\n {shown}\n </td>\n );\n }\n if (plan.kind === 'date') {\n /* An App says a near day from today and the rest as the date, the whole of it on hover (sayNearDay); the\n Workbench shows the data as it is, its stored form on hover. */\n const near = app ? sayNearDay(raw, Boolean(plan.showTime)) : null;\n const shown = near?.text ?? (plan.showTime ? formatDateTime(raw) : formatDate(raw));\n const title = near?.title ?? (shown === raw ? undefined : raw);\n return (\n <td className={`${classes.join(' ')}${pinClass}`} title={title} {...peek} {...pinAttrs}>\n {shown}\n </td>\n );\n }\n if (meta?.references) {\n return (\n <td className={`${classes.join(' ')}${pinClass}`} {...peek} {...pinAttrs}>\n <span className=\"ref\" title={`→ ${meta.references.table}`}>\n {raw}\n </span>\n </td>\n );\n }\n /* In an App a vocabulary's value is a word (Value.tsx says why); the Workbench's grid shows the data. */\n if (shellBody().classList.contains('app-mode') && meta?.allowed?.includes(raw))\n return (\n <td className={`${classes.join(' ')}${pinClass}`} title={raw} {...pinAttrs}>\n {vocabularyWord(raw)}\n </td>\n );\n const cell = clampCell(raw);\n return (\n <td className={`${classes.join(' ')}${pinClass}`} title={cell.title} {...pinAttrs}>\n {cell.text}\n </td>\n );\n}\n\n/* A vocabulary column that says where a row stands, kept when a narrow grid leaves columns out. */\nconst STATUS_NAME = /(^|_)(status|state|stage|phase)$/i;\n\nexport function Grid({\n table,\n data,\n hide,\n labels,\n totals,\n totalsLabel = say('total'),\n density,\n referenceLabels,\n sizing = 'fit',\n interactive = true,\n virtual: mayVirtualise = true,\n onRowClick,\n list,\n current,\n emptyText,\n compact = false,\n firstRow = 0,\n dropColumns = false,\n editCell,\n adornCell,\n}: GridProps) {\n const captionLanguage = useMessageLanguage();\n const wrap = useRef<HTMLDivElement>(null);\n const tableRef = useRef<HTMLTableElement>(null);\n const rows = data.rows ?? NO_ROWS;\n const byName = useMemo(() => presentationColumns(state.schema, table, data.columns ?? []), [table, data.columns, state.schema]);\n /* The columns asked to be drawn; an embedded grid may leave out those past its width (`drawn`, below). */\n const asked = useMemo(\n () => (hide?.length ? (data.columns ?? []).filter((name) => !hide.includes(name)) : (data.columns ?? [])),\n [data.columns, hide?.join(',')], // eslint-disable-line react-hooks/exhaustive-deps\n );\n /* A second line is read from the row only where the row carries it: a\n subtitle the list did not fetch is left out rather than read from a\n column of the same name on another table. */\n const subtitleOf = (name: string, row: Row) => {\n const path = subtitlePath(columnDisplay(table?.id, name) as DisplayRule | null, name);\n return path && Object.hasOwn(row, path) ? row[path] : undefined;\n };\n const plans = useMemo(\n () =>\n new Map(\n asked.map((name) => [\n name,\n {\n ...planColumn(byName.get(name), name, rows),\n ...(referenceLabels?.[name] ? { align: 'left' } : {}),\n // A key the App names ('SO-{id}') is drawn as that name: text, read from the left.\n ...(table?.keyLabel && table.labelTemplate && byName.get(name)?.primaryKey ? { kind: 'text', align: 'left' } : {}),\n } as Plan,\n ]),\n ),\n [asked, byName, rows, referenceLabels, table],\n );\n /* Each row's identity: the string its host is published under and the key\n React keeps it by, so a refetch that reorders or drops rows moves the\n survivors instead of redrawing them. A row that cannot name itself — no\n key, a result that dropped a key column, a duplicate — is kept by\n position and has no host. */\n const keyed = Boolean(table && primaryKey(table).length && primaryKey(table).every((c: string) => (data.columns ?? []).includes(c)));\n const outerHosts = useRowHostScope();\n const [ownHosts] = useState(createRowHosts);\n const hosts = outerHosts ?? ownHosts;\n /* The trailing cell, drawn only when something around the grid asked to\n put a row's own menu there — and only on rows that can name themselves. */\n const trailHosts = useRowTrailScope();\n const rowKeys = useMemo(() => {\n if (!keyed) return rows.map(() => null);\n const seen = new Set<string>();\n return rows.map((row) => {\n const key = rowKeyString(table, row);\n if (key === null || seen.has(key)) return null;\n seen.add(key);\n return key;\n });\n }, [keyed, table, rows]);\n /* Rows another person just changed, tinted for a moment (liveState.ts, docs/design.md rule 11). */\n const changedRows = useChangedRows(table?.id, rows, (row) => (table ? (keyOf(table, row) as Record<string, unknown> | null) : null));\n const openable = useMemo(() => rowKeys.filter((key): key is string => key !== null), [rowKeys]);\n\n const virtual = mayVirtualise && rows.length > VIRTUAL_THRESHOLD;\n /* Not where rows open as pages: the expander is the explorer's way of\n seeing what points at a row, and an app's list gets that on the page\n the row opens as. Nor on a windowed table: an opened detail is many\n times a row's height, and the window's whole model is uniform rows. Nor\n on a result without the key: what points at a row is asked by its key,\n and a projection that dropped it has nothing to ask with. */\n const expandable = interactive && !prefersPages() && rows.length <= VIRTUAL_THRESHOLD && hasChildren(table) && keyed;\n /* The leading cell is each row's host (components/RowHost.tsx): drawn when\n the grid has an expander to put there, or when a presentation around\n the grid has asked to decorate its rows. */\n const slotted = expandable || Boolean(outerHosts);\n const shift = slotted ? 1 : 0;\n const trailing = Boolean(trailHosts) && keyed;\n const language = interactive && Boolean(table);\n const [availableWidth, setAvailableWidth] = useState(0);\n const [headChar, setHeadChar] = useState(GRID_HEAD_CHAR);\n /* How a head sets its label (font, case, tracking), so a column is sized by the label as drawn and not by a\n count of its characters: seven pixels a character kept \"Listed online\" 125px wide at 1280, and the table\n that did not fit cut the last column off. */\n const [headFace, setHeadFace] = useState<{ font: string; upper: boolean; tracking: number } | null>(null);\n /* The fonts the first row's cells set in, one per cell, so a column is sized\n by what its words measure there rather than a count of their characters\n (gridSizing.ts). Per cell: a look sets the first column heavier, and\n measured in the others' weight its names ran past the width they got. */\n const [cellFonts, setCellFonts] = useState<string[]>([]);\n /* What a tone chip in the first row draws beyond its words, per cell (its dot, gap, padding): a look that says a\n status as a pill spends 41px there, one that says it as a dot and a word 12, and sizing every column for the\n wider kept 30px of every table's room in a status that never used it. -1: the cell holds no chip. */\n const [cellChips, setCellChips] = useState<number[]>([]);\n useLayoutEffect(() => {\n if (sizing !== 'fit' || !wrap.current) return;\n const element = wrap.current;\n /* The look says how wide its heads' characters set (gridSizing.ts); read\n again when the reader picks another look, which moves no width. */\n const measure = (contentWidth?: number) => {\n const style = getComputedStyle(element);\n /* clientWidth rounds up fractional layout widths. At density zoom that\n can create a one-screen-pixel scroll range even when scrollWidth and\n clientWidth agree. Preserve the fraction until fitGridColumns floors\n it; neither clip real overflow nor subtract space from column minima. */\n const inset =\n style.boxSizing === 'border-box'\n ? [style.paddingLeft, style.paddingRight, style.borderLeftWidth, style.borderRightWidth].reduce(\n (sum, value) => sum + (parseFloat(value) || 0),\n 0,\n )\n : 0;\n setAvailableWidth(contentWidth ?? Math.max(0, parseFloat(style.width) - inset));\n setHeadChar(parseFloat(style.getPropertyValue('--grid-head-char')) || GRID_HEAD_CHAR);\n const label = element.querySelector('thead th .th-sort');\n if (label) {\n const face = getComputedStyle(label);\n const next = {\n font: `${face.fontStyle} ${face.fontWeight} ${face.fontSize} ${face.fontFamily}`,\n upper: face.textTransform === 'uppercase',\n tracking: parseFloat(face.letterSpacing) || 0,\n };\n setHeadFace((was) => (was && was.font === next.font && was.upper === next.upper && was.tracking === next.tracking ? was : next));\n }\n const cells = [...element.querySelectorAll('tbody tr:first-child > td')];\n if (cells.length) {\n const fonts = cells.map((cell) => {\n const font = getComputedStyle(cell);\n return `${font.fontStyle} ${font.fontWeight} ${font.fontSize} ${font.fontFamily}`;\n });\n setCellFonts((was) => (was.join('|') === fonts.join('|') ? was : fonts));\n /* The widest chip of the sampled rows, not the first row's: a look may draw a neutral state as a bare word\n and the rest as pills, and sized by a first-row \"Ready\" Sage cut every \"In review\" pill to \"In rev…\". */\n const rows = [...element.querySelectorAll('tbody tr')].slice(0, GRID_SIZE_SAMPLE);\n const chips = cells.map((_, index) => {\n let extra = -1;\n for (const row of rows) {\n const chip = row.children[index]?.querySelector<HTMLElement>('.tone:not(.tone-figure)');\n const words = chip?.textContent?.trim();\n const said = words ? textMeasure(fonts[index])?.(words) : undefined;\n if (chip && said !== undefined) extra = Math.max(extra, Math.ceil(chip.offsetWidth - said));\n }\n return extra;\n });\n /* A row with no chip in the cell (a sort moved the empty ones to the top) keeps what was known: the\n columns must not move because of which row happens to be first. */\n setCellChips((was) => {\n const next = chips.map((extra, index) => (extra >= 0 ? extra : (was[index] ?? -1)));\n return was.join('|') === next.join('|') ? was : next;\n });\n }\n };\n measure();\n const observer = new ResizeObserver((entries) => measure(entries[0]?.contentRect.width));\n observer.observe(element);\n const themeChanged = () => measure();\n addHostListener(window, VISUAL_THEME_EVENT, themeChanged);\n return () => {\n observer.disconnect();\n removeHostListener(window, VISUAL_THEME_EVENT, themeChanged);\n };\n }, [sizing]);\n /* The column that names the row — the table's label where it is drawn,\n else the first text — is read whole before the others (gridSizing.ts). */\n const titleName = useMemo(() => {\n const naming = table ? namingColumn(table) : undefined;\n return naming && asked.includes(naming)\n ? naming\n : asked.find((name) => plans.get(name)?.kind === 'text' || Boolean(referenceLabels?.[name]));\n }, [table, asked, plans, referenceLabels]);\n const sizeHints = useMemo(\n () =>\n asked.map((name) => {\n const plan = plans.get(name)!;\n const labelColumn = referenceLabels?.[name];\n const display = datesAmong(\n columnDisplay(table?.id, name) as DisplayRule | null,\n rows.map((row) => row[name]),\n );\n const label = String(labels?.[name] ?? columnLabel(table?.id, name) ?? name);\n const headText = byName.get(name)?.primaryKey && !shell().inApp() ? `${label} ${say('common.key')}` : label;\n const headMeasure = headFace ? textMeasure(headFace.font) : undefined;\n const headSet = (text: string) => headMeasure!(headFace!.upper ? text.toUpperCase() : text) + headFace!.tracking * text.length;\n return {\n headWidth: headMeasure ? headSet(headText) : undefined,\n /* An App's head wraps to two lines before it widens its column (style.css, .th-label). */\n wrapHead: shell().inApp(),\n /* An App's words may wrap too, once its heads have and the room is still short: kept whole on two lines. */\n wrapValues: shell().inApp() && (Boolean(labelColumn) || plan.kind === 'text') && !display?.component,\n headWrap: headMeasure && shell().inApp() ? twoLineWidth(headText, headSet) : undefined,\n /* The head's key badge is words too, where it is drawn (an App hides it, features.css): once a\n number was sized by its figures, the Workbench's \"id KEY ↓\" lost its \"id\" under the badge. */\n label: byName.get(name)?.primaryKey && !shell().inApp() ? `${label} ${say('common.key')}` : label,\n title: name === titleName,\n avatar: Boolean(display?.avatar),\n chipExtra: (cellChips[asked.indexOf(name) + shift] ?? -1) >= 0 ? cellChips[asked.indexOf(name) + shift] : undefined,\n kind: labelColumn ? 'text' : plan.kind,\n controls: language || Boolean(byName.get(name)?.primaryKey || byName.get(name)?.references),\n /* A reference's arrow stands beside its label in the sort (the head, below), after the sort's 4px gap:\n uncounted, it took the room past the label that the resizer's strip is (style.css). */\n mark: byName.get(name)?.references ? 4 + (headMeasure ? headSet(REFERENCE_MARK) : GRID_HEAD_CHAR) : undefined,\n showTime: plan.showTime,\n values: rows.slice(0, GRID_SIZE_SAMPLE).map((row) => {\n if (labelColumn && row[labelColumn] != null) return row[labelColumn];\n /* A tags cell keeps at least its first chip whole, and the count beside it (TagsCellList). */\n if (byName.get(name)?.type === TAGS_TYPE) {\n const chips = tagChips(row[name]);\n return chips.length\n ? `${chips[0]!.label}${chips.length > 1 ? ` ${say('moreTags', { count: chips.length - 1 })}` : ''}`\n : null;\n }\n const json = jsonValueOf(byName.get(name), row[name]);\n if (json) return previewOf(json.value);\n // Sized by what is drawn: a tone chip draws its label, a bare number its formatted figures.\n return drawnWords(display, plan, row[name]);\n }),\n subValues: display?.subtitle ? rows.slice(0, GRID_SIZE_SAMPLE).map((row) => subtitleOf(name, row)) : undefined,\n chip:\n byName.get(name)?.type === TAGS_TYPE ||\n (!labelColumn &&\n rows.slice(0, GRID_SIZE_SAMPLE).some((row) => {\n const dress = dressFor(display, row[name]);\n return dress?.kind === 'tone' && !dress.figure;\n })),\n /* A number with no rule is sized by the figures its cell draws (\"1,249.50\"), measured as they\n are; an App's own renderer draws something the words do not measure. */\n dressed:\n !labelColumn &&\n !display?.component &&\n rows.slice(0, GRID_SIZE_SAMPLE).every((row) => {\n if (row[name] == null) return true;\n const dress = dressFor(display, row[name]);\n return dress ? drawsWords(dress) : plan.kind === 'number' && numberShown(row[name], plan) != null;\n }),\n status:\n !labelColumn &&\n plan.kind !== 'number' &&\n (Boolean(display?.tone && !display.format && !display.bar) ||\n (Boolean(byName.get(name)?.allowed?.length) && STATUS_NAME.test(name))),\n };\n }),\n [asked, plans, referenceLabels, table?.id, labels, language, captionLanguage, byName, rows, titleName, headFace, cellChips, shift],\n );\n /* Column i's cell follows the expander's when there is one. */\n const measureText = useMemo(\n () =>\n cellFonts.length\n ? (text: string, column: number) =>\n textMeasure(cellFonts[Math.min(column + (slotted ? 1 : 0), cellFonts.length - 1)])?.(text) ?? text.length * 8\n : undefined,\n [cellFonts, slotted],\n );\n /* An App's own list folds the columns its room cannot hold under the row's name, as a detail line, once its heads\n and words have wrapped (gridSizing.ts): they are moved, not lost, and the list does not scroll sideways. An\n embedded grid leaves them out, as it did. */\n const folds = !dropColumns && sizing === 'fit' && shell().inApp();\n const kept = useMemo(\n () =>\n (dropColumns || folds) && sizing === 'fit' ? keepFitting(sizeHints, availableWidth, slotted, trailing, headChar, measureText) : null,\n [dropColumns, folds, sizing, sizeHints, availableWidth, slotted, trailing, headChar, measureText],\n );\n const drawn = useMemo(() => (kept ? asked.filter((_, index) => kept[index]) : asked), [asked, kept]);\n const drawnHints = useMemo(() => (kept ? sizeHints.filter((_, index) => kept[index]) : sizeHints), [sizeHints, kept]);\n /* The reader's arrangement, over the drawn columns (gridArrange.ts): an\n order the reader put the columns in, and widths they dragged them to.\n Both live only in this grid — a refetch never moves a placed column —\n and both are dropped for columns no longer drawn. */\n const [columnOrder, setColumnOrder] = useState<string[] | null>(null);\n const [columnWidths, setColumnWidths] = useState<Record<string, number>>({});\n const ordered = useMemo(() => applyColumnOrder(drawn, columnOrder), [drawn, columnOrder]);\n const orderedHints = useMemo(() => ordered.map((name) => drawnHints[drawn.indexOf(name)]!), [ordered, drawn, drawnHints]);\n const fit = useMemo(\n () => fitGridColumns(orderedHints, availableWidth, slotted, trailing, headChar, measureText, dropColumns),\n [orderedHints, availableWidth, slotted, trailing, headChar, measureText, dropColumns],\n );\n /* A dragged width stands in place of its fitted one. A scrolled grid has\n no colgroup until a width is dragged: then it takes one, and the fixed\n layout that makes a dragged width hold, with the fitted widths for the\n columns untouched — a grid that was never arranged draws exactly as it\n did. */\n const hasWidthOverrides = Object.keys(columnWidths).length > 0;\n const colWidths = useMemo(\n () => (hasWidthOverrides ? applyColumnWidths(fit.columns, ordered, columnWidths) : fit.columns),\n [hasWidthOverrides, fit.columns, ordered, columnWidths],\n );\n const useColgroup = sizing === 'fit' || hasWidthOverrides;\n const tableWidth = hasWidthOverrides\n ? colWidths.reduce((sum, width) => sum + width, 0) + (slotted ? GRID_EXPANDER_WIDTH : 0) + (trailing ? GRID_TRAIL_WIDTH : 0)\n : fit.width;\n const moveColumnBy = useCallback(\n (name: string, direction: 'left' | 'right') =>\n setColumnOrder((current) => moveColumn(applyColumnOrder(drawn, current), name, direction)),\n [drawn],\n );\n const setColumnWidth = useCallback(\n (name: string, width: number) =>\n setColumnWidths((current) => {\n const next = clampColumnWidth(width);\n return current[name] === next ? current : { ...current, [name]: next };\n }),\n [],\n );\n const resetColumnWidth = useCallback(\n (name: string) =>\n setColumnWidths((current) => {\n if (!(name in current)) return current;\n const next = { ...current };\n delete next[name];\n return next;\n }),\n [],\n );\n /* The widths a scrolled grid's columns are drawn at now. A scrolled grid is laid out by its content and holds no\n width of its own, so the first one dragged would otherwise switch it to a fixed layout with every other column\n at its estimated minimum, and the dragged one would start from the estimate rather than from what the reader\n grabbed. The heads are measured instead, and the whole row becomes the first arrangement: the switch moves\n nothing but the column being dragged. A head not laid out yet (no width) is left to its fitted width. */\n const measureDrawn = useCallback((from: Element): Record<string, number> => {\n const measured: Record<string, number> = {};\n for (const th of from.closest('table')?.querySelectorAll<HTMLElement>('thead th[data-col]') ?? []) {\n const width = th.getBoundingClientRect().width / viewportScale();\n if (width > 0) measured[th.dataset.col!] = clampColumnWidth(width);\n }\n return measured;\n }, []);\n /* One resizer drag at a time: where it started, the width it started\n from, and the override it started over, so a cancelled drag puts\n back exactly what was there — including no override at all. `seed` is\n the measured row of a scrolled grid not yet arranged, spent by the\n first move (a press that never moves arranges nothing). */\n const resizeDrag = useRef<{\n name: string;\n startX: number;\n startWidth: number;\n hadOverride: boolean;\n prevWidth: number | undefined;\n seed: Record<string, number> | null;\n seeded: boolean;\n } | null>(null);\n const columns = useMemo(\n () => helper.columns(ordered.map((name) => helper.accessor((row: Row) => row[name], { id: name, header: name }))),\n [ordered],\n );\n const model = useTable({ features, columns, data: rows });\n const modelRows = model.getRowModel().rows;\n /* In an App list the header's ⌄ is the App's short menu (AppColumnMenu.tsx), and the list's pins are its own. */\n const appMenu = useAppColumnMenu();\n const pinList = appMenu?.current?.listKey;\n const pinChange = useSyncExternalStore(subscribePins, pinsVersion);\n const pinned = useMemo(\n () => (interactive ? (pinnedFor(table, ordered, pinList) as string[]) : []),\n [interactive, table, ordered, pinList, pinChange],\n ); // eslint-disable-line react-hooks/exhaustive-deps\n /* A pinned column keeps the block at the left that its sticky offsets are measured over (usePins.ts), so a\n column steps only among its own kind: a move across the boundary would leave a scrolling column between two\n frozen ones. The buttons and Alt+arrows both ask. */\n const canMove = (name: string, direction: 'left' | 'right') => {\n const next = ordered[ordered.indexOf(name) + (direction === 'left' ? -1 : 1)];\n return next !== undefined && pinned.includes(next) === pinned.includes(name);\n };\n const stepColumn = (name: string, direction: 'left' | 'right') => {\n if (canMove(name, direction)) moveColumnBy(name, direction);\n };\n const navigable = Boolean(onRowClick) || keyed;\n const query = currentEntry()?.query ?? '';\n\n /* The records on this page, and the list they are a page of when the room\n hands one (TableView): a record opened from this grid steps through the\n list past this page too (recordTrail.ts). An embedded grid hands its\n rows only. */\n const records = useMemo(\n () =>\n rows.flatMap((item) => {\n const itemKey = table && (keyOf(table, item) as Record<string, unknown> | null);\n return itemKey ? [{ key: itemKey, label: rowLabel(table, item) }] : [];\n }),\n [table, rows],\n );\n\n /* The record the reader is on beside this list — a split's detail — is\n marked, and brought into view as J and K step it along. */\n const currentKey = current && table ? rowKeyString(table, current) : null;\n useLayoutEffect(() => {\n if (currentKey === null) return;\n const rowNodes = tableRef.current?.querySelectorAll<HTMLElement>('tbody tr[data-row-key]') ?? [];\n [...rowNodes].find((node) => node.dataset.rowKey === currentKey)?.scrollIntoView?.({ block: 'nearest' });\n }, [currentKey]);\n\n const opens = useRowOpens();\n const openRow = useCallback(\n (row: Row) => {\n if (onRowClick) {\n onRowClick(row);\n return;\n }\n /* A row that opens what it is about opens that, with no neighbors to step to: they are rows of this list. */\n if (opens && table) {\n const target = rowOpensTarget(table, row, opens);\n if (target) void openRecord(target.table, target.key, target.label, 'push');\n return;\n }\n const key = table && (keyOf(table, row) as Record<string, unknown> | null);\n if (!key) return;\n void openRecord(table!.id, key, rowLabel(table, row), 'push', {\n records,\n list,\n });\n },\n [onRowClick, opens, table, records, list],\n );\n\n /* Space glances at the row's record without leaving the list (peekpanel.js), its neighbors a J or K away. */\n const peekRow = useCallback(\n (row: Row) => {\n if (opens && table) {\n const target = rowOpensTarget(table, row, opens);\n if (target) peekRecord(target.table, target.key, target.label);\n return;\n }\n const key = table && (keyOf(table, row) as Record<string, unknown> | null);\n if (key) peekRecord(table!.id, key, rowLabel(table, row), records, list);\n },\n [opens, table, records, list],\n );\n\n /* ---------- expansion ---------- */\n const [expanded, setExpanded] = useState<Set<string>>(() => new Set());\n const [expandingAll, setExpandingAll] = useState(false);\n /* An open row stays open for as long as it is in the result. A sort or a\n page re-asks in place (core.js `refine`) and a refetch moves rows by key,\n so a row still on screen keeps its detail; one that left is forgotten,\n and coming back to it is coming back to a closed row. */\n useEffect(() => {\n setExpanded((s) => {\n const kept = new Set(openable.filter((key) => s.has(key)));\n return kept.size === s.size ? s : kept;\n });\n }, [openable]);\n const toggle = (key: string) =>\n setExpanded((s) => {\n const n = new Set(s);\n if (n.has(key)) n.delete(key);\n else n.add(key);\n return n;\n });\n const anyClosed = openable.some((key) => !expanded.has(key));\n const expandAll = async () => {\n if (expandingAll) return;\n if (!anyClosed) {\n setExpanded(new Set());\n return;\n }\n /* A few at a time — the top of the table fills in immediately, the\n rest follows, and the database is never asked for everything at once. */\n setExpandingAll(true);\n try {\n for (let i = 0; i < openable.length; i += BATCH) {\n const batch = openable.slice(i, i + BATCH);\n setExpanded((s) => new Set([...s, ...batch]));\n if (i + BATCH < openable.length) await new Promise((r) => setTimeout(r, BREATH_MS));\n }\n } finally {\n setExpandingAll(false);\n }\n };\n\n /* ---------- windowing ---------- */\n const [scroller, setScroller] = useState<HTMLElement | null>(null);\n const [rowHeight, setRowHeight] = useState(26);\n const [margin, setMargin] = useState(0);\n useLayoutEffect(() => {\n if (!virtual || !wrap.current) return;\n setScroller((wrap.current.closest('.content') as HTMLElement | null) ?? (document.scrollingElement as HTMLElement | null));\n }, [virtual]);\n const virtualizer = useVirtualizer({\n count: virtual ? rows.length : 0,\n getScrollElement: () => scroller,\n estimateSize: () => rowHeight,\n overscan: OVERSCAN,\n scrollMargin: margin,\n enabled: virtual && Boolean(scroller),\n });\n const items = virtualizer.getVirtualItems();\n /* Measured from a rendered row rather than assumed: row height depends on\n font, zoom and content, and a wrong guess is wrong by a pixel per row —\n a scrollbar disagreeing with its content by a screenful. Sampled after\n each paint and corrected once the disagreement is real. */\n useLayoutEffect(() => {\n if (!virtual || !tableRef.current || !scroller) return;\n const sample = tableRef.current.querySelector('tbody tr[data-row]');\n const actual = sample ? viewportBox(sample).height : 0;\n if (actual && Math.abs(actual - rowHeight) >= 0.5) setRowHeight(actual);\n const top = tableRef.current.offsetTop;\n if (top !== margin) setMargin(top);\n });\n useEffect(() => {\n if (virtual) virtualizer.measure();\n }, [rowHeight, virtual]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const shown = virtual ? items.map((it) => it.index) : rows.map((_, i) => i);\n const padTop = virtual && items.length ? items[0].start - margin : 0;\n const padBottom = virtual && items.length ? Math.max(0, rows.length - items[items.length - 1].index - 1) * rowHeight : 0;\n\n /* ---------- pins and the keyboard ---------- */\n const lefts = usePins(wrap, ordered, pinned, shift, `${shown.join(',')}:${sizing}:${fit.columns.join(',')}`);\n useStickyHead(wrap, `${ordered.join(',')}:${sizing}:${rows.length > 0}`);\n const lastPinned = pinned.length ? ordered.filter((n) => pinned.includes(n)).pop() : undefined;\n /* Read on every paint, as the cells always read them — an App's display\n rules can change under the grid — and kept while they are equal. */\n const folded = folds && kept ? asked.filter((_, index) => !kept[index]) : [];\n /* Under the row's name, unless that column is a short key (\"AC-105\"): a line folded into it wraps word by word and\n reads as part of the key. Then the widest column of plain words (not a state's chip), else the name after all. */\n const foldsInto = (() => {\n if (!folded.length) return undefined;\n const named = titleName && ordered.includes(titleName) ? titleName : ordered[0]!;\n const width = (name: string) => fit.columns[ordered.indexOf(name)] ?? 0;\n if (width(named) >= FOLD_ROOM) return named;\n const words = ordered.filter(\n (name) =>\n (plans.get(name)?.kind === 'text' || Boolean(referenceLabels?.[name])) &&\n !(columnDisplay(table?.id, name) as DisplayRule | null)?.tone,\n );\n return words.reduce((best, name) => (width(name) > width(best) ? name : best), named);\n })();\n const cellColumns = useKeptColumns(\n ordered.map((name) => {\n /* A column of relative dates is said one way down its length (datesAmong). */\n const display = datesAmong(\n columnDisplay(table?.id, name) as DisplayRule | null,\n rows.map((row) => row[name]),\n );\n return {\n name,\n meta: byName.get(name),\n plan: plans.get(name)!,\n display,\n label: referenceLabels?.[name],\n subtitle: subtitlePath(display, name),\n ...(currencyPath(display, name) ? { currency: currencyPath(display, name) } : {}),\n ...(leadTonePath(display, name)\n ? {\n leadTone: {\n path: leadTonePath(display, name)!,\n rule: columnDisplay(table?.id, leadTonePath(display, name)!) as DisplayRule | null,\n },\n }\n : {}),\n photoOwner: avatarOwner(table, name, display, data.columns),\n pin: lefts.get(name),\n edge: name === lastPinned,\n ...(fit.wraps[ordered.indexOf(name)] ? { wraps: true } : {}),\n ...(name === foldsInto\n ? {\n more: folded.map((other) => ({\n name: other,\n head: String(labels?.[other] ?? columnLabel(table?.id, other) ?? other),\n meta: byName.get(other),\n plan: plans.get(other)!,\n display: datesAmong(\n columnDisplay(table?.id, other) as DisplayRule | null,\n rows.map((row) => row[other]),\n ),\n label: referenceLabels?.[other],\n })),\n }\n : {}),\n ...(table?.keyLabel && table.labelTemplate && byName.get(name)?.primaryKey ? { named: table.labelTemplate } : {}),\n };\n }),\n );\n const photoColumns = useMemo(() => cellColumns.filter((column) => column.photoOwner), [cellColumns]);\n /* One callback for every row and every paint: the one it calls is read\n when a row is opened, so a caller's fresh onRowClick redraws nothing. */\n const opener = useRef(openRow);\n opener.current = openRow;\n const openOne = useCallback((row: Row) => opener.current(row), []);\n useGridKeyboard(tableRef, wrap, {\n rowCount: rows.length,\n columnCount: ordered.length,\n offset: shift,\n onOpen: navigable ? (index) => openRow(rows[index]) : undefined,\n onPeek: keyed ? (index) => peekRow(rows[index]) : undefined,\n totalRows: data.exactTotal === false || data.cappedTotal ? undefined : data.total,\n firstRow,\n });\n\n /* Whatever the column clipped gets its whole value on hover, decided at hover time, once, from its own overflow:\n the cell, or the line inside it that cuts its own text (a row's name over its detail, a lead mark's body, a\n component's text), which the cell never sees overflow. A long summary ended in \"…\" with no way to read it (G210). */\n const onMouseOver = (e: React.MouseEvent) => {\n if (!(e.target instanceof Element)) return;\n const td = e.target.closest('td') as HTMLTableCellElement | null;\n if (!td) return;\n for (let at: Element | null = e.target; at; at = at === td ? null : at.parentElement) {\n if (at instanceof HTMLElement && at.title) return;\n if (at.scrollWidth > at.clientWidth) {\n (at as HTMLElement).title = at.textContent ?? '';\n return;\n }\n }\n };\n\n if (!rows.length && !(emptyText && data.columns?.length)) {\n /* \"No rows match\" claims a filter did it. On `customer` with no\n conditions, nothing was excluded — the table is empty, which is a\n different thing to be told. */\n const entry = currentEntry();\n const filtered = !entry || entry.kind !== 'table' || entry.query.trim() !== entry.table || Boolean(data.errors?.length);\n return (\n <div className={`table-wrap${compact ? ' grid-compact' : ''}`} ref={wrap}>\n <p className=\"note\">{filtered ? say('noRowsMatch') : say('thisTableIsEmpty')}</p>\n </div>\n );\n }\n\n const inApp = shell().inApp();\n const header = (name: string, index: number) => {\n const meta = byName.get(name);\n const plan = plans.get(name)!;\n const headLabel = labels?.[name] ?? columnLabel(table?.id, name) ?? name;\n /* The width this head's column is actually drawn at: its fitted width\n in a fitted grid, its dragged width in a scrolled one once it has\n one — a scrolled column with no dragged width is drawn by its\n content, so it has no width to say. */\n const appliedWidth = sizing === 'fit' ? colWidths[index] : columnWidths[name];\n /* Sorting from the header is offered only on columns the database can\n sort cheaply: indexed, or small enough that it does not matter. Over an\n API, only on the columns its documented sort values name (`sortable`). */\n const sortable = table\n ? table.sortable\n ? table.sortable.includes(name)\n : !table.indexed || table.indexed.includes(name) || sortableFromHeader(table)\n : false;\n const explicit = language ? (sortDirection(query, name) as 'asc' | 'desc' | null) : null;\n const implied = !explicit && data.order?.implicit ? (data.order.order.find((o) => o.column === name)?.direction ?? null) : null;\n const sorted = explicit ?? implied;\n const pin = lefts.get(name);\n return (\n <th\n key={name}\n scope=\"col\"\n className={`align-${plan.align}${explicit ? ' sorted' : ''}${implied ? ' sorted-default' : ''}${pin !== undefined ? ` pinned${name === lastPinned ? ' pinned-edge' : ''}` : ''}`}\n style={pin !== undefined ? { left: `${pin}px` } : undefined}\n data-col={name}\n /* Alt+arrows move the column, as they move a field in the\n arranger (FieldArranger.tsx): the head already owns its click\n for sorting, so a drag would fight it, and a drag's drop target\n is geometry a test cannot see. */\n onKeyDown={(e) => {\n if (!interactive || !e.altKey || (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight')) return;\n e.preventDefault();\n stepColumn(name, e.key === 'ArrowLeft' ? 'left' : 'right');\n }}\n aria-sort={explicit ? (explicit === 'desc' ? 'descending' : 'ascending') : undefined}\n title={\n implied\n ? `${meta ? `${meta.type} · ` : ''}${say('defaultOrderRowsHaveToCome')}`\n : meta?.type\n ? `${meta.type}${meta.nullable ? '' : ' NOT NULL'}`\n : name\n }\n >\n <span className=\"th-controls\">\n <button\n type=\"button\"\n className={`th-sort${language && !sortable ? ' not-sortable' : ''}`}\n aria-disabled={!language || !sortable}\n /* An App has no statement to edit and no query bar to type into: its words say what is so. */\n title={\n !language\n ? say(inApp ? 'notSortableHere' : 'sortingAResultLike', {\n name,\n })\n : sortable\n ? say('sortBy', { name })\n : table?.sortable\n ? say('theApiDocumentsNoSort', { name })\n : say(inApp ? 'isNotIndexedSortingInApp' : 'isNotIndexedSorting', { name })\n }\n onClick={(e) => {\n if (!language || !sortable) return;\n if (e.shiftKey) sortBy(name, sortDirection(currentEntry()?.query ?? '', name) === 'asc' ? 'desc' : 'asc', true);\n else sortBy(name);\n }}\n >\n <span className=\"th-label\">{headLabel}</span>\n {meta?.primaryKey && <span className=\"pk\">{say('common.key')}</span>}\n {meta?.references && <span className=\"fk\">{REFERENCE_MARK}</span>}\n {sorted && <span className=\"th-arrow\">{sorted === 'desc' ? '↓' : '↑'}</span>}\n </button>\n {/* The column's own order, beside its sort: one step at a time,\n at either edge — and at the edge of the pinned block — the\n step that way is not offered. Quiet until the head is hovered\n or holds focus, and out of the head's flow there (style.css),\n as the filter caret is — a row of marks down every head\n otherwise. The arrows are drawn by the stylesheet, so the\n head's text stays its label. They are out of the tab order: a\n head already costs a stop for its sort, one for its filter and\n one for its resizer, and five per head is sixty Tabs across a\n twelve-column grid. A keyboard moves a column with Alt+arrows\n on the head (below); a pointer and a screen reader's cursor\n still reach the buttons. */}\n {interactive && (\n <span className=\"th-moves\">\n <button\n type=\"button\"\n className=\"th-move th-move-left\"\n tabIndex={-1}\n disabled={!canMove(name, 'left')}\n title={say('moveColumnLeft', { name: headLabel })}\n aria-label={say('moveColumnLeft', { name: headLabel })}\n onClick={(e) => {\n e.stopPropagation();\n stepColumn(name, 'left');\n }}\n />\n <button\n type=\"button\"\n className=\"th-move th-move-right\"\n tabIndex={-1}\n disabled={!canMove(name, 'right')}\n title={say('moveColumnRight', { name: headLabel })}\n aria-label={say('moveColumnRight', { name: headLabel })}\n onClick={(e) => {\n e.stopPropagation();\n stepColumn(name, 'right');\n }}\n />\n </span>\n )}\n {language && appMenu && (\n <AppColumnMenuButton\n host={appMenu}\n name={name}\n label={headLabel}\n kind={plan.kind}\n meta={meta}\n sortable={sortable}\n current={sorted}\n columns={ordered}\n drawnBy={referenceLabels?.[name]}\n />\n )}\n {/* Over an API, only where it documents a filter (`filterable`): a menu the source refuses is a control that lies. */}\n {language && !appMenu && (!table?.filterable || table.filterable.includes(name)) && (\n <button\n type=\"button\"\n className=\"th-filter\"\n title={say('filterOn', { name })}\n aria-label={say('filterOn', { name })}\n onClick={(e) => {\n e.stopPropagation();\n openFilterMenu(e.currentTarget, meta, name, rows, plan);\n }}\n >\n <span className=\"th-filter-icon\" aria-hidden=\"true\" />\n </button>\n )}\n </span>\n {/* The column's width, on its trailing edge: dragged with a\n pointer, stepped with arrow keys, restored with a double-click\n or Alt+Backspace. No transition and no slide: a width lands\n where it is put, so reduced motion needs nothing special. */}\n {interactive && (\n <span\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={say('resizeColumn', { name: headLabel })}\n title={say('resizeColumnHint', { name: headLabel })}\n tabIndex={0}\n className=\"th-resizer\"\n {...(appliedWidth !== undefined ? { 'aria-valuenow': appliedWidth, 'aria-valuemin': MIN_COLUMN_WIDTH } : {})}\n onPointerDown={(e) => {\n if (e.pointerType === 'mouse' && e.button !== 0) return;\n const seed = sizing !== 'fit' && !hasWidthOverrides ? measureDrawn(e.currentTarget) : null;\n resizeDrag.current = {\n name,\n startX: e.clientX,\n startWidth: seed?.[name] ?? appliedWidth ?? colWidths[index] ?? 0,\n hadOverride: name in columnWidths,\n prevWidth: columnWidths[name],\n seed,\n seeded: false,\n };\n try {\n e.currentTarget.setPointerCapture(e.pointerId);\n } catch {\n /* A renderer without capture still delivers the moves to the handle. */\n }\n }}\n onPointerMove={(e) => {\n const drag = resizeDrag.current;\n if (!drag || drag.name !== name) return;\n /* The pointer speaks screen pixels; the column's width\n speaks layout pixels (ruler.ts), so the drag is divided\n by the root's zoom before it becomes a width. */\n const width = drag.startWidth + (e.clientX - drag.startX) / viewportScale();\n if (drag.seed) {\n const seed = drag.seed;\n drag.seed = null;\n drag.seeded = true;\n setColumnWidths({ ...seed, [name]: clampColumnWidth(width) });\n return;\n }\n setColumnWidth(name, width);\n }}\n onPointerUp={() => {\n if (resizeDrag.current?.name === name) resizeDrag.current = null;\n }}\n onPointerCancel={() => {\n const drag = resizeDrag.current;\n if (drag?.name !== name) return;\n resizeDrag.current = null;\n /* A drag that arranged a scrolled grid undoes all of it: the grid goes back to no arrangement. */\n if (drag.seeded) {\n setColumnWidths({});\n return;\n }\n setColumnWidths((current) => {\n const next = { ...current };\n if (drag.hadOverride && drag.prevWidth !== undefined) next[name] = drag.prevWidth;\n else delete next[name];\n return next;\n });\n }}\n onKeyDown={(e) => {\n if (e.altKey && e.key === 'Backspace') {\n e.preventDefault();\n resetColumnWidth(name);\n return;\n }\n if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') return;\n e.preventDefault();\n const seed = sizing !== 'fit' && !hasWidthOverrides ? measureDrawn(e.currentTarget) : null;\n const current = seed?.[name] ?? appliedWidth ?? colWidths[index] ?? 0;\n const width = current + (e.key === 'ArrowRight' ? 1 : -1) * columnResizeStep(e.shiftKey);\n if (seed) setColumnWidths({ ...seed, [name]: clampColumnWidth(width) });\n else setColumnWidth(name, width);\n }}\n onDoubleClick={() => resetColumnWidth(name)}\n />\n )}\n </th>\n );\n };\n\n const colSpan = ordered.length + shift + (trailing ? 1 : 0);\n return (\n <div className={`table-wrap${compact ? ' grid-compact' : ''}${density === 'compact' ? ' grid-dense' : ''}`} ref={wrap}>\n <table\n ref={tableRef}\n onMouseOver={onMouseOver}\n className={useColgroup ? 'grid-fit' : undefined}\n style={useColgroup ? { width: tableWidth } : undefined}\n >\n {useColgroup && (\n <colgroup>\n {slotted && <col style={{ width: GRID_EXPANDER_WIDTH }} />}\n {ordered.map((name, index) => (\n <col key={name} style={{ width: colWidths[index] }} />\n ))}\n {trailing && <col style={{ width: GRID_TRAIL_WIDTH }} />}\n </colgroup>\n )}\n <thead>\n <tr>\n {slotted && (\n <th className=\"expander-cell row-host\" ref={hosts.headRef}>\n {expandable && !virtual && (\n <button\n type=\"button\"\n className={`expander expand-all${expandingAll ? ' working' : ''}`}\n title={anyClosed ? say('expandEveryRow') : say('collapseEveryRow')}\n aria-label={anyClosed ? say('expandEveryRow') : say('collapseEveryRow')}\n aria-expanded={!anyClosed}\n onClick={(e) => {\n e.stopPropagation();\n void expandAll();\n }}\n >\n {anyClosed ? '▸' : '▾'}\n </button>\n )}\n </th>\n )}\n {ordered.map((name, index) => header(name, index))}\n {trailing && (\n <th className=\"row-trail\">\n <span className=\"visually-hidden\">{say('actions')}</span>\n </th>\n )}\n </tr>\n </thead>\n {(() => {\n const body = (\n <tbody>\n {virtual && (\n <tr className=\"virtual-spacer\" aria-hidden=\"true\">\n <td\n colSpan={colSpan}\n style={{\n height: `${padTop}px`,\n padding: 0,\n border: 'none',\n }}\n />\n </tr>\n )}\n {shown.map((i) => {\n const row = modelRows[i];\n if (!row) return null;\n const key = rowKeys[i];\n const open = expandable && key !== null && expanded.has(key);\n return (\n <Row\n key={key === null ? `at:${i}` : `key:${key}`}\n index={i}\n rowKey={key}\n slot={slotted}\n hostRef={key === null ? undefined : hosts.ref(key)}\n trail={trailing}\n trailRef={key === null || !trailHosts ? undefined : trailHosts.ref(key)}\n record={row.original}\n navigable={navigable}\n opensPage={navigable && !onRowClick && !opens}\n onOpen={openOne}\n open={open}\n current={key !== null && key === currentKey}\n changed={changedRows.get(row.original)}\n table={table}\n colSpan={colSpan}\n columns={cellColumns}\n editCell={editCell}\n adornCell={adornCell}\n />\n );\n })}\n {virtual && (\n <tr className=\"virtual-spacer\" aria-hidden=\"true\">\n <td\n colSpan={colSpan}\n style={{\n height: `${padBottom}px`,\n padding: 0,\n border: 'none',\n }}\n />\n </tr>\n )}\n </tbody>\n );\n return photoColumns.length ? (\n <AvatarPhotos columns={photoColumns} rows={rows}>\n {body}\n </AvatarPhotos>\n ) : (\n body\n );\n })()}\n {totals && rows.length > 0 && (\n <tfoot>\n <tr className=\"grid-totals\">\n {slotted && <td className=\"expander-cell\" />}\n {ordered.map((name, index) => {\n if (!Object.hasOwn(totals, name))\n return <td key={name}>{index === 0 && <span className=\"grid-totals-label\">{totalsLabel}</span>}</td>;\n return (\n <td key={name} className=\"align-right num\">\n <TotalValue value={totals[name]} display={columnDisplay(table?.id, name) as DisplayRule | null} />\n </td>\n );\n })}\n {trailing && <td />}\n </tr>\n </tfoot>\n )}\n </table>\n {/* The first decoration: the expander, declared here beside the table\n and portalled into each row's leading cell — the same place and the\n same button it always was, now drawn from outside the row. */}\n {expandable &&\n openable.map((key) => (\n <RowDecoration key={key} rowKey={key} store={hosts}>\n <Expander open={expanded.has(key)} onToggle={() => toggle(key)} />\n </RowDecoration>\n ))}\n {virtual && <p className=\"note virtual-note\">{say('rowsDrawnAsYouScroll', { count: rows.length })}</p>}\n {!rows.length && <p className=\"note grid-empty\">{emptyText}</p>}\n </div>\n );\n}\n\n/**\n * One row, and its detail row when it is open. The leading cell, when the\n * grid draws one, is the row's host: React never gives it children of its\n * own, so what a decoration portals there is left alone by every repaint.\n */\nconst Row = memo(function Row({\n index,\n rowKey,\n slot,\n hostRef,\n trail = false,\n trailRef,\n record,\n navigable,\n opensPage = false,\n onOpen,\n open,\n current = false,\n changed,\n table,\n colSpan,\n columns,\n editCell,\n adornCell,\n}: {\n index: number;\n rowKey: string | null;\n slot: boolean;\n hostRef?: RowHostRef;\n trail?: boolean;\n trailRef?: RowHostRef;\n record: Row;\n navigable: boolean;\n onOpen: (row: Row) => void;\n open: boolean;\n /** The row opens its record (not a caller's own click): a press on it begins reading the record's page (recordCompose.ts). */\n opensPage?: boolean;\n /** The record shown beside the list (a split's detail). */\n current?: boolean;\n /** Another person's change to this row, just announced: which of two tints it wears. */\n changed?: 1 | 2;\n table: TableMeta | undefined;\n colSpan: number;\n columns: CellColumn[];\n editCell?: GridProps['editCell'];\n adornCell?: GridProps['adornCell'];\n}) {\n const photoOf = useContext(AvatarPhotoContext);\n /* A click inside a dialog one of its cells opened reaches the row through\n React's tree, not the page's: only a click on the row opens it. */\n const row = (\n <tr\n className={\n `${navigable ? 'clickable' : ''}${open ? ' expanded' : ''}${current ? ' is-current' : ''}${changed ? ` row-changed-${changed}` : ''}`.trim() ||\n undefined\n }\n aria-current={current ? 'true' : undefined}\n data-row={index}\n data-row-key={rowKey ?? undefined}\n data-opens={opensPage && table ? opensRecord(table.id, keyOf(table, record)) : undefined}\n onClick={\n navigable\n ? (e) => {\n if (e.currentTarget.contains(e.target as Node)) onOpen(record);\n }\n : undefined\n }\n >\n {slot && <td className=\"expander-cell row-host\" ref={hostRef} />}\n {columns.map((column) => (\n <Cell\n key={column.name}\n meta={column.meta}\n plan={column.plan}\n value={column.named ? keyName(column.named, record[column.name]) : record[column.name]}\n label={column.label ? record[column.label] : undefined}\n display={column.display}\n pin={column.pin}\n edge={column.edge}\n wraps={column.wraps}\n more={column.more ? foldedOf(column.more, record) : undefined}\n sub={column.subtitle && Object.hasOwn(record, column.subtitle) ? record[column.subtitle] : undefined}\n currency={column.currency ? record[column.currency] : undefined}\n open={(column.display as DisplayRule | null)?.format === 'relative' && dueOpen(table?.id, column.name, record) ? true : undefined}\n lead={leadOf(column, record)}\n name={column.name}\n editCell={editCell}\n adornCell={adornCell}\n record={editCell || adornCell ? record : undefined}\n photo={column.photoOwner ? photoOf(column.name, record[column.photoOwner]) : undefined}\n row={column.display?.component ? record : undefined}\n table={table?.id}\n />\n ))}\n {trail && <td className=\"row-trail\" ref={trailRef} />}\n </tr>\n );\n if (!open || !table) return row;\n return (\n <>\n {row}\n {/* Its grids publish nowhere: a presentation decorating this grid must\n never find a nested row under one of its keys. */}\n <RowHostScope store={null}>\n <RowTrailScope store={null}>\n <DetailRow table={table} row={record} colSpan={colSpan} grid={Grid} />\n </RowTrailScope>\n </RowHostScope>\n </>\n );\n});\n","/** What RecordSummaries says, in the record page room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({});\n","import type { ReactNode } from 'react';\nimport { useMessageLanguage } from './useMessageLanguage.js';\nimport { columnLabel, keyOf, labelPath, openRecord, recordLabel, rowLabel, state } from '../core.js';\nimport { opensRecord } from '../recordIntent.js';\nimport { humanName } from '@mistriwork/engine/shared/model.js';\nimport { primaryKey, type TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport type { TrailList } from '../recordTrail.js';\nimport { Value } from './Value.js';\nimport { rowOpensTarget, useRowOpens } from './rowOpens.js';\nimport type { GridData } from './Grid.js';\nimport { presentationColumns } from './columnPresentation.js';\nimport { splitConditions, splitQuery } from '../clauses.js';\nimport { say } from '../copy/record/components/RecordSummaries.js';\n\n/**\n * The columns a question holds to one value (`status = new`, a tab's own\n * condition): every record the list shows says the same there, so a summary\n * that repeats it on each is a line spent saying nothing. Only a whole\n * condition of one literal counts; `a or b`, a range or a window phrase does not.\n */\nexport function fixedColumns(query: string | undefined): string[] {\n if (!query) return [];\n return splitConditions(splitQuery(query).filter).flatMap((condition: string) => {\n const match = /^([\\w.]+)\\s*=\\s*(\"[^\"]*\"|'[^']*'|[\\w.-]+)$/.exec(condition.trim());\n return match ? [match[1]] : [];\n });\n}\n\n/** The authored column order is the mobile priority; state remains visible. */\nexport function summaryColumns(table: TableMeta, columns: string[]): string[] {\n const naming = labelPath(table);\n const keys = primaryKey(table);\n const facts = columns.filter((name) => name !== naming && !keys.includes(name));\n const state = facts.filter((name) => /^(status|stage|priority)$/.test(name));\n return [...new Set([...state, ...facts])].slice(0, 4);\n}\n\n/**\n * The column a link row is titled by, where it has no title of its own: the\n * name of the row it links to that is not the record it is listed under. A\n * campaign's member row (`campaign_id`, `lead_id`, a date, a flag) on a\n * lead's page was a card titled \"6\" — its key — over a \"Campaign\" line that\n * named it; it is the campaign's card there. `parent` names the reference\n * to the record the list is under (and every column the list holds to one\n * value is one too), so it is never the title. Null where the row names\n * itself, or nothing shown names a row it links to.\n */\nexport function linkTitleColumn(\n table: TableMeta,\n columns: string[],\n parent: string[],\n referenceLabels?: Record<string, string>,\n): string | null {\n if (recordLabel(table) !== undefined) return null;\n const naming = labelPath(table);\n if (naming && !primaryKey(table).includes(naming)) return null;\n const links = table.columns.filter((column) => column.references && !parent.includes(column.name)).map((column) => column.name);\n for (const link of links) {\n if (referenceLabels?.[link] && columns.includes(link)) return link;\n const path = columns.find((name) => name.startsWith(`${link}.`) && !name.slice(link.length + 1).includes('.'));\n if (path) return path;\n }\n return null;\n}\n\n/**\n * The columns a summary says under its title: the page's columns less what the question fixes, the link that titles\n * the row, and any column whose value *is* the title on every row. A record named by a template of one column\n * (`recordLabel: '{title}'`) reaches `labelPath` as the template, not the column, so the column was listed again under\n * its own name, as \"Title Outlet not working\" below \"Outlet not working\". A reference is compared by the name it is\n * drawn as (`referenceLabels`), not by its key: a lease titled \"Alder Court #406\" listed \"Home\" with the same words.\n */\nfunction shownValue(row: Record<string, unknown>, name: string, referenceLabels?: Record<string, string>): string {\n const label = referenceLabels?.[name];\n return String((label ? row[label] : row[name]) ?? '');\n}\n\nfunction summaryFacts(\n table: TableMeta,\n columns: string[],\n rows: Array<Record<string, unknown>>,\n titles: string[],\n skip: string[],\n referenceLabels?: Record<string, string>,\n): string[] {\n const echoes = (name: string) => rows.length > 0 && rows.every((row, i) => shownValue(row, name, referenceLabels) === titles[i]);\n return summaryColumns(\n table,\n columns.filter((name) => !skip.includes(name) && !echoes(name)),\n );\n}\n\n/**\n * Whether the table has anything the summaries leave out, which is the only reason to offer the Table beside them\n * (TableView): the summaries say four facts under a title, so a list of more has a wider reading, and a list of\n * fewer has the same one in two dresses.\n */\nexport function tableSaysMore(\n table: TableMeta,\n columns: string[],\n rows: Array<Record<string, unknown>>,\n query?: string,\n referenceLabels?: Record<string, string>,\n): boolean {\n const titles = rows.map((row) => String(rowLabel(table, row) ?? ''));\n const fixed = fixedColumns(query);\n const said = summaryFacts(table, columns, rows, titles, fixed, referenceLabels);\n const keys = primaryKey(table);\n const naming = labelPath(table);\n return columns.some(\n (name) =>\n !said.includes(name) &&\n !fixed.includes(name) &&\n !keys.includes(name) &&\n name !== naming &&\n !rows.every((row, i) => shownValue(row, name, referenceLabels) === titles[i]),\n );\n}\n\nexport function RecordSummaries({\n table,\n data,\n columns,\n labels,\n referenceLabels,\n list,\n recordForRow,\n query,\n parent,\n adornFact,\n}: {\n table: TableMeta;\n data: GridData;\n columns: string[];\n labels?: Record<string, string>;\n /** The list's question: a column it holds to one value is left out of every summary (fixedColumns). */\n query?: string;\n /** Joined names already carried by the list query; raw values remain keys. */\n referenceLabels?: Record<string, string>;\n /** The list these rows are a page of, so a record opened here steps past the page (recordTrail.ts). */\n list?: TrailList;\n /** Related projections can alias primary keys and the record's naming path. */\n recordForRow?: (row: Record<string, unknown>) => {\n key: Record<string, unknown> | null;\n label: string;\n };\n /** The reference to the record this list is under, on a record's page (linkTitleColumn). */\n parent?: string;\n /**\n * What the host draws for an empty fact in place of its empty mark (a suggestion waiting on it, the shell's\n * `useCellMarks` in its summary form); undefined leaves the mark. It stands in the mark's own box: a fact's line\n * wraps, so anything wider arriving later would move the facts after it.\n */\n adornFact?: (row: Record<string, unknown>, column: string) => ReactNode | undefined;\n}) {\n useMessageLanguage();\n const fixed = fixedColumns(query);\n const linkTitle = linkTitleColumn(table, columns, [...fixed, ...(parent ? [parent] : [])], referenceLabels);\n const linked = (row: Record<string, unknown>) => {\n const value = linkTitle ? (referenceLabels?.[linkTitle] ? row[referenceLabels[linkTitle]] : row[linkTitle]) : undefined;\n return value == null || String(value) === '' ? undefined : String(value);\n };\n /* A list whose rows open what they are about (a view's `opens`) opens that from a summary too, alone. */\n const opens = useRowOpens();\n const items = (data.rows ?? []).map((row) => {\n const target = opens && !recordForRow ? rowOpensTarget(table, row, opens) : undefined;\n if (target !== undefined)\n return {\n row,\n opensTable: target?.table,\n key: target?.key ?? null,\n label: linked(row) ?? target?.label ?? '',\n };\n const record = recordForRow?.(row) ?? {\n key: keyOf(table, row) as Record<string, unknown> | null,\n label: rowLabel(table, row) as string,\n };\n return {\n row,\n opensTable: undefined as string | undefined,\n ...record,\n label: linked(row) ?? record.label,\n };\n });\n const facts = summaryFacts(\n table,\n columns,\n items.map(({ row }) => row),\n items.map(({ label }) => label),\n [...fixed, ...(linkTitle ? [linkTitle] : [])],\n referenceLabels,\n );\n const metadata = presentationColumns(state.schema, table, facts);\n const records = items.flatMap(({ key, label }) => (key ? [{ key, label }] : []));\n const trail = opens ? {} : { records, list };\n return (\n <ul className=\"record-summaries\" aria-label={say('common.records')}>\n {items.map(({ row, key, label: title, opensTable }, index) => {\n return (\n <li\n key={key ? JSON.stringify(key) : index}\n className={`record-summary${key ? ' is-navigable' : ''}`}\n data-opens={key ? opensRecord(opensTable ?? table.id, key) : undefined}\n onClick={(event) => {\n // The title remains the keyboard target; nested controls own their clicks.\n if (\n !key ||\n (event.target as Element).closest('button, a, input, select, textarea, summary, [role=\"button\"], [contenteditable=\"true\"]')\n )\n return;\n if (window.getSelection()?.isCollapsed === false) return;\n void openRecord(opensTable ?? table.id, key, title, 'push', trail);\n }}\n >\n <button\n type=\"button\"\n className=\"record-summary-title\"\n disabled={!key}\n onClick={() => {\n if (key) void openRecord(opensTable ?? table.id, key, title, 'push', trail);\n }}\n >\n {title}\n </button>\n <dl>\n {facts.map((name) => {\n const label = referenceLabels?.[name] ? row[referenceLabels[name]] : undefined;\n const col = metadata.get(name) ?? {\n name,\n type: 'TEXT',\n nullable: true,\n primaryKey: false,\n };\n const value = label ?? row[name];\n const adorned = adornFact && (value === null || value === undefined || value === '') ? adornFact(row, name) : undefined;\n return (\n <div key={name}>\n <dt>{labels?.[name] ?? columnLabel(table.id, name) ?? humanName(name)}</dt>\n <dd>\n {adorned ?? <Value tableId={table.id} col={label == null ? col : { ...col, type: 'TEXT' }} value={value} compact />}\n </dd>\n </div>\n );\n })}\n </dl>\n </li>\n );\n })}\n </ul>\n );\n}\n","/** What RowActions says, in the lists and grid room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({});\n","/**\n * A row's own menu: the record's actions, as its page offers them, from a ⋯\n * at the end of the row — the trailing host, so the grid is not told.\n *\n * Nothing is asked until the menu is opened: a list of twenty rows is not\n * sixty condition reads. The first press mounts that record's action bar in\n * its menu-only mode, so a verb here is the same verb as on the page — its\n * condition judged by the server, its confirmation, its command form, its\n * Undo — and choosing one never opens the row.\n */\nimport { shell } from '../shellMode.js';\nimport { useState } from 'react';\nimport type { TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport type { AppAction } from '@mistriwork/engine/schema/model.js';\nimport { keyOf, rowLabel, state, writeAllowed } from '../core.js';\nimport { grantedActionIds } from '../actionGrants.js';\nimport { bulkKey } from '../bulkActions.js';\nimport { rootMatches } from './pageModel.js';\nimport { RowDecoration, useRowTrailScope } from './RowHost.js';\nimport { say } from '../copy/lists/components/RowActions.js';\n\nfunction RowMenu({\n table,\n record,\n label,\n actions,\n onDone,\n}: {\n table: TableMeta;\n record: Record<string, unknown>;\n label: string;\n actions: AppAction[];\n onDone: () => void;\n}) {\n const [armed, setArmed] = useState(false);\n const [open, setOpen] = useState(false);\n /* The verbs are the App's (Actions.tsx), drawn through the shell's slot: a shell with none has no menu to offer. */\n const { ActionBar } = shell().slots;\n if (!ActionBar) return null;\n if (!armed) {\n return (\n <button\n type=\"button\"\n className=\"ghost row-actions-trigger\"\n aria-label={say('common.actions', { label })}\n title={say('common.actions', { label })}\n aria-haspopup=\"menu\"\n onClick={(event) => {\n event.stopPropagation();\n setArmed(true);\n setOpen(true);\n }}\n >\n ⋯\n </button>\n );\n }\n const connection = state.activeConnection ?? undefined;\n return (\n <span className=\"row-actions\" onClick={(event) => event.stopPropagation()}>\n <ActionBar\n tableId={table.id}\n actions={actions}\n recordKey={record}\n label={label}\n matches={(when) => rootMatches(table, record, when, connection)}\n canUpdate={writeAllowed(table.id)}\n grantedCommands={shell().app()?.grantedCommands ?? []}\n grantedActions={grantedActionIds(shell().app(), table.id)}\n menuOnly={{ label, open, onOpenChange: setOpen }}\n onDone={onDone}\n />\n </span>\n );\n}\n\nexport function RowActions({\n table,\n rows,\n actions,\n onDone,\n}: {\n table: TableMeta;\n rows: Array<Record<string, unknown>>;\n actions: AppAction[];\n onDone: () => void;\n}) {\n const store = useRowTrailScope();\n if (!store) return null;\n return (\n <>\n {rows.map((row) => {\n const key = keyOf(table, row) as Record<string, unknown> | null;\n if (!key) return null;\n const id = bulkKey(table, key);\n const label = String(rowLabel(table, row) ?? say('common.untitled'));\n return (\n <RowDecoration key={id} rowKey={id} store={store}>\n <RowMenu table={table} record={key} label={label} actions={actions} onDone={onDone} />\n </RowDecoration>\n );\n })}\n </>\n );\n}\n","/**\n * A successful empty list explains what belongs here and offers an available\n * next room — as the one empty block (Notes.tsx), at body size on the list's\n * edge. It was a heading at the list title's size, louder than the section\n * it stood in.\n */\nimport type { AppListEmpty } from '@mistriwork/engine/shared/listPresentations.js';\nimport { useListNavigation } from './listNavigation.js';\nimport { Empty } from './Notes.js';\n\nexport function ListEmpty({ spec }: { spec: AppListEmpty }) {\n const navigate = useListNavigation();\n const link = spec.action ? navigate?.(spec.action.view, 'reset') : undefined;\n return (\n <Empty\n className=\"list-empty\"\n text={<span className=\"empty-note-title\">{spec.title}</span>}\n detail={spec.description}\n action={spec.action && link ? <a {...link}>{spec.action.label}</a> : undefined}\n />\n );\n}\n","/**\n * Where a call to action that names one of the App's views goes, as a link\n * a reader can also open in a new tab. A list or a dashboard the App serves\n * this reader is followed in place, through the walk, and so is a signed-in\n * form, which is a room of its own (`form-<key>`). A public form is not\n * among those — it is served at its own address, outside the App — so its\n * link is that address. A list's link is its key, `/thread/board`, and a\n * dashboard's its own, `/compass/sales-dashboard`: the address bar's once\n * followed (publicAddress.ts).\n */\nimport type { MouseEvent } from 'react';\nimport { shell } from '../shellMode.js';\nimport { go, pageView, state, tableView } from '../core.js';\nimport { hashFor } from '../deeplink.js';\nimport { tabSlug } from '@mistriwork/engine/shared/addressParams.js';\nimport { appListQuery } from './appListModel.js';\nimport { dashPageId, isListRoom, roomPageId, viewRoom } from './appRooms.js';\nimport { registerViewOpener } from '../uiBridge.js';\nimport { shown } from '../addressMount.js';\n\nexport interface ViewLink {\n href: string;\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\n/** A walk entry as a link a reader can also open in a new tab: its address, and the walk followed in place. */\nfunction linkTo(entry: Parameters<typeof go>[0], mode: 'push' | 'reset'): ViewLink {\n const connection = state.activeConnection ?? null;\n /* The App's addresses are the shell's answer (shellMode.ts): a link names one of the App's views, so it is drawn\n where the App shell is. */\n const addresses = shell().addresses;\n return {\n // The walk's own form only where the App's book has no word for it (an App not yet loaded).\n href: shown(\n (connection ? addresses?.address(connection, [entry]) : undefined) ??\n hashFor(connection, [entry], { listParams: addresses?.listParams }),\n ),\n onClick: (event) => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n event.preventDefault();\n go(entry, mode);\n },\n };\n}\n\n/** A list, dashboard or signed-in form this reader is served, by key. `adding` opens a list with its New form over it (`…!new`). */\nexport function viewLink(key: string, mode: 'push' | 'reset' = 'push', adding = false): ViewLink | undefined {\n const app = shell().app() as Parameters<typeof viewRoom>[0] | null;\n const room = app ? viewRoom(app, key) : undefined;\n if (!room) return undefined;\n const entry = isListRoom(room)\n ? { ...tableView(room.table, appListQuery(room, 0), adding ? 'new' : undefined), view: key }\n : pageView(roomPageId(room) ?? dashPageId(key));\n return linkTo(entry, mode);\n}\n\n/**\n * One of the App's lists on a refinement of its rows, as a dashboard group opens it: the list's own parameter where\n * it offers the column as a filter (`?status=approved`), `q=` for what those cannot say. Undefined for a key this\n * reader is served no list under, so a caller never falls back to the table's raw rows.\n */\nexport function listEntry(key: string, query: string): Parameters<typeof go>[0] | undefined {\n const app = shell().app() as Parameters<typeof viewRoom>[0] | null;\n const room = app ? viewRoom(app, key) : undefined;\n return room && isListRoom(room) && !room.error ? { ...tableView(room.table, query), view: key } : undefined;\n}\n\nexport function listLink(key: string, query: string): ViewLink | undefined {\n const entry = listEntry(key, query);\n return entry ? linkTo(entry, 'push') : undefined;\n}\n\n/** Follow a list or dashboard this reader is served, as its link would; false when the key names none. */\nfunction openView(key: string, options: { tab?: string; search?: string; filters?: Readonly<Record<string, string>> } = {}): boolean {\n const app = shell().app() as Parameters<typeof viewRoom>[0] | null;\n const room = app ? viewRoom(app, key) : undefined;\n if (!room) return false;\n if (!isListRoom(room)) {\n go(pageView(dashPageId(key)));\n return true;\n }\n /* A tab, a search and filters are the words an address says (publicAddress.ts addressQuestion), so a list\n opened here is the list that address opens: the same tab lit, the same boxes filled. */\n const params = new URLSearchParams();\n if (options.tab) params.set('tab', tabSlug(options.tab));\n if (options.search) params.set('search', options.search);\n for (const [column, value] of Object.entries(options.filters ?? {})) params.set(column, value);\n const asked = params.size ? (shell().addresses?.viewEntry(key, params.toString()) as Parameters<typeof go>[0] | null) : null;\n go(asked ?? { ...tableView(room.table, appListQuery(room, 0)), view: key });\n return true;\n}\nregisterViewOpener(openView);\n\n/** A public form's own page: `/{app}/form/{key}`. */\nexport function formLink(key: string): ViewLink {\n return { href: shown(`/${encodeURIComponent(state.activeConnection ?? '')}/form/${encodeURIComponent(key)}`) };\n}\n","/** A dashboard note is authored guidance, with at most one available next room. */\nimport type { AppIconName } from '@mistriwork/engine/shared/appIcons.js';\nimport { Icon } from './Icon.js';\nimport { useListNavigation } from './listNavigation.js';\nimport type { AppLinkAction } from '@mistriwork/engine/shared/appLinks.js';\nimport { shell } from '../shellMode.js';\n\ninterface DashboardNoteProps {\n title?: string;\n text: string;\n icon?: AppIconName;\n action?: AppLinkAction;\n row?: Readonly<Record<string, unknown>>;\n /** A page's note is plain, quiet or a callout; a dashboard's may be its banner. */\n variant?: 'quiet' | 'callout' | 'banner';\n /** A banner's short tag over its title. */\n eyebrow?: string;\n /** A banner's picture, already an address. */\n image?: { src: string; alt: string };\n}\n\nexport function DashboardNote({ title, text, icon, action, row, variant, eyebrow, image }: DashboardNoteProps) {\n /* The shell's navigation, not viewLink itself: a record page draws notes\n too, and viewLink reaches back into the page modules through the walk. */\n const navigate = useListNavigation();\n /* A call to action into another App of the suite is the App framework's (shellMode.ts): none where the shell has none. */\n const { TargetAction } = shell().slots;\n const link = action && 'view' in action ? navigate?.(action.view) : undefined;\n const paragraphs = text\n .split(/\\n\\s*\\n/)\n .map((paragraph) => paragraph.trim())\n .filter(Boolean);\n const words = (\n <>\n {icon && <Icon name={icon} size={28} className=\"dashboard-note-icon\" />}\n {eyebrow && <span className=\"dashboard-note-eyebrow\">{eyebrow}</span>}\n {title && <h2 className=\"dashboard-note-title\">{title}</h2>}\n {paragraphs.map((paragraph, index) => (\n <p key={index} className=\"dashboard-note-text\">\n {paragraph}\n </p>\n ))}\n {action && link && (\n <a className=\"dashboard-note-action\" {...link}>\n {action.label}\n {variant === 'banner' && <Icon name=\"caret-right\" size={14} />}\n </a>\n )}\n {action && 'to' in action && TargetAction && <TargetAction label={action.label} to={action.to} row={row} />}\n </>\n );\n /* A banner's words and its picture are two columns; the picture is sized by the banner, never by its file, so\n it arriving moves nothing. */\n if (variant === 'banner')\n return (\n <div className={`dashboard-note is-banner${image ? ' has-image' : ''}`}>\n <div className=\"dashboard-note-words\">{words}</div>\n {image && (\n <span className=\"dashboard-note-picture\">\n <img src={image.src} alt={image.alt} decoding=\"async\" />\n </span>\n )}\n </div>\n );\n return <div className={`dashboard-note${variant ? ` is-${variant}` : ''}`}>{words}</div>;\n}\n"],"ignoreList":[0,6,7,8,9,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAa,YAAyB,sBAAM,WAAW,SAAS,mBAAmB,gBAAgB,cAAc;CAC/G,MAAM,EACJ,WACA,QACA,cAAc,cACd,OACA,GAAG,iBACD;CAYJ,OARgB,iBAAiB,OAAO,gBAAgB;EACtD,OAAA,EAHA,YAGI;EACJ,KAAK;EACL,OAAO,CAAC;GACN,MAAM;GACN,oBAAoB;EACtB,GAAG,YAAY;CACjB,CACa;AACf,CAAC;AACD,IAAA,QAAA,I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AM,MAAM;GAAI,WAAU;EAAuB,CAAA;EACrE,WAAW,oBAAC,QAAD;GAAM,WAAU;GAA0B,UAAA;EAAc,CAAA;EACnE,SAAS,oBAAC,MAAD;GAAI,WAAU;GAAwB,UAAA;EAAU,CAAA;EACzD,WAAW,KAAK,WAAW,UAC1B,oBAAC,KAAD;GAAe,WAAU;GACtB,UAAA;EACA,GAFK,KAEL,CACJ;EACA,UAAU,QACT,qBAAC,KAAD;GAAG,WAAU;GAAwB,GAAI;GAAzC,UAAA,CACG,OAAO,OACP,YAAY,YAAY,oBAAC,MAAD;IAAM,MAAK;IAAc,MAAM;GAAK,CAAA,CAC5D;;EAEJ,UAAU,QAAQ,UAAU,gBAAgB,oBAAC,cAAD;GAAc,OAAO,OAAO;GAAO,IAAI,OAAO;GAAS;EAAM,CAAA;CAC1G,EAAA,CAAA;CAIJ,IAAI,YAAY,UACd,OACE,qBAAC,OAAD;EAAK,WAAW,2BAA2B,QAAQ,eAAe;EAAlE,UAAA,CACE,oBAAC,OAAD;GAAK,WAAU;GAAwB,UAAA;EAAW,CAAA,GACjD,SACC,oBAAC,QAAD;GAAM,WAAU;GACd,UAAA,oBAAC,OAAD;IAAK,KAAK,MAAM;IAAK,KAAK,MAAM;IAAK,UAAS;GAAS,CAAA;EACnD,CAAA,CAEL;;CAET,OAAO,oBAAC,OAAD;EAAK,WAAW,iBAAiB,UAAU,OAAO,YAAY;EAAO,UAAA;CAAW,CAAA;AACzF"}
1
+ {"version":3,"file":"shared-XcSKDp6N.js","names":["say","say","memo","memo","useIsomorphicLayoutEffect","React","say","say","say","say","say","_Fragment","sayCopy","_Fragment","say","say","Menu.Root","Menu.Portal","Menu.Positioner","Menu.Popup","Menu.Separator","Menu.Item","memo","say","say","_Fragment","say","say","say","JsonView","_Fragment","say","say","say","_Fragment","namingColumn","say","say","_Fragment","_Fragment"],"sources":["../../../../node_modules/@base-ui/react/separator/Separator.mjs","../../../kit/src/client/pins.js","../../../kit/src/client/components/columnPresentation.ts","../../../kit/src/client/copy/lists/components/placeOrder.ts","../../../kit/src/client/components/placeOrder.ts","../../../kit/src/client/components/RowHost.tsx","../../../../node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js","../../../../node_modules/@tanstack/virtual-core/dist/esm/utils.js","../../../../node_modules/@tanstack/virtual-core/dist/esm/index.js","../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js","../../../engine/src/shared/dashboardAsks.ts","../../../kit/src/client/copy/dashboards/components/dashboardModel.ts","../../../kit/src/client/components/dashboardModel.ts","../../../kit/src/client/components/textMeasure.ts","../../../kit/src/client/copy/dashboards/breakdownBatch.ts","../../../kit/src/client/breakdownBatch.ts","../../../kit/src/client/copy/columnMenu/components/AppColumnMenu.ts","../../../kit/src/client/components/AppColumnMenu.tsx","../../../kit/src/client/nested.js","../../../kit/src/client/components/PresentationSwitch.tsx","../../../kit/src/client/compose.js","../../../kit/src/client/copy/columnMenu/components/ThMenu.ts","../../../kit/src/client/components/ThMenu.tsx","../../../kit/src/client/thmenu.js","../../../../node_modules/@tanstack/react-table/dist/FlexRender.js","../../../../node_modules/@tanstack/store/dist/shallow.js","../../../../node_modules/@tanstack/react-table/dist/Subscribe.js","../../../../node_modules/@tanstack/table-core/dist/core/reactivity/coreReactivityFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/reactivity/renderPhaseReactivity.js","../../../../node_modules/@tanstack/react-table/dist/reactivity.js","../../../../node_modules/@tanstack/table-core/dist/utils.js","../../../../node_modules/@tanstack/table-core/dist/core/cells/coreCellsFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/cells/coreCellsFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/headers/constructHeader.js","../../../../node_modules/@tanstack/table-core/dist/features/column-pinning/columnPinningFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/features/column-visibility/columnVisibilityFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/headers/buildHeaderGroups.js","../../../../node_modules/@tanstack/table-core/dist/core/columns/constructColumn.js","../../../../node_modules/@tanstack/table-core/dist/features/column-ordering/columnOrderingFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/columns/coreColumnsFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/columns/coreColumnsFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/headers/coreHeadersFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/headers/coreHeadersFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/rows/constructRow.js","../../../../node_modules/@tanstack/table-core/dist/features/cell-selection/cellSelectionFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/features/row-expanding/rowExpandingFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/features/row-pagination/rowPaginationFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/features/row-sorting/rowSortingFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/row-models/createCoreRowModel.js","../../../../node_modules/@tanstack/table-core/dist/core/row-models/coreRowModelsFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/row-models/coreRowModelsFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/cells/constructCell.js","../../../../node_modules/@tanstack/table-core/dist/core/rows/coreRowsFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/rows/coreRowsFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/table/coreTablesFeature.utils.js","../../../../node_modules/@tanstack/table-core/dist/core/table/coreTablesFeature.js","../../../../node_modules/@tanstack/table-core/dist/core/coreFeatures.js","../../../../node_modules/@tanstack/table-core/dist/helpers/columnHelper.js","../../../../node_modules/@tanstack/table-core/dist/helpers/tableFeatures.js","../../../../node_modules/@tanstack/table-core/dist/core/table/constructTable.js","../../../../node_modules/@tanstack/react-table/dist/useTable.js","../../../kit/src/client/copy/lists/components/Nested.ts","../../../kit/src/client/components/Nested.tsx","../../../kit/src/client/components/useGridKeyboard.ts","../../../kit/src/client/components/usePins.ts","../../../kit/src/client/components/useStickyHead.ts","../../../kit/src/client/components/gridSizing.ts","../../../kit/src/client/components/gridArrange.ts","../../../kit/src/client/copy/shell/visualTheme.ts","../../../engine/src/shared/themeFaces.ts","../../../kit/src/client/visualTheme.ts","../../../kit/src/client/copy/record/components/JsonPreview.ts","../../../kit/src/client/components/JsonPreview.tsx","../../../kit/src/client/copy/lists/components/Grid.ts","../../../kit/src/client/components/rowOpens.ts","../../../kit/src/client/components/Grid.tsx","../../../kit/src/client/copy/record/components/RecordSummaries.ts","../../../kit/src/client/components/RecordSummaries.tsx","../../../kit/src/client/copy/lists/components/RowActions.ts","../../../kit/src/client/components/RowActions.tsx","../../../kit/src/client/components/ListEmpty.tsx","../../../kit/src/client/components/viewLink.ts","../../../kit/src/client/components/DashboardNote.tsx"],"sourcesContent":[null,"/**\n * Columns that stay put when a wide table scrolls sideways.\n *\n * A twenty-seven column table is wider than any window, so reading the right\n * of it means scrolling the left of it away — and the left of it is where the\n * key and the name live. Three columns in you are looking at values with\n * nothing to attach them to, and the only way back is to scroll left, read the\n * name, and scroll right again holding it in your head.\n *\n * Pinning is the fix every spreadsheet arrived at, and the reason it belongs\n * here rather than in a preference nobody finds is that tablewalk already knows\n * which columns identify a row: the primary key, and the label column it uses\n * for breadcrumbs. Those are pinned without being asked for, on tables wide\n * enough to need it, and anything else is one click in the column menu.\n *\n * What is pinned lives here; how it is frozen in place is the grid's\n * (components/usePins.ts), which measures the columns after layout.\n */\nimport { labelColumn, loadJson, primaryKey, saveJson, state } from './core.js';\n\nconst KEY = 'mistri.pins.v1';\n\n/**\n * Below this many columns, pinning is a border and a shadow for no gain.\n *\n * The number is about the *window* rather than the table: eight columns of\n * ordinary width fit, and the ones that do not are exactly the tables where\n * losing the key hurts.\n */\nconst WIDE_ENOUGH = 8;\n\nconst connectionKey = () => state.activeConnection ?? 'default';\n\n/* An App list keeps its own pins, apart from its table's: two views over one\n table are two lists a reader arranges separately. The store is the\n browser's, scoped to the signed-in account (captureScopedStorage), so a\n pin is one reader's arrangement and never what another reader sees. */\nconst storeKey = (table, list) => (list ? `list:${list}` : table.id);\n\nfunction stored() {\n return loadJson(KEY, {})[connectionKey()] ?? {};\n}\n\n/* A pin changed: the grid that reads them draws again (useSyncExternalStore). */\nlet version = 0;\nconst listeners = new Set();\nexport const pinsVersion = () => version;\n/** @param {() => void} listener */\nexport function subscribePins(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\n/**\n * The columns pinned for a table: what was chosen, or what identifies a row.\n *\n * The derived default is not written to storage. Storing it would freeze\n * today's guess against a schema that may gain a better label column, and it\n * would make \"I have never touched this\" indistinguishable from \"I chose\n * exactly this\".\n *\n * @param {any} table\n * @param {string[]} columns\n * @param {string} [list] An App list's key: its own pins rather than its table's.\n * @returns {string[]}\n */\nexport function pinnedFor(table, columns, list) {\n if (!table) return [];\n const chosen = stored()[storeKey(table, list)];\n if (chosen) return chosen.filter((c) => columns.includes(c));\n if (columns.length < WIDE_ENOUGH) return [];\n\n const key = primaryKey(table);\n const label = labelColumn(table);\n const wanted = [...key, ...(label && !key.includes(label) ? [label] : [])];\n return wanted.filter((c) => columns.includes(c));\n}\n\n/**\n * @param {any} table\n * @param {string[]} columns\n * @param {string} name\n * @param {string} [list]\n */\nexport function togglePin(table, columns, name, list) {\n if (!table) return;\n const current = pinnedFor(table, columns, list);\n const next = current.includes(name) ? current.filter((c) => c !== name) : [...current, name];\n\n /* Kept in column order rather than the order they were pinned in. Pinned\n columns are rendered as a block on the left, and a block whose internal\n order differs from the table's is a second thing to reconcile every time\n you read it. */\n const ordered = columns.filter((c) => next.includes(c));\n\n const all = loadJson(KEY, {});\n all[connectionKey()] = { ...(all[connectionKey()] ?? {}), [storeKey(table, list)]: ordered };\n saveJson(KEY, all);\n version += 1;\n for (const listener of [...listeners]) listener();\n}\n","import { TAGS_COLUMN, tagsColumnMeta } from '@mistriwork/engine/shared/tagLists.js';\nimport type { ColumnMeta, DatabaseSchema, TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport { resolvePath } from '@mistriwork/engine/shared/view.js';\nimport { rollupColumnMeta } from '@mistriwork/engine/shared/rollups.js';\nimport { computedColumnMeta } from '@mistriwork/engine/shared/computed.js';\n\ntype PresentationColumn = ColumnMeta & { sourceName?: string; identifier?: boolean };\n\n/** Dotted projections retain their source type without becoming the base row's key. */\nexport function presentationColumns(\n schema: DatabaseSchema | undefined,\n table: TableMeta | undefined,\n paths: readonly string[],\n): Map<string, PresentationColumn> {\n const columns = new Map<string, PresentationColumn>((table?.columns ?? []).map((column) => [column.name, column]));\n if (!schema || !table) return columns;\n for (const path of paths) {\n /* A rollup of the table itself (rollups.ts) is named without a dot, and\n read-only like every summary: its type is how it dresses. */\n const rollup = !path.includes('.') && table.rollups && Object.hasOwn(table.rollups, path) ? table.rollups[path] : undefined;\n if (rollup && !columns.has(path)) {\n columns.set(path, { ...rollupColumnMeta(path, rollup), identifier: false });\n continue;\n }\n // A computed column of the table, likewise (computed.ts).\n const computed = !path.includes('.') && table.computed && Object.hasOwn(table.computed, path) ? table.computed[path] : undefined;\n if (computed && !columns.has(path)) {\n columns.set(path, { ...computedColumnMeta(path, computed), identifier: false });\n continue;\n }\n // A record's tags (tagLists.ts): chips in a cell, a checklist in a facet.\n if (path === TAGS_COLUMN && table.tags && !columns.has(path)) {\n columns.set(path, { ...tagsColumnMeta(), identifier: false });\n continue;\n }\n if (columns.has(path) || !path.includes('.')) continue;\n try {\n const resolved = resolvePath(schema, table.id, path);\n columns.set(path, {\n ...resolved.column,\n name: path,\n sourceName: resolved.column.name,\n identifier: Boolean(resolved.column.primaryKey || resolved.column.references),\n primaryKey: false,\n nullable: true,\n });\n } catch {\n // An arbitrary result alias is not necessarily a schema path.\n }\n }\n return columns;\n}\n","/** What placeOrder says, in the lists and grid room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n moveToTop: 'Move to top',\n moveToBottom: 'Move to bottom',\n});\n","/**\n * A record's place among its neighbors, for every run a reader arranges by\n * hand — a board's lane (BoardList) and a list with an `order` column\n * (useListOrder) — so the two can never number, or save, differently.\n */\n\n/* A run renumbered is numbered this far apart, so the next many moves each\n find a number between their neighbors and write the one record. */\nimport { say } from '../copy/lists/components/placeOrder.js';\n\nexport const STEP = 1024;\n\n/**\n * The writes that give a record its new place, as few as the numbers allow:\n * the one record, halfway between its new neighbors (a step past the end one\n * at either end of the run). Only when there is no number between them — two\n * whole numbers side by side, a fraction halved away to nothing, or a\n * neighbor with no place yet — is the run numbered again, a step apart with\n * the record in its place, skipping every record already on its number.\n */\nexport function placements<Item extends { id: string; position?: number }>(\n item: Item,\n others: Item[],\n index: number,\n whole: boolean,\n): Array<[Item, number]> {\n const above = others[index - 1],\n below = others[index];\n const a = above?.position,\n b = below?.position;\n if ((above || below) && (!above || a !== undefined) && (!below || b !== undefined)) {\n const value =\n a !== undefined && b !== undefined ? (whole ? Math.floor((a + b) / 2) : (a + b) / 2) : a !== undefined ? a + STEP : b! - STEP;\n if ((a === undefined || value > a) && (b === undefined || value < b)) return value === item.position ? [] : [[item, value]];\n }\n const run = [...others.slice(0, index), item, ...others.slice(index)];\n return run.flatMap((each, i): Array<[Item, number]> => (each.position === (i + 1) * STEP ? [] : [[each, (i + 1) * STEP]]));\n}\n\n/** A stored place as a number: absent where the record has none yet, or its value is not one. */\nexport function positionOf(value: unknown): number | undefined {\n if (value === null || value === undefined || value === '') return undefined;\n const n = typeof value === 'number' ? value : typeof value === 'string' ? Number(value.trim() || NaN) : NaN;\n return Number.isFinite(n) ? n : undefined;\n}\n\n/** Whether a place column holds whole numbers only, so a midpoint is rounded down rather than halved. */\nexport const wholeColumn = (type: string | undefined) => /int|serial/i.test(type ?? '');\n\n/** The places a record's menu names, in the order it names them. */\nexport type Place = 'up' | 'down' | 'top' | 'bottom';\nexport const PLACES: Array<[Place, string]> = [\n ['up', say('common.moveUp')],\n ['down', say('common.moveDown')],\n ['top', say('moveToTop')],\n ['bottom', say('moveToBottom')],\n];\n\n/**\n * Where one of the menu's places puts a record: its index among the others\n * as they will be, 0 at the top — or undefined where it already stands\n * there, so the menu leaves that place out.\n */\nexport function placeIndex(ids: readonly string[], id: string, place: Place): number | undefined {\n const at = ids.indexOf(id);\n const index = place === 'up' ? at - 1 : place === 'down' ? at + 1 : place === 'top' ? 0 : ids.length - 1;\n return at >= 0 && index !== at && index >= 0 && index < ids.length ? index : undefined;\n}\n\n/** A write that did not apply: what it said, and whether that was a refusal (an uncertain write says so on its record). */\nexport interface PlaceFailure {\n message: string;\n refused: boolean;\n}\n\n/**\n * The writes, one ordinary update each and in order, so each is checked,\n * recorded and undoable on its own. The first that does not apply stops the\n * rest; a page that has gone (another connection, a signed-out session)\n * stops them too, and says so as `stale`.\n */\nexport async function savePlaces<Item>(\n writes: Array<[Item, number]>,\n write: (item: Item, value: number) => Promise<PlaceFailure | null>,\n isCurrent: () => boolean,\n): Promise<{ applied: number; failed?: PlaceFailure; stale: boolean }> {\n let applied = 0;\n for (const [item, value] of writes) {\n const failed = await write(item, value);\n if (!isCurrent()) return { applied, stale: true };\n if (failed) return { applied, failed, stale: false };\n applied++;\n }\n return { applied, stale: false };\n}\n","/**\n * One host per grid row, so a presentation can decorate a row without\n * replacing the grid.\n *\n * The queue's selection had to be a list of its own because nothing could\n * put a control *into* a grid row from outside the grid: the rows are the\n * grid's, drawn from its own row model, and the only way in was another\n * prop threaded through TableRoom, Rows and TableView into Grid for every\n * new kind of decoration. This is the other way in. The grid gives each\n * row it can identify one element — the leading cell, the column the\n * expander already occupies, so nothing shifts — and publishes them in a\n * store keyed by the row's primary key. A decoration anywhere under the\n * same scope portals into the host for its key, and its state, its\n * queries and its context stay where it was declared.\n *\n * Keys are strings, spelled exactly as `bulkKey` spells them, so a\n * selection made on the grid and a selection made in a queue are the same\n * set. A value is never run through `Number()`: an id past 2^53 arrives as\n * a string and a rounded one would name a different row.\n *\n * A host keeps its identity for as long as its row does. The grid keys its\n * rows by the same string, so a refetch that reorders, adds or drops rows\n * moves the surviving rows' elements instead of redrawing them, and a\n * portal into a surviving row is never unmounted. A row that leaves the\n * result takes its host with it, and the decoration's portal goes too.\n */\nimport { createContext, useContext, useLayoutEffect, useState, type ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\nimport { primaryKey, type TableMeta } from '@mistriwork/engine/shared/schema.js';\n\ntype RowHostMap = ReadonlyMap<string, HTMLElement>;\n\nexport interface RowHostStore {\n /** The hosts drawn now. The same object until one arrives or leaves. */\n hosts(): RowHostMap;\n subscribe(listener: () => void): () => void;\n /** The grid's side: a stable ref callback for the host of one row. */\n ref(key: string): (element: HTMLElement | null) => (() => void) | undefined;\n /** The header row's leading cell, where what speaks for every row goes (select all). */\n head(): HTMLElement | null;\n /** The grid's side of it: one stable ref callback. Not a key in `hosts()`, which is rows only. */\n headRef(element: HTMLElement | null): (() => void) | undefined;\n}\n\nconst NONE: RowHostMap = new Map();\n\n/**\n * A row's identity as a string, or null when the row cannot say which row\n * it is: no table, no key, a projection that dropped a key column, or a\n * null in the key (NULL is equal to nothing in SQL, so it identifies\n * nothing here either, and must not collide with the text 'null').\n */\nexport function rowKeyString(table: TableMeta | undefined, row: Record<string, unknown>): string | null {\n if (!table) return null;\n const columns = primaryKey(table);\n if (!columns.length) return null;\n const parts: Array<[string, string]> = [];\n for (const column of columns) {\n const value = row[column];\n if (value === undefined || value === null) return null;\n parts.push([column, String(value)]);\n }\n return JSON.stringify(parts);\n}\n\nexport function createRowHosts(): RowHostStore {\n const live = new Map<string, HTMLElement>();\n const refs = new Map<string, (element: HTMLElement | null) => (() => void) | undefined>();\n const listeners = new Set<() => void>();\n let snapshot: RowHostMap | null = NONE;\n let head: HTMLElement | null = null;\n const tell = () => {\n for (const listener of [...listeners]) listener();\n };\n const changed = () => {\n snapshot = null;\n tell();\n };\n return {\n hosts: () => (snapshot ??= new Map(live)),\n head: () => head,\n /* The rows' snapshot is left alone: the header arriving is no reason for\n every row's decoration to be handed a new map. */\n headRef(element) {\n if (!element) return undefined;\n if (head !== element) {\n head = element;\n tell();\n }\n return () => {\n if (head !== element) return;\n head = null;\n tell();\n };\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n ref(key) {\n /* Stable per key: a fresh callback on every render would make React\n detach and re-attach every host on every paint, and every\n decoration would be told about it. */\n let callback = refs.get(key);\n if (!callback) {\n callback = (element) => {\n if (!element) return undefined;\n if (live.get(key) !== element) {\n live.set(key, element);\n changed();\n }\n return () => {\n /* Only this element's own departure: a remounted row may already\n have put its new host under the same key. */\n if (live.get(key) !== element) return;\n live.delete(key);\n refs.delete(key);\n changed();\n };\n };\n refs.set(key, callback);\n }\n return callback;\n },\n };\n}\n\nconst Scope = createContext<RowHostStore | null>(null);\n\n/**\n * Where a grid publishes its hosts. A grid under a scope registers its rows\n * in it and draws the leading cell on every row; one without draws the cell\n * only when it has something of its own to put there (the expander). A grid\n * hands its own subtree — the rows it opens in place — a null scope, so a\n * nested grid never publishes into its parent's.\n */\nexport function RowHostScope({ store, children }: { store: RowHostStore | null; children: ReactNode }) {\n return <Scope.Provider value={store}>{children}</Scope.Provider>;\n}\n\n/** A scope with its own store, for a presentation that decorates the grid under it. */\nexport function RowHosts({ children }: { children: ReactNode }) {\n const [store] = useState(createRowHosts);\n return <RowHostScope store={store}>{children}</RowHostScope>;\n}\n\nexport const useRowHostScope = (): RowHostStore | null => useContext(Scope);\n\nconst TrailScope = createContext<RowHostStore | null>(null);\n\n/**\n * The second host a row can have: its trailing cell, at the far end, where a\n * row's own menu sits. The same store and the same keys as the leading host;\n * a grid draws the cell only under a trailing scope, and hands the rows it\n * opens in place a null one, as it does the leading scope.\n */\nexport function RowTrailScope({ store, children }: { store: RowHostStore | null; children: ReactNode }) {\n return <TrailScope.Provider value={store}>{children}</TrailScope.Provider>;\n}\n\n/** A trailing scope with its own store, for a decoration at the end of each row. */\nexport function RowTrailHosts({ children }: { children: ReactNode }) {\n const [store] = useState(createRowHosts);\n return <RowTrailScope store={store}>{children}</RowTrailScope>;\n}\n\nexport const useRowTrailScope = (): RowHostStore | null => useContext(TrailScope);\n\n/**\n * The hosts a grid has drawn, re-read whenever one arrives or leaves.\n *\n * Subscribed in a layout effect rather than through useSyncExternalStore,\n * which subscribes after paint: the hosts are attached in the grid's commit,\n * and a decoration that learnt of them a frame later would paint the rows\n * without it first. Grids paint complete (docs/design.md, \"data does not\n * dance\"), so the decoration lands in the same frame as its row.\n */\nexport function useRowHosts(store?: RowHostStore | null): RowHostMap {\n const scoped = useRowHostScope();\n const source = store === undefined ? scoped : store;\n const [hosts, setHosts] = useState<RowHostMap>(() => source?.hosts() ?? NONE);\n useLayoutEffect(() => {\n if (!source) {\n setHosts(NONE);\n return undefined;\n }\n const read = () => setHosts(source.hosts());\n read();\n return source.subscribe(read);\n }, [source]);\n return source ? hosts : NONE;\n}\n\n/**\n * Children drawn into one row's host, for as long as that row is in the\n * result. Nothing is drawn while the row is not (yet) on screen — a\n * windowed grid draws only the rows in view — and the children arrive when\n * it scrolls in.\n */\nexport function RowDecoration({ rowKey, store, children }: { rowKey: string; store?: RowHostStore | null; children: ReactNode }) {\n const host = useRowHosts(store).get(rowKey);\n return host ? createPortal(children, host, rowKey) : null;\n}\n\n/** The header's leading cell, re-read as it arrives or leaves — in a layout effect, as the rows' hosts are. */\nfunction useRowHead(store?: RowHostStore | null): HTMLElement | null {\n const scoped = useRowHostScope();\n const source = store === undefined ? scoped : store;\n const [head, setHead] = useState<HTMLElement | null>(() => source?.head() ?? null);\n useLayoutEffect(() => {\n if (!source) {\n setHead(null);\n return undefined;\n }\n const read = () => setHead(source.head());\n read();\n return source.subscribe(read);\n }, [source]);\n return source ? head : null;\n}\n\n/**\n * Children drawn into the header row's leading cell: the one place a\n * decoration speaks for every row, as the select-all box every table has\n * does, above the rows' own boxes in the same column.\n */\nexport function RowHeadDecoration({ store, children }: { store?: RowHostStore | null; children: ReactNode }) {\n const head = useRowHead(store);\n return head ? createPortal(children, head, 'head') : null;\n}\n",null,null,null,null,"/**\n * What a dashboard's sections ask, in the words they ask it: a metric's\n * figure and its compare window's (its trend's are dashboardTrend.ts), a breakdown's groups, a chart's\n * and a matrix's crosses, a board's lanes, a list's first rows, a pick's\n * choices. The client's sections build their requests from these\n * (client/components/Dashboard.tsx, dashboardModel.ts), and the server\n * builds a first page's from them too (server/http/firstPaintRooms.ts), so\n * the answers it carries are for the requests the sections then make.\n */\nimport { andQuery } from './query.js';\nimport { labelColumn, primaryKey, type ForeignKey, type TableMeta } from './schema.js';\nimport { listPresentationColumns } from './appListColumns.js';\nimport type { AppListPresentation } from './listPresentations.js';\n\n/**\n * How the asks read the schema: the client through the walk's own helpers\n * (core.js), the server over the schema it answered with (listQuestion.ts\n * `referenceNames` names the references either way).\n */\nexport interface AskLookups {\n table(id: string): TableMeta | undefined;\n references(id: string): readonly ForeignKey[];\n referenceNames(tableId: string, names: readonly string[]): Record<string, string>;\n /** Where a table's records are named, as a view path (schema.ts labelPath, by the App's record label). */\n naming(table: TableMeta): string | undefined;\n}\n\n/** What of a section its asks are made from. */\nexport interface AskedSection {\n kind: string;\n table?: string;\n query?: string;\n measure?: string;\n /** A scatter's second measure, which places its dots across. */\n x?: string;\n by?: string;\n lanes?: string[];\n limit?: number;\n over?: string;\n compare?: string;\n windowBase?: string;\n /** The reader's window, where one stands in the author's (`windowed`): the window a metric's trend is drawn over. */\n windowPhrase?: string;\n comparePeriod?: boolean;\n spark?: boolean;\n shape?: string;\n show?: string[];\n sort?: string;\n view?: string;\n windows?: string[];\n windowKey?: string;\n /** A goal: a number, or read from data — per group where it names a `by` (a breakdown's, G76). */\n target?: number | { table: string; query?: string; measure: string; by?: string; over?: string; windowBase?: string };\n /** The target is the whole this metric is a share of, not a goal (it follows the metric's window and picks). */\n targetWhole?: true;\n error?: string;\n}\n\n/** A breakdown's goals, a row per group: the target table's measure by its own `by`, within its query. */\nexport function targetText(section: Pick<AskedSection, 'target' | 'limit'>): string | null {\n const goal = section.target;\n if (typeof goal !== 'object' || !goal.by) return null;\n return [goal.table, goal.query, `${goal.measure} by ${goal.by}`, `limit ${groupsAskedFor(section)}`].filter(Boolean).join(' ');\n}\n\n/** The breakdown a section asks for: its measure by its key, within its query. */\nexport function breakdownText(section: Pick<AskedSection, 'table' | 'query' | 'measure' | 'by' | 'x'>, limit?: number | string): string {\n /* A scatter asks its two measures in one line: the answer is its key, then `x`, then the measure. */\n const measured = `${section.x ? `${section.x}, ` : ''}${section.measure ?? 'count'}`;\n return [section.table, section.query, `${measured} by ${section.by}`, limit ? `limit ${limit}` : ''].filter(Boolean).join(' ');\n}\n\n/**\n * A section with the reader's window in place of the author's. The server\n * hands sections whose query already windows the `over` column a\n * `windowBase` without that phrase, so the reader's phrase stands where\n * the author's did rather than intersecting it. A compare derived from\n * \"previous period\" is re-derived against the reader's window — `last 30\n * days` picked compares against `previous 30 days`; a hand-written compare,\n * or a window phrase with no \"previous\" (this month), hides the delta rather\n * than compare the reader's window to the author's.\n */\nexport function windowed<S extends AskedSection>(section: S, windowNow: string | null): S {\n if (!section.over || !windowNow) return section;\n const base = section.windowBase ?? section.query;\n const out: S = { ...section, query: andQuery(base, `${section.over} = ${windowNow}`), windowPhrase: windowNow };\n /* A goal per group follows the reader's window by its own clock: this quarter's quotas beside this quarter's wins. */\n const goal = section.target;\n if (typeof goal === 'object' && goal.over)\n out.target = {\n ...goal,\n query: andQuery(section.targetWhole ? (goal.windowBase ?? goal.query) : goal.query, `${goal.over} = ${windowNow}`),\n };\n /* A metric with no window of its own is served `comparePeriod` and no\n compare at all: it has a change only once a window is picked. */\n if (section.compare || section.comparePeriod) {\n const m = /^last\\s+(\\d+)\\s+(minute|hour|day|week|month|year)s?$/i.exec(windowNow.trim());\n out.compare =\n section.comparePeriod && m ? andQuery(base, `${section.over} = previous ${m[1]} ${m[2]}${m[1] === '1' ? '' : 's'}`) : undefined;\n }\n return out;\n}\n\n/** The period a section with windows of its own is over: the reader's pick, else its first. */\nexport const sectionPeriod = (\n section: Pick<AskedSection, 'windows' | 'windowKey'>,\n periods: Readonly<Record<string, string>>,\n): string | null => (section.windows?.length ? (section.windowKey && periods[section.windowKey]) || section.windows[0] : null);\n\n/** A metric's figure over `query` — its own, or its compare window's. */\nexport const measureText = (section: Pick<AskedSection, 'table' | 'measure'>, query: string | undefined): string =>\n [section.table, query, section.measure ?? 'count'].filter(Boolean).join(' ');\n\n/**\n * How many groups a breakdown asks for before it orders them itself. The\n * grammar answers groups in the engine's order — the alphabet, on SQLite —\n * so a section's `limit` asked of the server kept the first groups by name,\n * not the biggest. The groups are fetched, ordered on the client and then\n * cut to the section's limit.\n */\nconst GROUPS_ASKED = 200;\nexport const groupsAskedFor = (section: Pick<AskedSection, 'limit'>): number => Math.max(section.limit ?? 0, GROUPS_ASKED);\n\n/** The groups a chart asks for: stacked bars cross two keys, and bars and a donut order their groups themselves. */\nexport function chartLimit(section: Pick<AskedSection, 'shape' | 'limit' | 'by'>): number | undefined {\n /* A heat map's grid is every cross of its keys: a week of hours is 168. */\n if (section.shape === 'stacked' || section.shape === 'heatmap') return 400;\n /* A waterfall's and a treemap's groups are all drawn, as a donut's slices: `limit` keeps the largest. */\n if (section.shape === 'waterfall' || section.shape === 'treemap' || section.shape === 'scatter') return groupsAskedFor(section);\n /* A line (or the default chart) over two keys draws one line per second key: every period crossed with every series is a\n row, and the server's twenty-row default dropped the later periods, so each line fell to zero where the rows ran out. */\n if (section.shape === 'line' && (section.by ?? '').includes(',')) return 400;\n return section.shape === 'donut' || section.shape === 'bar' ? groupsAskedFor(section) : section.limit;\n}\n\n/** A board's lane counts. */\nexport const boardCountText = (section: Pick<AskedSection, 'table' | 'query' | 'by'>): string =>\n [section.table, section.query, `count by ${section.by}`].filter(Boolean).join(' ');\n\n/**\n * A dashboard list's question: its rows with the columns it draws, the names\n * its references are read by and the keys a row opens by, kept out of sight,\n * up to its limit. `presentation` is the embedded view's, whose dress reads\n * columns of its own.\n */\nexport function dashboardListQuery(\n lookups: AskLookups,\n section: Pick<AskedSection, 'table' | 'query' | 'sort' | 'show' | 'limit'>,\n presentation?: AppListPresentation,\n): { query: string; keys: string[]; named: string[]; referenceLabels: Record<string, string> } {\n const table = section.table ? lookups.table(section.table) : undefined;\n const shown = [...new Set([...(section.show ?? []), ...(presentation ? listPresentationColumns(presentation) : [])])];\n const keys = shown.length ? (table ? primaryKey(table) : []).filter((key) => !shown.includes(key)) : [];\n const referenceLabels = shown.length ? lookups.referenceNames(section.table as string, shown) : {};\n /* The record's own name rides along unseen as its key does: on a phone a\n row is a card titled by it, and without it a lease was titled \"21\". */\n const naming = shown.length && table ? lookups.naming(table) : undefined;\n const titled = naming && !primaryKey(table as TableMeta).includes(naming) ? [naming] : [];\n const named = [...new Set([...Object.values(referenceLabels), ...titled])].filter((name) => !shown.includes(name));\n const query = [\n section.table,\n section.query,\n section.sort ? `sort ${section.sort}` : '',\n shown.length ? `show ${[...shown, ...named, ...keys].join(', ')}` : '',\n `limit ${section.limit ?? 5}`,\n ]\n .filter(Boolean)\n .join(' ');\n return { query, keys, named, referenceLabels };\n}\n\n/**\n * A pick's choices, where its column is a whole single-column reference: the\n * records it points at, by name, fifty at most. Null where the column is a\n * vocabulary (its values are the choices) or no section's table has it.\n */\nexport function pickQuery(lookups: AskLookups, sections: readonly Pick<AskedSection, 'table'>[], column: string): string | null {\n const home = sections.find((section) => section.table && lookups.table(section.table)?.columns.some((c) => c.name === column));\n const table: TableMeta | undefined = home?.table ? lookups.table(home.table) : undefined;\n const meta = table?.columns.find((c) => c.name === column) as { allowed?: string[] } | undefined;\n const fk =\n table && !meta?.allowed?.length\n ? lookups.references(table.id).find((f) => f.from.columns.length === 1 && f.from.columns[0] === column)\n : undefined;\n const target = fk ? lookups.table(fk.to.table) : undefined;\n const naming = target ? labelColumn(target) : undefined;\n const pk = target ? primaryKey(target)[0] : undefined;\n return target && naming ? `${target.id} show ${[...new Set([naming, pk])].join(', ')} sort ${naming}` : null;\n}\n","/** What dashboardModel says, in the dashboards room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n allTime: '{title} (all time)',\n});\n","/**\n * What a dashboard is made of, before anything is drawn.\n *\n * The reader's window and picks folded into a section's query, the slot\n * they ride the address in, the breakdown text a section asks the server\n * for, and how a measured figure is said. Pure, so the components and\n * the vanilla entry read one rule.\n */\nimport { andQuery } from '@mistriwork/engine/shared/query.js';\nimport type { FigureFormat } from '@mistriwork/engine/shared/model.js';\nimport { breakdownText, sectionPeriod, windowed } from '@mistriwork/engine/shared/dashboardAsks.js';\nimport { columnDisplay, findTable, quote } from '../core.js';\nimport { defaultCurrency, formatLocale, formatMoney, formatNumber, formatPercent, formatWholeMoney } from '../locale.js';\nimport { currencyDigits, currencyPath, minorFigure } from '@mistriwork/engine/shared/money.js';\nimport { DURATION_STEPS } from '@mistriwork/engine/shared/niceTicks.js';\nimport { sayDuration, withUnit } from './valueModel.js';\nimport { say } from '../copy/dashboards/components/dashboardModel.js';\nimport { ALL_TIME, readPeriod } from '@mistriwork/engine/shared/addressParams.js';\n\ninterface DisplayRule {\n format?: string;\n currency?: string;\n minor?: true;\n whole?: true;\n /** Each row says its own currency in this column (`currency: { column }`). */\n currencyColumn?: string;\n}\n\n/**\n * A money measure summed apart per currency, where each row says its own\n * (`currency: { column }`): one figure per currency, never one sum of yen\n * and dollars. As a number it is its figure when there is one currency and\n * NaN when there are several, so a change or a goal is said only where it\n * means something. A class, so the query cache keeps it as it is.\n */\nexport class CurrencyFigures {\n constructor(readonly figures: ReadonlyArray<readonly [currency: string, value: unknown]>) {}\n valueOf(): number {\n return this.figures.length === 1 ? Number(this.figures[0][1]) : NaN;\n }\n}\n\n/** The one currency a query keeps its rows to (`currency = JPY`), if it does. */\nexport function pinnedCurrency(query: string | undefined, path: string): string | undefined {\n const escaped = path.replace(/[.]/g, '\\\\.');\n return new RegExp(`(?:^|\\\\s)${escaped}\\\\s*=\\\\s*\"?([A-Za-z]{3})\"?(?:\\\\s|$)`).exec(query ?? '')?.[1]?.toUpperCase();\n}\n\nexport interface Section {\n /** A stat card's window, said under its figure (metricWindow). Set on the client, never served. */\n windowNote?: string;\n sizing?: import('@mistriwork/engine/shared/tableSizing.js').TableSizing;\n kind: string;\n /** custom: the author's component, its named reads (each a rows section's words) and its props. */\n component?: import('@mistriwork/engine/shared/appComponents.js').ComponentDecl;\n reads?: Record<string, import('@mistriwork/engine/shared/appComponents.js').DashCustomRead>;\n aggregates?: Record<string, import('@mistriwork/engine/shared/appComponents.js').DashCustomTotal>;\n props?: Record<string, unknown>;\n table?: string;\n query?: string;\n measure?: string;\n by?: string;\n lanes?: string[];\n limit?: number;\n title?: string;\n width?: string;\n /** The area of the dashboard's `layout` the section stands in. */\n area?: string;\n over?: string;\n compare?: string;\n windowBase?: string;\n comparePeriod?: boolean;\n better?: 'up' | 'down';\n spark?: boolean;\n /** metric: how its figure is said, and the word after it, where its measure has no column's rule to say it. */\n format?: FigureFormat;\n unit?: string;\n /** metric: money said exact, to the currency's minor digits at any size (the default), or compact from a thousand. */\n figure?: 'exact' | 'compact';\n shape?: string;\n /** funnel: the stages a row reaches in order (shared/funnel.ts). */\n stages?: import('@mistriwork/engine/shared/funnel.js').FunnelStage[];\n /** chart: a scatter's across measure, its `measure` the up one. */\n x?: string;\n /** breakdown, steps: a line under a step, by its value. */\n notes?: Record<string, string>;\n /** chart: a line's curve, and a donut's words for its middle figure. */\n curve?: 'smooth' | 'straight';\n total?: string;\n height?: number;\n /** metric and chart: a goal, drawn as a meter or a rule and said; a metric's may be a measure read from data. */\n target?: number | { table: string; query?: string; measure: string; by?: string; over?: string; windowBase?: string };\n targetWhole?: true;\n show?: string[];\n labels?: Record<string, string>;\n sort?: string;\n text?: string;\n icon?: import('@mistriwork/engine/shared/appIcons.js').AppIconName;\n action?: { label: string; view: string };\n /** note: the dashboard's banner, its tag and its picture. */\n variant?: 'banner';\n eyebrow?: string;\n image?: import('@mistriwork/engine/shared/servedApp.js').LandingImage;\n error?: string;\n /** An embed: the key of the list view it draws, whose room \"open →\" opens. */\n view?: string;\n /** metric, breakdown, chart, matrix, funnel: its authored `to: false`, a card or groups that are text. */\n noDrill?: true;\n /** Authored `empty: 'hide'`: the section is left out of the dashboard while it has nothing to draw. */\n emptyMode?: 'hide';\n /** The section's own windows, the first where it starts; `windowKey` names it in the address. */\n windows?: string[];\n windowKey?: string;\n /** An embed that works as its room: search, filters, selection with the room's bulk actions. */\n interactive?: true;\n /** A ⋯ menu on each row with the record's own verbs, as the list over the table offers them (the assistant's tables). */\n rowActions?: true;\n /** activity: the resources whose changes it lists, each with its mark and its word. */\n resources?: Record<string, { icon?: import('@mistriwork/engine/shared/appIcons.js').AppIconName; label?: string }>;\n /** A first run's steps, each served with its view's table (FirstRun.tsx). */\n steps?: import('@mistriwork/engine/shared/servedApp.js').AppFirstRunStep[];\n /** find: the tables its box searches (DashboardFind.tsx), and the box's words before anything is typed. */\n searched?: string[];\n placeholder?: string;\n}\n\n/** The chart shapes a part on demand draws (ChartShapes.tsx), so a dashboard of lines and bars never fetches it. */\nexport const EXTRA_SHAPES: readonly string[] = ['scatter', 'heatmap', 'waterfall', 'treemap'];\n\nexport interface DashboardDef {\n /** The view carries a Favorites star. */\n favorite?: true;\n /** The dashboard's view key; its address is `dash-<key>`. */\n id: string;\n label: string;\n /** The words over the sections when they are not the label, the reader already greeted by the server. */\n heading?: string;\n /** The title is not drawn; it stays for a screen reader. */\n headingHidden?: true;\n /** Plain text, authored with the dashboard and served only with it. */\n description?: string;\n sections: Section[];\n /** A separate context flow beside the main dashboard sections. */\n aside?: Section[];\n /** Sections on a grid: a row of cells each, an area's name or `.` (shared/dashLayout.ts). Never with an aside. */\n areas?: string[];\n windows?: string[];\n /** The window it opens on, one of `windows`: unpicked is this, and all time is said `all-time`. */\n window?: string;\n /** The window picked from one date-range button rather than a row of them. */\n windowControl?: 'segmented' | 'button';\n filters?: string[];\n refresh?: number;\n /** A free-form page (definePage): what its component reads and runs, the address parameters it keeps its place in, and its loader. */\n page?: { reads: string[]; commands: string[]; params: string[]; loader?: string; public?: true };\n error?: string;\n}\n\nexport type Picks = Record<string, string>;\n/** The periods the reader picked on sections with windows of their own: the section's `windowKey` → its phrase. */\nexport type Periods = Record<string, string>;\n\n/** What the dashboard room hands the dashboard it draws (Rooms.tsx, through the shell's `rooms`; Dashboard.tsx). */\nexport interface DashboardProps {\n dashboard: DashboardDef;\n /** The reader's time window: null is all time. */\n window?: string | null;\n picks?: Picks;\n /** The periods picked on sections with windows of their own, by section. */\n periods?: Periods;\n onWindow?: (w: string | null) => void;\n onPick?: (picks: Picks) => void;\n onPeriods?: (periods: Periods) => void;\n}\n\n/** How a section's own window rides the address: `period.<windowKey>` beside the dashboard's `period`. */\nconst PERIOD_PREFIX = 'period.';\n\n/** The number, spoken the way the grid speaks numbers: the reader's\n separators, and an integer past 2^53 digit for digit. */\nexport function figure(value: unknown): string {\n if (value === undefined || value === null) return '0';\n if (typeof value === 'string' && /^-?\\d+$/.test(value)) return formatNumber(value);\n const n = typeof value === 'string' && /^-?\\d+(\\.\\d+)?$/.test(value) ? Number(value) : value;\n return typeof n === 'number' && Number.isFinite(n) && Number.isSafeInteger(Math.trunc(n)) ? formatNumber(n) : String(value);\n}\n\n/**\n * The display rule behind a measured number, read off the measure's own\n * column — \"sum amount as pipeline\" is dressed by whatever dresses\n * `amount`. A bare \"count\" measures rows, not a column, so it has none.\n * A computed measure that multiplies or divides — a ratio — is a plain\n * number: dollars over dollars are not dollars. One that adds or\n * subtracts keeps its first term's dress.\n */\nfunction measureRule(section: Section): DisplayRule | null {\n /* The author's word for the figure stands over the column's: \"avg resolution_met * 100\" is a share. */\n if (section.format) return { format: section.format };\n if (/\\s[*/]\\s/.test(section.measure ?? '')) return null;\n const m = /^(?:sum|avg|min|max|median)\\s+([A-Za-z0-9_.]+)/i.exec(section.measure ?? '');\n const rule = m && section.table ? (columnDisplay(section.table, m[1]) as DisplayRule | null) : null;\n /* A query kept to one currency says its figures in it. */\n const path = rule?.format === 'money' ? currencyPath(rule, m![1]) : undefined;\n const pinned = path ? pinnedCurrency(section.query, path) : undefined;\n return pinned ? { ...rule, currency: pinned } : rule;\n}\n\n/** Where money goes compact: a hundred thousand in a table or a breakdown, where a figure is read whole; a\n thousand on a metric card that says `figure: 'compact'` (CARD_COMPACT). */\nconst COMPACT_FROM = 100_000;\n/* A strip of compact cards said \"$414.1K\" beside \"$27,300\": each card measures alone, so no rule over its neighbours\n could hold before every one had answered, and a card that changed its figure's form as they did would shift. One\n rule a compact card keeps by itself — compact from a thousand, as its axis and its change say it — reads one way\n across any strip (docs/design.md, stat cards). */\nconst CARD_COMPACT = 1000;\n/** Never compact: money to the currency's minor digits at any size. A metric's figure by default, a card's title,\n what a screen reader hears, and a record page's metric. */\nexport const EXACT = Infinity;\n\n/** A stored decimal's digits, or a finite number: what money can be said exactly from (formatMoney). */\nconst DECIMAL = /^\\s*[+-]?\\d+(\\.\\d+)?\\s*$/;\n\n/** A measured figure in its dress: compact money reads as \"$27.9M\" from\n `compactFrom`, and exact below it — to the currency's minor digits, a\n figure past 2^53 digit for digit — save in a set whose figures are all\n whole (`cents: false`, a breakdown's `among`). */\nfunction dressedFigure(rule: DisplayRule | null, value: unknown, cents?: boolean, compactFrom = COMPACT_FROM): string | null {\n if (value instanceof CurrencyFigures)\n return value.figures\n .map(([currency, each]) => dressedFigure({ ...rule, format: 'money', currency }, each, cents, compactFrom) ?? figure(each))\n .join(' · ');\n if (rule?.format !== 'money') return null;\n const currency = rule.currency || defaultCurrency();\n /* A sum of minor units is said in the major unit, exactly: 1999 cents is $19.99, as text. */\n const major = rule.minor ? minorFigure(value, currency) : value;\n const exact = (typeof major === 'number' && Number.isFinite(major)) || (typeof major === 'string' && DECIMAL.test(major));\n if (!exact) return null;\n const n = Number(major);\n if (Math.abs(n) >= compactFrom) return formatMoney(n, rule.currency, { notation: 'compact', maximumFractionDigits: 1 });\n if (rule.whole && cents !== false) return formatWholeMoney(major as number | string, rule.currency);\n return formatMoney(\n major as number | string,\n rule.currency,\n cents === false ? { minimumFractionDigits: 0, maximumFractionDigits: 0 } : {},\n );\n}\n\n/**\n * A measured fraction, said to a headline's precision. An average or a ratio\n * comes back from the database to every digit it has, and the number\n * formatter's default three places put \"78.261\" on a card whose measure was\n * \"avg resolution_met * 100\": noise, not news. One place at or past 1, and\n * three significant digits below it, so a ratio such as 0.0345 does not\n * round to 0.\n */\nfunction measuredFraction(value: unknown): string | null {\n const n = typeof value === 'number' ? value : typeof value === 'string' && /^-?\\d+\\.\\d+$/.test(value) ? Number(value) : NaN;\n if (!Number.isFinite(n) || Number.isInteger(n)) return null;\n return formatNumber(n, Math.abs(n) >= 1 ? { maximumFractionDigits: 1 } : { maximumSignificantDigits: 3 });\n}\n\n/**\n * A stacked chart's visible figures (its legend's totals, each bar's pill and its target), said by one rule decided from\n * all of them: money compact from a thousand for every one where any reaches a hundred thousand, exact for every one\n * else, so \"$45,230\" never stands beside \"$451.2K\" on one chart. The figures arrive as stored, so a sum of cents is read\n * in the major unit before it is held to the threshold: a hundred thousand cents is a thousand dollars, not compact.\n */\nexport function legendSayer(section: Section, figures: readonly number[]): (value: unknown) => string {\n const rule = measureRule(section);\n const major = rule?.format === 'money' && rule.minor ? 10 ** currencyDigits(rule.currency || defaultCurrency()) : 1;\n return sayer(section, undefined, { compact: figures.some((n) => Math.abs(n) / major >= COMPACT_FROM) });\n}\n\n/** How a section says a figure: in its measure's dress, else as a number. */\nexport function sayer(\n section: Section,\n measured?: unknown,\n /* A metric card's own figure, its change and its goal: money exact, or compact from a thousand (CARD_COMPACT) where\n the metric says `figure: 'compact'`; `whole`, exact at any size, for the card's title; `compact`, a legend's\n figures compact from a thousand. */\n { card = false, whole = false, compact = false }: { card?: boolean; whole?: boolean; compact?: boolean } = {},\n): ((value: unknown) => string) & { tick: (value: unknown) => string; among: (values: readonly unknown[]) => (value: unknown) => string } {\n const rule = measureRule(section);\n /* Figures in one currency, read apart per currency: its change and its goal are said in it too. */\n const one = measured instanceof CurrencyFigures && measured.figures.length === 1 ? measured.figures[0][0] : undefined;\n const dress = one && rule ? { ...rule, currency: one } : rule;\n const said = figureSayer(\n dress,\n section.unit,\n whole ? EXACT : compact ? CARD_COMPACT : card ? (section.figure === 'compact' ? CARD_COMPACT : EXACT) : COMPACT_FROM,\n );\n /* Figures said side by side, in one form: where every one is a thousand or more, money drops its cents, so\n \"$67,713.40\" never stands beside \"$17,970\" in one breakdown; else every figure says cents if one has some. */\n const among = (values: readonly unknown[]) => {\n if (dress?.format !== 'money') return said;\n const minor = dress.minor ? 10 ** currencyDigits(dress.currency || defaultCurrency()) : 1;\n const majors = values.filter((v) => v !== null && v !== undefined && v !== '').map((v) => Number(v) / minor);\n const large = majors.length > 0 && majors.every((n) => Math.abs(n) >= 1000);\n /* Cents for every figure where one has some and none is large; else none. */\n const cents = !large && majors.some((n) => Number.isFinite(n) && Math.round(n * 100) % 100 !== 0);\n const one = (v: unknown) => dressedFigure(dress, v, cents) ?? said(v);\n return section.unit ? (v: unknown) => withUnit(one(v), section.unit!) : one;\n };\n return Object.assign(said, { tick: tickSayer(dress, section.unit), among });\n}\n\n/**\n * How an axis says one of its round levels (shared/niceTicks.ts): compact\n * from a thousand up and never to the cent, so a money axis reads \"$0 / $2K /\n * $4K\" where the figure itself is said whole. A share and a time taken keep\n * their own words, which are short already.\n */\nfunction tickSayer(rule: DisplayRule | null, unit?: string): ((value: unknown) => string) & { steps?: readonly number[] } {\n const said = figureSayer(rule, unit);\n const tick = (value: unknown) => {\n const stored = Number(value);\n if (value === null || value === '' || !Number.isFinite(stored) || rule?.format === 'percent' || rule?.format === 'duration')\n return said(value);\n const compact = { notation: 'compact', maximumFractionDigits: 1, minimumFractionDigits: 0 } as const;\n if (rule?.format === 'money') {\n const n = rule.minor ? stored / 10 ** currencyDigits(rule.currency || defaultCurrency()) : stored;\n const text = formatMoney(\n n,\n rule.currency,\n Math.abs(n) >= 1000 ? compact : { minimumFractionDigits: 0, maximumFractionDigits: Number.isInteger(n) ? 0 : 2 },\n );\n return unit ? withUnit(text, unit) : text;\n }\n if (Math.abs(stored) < 1000) return said(value);\n const text = formatNumber(stored, compact);\n return unit ? withUnit(text, unit) : text;\n };\n /* A time taken is ruled in days and hours, not in round numbers of seconds. */\n return rule?.format === 'duration' ? Object.assign(tick, { steps: DURATION_STEPS }) : tick;\n}\n\n/**\n * A measured figure said in a rule's dress — money, a share (`percent` reads\n * the figure as 0–100: 53.8 is \"53.8%\", never 0.538) — else as a number, an\n * average or a ratio to a headline's precision; then the unit. A dashboard's\n * metric and a record page's say a figure the same way.\n */\nexport function figureSayer(rule: DisplayRule | null, unit?: string, compactFrom = COMPACT_FROM): (value: unknown) => string {\n const said = (v: unknown) =>\n dressedFigure(rule, v, undefined, compactFrom) ?? sharedFigure(rule, v) ?? durationFigure(rule, v) ?? measuredFraction(v) ?? figure(v);\n return unit ? (v) => withUnit(said(v), unit) : said;\n}\n\n/** A share said as one: 78.261 is \"78.3%\". */\nfunction sharedFigure(rule: DisplayRule | null, value: unknown): string | null {\n const n = Number(value);\n if (rule?.format !== 'percent' || value === null || value === '' || !Number.isFinite(n)) return null;\n return formatPercent(n, { maximumFractionDigits: 1 });\n}\n\n/** A figure of seconds said as a time taken: 36120 is \"10h 2m\", as a `duration` column says it. */\nfunction durationFigure(rule: DisplayRule | null, value: unknown): string | null {\n const n = Number(value);\n if (rule?.format !== 'duration' || value === null || value === '' || !Number.isFinite(n)) return null;\n return sayDuration(n, formatLocale());\n}\n\n/* What a section asks is shared (shared/dashboardAsks.ts): a first page's\n dashboard is asked by the server in the same words. */\nexport { breakdownText, sectionPeriod, windowed };\n\n/** The section's whole query, as the list page would take it. */\nexport function fullQuery(section: Section): string {\n return [section.table, section.query].filter(Boolean).join(' ');\n}\n\n/** Authored lane visibility narrows every board read and drilldown alike. */\nexport function boardSection(section: Section): Section {\n if (section.kind !== 'board' || !section.lanes?.length) return section;\n return {\n ...section,\n query: andQuery(section.query, section.lanes.map((value) => `${section.by} = ${quote(value)}`).join(' or ')),\n };\n}\n\n/**\n * A windowed section's title, saying the window its figure is over. A title\n * that names the author's own window (\"Won, last 90 days\") has the reader's\n * picked window stand in its place — \"Won, last 30 days\" — where appending\n * it read \"Won, last 90 days (last 30 days)\", two windows for one figure.\n * A title that names none says the window after it. With nothing picked, a\n * section the author windowed says the author's window — \"Won (last 90\n * days)\", unless its title already names it — and any other says it is over\n * all time: under \"All time\" a bare \"Won\" counted ninety days and said so\n * nowhere.\n */\nexport function windowTitle(title: string, section: Pick<Section, 'query' | 'over' | 'windowBase'>, windowNow: string | null): string {\n if (!section.over) return title;\n const authored = section.windowBase === undefined ? undefined : authoredWindow(section.query ?? '', section.over);\n const at = authored ? title.toLowerCase().indexOf(authored.toLowerCase()) : -1;\n if (!windowNow)\n return section.windowBase === undefined ? say('allTime', { title }) : authored && at < 0 ? `${title} (${authored})` : title;\n if (authored && at >= 0) {\n const said = at === 0 && /^[A-Z]/.test(title) ? windowNow.charAt(0).toUpperCase() + windowNow.slice(1) : windowNow;\n return title.slice(0, at) + said + title.slice(at + authored.length);\n }\n return `${title} (${windowNow})`;\n}\n\n/**\n * A stat card's title and the window said under its figure. A card's label is\n * one line over a number, and \"Won (all time)\" or \"Won (last 90 days)\" wrapped\n * it, so a card never has the window appended: a title that names the\n * author's window has the reader's pick stand in its place, as a section's\n * does (windowTitle), and one that names none says the author's window\n * quietly under the figure until the reader picks one — then the picker above\n * says it, and a card it does not move says \"Right now\". Under All time\n * nothing is narrowed and nothing is said.\n */\nexport function metricWindow(\n title: string,\n section: Pick<Section, 'query' | 'over' | 'windowBase'>,\n windowNow: string | null,\n): { title: string; note?: string } {\n if (!section.over) return { title };\n const authored = section.windowBase === undefined ? undefined : authoredWindow(section.query ?? '', section.over);\n const named = authored !== undefined && title.toLowerCase().includes(authored.toLowerCase());\n if (named) return { title: windowNow ? windowTitle(title, section, windowNow) : title };\n if (!windowNow && authored) return { title, note: authored.charAt(0).toUpperCase() + authored.slice(1) };\n return { title };\n}\n\n/** The window phrase a query gives its `over` column (`close_date = last 90 days` → \"last 90 days\"). */\nfunction authoredWindow(query: string, over: string): string | undefined {\n const column = over.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const match = new RegExp(`\\\\b${column}\\\\s*=\\\\s*(.+?)(?=\\\\s+(?:and|or|sort|show|limit)\\\\b|\\\\s*\\\\)|\\\\s*$)`, 'i').exec(query);\n return match?.[1].trim();\n}\n\n/**\n * The window a section's own query sets on its `over` column — \"last 90\n * days\" — which its title says while the reader has picked none, so a card\n * titled \"Won\" reads \"Won (last 90 days)\" under All time and \"Won (last 30\n * days)\" once the reader picks that, never both windows at once.\n */\nexport function ownWindow(section: Section): string | undefined {\n if (!section.over || section.windowBase === undefined || !section.query) return undefined;\n const over = section.over.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const m = new RegExp(`(?:^|[\\\\s(])${over}\\\\s*=\\\\s*(last\\\\s+\\\\d+\\\\s+(?:day|week|month|year)s?)\\\\b`, 'i').exec(section.query);\n return m?.[1].replace(/\\s+/g, ' ').toLowerCase();\n}\n\n/** A section with the reader's picks folded in — only the columns its\n own table actually has; the rest pass it over, like the window. */\nexport function picked(section: Section, picks: Picks): Section {\n if (!section.table) return section;\n const table = findTable(section.table) as { columns: Array<{ name: string }> } | undefined;\n const conds = Object.entries(picks)\n .filter(([column]) => table?.columns.some((c) => c.name === column))\n .map(([column, value]) => `${column} = ${quote(String(value))}`);\n if (!conds.length) return section;\n /* The unwindowed query takes the picks too: a card's trend is drawn over\n it (Dashboard.tsx, Metric), and a picked owner's trend is theirs. */\n const goal = section.target;\n return {\n ...section,\n query: andQuery(section.query, ...conds),\n ...(section.windowBase !== undefined ? { windowBase: andQuery(section.windowBase, ...conds) } : {}),\n /* A whole is the same cohort as the figure: a picked owner's share is of that owner's rows. */\n ...(section.targetWhole && typeof goal === 'object'\n ? {\n target: {\n ...goal,\n query: andQuery(goal.query, ...conds),\n ...(goal.windowBase !== undefined ? { windowBase: andQuery(goal.windowBase, ...conds) } : {}),\n },\n }\n : {}),\n };\n}\n\n/** A window phrase as it rides the page token: spaces become hyphens, and\n matching happens slug-to-slug so nothing needs a lossless inverse. */\nexport const windowSlug = (w: string): string => w.replace(/\\s+/g, '-');\n\n/** The root slot, written: the window slug, then `column=value` per pick and\n `period.<section>=<slug>` per section's own window, `;`-separated. Empty\n when there is nothing to say. A dashboard that opens on a window (`opensOn`)\n leaves that one unsaid and says all time as `all-time`. */\nexport function rootSlot(windowNow: string | null, picks: Picks, periods: Periods = {}, opensOn?: string): string {\n const parts = [windowNow === (opensOn ?? null) ? '' : windowNow ? windowSlug(windowNow) : ALL_TIME];\n for (const [column, value] of Object.entries(picks ?? {})) parts.push(`${column}=${value}`);\n for (const [key, phrase] of Object.entries(periods)) parts.push(`${PERIOD_PREFIX}${key}=${windowSlug(phrase)}`);\n return parts.filter((p, i) => p || (i === 0 && parts.length > 1)).join(';');\n}\n\n/** The root slot, read: whatever is not `name=value` is the window; a `period.` name is a section's own. */\nexport function parseRootSlot(body: unknown): { window: string; picks: Picks; periods?: Periods } {\n const picks: Picks = {};\n const periods: Periods = {};\n let window = '';\n for (const part of String(body ?? '').split(';')) {\n const eq = part.indexOf('=');\n if (eq > 0 && part.startsWith(PERIOD_PREFIX)) periods[part.slice(PERIOD_PREFIX.length, eq)] = part.slice(eq + 1);\n else if (eq > 0) picks[part.slice(0, eq)] = part.slice(eq + 1);\n else if (part) window = readPeriod(part);\n }\n return { window, picks, ...(Object.keys(periods).length ? { periods } : {}) };\n}\n\n/** A free-form page's place, read from its slot: the parameters it declares, and nothing else a link carried. */\nexport function pagePlace(dashboard: DashboardDef, body: unknown): Picks {\n const params = dashboard.page?.params ?? [];\n return Object.fromEntries(Object.entries(parseRootSlot(body).picks).filter(([name]) => params.includes(name)));\n}\n\n/** Every section of a dashboard, main flow and aside. */\nexport const allSections = (dashboard: DashboardDef): Section[] => [...dashboard.sections, ...(dashboard.aside ?? [])];\n\n/** Ignore selections the current dashboard no longer offers: a window, a pick or a section's period it does not have. */\nexport function dashboardSelection(dashboard: DashboardDef, body: unknown): { window: string | null; picks: Picks; periods: Periods } {\n const linked = parseRootSlot(body);\n const periods: Periods = {};\n for (const section of allSections(dashboard)) {\n const slug = section.windowKey ? linked.periods?.[section.windowKey] : undefined;\n const phrase = slug ? section.windows?.find((w) => windowSlug(w) === slug) : undefined;\n if (phrase) periods[section.windowKey!] = phrase;\n }\n /* What the address says wins; unsaid, or a window no longer offered, is the one the dashboard opens on. */\n const offered = dashboard.windows?.find((w) => windowSlug(w) === linked.window);\n return {\n window: dashboard.window && linked.window === ALL_TIME ? null : (offered ?? dashboard.window ?? null),\n picks: Object.fromEntries(Object.entries(linked.picks).filter(([column]) => (dashboard.filters ?? []).includes(column))),\n periods,\n };\n}\n\n/**\n * Groups in the order a reader expects them: a column with a vocabulary (a\n * CHECK list, an enum) in that vocabulary's order — a pipeline reads\n * Prospecting, Qualification, Proposal, Negotiation, never the alphabet —\n * and anything else biggest first. Groups the vocabulary does not name (an\n * empty one, a stray value) come after it, biggest first.\n */\nexport function orderGroups<T extends Record<string, unknown>>(\n rows: readonly T[],\n key: string,\n value: string,\n vocabulary?: readonly string[],\n): T[] {\n const rank = new Map((vocabulary ?? []).map((word, at) => [word, at]));\n const place = (row: T) => (row[key] == null ? undefined : rank.get(String(row[key]))) ?? Number.POSITIVE_INFINITY;\n return [...rows].sort((a, b) => {\n const first = place(a),\n second = place(b);\n if (first !== second) return first - second;\n return (Number(b[value]) || 0) - (Number(a[value]) || 0);\n });\n}\n\n/**\n * A bar's length as a share of the largest group, not of the whole: three\n * equal groups each fill the track, rather than a third of it each, and the\n * biggest group always reaches the end. Never under 2%, so a group is seen.\n */\nexport function barShare(value: unknown, largest: number): number {\n return Math.max(2, Math.round((100 * (Number(value) || 0)) / Math.max(largest, 1)));\n}\n\n/**\n * A group's key said by the name of the record it is, where the answer names\n * it (a breakdown by a reference, `names` beside its rows: breakdown.ts,\n * withGroupNames), else as `sayKey` says the key: \"Ada Park\", not \"17\", as\n * the grid's cell says the same reference. Not called `say`: the build reads\n * every `say` in a module as the catalog's (vite.config.ts, short-catalog-keys).\n */\nexport function namedGroups(\n answer: { names?: Record<string, Record<string, string>> } | undefined,\n keyName: string | undefined,\n sayKey: (key: unknown) => string,\n): (key: unknown) => string {\n const names = keyName ? answer?.names?.[keyName] : undefined;\n if (!names) return sayKey;\n return (key) => (key != null && Object.hasOwn(names, String(key)) ? names[String(key)] : sayKey(key));\n}\n","import type { TextMeasure } from './gridSizing.js';\n\n/** Text widths in one font, from a shared canvas; `undefined` where there is\n no 2D context (the component tests), which falls back to counting. */\nlet measuringContext: CanvasRenderingContext2D | null | undefined;\nconst measures = new Map<string, TextMeasure>();\nexport function textMeasure(font: string): TextMeasure | undefined {\n if (measuringContext === undefined) {\n try {\n measuringContext = document.createElement('canvas').getContext('2d');\n } catch {\n measuringContext = null;\n }\n }\n const context = measuringContext;\n if (!context) return undefined;\n const known = measures.get(font);\n if (known) return known;\n const cache = new Map<string, number>();\n const measure: TextMeasure = (text) => {\n const seen = cache.get(text);\n if (seen !== undefined) return seen;\n context.font = font;\n /* Cells set their figures tabular (themeFamilies.css), and a canvas cannot: measured proportional,\n \"$105,828\" came out a few pixels short and its cell cut it to \"$105,8…\". A tabular figure is as wide\n as a zero, so every figure is measured as one. */\n const width = context.measureText(text.replace(/[0-9]/g, '0')).width;\n cache.set(text, width);\n return width;\n };\n measures.set(font, measure);\n return measure;\n}\n","/** What breakdownBatch says, in the dashboards room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../messages.js';\n\nexport const say = defineMessages({\n theBreakdownBatchCame: 'The breakdown batch came back the wrong length.',\n});\n","/**\n * A dashboard's breakdowns, and its lists, asked for together.\n *\n * Every card on a home asks for its number, a compare window's number and a\n * spark, and every chart and table once more: about thirty requests for eight\n * cards, queued behind one active connection and six browser sockets. The\n * cards still each ask for what they need (React Query keys, caches and\n * refetches each one); this only carries the questions that are asked in the\n * same moment in one request (`/api/breakdowns`) and hands each card its own\n * answer, or its own error. A dashboard's lists (its tables, the aside's\n * rows) are carried the same way (`batchedRun`): on a home, they were eight\n * requests of their own, each a round trip for a statement or two.\n *\n * A server that does not take a batch — a support session inside a tenant,\n * whose every read is ledgered as the one read it is, answers 404, and so does\n * an older server — is asked one at a time for the rest of the page's life.\n * A tenant or platform lease takes it: one admission for the cards, not one each.\n */\nimport { api } from './core.js';\nimport { sameReads } from './liveReads.js';\nimport { composedReply, mayBeComposed } from './composedReads.js';\nimport { composedConnection } from './composedHook.js';\nimport { firstPaintItem } from './firstPaint.js';\nimport type { HttpBreakdownDefinition } from '@mistriwork/engine/shared/resourceHttp.js';\nimport { say } from './copy/dashboards/breakdownBatch.js';\n\n/** A line of the language, or the structured breakdown a page's plan built;\n * `owner` routes it as `ownedBy` would (a page's own connection), and only\n * asks that go to the same owner share a request. */\ntype BreakdownAsk = (\n | { text: string; def?: never; run?: never }\n | { def: HttpBreakdownDefinition; text?: never; run?: never }\n /* A list's first page, as `/api/run` takes it. */\n | { run: RunAsk; text?: never; def?: never }\n) & { limit?: number; owner?: Record<string, string> };\ninterface RunAsk {\n q: string;\n limit: number;\n offset?: number;\n count?: 'none';\n exactCount?: boolean;\n}\n\ninterface Pending {\n ask: BreakdownAsk;\n resolve: (value: unknown) => void;\n reject: (error: unknown) => void;\n}\n\n/* The server's own ceiling (resourceReadHttp.ts, BREAKDOWN_BATCH). */\nconst MOST = 48;\nlet queue: Pending[] = [];\nlet scheduled = false;\n/* Set once a server says it has no such route; the rest of the page's life\n asks one at a time rather than being refused again. */\nlet unsupported = false;\n\nconst item = (ask: BreakdownAsk) =>\n ask.run ? { run: ask.run } : { ...(ask.def ? { def: ask.def } : { text: ask.text }), ...(ask.limit ? { limit: ask.limit } : {}) };\nconst single = (ask: BreakdownAsk) =>\n ask.run\n ? api('/api/run', { ...ask.run, ...ask.owner } as Parameters<typeof api<'/api/run'>>[1])\n : api('/api/breakdown', { ...item(ask), ...ask.owner } as Parameters<typeof api<'/api/breakdown'>>[1]);\n\n/** A list's first page, answered as `/api/run` would answer it, asked with the breakdowns of the same moment. */\nexport function batchedRun<T = unknown>(run: RunAsk, owner?: Record<string, string>): Promise<T> {\n return batchedBreakdown<T>({ run, ...(owner ? { owner } : {}) });\n}\n\n/** One breakdown, answered as `/api/breakdown` would answer it. */\nexport async function batchedBreakdown<T = unknown>(ask: BreakdownAsk): Promise<T> {\n /* A record page's figures come with its compose (composedReads.ts). */\n if (mayBeComposed('/api/breakdown')) {\n const composed = await composedReply('/api/breakdown', { ...item(ask), ...ask.owner });\n if (composed !== undefined) return composed as T;\n }\n /* A first page's sections come with the page (firstPaint.ts), each by what it asks. */\n const carried = firstPaintItem(ask.run ? 'run' : 'breakdown', ask.owner?.app ?? ask.owner?.conn ?? composedConnection(), item(ask));\n if (carried !== undefined) return carried as T;\n if (unsupported) return single(ask) as Promise<T>;\n return new Promise<T>((resolve, reject) => {\n queue.push({ ask, resolve: resolve as (value: unknown) => void, reject });\n if (scheduled) return;\n scheduled = true;\n /* A macrotask, not a microtask: the cards of one render mount their\n queries across several microtasks, and a timer is after all of them. */\n setTimeout(flush, 0);\n });\n}\n\nasync function flush() {\n scheduled = false;\n const waiting = queue;\n queue = [];\n const owners = new Map<string, Pending[]>();\n for (const pending of waiting) {\n const key = JSON.stringify(pending.ask.owner ?? {});\n owners.set(key, [...(owners.get(key) ?? []), pending]);\n }\n for (const group of owners.values()) {\n for (let start = 0; start < group.length; start += MOST) void send(group.slice(start, start + MOST));\n }\n}\n\nasync function send(batch: Pending[]) {\n if (batch.length === 1) {\n const [only] = batch;\n return single(only!.ask).then(only!.resolve, only!.reject);\n }\n let results: Array<{ status: number; body: unknown }>;\n let reply: unknown;\n try {\n reply = await api('/api/breakdowns', { items: batch.map(({ ask }) => item(ask)), ...batch[0]!.ask.owner });\n const said = reply as { results?: typeof results } | undefined;\n results = Array.isArray(said?.results) && said.results.length === batch.length ? said.results : [];\n if (!results.length) throw Object.assign(new Error(say('theBreakdownBatchCame')), { status: 404 });\n } catch (error) {\n const status = (error as { status?: number }).status;\n if (status === 404 || status === 405) unsupported = true;\n /* Whatever refused the batch, each card is owed its own answer: asked\n alone, a card gets the error its own read would, not the batch's. */\n for (const { ask, resolve, reject } of batch) single(ask).then(resolve, reject);\n return;\n }\n batch.forEach(({ resolve, reject }, index) => {\n const { status, body } = results[index]!;\n if (status < 400) return resolve(sameReads(body, reply));\n const said = body as { error?: string; message?: string } | null;\n reject(Object.assign(new Error(said?.message ?? said?.error ?? say('common.requestFailed', { status })), { status }));\n });\n}\n\n/** For tests: forget that a server refused the batch. */\nexport function resetBreakdownBatch() {\n queue = [];\n scheduled = false;\n unsupported = false;\n}\n","/** What AppColumnMenu says, in the column menu room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n columnOptions: '{label} column options',\n sortFilterPin: '{label}: sort, filter, pin',\n});\n","/**\n * An App list's column menu: the header's ⌄ with at most five entries.\n *\n * The Workbench keeps its power menu (ThMenu.tsx). In an App the reader\n * gets the two sorts in the column's own words, one Filter… that opens the\n * control the filter rail draws for the column (FilterRail.tsx's facet,\n * through the list bar's picker, so the three look and behave alike), Clear\n * filter while the column is narrowed, and Pin column, last. Where the list's\n * rail is beside the rows and already shows the column, Filter… goes to that\n * facet rather than opening a second one over it.\n *\n * What an open menu says and does is its own part (AppColumnMenuPopups.tsx),\n * loaded the first time a ⌄ is hovered, focused or opened.\n *\n * The list (AppList.tsx) provides what the menu writes through, as a ref\n * read when the menu is used: a context value that changed with every\n * keystroke in the search box would redraw the whole grid under it.\n */\nimport { createContext, useContext, useEffect, useRef, useState, type ComponentType, type RefObject } from 'react';\nimport type { ColumnMeta, TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport { onDemand } from './onDemand.js';\nimport type { Box } from './FilterBoxes.js';\nimport type { FacetUnit } from './FilterRail.js';\nimport type { FilterPickerProps } from './ListFilterBar.js';\nimport { say as sayCopy } from '../copy/columnMenu/components/AppColumnMenu.js';\n\n/** What an App list lends its grid's column menus. */\nexport interface AppColumnMenuHost {\n table: TableMeta;\n /** The whole question on screen, sort and all. */\n query: string;\n /** The reader's part of it, as the list's controls read it. */\n refinement: string;\n tabQuery: string;\n standing: string;\n /** The list's own key: its pins are its own, not its table's. */\n listKey: string;\n boxFor: (column: string) => Box | undefined;\n unitOf: (column: string) => FacetUnit | undefined;\n /** A new refinement, with the header whose menu asked for it taking the focus back. */\n apply: (refinement: string, column: string) => void;\n /** A new whole question (a sort), likewise. */\n navigate: (query: string, column: string) => void;\n /* Lent rather than imported, so the grid, which every surface draws, does\n not carry the list bar's pickers into rooms that have no App list. */\n /** The list bar's picker (ListFilterBar.tsx), which Filter… opens. */\n Picker: ComponentType<FilterPickerProps>;\n /** The rail's facet for the column, where a rail beside the rows shows it. */\n railFacet: (column: string) => HTMLElement | null;\n}\n\n/* The ⌄ a choice was made from, to take the focus back once the list has\n redrawn under it: the rows of a new question arrive after the navigation,\n and the header with them. A few seconds, not forever — a question that\n lands on no rows draws no header to come back to. */\nlet comeBack: { column: string; at: number } | null = null;\n/** Say which column's ⌄ takes the focus when the grid next draws. */\nexport function returnFocusTo(column: string): void {\n comeBack = { column, at: Date.now() };\n}\n\nexport const AppColumnMenuContext = createContext<RefObject<AppColumnMenuHost | null> | null>(null);\nexport const useAppColumnMenu = () => useContext(AppColumnMenuContext);\n\nconst Popups = onDemand(() => import('./AppColumnMenuPopups.js'), 'AppColumnMenuPopups', { quiet: true });\n\n/** What a column's ⌄ is told of its column. */\nexport interface ColumnMenuProps {\n name: string;\n /** The column's caption, for the button's name and the popover's. */\n label: string;\n kind: string;\n meta: ColumnMeta | undefined;\n sortable: boolean;\n current: 'asc' | 'desc' | null;\n /** The path a reference is drawn by (`owner_id.name`), where the list names it. */\n drawnBy?: string;\n /** The columns as drawn, for the pin store's order. */\n columns: string[];\n}\n\nexport function AppColumnMenuButton({ host, ...column }: ColumnMenuProps & { host: RefObject<AppColumnMenuHost | null> }) {\n const { name, label } = column;\n const button = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState<'menu' | 'filter' | null>(null);\n /* Where the focus goes as the menu closes: back to the ⌄, or on into the\n popover or the rail, which take it themselves. */\n const handBack = useRef(true);\n useEffect(() => {\n if (!comeBack || comeBack.column !== name) return;\n if (Date.now() - comeBack.at < 3000) button.current?.focus();\n comeBack = null;\n });\n if (!host.current) return null;\n const soon = () => {\n void Popups.ready();\n };\n return (\n <>\n <button\n ref={button}\n type=\"button\"\n className=\"th-filter\"\n data-column={name}\n aria-label={sayCopy('columnOptions', { label })}\n title={sayCopy('sortFilterPin', { label })}\n aria-haspopup=\"menu\"\n aria-expanded={open === 'menu'}\n onPointerEnter={soon}\n onFocus={soon}\n onClick={(e) => {\n e.stopPropagation();\n handBack.current = true;\n setOpen(open === 'menu' ? null : 'menu');\n }}\n >\n <span className=\"th-filter-icon\" aria-hidden=\"true\" />\n </button>\n {open && <Popups host={host} button={button} open={open} setOpen={setOpen} handBack={handBack} {...column} />}\n </>\n );\n}\n","/**\n * A row's children, opened in place — the vanilla client's view of it.\n *\n * The expander and the detail row are components (components/Nested.tsx) and\n * their answers live in the Query cache; what stays here is what the rest\n * of the client asks: whether a table has children at all, and the reset a\n * new result calls for.\n */\nimport { refsTo } from './core.js';\nimport { queryClient } from './components/mount.js';\n\n/** A new result means new rows; answers cached against the old ones are\n answers to a question nobody is asking any more. A row still open on\n screen is still asking — a sort or a page re-asks the table in place and\n keeps it open — so its answer is refreshed where it stands rather than\n pulled from under it. */\nexport function resetNested() {\n const cache = queryClient.getQueryCache();\n for (const query of cache.findAll({ queryKey: ['nested'] })) {\n if (query.getObserversCount() > 0) void queryClient.invalidateQueries({ queryKey: query.queryKey, exact: true });\n else cache.remove(query);\n }\n}\n\n/** Whether expanding would show anything at all. */\nexport const hasChildren = (table) => Boolean(table) && refsTo(table.id).length > 0;\n","/**\n * How the same rows are read on a phone — as records or as the table — as a\n * two-icon segmented control at the row's end, not a second row of tabs\n * under the list's own view tabs (which it matched word for word and\n * underline for underline). The names stay on the buttons for a screen reader.\n */\nexport function PresentationSwitch({\n layout,\n onChange,\n label,\n records,\n table,\n}: {\n layout: string;\n onChange: (mode: string) => void;\n label: string;\n records: string;\n table: string;\n}) {\n return (\n <div className=\"record-presentation\" role=\"group\" aria-label={label}>\n {(['records', 'table'] as const).map((mode) => (\n <button\n key={mode}\n type=\"button\"\n className=\"presentation-seg\"\n aria-pressed={layout === mode}\n aria-label={mode === 'records' ? records : table}\n title={mode === 'records' ? records : table}\n onClick={() => onChange(mode)}\n >\n <svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.4\">\n {mode === 'records' ? (\n <path d=\"M2 4h12M2 8h12M2 12h12\" />\n ) : (\n <>\n <rect x=\"2\" y=\"3\" width=\"12\" height=\"10\" rx=\"1\" />\n <path d=\"M2 7h12M6.5 3v10\" />\n </>\n )}\n </svg>\n </button>\n ))}\n </div>\n );\n}\n","/**\n * Folding a filter into an existing query.\n *\n * Pure — no DOM, no state — so the rules can be tested directly rather than\n * through a browser. They are fiddly enough to deserve it: the naive version\n * of this produces queries that silently match nothing.\n */\n\n/**\n * Fold a new condition into an existing query, following the grammar.\n *\n * The naive version — append \" and <condition>\" — produces\n * `status = scheduled and status = scheduled`, and picking a second value for\n * the same column gives `status = a and status = b`, which matches nothing.\n * Neither is what anyone means by clicking two values in a list.\n *\n * The rule that matches intent: conditions on *different* columns combine\n * with AND, conditions on the *same* column combine with OR — and the\n * language already has a word for OR within one column, so repeat equality\n * folds into `in (…)` rather than growing a chain of ors. That keeps the\n * query readable, which matters because the query is the thing you save,\n * share and edit by hand.\n */\nimport { splitConditions, splitQuery } from './clauses.js';\n\nexport function composeFilter(query, table, column, condition) {\n /* Clauses have to stay at the end for the parser to read them as clauses,\n so a new condition is inserted before them, never appended.\n \n Split by the shared splitter rather than by a regex of its own. The regex\n was blind to quotes, so `customer note = \"sort me\"` split at the `sort`\n inside the value: everything from that word became a clause, the\n condition was cut in half, and adding a filter destroyed the query it was\n added to. `splitQuery` masks quoted spans and sorts boundaries by\n position, which is the behaviour the query bar has always had — there was\n no reason for this file to have a second, worse one. */\n const parts = splitQuery(query);\n const head = `${parts.table}${parts.filter ? ` ${parts.filter}` : ''}`.trim();\n const tailPieces = [parts.show ? ` ${parts.show}` : '', parts.sort ? ` ${parts.sort}` : '', parts.limit ? ` ${parts.limit}` : ''];\n const tail = tailPieces.join('');\n\n const equality = condition.match(new RegExp(`^${escapeRe(column)}\\\\s*=\\\\s*(.+)$`));\n if (equality) {\n const value = equality[1].trim();\n /* Found by splitting the conditions rather than by matching a value with\n a regex. The regex read a value as `\\\\S+` — one token — which is most\n values and not all of them: `hired_on = this year` matched `this`, and\n folding it into a list replaced only that much, leaving\n\n employee hired_on in (this, last 7 days) year\n\n — text the parser cannot read, which came back as \"0 rows\" rather than\n as an error. A filter UI that silently empties the table is the thing\n this module exists to prevent, and it was doing it. */\n const existing = conditionOn(head, column, table);\n\n if (existing && existing.op === 'in') {\n if (existing.values.includes(value)) return `${head}${tail}`;\n /* A value that cannot sit in a list does not join one. */\n if (!listable(value)) return `${replaceCondition(head, table, existing, condition)}${tail}`;\n const merged = `${column} in (${[...existing.values, value].join(', ')})`;\n return `${replaceCondition(head, table, existing, merged)}${tail}`;\n }\n if (existing && existing.op === '=') {\n if (existing.value === value) return `${head}${tail}`;\n /* Two values fold into `in (…)` only when both are things a list can\n hold. A relative date phrase is not one: `last 7 days` is a *range*,\n and \"hired in this year or in the last seven days\" is not what\n picking a second period from a menu of periods means — picking one\n replaces the last. It is also not expressible, which is how the bug\n above announced itself. */\n if (!listable(value) || !listable(existing.value)) {\n return `${replaceCondition(head, table, existing, condition)}${tail}`;\n }\n const merged = `${column} in (${existing.value}, ${value})`;\n return `${replaceCondition(head, table, existing, merged)}${tail}`;\n }\n }\n\n /* A null check replaces any other condition on the same column: `x is\n empty and x = 3` is a contradiction, not a refinement. */\n const nullCheck = condition.match(new RegExp(`^${escapeRe(column)}\\\\s+is\\\\s+(not\\\\s+)?empty$`, 'i'));\n if (nullCheck) {\n const stripped = stripConditionsOn(head, column, table);\n return `${stripped}${stripped.trim() === table ? '' : ' and'} ${condition}${tail}`;\n }\n\n if (head === table) return `${head} ${condition}${tail}`;\n return `${head} and ${condition}${tail}`;\n}\n\n/**\n * Can this value sit inside `in (…)`?\n *\n * A bare token or a quoted string. Anything else — a relative date phrase, a\n * range, an unquoted value with a space in it — is not a list member, and the\n * list it would be written into is text no parser here accepts.\n */\nfunction listable(value) {\n const text = String(value ?? '').trim();\n if (!text) return false;\n /* Spelled out rather than as one regex: a quote character inside a regex\n literal is indistinguishable from the start of a string to anything\n reading this file with a tokenizer simpler than a parser, and\n `check-client-imports` is exactly that. */\n const quote = String.fromCharCode(34);\n if (text.startsWith(quote) && text.endsWith(quote) && text.length > 1) {\n return !text.slice(1, -1).includes(quote);\n }\n return !/[\\s,()]/.test(text);\n}\n\n/**\n * The one top-level condition on `column`, split the way the parser splits.\n *\n * Returns its exact text, so it can be swapped out without a regex having to\n * work out where a value ends — which is the mistake this file has now made\n * twice, once on quotes and once on multi-word values.\n */\nfunction conditionOn(head, column, table) {\n const body = head.slice(table.length).trim();\n const on = new RegExp(`^${escapeRe(column)}\\\\s*(=|\\\\bin\\\\b)`, 'i');\n for (const part of splitConditions(body)) {\n const text = part.trim();\n if (!on.test(text)) continue;\n const list = text.match(new RegExp(`^${escapeRe(column)}\\\\s+in\\\\s*\\\\(([^)]*)\\\\)$`, 'i'));\n if (list) {\n return {\n text,\n op: 'in',\n values: list[1]\n .split(',')\n .map((v) => v.trim())\n .filter(Boolean),\n };\n }\n const eq = text.match(new RegExp(`^${escapeRe(column)}\\\\s*=\\\\s*(.+)$`, 'i'));\n if (eq) return { text, op: '=', value: eq[1].trim() };\n }\n return null;\n}\n\n/** Swap one condition for another, leaving every other condition alone. */\nfunction replaceCondition(head, table, existing, next) {\n const body = head.slice(table.length).trim();\n const parts = splitConditions(body).map((part) => (part.trim() === existing.text ? next : part.trim()));\n return `${table} ${parts.join(' and ')}`.trim();\n}\n\n/**\n * Remove every top-level condition mentioning `column`.\n *\n * Split by `splitConditions`, which tracks quotes and parentheses. Splitting\n * on `\\s+and\\s+` took `name = \"a and b\"` apart in the middle of a value, and\n * took `(a = 1 and b = 2)` apart inside a group it was supposed to leave\n * whole — turning one condition the reader wrote into two the parser could\n * not read.\n */\nfunction stripConditionsOn(head, column, table) {\n const body = head.slice(table.length).trim();\n const kept = splitConditions(body).filter((part) => !new RegExp(`^${escapeRe(column)}\\\\b`, 'i').test(part.trim()));\n return kept.length ? `${table} ${kept.join(' and ')}` : table;\n}\n\nfunction escapeRe(text) {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n","/** What ThMenu says, in the column menu room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n greaterThan: 'greater than {mid}',\n lessThan: 'less than {mid}',\n ofTheFirst: 'of the first {rowsCount}',\n ofHere: 'of {rowsCount} here',\n equalsAValue: 'equals a value…',\n value: 'Value',\n greaterThanMore: 'greater than…',\n minimum: 'Minimum',\n lessThanMore: 'less than…',\n maximum: 'Maximum',\n onOrAfter: 'on or after…',\n date: 'Date',\n before: 'before…',\n contains: 'contains…',\n textToLook: 'Text to look for',\n starts: 'starts with…',\n prefix: 'Prefix',\n matchesAPattern: 'matches a pattern…',\n between: 'between…',\n noIndexAFull: 'no index — a full scan',\n filter: 'Filter {name}',\n addsAConditionToTheQuery: 'Adds a condition to the query, which you can edit afterwards.',\n bothEndsAreIncluded: 'Both ends are included. Adds a condition you can edit afterwards.',\n unpinThisColumn: 'Unpin this column',\n pinThisColumn: 'Pin this column',\n letItScrollAway: 'let it scroll away',\n keepItInView: 'keep it in view',\n sortAscending: 'Sort ascending',\n sortDescending: 'Sort descending',\n thenByAscending: 'Then by, ascending',\n thenByDescending: 'Then by, descending',\n fieldFrom: '{fieldLabel} from',\n fieldTo: '{fieldLabel} to',\n});\n","/**\n * The column header's ⌄ menu: pin, sort, and a filter built from what the\n * column holds — sampled values where the column repeats, typed conditions\n * always, ranges where a range means anything. The sampling round trip\n * stays in `thmenu.js`; this is the menu, and the rule for what it offers.\n */\nimport { Menu } from '@base-ui/react/menu';\nimport { layoutViewport, zoomAnchor } from '@mistriwork/ui/internal/anchor.js';\nimport { go, quote, refine, render, tableView } from '../core.js';\nimport { addSort, nextSort, sortCount, sortDirection } from '../clauses.js';\nimport { SORT_SCAN_BELOW } from '../columns.js';\nimport { composeFilter } from '../compose.js';\nimport { promptFor, promptForRange } from '../prompt.js';\nimport { pinnedFor, togglePin } from '../pins.js';\nimport type { TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport { formatNumber } from '../locale.js';\nimport { say } from '../copy/columnMenu/components/ThMenu.js';\nimport { popupContainer } from '../shellHost.js';\n\nexport type Kind = 'boolean' | 'date' | 'number' | 'text' | string;\ntype Row = Record<string, unknown>;\nexport interface Typed {\n label: string;\n build: (value: string) => string;\n placeholder: string;\n type: string;\n}\nexport interface Offer {\n options: Array<[string, string]>;\n typed: Typed[];\n ranges: Array<[string, string, string]>;\n asStamp: (v: string) => string;\n}\n\n/** Quote a typed value only when the grammar needs it. Trimmed, then handed to the one quoter. */\nconst quoteValue = (text: string) => quote(String(text).trim()) as string;\n\n/**\n * What the menu offers a column of this kind, given a sample of its rows.\n * Dates get ranges, not equality; sampled values only where the column\n * repeats; typed conditions always, because on a key the sample is a list\n * of arbitrary values and the thing wanted is to name one.\n */\nexport function offersFor(name: string, kind: Kind, dateish: boolean, rows: Row[], metaType?: string): Offer {\n const options: Array<[string, string]> = [];\n if (kind === 'boolean') {\n options.push(['is true', `${name} = true`], ['is false', `${name} = false`]);\n } else if (kind === 'date' || dateish) {\n for (const phrase of ['today', 'last 7 days', 'last 30 days', 'this month', 'last month', 'this year'])\n options.push([phrase, `${name} = ${phrase}`]);\n } else if (kind === 'number') {\n const values = rows.map((r) => Number(r[name])).filter((n) => Number.isFinite(n));\n if (values.length) {\n const mid = Math.round((Math.min(...values) + Math.max(...values)) / 2);\n options.push(\n [say('greaterThan', { mid: formatNumber(mid) }), `${name} > ${mid}`],\n [say('lessThan', { mid: formatNumber(mid) }), `${name} < ${mid}`],\n );\n }\n }\n const counts = new Map<unknown, number>();\n for (const row of rows) {\n const value = row[name];\n if (value === null || value === undefined) continue;\n counts.set(value, (counts.get(value) ?? 0) + 1);\n }\n const distinct = [...counts.entries()].sort((a, b) => b[1] - a[1]);\n if (distinct.length && distinct.length <= Math.max(3, rows.length / 2)) {\n /* The counts are honest about their sample: bare numbers read as table totals. */\n const sampled = rows.length >= 400 ? say('ofTheFirst', { rowsCount: rows.length }) : say('ofHere', { rowsCount: rows.length });\n for (const [value, count] of distinct.slice(0, 8)) {\n const text = String(value);\n const quoted = /^[\\w.-]+$/.test(text) ? text : `\"${text.replace(/\"/g, '')}\"`;\n options.push([`${text} · ${count} ${sampled}`, `${name} = ${quoted}`]);\n }\n }\n options.push(['is empty', `${name} is empty`], ['is not empty', `${name} is not empty`]);\n\n /* A timestamp gets a time in its picker and a date does not, read off the declared type so the answer is the same before the table has rows. */\n const hasTime = /time|timestamp/i.test(metaType ?? '');\n const dateInput = hasTime ? 'datetime-local' : 'date';\n /* `2026-01-01T09:30` is what the control hands back and not what any of these databases write. */\n const asStamp = (v: string) => String(v).replace('T', ' ');\n const typed: Typed[] =\n kind === 'number'\n ? [\n { label: say('equalsAValue'), build: (v) => `${name} = ${v}`, placeholder: say('value'), type: 'text' },\n { label: say('greaterThanMore'), build: (v) => `${name} > ${v}`, placeholder: say('minimum'), type: 'text' },\n { label: say('lessThanMore'), build: (v) => `${name} < ${v}`, placeholder: say('maximum'), type: 'text' },\n ]\n : kind === 'date'\n ? [\n { label: say('onOrAfter'), build: (v) => `${name} >= ${quoteValue(asStamp(v))}`, placeholder: say('date'), type: dateInput },\n { label: say('before'), build: (v) => `${name} < ${quoteValue(asStamp(v))}`, placeholder: say('date'), type: dateInput },\n ]\n : [\n { label: say('equalsAValue'), build: (v) => `${name} = ${quoteValue(v)}`, placeholder: say('value'), type: 'text' },\n { label: say('contains'), build: (v) => `${name} contains ${quoteValue(v)}`, placeholder: say('textToLook'), type: 'text' },\n { label: say('starts'), build: (v) => `${name} startswith ${quoteValue(v)}`, placeholder: say('prefix'), type: 'text' },\n /* The escape hatch from the three above, which all escape `%`. Here the wildcards are the question. */\n {\n label: say('matchesAPattern'),\n build: (v) => `${name} like ${quoteValue(v)}`,\n placeholder: say('common.patternEGWh'),\n type: 'text',\n },\n ];\n const ranges: Array<[string, string, string]> =\n kind === 'date' ? [[say('between'), dateInput, say('date')]] : kind === 'number' ? [[say('between'), 'text', say('value')]] : [];\n return { options, typed, ranges, asStamp };\n}\n\ninterface FilterMenuProps {\n anchor: HTMLElement;\n name: string;\n kind: Kind;\n metaType?: string;\n dateish: boolean;\n rows: Row[];\n table: TableMeta | undefined;\n /** The columns as drawn, for the pin store's order. */\n columns: string[];\n entry: { table: string; query: string } | null;\n onClose: () => void;\n}\n\nexport function FilterMenu({ anchor, name, kind, metaType, dateish, rows, table, columns, entry, onClose }: FilterMenuProps) {\n const offer = offersFor(name, kind, dateish, rows, metaType);\n const pinned = table ? (pinnedFor(table, columns) as string[]) : [];\n /* Sort and filter from a header refine the room on screen rather than\n starting it over (core.js `refine`): the grid is re-asked in place. */\n const apply = (condition: string) => {\n if (entry) refine(() => go(tableView(entry.table, composeFilter(entry.query, entry.table, name, condition)), 'replace'));\n };\n const add = (condition: string) => {\n apply(condition);\n onClose();\n };\n /* Sorting always offered, whatever the index says, and the cost stated rather than the action withheld. */\n const indexLeads = !table?.indexed || table.indexed.includes(name);\n const bigTable =\n (table as { approxRows?: number } | undefined)?.approxRows != null &&\n (table as { approxRows: number }).approxRows >= (SORT_SCAN_BELOW as number);\n const sortsAlready = Boolean(entry) && (sortCount(entry!.query) as number) > 0 && sortDirection(entry!.query, name) === null;\n const sortItem = (label: string, direction: 'asc' | 'desc', append = false) =>\n entry ? (\n <Item\n key={label}\n onClick={() => {\n refine(() => go(tableView(entry.table, (append ? addSort : nextSort)(entry.query, name, direction)), 'replace'));\n onClose();\n }}\n >\n <span className=\"th-menu-label\">{label}</span>\n <span className=\"th-menu-cond\">{indexLeads || !bigTable ? `sort ${name}` : say('noIndexAFull')}</span>\n </Item>\n ) : null;\n\n const ask = async (typed: Typed) => {\n onClose();\n const value = await promptFor({\n title: say('filter', { name }),\n label: typed.label,\n placeholder: typed.placeholder,\n type: typed.type,\n confirmLabel: say('common.apply'),\n hint: say('addsAConditionToTheQuery'),\n });\n if (value) apply(typed.build(value));\n };\n const askRange = async ([, inputType, fieldLabel]: [string, string, string]) => {\n onClose();\n const range = await promptForRange({\n title: say('filter', { name }),\n fromLabel: say('fieldFrom', { fieldLabel }),\n toLabel: say('fieldTo', { fieldLabel }),\n type: inputType,\n hint: say('bothEndsAreIncluded'),\n placeholder: undefined,\n });\n if (range) apply(`${name} between ${quoteValue(offer.asStamp(range.from))} and ${quoteValue(offer.asStamp(range.to))}`);\n };\n /* Base UI owns the menu's keyboard and its dismissal: focus moves in on\n open, arrows walk the items, Escape and a click outside close only this\n layer, and focus goes back to the ⌄ that opened it. Placed under the\n header on the zoom-aware ruler, flipped or shifted when it would run\n off an edge — which happens constantly on a wide table scrolled to the end. */\n return (\n <Menu.Root\n open\n onOpenChange={(next) => {\n if (next) return;\n /* Dismissed rather than used: the keyboard goes back to the ⌄. */\n if (anchor.isConnected) anchor.focus();\n onClose();\n }}\n >\n <Menu.Portal container={popupContainer()}>\n <Menu.Positioner\n anchor={() => zoomAnchor(anchor)}\n positionMethod=\"fixed\"\n side=\"bottom\"\n align=\"start\"\n sideOffset={4}\n collisionBoundary={layoutViewport()}\n collisionPadding={12}\n style={{ zIndex: 40 }}\n >\n <Menu.Popup className=\"th-menu\" finalFocus={() => (anchor.isConnected ? anchor : false)}>\n {/* First, because it is the one item about *reading* the table rather than narrowing it. */}\n {table ? (\n <Item\n onClick={() => {\n togglePin(table, columns, name);\n onClose();\n render();\n }}\n >\n <span className=\"th-menu-label\">{pinned.includes(name) ? say('unpinThisColumn') : say('pinThisColumn')}</span>\n <span className=\"th-menu-cond\">{pinned.includes(name) ? say('letItScrollAway') : say('keepItInView')}</span>\n </Item>\n ) : null}\n {sortItem(say('sortAscending'), 'asc')}\n {sortItem(say('sortDescending'), 'desc')}\n {/* \"Then by\" appears only once there is something to be *after*. */}\n {sortsAlready ? sortItem(say('thenByAscending'), 'asc', true) : null}\n {sortsAlready ? sortItem(say('thenByDescending'), 'desc', true) : null}\n {table ? <Menu.Separator className=\"th-menu-sep\" /> : null}\n {offer.typed.map((typed) => (\n <Item key={typed.label} className=\"th-menu-item th-menu-typed\" onClick={() => void ask(typed)}>\n <span className=\"th-menu-label\">{typed.label}</span>\n </Item>\n ))}\n {offer.ranges.map((range) => (\n <Item key={range[0]} className=\"th-menu-item th-menu-typed\" onClick={() => void askRange(range)}>\n <span className=\"th-menu-label\">{range[0]}</span>\n </Item>\n ))}\n {offer.typed.length ? <Menu.Separator className=\"th-menu-sep\" /> : null}\n {offer.options.map(([label, condition]) => (\n <Item key={condition + label} onClick={() => add(condition)}>\n <span className=\"th-menu-label\">{label}</span>\n <span className=\"th-menu-cond\">{condition}</span>\n </Item>\n ))}\n </Menu.Popup>\n </Menu.Positioner>\n </Menu.Portal>\n </Menu.Root>\n );\n}\n\n/** One row of the menu, drawn as the button it always was. */\nfunction Item({ className = 'th-menu-item', onClick, children }: { className?: string; onClick: () => void; children: React.ReactNode }) {\n /* The handlers close the menu themselves (onClose unmounts it), so the\n item does not also ask Base UI to — that told the caller twice. */\n return (\n <Menu.Item render={<button type=\"button\" className={className} />} nativeButton closeOnClick={false} onClick={onClick}>\n {children}\n </Menu.Item>\n );\n}\n","/**\n * The per-column filter menu of the grid, and the sort it rewrites.\n *\n * Its own module: the grid is a component now, and this menu is the one\n * piece of it that stays a transient vanilla surface — appended to the\n * body, driven by the keyboard, gone on Escape — the way the palette and\n * the topbar's ··· menu are.\n */\nimport { createElement } from 'react';\nimport { api, currentEntry, findTable, go, looksLikeDateColumn, quote, refine, state, tableView } from './core.js';\nimport { addSort, nextSort } from './clauses.js';\nimport { mount, unmount } from './components/mount.js';\nimport { FilterMenu } from './components/ThMenu.js';\nimport { portalRoot, shellQueryAll } from './shellHost.js';\n\nlet host = null;\n\nfunction closeMenu() {\n if (!host) return;\n unmount(host);\n host.remove();\n host = null;\n}\n\n/**\n * Open the header menu for a column — `components/ThMenu.tsx`. What stays here is\n * the sampling: values come from the *unfiltered* table, not the visible\n * page, because once you have filtered to status = scheduled the page offers\n * exactly the filter you already applied.\n */\nexport async function openFilterMenu(anchor, meta, name, rows, plan) {\n closeMenu();\n const entryNow = currentEntry();\n let sample = rows;\n if (entryNow && entryNow.kind === 'table' && entryNow.query.trim() !== entryNow.table) {\n try {\n const unfiltered = await api('/api/run', { q: `${entryNow.table} show ${name}`, limit: 400, count: 'none' });\n if (unfiltered.rows?.length) sample = unfiltered.rows;\n } catch {\n // Sampling is a nicety; the rest of the menu still works without it.\n }\n }\n /* The header this menu belongs to may be gone: the sample takes a round\n trip, and navigating during it leaves the anchor detached. */\n if (!anchor.isConnected) return;\n\n const table = findTable(currentEntry()?.table ?? '');\n const columns = [...shellQueryAll('.table-wrap thead th')].map((th) => th.querySelector('.th-sort')?.firstChild?.textContent ?? '');\n host = document.createElement('div');\n host.className = 'host-contents';\n portalRoot().append(host);\n mount(\n host,\n createElement(FilterMenu, {\n anchor,\n name,\n kind: plan.kind,\n metaType: meta?.type,\n dateish: dateish(meta, name),\n rows: sample,\n table,\n columns,\n entry: entryNow && entryNow.kind === 'table' ? entryNow : null,\n onClose: closeMenu,\n }),\n );\n}\n\n/**\n * The date test from core.js, applied to the name the *result set* used.\n *\n * A joined column arrives under its path — `customer_id.opened_on` — and the\n * column meta beside it still calls itself `opened_on`, so the name has to be\n * passed in rather than read off the meta.\n *\n * The copy that used to be written out here had lost `timestamp`, `datetime`\n * and `deleted` from the name pattern, so the filter menu offered `=` on an\n * `event_timestamp TEXT` column and hid the relative-date phrases that are\n * the only sensible thing to say about a date.\n */\nconst dateish = (meta, name) => Boolean(meta) && looksLikeDateColumn({ type: meta.type, name });\n\n/**\n * `append` adds a level to the sort instead of replacing it — shift-click,\n * which is the gesture every grid uses for exactly this.\n */\nexport function sortBy(column, direction, append = false) {\n const entry = state.stack[state.stack.length - 1];\n if (!entry || entry.kind !== 'table') return;\n /* `nextSort` must keep receiving `undefined` when no direction was named:\n an explicit direction means \"write down what is already happening\" and\n deliberately skips the ascending → descending cycle. Defaulting it here\n cost the header its second click. `addSort` has no cycle to skip, so it\n takes a direction. */\n /* A refinement: the same table room re-asks in place (core.js `refine`),\n so the header that was clicked, the rows' decorations and the focus stay. */\n refine(() =>\n go(\n tableView(entry.table, append ? addSort(entry.query, column, direction ?? 'asc') : nextSort(entry.query, column, direction)),\n 'replace',\n ),\n );\n}\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/** What Nested says, in the lists and grid room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n showWhatPointsAtThisRow: 'Show what points at this row',\n looking: 'Looking…',\n nothingPointsAtThisRow: 'Nothing points at this row.',\n viaColumns: 'via {columns}',\n seeAll: 'See all →',\n});\n","/**\n * A row's children, opened in place.\n *\n * The view composer answers \"how many\" with an aggregate and deliberately\n * refuses to LEFT JOIN a has-many, because that multiplies the base row.\n * Expanding a row is the answer that does not multiply it: the children\n * live in their own row underneath, one query per relationship keyed on\n * that row, so the base row remains one row and its numbers its own.\n *\n * Fetched when opened rather than with the page, and kept by Query so that\n * closing and reopening is free; a new result clears the cache (see\n * `resetNested` in nested.js).\n */\nimport { useQuery } from '@tanstack/react-query';\nimport { api, findTable, go, keyOf, openRecord, quote, refsTo, tableView } from '../core.js';\nimport { equalityFilter } from '../resourceRequests.js';\nimport type { TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport type { Grid as GridComponent, GridData, Row } from './Grid.js';\nimport { formatApprox, formatNumber } from '../locale.js';\nimport { say } from '../copy/lists/components/Nested.js';\n\n/** Rows of a child table shown inline before it needs its own page. */\nconst INLINE = 5;\n\ninterface Fk {\n name: string;\n from: { table: string; columns: string[] };\n to: { table: string; columns: string[] };\n}\n\ninterface Section {\n fk: Fk;\n child: TableMeta;\n data?: GridData;\n total?: number;\n exact?: boolean;\n error?: string;\n}\n\nasync function fetchChildren(table: TableMeta, key: Record<string, unknown>): Promise<Section[]> {\n const sections = await Promise.all(\n (refsTo(table.id) as Fk[]).map(async (fk): Promise<Section | null> => {\n const child = findTable(fk.from.table) as TableMeta | undefined;\n if (!child) return null;\n /* Every column of the key has to match, which is what makes this correct\n for a composite key and not only for a single-column one. */\n const conditions = fk.to.columns.map((parentColumn, i) => ({\n column: fk.from.columns[i] ?? fk.from.columns[0],\n op: '=',\n value: key[parentColumn],\n }));\n if (conditions.some((c) => c.value === undefined || c.value === null)) return null;\n try {\n const filter = equalityFilter(Object.fromEntries(conditions.map((condition) => [condition.column, condition.value])));\n // A source that reports no totals (an API) is not asked for one it would refuse.\n const counted = child.countable !== false;\n const [data, total] = await Promise.all([\n api('/api/query', { table: child.id, filter, limit: INLINE, offset: 0 }),\n counted ? api('/api/count', { table: child.id, filter }) : Promise.resolve(undefined),\n ]);\n return { fk, child, data, total: total?.count, exact: total?.exact };\n } catch (err) {\n return { fk, child, error: (err as Error).message };\n }\n }),\n );\n return sections.filter((s): s is Section => Boolean(s)).filter((s) => s.error || (s.data?.rows.length ?? 0) > 0);\n}\n\n/** The little triangle, drawn into its row's host (components/RowHost.tsx).\n The row itself navigates; opening the detail is a different intent and\n must not also walk away from the table — or out of whatever holds it. */\nexport function Expander({ open, onToggle }: { open: boolean; onToggle: () => void }) {\n return (\n <button\n type=\"button\"\n className=\"expander\"\n aria-expanded={open}\n aria-label={say('showWhatPointsAtThisRow')}\n title={say('showWhatPointsAtThisRow')}\n onClick={(e) => {\n e.stopPropagation();\n onToggle();\n }}\n >\n {open ? '▾' : '▸'}\n </button>\n );\n}\n\n/**\n * The detail, in a sibling `<tr>` rather than inside the row's own cell,\n * because a table row cannot contain another table without the inner one\n * inheriting the outer one's column widths.\n */\nexport function DetailRow({\n table,\n row,\n colSpan,\n grid: Grid,\n}: {\n table: TableMeta;\n row: Row;\n colSpan: number;\n /** The grid that draws a child's rows: handed in, since a nested grid is a Grid and an import would loop. */\n grid: typeof GridComponent;\n}) {\n const key = keyOf(table, row) as Record<string, unknown>;\n const children = useQuery({\n queryKey: ['nested', table.id, key],\n queryFn: () => fetchChildren(table, key),\n staleTime: Infinity,\n });\n return (\n <tr className=\"detail-row\">\n <td className=\"detail-cell\" colSpan={colSpan}>\n {children.isPending && <p className=\"loading\">{say('looking')}</p>}\n {children.data && !children.data.length && <p className=\"note\">{say('nothingPointsAtThisRow')}</p>}\n {children.data?.map((section) => (\n <div key={section.fk.name} className=\"detail-section\">\n {section.error ? (\n <>\n <h4>{section.child.name}</h4>\n <p className=\"sql-error\" role=\"alert\">\n {section.error}\n </p>\n </>\n ) : (\n <>\n <div className=\"detail-head\">\n <h4>{section.child.name}</h4>\n <span className=\"detail-via\">{say('viaColumns', { columns: section.fk.from.columns.join(', ') })}</span>\n {section.total !== undefined && (\n <span className=\"detail-count\">\n {section.exact === false ? `~${formatApprox(section.total)}` : formatNumber(section.total)}\n </span>\n )}\n {/* Without a total (an API), a full inline page is the sign that more follow. */}\n {(section.total === undefined\n ? (section.data?.rows.length ?? 0) >= INLINE\n : section.total > (section.data?.rows.length ?? 0)) && (\n <button\n type=\"button\"\n className=\"ghost detail-all\"\n onClick={() => {\n const conditions = section.fk.from.columns\n .map((col, i) => `${col} = ${quote(key[section.fk.to.columns[i]])}`)\n .join(' and ');\n go(tableView(section.child.id, `${section.child.id} ${conditions}`), 'push');\n }}\n >\n {say('seeAll')}\n </button>\n )}\n </div>\n <Grid\n table={section.child}\n data={section.data!}\n interactive={false}\n virtual={false}\n onRowClick={(childRow) => {\n const childKey = keyOf(section.child, childRow) as Record<string, unknown> | null;\n // Through openRecord: in app mode a nested row opens as a page too.\n if (childKey) void openRecord(section.child.id, childKey, String(Object.values(childKey).join('/')));\n }}\n />\n </>\n )}\n </div>\n ))}\n </td>\n </tr>\n );\n}\n","/**\n * Moving around a result without a mouse.\n *\n * Arrow keys move a cell cursor, Enter opens the row's record — which is\n * the walk, done from the keyboard. Everything else follows from those two\n * and from the grid pattern people already know from a spreadsheet.\n *\n * The position is held as `(row, column)` indices, not elements. Above a\n * few hundred rows the table is virtualised and the `<tr>` under the cursor\n * is destroyed the moment it scrolls out of the window; indices survive\n * that, the element is looked up again on every move, and when the row has\n * not been painted yet the scroller is moved and the lookup retried.\n *\n * The hook version of grid.js: the same contract, with the listeners taken\n * down when the table or its shape changes rather than stacked on the\n * element by every repaint.\n */\nimport { useEffect, useRef, type RefObject } from 'react';\nimport { viewportBox } from '../core.js';\nimport { shellById, shellQuery } from '../shellHost.js';\n\n/** Rows moved by PageUp/PageDown when the viewport cannot be measured. */\nconst PAGE_FALLBACK = 20;\n/** How many frames to wait for the virtualiser to paint a row we scrolled to. */\nconst PAINT_TRIES = 4;\n\ninterface GridKeyboardOptions {\n rowCount: number;\n columnCount: number;\n /** Leading cells before the first data column (an expander). */\n offset: number;\n onOpen?: (index: number) => void;\n /** Space: a glance at the row's record without leaving the list. */\n onPeek?: (index: number) => void;\n /** So a screen reader hears \"of 63,010\" rather than \"of 20\". */\n totalRows?: number;\n firstRow: number;\n}\n\nexport function useGridKeyboard(\n tableRef: RefObject<HTMLTableElement | null>,\n wrapRef: RefObject<HTMLElement | null>,\n opts: GridKeyboardOptions,\n): void {\n /* The cursor survives repaints: a sort that redraws the rows should not\n send the reader back to the top-left corner. */\n const cursor = useRef({ row: -1, col: 0 });\n const { rowCount, columnCount, offset, onOpen, onPeek, totalRows, firstRow } = opts;\n\n useEffect(() => {\n const table = tableRef.current;\n const wrap = wrapRef.current;\n if (!table || !wrap || !rowCount || !columnCount) return;\n const tbody = table.tBodies[0];\n if (!tbody) return;\n\n table.setAttribute('role', 'grid');\n table.setAttribute('aria-colcount', String(columnCount + offset));\n if (typeof totalRows === 'number') {\n table.setAttribute('aria-rowcount', String(totalRows));\n table.querySelector('thead tr')?.setAttribute('aria-rowindex', '1');\n for (const tr of tbody.querySelectorAll<HTMLTableRowElement>('tr[data-row]')) {\n tr.setAttribute('aria-rowindex', String(firstRow + Number(tr.dataset.row) + 2));\n }\n } else {\n table.removeAttribute('aria-rowcount');\n }\n\n const scrollerOf = () => (wrap.closest('.content') as HTMLElement | null) ?? (document.scrollingElement as HTMLElement | null);\n const rowAt = (i: number) => tbody.querySelector<HTMLTableRowElement>(`tr[data-row=\"${i}\"]`);\n const cellAt = (i: number, c: number) => (rowAt(i)?.children[c + offset] as HTMLElement | undefined) ?? null;\n\n const pageSize = () => {\n const sample = tbody.querySelector('tr[data-row]');\n const height = sample ? viewportBox(sample).height : 0;\n const view = scrollerOf()?.clientHeight;\n if (!height || !view) return PAGE_FALLBACK;\n return Math.max(1, Math.floor(view / height) - 1);\n };\n\n const focusCell = (tries = PAINT_TRIES) => {\n const { row, col } = cursor.current;\n const cell = cellAt(row, col);\n if (!cell) {\n if (tries <= 0) return;\n const sample = tbody.querySelector('tr[data-row]');\n const height = sample ? viewportBox(sample).height : 0;\n const scroller = scrollerOf();\n if (scroller && height) scroller.scrollTop = Math.max(0, row * height - scroller.clientHeight / 2);\n requestAnimationFrame(() => focusCell(tries - 1));\n return;\n }\n for (const stale of tbody.querySelectorAll<HTMLElement>('.cell-cursor')) {\n stale.classList.remove('cell-cursor');\n stale.removeAttribute('tabindex');\n }\n cell.classList.add('cell-cursor');\n cell.tabIndex = 0;\n /* The grid's tab stop moves to the cell, so tabbing in returns to\n where the cursor was left, and the table and the cell are never\n both stops. */\n table.tabIndex = -1;\n cell.focus({ preventScroll: true });\n cell.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n };\n\n const moveTo = (nextRow: number, nextCol: number) => {\n cursor.current = {\n row: Math.max(0, Math.min(rowCount - 1, nextRow)),\n col: Math.max(0, Math.min(columnCount - 1, nextCol)),\n };\n focusCell();\n };\n\n /* One stop for the whole grid, not one per cell. */\n table.tabIndex = 0;\n const onFocus = (e: FocusEvent) => {\n if (e.target !== table) return;\n const { row, col } = cursor.current;\n moveTo(row < 0 ? 0 : row, col);\n };\n // A click is also a way of saying where the cursor is.\n const onMouseDown = (e: MouseEvent) => {\n const cell = (e.target as Element).closest('td');\n const tr = cell?.closest<HTMLTableRowElement>('tr[data-row]');\n if (!cell || !tr) return;\n cursor.current = { row: Number(tr.dataset.row), col: Math.max(0, [...tr.children].indexOf(cell) - offset) };\n };\n const onKey = (e: KeyboardEvent) => {\n if ((e.target as Element).closest('input, textarea, select, [contenteditable]')) return;\n if (e.altKey) return;\n /* A control inside the grid — a header's sort, a row's expander, what a\n decoration puts in a row — answers its own Enter. The cursor's Enter\n opens a row from a cell; taken from a button it opened whichever row\n was last clicked instead of pressing the button, and a header that\n keeps its focus across a sort is exactly where a second Enter lands. */\n if ((e.key === 'Enter' || e.key === ' ') && (e.target as Element).closest('button, a')) return;\n const jump = e.metaKey || e.ctrlKey;\n const { row, col } = cursor.current;\n switch (e.key) {\n case 'ArrowDown':\n moveTo(jump ? rowCount - 1 : row + 1, col);\n break;\n case 'ArrowUp':\n moveTo(jump ? 0 : row - 1, col);\n break;\n case 'ArrowRight':\n moveTo(row, jump ? columnCount - 1 : col + 1);\n break;\n case 'ArrowLeft':\n moveTo(row, jump ? 0 : col - 1);\n break;\n case 'Home':\n moveTo(jump ? 0 : row, 0);\n break;\n case 'End':\n moveTo(jump ? rowCount - 1 : row, columnCount - 1);\n break;\n case 'PageDown':\n moveTo(row + pageSize(), col);\n break;\n case 'PageUp':\n moveTo(row - pageSize(), col);\n break;\n case 'Enter': {\n /* A cell holding more than its line — a JSON document — opens\n that, and a cell the list edits in place opens its editor; the\n row is a cell away. */\n const opener = cellAt(row, col)?.querySelector<HTMLElement>('[data-cell-opens]');\n if (opener) opener.click();\n else if (row >= 0 && onOpen) onOpen(row);\n break;\n }\n case 'F2': {\n /* A spreadsheet's edit key: a cell the list edits in place opens its\n editor (GridCellEditor.tsx), which Enter also does from the cell. */\n const editor = cellAt(row, col)?.querySelector<HTMLElement>('[data-cell-edits]');\n if (!editor) return;\n editor.click();\n break;\n }\n case ' ':\n /* A glance, as a file list's Space: the record over the list, J and\n K through its neighbors, Escape back to this cell. */\n if (row < 0 || !onPeek) return;\n onPeek(row);\n break;\n case 'Escape': {\n /* Back to the filter you would type into rather than nowhere. App\n mode hides the query bar, so there the landing is the list's own\n filter row. */\n table.blur();\n const query = shellById('query') as HTMLElement | null;\n if (query && query.offsetParent) query.focus();\n else (shellQuery('.applist-fields input, .applist-fields button') as HTMLElement | null)?.focus();\n break;\n }\n case 'c':\n if (!jump) return;\n void copyCell(cellAt(row, col));\n break;\n default:\n return;\n }\n e.preventDefault();\n };\n table.addEventListener('focus', onFocus);\n tbody.addEventListener('mousedown', onMouseDown);\n table.addEventListener('keydown', onKey);\n return () => {\n table.removeEventListener('focus', onFocus);\n tbody.removeEventListener('mousedown', onMouseDown);\n table.removeEventListener('keydown', onKey);\n };\n }, [tableRef, wrapRef, rowCount, columnCount, offset, onOpen, onPeek, totalRows, firstRow]);\n}\n\n/** Copy one cell: `title` before `textContent`, because a shortened value\n keeps the whole thing in its tooltip. */\nasync function copyCell(cell: HTMLElement | null): Promise<void> {\n if (!cell) return;\n const text = cell.getAttribute('title') ?? cell.textContent ?? '';\n try {\n await navigator.clipboard.writeText(text);\n cell.classList.add('cell-copied');\n setTimeout(() => cell.classList.remove('cell-copied'), 400);\n } catch {\n /* Clipboard access can be refused; the value is on screen. */\n }\n}\n","/**\n * Columns that stay put when a wide table scrolls sideways.\n *\n * `position: sticky` needs a `left` for each pinned column, and the offsets\n * are the widths of the columns before it — not known until the browser\n * has laid the table out. So they are measured after layout, again on\n * resize, and again when the rows are repainted under them, and handed\n * back as numbers for the cells to wear. Rounded *down*, so consecutive\n * frozen columns overlap by a fraction of a pixel rather than leaving a\n * hairline through which the scrolling content shows.\n */\nimport { useEffect, useLayoutEffect, useState, type RefObject } from 'react';\nimport { viewportBox } from '../core.js';\n\n/** Column name → sticky left, in layout pixels. */\ntype PinOffsets = Map<string, number>;\n\nexport function usePins(\n wrapRef: RefObject<HTMLElement | null>,\n drawn: string[],\n pinned: string[],\n /** Cell offset: an expander column shifts every data cell right by one. */\n shift: number,\n /** Anything whose change moves the columns — the rows painted. */\n repaintKey: unknown,\n): PinOffsets {\n const [lefts, setLefts] = useState<PinOffsets>(new Map());\n\n const measure = () => {\n const wrap = wrapRef.current;\n const head = wrap?.querySelector('thead tr') as HTMLTableRowElement | null;\n if (!wrap || !head || !pinned.length) {\n setLefts((m) => (m.size ? new Map() : m));\n return;\n }\n const indexes = pinned\n .map((name) => drawn.indexOf(name))\n .filter((i) => i >= 0)\n .sort((a, b) => a - b);\n let offset = 0;\n const next: PinOffsets = new Map();\n for (const i of indexes) {\n next.set(drawn[i], Math.floor(offset));\n const cell = head.cells[i + shift];\n offset += cell ? viewportBox(cell).width : 0;\n }\n setLefts((m) => {\n if (m.size === next.size && [...next].every(([k, v]) => m.get(k) === v)) return m;\n return next;\n });\n };\n\n useLayoutEffect(measure, [drawn.join(','), pinned.join(','), shift, repaintKey]); // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n const wrap = wrapRef.current;\n if (!wrap || !pinned.length) return;\n const size = new ResizeObserver(() => measure());\n size.observe(wrap);\n /* The seam appears only once there is something behind it. */\n const mark = () => {\n if (wrap.scrollLeft > 0) wrap.dataset.scrolled = '1';\n else delete wrap.dataset.scrolled;\n };\n wrap.addEventListener('scroll', mark, { passive: true });\n mark();\n return () => {\n size.disconnect();\n wrap.removeEventListener('scroll', mark);\n };\n }, [wrapRef, pinned.join(',')]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return lefts;\n}\n","/**\n * A table's head that stays in view while the page scrolls past its rows.\n *\n * `position: sticky` sticks to the nearest scroller, and a grid's wrap is one\n * (it scrolls sideways), so the head stuck to a box that never scrolls up and\n * went off the top with the page. Where the table fits its width the wrap has\n * nothing to scroll, so it is marked `data-fits` and stops being a scroller\n * (style.css); the head then sticks to the page's scroller, under its sticky\n * trail (`--head-top`, the trail's height). `data-stuck` says the head is\n * stuck, for its soft ground. A table wider than its wrap keeps the sideways\n * scroll and its head scrolls with the page, as before.\n *\n * Panes draw no scroll bar (docs/design.md), so a table that does overflow says so itself: `data-more` names\n * the sides with columns past them (\"start\", \"end\", \"start end\") and style.css fades those edges.\n */\nimport { useEffect, type RefObject } from 'react';\n\nexport function useStickyHead(wrapRef: RefObject<HTMLElement | null>, repaintKey: unknown): void {\n useEffect(() => {\n const wrap = wrapRef.current;\n const table = wrap?.querySelector(':scope > table');\n const scroller = wrap?.closest<HTMLElement>('.content');\n if (!wrap || !table || !scroller) return;\n const trail = [...scroller.querySelectorAll<HTMLElement>('.crumbs')].find((el) => getComputedStyle(el).position === 'sticky');\n const head = table.querySelector('thead');\n const fit = () => {\n /* The table's own width against the wrap's, which holds whichever way the wrap overflows. */\n const fits = table.scrollWidth <= wrap.clientWidth + 1;\n wrap.toggleAttribute('data-fits', fits);\n wrap.style.setProperty('--head-top', `${trail?.offsetHeight ?? 0}px`);\n more();\n stuck();\n };\n const more = () => {\n const past = wrap.scrollWidth - wrap.clientWidth - wrap.scrollLeft;\n const sides = [wrap.scrollLeft > 1 ? 'start' : '', past > 1 ? 'end' : ''].filter(Boolean).join(' ');\n if (sides) wrap.dataset.more = sides;\n else delete wrap.dataset.more;\n };\n const stuck = () => {\n if (!head || !wrap.hasAttribute('data-fits')) return wrap.removeAttribute('data-stuck');\n /* All in the window's pixels: under the density zoom an offsetHeight is the layout's, a rect the window's. */\n const top = trail ? trail.getBoundingClientRect().bottom : scroller.getBoundingClientRect().top;\n const box = table.getBoundingClientRect();\n wrap.toggleAttribute('data-stuck', box.top < top - 0.5 && box.bottom > top + head.getBoundingClientRect().height);\n };\n const size = new ResizeObserver(fit);\n size.observe(wrap);\n size.observe(table);\n if (trail) size.observe(trail);\n scroller.addEventListener('scroll', stuck, { passive: true });\n wrap.addEventListener('scroll', more, { passive: true });\n fit();\n return () => {\n size.disconnect();\n wrap.removeEventListener('scroll', more);\n delete wrap.dataset.more;\n scroller.removeEventListener('scroll', stuck);\n };\n }, [wrapRef, repaintKey]);\n}\n","/**\n * How a grid's columns share their room: each column's floor from its head and its values, the width it would like,\n * and which give way first when the room is short. An App's head may wrap to two lines, so its floor is its widest\n * line, and the wrap is taken only when the heads set on one line would run past the room.\n */\ninterface GridColumnSize {\n label: string;\n /** The label as the head sets it, measured in the head's own font, case and tracking; absent, its characters are counted. */\n headWidth?: number;\n /** An App's head may wrap to two lines, so its floor is the label's widest line when broken at the best word, not the whole label. `headWrap` is that line measured like `headWidth`; absent, its characters are counted. */\n wrapHead?: boolean;\n headWrap?: number;\n /** An App's text column whose values may wrap at their words: where the heads wrapped still run past the room, its\n floor is its widest value's two-line width rather than its whole width, so the value is kept whole on two lines\n rather than cut or scrolled to. The row's name is the first to take it (sizeHints); never a chip or a figure. */\n wrapValues?: boolean;\n kind: string;\n values: unknown[];\n /** The second line a display rule draws under each value, in the smaller type. */\n subValues?: unknown[];\n /** Values drawn as tone chips: the dot, padding and border are width too. */\n chip?: boolean;\n /** Measured in the first row: what a chip draws beyond its words (the dot, gap and padding of the look wearing it). */\n chipExtra?: number;\n controls?: boolean;\n /** What the sort draws beside the label on its line, the gap before it included: a reference's arrow. A head that\n wraps keeps it beside the label's line, so it is room on both floors. */\n mark?: number;\n showTime?: boolean;\n /** The column that names the row: it is read whole before the others are. */\n title?: boolean;\n /** Values drawn beside an initials disc: the disc and its gap are width too. */\n avatar?: boolean;\n /** The row's state (a tone chip, or a vocabulary named status or stage): kept with the name when columns are left out. */\n status?: boolean;\n /** Every value is the words the cell draws (\"4 weeks ago\", \"$22,495\"), not a raw value it formats, and nothing beside them (a bar, a ring, an App's own renderer). */\n dressed?: boolean;\n}\n\nexport const GRID_SIZE_SAMPLE = 40;\nexport const GRID_EXPANDER_WIDTH = 32;\n/** The trailing cell a row's own menu sits in. */\nexport const GRID_TRAIL_WIDTH = 44;\n\n/** A long title is read up to about this wide before it earns an ellipsis. */\nconst READABLE_TEXT = 360;\n/** The name of a row keeps about this much before any other text column\n grows past SECONDARY_TEXT: an issue's name was cut at 155px while Project\n and Cycle kept their whole words as their minimum. */\nconst TITLE_TEXT = 240;\nconst SECONDARY_TEXT = 120;\n/** An avatar's disc (24px) and the gap before its name. */\nconst AVATAR_WIDTH = 32;\n/** How wide a head's characters set: a sentence-case label in the interface\n face. A look whose heads are capitals sets wider — small capitals' and Mono's\n clipped their last head into a stray \"…\" — and says by how much through\n `--grid-head-char` (themeFamilies.css), which the grid reads where it\n measures its room. */\nexport const GRID_HEAD_CHAR = 7;\n\n/**\n * The width of a label's widest line when it is broken into two at the best word: the narrowest a head can be\n * and still read as at most two lines. One word cannot break, so it is its own width. `width` measures a piece.\n */\nexport function twoLineWidth(label: string, width: (text: string) => number): number {\n const words = label.split(/\\s+/).filter(Boolean);\n if (words.length < 2) return width(label);\n let best = width(label);\n for (let at = 1; at < words.length; at++)\n best = Math.min(best, Math.max(width(words.slice(0, at).join(' ')), width(words.slice(at).join(' '))));\n return best;\n}\n\n/** Measures a text in the grid's cell font, in pixels (Grid.tsx, a canvas). */\nexport type TextMeasure = (text: string) => number;\n\n/** Bounded hints: readable minima survive small containers. Text is measured in\n the cells' own font where the grid can (`measure`); without it, a character\n counts 8px, which ran a 14px sans 20–40% wide — five short columns held a\n third of the room while the title beside them was cut to \"Preserve filt…\". */\nexport function columnSizeHint(\n column: GridColumnSize,\n headChar = GRID_HEAD_CHAR,\n measure?: TextMeasure,\n squeezeName = false,\n): { minimum: number; wanted: number; least: number; whole?: number; twoLines?: number } {\n /* A head with controls keeps room for its sort's leading padding, its arrow and the resizer's 12px at its trailing\n edge, which the sort never reaches under (style.css); a reference's arrow beside the label is room too (`mark`).\n Its menu caret and its move buttons stand past the label's end where a pointer hovers, so they are not reserved. */\n const counted = Math.min(column.label.length, 22) * headChar;\n const around = (column.controls ? 34 : 28) + (column.mark ?? 0);\n const header = Math.ceil(column.headWidth === undefined ? counted : Math.min(column.headWidth, counted * 1.15)) + around;\n /* An App's head wraps before it widens its column: the floor is its two-line width, and the whole label stays\n what the column wants, so a table with room for it still draws every head on one line. */\n const countedWrap = twoLineWidth(column.label, (text) => Math.min(text.length, 22) * headChar);\n const headLeast = column.wrapHead\n ? Math.min(header, Math.ceil(column.headWrap === undefined ? countedWrap : Math.min(column.headWrap, countedWrap * 1.15)) + around)\n : header;\n const sample = (values: unknown[] = []) =>\n values\n .slice(0, GRID_SIZE_SAMPLE)\n .filter((value) => value != null)\n .map(String);\n const longest = (values: unknown[] = []) => sample(values).reduce<number>((max, text) => Math.max(max, text.length), 0);\n const widest = (values: unknown[] = [], scale = 1) =>\n sample(values).reduce<number>((max, text) => Math.max(max, measure!(text) * scale), 0);\n /* An \"In progress\" chip is its words plus a dot, a gap, padding and a\n border; sized as bare text it spilled over the next column's edge once\n spare room stopped arriving evenly. Counted as five more characters, or\n measured, 40px: Lumen's \"In progress\" chip draws 41px past its words (dot,\n gap, 8px and 10px of padding), and at 22 its cell cut it to \"In progress …\"\n in Thread's issues and Compass's ratings. */\n const length = longest(column.values) + (column.chip ? 5 : 0);\n const textWidth =\n (measure ? Math.ceil(widest(column.values)) + (column.chip ? (column.chipExtra ?? CHIP_EXTRA) : 0) : length * 8) +\n (column.avatar ? AVATAR_WIDTH : 0);\n /* A second line asks for room, never lowers the floor: an email under a\n name wants its width, but a narrow panel still keeps the name's minimum.\n It is set a size down (12.5px under 14px). */\n const under = (measure ? Math.ceil(widest(column.subValues, 0.9)) : longest(column.subValues) * 7) + 24;\n const fixed = (\n minimum: number,\n wanted = minimum,\n ): { minimum: number; wanted: number; least: number; whole?: number; twoLines?: number } => ({\n minimum,\n wanted,\n least: minimum,\n });\n /* A date or a number said in a display rule's own words — \"4 weeks ago\", a priority's chip — is as wide as\n those words measure. Its usual width held a relative date at 112px and a one-digit chip at 97px while the\n name and the owner beside them were cut: the room went to the columns that could not use it. A date or a\n number the cell formats itself keeps its width, since the raw value is not what is drawn. */\n const measured = measure && sample(column.values).length > 0;\n /* A yes-or-no is a mark, 64px, unless its display says it in words: an SLA's \"On track\" and \"Breached\" in tone\n chips were held to the mark's width and cut to \"On trac…\" (G187). Said in words, it is as wide as they are. */\n if (column.kind === 'boolean') {\n const width = (column.chip || column.dressed) && sample(column.values).length > 0 ? Math.min(264, textWidth + 24) : 64;\n return fixed(Math.max(headLeast, width), Math.max(header, width));\n }\n if (column.kind === 'date') {\n const width = measured && column.dressed ? Math.min(column.showTime ? 176 : 112, textWidth + 24) : column.showTime ? 176 : 112;\n return fixed(Math.max(headLeast, width), Math.max(header, width));\n }\n /* A number measured as it is drawn (\"$22,495\", \"18,340 mi\") is as wide as\n those figures: counted at 8px a character with four to spare, Forecourt's\n price, miles and days held 56px each past their figures while the car's\n name beside them was cut to \"2024 Toyota C…\". */\n if (column.kind === 'number') {\n const width =\n measured && (column.chip || column.dressed) ? Math.min(264, textWidth + 24) : Math.min(264, Math.max(88, (length + 4) * 8 + 24));\n return fixed(Math.max(headLeast, width), Math.max(header, width));\n }\n /* Past about 24 characters a text is a sentence that may be cut, not a name\n that must be whole: 24 characters of a 14px sans measure about 168px. At\n 190 a 25-character name in a heavier first column kept its whole width\n and four columns of minima ran past a half-width panel. */\n const verbose = measure ? textWidth > 168 : length > 24;\n /* Its values on two lines, each broken at its best word: the widest of them is the floor it may take. */\n const wrapped =\n column.wrapValues && !column.chip\n ? (measure\n ? Math.ceil(sample(column.values).reduce<number>((max, text) => Math.max(max, twoLineWidth(text, measure)), 0))\n : sample(column.values).reduce<number>(\n (max, text) =>\n Math.max(\n max,\n twoLineWidth(text, (part) => part.length * 8),\n ),\n 0,\n )) +\n 24 +\n (column.avatar ? AVATAR_WIDTH : 0)\n : undefined;\n /* The row's name holds up to TITLE_TEXT as its floor; every other text\n column holds at most SECONDARY_TEXT and asks for the rest as room it\n wants, so when a table is tight the secondary columns are the ones cut.\n The name never gives way below its floor: where the minima run past the\n room, the table scrolls (or an embedded one leaves columns out). Giving\n way first cut \"2024 Toyota C…\" and \"Frame Bag…\" in tables that scrolled\n sideways anyway, so nothing was gained for the cut. */\n // A tone chip is a short word that is never cut; it keeps its whole width.\n const floor = (title: boolean) => (title ? TITLE_TEXT : column.chip ? 216 : verbose ? 128 : SECONDARY_TEXT);\n const minimum = Math.max(headLeast, Math.min(floor(Boolean(column.title)), Math.max(80, Math.min(textWidth + 24, wrapped ?? Infinity))));\n /* What a secondary text column gives way to before the table scrolls: its\n head. A dealer's name cut at the head's width reads better than a table\n that scrolls 45px to show the rest of it at the edge. */\n /* In a column of its own (an aside's list, a half-width block) the name is the last to give way, not a floor under\n the table: where the kept columns still run past the room, the name is cut to an ellipsis at its head's width\n rather than the table scrolled sideways under cut-off heads. */\n const least = column.chip\n ? minimum\n : column.title\n ? squeezeName\n ? Math.max(headLeast, Math.min(minimum, SECONDARY_TEXT - 24))\n : minimum\n : Math.max(headLeast, Math.min(minimum, 80));\n return {\n minimum,\n least,\n wanted: Math.max(minimum, header, Math.min(READABLE_TEXT, Math.max(textWidth + 24, under))),\n /* What its widest value needs on one line, and on two: a column given less than the one and at least the other\n wraps its values rather than cutting them (fitGridColumns). */\n ...(wrapped !== undefined ? { whole: textWidth + 24, twoLines: wrapped } : {}),\n };\n}\n\n/**\n * The hints for a grid's columns, and whether its values wrap. A table is fitted to its room in this order, each\n * step taken only where the one before still runs past it (docs/design.md, Standing layout rules): every head and\n * value whole on one line; an App's heads on two lines at their words; the row's name on two lines, kept whole;\n * the other text values on two lines too; and only then the secondary text given way to its head, cut. A table whose heads fit whole keeps them on\n * one line, as it always did, and a value is cut only where nothing else spares the sideways scroll.\n */\nfunction sizeHints(\n columns: GridColumnSize[],\n room: number,\n headChar: number,\n measure?: (text: string, column: number) => number,\n squeezeName = false,\n): ReturnType<typeof columnSizeHint>[] {\n /* `values` says whose words may take their two-line floor: nobody's, only the row's name, or every text column's. */\n const hints = (heads: boolean, values: 'none' | 'title' | 'all') =>\n columns.map((column, index) =>\n columnSizeHint(\n {\n ...column,\n wrapHead: heads && column.wrapHead,\n wrapValues: column.wrapValues && (values === 'all' || (values === 'title' && Boolean(column.title))),\n },\n headChar,\n measure && ((text) => measure(text, index)),\n squeezeName,\n ),\n );\n const fits = (list: { minimum: number }[]) => list.reduce((sum, hint) => sum + hint.minimum, 0) <= room;\n const whole = hints(false, 'none');\n if (fits(whole) || !columns.some((column) => column.wrapHead || column.wrapValues)) return giveWay(whole, room);\n const heads = hints(true, 'none');\n if (fits(heads) || !columns.some((column) => column.wrapValues)) return giveWay(heads, room);\n /* The row's name is the most important text in the row, so it takes its second line before a short secondary value\n (a person's two-word name) is given one: the others keep their floors while the name's alone still spares the room. */\n const named = hints(true, 'title');\n if (columns.some((column) => column.title && column.wrapValues) && fits(named)) return giveWay(named, room);\n return giveWay(hints(true, 'all'), room);\n}\n\n/* Where the minima together run past the room, the secondary text columns\n give way, the last first, down to their heads; the name, the chips and the\n figures never do. Where giving way would not spare the scroll, nothing is\n cut for it: a phone's table cut a SKU to \"BAG-FRB-…\" and scrolled anyway. */\nfunction giveWay<T extends { minimum: number; least: number }>(hints: T[], room: number): T[] {\n let over = hints.reduce((sum, hint) => sum + hint.minimum, 0) - room;\n if (over <= 0 || hints.reduce((sum, hint) => sum + hint.least, 0) > room) return hints;\n const given = [...hints];\n for (let i = given.length - 1; i >= 0 && over > 0; i--) {\n const less = Math.min(over, given[i]!.minimum - given[i]!.least);\n given[i] = { ...given[i]!, minimum: given[i]!.minimum - less };\n over -= less;\n }\n return given;\n}\n\n/**\n * The columns an embedded grid keeps in its width: a dashboard's list in half\n * a row cut \"Sep 22, 202\" behind a scroll bar. Past the width, columns are\n * left out from the end, as an aside's list says names rather than a table;\n * the row's name, the first column and its status always stay — a related\n * list beside an aside cut its status first, as the last column written,\n * which was the one a reader came to it for. Null when all fit, or before\n * the room is measured.\n */\nexport function keepFitting(\n columns: GridColumnSize[],\n available: number,\n expandable = false,\n trailing = false,\n headChar = GRID_HEAD_CHAR,\n measure?: (text: string, column: number) => number,\n): boolean[] | null {\n if (!(available > 0)) return null;\n let room = available - (expandable ? GRID_EXPANDER_WIDTH : 0) - (trailing ? GRID_TRAIL_WIDTH : 0);\n const hints = sizeHints(columns, room, headChar, measure);\n if (hints.reduce((sum, hint) => sum + hint.minimum, 0) <= room) return null;\n const kept = columns.map((column, index) => index === 0 || Boolean(column.title) || Boolean(column.status));\n room -= hints.reduce((sum, hint, index) => sum + (kept[index] ? hint.minimum : 0), 0);\n // In order, until one does not fit: a narrower column after it is not a reason to leave a gap.\n let full = false;\n hints.forEach((hint, index) => {\n if (kept[index] || full) return;\n if (hint.minimum > room) {\n full = true;\n return;\n }\n kept[index] = true;\n room -= hint.minimum;\n });\n return kept;\n}\n\n/* Room past the minima goes first to the columns still cut short — an issue\n title at \"Preserve filters when op…\" beside a \"Cycle 18\" column holding\n twice its text's width — and only then, evenly, to everyone. Long text\n used to take a double share of all of it, and grew past its sentence\n while the name beside it lost its second line. Among the columns cut\n short, the one that needs least is made whole first: shared in proportion\n to what each wanted, a deal's committee gave \"Karen Olstad\" five of the\n twenty pixels her name lacked and a note the rest, so both were cut. */\n/* Short of its whole width by no more than this, a column is made whole before the name grows. */\nconst NEARLY_WHOLE = 40;\n/* What a tone chip draws beyond its words, measured (see columnSizeHint). */\nconst CHIP_EXTRA = 40;\n\nexport function fitGridColumns(\n columns: GridColumnSize[],\n available: number,\n expandable = false,\n trailing = false,\n headChar = GRID_HEAD_CHAR,\n measure?: (text: string, column: number) => number,\n squeezeName = false,\n): { width: number; columns: number[]; wraps: boolean[] } {\n const gutter = (expandable ? GRID_EXPANDER_WIDTH : 0) + (trailing ? GRID_TRAIL_WIDTH : 0);\n const hints = sizeHints(columns, Number.isFinite(available) ? Math.floor(available) - gutter : Infinity, headChar, measure, squeezeName);\n const minimum = hints.reduce((sum, hint) => sum + hint.minimum, gutter);\n const width = Math.max(minimum, Number.isFinite(available) ? Math.floor(available) : 0);\n const extra = width - minimum;\n const short = hints.reduce((sum, hint) => sum + hint.wanted - hint.minimum, 0);\n const filling = Math.min(extra, short);\n const spare = extra - filling;\n /* A column a few pixels short of whole is made whole first — an owner's\n \"Karen Olstad\" short by 20px — then the row's name, up to its readable\n width: Thread's issues cut every name at 274px while Status, Project and\n Cycle shared the room. Then each in turn, least wanting first, takes what\n it lacks or an even share of what is left, whichever is less. */\n const given = hints.map(() => 0);\n let left = filling;\n const lacking = hints\n .map((hint, index) => ({ index, lacks: hint.wanted - hint.minimum }))\n .filter(({ lacks }) => lacks > 0)\n .sort((a, b) => a.lacks - b.lacks);\n const named = columns.findIndex((column) => column.title);\n for (const { index, lacks } of lacking) {\n if (index === named || lacks > NEARLY_WHOLE || lacks > left) continue;\n given[index] = lacks;\n left -= lacks;\n }\n if (named >= 0) {\n given[named] = Math.min(left, hints[named]!.wanted - hints[named]!.minimum);\n left -= given[named]!;\n }\n const wanting = lacking.filter(({ index }) => given[index] === 0 && index !== named);\n wanting.forEach(({ index, lacks }, turn) => {\n const share = Math.min(lacks, Math.floor(left / (wanting.length - turn)));\n given[index] = share;\n left -= share;\n });\n let remaining = extra;\n const sizes = hints.map((hint, index) => {\n const share = index === hints.length - 1 ? remaining : given[index]! + Math.floor(spare / hints.length);\n remaining -= share;\n return hint.minimum + share;\n });\n /* A column given less than its widest value and enough for it on two lines wraps at its words (Grid.tsx, style.css\n `td.wraps`): the value stays whole rather than cut. One given less than that is a sentence, and is cut. */\n const wraps = columns.map((column, index) => {\n if (!column.wrapValues) return false;\n const { whole, twoLines } = columnSizeHint({ ...column, wrapHead: false }, headChar, measure && ((text) => measure(text, index)));\n return whole !== undefined && twoLines !== undefined && sizes[index]! < whole && sizes[index]! >= twoLines;\n });\n return { width, columns: sizes, wraps };\n}\n\n/**\n * How many of a cell's tag chips are drawn whole in `room`: as many as fit\n * beside the \"+N\" that counts the rest, and at least one. `widths` are the\n * chips that may be drawn (the first few of `total`); `more` measures the\n * count for so many left out.\n */\nexport function tagsThatFit(widths: number[], total: number, gap: number, room: number, more: (rest: number) => number): number {\n const needs = (count: number) =>\n widths.slice(0, count).reduce((sum, width) => sum + width, 0) + gap * (count - 1) + (count < total ? gap + more(total - count) : 0);\n let count = Math.min(widths.length, total);\n while (count > 1 && needs(count) > room) count -= 1;\n return count;\n}\n","/**\n * A grid's own arrangement: the order its reader put its columns in, and\n * the widths they dragged them to. Both live only in the grid that drew\n * them — a reader's arrangement, never the query's, so a refetch, a sort\n * or a page never moves a column the reader placed, and another reader\n * never sees it. The query's columns stay the source of truth: an order\n * that names a column no longer drawn is dropped, and a column the order\n * never named stands after the arranged ones, in the query's order.\n *\n * Widths are layout pixels, the units a column's `width` style speaks\n * (Grid.tsx divides the pointer's screen pixels by the zoom-aware ruler\n * before they arrive here). A column narrower than this does not take a\n * head: its label would be a sliver and its sort a guess.\n */\nexport const MIN_COLUMN_WIDTH = 48;\n\n/** One arrow-key step on a column's resizer, and the step with Shift held. */\nconst RESIZE_STEP = 16;\nconst RESIZE_SHIFT_STEP = 64;\n\n/** The step an arrow key moves a resizer, larger with Shift held. */\nexport function columnResizeStep(shiftKey: boolean): number {\n return shiftKey ? RESIZE_SHIFT_STEP : RESIZE_STEP;\n}\n\n/** A width a column may actually be given: whole pixels, never below its floor. */\nexport function clampColumnWidth(width: number): number {\n if (!Number.isFinite(width)) return MIN_COLUMN_WIDTH;\n return Math.max(MIN_COLUMN_WIDTH, Math.round(width));\n}\n\n/**\n * The columns as drawn, in the reader's order: the order's names first,\n * in the order's order, then every drawn column the order never named,\n * in the order they were drawn. With no order, the drawn order stands.\n */\nexport function applyColumnOrder(drawn: readonly string[], order: readonly string[] | null): string[] {\n if (!order) return [...drawn];\n const kept = order.filter((name) => drawn.includes(name));\n const placed = new Set(kept);\n return [...kept, ...drawn.filter((name) => !placed.has(name))];\n}\n\n/**\n * The order with one column stepped one place left or right, as the\n * header's move buttons and Alt+arrows ask. At either edge, or naming a\n * column the order does not hold, the order stands unchanged.\n */\nexport function moveColumn(order: readonly string[], name: string, direction: 'left' | 'right'): string[] {\n const at = order.indexOf(name);\n const to = direction === 'left' ? at - 1 : at + 1;\n if (at < 0 || to < 0 || to >= order.length) return [...order];\n const next = [...order];\n const [moved] = next.splice(at, 1);\n next.splice(to, 0, moved!);\n return next;\n}\n\n/** The fitted widths, with every width the reader dragged standing in place of its fitted one. */\nexport function applyColumnWidths(\n fitted: readonly number[],\n columns: readonly string[],\n overrides: Readonly<Record<string, number>>,\n): number[] {\n return columns.map((name, index) => {\n const override = overrides[name];\n return override === undefined ? (fitted[index] ?? 0) : clampColumnWidth(override);\n });\n}\n","/** What visualTheme says, in the shell room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../messages.js';\n\nexport const say = defineMessages({\n default: 'Default',\n workbenchDefault: 'Workbench default',\n});\n","/**\n * A theme's own font files (`type.faces`) as a page declares them: the\n * `@font-face` rules, the face its headings are drawn in, and the families a\n * stack names. Shared by the server's first paint (clientSurface.ts) and the\n * browser's look (client visualTheme.ts), so a face is declared the same way\n * before the script runs and after; the files themselves are the server's\n * (server/app/appFonts.ts).\n */\nimport type { ThemeDefinition, ThemeFaceDefinition } from '../../schema/theme.js';\n\n/** The path segment an App's fonts are served under, beside its `_components`. */\nexport const FONTS_SEGMENT = '_fonts';\n\n/** A stack's families, unquoted. */\nexport function families(stack: string): string[] {\n return stack\n .split(',')\n .map((family) => family.trim().replace(/^[\"']|[\"']$/g, ''))\n .filter(Boolean);\n}\n\n/**\n * The face a theme's headings are drawn in, preloaded on first paint: the\n * first served face of the family its heading stack leads with, at the\n * heading weight where it ships one. A theme whose headings lead with a\n * family it does not ship has none: nothing is fetched for a face the page\n * would not draw a line in.\n */\nexport function headingFace(theme: ThemeDefinition): ThemeFaceDefinition | undefined {\n const lead = families(theme.fonts?.heading ?? theme.fonts?.ui ?? '')[0]?.toLowerCase();\n if (!lead) return undefined;\n const faces = (theme.faces ?? []).filter((face) => face.family.toLowerCase() === lead && face.style === 'normal' && face.href);\n const weight = theme.type?.roles?.title?.weight ?? 700;\n return (\n faces.find((face) => {\n const [low, high = low] = face.weight.split(' ').map(Number);\n return weight >= low! && weight <= high!;\n }) ?? faces[0]\n );\n}\n\n/**\n * The `@font-face` rules for a theme's served faces, each `url()` the\n * browser's own form of its address (`shown`). `swap`, as Inter's is\n * (lumenLook.css): the text is drawn at once in the stack's next family and\n * set again when the face lands, never held invisible. The family and the\n * address are both checked to a character set that cannot close the rule\n * (themeSpec.ts, appFonts.ts), so nothing a theme says becomes a stylesheet.\n */\nexport function faceRules(theme: ThemeDefinition | undefined, shown: (href: string) => string = (href) => href): string {\n return (theme?.faces ?? [])\n .filter((face) => face.href && /^[\\w/.%-]+$/.test(face.href))\n .map(\n (face) =>\n `@font-face{font-family:\"${face.family}\";src:url(\"${shown(face.href!)}\") format(\"${face.href!.endsWith('.woff') ? 'woff' : 'woff2'}\");` +\n `font-weight:${face.weight};font-style:${face.style};font-display:swap}`,\n )\n .join('\\n');\n}\n","import type { ThemeDefinition, ThemePalette } from '@mistriwork/engine/schema/theme.js';\nimport { FONT_TOKENS, PALETTE_TOKENS, ROUND, ROUND_BOX, shapeTokens } from '@mistriwork/engine/shared/themeTokens.js';\nimport { partTokens } from '@mistriwork/engine/shared/themeParts.js';\nimport { wearIconWeight } from './iconWeight.js';\nimport { typeTokens } from '@mistriwork/engine/shared/themeType.js';\nimport {\n effectiveThemeDefinition,\n headingWeight,\n inheritThemePreset,\n lookNavRole,\n themePreset,\n THEME_PRESETS,\n} from '@mistriwork/engine/shared/themePresets.js';\nimport { lookAttribute, RECIPE_PARTS, recipeAttributes, TYPE_ATTRIBUTES } from '@mistriwork/engine/shared/themeRecipes.js';\nimport { say } from './copy/shell/visualTheme.js';\nimport { shellById, shellRoot } from './shellHost.js';\nimport { faceRules } from '@mistriwork/engine/shared/themeFaces.js';\nimport { appFile } from './addressMount.js';\n\nexport const VISUAL_THEME_KEY = 'mistri.visual-theme';\nexport const WORKBENCH_VISUAL_THEME_KEY = 'mistri.workbench-visual-theme';\nexport const VISUAL_PALETTE_KEY = 'mistri.visual-palettes';\nconst CUSTOM_THEME_KEY = 'mistri.custom-theme-choices';\nexport const VISUAL_THEME_EVENT = 'mistri:visual-theme-change';\nexport const VISUAL_THEME_REGISTRY_EVENT = 'mistri:visual-theme-registry-change';\n/** The look inside an App when neither the reader nor the App names one.\n Workbench instead defaults to its native tokens in style.css. */\nexport const DEFAULT_VISUAL_THEME = 'workshop';\nconst SANS = 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif';\n/** The reader's own pick, kept only while it names a theme this screen offers. */\nlet preferred: unknown = null;\nlet workbenchPreferred: string | undefined;\nlet customPreferences = new Map<string, string>();\nlet registered: readonly ThemeDefinition[] = [];\nlet authoredPreset: string | undefined;\nlet authoredPalette: string | undefined;\nlet appScope = '';\nlet palettePreferences = new Map<string, string>();\n/** App defaults and policy never become Workbench's explicit reader choice. */\nlet inApp = false;\nlet locked = false;\nlet isolated = false;\n\nconst swatches = (theme: ThemeDefinition) =>\n [theme.light.navGround ?? theme.light.surface, theme.light.accent, theme.light.chart2 ?? theme.light.ink] as const;\n\n/** The built-in looks, then the App's own themes. */\nexport function visualThemeOptions(): Array<{ value: string; label: string; swatches: readonly string[] }> {\n const themes = [...THEME_PRESETS, ...registered]\n .filter((theme) => !locked || theme.id === authoredPreset)\n .map((theme) => ({\n value: theme.id,\n label: theme.label,\n swatches: swatches(effectiveThemeDefinition(theme, paletteChoiceFor(theme))),\n }));\n return inApp ? themes : [{ value: 'default', label: say('workbenchDefault'), swatches: [] }, ...themes];\n}\n\nconst offered = (value: unknown): value is string =>\n typeof value === 'string' && visualThemeOptions().some((theme) => theme.value === value);\n\n/** The look in force: the reader's pick, else the App's preset, else Workshop. */\nexport function visualThemeChoice(): string {\n if (!inApp) return workbenchPreferred ?? 'default';\n if (locked && offered(authoredPreset)) return authoredPreset;\n const scoped = appScope ? customPreferences.get(appScope) : undefined;\n // A retired custom choice belongs to this App, not to the global look.\n // Keep it for a later registry reload while falling back to the App default.\n if (scoped !== undefined) {\n if (registered.some((theme) => theme.id === scoped) || (isolated && offered(scoped))) return scoped;\n } else if (!isolated && offered(preferred) && (!appScope || themePreset(preferred))) return preferred;\n if (offered(authoredPreset)) return authoredPreset;\n return DEFAULT_VISUAL_THEME;\n}\n\nfunction selectedThemeBase(): ThemeDefinition {\n const id = visualThemeChoice();\n const custom = registered.find((theme) => theme.id === id);\n return custom ? inheritThemePreset(custom) : (themePreset(id) ?? themePreset(DEFAULT_VISUAL_THEME)!);\n}\n\n// A different tuple shape keeps Workbench separate even from an App named \"workbench\".\nconst paletteScope = (theme = visualThemeChoice()) => JSON.stringify(inApp ? [appScope, theme] : ['workbench', null, theme]);\n\n/** The theme the App itself wears, where this screen is an App's and the reader may pick another: what the picker marks and what a reset returns to. */\nexport function appVisualTheme(): string | undefined {\n return inApp && !locked && offered(authoredPreset) ? authoredPreset : undefined;\n}\n\n/** Whether the reader's own pick (a theme, or a palette of the App's theme) is what is worn instead of the App's. */\nexport function readerOverridesAppTheme(): boolean {\n const own = appVisualTheme();\n return own !== undefined && (visualThemeChoice() !== own || palettePreferences.has(paletteScope(own)));\n}\n\n/** Back to the App's own theme and palette: the reader's picks for this App are forgotten, not replaced by new ones. */\nexport function resetVisualTheme() {\n const own = appVisualTheme();\n if (own === undefined) return;\n setVisualTheme(own);\n if (palettePreferences.delete(paletteScope(own))) {\n try {\n window.localStorage.setItem(VISUAL_PALETTE_KEY, JSON.stringify([...palettePreferences]));\n } catch {\n /* Tab-local choice still applies. */\n }\n apply();\n window.dispatchEvent(new Event(VISUAL_THEME_EVENT));\n }\n}\n\n/** A built-in look's own colors are one of its palettes (its `defaultPalette`, lookPalettes.ts), so it offers no\n \"Default\" beside them: the same palette twice under two names. A theme of the App's own keeps its Default. */\nconst ownColorsArePalette = (theme: ThemeDefinition) =>\n themePreset(theme.id) === theme && Boolean(theme.palettes?.some((palette) => palette.id === theme.defaultPalette));\n\n/** Palette choices belong to their theme, not to an unrelated App using the same slug. */\nexport function visualPaletteOptions(): Array<{ value: string; label: string; swatches: readonly string[] }> {\n if (!inApp && !workbenchPreferred) return [];\n const theme = selectedThemeBase();\n return [\n ...(ownColorsArePalette(theme) ? [] : [{ value: 'default', label: say('default'), swatches: swatches(theme) }]),\n ...(theme.palettes ?? []).map((palette) => ({\n value: palette.id,\n label: palette.label,\n swatches: swatches(effectiveThemeDefinition(theme, palette.id)),\n })),\n ];\n}\n\nfunction paletteChoiceFor(theme: ThemeDefinition): string {\n /* A built-in's \"default\" is its own palette by name, so a pick or an App's `palette: 'default'` marks that one. */\n const named = (value: string | undefined) => (value === 'default' && ownColorsArePalette(theme) ? theme.defaultPalette : value);\n const offered = (value: string | undefined): value is string =>\n value === 'default' || Boolean(theme.palettes?.some((palette) => palette.id === value));\n const preferred = named(palettePreferences.get(paletteScope(theme.id)));\n if (!locked && offered(preferred)) return preferred;\n const authored = named(authoredPalette);\n if (theme.id === authoredPreset && offered(authored)) return authored;\n const fallback = theme.defaultPalette;\n return offered(fallback) ? fallback : 'default';\n}\n\nexport function visualPaletteChoice(): string {\n if (!inApp && !workbenchPreferred) return 'default';\n return paletteChoiceFor(selectedThemeBase());\n}\n\nfunction selectedThemeDefinition(): ThemeDefinition {\n return effectiveThemeDefinition(selectedThemeBase(), visualPaletteChoice());\n}\n\nexport function setVisualPalette(value: string) {\n if (locked || !visualPaletteOptions().some((palette) => palette.value === value)) return;\n palettePreferences.set(paletteScope(), value);\n // Bound retained preferences while keeping the current tab independent of storage availability.\n if (palettePreferences.size > 200) palettePreferences.delete(palettePreferences.keys().next().value!);\n try {\n window.localStorage.setItem(VISUAL_PALETTE_KEY, JSON.stringify([...palettePreferences]));\n } catch {\n /* Tab-local choice still applies. */\n }\n apply();\n window.dispatchEvent(new Event(VISUAL_THEME_EVENT));\n}\n\n/** Called by the app-theme owner after load, reload, workspace changes and every\n flip between an App and its Workbench; `app` says which this screen is. */\nexport function configureVisualThemes(\n themes: readonly ThemeDefinition[] = [],\n preset?: string,\n app = false,\n palette?: string,\n scope = '',\n policy: { locked?: boolean; isolated?: boolean } = {},\n) {\n if (!app) {\n themes = [];\n preset = undefined;\n palette = undefined;\n scope = '';\n policy = {};\n }\n const changed =\n registered.length !== themes.length ||\n registered.some((theme, index) => theme !== themes[index]) ||\n authoredPreset !== preset ||\n inApp !== app ||\n authoredPalette !== palette ||\n appScope !== scope ||\n locked !== Boolean(policy.locked) ||\n isolated !== Boolean(policy.isolated);\n registered = themes;\n authoredPreset = preset;\n authoredPalette = palette;\n appScope = scope;\n inApp = app;\n locked = Boolean(policy.locked);\n isolated = Boolean(policy.isolated);\n apply();\n if (changed) window.dispatchEvent(new Event(VISUAL_THEME_REGISTRY_EVENT));\n}\n\n/** Workbench always offers its own looks; an App may lock its authored branding. */\nexport function visualThemesOffered(): boolean {\n return !locked;\n}\n\n/** A theme this screen offers, or the default look. */\nexport function validVisualTheme(value: unknown): string {\n return offered(value) ? value : inApp ? DEFAULT_VISUAL_THEME : 'default';\n}\n\n/* The look sheets fetched when a worn theme picks one of their recipes rather\n than carried in every first paint (brandLook.css says why). Mono's and the\n defaults' rules are in the first stylesheet (themeFamilies.css); which sheet\n answers which recipe is the menu's (themeRecipes.ts RECIPE_MENU). */\n/* A stylesheet is a module to Vite, which splits it into a file of its own; its type is packages/mistri/schema/css.d.ts's. */\nconst LOOK_SHEETS: Readonly<Record<string, () => Promise<unknown>>> = {\n workshop: () => import('./workshopLook.css'),\n lumen: () => import('./lumenLook.css'),\n sage: () => import('./sageLook.css'),\n ledger: () => import('./ledgerLook.css'),\n brand: () => import('./brandLook.css'),\n /* What a theme says beyond the menu: its parts' own styles and its patterns (themeParts.ts). */\n parts: () => import('./partsLook.css'),\n surfaces: () => import('./surfacesLook.css'),\n};\nconst lookSheets = new Map<string, Promise<void>>();\nlet lookSheet: Promise<void> = Promise.resolve();\n\n/** Settles once the worn look's own sheets have arrived (or could not), so boot\n reveals the page in its look rather than a moment before it. */\nexport function lookSheetReady(): Promise<void> {\n return lookSheet;\n}\n\nfunction sheet(style: string): Promise<void> | undefined {\n const load = LOOK_SHEETS[style];\n if (!load) return undefined;\n let arriving = lookSheets.get(style);\n if (!arriving) {\n /* A sheet that cannot come leaves the look's tokens on the page, which read; it is not worth a failed boot. */\n arriving = load().then(\n () => undefined,\n (error: unknown) => {\n console.error(`The ${style} look's sheet did not load.`, error);\n },\n );\n lookSheets.set(style, arriving);\n }\n return arriving;\n}\n\n/* A theme's own stylesheet, as the server read and scoped it (appBrand.ts): only an address of that shape is linked,\n so nothing a payload carries can link another site's sheet. Every rule in it is scoped to its theme's root\n attribute, so a sheet left linked after another theme is worn draws nothing. */\nconst THEME_SHEET = /^\\/[^/?#]+\\/_brand\\/[a-z0-9][a-z0-9-]*\\.css$/;\nconst themeSheets = new Map<string, Promise<void>>();\nfunction themeSheet(href: string | undefined): Promise<void> | undefined {\n if (!href || !THEME_SHEET.test(href)) return undefined;\n let arriving = themeSheets.get(href);\n if (!arriving) {\n const link = document.createElement('link');\n link.rel = 'stylesheet';\n /* An inside address, as the faces are: `/acme/_brand/…` is `/_brand/…` with the App at the root, and the\n Provider's endpoint's in an embed, never the host's address (addressMount appFile). */\n link.href = appFile(href);\n link.dataset.themeSheet = '';\n arriving = new Promise<void>((settle) => {\n link.addEventListener('load', () => settle(), { once: true });\n /* A sheet that cannot come leaves the theme its look and parts, which read; it is not worth a failed boot. */\n link.addEventListener(\n 'error',\n () => {\n console.error(`The theme's stylesheet ${href} did not load.`);\n settle();\n },\n { once: true },\n );\n });\n document.head.append(link);\n themeSheets.set(href, arriving);\n }\n return arriving;\n}\n\nfunction wearSheets(styles: readonly string[], ...also: (Promise<void> | undefined)[]) {\n const arriving = [...styles.map(sheet), ...also].filter((value): value is Promise<void> => value !== undefined);\n lookSheet = arriving.length ? Promise.all(arriving).then(() => undefined) : Promise.resolve();\n}\n\n/** The attributes a worn theme sets only when it says something there, so one the last theme set goes. */\nconst OPTIONAL_ATTRIBUTES = [\n ...TYPE_ATTRIBUTES,\n 'data-bar-ground',\n 'data-parts',\n 'data-surface-ground',\n 'data-surface-nav',\n 'data-icons',\n] as const;\n\n/** Every attribute a worn look sets on the root: its name, palette and each recipe. */\nconst LOOK_ATTRIBUTES = [\n 'data-custom-theme',\n 'data-visual-theme',\n 'data-theme-style',\n 'data-theme-palette',\n ...RECIPE_PARTS.map(lookAttribute),\n 'data-look-elevation',\n 'data-look-motion',\n 'data-look-rhythm',\n 'data-look-card',\n 'data-look-float',\n ...OPTIONAL_ATTRIBUTES,\n] as const;\n\nfunction apply() {\n const root = shellRoot();\n /* Native Workbench has no look attributes. Explicit picks use the same\n definitions, token owner and sheets as the App looks. */\n if (!inApp && !workbenchPreferred) {\n for (const name of LOOK_ATTRIBUTES) root.removeAttribute(name);\n void wearIconWeight(undefined);\n facesStyle?.remove();\n facesStyle = undefined;\n return;\n }\n const definition = selectedThemeDefinition();\n root.setAttribute('data-custom-theme', '');\n root.dataset.visualTheme = definition.id;\n root.dataset.themeStyle = definition.base ?? '';\n root.dataset.themePalette = visualPaletteChoice();\n const { attributes, sheets } = recipeAttributes(definition, lookNavRole(definition));\n /* A role the worn theme leaves to the look has no attribute, so one the last theme set goes. */\n for (const name of OPTIONAL_ATTRIBUTES) if (!(name in attributes)) root.removeAttribute(name);\n for (const [name, value] of Object.entries(attributes)) root.setAttribute(name, value);\n wearSheets(sheets, wearIconWeight(definition.icons), themeSheet(definition.stylesheet?.href));\n wearFaces(definition);\n}\n\n/**\n * The worn theme's own font files (`type.faces`) as `@font-face` rules, in the\n * one style element the server's first paint writes them in\n * (clientSurface.ts appFaceHead) — replaced, not added to, when the reader\n * picks another theme or the App's theme is edited and reloads. A rule costs\n * nothing until a line is drawn in its family.\n */\nfunction wearFaces(definition: ThemeDefinition) {\n /* Each face where its App serves it: the endpoint's in an embed, where `shown` would be the host's address. */\n const rules = faceRules(definition, appFile);\n /* A theme without faces leaves the first paint's rules where they are: a rule for a family no stack names is never\n fetched, and the page then needs no DOM at all for a theme that ships no fonts. */\n if (!rules) {\n facesStyle?.remove();\n facesStyle = undefined;\n return;\n }\n facesStyle ??= (shellById('mistri-theme-faces') as HTMLStyleElement | null) ?? undefined;\n if (!facesStyle) {\n facesStyle = document.createElement('style');\n facesStyle.id = 'mistri-theme-faces';\n document.head.append(facesStyle);\n }\n if (facesStyle.textContent !== rules) facesStyle.textContent = rules;\n}\nlet facesStyle: HTMLStyleElement | undefined;\n\nexport function initVisualTheme() {\n try {\n preferred = window.localStorage.getItem(VISUAL_THEME_KEY);\n } catch {\n preferred = null; /* The default needs no storage. */\n }\n try {\n const value = window.localStorage.getItem(WORKBENCH_VISUAL_THEME_KEY);\n workbenchPreferred = value && themePreset(value) ? value : undefined;\n } catch {\n workbenchPreferred = undefined; /* Native Workbench needs no storage. */\n }\n customPreferences = new Map();\n try {\n const entries: unknown = JSON.parse(window.localStorage.getItem(CUSTOM_THEME_KEY) ?? '[]');\n if (Array.isArray(entries))\n for (const entry of entries.slice(-200)) {\n if (\n Array.isArray(entry) &&\n entry.length === 2 &&\n typeof entry[0] === 'string' &&\n entry[0].length > 0 &&\n entry[0].length <= 256 &&\n typeof entry[1] === 'string' &&\n /^[a-z][a-z0-9-]{0,47}$/.test(entry[1]) &&\n (!themePreset(entry[1]) || entry[0].startsWith('[\"branding\",'))\n )\n customPreferences.set(entry[0], entry[1]);\n }\n } catch {\n /* Missing or malformed custom choices do not prevent boot. */\n }\n palettePreferences = new Map();\n try {\n const entries: unknown = JSON.parse(window.localStorage.getItem(VISUAL_PALETTE_KEY) ?? '[]');\n if (Array.isArray(entries))\n for (const entry of entries.slice(-200)) {\n if (\n Array.isArray(entry) &&\n entry.length === 2 &&\n typeof entry[0] === 'string' &&\n entry[0].length <= 256 &&\n typeof entry[1] === 'string' &&\n /^[a-z][a-z0-9-]{0,47}$/.test(entry[1])\n )\n palettePreferences.set(entry[0], entry[1]);\n }\n } catch {\n /* Invalid or unavailable storage cannot prevent boot. */\n }\n apply();\n}\n\n/** The reader's pick. Choosing what the App or the default would have given anyway keeps no preference. */\nexport function setVisualTheme(value: string) {\n if (locked || !offered(value)) return;\n if (!inApp) {\n workbenchPreferred = value === 'default' ? undefined : value;\n try {\n if (workbenchPreferred) window.localStorage.setItem(WORKBENCH_VISUAL_THEME_KEY, workbenchPreferred);\n else window.localStorage.removeItem(WORKBENCH_VISUAL_THEME_KEY);\n } catch {\n /* A Workbench choice is still usable in this tab. */\n }\n apply();\n window.dispatchEvent(new Event(VISUAL_THEME_EVENT));\n return;\n }\n if (appScope) {\n const fallback = offered(authoredPreset) ? authoredPreset : DEFAULT_VISUAL_THEME;\n const custom = registered.some((theme) => theme.id === value);\n if ((custom || isolated) && value !== fallback) {\n customPreferences.set(appScope, value);\n if (customPreferences.size > 200) customPreferences.delete(customPreferences.keys().next().value!);\n } else {\n customPreferences.delete(appScope);\n if (!isolated) preferred = value === fallback ? null : value;\n try {\n if (!isolated && preferred === null) window.localStorage.removeItem(VISUAL_THEME_KEY);\n else if (!isolated) window.localStorage.setItem(VISUAL_THEME_KEY, preferred as string);\n } catch {\n /* The global choice remains usable in this tab. */\n }\n }\n try {\n window.localStorage.setItem(CUSTOM_THEME_KEY, JSON.stringify([...customPreferences]));\n } catch {\n /* Keep the scoped choice in this tab. */\n }\n apply();\n window.dispatchEvent(new Event(VISUAL_THEME_EVENT));\n return;\n }\n const before = preferred;\n preferred = null;\n const fallback = visualThemeChoice();\n preferred = offered(value) && value !== fallback ? value : null;\n if (!offered(value)) preferred = before;\n apply();\n try {\n if (preferred === null) window.localStorage.removeItem(VISUAL_THEME_KEY);\n else window.localStorage.setItem(VISUAL_THEME_KEY, preferred as string);\n } catch {\n /* Keep the current tab usable when preferences cannot be saved. */\n }\n window.dispatchEvent(new Event(VISUAL_THEME_EVENT));\n}\n\n/** The look's own radius and data face; an App's authored values win over them in appnav. */\nexport function visualThemeOverrides(): { radius?: string; font: string; square: boolean; density?: string } {\n if (!inApp && !workbenchPreferred) return { font: 'var(--code)', square: false };\n const definition = selectedThemeDefinition();\n return {\n ...(definition.density ? { density: definition.density } : {}),\n /* Round controls are a pill only where a control is drawn (--control-radius): every other box keeps a box's corner. */\n ...(definition.radius?.control ? { radius: definition.radius.control === ROUND ? ROUND_BOX : definition.radius.control } : {}),\n font: definition.fonts?.data ?? SANS,\n square: definition.radius?.control === '0px',\n };\n}\n\n/** The worn theme's `scheme`: dark until the reader picks a mode, or dark only (theme.js). */\nexport function visualThemeScheme(): ThemeDefinition['scheme'] {\n return selectedThemeDefinition().scheme;\n}\n\nexport function visualThemePalette(dark: boolean): ThemePalette {\n return selectedThemeDefinition()[dark ? 'dark' : 'light'];\n}\n\n/** The worn theme's part styles as custom properties, written where the App's accent is (appTheme.js) so a part in\n `accent` is the App's own accent; none outside an App or for a theme without parts. */\nexport function customThemePartTokens(): Record<string, string> {\n if (!inApp && !workbenchPreferred) return {};\n return partTokens(selectedThemeDefinition().parts);\n}\n\n/** Values only; appnav remains the sole writer of inline theme tokens. */\nexport function customThemeTokens(dark: boolean): Record<string, string> {\n if (!inApp && !workbenchPreferred) return {};\n const definition = selectedThemeDefinition();\n const tokens: Record<string, string> = {};\n for (const [key, value] of Object.entries(definition[dark ? 'dark' : 'light'])) {\n tokens[PALETTE_TOKENS[key as keyof ThemePalette]] = value;\n }\n for (const [key, value] of Object.entries(definition.fonts ?? {})) {\n if (key !== 'data') tokens[FONT_TOKENS[key as keyof typeof FONT_TOKENS]] = value;\n }\n /* The corners and widths but the control's own, which appnav writes as --radius (visualThemeOverrides). */\n const { '--radius': _control, ...shape } = shapeTokens(definition);\n Object.assign(tokens, shape, typeTokens(definition.type));\n tokens['--heading-weight'] = String(headingWeight(definition));\n return tokens;\n}\n","/** What JsonPreview says, in the record page room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n openName: 'Open {name}',\n});\n","/**\n * A JSON document in a grid cell: one line that says its shape, and the\n * whole document laid out in an overlay, on a click or on Enter.\n *\n * The line is a button, so a click on it opens the document rather than\n * the row. It is out of the tab order because the grid is one tab stop:\n * the cell cursor's Enter presses it instead (`data-cell-opens`, read by\n * useGridKeyboard), and the row is a cell away.\n */\nimport { useRef, useState } from 'react';\nimport { Modal, type ModalHandle } from '@mistriwork/ui/Modal.js';\nimport { JsonValue as JsonView } from './JsonValue.js';\nimport { useArrived } from './onDemand.js';\nimport { previewOf } from './jsonModel.js';\nimport { say } from '../copy/record/components/JsonPreview.js';\n\nexport function JsonPreview({ value, name, type }: { value: object; name: string; type?: string }) {\n const [open, setOpen] = useState(false);\n const here = useArrived(JsonView, open);\n const modal = useRef<ModalHandle>(null);\n return (\n <>\n <button\n type=\"button\"\n className=\"json-preview\"\n data-cell-opens=\"\"\n tabIndex={-1}\n aria-haspopup=\"dialog\"\n title={say('openName', { name })}\n onClick={(e) => {\n e.stopPropagation();\n setOpen(true);\n }}\n >\n {previewOf(value)}\n </button>\n {open && here && (\n <Modal ref={modal} className=\"confirm json-overlay\" ariaLabel={`${name} (JSON)`} onClose={() => setOpen(false)}>\n <header className=\"json-overlay-head\">\n <h2>{name}</h2>\n {type && <span className=\"json-overlay-type\">{type.toLowerCase()}</span>}\n <button type=\"button\" className=\"ghost json-overlay-close\" onClick={() => modal.current?.close()}>\n {say('common.close')}\n </button>\n </header>\n <JsonView value={value} />\n </Modal>\n )}\n </>\n );\n}\n","/** What Grid says, in the lists and grid room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({\n moreTags: '+{count}',\n moreCharactersOpenTheRow: {\n one: '{count} more character — open the row to read it',\n other: '{count} more characters — open the row to read it',\n },\n summing: 'Summing',\n total: 'Total',\n noRowsMatch: 'No rows match.',\n thisTableIsEmpty: 'This table is empty.',\n sortingAResultLike: '{name} — sorting a result like this one means editing the statement that produced it',\n notSortableHere: '{name} — this list cannot be sorted from its header.',\n sortBy: 'Sort by {name}',\n theApiDocumentsNoSort: '{name} — the API documents no sort by it.',\n isNotIndexedSorting: '{name} is not indexed — sorting it would scan the whole table. Type \"sort {name}\" in the query bar if you mean it.',\n isNotIndexedSortingInApp: '{name} is not indexed — sorting it would scan the whole table.',\n filterOn: 'Filter on {name}',\n expandEveryRow: 'Expand every row',\n collapseEveryRow: 'Collapse every row',\n moveColumnLeft: 'Move {name} left',\n moveColumnRight: 'Move {name} right',\n resizeColumn: 'Resize {name} column',\n resizeColumnHint: 'Drag or use arrow keys to resize {name}; double-click or Alt+Backspace to restore its fitted width',\n actions: 'Actions',\n rowsDrawnAsYouScroll: { one: '{count} row, drawn as you scroll.', other: '{count} rows, drawn as you scroll.' },\n defaultOrderRowsHaveToCome: 'default order — rows have to come back in some order, and this is the one tablewalk chose',\n});\n","/**\n * A list whose rows open another record (a view's `opens`): a join table's list, `ticket_watcher`,\n * opens the ticket each row is about rather than the watcher row, a page with nothing to do on it. Given by the App's\n * list (AppList.tsx) to the two places a grid's row is opened from — the grid and, on a phone, its summaries — so no\n * prop has to be threaded through the rooms between them.\n */\nimport { createContext, useContext } from 'react';\nimport type { TableMeta } from '@mistriwork/engine/shared/schema.js';\n\ninterface RowOpens {\n /** The reference column whose record a row opens. */\n column: string;\n /** The fetched path its record's name is read from, when the list shows it by name. */\n label?: string;\n}\n\nexport const RowOpensContext = createContext<RowOpens | null>(null);\n\nexport const useRowOpens = () => useContext(RowOpensContext);\n\n/**\n * The record a row opens under `opens`: the referenced table, keyed by the row's value. `null` when the row names\n * none — an empty reference opens nothing, rather than the row it was asked not to open.\n */\nexport function rowOpensTarget(\n table: TableMeta,\n row: Record<string, unknown>,\n opens: RowOpens,\n): { table: string; key: Record<string, unknown>; label: string } | null {\n const ref = table.columns.find((column) => column.name === opens.column)?.references;\n const value = row[opens.column];\n if (!ref || value === null || value === undefined || value === '') return null;\n const named = opens.label ? row[opens.label] : undefined;\n return {\n table: ref.table,\n key: { [ref.column]: value },\n label: named == null || named === '' ? String(value) : String(named),\n };\n}\n","/**\n * A result grid, for anything that has rows and columns.\n *\n * One grid for the explorer's table view, an app's list, a record's related\n * rows, a dashboard's list card and an expanded row's children — two\n * renderers would drift, and a work order's parts showing `1`/`0` where\n * the table above shows ✓/✗ is the kind of small inconsistency that makes a\n * tool feel assembled rather than built.\n *\n * Sorting and filtering here work by rewriting the query text — that is\n * the design, and it is why a filter built by clicking can be edited by\n * typing, saved, shared as a link and read back later. So the grid holds\n * no sort state of its own: the walk's query is read for what is sorted,\n * and the header's clicks write to it.\n *\n * TanStack Table holds the column and row model; TanStack Virtual does the\n * window arithmetic for a long result, rendered as a real table with two\n * spacer rows, so column widths, sticky headers, text selection and\n * Find-in-page all keep working. Below a few hundred rows windowing costs\n * more than it saves and every row is drawn.\n *\n * The reader arranges the columns they see (gridArrange.ts): each head\n * carries move buttons and a resizer, one step or one drag at a time,\n * and the arrangement lives only in this grid — a refetch never moves a\n * column the reader placed, and another reader never sees it.\n */\nimport { useMessageLanguage } from './useMessageLanguage.js';\nimport {\n cloneElement,\n isValidElement,\n memo,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type ReactNode,\n} from 'react';\nimport { createColumnHelper, tableFeatures, useTable } from '@tanstack/react-table';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport {\n columnDisplay,\n columnLabel,\n currentEntry,\n emptyWord,\n keyOf,\n openRecord,\n peekRecord,\n prefersPages,\n primaryKey,\n rowLabel,\n state,\n viewportBox,\n viewportScale,\n} from '../core.js';\nimport { opensRecord } from '../recordIntent.js';\nimport { labelColumn as namingColumn } from '@mistriwork/engine/shared/schema.js';\nimport { datesAmong, dressFor, leadTonePath, maskedText, ruleSays, subtitlePath, type DisplayRule } from './valueModel.js';\nimport { currencyPath } from '@mistriwork/engine/shared/money.js';\nimport { dueOpen } from './dueOpen.js';\nimport { LeadMark } from './Dressed.js';\nimport { formatDate, formatDateTime, formatNumber, sayNearDay } from '../locale.js';\nimport { AvatarText, Dressed } from './Value.js';\nimport { ValueSlot } from './valueRenderers.js';\nimport { sortDirection } from '../clauses.js';\nimport { planColumn, sortableFromHeader } from '../columns.js';\nimport { pinnedFor, pinsVersion, subscribePins } from '../pins.js';\nimport { hasChildren } from '../nested.js';\nimport { openFilterMenu, sortBy } from '../thmenu.js';\nimport { AppColumnMenuButton, useAppColumnMenu } from './AppColumnMenu.js';\nimport type { ColumnMeta, TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport { DetailRow, Expander } from './Nested.js';\nimport {\n createRowHosts,\n RowDecoration,\n RowHostScope,\n RowTrailScope,\n rowKeyString,\n useRowHostScope,\n useRowTrailScope,\n type RowHostStore,\n} from './RowHost.js';\nimport type { TrailList } from '../recordTrail.js';\nimport { useGridKeyboard } from './useGridKeyboard.js';\nimport { useChangedRows } from '../liveState.js';\nimport { textMeasure } from './textMeasure.js';\nimport { presentationColumns } from './columnPresentation.js';\nimport { usePins } from './usePins.js';\nimport { useStickyHead } from './useStickyHead.js';\nimport type { TableSizing } from '@mistriwork/engine/shared/tableSizing.js';\nimport {\n fitGridColumns,\n keepFitting,\n tagsThatFit,\n twoLineWidth,\n GRID_EXPANDER_WIDTH,\n GRID_HEAD_CHAR,\n GRID_SIZE_SAMPLE,\n GRID_TRAIL_WIDTH,\n} from './gridSizing.js';\nimport { applyColumnOrder, applyColumnWidths, clampColumnWidth, columnResizeStep, MIN_COLUMN_WIDTH, moveColumn } from './gridArrange.js';\nimport { VISUAL_THEME_EVENT } from '../visualTheme.js';\nimport { JsonPreview } from './JsonPreview.js';\nimport { AvatarPhotoContext, AvatarPhotos, avatarOwner } from './avatarPhotos.js';\nimport { jsonValueOf, previewOf } from './jsonModel.js';\nimport { vocabularyWord } from '@mistriwork/engine/shared/model.js';\nimport { shell } from '../shellMode.js';\nimport type { CellDraw } from './gridCellModel.js';\nimport { parseLabelTemplate } from '@mistriwork/engine/shared/recordLabel.js';\nimport { say } from '../copy/lists/components/Grid.js';\nimport { TAGS_TYPE, tagChips } from '@mistriwork/engine/shared/tagLists.js';\nimport { addHostListener, removeHostListener, shellBody } from '../shellHost.js';\nimport { rowOpensTarget, useRowOpens } from './rowOpens.js';\n\n/* A column narrower than this does not take a folded detail line: it would wrap inside it. */\nconst FOLD_ROOM = 150;\n\n/* How many of a record's tags a list's cell draws before it says how many more. */\nconst TAGS_SHOWN = 3;\n/* The mark a reference's head draws after its label, and its sizing counts. */\nconst REFERENCE_MARK = '→';\n\nexport type Row = Record<string, unknown>;\n\nexport interface GridData {\n table?: string;\n columns?: string[];\n rows: Row[];\n total?: number;\n exactTotal?: boolean;\n /** The total stopped at its bound: at least `total` rows, not exactly. */\n cappedTotal?: boolean;\n /** The page this is, as the run answered it; a record opened from it steps through the list with them (recordTrail.ts). */\n limit?: number;\n offset?: number;\n ms?: number;\n order?: {\n implicit?: boolean;\n order: Array<{ column: string; direction: 'asc' | 'desc' }>;\n };\n /** The first and last rows' order values, where the list pages by key (pageStep.ts). */\n bounds?: {\n first: Record<string, string | number | boolean | null>;\n last: Record<string, string | number | boolean | null>;\n };\n errors?: unknown[];\n}\n\ninterface GridProps {\n sizing?: TableSizing;\n table?: TableMeta;\n data: GridData;\n /** Ride-along columns — the keys a list fetches so rows can open — dropped from the drawing only. */\n hide?: string[];\n /** A caller's own words over columns; the label seam answers otherwise. */\n labels?: Record<string, string>;\n /** Column → its total over the whole query, drawn in a footer row; undefined while it is asked. */\n totals?: Record<string, unknown>;\n /** The footer's caption: \"Total\", or what it is a total of when the grid shows fewer rows than it sums. */\n totalsLabel?: string;\n /** Row height: 'compact' tightens the rows of a list read as a ledger. */\n density?: 'comfortable' | 'compact';\n /** Visible raw-key column -> hidden joined label column. Keys remain untouched. */\n referenceLabels?: Record<string, string>;\n /** Whether this grid may navigate the walk: header sort, filter menus, expanders. */\n interactive?: boolean;\n /** Whether a long result is windowed. */\n virtual?: boolean;\n onRowClick?: (row: Row) => void;\n /** The list this grid's rows are a page of, when it is a room's own list: a record opened from it steps past the page (recordTrail.ts). An embedded grid hands its rows only. */\n list?: TrailList;\n /** The record the reader is on beside this list — a split's detail — marked and kept in view as it steps. */\n current?: Record<string, unknown>;\n emptyText?: string;\n compact?: boolean;\n /** The result's first row number in the whole, for the keyboard's aria. */\n firstRow?: number;\n /** An embedded grid keeps to its width: columns past it are left out rather than scrolled to. */\n dropColumns?: boolean;\n /** A cell's editor in place of its value, where the list edits it (GridCellEditor.tsx); undefined leaves the cell as drawn. */\n /** `label` is the reference's name the cell already draws, so an editor opens on it rather than on the key. */\n editCell?: (row: Row, column: string, draw: CellDraw, label?: unknown) => ReactNode | undefined;\n /** What the host draws in an empty cell in place of its empty mark (a suggestion waiting on it); undefined leaves the mark. One line: no row grows. */\n adornCell?: (row: Row, column: string) => ReactNode | undefined;\n}\n\n/** Beyond a few hundred rows the DOM, not the database, is the bottleneck. */\nconst VIRTUAL_THRESHOLD = 300;\nconst OVERSCAN = 12;\n/** The most a single grid cell will put in the DOM. Well past what 30rem shows. */\nconst CELL_MAX = 300;\n/** Rows started per batch when every row is expanded at once, and the pause between. */\nconst BATCH = 4;\nconst BREATH_MS = 60;\n\ninterface Plan {\n align: string;\n kind: string;\n mono: boolean;\n /** A text column of keys, references or codes: the data face stays for it in an App, where other short text is read. */\n idLike?: boolean;\n decimals?: number;\n group?: boolean;\n showTime?: boolean;\n}\n\nconst features = tableFeatures({});\nconst helper = createColumnHelper<typeof features, Row>();\nconst NO_ROWS: Row[] = [];\n\ntype RowHostRef = ReturnType<RowHostStore['ref']>;\n\nfunction clampCell(raw: string): { text: string; title?: string } {\n /* Not clamped, the cell has nothing to add on hover unless its column clips\n it, which onMouseOver decides from the cell's own overflow: a title on\n every value past 40 characters repeated a name the reader could read, in a\n native tooltip drawn over whatever sat under it. */\n if (raw.length <= CELL_MAX) return { text: raw };\n const more = raw.length - CELL_MAX;\n return {\n text: `${raw.slice(0, CELL_MAX)}…`,\n title: say('moreCharactersOpenTheRow', { count: more }),\n };\n}\n\n/**\n * One cell, rendered by what it holds. A reference is marked on the way\n * out: a foreign key can be a number, a string or a code, so the branch\n * that draws it is decided by its type while whether it points somewhere\n * is decided by the schema.\n */\n/** A total, dressed as its column is; a sum past 2^53 is shown as the server sent it. */\nfunction TotalValue({ value, display }: { value: unknown; display: DisplayRule | null }) {\n if (value === undefined)\n return (\n <span className=\"grid-totals-pending\" aria-label={say('summing')}>\n …\n </span>\n );\n if (value === null) return <span className=\"null\">{emptyWord()}</span>;\n const dress = dressFor(display, value);\n if (dress && dress.kind !== 'meter') return <Dressed dress={dress} compact={dress.kind === 'richText'} />;\n return <span className=\"num-value\">{formatNumber(value)}</span>;\n}\n\n/** The words a plain cell draws for a value, which the grid sizes a column by and a folded detail line tests its head\n against: a reference's label, a display rule's own words, a number as formatted, else the raw value. */\nfunction drawnWords(display: DisplayRule | null, plan: Plan, value: unknown, label?: unknown): unknown {\n if (label !== null && label !== undefined && String(label) !== '') return label;\n const dress = dressFor(display, value);\n if (!dress && plan.kind === 'number' && value != null) return numberShown(value, plan) ?? value;\n return (dress?.kind === 'tone' || dress?.kind === 'word' || dress?.kind === 'mark' ? dress.label : dress?.text) ?? value;\n}\n\n/** A row's folded columns, each drawn as its own cell would draw it, for the detail line under the row's name. */\nexport function foldedOf(more: NonNullable<CellColumn['more']>, record: Row): { name: string; head: string; body: ReactNode }[] {\n /* Empty says nothing, and a yes-or-no says its head where it is yes (\"Listed online\") and nothing where it is no. */\n const yes = (value: unknown) => value === true || value === 1 || value === '1' || value === 't' || value === 'true';\n return more\n .filter((column) => record[column.name] !== null && record[column.name] !== undefined && record[column.name] !== '')\n .filter((column) => column.plan.kind !== 'boolean' || yes(record[column.name]))\n .map((column) => {\n if (column.plan.kind === 'boolean') return { name: column.name, head: column.head, body: null };\n const td = CellBody({\n meta: column.meta,\n plan: column.plan,\n value: record[column.name],\n label: column.label ? record[column.label] : undefined,\n display: column.display,\n pin: undefined,\n edge: false,\n });\n /* A value that already says its head (\"Cycle 19\" under Cycle) is not told it twice: tested against the words\n the cell draws, which a display rule or a reference's label may set apart from the stored value. */\n const said = String(\n drawnWords(\n column.display as DisplayRule | null,\n column.plan,\n record[column.name],\n column.label ? record[column.label] : undefined,\n ) ?? '',\n ).toLowerCase();\n return {\n name: column.name,\n head: said.startsWith(column.head.toLowerCase()) ? '' : column.head,\n body: isValidElement<{ children?: ReactNode }>(td) ? td.props.children : null,\n };\n });\n}\n\n/** A cell, and under it the second line its column's display rule names.\n Memoized, as its row is: every prop is a value or a per-column object\n the grid keeps (`useKeptColumns`), so an unchanged cell is not redrawn.\n An editable cell is handed the grid's one `editCell` and its row, not a\n closure made per paint, for the same reason. */\nconst Cell = memo(function Cell({\n sub,\n more,\n editCell,\n adornCell,\n record,\n name,\n lead,\n ...props\n}: Parameters<typeof CellBody>[0] & {\n sub?: unknown;\n editCell?: GridProps['editCell'];\n adornCell?: GridProps['adornCell'];\n record?: Row;\n name?: string;\n /** The mark in a tinted square before the value, and the tone its square takes from the row. */\n lead?: { mark: string; tone?: string };\n /** The folded columns' heads and values, drawn under the value as one detail line. */\n more?: { name: string; head: string; body: ReactNode }[];\n}) {\n const edit = editCell && record && name !== undefined ? (draw: CellDraw) => editCell(record, name, draw, props.label) : undefined;\n const td = CellBody(props);\n const empty = props.value === null || props.value === undefined || props.value === '';\n const adorned = adornCell && record && name !== undefined && empty ? adornCell(record, name) : undefined;\n if (adorned !== undefined && isValidElement<{ children?: ReactNode }>(td)) return cloneElement(td, {}, adorned);\n /* An edited cell keeps its own <td> — alignment, pin, dress — and hands its\n editor a way to draw any value as this cell would. */\n if (edit && isValidElement<{ children?: ReactNode; className?: string }>(td)) {\n const draw: CellDraw = (next) => {\n const drawn = next ? CellBody({ ...props, value: next.value, label: next.label }) : td;\n return isValidElement<{ children?: ReactNode }>(drawn) ? drawn.props.children : null;\n };\n const editor = edit(draw);\n /* The whole cell is the editor's, its padding too: a click there edits\n rather than opening the row, as a click on the value does. */\n if (editor !== undefined)\n return cloneElement(\n td,\n {\n className: `${td.props.className ?? ''} cell-editable`,\n onClick: (event: React.MouseEvent<HTMLElement>) => {\n event.stopPropagation();\n if (event.target === event.currentTarget) event.currentTarget.querySelector<HTMLElement>('[data-cell-edits]')?.click();\n },\n } as Record<string, unknown>,\n editor,\n );\n }\n const hasSub = !(sub === null || sub === undefined || sub === '');\n const hasMore = Boolean(more?.length);\n if ((!hasSub && !lead && !hasMore) || !isValidElement<{ children?: ReactNode; className?: string }>(td)) return td;\n const body =\n hasSub || hasMore ? (\n <span className=\"cell-stack\">\n <span className=\"cell-main\">{td.props.children}</span>\n {hasSub && <span className=\"cell-sub\">{String(sub)}</span>}\n {hasMore && (\n <span className=\"cell-more\">\n {more!.map((item) => (\n <span key={item.name} className=\"cell-more-item\">\n {item.head && <span className={item.body === null ? 'cell-more-flag' : 'cell-more-head'}>{item.head}</span>}\n {item.body !== null && <> {item.body}</>}\n </span>\n ))}\n </span>\n )}\n </span>\n ) : (\n td.props.children\n );\n return cloneElement(\n td,\n hasMore ? ({ className: `${td.props.className ?? ''} has-more` } as Record<string, unknown>) : undefined,\n lead ? (\n <span className=\"cell-lead\">\n <LeadMark mark={lead.mark} tone={lead.tone} />\n <span className=\"cell-lead-body\">{body}</span>\n </span>\n ) : (\n body\n ),\n );\n});\n\n/* The lead icon a column's rule puts before its value, tinted by the tone its tone column's rule gives the row. Kept\n per row as one object per mark and tone, so the memoized cell sees the same prop until the row changes. */\nconst leads = new Map<string, { mark: string; tone?: string }>();\nfunction leadOf(column: CellColumn, record: Row): { mark: string; tone?: string } | undefined {\n const mark = column.display?.icon?.mark;\n if (!mark) return undefined;\n const raw = column.leadTone && Object.hasOwn(record, column.leadTone.path) ? record[column.leadTone.path] : undefined;\n const said = column.leadTone && raw != null ? ruleSays(column.leadTone.rule, raw).tone : undefined;\n /* A value the rule does not name is \"neutral\" as a chip, but a grey square on every ordinary row reads as disabled:\n only a tone the rule says (by name or by \"*\") takes the accent's place. */\n const named = column.leadTone?.rule?.tone ?? {};\n const tone = said === 'neutral' && !Object.hasOwn(named, String(raw)) && !Object.hasOwn(named, '*') ? undefined : said;\n const key = `${mark}\\u0000${tone ?? ''}`;\n if (!leads.has(key)) leads.set(key, { mark, ...(tone ? { tone } : {}) });\n return leads.get(key);\n}\n\n/* A key the App names in its own words ('SO-{id}'): the template filled\n with the key as it came, never through Number(), so a key past 2^53\n reads whole. The cell's data is untouched: sort, filter and export read the key. */\nfunction keyName(template: string, value: unknown): unknown {\n if (value === null || value === undefined || value === '') return value;\n const parsed = parseLabelTemplate(template);\n return 'problem' in parsed ? value : parsed.parts.map((part) => ('text' in part ? part.text : String(value))).join('');\n}\n\n/** What a row needs to draw one column's cells. */\ninterface CellColumn {\n name: string;\n meta: ColumnMeta | undefined;\n plan: Plan;\n display: DisplayRule | null;\n /** The hidden column that holds a reference's label, when this column is one. */\n label: string | undefined;\n /** The row field its second line is read from, when the display rule names one. */\n subtitle: string | undefined;\n /** The row field a money column's currency code is read from, when its rule says `currency: { column }`. */\n currency?: string;\n /** The row field a lead icon's tone is read from, and the rule that says that field's tone. */\n leadTone?: { path: string; rule: DisplayRule | null };\n /** The App's name for a record keyed by this column ('SO-{id}'), drawn in place of the bare key. */\n named?: string;\n /** The row column holding the key of the record this column's avatar photo is of (avatarPhotos.tsx). */\n photoOwner: string | undefined;\n pin: number | undefined;\n edge: boolean;\n wraps?: boolean;\n /** The columns the room could not hold, drawn under this one's value as a detail line (an App's list). */\n more?: { name: string; head: string; meta: ColumnMeta | undefined; plan: Plan; display: DisplayRule | null; label: string | undefined }[];\n}\n\n/**\n * The columns as the rows draw them, the same array for as long as nothing\n * in it changed. The grid redraws whenever the room around it does — a\n * keystroke in the list's search box was one — and a fresh array every time\n * handed every memoized row a new prop, so each keystroke redrew every cell\n * on the page: 250 rows, 250 times the work of 20.\n */\nfunction useKeptColumns(columns: CellColumn[]): CellColumn[] {\n const kept = useRef(columns);\n const was = kept.current;\n /* A plan is remade from the rows (planColumn reads their decimals), so a\n refetch with one changed row compares it by what it says. */\n const samePlan = (a: Plan, b: Plan) =>\n (Object.keys(a) as Array<keyof Plan>).every((key) => a[key] === b[key]) && Object.keys(a).length === Object.keys(b).length;\n const same =\n was.length === columns.length &&\n columns.every((column, i) =>\n (Object.keys(column) as Array<keyof CellColumn>).every(\n (key) => column[key] === was[i][key] || (key === 'plan' && samePlan(column.plan, was[i].plan)),\n ),\n );\n if (!same) kept.current = columns;\n return kept.current;\n}\n\n/** What a number cell draws for a value, or null where it draws the raw text.\n A value the server sent as a string because it is past 2^53 must not be\n run back through Number(): formatNumber keeps every digit. */\nfunction numberShown(value: unknown, plan: { decimals?: number; group?: boolean }): string | null {\n const n = Number(value);\n if (typeof value === 'string' && /^-?\\d+$/.test(value) && !Number.isSafeInteger(n)) return formatNumber(value);\n return Number.isFinite(n)\n ? formatNumber(n, {\n minimumFractionDigits: plan.decimals,\n maximumFractionDigits: plan.decimals,\n useGrouping: plan.group,\n })\n : null;\n}\n\n/* A dress that draws only its words: a meter's bar and a percent's bar or ring are width the words do not\n measure. (Only a number's or a date's dress is read for this: an avatar or a signature is text's.) */\nconst drawsWords = (dress: NonNullable<ReturnType<typeof dressFor>>) =>\n dress.kind !== 'meter' && !('bar' in dress && dress.bar) && !('ring' in dress && dress.ring);\n\n/* A record's tags in a list's cell: as many whole chips as the cell holds\n (at most TAGS_SHOWN, at least one), then how many more. Clipped by the\n cell, Thread's issues read \"accessibility perfo\"; a chip is a word, and a\n cut one is no word at all. The chips that do not fit are hidden, not\n unmounted, so a wider cell shows them again; the count is written into a\n span React leaves empty. */\nfunction TagsCellList({ chips }: { chips: ReturnType<typeof tagChips> }) {\n const ref = useRef<HTMLSpanElement>(null);\n const shown = chips.slice(0, TAGS_SHOWN);\n const labels = chips.map((chip) => chip.label).join('\\n');\n useLayoutEffect(() => {\n const list = ref.current;\n const cell = list?.parentElement;\n if (!list || !cell) return;\n const tags = [...list.querySelectorAll<HTMLElement>(':scope > .record-tag')];\n const more = list.querySelector<HTMLElement>(':scope > .tags-cell-more')!;\n const sayMore = (count: number) => {\n more.textContent = count > 0 ? say('moreTags', { count }) : '';\n more.style.display = count > 0 ? '' : 'none';\n };\n const fit = () => {\n tags.forEach((tag) => (tag.style.display = ''));\n sayMore(chips.length - tags.length);\n const box = getComputedStyle(cell);\n const room = cell.clientWidth - parseFloat(box.paddingLeft) - parseFloat(box.paddingRight);\n if (!(room > 0)) return;\n const gap = parseFloat(getComputedStyle(list).columnGap) || 0;\n const widths = tags.map((tag) => tag.offsetWidth);\n const count = tagsThatFit(widths, chips.length, gap, room, (rest) => {\n sayMore(rest);\n return more.offsetWidth;\n });\n sayMore(chips.length - count);\n tags.forEach((tag, index) => (tag.style.display = index < count ? '' : 'none'));\n };\n fit();\n const observer = new ResizeObserver(() => fit());\n observer.observe(cell);\n return () => observer.disconnect();\n }, [labels]); // eslint-disable-line react-hooks/exhaustive-deps\n return (\n <span ref={ref} className=\"tags-cell-list\">\n {shown.map((chip) => (\n <span key={chip.label} className={`record-tag tone tone-${chip.tone ?? 'neutral'}`}>\n {chip.label}\n </span>\n ))}\n <span className=\"tags-cell-more\" />\n </span>\n );\n}\n\nfunction CellBody(\n props: Parameters<typeof PlatformCell>[0] & {\n row?: Record<string, unknown>;\n table?: string;\n currency?: unknown;\n /** A due date's row is still open (dueOpen.ts): one that has passed is drawn in the warning tone. */\n open?: boolean;\n },\n) {\n const { row, table, currency, open, ...cell } = props;\n if (open) cell.display = { ...(cell.display as DisplayRule), open: true };\n /* A money column whose currency is the row's own: the code the row holds, where it holds one. */\n if (typeof currency === 'string' && /^[A-Za-z]{3}$/.test(currency))\n cell.display = {\n ...(cell.display as DisplayRule),\n currency: currency.toUpperCase(),\n };\n const rule = cell.display as DisplayRule | null;\n /* The App's own renderer draws the value inside the platform's cell — its\n class, alignment and pin kept — and the platform's own drawing stands in\n until it arrives. The cell's data is untouched: sort, filter and export\n read the value, never what a renderer drew. */\n if (\n rule?.component &&\n table &&\n maskedText(rule, cell.value) === undefined &&\n cell.value !== null &&\n cell.value !== undefined &&\n shellBody().classList.contains('app-mode')\n ) {\n const { component: _component, ...rest } = rule;\n const td = PlatformCell({ ...cell, display: rest });\n if (!isValidElement<{ children?: ReactNode }>(td)) return td;\n return cloneElement(\n td,\n undefined,\n <ValueSlot\n id={rule.component.id}\n value={cell.value}\n row={row}\n column={{ name: cell.meta?.name ?? '', resource: table }}\n context=\"grid\"\n compact\n {...ruleSays(rest, cell.value)}\n fallback={td.props.children}\n />,\n );\n }\n return PlatformCell(cell);\n}\n\nfunction PlatformCell({\n meta,\n plan,\n value,\n label,\n display,\n pin,\n edge,\n photo,\n wraps,\n}: {\n meta: ColumnMeta | undefined;\n plan: Plan;\n value: unknown;\n label?: unknown;\n display: unknown;\n pin: number | undefined;\n edge: boolean;\n /** The room set this column's values on two lines (gridSizing.ts): the cell wraps at words, kept whole. */\n wraps?: boolean;\n /** The avatar's photo, where the column draws one and the record has one. */\n photo?: string;\n}) {\n const classes: string[] = [`align-${plan.align}`];\n const peek =\n meta?.references && value !== null && value !== undefined && value !== ''\n ? {\n 'data-ref-table': meta.references.table,\n 'data-ref-column': meta.references.column,\n 'data-ref-value': String(value),\n }\n : {};\n const pinAttrs = pin !== undefined ? { style: { left: `${pin}px` } } : {};\n /* The face the rule asks for wins; unasked, an App sets short text in the reading face unless it is a key or a code. */\n const face = (display as DisplayRule | null)?.face;\n const app = shellBody().classList.contains('app-mode');\n const pinClass =\n (pin !== undefined ? ` pinned${edge ? ' pinned-edge' : ''}` : '') + (face ? ` face-${face}` : '') + (wraps ? ' wraps' : '');\n\n /* A record's tags (tagLists.ts): a few chips, and how many more there are. */\n if (meta?.type === TAGS_TYPE) {\n const chips = tagChips(value);\n return (\n <td className={`align-left tags-cell${pinClass}`} title={chips.map((chip) => chip.label).join(', ') || undefined} {...pinAttrs}>\n {chips.length ? <TagsCellList chips={chips} /> : emptyWord()}\n </td>\n );\n }\n if (value === null || value === undefined) {\n return (\n <td className={`null align-${plan.align}${pinClass}`} title=\"null\" {...pinAttrs}>\n {emptyWord()}\n </td>\n );\n }\n const json = jsonValueOf(meta, value);\n if (json)\n return (\n <td className={`align-left json-cell${pinClass}`} {...pinAttrs}>\n <JsonPreview value={json.value} name={meta?.name ?? 'Value'} type={meta?.type} />\n </td>\n );\n const raw = String(value);\n if (label !== null && label !== undefined && String(label) !== '') {\n return (\n <td className={`align-left reflink${pinClass}`} title={`${String(label)} (${raw})`} {...peek} {...pinAttrs}>\n {(display as DisplayRule | null)?.avatar ? (\n <AvatarText text={clampCell(String(label)).text} photo={photo} />\n ) : (\n clampCell(String(label)).text\n )}\n </td>\n );\n }\n const dress = dressFor(display as DisplayRule | null, value);\n if (dress) {\n return (\n <td className={`align-${plan.align} dressed${pinClass}`} {...peek} {...pinAttrs}>\n {/* A cell is one line: rich text is its excerpt there, read whole on its record. */}\n <Dressed dress={dress.kind === 'avatar' && photo ? { ...dress, photo } : dress} compact={dress.kind === 'richText'} />\n </td>\n );\n }\n if (!face && (plan.kind === 'number' || (plan.mono && (!app || plan.kind !== 'text' || plan.idLike)))) classes.push('mono');\n\n if (plan.kind === 'boolean') {\n const on = value === true || value === 1 || value === '1' || value === 't';\n return (\n <td className={`${classes.join(' ')} bool${pinClass}`} title={raw} {...peek} {...pinAttrs}>\n <span className={on ? 'yes' : 'no'}>{on ? '✓' : '✗'}</span>\n </td>\n );\n }\n if (plan.kind === 'number') {\n const shown = numberShown(value, plan) ?? raw;\n return (\n <td\n className={`${classes.join(' ')} num${meta?.references ? ' reflink' : ''}${pinClass}`}\n title={shown === raw ? undefined : raw}\n {...peek}\n {...pinAttrs}\n >\n {shown}\n </td>\n );\n }\n if (plan.kind === 'date') {\n /* An App says a near day from today and the rest as the date, the whole of it on hover (sayNearDay); the\n Workbench shows the data as it is, its stored form on hover. */\n const near = app ? sayNearDay(raw, Boolean(plan.showTime)) : null;\n const shown = near?.text ?? (plan.showTime ? formatDateTime(raw) : formatDate(raw));\n const title = near?.title ?? (shown === raw ? undefined : raw);\n return (\n <td className={`${classes.join(' ')}${pinClass}`} title={title} {...peek} {...pinAttrs}>\n {shown}\n </td>\n );\n }\n if (meta?.references) {\n return (\n <td className={`${classes.join(' ')}${pinClass}`} {...peek} {...pinAttrs}>\n <span className=\"ref\" title={`→ ${meta.references.table}`}>\n {raw}\n </span>\n </td>\n );\n }\n /* In an App a vocabulary's value is a word (Value.tsx says why); the Workbench's grid shows the data. */\n if (shellBody().classList.contains('app-mode') && meta?.allowed?.includes(raw))\n return (\n <td className={`${classes.join(' ')}${pinClass}`} title={raw} {...pinAttrs}>\n {vocabularyWord(raw)}\n </td>\n );\n const cell = clampCell(raw);\n return (\n <td className={`${classes.join(' ')}${pinClass}`} title={cell.title} {...pinAttrs}>\n {cell.text}\n </td>\n );\n}\n\n/* A vocabulary column that says where a row stands, kept when a narrow grid leaves columns out. */\nconst STATUS_NAME = /(^|_)(status|state|stage|phase)$/i;\n\nexport function Grid({\n table,\n data,\n hide,\n labels,\n totals,\n totalsLabel = say('total'),\n density,\n referenceLabels,\n sizing = 'fit',\n interactive = true,\n virtual: mayVirtualise = true,\n onRowClick,\n list,\n current,\n emptyText,\n compact = false,\n firstRow = 0,\n dropColumns = false,\n editCell,\n adornCell,\n}: GridProps) {\n const captionLanguage = useMessageLanguage();\n const wrap = useRef<HTMLDivElement>(null);\n const tableRef = useRef<HTMLTableElement>(null);\n const rows = data.rows ?? NO_ROWS;\n const byName = useMemo(() => presentationColumns(state.schema, table, data.columns ?? []), [table, data.columns, state.schema]);\n /* The columns asked to be drawn; an embedded grid may leave out those past its width (`drawn`, below). */\n const asked = useMemo(\n () => (hide?.length ? (data.columns ?? []).filter((name) => !hide.includes(name)) : (data.columns ?? [])),\n [data.columns, hide?.join(',')], // eslint-disable-line react-hooks/exhaustive-deps\n );\n /* A second line is read from the row only where the row carries it: a\n subtitle the list did not fetch is left out rather than read from a\n column of the same name on another table. */\n const subtitleOf = (name: string, row: Row) => {\n const path = subtitlePath(columnDisplay(table?.id, name) as DisplayRule | null, name);\n return path && Object.hasOwn(row, path) ? row[path] : undefined;\n };\n const plans = useMemo(\n () =>\n new Map(\n asked.map((name) => [\n name,\n {\n ...planColumn(byName.get(name), name, rows),\n ...(referenceLabels?.[name] ? { align: 'left' } : {}),\n // A key the App names ('SO-{id}') is drawn as that name: text, read from the left.\n ...(table?.keyLabel && table.labelTemplate && byName.get(name)?.primaryKey ? { kind: 'text', align: 'left' } : {}),\n } as Plan,\n ]),\n ),\n [asked, byName, rows, referenceLabels, table],\n );\n /* Each row's identity: the string its host is published under and the key\n React keeps it by, so a refetch that reorders or drops rows moves the\n survivors instead of redrawing them. A row that cannot name itself — no\n key, a result that dropped a key column, a duplicate — is kept by\n position and has no host. */\n const keyed = Boolean(table && primaryKey(table).length && primaryKey(table).every((c: string) => (data.columns ?? []).includes(c)));\n const outerHosts = useRowHostScope();\n const [ownHosts] = useState(createRowHosts);\n const hosts = outerHosts ?? ownHosts;\n /* The trailing cell, drawn only when something around the grid asked to\n put a row's own menu there — and only on rows that can name themselves. */\n const trailHosts = useRowTrailScope();\n const rowKeys = useMemo(() => {\n if (!keyed) return rows.map(() => null);\n const seen = new Set<string>();\n return rows.map((row) => {\n const key = rowKeyString(table, row);\n if (key === null || seen.has(key)) return null;\n seen.add(key);\n return key;\n });\n }, [keyed, table, rows]);\n /* Rows another person just changed, tinted for a moment (liveState.ts, docs/design.md rule 11). */\n const changedRows = useChangedRows(table?.id, rows, (row) => (table ? (keyOf(table, row) as Record<string, unknown> | null) : null));\n const openable = useMemo(() => rowKeys.filter((key): key is string => key !== null), [rowKeys]);\n\n const virtual = mayVirtualise && rows.length > VIRTUAL_THRESHOLD;\n /* Not where rows open as pages: the expander is the explorer's way of\n seeing what points at a row, and an app's list gets that on the page\n the row opens as. Nor on a windowed table: an opened detail is many\n times a row's height, and the window's whole model is uniform rows. Nor\n on a result without the key: what points at a row is asked by its key,\n and a projection that dropped it has nothing to ask with. */\n const expandable = interactive && !prefersPages() && rows.length <= VIRTUAL_THRESHOLD && hasChildren(table) && keyed;\n /* The leading cell is each row's host (components/RowHost.tsx): drawn when\n the grid has an expander to put there, or when a presentation around\n the grid has asked to decorate its rows. */\n const slotted = expandable || Boolean(outerHosts);\n const shift = slotted ? 1 : 0;\n const trailing = Boolean(trailHosts) && keyed;\n const language = interactive && Boolean(table);\n const [availableWidth, setAvailableWidth] = useState(0);\n const [headChar, setHeadChar] = useState(GRID_HEAD_CHAR);\n /* How a head sets its label (font, case, tracking), so a column is sized by the label as drawn and not by a\n count of its characters: seven pixels a character kept \"Listed online\" 125px wide at 1280, and the table\n that did not fit cut the last column off. */\n const [headFace, setHeadFace] = useState<{ font: string; upper: boolean; tracking: number } | null>(null);\n /* The fonts the first row's cells set in, one per cell, so a column is sized\n by what its words measure there rather than a count of their characters\n (gridSizing.ts). Per cell: a look sets the first column heavier, and\n measured in the others' weight its names ran past the width they got. */\n const [cellFonts, setCellFonts] = useState<string[]>([]);\n /* What a tone chip in the first row draws beyond its words, per cell (its dot, gap, padding): a look that says a\n status as a pill spends 41px there, one that says it as a dot and a word 12, and sizing every column for the\n wider kept 30px of every table's room in a status that never used it. -1: the cell holds no chip. */\n const [cellChips, setCellChips] = useState<number[]>([]);\n useLayoutEffect(() => {\n if (sizing !== 'fit' || !wrap.current) return;\n const element = wrap.current;\n /* The look says how wide its heads' characters set (gridSizing.ts); read\n again when the reader picks another look, which moves no width. */\n const measure = (contentWidth?: number) => {\n const style = getComputedStyle(element);\n /* clientWidth rounds up fractional layout widths. At density zoom that\n can create a one-screen-pixel scroll range even when scrollWidth and\n clientWidth agree. Preserve the fraction until fitGridColumns floors\n it; neither clip real overflow nor subtract space from column minima. */\n const inset =\n style.boxSizing === 'border-box'\n ? [style.paddingLeft, style.paddingRight, style.borderLeftWidth, style.borderRightWidth].reduce(\n (sum, value) => sum + (parseFloat(value) || 0),\n 0,\n )\n : 0;\n setAvailableWidth(contentWidth ?? Math.max(0, parseFloat(style.width) - inset));\n setHeadChar(parseFloat(style.getPropertyValue('--grid-head-char')) || GRID_HEAD_CHAR);\n const label = element.querySelector('thead th .th-sort');\n if (label) {\n const face = getComputedStyle(label);\n const next = {\n font: `${face.fontStyle} ${face.fontWeight} ${face.fontSize} ${face.fontFamily}`,\n upper: face.textTransform === 'uppercase',\n tracking: parseFloat(face.letterSpacing) || 0,\n };\n setHeadFace((was) => (was && was.font === next.font && was.upper === next.upper && was.tracking === next.tracking ? was : next));\n }\n const cells = [...element.querySelectorAll('tbody tr:first-child > td')];\n if (cells.length) {\n const fonts = cells.map((cell) => {\n const font = getComputedStyle(cell);\n return `${font.fontStyle} ${font.fontWeight} ${font.fontSize} ${font.fontFamily}`;\n });\n setCellFonts((was) => (was.join('|') === fonts.join('|') ? was : fonts));\n /* The widest chip of the sampled rows, not the first row's: a look may draw a neutral state as a bare word\n and the rest as pills, and sized by a first-row \"Ready\" Sage cut every \"In review\" pill to \"In rev…\". */\n const rows = [...element.querySelectorAll('tbody tr')].slice(0, GRID_SIZE_SAMPLE);\n const chips = cells.map((_, index) => {\n let extra = -1;\n for (const row of rows) {\n const chip = row.children[index]?.querySelector<HTMLElement>('.tone:not(.tone-figure)');\n const words = chip?.textContent?.trim();\n const said = words ? textMeasure(fonts[index])?.(words) : undefined;\n if (chip && said !== undefined) extra = Math.max(extra, Math.ceil(chip.offsetWidth - said));\n }\n return extra;\n });\n /* A row with no chip in the cell (a sort moved the empty ones to the top) keeps what was known: the\n columns must not move because of which row happens to be first. */\n setCellChips((was) => {\n const next = chips.map((extra, index) => (extra >= 0 ? extra : (was[index] ?? -1)));\n return was.join('|') === next.join('|') ? was : next;\n });\n }\n };\n measure();\n const observer = new ResizeObserver((entries) => measure(entries[0]?.contentRect.width));\n observer.observe(element);\n const themeChanged = () => measure();\n addHostListener(window, VISUAL_THEME_EVENT, themeChanged);\n return () => {\n observer.disconnect();\n removeHostListener(window, VISUAL_THEME_EVENT, themeChanged);\n };\n }, [sizing]);\n /* The column that names the row — the table's label where it is drawn,\n else the first text — is read whole before the others (gridSizing.ts). */\n const titleName = useMemo(() => {\n const naming = table ? namingColumn(table) : undefined;\n return naming && asked.includes(naming)\n ? naming\n : asked.find((name) => plans.get(name)?.kind === 'text' || Boolean(referenceLabels?.[name]));\n }, [table, asked, plans, referenceLabels]);\n const sizeHints = useMemo(\n () =>\n asked.map((name) => {\n const plan = plans.get(name)!;\n const labelColumn = referenceLabels?.[name];\n const display = datesAmong(\n columnDisplay(table?.id, name) as DisplayRule | null,\n rows.map((row) => row[name]),\n );\n const label = String(labels?.[name] ?? columnLabel(table?.id, name) ?? name);\n const headText = byName.get(name)?.primaryKey && !shell().inApp() ? `${label} ${say('common.key')}` : label;\n const headMeasure = headFace ? textMeasure(headFace.font) : undefined;\n const headSet = (text: string) => headMeasure!(headFace!.upper ? text.toUpperCase() : text) + headFace!.tracking * text.length;\n return {\n headWidth: headMeasure ? headSet(headText) : undefined,\n /* An App's head wraps to two lines before it widens its column (style.css, .th-label). */\n wrapHead: shell().inApp(),\n /* An App's words may wrap too, once its heads have and the room is still short: kept whole on two lines. */\n wrapValues: shell().inApp() && (Boolean(labelColumn) || plan.kind === 'text') && !display?.component,\n headWrap: headMeasure && shell().inApp() ? twoLineWidth(headText, headSet) : undefined,\n /* The head's key badge is words too, where it is drawn (an App hides it, features.css): once a\n number was sized by its figures, the Workbench's \"id KEY ↓\" lost its \"id\" under the badge. */\n label: byName.get(name)?.primaryKey && !shell().inApp() ? `${label} ${say('common.key')}` : label,\n title: name === titleName,\n avatar: Boolean(display?.avatar),\n chipExtra: (cellChips[asked.indexOf(name) + shift] ?? -1) >= 0 ? cellChips[asked.indexOf(name) + shift] : undefined,\n kind: labelColumn ? 'text' : plan.kind,\n controls: language || Boolean(byName.get(name)?.primaryKey || byName.get(name)?.references),\n /* A reference's arrow stands beside its label in the sort (the head, below), after the sort's 4px gap:\n uncounted, it took the room past the label that the resizer's strip is (style.css). */\n mark: byName.get(name)?.references ? 4 + (headMeasure ? headSet(REFERENCE_MARK) : GRID_HEAD_CHAR) : undefined,\n showTime: plan.showTime,\n values: rows.slice(0, GRID_SIZE_SAMPLE).map((row) => {\n if (labelColumn && row[labelColumn] != null) return row[labelColumn];\n /* A tags cell keeps at least its first chip whole, and the count beside it (TagsCellList). */\n if (byName.get(name)?.type === TAGS_TYPE) {\n const chips = tagChips(row[name]);\n return chips.length\n ? `${chips[0]!.label}${chips.length > 1 ? ` ${say('moreTags', { count: chips.length - 1 })}` : ''}`\n : null;\n }\n const json = jsonValueOf(byName.get(name), row[name]);\n if (json) return previewOf(json.value);\n // Sized by what is drawn: a tone chip draws its label, a bare number its formatted figures.\n return drawnWords(display, plan, row[name]);\n }),\n subValues: display?.subtitle ? rows.slice(0, GRID_SIZE_SAMPLE).map((row) => subtitleOf(name, row)) : undefined,\n chip:\n byName.get(name)?.type === TAGS_TYPE ||\n (!labelColumn &&\n rows.slice(0, GRID_SIZE_SAMPLE).some((row) => {\n const dress = dressFor(display, row[name]);\n return dress?.kind === 'tone' && !dress.figure;\n })),\n /* A number with no rule is sized by the figures its cell draws (\"1,249.50\"), measured as they\n are; an App's own renderer draws something the words do not measure. */\n dressed:\n !labelColumn &&\n !display?.component &&\n rows.slice(0, GRID_SIZE_SAMPLE).every((row) => {\n if (row[name] == null) return true;\n const dress = dressFor(display, row[name]);\n return dress ? drawsWords(dress) : plan.kind === 'number' && numberShown(row[name], plan) != null;\n }),\n status:\n !labelColumn &&\n plan.kind !== 'number' &&\n (Boolean(display?.tone && !display.format && !display.bar) ||\n (Boolean(byName.get(name)?.allowed?.length) && STATUS_NAME.test(name))),\n };\n }),\n [asked, plans, referenceLabels, table?.id, labels, language, captionLanguage, byName, rows, titleName, headFace, cellChips, shift],\n );\n /* Column i's cell follows the expander's when there is one. */\n const measureText = useMemo(\n () =>\n cellFonts.length\n ? (text: string, column: number) =>\n textMeasure(cellFonts[Math.min(column + (slotted ? 1 : 0), cellFonts.length - 1)])?.(text) ?? text.length * 8\n : undefined,\n [cellFonts, slotted],\n );\n /* An App's own list folds the columns its room cannot hold under the row's name, as a detail line, once its heads\n and words have wrapped (gridSizing.ts): they are moved, not lost, and the list does not scroll sideways. An\n embedded grid leaves them out, as it did. */\n const folds = !dropColumns && sizing === 'fit' && shell().inApp();\n const kept = useMemo(\n () =>\n (dropColumns || folds) && sizing === 'fit' ? keepFitting(sizeHints, availableWidth, slotted, trailing, headChar, measureText) : null,\n [dropColumns, folds, sizing, sizeHints, availableWidth, slotted, trailing, headChar, measureText],\n );\n const drawn = useMemo(() => (kept ? asked.filter((_, index) => kept[index]) : asked), [asked, kept]);\n const drawnHints = useMemo(() => (kept ? sizeHints.filter((_, index) => kept[index]) : sizeHints), [sizeHints, kept]);\n /* The reader's arrangement, over the drawn columns (gridArrange.ts): an\n order the reader put the columns in, and widths they dragged them to.\n Both live only in this grid — a refetch never moves a placed column —\n and both are dropped for columns no longer drawn. */\n const [columnOrder, setColumnOrder] = useState<string[] | null>(null);\n const [columnWidths, setColumnWidths] = useState<Record<string, number>>({});\n const ordered = useMemo(() => applyColumnOrder(drawn, columnOrder), [drawn, columnOrder]);\n const orderedHints = useMemo(() => ordered.map((name) => drawnHints[drawn.indexOf(name)]!), [ordered, drawn, drawnHints]);\n const fit = useMemo(\n () => fitGridColumns(orderedHints, availableWidth, slotted, trailing, headChar, measureText, dropColumns),\n [orderedHints, availableWidth, slotted, trailing, headChar, measureText, dropColumns],\n );\n /* A dragged width stands in place of its fitted one. A scrolled grid has\n no colgroup until a width is dragged: then it takes one, and the fixed\n layout that makes a dragged width hold, with the fitted widths for the\n columns untouched — a grid that was never arranged draws exactly as it\n did. */\n const hasWidthOverrides = Object.keys(columnWidths).length > 0;\n const colWidths = useMemo(\n () => (hasWidthOverrides ? applyColumnWidths(fit.columns, ordered, columnWidths) : fit.columns),\n [hasWidthOverrides, fit.columns, ordered, columnWidths],\n );\n const useColgroup = sizing === 'fit' || hasWidthOverrides;\n const tableWidth = hasWidthOverrides\n ? colWidths.reduce((sum, width) => sum + width, 0) + (slotted ? GRID_EXPANDER_WIDTH : 0) + (trailing ? GRID_TRAIL_WIDTH : 0)\n : fit.width;\n const moveColumnBy = useCallback(\n (name: string, direction: 'left' | 'right') =>\n setColumnOrder((current) => moveColumn(applyColumnOrder(drawn, current), name, direction)),\n [drawn],\n );\n const setColumnWidth = useCallback(\n (name: string, width: number) =>\n setColumnWidths((current) => {\n const next = clampColumnWidth(width);\n return current[name] === next ? current : { ...current, [name]: next };\n }),\n [],\n );\n const resetColumnWidth = useCallback(\n (name: string) =>\n setColumnWidths((current) => {\n if (!(name in current)) return current;\n const next = { ...current };\n delete next[name];\n return next;\n }),\n [],\n );\n /* The widths a scrolled grid's columns are drawn at now. A scrolled grid is laid out by its content and holds no\n width of its own, so the first one dragged would otherwise switch it to a fixed layout with every other column\n at its estimated minimum, and the dragged one would start from the estimate rather than from what the reader\n grabbed. The heads are measured instead, and the whole row becomes the first arrangement: the switch moves\n nothing but the column being dragged. A head not laid out yet (no width) is left to its fitted width. */\n const measureDrawn = useCallback((from: Element): Record<string, number> => {\n const measured: Record<string, number> = {};\n for (const th of from.closest('table')?.querySelectorAll<HTMLElement>('thead th[data-col]') ?? []) {\n const width = th.getBoundingClientRect().width / viewportScale();\n if (width > 0) measured[th.dataset.col!] = clampColumnWidth(width);\n }\n return measured;\n }, []);\n /* One resizer drag at a time: where it started, the width it started\n from, and the override it started over, so a cancelled drag puts\n back exactly what was there — including no override at all. `seed` is\n the measured row of a scrolled grid not yet arranged, spent by the\n first move (a press that never moves arranges nothing). */\n const resizeDrag = useRef<{\n name: string;\n startX: number;\n startWidth: number;\n hadOverride: boolean;\n prevWidth: number | undefined;\n seed: Record<string, number> | null;\n seeded: boolean;\n } | null>(null);\n const columns = useMemo(\n () => helper.columns(ordered.map((name) => helper.accessor((row: Row) => row[name], { id: name, header: name }))),\n [ordered],\n );\n const model = useTable({ features, columns, data: rows });\n const modelRows = model.getRowModel().rows;\n /* In an App list the header's ⌄ is the App's short menu (AppColumnMenu.tsx), and the list's pins are its own. */\n const appMenu = useAppColumnMenu();\n const pinList = appMenu?.current?.listKey;\n const pinChange = useSyncExternalStore(subscribePins, pinsVersion);\n const pinned = useMemo(\n () => (interactive ? (pinnedFor(table, ordered, pinList) as string[]) : []),\n [interactive, table, ordered, pinList, pinChange],\n ); // eslint-disable-line react-hooks/exhaustive-deps\n /* A pinned column keeps the block at the left that its sticky offsets are measured over (usePins.ts), so a\n column steps only among its own kind: a move across the boundary would leave a scrolling column between two\n frozen ones. The buttons and Alt+arrows both ask. */\n const canMove = (name: string, direction: 'left' | 'right') => {\n const next = ordered[ordered.indexOf(name) + (direction === 'left' ? -1 : 1)];\n return next !== undefined && pinned.includes(next) === pinned.includes(name);\n };\n const stepColumn = (name: string, direction: 'left' | 'right') => {\n if (canMove(name, direction)) moveColumnBy(name, direction);\n };\n const navigable = Boolean(onRowClick) || keyed;\n const query = currentEntry()?.query ?? '';\n\n /* The records on this page, and the list they are a page of when the room\n hands one (TableView): a record opened from this grid steps through the\n list past this page too (recordTrail.ts). An embedded grid hands its\n rows only. */\n const records = useMemo(\n () =>\n rows.flatMap((item) => {\n const itemKey = table && (keyOf(table, item) as Record<string, unknown> | null);\n return itemKey ? [{ key: itemKey, label: rowLabel(table, item) }] : [];\n }),\n [table, rows],\n );\n\n /* The record the reader is on beside this list — a split's detail — is\n marked, and brought into view as J and K step it along. */\n const currentKey = current && table ? rowKeyString(table, current) : null;\n useLayoutEffect(() => {\n if (currentKey === null) return;\n const rowNodes = tableRef.current?.querySelectorAll<HTMLElement>('tbody tr[data-row-key]') ?? [];\n [...rowNodes].find((node) => node.dataset.rowKey === currentKey)?.scrollIntoView?.({ block: 'nearest' });\n }, [currentKey]);\n\n const opens = useRowOpens();\n const openRow = useCallback(\n (row: Row) => {\n if (onRowClick) {\n onRowClick(row);\n return;\n }\n /* A row that opens what it is about opens that, with no neighbors to step to: they are rows of this list. */\n if (opens && table) {\n const target = rowOpensTarget(table, row, opens);\n if (target) void openRecord(target.table, target.key, target.label, 'push');\n return;\n }\n const key = table && (keyOf(table, row) as Record<string, unknown> | null);\n if (!key) return;\n void openRecord(table!.id, key, rowLabel(table, row), 'push', {\n records,\n list,\n });\n },\n [onRowClick, opens, table, records, list],\n );\n\n /* Space glances at the row's record without leaving the list (peekpanel.js), its neighbors a J or K away. */\n const peekRow = useCallback(\n (row: Row) => {\n if (opens && table) {\n const target = rowOpensTarget(table, row, opens);\n if (target) peekRecord(target.table, target.key, target.label);\n return;\n }\n const key = table && (keyOf(table, row) as Record<string, unknown> | null);\n if (key) peekRecord(table!.id, key, rowLabel(table, row), records, list);\n },\n [opens, table, records, list],\n );\n\n /* ---------- expansion ---------- */\n const [expanded, setExpanded] = useState<Set<string>>(() => new Set());\n const [expandingAll, setExpandingAll] = useState(false);\n /* An open row stays open for as long as it is in the result. A sort or a\n page re-asks in place (core.js `refine`) and a refetch moves rows by key,\n so a row still on screen keeps its detail; one that left is forgotten,\n and coming back to it is coming back to a closed row. */\n useEffect(() => {\n setExpanded((s) => {\n const kept = new Set(openable.filter((key) => s.has(key)));\n return kept.size === s.size ? s : kept;\n });\n }, [openable]);\n const toggle = (key: string) =>\n setExpanded((s) => {\n const n = new Set(s);\n if (n.has(key)) n.delete(key);\n else n.add(key);\n return n;\n });\n const anyClosed = openable.some((key) => !expanded.has(key));\n const expandAll = async () => {\n if (expandingAll) return;\n if (!anyClosed) {\n setExpanded(new Set());\n return;\n }\n /* A few at a time — the top of the table fills in immediately, the\n rest follows, and the database is never asked for everything at once. */\n setExpandingAll(true);\n try {\n for (let i = 0; i < openable.length; i += BATCH) {\n const batch = openable.slice(i, i + BATCH);\n setExpanded((s) => new Set([...s, ...batch]));\n if (i + BATCH < openable.length) await new Promise((r) => setTimeout(r, BREATH_MS));\n }\n } finally {\n setExpandingAll(false);\n }\n };\n\n /* ---------- windowing ---------- */\n const [scroller, setScroller] = useState<HTMLElement | null>(null);\n const [rowHeight, setRowHeight] = useState(26);\n const [margin, setMargin] = useState(0);\n useLayoutEffect(() => {\n if (!virtual || !wrap.current) return;\n setScroller((wrap.current.closest('.content') as HTMLElement | null) ?? (document.scrollingElement as HTMLElement | null));\n }, [virtual]);\n const virtualizer = useVirtualizer({\n count: virtual ? rows.length : 0,\n getScrollElement: () => scroller,\n estimateSize: () => rowHeight,\n overscan: OVERSCAN,\n scrollMargin: margin,\n enabled: virtual && Boolean(scroller),\n });\n const items = virtualizer.getVirtualItems();\n /* Measured from a rendered row rather than assumed: row height depends on\n font, zoom and content, and a wrong guess is wrong by a pixel per row —\n a scrollbar disagreeing with its content by a screenful. Sampled after\n each paint and corrected once the disagreement is real. */\n useLayoutEffect(() => {\n if (!virtual || !tableRef.current || !scroller) return;\n const sample = tableRef.current.querySelector('tbody tr[data-row]');\n const actual = sample ? viewportBox(sample).height : 0;\n if (actual && Math.abs(actual - rowHeight) >= 0.5) setRowHeight(actual);\n const top = tableRef.current.offsetTop;\n if (top !== margin) setMargin(top);\n });\n useEffect(() => {\n if (virtual) virtualizer.measure();\n }, [rowHeight, virtual]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const shown = virtual ? items.map((it) => it.index) : rows.map((_, i) => i);\n const padTop = virtual && items.length ? items[0].start - margin : 0;\n const padBottom = virtual && items.length ? Math.max(0, rows.length - items[items.length - 1].index - 1) * rowHeight : 0;\n\n /* ---------- pins and the keyboard ---------- */\n const lefts = usePins(wrap, ordered, pinned, shift, `${shown.join(',')}:${sizing}:${fit.columns.join(',')}`);\n useStickyHead(wrap, `${ordered.join(',')}:${sizing}:${rows.length > 0}`);\n const lastPinned = pinned.length ? ordered.filter((n) => pinned.includes(n)).pop() : undefined;\n /* Read on every paint, as the cells always read them — an App's display\n rules can change under the grid — and kept while they are equal. */\n const folded = folds && kept ? asked.filter((_, index) => !kept[index]) : [];\n /* Under the row's name, unless that column is a short key (\"AC-105\"): a line folded into it wraps word by word and\n reads as part of the key. Then the widest column of plain words (not a state's chip), else the name after all. */\n const foldsInto = (() => {\n if (!folded.length) return undefined;\n const named = titleName && ordered.includes(titleName) ? titleName : ordered[0]!;\n const width = (name: string) => fit.columns[ordered.indexOf(name)] ?? 0;\n if (width(named) >= FOLD_ROOM) return named;\n const words = ordered.filter(\n (name) =>\n (plans.get(name)?.kind === 'text' || Boolean(referenceLabels?.[name])) &&\n !(columnDisplay(table?.id, name) as DisplayRule | null)?.tone,\n );\n return words.reduce((best, name) => (width(name) > width(best) ? name : best), named);\n })();\n const cellColumns = useKeptColumns(\n ordered.map((name) => {\n /* A column of relative dates is said one way down its length (datesAmong). */\n const display = datesAmong(\n columnDisplay(table?.id, name) as DisplayRule | null,\n rows.map((row) => row[name]),\n );\n return {\n name,\n meta: byName.get(name),\n plan: plans.get(name)!,\n display,\n label: referenceLabels?.[name],\n subtitle: subtitlePath(display, name),\n ...(currencyPath(display, name) ? { currency: currencyPath(display, name) } : {}),\n ...(leadTonePath(display, name)\n ? {\n leadTone: {\n path: leadTonePath(display, name)!,\n rule: columnDisplay(table?.id, leadTonePath(display, name)!) as DisplayRule | null,\n },\n }\n : {}),\n photoOwner: avatarOwner(table, name, display, data.columns),\n pin: lefts.get(name),\n edge: name === lastPinned,\n ...(fit.wraps[ordered.indexOf(name)] ? { wraps: true } : {}),\n ...(name === foldsInto\n ? {\n more: folded.map((other) => ({\n name: other,\n head: String(labels?.[other] ?? columnLabel(table?.id, other) ?? other),\n meta: byName.get(other),\n plan: plans.get(other)!,\n display: datesAmong(\n columnDisplay(table?.id, other) as DisplayRule | null,\n rows.map((row) => row[other]),\n ),\n label: referenceLabels?.[other],\n })),\n }\n : {}),\n ...(table?.keyLabel && table.labelTemplate && byName.get(name)?.primaryKey ? { named: table.labelTemplate } : {}),\n };\n }),\n );\n const photoColumns = useMemo(() => cellColumns.filter((column) => column.photoOwner), [cellColumns]);\n /* One callback for every row and every paint: the one it calls is read\n when a row is opened, so a caller's fresh onRowClick redraws nothing. */\n const opener = useRef(openRow);\n opener.current = openRow;\n const openOne = useCallback((row: Row) => opener.current(row), []);\n useGridKeyboard(tableRef, wrap, {\n rowCount: rows.length,\n columnCount: ordered.length,\n offset: shift,\n onOpen: navigable ? (index) => openRow(rows[index]) : undefined,\n onPeek: keyed ? (index) => peekRow(rows[index]) : undefined,\n totalRows: data.exactTotal === false || data.cappedTotal ? undefined : data.total,\n firstRow,\n });\n\n /* Whatever the column clipped gets its whole value on hover, decided at hover time, once, from its own overflow:\n the cell, or the line inside it that cuts its own text (a row's name over its detail, a lead mark's body, a\n component's text), which the cell never sees overflow. A long summary ended in \"…\" with no way to read it (G210). */\n const onMouseOver = (e: React.MouseEvent) => {\n if (!(e.target instanceof Element)) return;\n const td = e.target.closest('td') as HTMLTableCellElement | null;\n if (!td) return;\n for (let at: Element | null = e.target; at; at = at === td ? null : at.parentElement) {\n if (at instanceof HTMLElement && at.title) return;\n if (at.scrollWidth > at.clientWidth) {\n (at as HTMLElement).title = at.textContent ?? '';\n return;\n }\n }\n };\n\n if (!rows.length && !(emptyText && data.columns?.length)) {\n /* \"No rows match\" claims a filter did it. On `customer` with no\n conditions, nothing was excluded — the table is empty, which is a\n different thing to be told. */\n const entry = currentEntry();\n const filtered = !entry || entry.kind !== 'table' || entry.query.trim() !== entry.table || Boolean(data.errors?.length);\n return (\n <div className={`table-wrap${compact ? ' grid-compact' : ''}`} ref={wrap}>\n <p className=\"note\">{filtered ? say('noRowsMatch') : say('thisTableIsEmpty')}</p>\n </div>\n );\n }\n\n const inApp = shell().inApp();\n const header = (name: string, index: number) => {\n const meta = byName.get(name);\n const plan = plans.get(name)!;\n const headLabel = labels?.[name] ?? columnLabel(table?.id, name) ?? name;\n /* The width this head's column is actually drawn at: its fitted width\n in a fitted grid, its dragged width in a scrolled one once it has\n one — a scrolled column with no dragged width is drawn by its\n content, so it has no width to say. */\n const appliedWidth = sizing === 'fit' ? colWidths[index] : columnWidths[name];\n /* Sorting from the header is offered only on columns the database can\n sort cheaply: indexed, or small enough that it does not matter. Over an\n API, only on the columns its documented sort values name (`sortable`). */\n const sortable = table\n ? table.sortable\n ? table.sortable.includes(name)\n : !table.indexed || table.indexed.includes(name) || sortableFromHeader(table)\n : false;\n const explicit = language ? (sortDirection(query, name) as 'asc' | 'desc' | null) : null;\n const implied = !explicit && data.order?.implicit ? (data.order.order.find((o) => o.column === name)?.direction ?? null) : null;\n const sorted = explicit ?? implied;\n const pin = lefts.get(name);\n return (\n <th\n key={name}\n scope=\"col\"\n className={`align-${plan.align}${explicit ? ' sorted' : ''}${implied ? ' sorted-default' : ''}${pin !== undefined ? ` pinned${name === lastPinned ? ' pinned-edge' : ''}` : ''}`}\n style={pin !== undefined ? { left: `${pin}px` } : undefined}\n data-col={name}\n /* Alt+arrows move the column, as they move a field in the\n arranger (FieldArranger.tsx): the head already owns its click\n for sorting, so a drag would fight it, and a drag's drop target\n is geometry a test cannot see. */\n onKeyDown={(e) => {\n if (!interactive || !e.altKey || (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight')) return;\n e.preventDefault();\n stepColumn(name, e.key === 'ArrowLeft' ? 'left' : 'right');\n }}\n aria-sort={explicit ? (explicit === 'desc' ? 'descending' : 'ascending') : undefined}\n title={\n implied\n ? `${meta ? `${meta.type} · ` : ''}${say('defaultOrderRowsHaveToCome')}`\n : meta?.type\n ? `${meta.type}${meta.nullable ? '' : ' NOT NULL'}`\n : name\n }\n >\n <span className=\"th-controls\">\n <button\n type=\"button\"\n className={`th-sort${language && !sortable ? ' not-sortable' : ''}`}\n aria-disabled={!language || !sortable}\n /* An App has no statement to edit and no query bar to type into: its words say what is so. */\n title={\n !language\n ? say(inApp ? 'notSortableHere' : 'sortingAResultLike', {\n name,\n })\n : sortable\n ? say('sortBy', { name })\n : table?.sortable\n ? say('theApiDocumentsNoSort', { name })\n : say(inApp ? 'isNotIndexedSortingInApp' : 'isNotIndexedSorting', { name })\n }\n onClick={(e) => {\n if (!language || !sortable) return;\n if (e.shiftKey) sortBy(name, sortDirection(currentEntry()?.query ?? '', name) === 'asc' ? 'desc' : 'asc', true);\n else sortBy(name);\n }}\n >\n <span className=\"th-label\">{headLabel}</span>\n {meta?.primaryKey && <span className=\"pk\">{say('common.key')}</span>}\n {meta?.references && <span className=\"fk\">{REFERENCE_MARK}</span>}\n {sorted && <span className=\"th-arrow\">{sorted === 'desc' ? '↓' : '↑'}</span>}\n </button>\n {/* The column's own order, beside its sort: one step at a time,\n at either edge — and at the edge of the pinned block — the\n step that way is not offered. Quiet until the head is hovered\n or holds focus, and out of the head's flow there (style.css),\n as the filter caret is — a row of marks down every head\n otherwise. The arrows are drawn by the stylesheet, so the\n head's text stays its label. They are out of the tab order: a\n head already costs a stop for its sort, one for its filter and\n one for its resizer, and five per head is sixty Tabs across a\n twelve-column grid. A keyboard moves a column with Alt+arrows\n on the head (below); a pointer and a screen reader's cursor\n still reach the buttons. */}\n {interactive && (\n <span className=\"th-moves\">\n <button\n type=\"button\"\n className=\"th-move th-move-left\"\n tabIndex={-1}\n disabled={!canMove(name, 'left')}\n title={say('moveColumnLeft', { name: headLabel })}\n aria-label={say('moveColumnLeft', { name: headLabel })}\n onClick={(e) => {\n e.stopPropagation();\n stepColumn(name, 'left');\n }}\n />\n <button\n type=\"button\"\n className=\"th-move th-move-right\"\n tabIndex={-1}\n disabled={!canMove(name, 'right')}\n title={say('moveColumnRight', { name: headLabel })}\n aria-label={say('moveColumnRight', { name: headLabel })}\n onClick={(e) => {\n e.stopPropagation();\n stepColumn(name, 'right');\n }}\n />\n </span>\n )}\n {language && appMenu && (\n <AppColumnMenuButton\n host={appMenu}\n name={name}\n label={headLabel}\n kind={plan.kind}\n meta={meta}\n sortable={sortable}\n current={sorted}\n columns={ordered}\n drawnBy={referenceLabels?.[name]}\n />\n )}\n {/* Over an API, only where it documents a filter (`filterable`): a menu the source refuses is a control that lies. */}\n {language && !appMenu && (!table?.filterable || table.filterable.includes(name)) && (\n <button\n type=\"button\"\n className=\"th-filter\"\n title={say('filterOn', { name })}\n aria-label={say('filterOn', { name })}\n onClick={(e) => {\n e.stopPropagation();\n openFilterMenu(e.currentTarget, meta, name, rows, plan);\n }}\n >\n <span className=\"th-filter-icon\" aria-hidden=\"true\" />\n </button>\n )}\n </span>\n {/* The column's width, on its trailing edge: dragged with a\n pointer, stepped with arrow keys, restored with a double-click\n or Alt+Backspace. No transition and no slide: a width lands\n where it is put, so reduced motion needs nothing special. */}\n {interactive && (\n <span\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={say('resizeColumn', { name: headLabel })}\n title={say('resizeColumnHint', { name: headLabel })}\n tabIndex={0}\n className=\"th-resizer\"\n {...(appliedWidth !== undefined ? { 'aria-valuenow': appliedWidth, 'aria-valuemin': MIN_COLUMN_WIDTH } : {})}\n onPointerDown={(e) => {\n if (e.pointerType === 'mouse' && e.button !== 0) return;\n const seed = sizing !== 'fit' && !hasWidthOverrides ? measureDrawn(e.currentTarget) : null;\n resizeDrag.current = {\n name,\n startX: e.clientX,\n startWidth: seed?.[name] ?? appliedWidth ?? colWidths[index] ?? 0,\n hadOverride: name in columnWidths,\n prevWidth: columnWidths[name],\n seed,\n seeded: false,\n };\n try {\n e.currentTarget.setPointerCapture(e.pointerId);\n } catch {\n /* A renderer without capture still delivers the moves to the handle. */\n }\n }}\n onPointerMove={(e) => {\n const drag = resizeDrag.current;\n if (!drag || drag.name !== name) return;\n /* The pointer speaks screen pixels; the column's width\n speaks layout pixels (ruler.ts), so the drag is divided\n by the root's zoom before it becomes a width. */\n const width = drag.startWidth + (e.clientX - drag.startX) / viewportScale();\n if (drag.seed) {\n const seed = drag.seed;\n drag.seed = null;\n drag.seeded = true;\n setColumnWidths({ ...seed, [name]: clampColumnWidth(width) });\n return;\n }\n setColumnWidth(name, width);\n }}\n onPointerUp={() => {\n if (resizeDrag.current?.name === name) resizeDrag.current = null;\n }}\n onPointerCancel={() => {\n const drag = resizeDrag.current;\n if (drag?.name !== name) return;\n resizeDrag.current = null;\n /* A drag that arranged a scrolled grid undoes all of it: the grid goes back to no arrangement. */\n if (drag.seeded) {\n setColumnWidths({});\n return;\n }\n setColumnWidths((current) => {\n const next = { ...current };\n if (drag.hadOverride && drag.prevWidth !== undefined) next[name] = drag.prevWidth;\n else delete next[name];\n return next;\n });\n }}\n onKeyDown={(e) => {\n if (e.altKey && e.key === 'Backspace') {\n e.preventDefault();\n resetColumnWidth(name);\n return;\n }\n if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') return;\n e.preventDefault();\n const seed = sizing !== 'fit' && !hasWidthOverrides ? measureDrawn(e.currentTarget) : null;\n const current = seed?.[name] ?? appliedWidth ?? colWidths[index] ?? 0;\n const width = current + (e.key === 'ArrowRight' ? 1 : -1) * columnResizeStep(e.shiftKey);\n if (seed) setColumnWidths({ ...seed, [name]: clampColumnWidth(width) });\n else setColumnWidth(name, width);\n }}\n onDoubleClick={() => resetColumnWidth(name)}\n />\n )}\n </th>\n );\n };\n\n const colSpan = ordered.length + shift + (trailing ? 1 : 0);\n return (\n <div className={`table-wrap${compact ? ' grid-compact' : ''}${density === 'compact' ? ' grid-dense' : ''}`} ref={wrap}>\n <table\n ref={tableRef}\n onMouseOver={onMouseOver}\n className={useColgroup ? 'grid-fit' : undefined}\n style={useColgroup ? { width: tableWidth } : undefined}\n >\n {useColgroup && (\n <colgroup>\n {slotted && <col style={{ width: GRID_EXPANDER_WIDTH }} />}\n {ordered.map((name, index) => (\n <col key={name} style={{ width: colWidths[index] }} />\n ))}\n {trailing && <col style={{ width: GRID_TRAIL_WIDTH }} />}\n </colgroup>\n )}\n <thead>\n <tr>\n {slotted && (\n <th className=\"expander-cell row-host\" ref={hosts.headRef}>\n {expandable && !virtual && (\n <button\n type=\"button\"\n className={`expander expand-all${expandingAll ? ' working' : ''}`}\n title={anyClosed ? say('expandEveryRow') : say('collapseEveryRow')}\n aria-label={anyClosed ? say('expandEveryRow') : say('collapseEveryRow')}\n aria-expanded={!anyClosed}\n onClick={(e) => {\n e.stopPropagation();\n void expandAll();\n }}\n >\n {anyClosed ? '▸' : '▾'}\n </button>\n )}\n </th>\n )}\n {ordered.map((name, index) => header(name, index))}\n {trailing && (\n <th className=\"row-trail\">\n <span className=\"visually-hidden\">{say('actions')}</span>\n </th>\n )}\n </tr>\n </thead>\n {(() => {\n const body = (\n <tbody>\n {virtual && (\n <tr className=\"virtual-spacer\" aria-hidden=\"true\">\n <td\n colSpan={colSpan}\n style={{\n height: `${padTop}px`,\n padding: 0,\n border: 'none',\n }}\n />\n </tr>\n )}\n {shown.map((i) => {\n const row = modelRows[i];\n if (!row) return null;\n const key = rowKeys[i];\n const open = expandable && key !== null && expanded.has(key);\n return (\n <Row\n key={key === null ? `at:${i}` : `key:${key}`}\n index={i}\n rowKey={key}\n slot={slotted}\n hostRef={key === null ? undefined : hosts.ref(key)}\n trail={trailing}\n trailRef={key === null || !trailHosts ? undefined : trailHosts.ref(key)}\n record={row.original}\n navigable={navigable}\n opensPage={navigable && !onRowClick && !opens}\n onOpen={openOne}\n open={open}\n current={key !== null && key === currentKey}\n changed={changedRows.get(row.original)}\n table={table}\n colSpan={colSpan}\n columns={cellColumns}\n editCell={editCell}\n adornCell={adornCell}\n />\n );\n })}\n {virtual && (\n <tr className=\"virtual-spacer\" aria-hidden=\"true\">\n <td\n colSpan={colSpan}\n style={{\n height: `${padBottom}px`,\n padding: 0,\n border: 'none',\n }}\n />\n </tr>\n )}\n </tbody>\n );\n return photoColumns.length ? (\n <AvatarPhotos columns={photoColumns} rows={rows}>\n {body}\n </AvatarPhotos>\n ) : (\n body\n );\n })()}\n {totals && rows.length > 0 && (\n <tfoot>\n <tr className=\"grid-totals\">\n {slotted && <td className=\"expander-cell\" />}\n {ordered.map((name, index) => {\n if (!Object.hasOwn(totals, name))\n return <td key={name}>{index === 0 && <span className=\"grid-totals-label\">{totalsLabel}</span>}</td>;\n return (\n <td key={name} className=\"align-right num\">\n <TotalValue value={totals[name]} display={columnDisplay(table?.id, name) as DisplayRule | null} />\n </td>\n );\n })}\n {trailing && <td />}\n </tr>\n </tfoot>\n )}\n </table>\n {/* The first decoration: the expander, declared here beside the table\n and portalled into each row's leading cell — the same place and the\n same button it always was, now drawn from outside the row. */}\n {expandable &&\n openable.map((key) => (\n <RowDecoration key={key} rowKey={key} store={hosts}>\n <Expander open={expanded.has(key)} onToggle={() => toggle(key)} />\n </RowDecoration>\n ))}\n {virtual && <p className=\"note virtual-note\">{say('rowsDrawnAsYouScroll', { count: rows.length })}</p>}\n {!rows.length && <p className=\"note grid-empty\">{emptyText}</p>}\n </div>\n );\n}\n\n/**\n * One row, and its detail row when it is open. The leading cell, when the\n * grid draws one, is the row's host: React never gives it children of its\n * own, so what a decoration portals there is left alone by every repaint.\n */\nconst Row = memo(function Row({\n index,\n rowKey,\n slot,\n hostRef,\n trail = false,\n trailRef,\n record,\n navigable,\n opensPage = false,\n onOpen,\n open,\n current = false,\n changed,\n table,\n colSpan,\n columns,\n editCell,\n adornCell,\n}: {\n index: number;\n rowKey: string | null;\n slot: boolean;\n hostRef?: RowHostRef;\n trail?: boolean;\n trailRef?: RowHostRef;\n record: Row;\n navigable: boolean;\n onOpen: (row: Row) => void;\n open: boolean;\n /** The row opens its record (not a caller's own click): a press on it begins reading the record's page (recordCompose.ts). */\n opensPage?: boolean;\n /** The record shown beside the list (a split's detail). */\n current?: boolean;\n /** Another person's change to this row, just announced: which of two tints it wears. */\n changed?: 1 | 2;\n table: TableMeta | undefined;\n colSpan: number;\n columns: CellColumn[];\n editCell?: GridProps['editCell'];\n adornCell?: GridProps['adornCell'];\n}) {\n const photoOf = useContext(AvatarPhotoContext);\n /* A click inside a dialog one of its cells opened reaches the row through\n React's tree, not the page's: only a click on the row opens it. */\n const row = (\n <tr\n className={\n `${navigable ? 'clickable' : ''}${open ? ' expanded' : ''}${current ? ' is-current' : ''}${changed ? ` row-changed-${changed}` : ''}`.trim() ||\n undefined\n }\n aria-current={current ? 'true' : undefined}\n data-row={index}\n data-row-key={rowKey ?? undefined}\n data-opens={opensPage && table ? opensRecord(table.id, keyOf(table, record)) : undefined}\n onClick={\n navigable\n ? (e) => {\n if (e.currentTarget.contains(e.target as Node)) onOpen(record);\n }\n : undefined\n }\n >\n {slot && <td className=\"expander-cell row-host\" ref={hostRef} />}\n {columns.map((column) => (\n <Cell\n key={column.name}\n meta={column.meta}\n plan={column.plan}\n value={column.named ? keyName(column.named, record[column.name]) : record[column.name]}\n label={column.label ? record[column.label] : undefined}\n display={column.display}\n pin={column.pin}\n edge={column.edge}\n wraps={column.wraps}\n more={column.more ? foldedOf(column.more, record) : undefined}\n sub={column.subtitle && Object.hasOwn(record, column.subtitle) ? record[column.subtitle] : undefined}\n currency={column.currency ? record[column.currency] : undefined}\n open={(column.display as DisplayRule | null)?.format === 'relative' && dueOpen(table?.id, column.name, record) ? true : undefined}\n lead={leadOf(column, record)}\n name={column.name}\n editCell={editCell}\n adornCell={adornCell}\n record={editCell || adornCell ? record : undefined}\n photo={column.photoOwner ? photoOf(column.name, record[column.photoOwner]) : undefined}\n row={column.display?.component ? record : undefined}\n table={table?.id}\n />\n ))}\n {trail && <td className=\"row-trail\" ref={trailRef} />}\n </tr>\n );\n if (!open || !table) return row;\n return (\n <>\n {row}\n {/* Its grids publish nowhere: a presentation decorating this grid must\n never find a nested row under one of its keys. */}\n <RowHostScope store={null}>\n <RowTrailScope store={null}>\n <DetailRow table={table} row={record} colSpan={colSpan} grid={Grid} />\n </RowTrailScope>\n </RowHostScope>\n </>\n );\n});\n","/** What RecordSummaries says, in the record page room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({});\n","import type { ReactNode } from 'react';\nimport { useMessageLanguage } from './useMessageLanguage.js';\nimport { columnLabel, keyOf, labelPath, openRecord, recordLabel, rowLabel, state } from '../core.js';\nimport { opensRecord } from '../recordIntent.js';\nimport { humanName } from '@mistriwork/engine/shared/model.js';\nimport { primaryKey, type TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport type { TrailList } from '../recordTrail.js';\nimport { Value } from './Value.js';\nimport { rowOpensTarget, useRowOpens } from './rowOpens.js';\nimport type { GridData } from './Grid.js';\nimport { presentationColumns } from './columnPresentation.js';\nimport { splitConditions, splitQuery } from '../clauses.js';\nimport { say } from '../copy/record/components/RecordSummaries.js';\n\n/**\n * The columns a question holds to one value (`status = new`, a tab's own\n * condition): every record the list shows says the same there, so a summary\n * that repeats it on each is a line spent saying nothing. Only a whole\n * condition of one literal counts; `a or b`, a range or a window phrase does not.\n */\nexport function fixedColumns(query: string | undefined): string[] {\n if (!query) return [];\n return splitConditions(splitQuery(query).filter).flatMap((condition: string) => {\n const match = /^([\\w.]+)\\s*=\\s*(\"[^\"]*\"|'[^']*'|[\\w.-]+)$/.exec(condition.trim());\n return match ? [match[1]] : [];\n });\n}\n\n/** The authored column order is the mobile priority; state remains visible. */\nexport function summaryColumns(table: TableMeta, columns: string[]): string[] {\n const naming = labelPath(table);\n const keys = primaryKey(table);\n const facts = columns.filter((name) => name !== naming && !keys.includes(name));\n const state = facts.filter((name) => /^(status|stage|priority)$/.test(name));\n return [...new Set([...state, ...facts])].slice(0, 4);\n}\n\n/**\n * The column a link row is titled by, where it has no title of its own: the\n * name of the row it links to that is not the record it is listed under. A\n * campaign's member row (`campaign_id`, `lead_id`, a date, a flag) on a\n * lead's page was a card titled \"6\" — its key — over a \"Campaign\" line that\n * named it; it is the campaign's card there. `parent` names the reference\n * to the record the list is under (and every column the list holds to one\n * value is one too), so it is never the title. Null where the row names\n * itself, or nothing shown names a row it links to.\n */\nexport function linkTitleColumn(\n table: TableMeta,\n columns: string[],\n parent: string[],\n referenceLabels?: Record<string, string>,\n): string | null {\n if (recordLabel(table) !== undefined) return null;\n const naming = labelPath(table);\n if (naming && !primaryKey(table).includes(naming)) return null;\n const links = table.columns.filter((column) => column.references && !parent.includes(column.name)).map((column) => column.name);\n for (const link of links) {\n if (referenceLabels?.[link] && columns.includes(link)) return link;\n const path = columns.find((name) => name.startsWith(`${link}.`) && !name.slice(link.length + 1).includes('.'));\n if (path) return path;\n }\n return null;\n}\n\n/**\n * The columns a summary says under its title: the page's columns less what the question fixes, the link that titles\n * the row, and any column whose value *is* the title on every row. A record named by a template of one column\n * (`recordLabel: '{title}'`) reaches `labelPath` as the template, not the column, so the column was listed again under\n * its own name, as \"Title Outlet not working\" below \"Outlet not working\". A reference is compared by the name it is\n * drawn as (`referenceLabels`), not by its key: a lease titled \"Alder Court #406\" listed \"Home\" with the same words.\n */\nfunction shownValue(row: Record<string, unknown>, name: string, referenceLabels?: Record<string, string>): string {\n const label = referenceLabels?.[name];\n return String((label ? row[label] : row[name]) ?? '');\n}\n\nfunction summaryFacts(\n table: TableMeta,\n columns: string[],\n rows: Array<Record<string, unknown>>,\n titles: string[],\n skip: string[],\n referenceLabels?: Record<string, string>,\n): string[] {\n const echoes = (name: string) => rows.length > 0 && rows.every((row, i) => shownValue(row, name, referenceLabels) === titles[i]);\n return summaryColumns(\n table,\n columns.filter((name) => !skip.includes(name) && !echoes(name)),\n );\n}\n\n/**\n * Whether the table has anything the summaries leave out, which is the only reason to offer the Table beside them\n * (TableView): the summaries say four facts under a title, so a list of more has a wider reading, and a list of\n * fewer has the same one in two dresses.\n */\nexport function tableSaysMore(\n table: TableMeta,\n columns: string[],\n rows: Array<Record<string, unknown>>,\n query?: string,\n referenceLabels?: Record<string, string>,\n): boolean {\n const titles = rows.map((row) => String(rowLabel(table, row) ?? ''));\n const fixed = fixedColumns(query);\n const said = summaryFacts(table, columns, rows, titles, fixed, referenceLabels);\n const keys = primaryKey(table);\n const naming = labelPath(table);\n return columns.some(\n (name) =>\n !said.includes(name) &&\n !fixed.includes(name) &&\n !keys.includes(name) &&\n name !== naming &&\n !rows.every((row, i) => shownValue(row, name, referenceLabels) === titles[i]),\n );\n}\n\nexport function RecordSummaries({\n table,\n data,\n columns,\n labels,\n referenceLabels,\n list,\n recordForRow,\n query,\n parent,\n adornFact,\n}: {\n table: TableMeta;\n data: GridData;\n columns: string[];\n labels?: Record<string, string>;\n /** The list's question: a column it holds to one value is left out of every summary (fixedColumns). */\n query?: string;\n /** Joined names already carried by the list query; raw values remain keys. */\n referenceLabels?: Record<string, string>;\n /** The list these rows are a page of, so a record opened here steps past the page (recordTrail.ts). */\n list?: TrailList;\n /** Related projections can alias primary keys and the record's naming path. */\n recordForRow?: (row: Record<string, unknown>) => {\n key: Record<string, unknown> | null;\n label: string;\n };\n /** The reference to the record this list is under, on a record's page (linkTitleColumn). */\n parent?: string;\n /**\n * What the host draws for an empty fact in place of its empty mark (a suggestion waiting on it, the shell's\n * `useCellMarks` in its summary form); undefined leaves the mark. It stands in the mark's own box: a fact's line\n * wraps, so anything wider arriving later would move the facts after it.\n */\n adornFact?: (row: Record<string, unknown>, column: string) => ReactNode | undefined;\n}) {\n useMessageLanguage();\n const fixed = fixedColumns(query);\n const linkTitle = linkTitleColumn(table, columns, [...fixed, ...(parent ? [parent] : [])], referenceLabels);\n const linked = (row: Record<string, unknown>) => {\n const value = linkTitle ? (referenceLabels?.[linkTitle] ? row[referenceLabels[linkTitle]] : row[linkTitle]) : undefined;\n return value == null || String(value) === '' ? undefined : String(value);\n };\n /* A list whose rows open what they are about (a view's `opens`) opens that from a summary too, alone. */\n const opens = useRowOpens();\n const items = (data.rows ?? []).map((row) => {\n const target = opens && !recordForRow ? rowOpensTarget(table, row, opens) : undefined;\n if (target !== undefined)\n return {\n row,\n opensTable: target?.table,\n key: target?.key ?? null,\n label: linked(row) ?? target?.label ?? '',\n };\n const record = recordForRow?.(row) ?? {\n key: keyOf(table, row) as Record<string, unknown> | null,\n label: rowLabel(table, row) as string,\n };\n return {\n row,\n opensTable: undefined as string | undefined,\n ...record,\n label: linked(row) ?? record.label,\n };\n });\n const facts = summaryFacts(\n table,\n columns,\n items.map(({ row }) => row),\n items.map(({ label }) => label),\n [...fixed, ...(linkTitle ? [linkTitle] : [])],\n referenceLabels,\n );\n const metadata = presentationColumns(state.schema, table, facts);\n const records = items.flatMap(({ key, label }) => (key ? [{ key, label }] : []));\n const trail = opens ? {} : { records, list };\n return (\n <ul className=\"record-summaries\" aria-label={say('common.records')}>\n {items.map(({ row, key, label: title, opensTable }, index) => {\n return (\n <li\n key={key ? JSON.stringify(key) : index}\n className={`record-summary${key ? ' is-navigable' : ''}`}\n data-opens={key ? opensRecord(opensTable ?? table.id, key) : undefined}\n onClick={(event) => {\n // The title remains the keyboard target; nested controls own their clicks.\n if (\n !key ||\n (event.target as Element).closest('button, a, input, select, textarea, summary, [role=\"button\"], [contenteditable=\"true\"]')\n )\n return;\n if (window.getSelection()?.isCollapsed === false) return;\n void openRecord(opensTable ?? table.id, key, title, 'push', trail);\n }}\n >\n <button\n type=\"button\"\n className=\"record-summary-title\"\n disabled={!key}\n onClick={() => {\n if (key) void openRecord(opensTable ?? table.id, key, title, 'push', trail);\n }}\n >\n {title}\n </button>\n <dl>\n {facts.map((name) => {\n const label = referenceLabels?.[name] ? row[referenceLabels[name]] : undefined;\n const col = metadata.get(name) ?? {\n name,\n type: 'TEXT',\n nullable: true,\n primaryKey: false,\n };\n const value = label ?? row[name];\n const adorned = adornFact && (value === null || value === undefined || value === '') ? adornFact(row, name) : undefined;\n return (\n <div key={name}>\n <dt>{labels?.[name] ?? columnLabel(table.id, name) ?? humanName(name)}</dt>\n <dd>\n {adorned ?? <Value tableId={table.id} col={label == null ? col : { ...col, type: 'TEXT' }} value={value} compact />}\n </dd>\n </div>\n );\n })}\n </dl>\n </li>\n );\n })}\n </ul>\n );\n}\n","/** What RowActions says, in the lists and grid room (packages/kit/src/client/messages.ts says how the catalog is split). */\nimport { defineMessages } from '../../../messages.js';\n\nexport const say = defineMessages({});\n","/**\n * A row's own menu: the record's actions, as its page offers them, from a ⋯\n * at the end of the row — the trailing host, so the grid is not told.\n *\n * Nothing is asked until the menu is opened: a list of twenty rows is not\n * sixty condition reads. The first press mounts that record's action bar in\n * its menu-only mode, so a verb here is the same verb as on the page — its\n * condition judged by the server, its confirmation, its command form, its\n * Undo — and choosing one never opens the row.\n */\nimport { shell } from '../shellMode.js';\nimport { useState } from 'react';\nimport type { TableMeta } from '@mistriwork/engine/shared/schema.js';\nimport type { AppAction } from '@mistriwork/engine/schema/model.js';\nimport { keyOf, rowLabel, state, writeAllowed } from '../core.js';\nimport { grantedActionIds } from '../actionGrants.js';\nimport { bulkKey } from '../bulkActions.js';\nimport { rootMatches } from './pageModel.js';\nimport { RowDecoration, useRowTrailScope } from './RowHost.js';\nimport { say } from '../copy/lists/components/RowActions.js';\n\nfunction RowMenu({\n table,\n record,\n label,\n actions,\n onDone,\n}: {\n table: TableMeta;\n record: Record<string, unknown>;\n label: string;\n actions: AppAction[];\n onDone: () => void;\n}) {\n const [armed, setArmed] = useState(false);\n const [open, setOpen] = useState(false);\n /* The verbs are the App's (Actions.tsx), drawn through the shell's slot: a shell with none has no menu to offer. */\n const { ActionBar } = shell().slots;\n if (!ActionBar) return null;\n if (!armed) {\n return (\n <button\n type=\"button\"\n className=\"ghost row-actions-trigger\"\n aria-label={say('common.actions', { label })}\n title={say('common.actions', { label })}\n aria-haspopup=\"menu\"\n onClick={(event) => {\n event.stopPropagation();\n setArmed(true);\n setOpen(true);\n }}\n >\n ⋯\n </button>\n );\n }\n const connection = state.activeConnection ?? undefined;\n return (\n <span className=\"row-actions\" onClick={(event) => event.stopPropagation()}>\n <ActionBar\n tableId={table.id}\n actions={actions}\n recordKey={record}\n label={label}\n matches={(when) => rootMatches(table, record, when, connection)}\n canUpdate={writeAllowed(table.id)}\n grantedCommands={shell().app()?.grantedCommands ?? []}\n grantedActions={grantedActionIds(shell().app(), table.id)}\n menuOnly={{ label, open, onOpenChange: setOpen }}\n onDone={onDone}\n />\n </span>\n );\n}\n\nexport function RowActions({\n table,\n rows,\n actions,\n onDone,\n}: {\n table: TableMeta;\n rows: Array<Record<string, unknown>>;\n actions: AppAction[];\n onDone: () => void;\n}) {\n const store = useRowTrailScope();\n if (!store) return null;\n return (\n <>\n {rows.map((row) => {\n const key = keyOf(table, row) as Record<string, unknown> | null;\n if (!key) return null;\n const id = bulkKey(table, key);\n const label = String(rowLabel(table, row) ?? say('common.untitled'));\n return (\n <RowDecoration key={id} rowKey={id} store={store}>\n <RowMenu table={table} record={key} label={label} actions={actions} onDone={onDone} />\n </RowDecoration>\n );\n })}\n </>\n );\n}\n","/**\n * A successful empty list explains what belongs here and offers an available\n * next room — as the one empty block (Notes.tsx), at body size on the list's\n * edge. It was a heading at the list title's size, louder than the section\n * it stood in.\n */\nimport type { AppListEmpty } from '@mistriwork/engine/shared/listPresentations.js';\nimport { useListNavigation } from './listNavigation.js';\nimport { Empty } from './Notes.js';\n\nexport function ListEmpty({ spec }: { spec: AppListEmpty }) {\n const navigate = useListNavigation();\n const link = spec.action ? navigate?.(spec.action.view, 'reset') : undefined;\n return (\n <Empty\n className=\"list-empty\"\n text={<span className=\"empty-note-title\">{spec.title}</span>}\n detail={spec.description}\n action={spec.action && link ? <a {...link}>{spec.action.label}</a> : undefined}\n />\n );\n}\n","/**\n * Where a call to action that names one of the App's views goes, as a link\n * a reader can also open in a new tab. A list or a dashboard the App serves\n * this reader is followed in place, through the walk, and so is a signed-in\n * form, which is a room of its own (`form-<key>`). A public form is not\n * among those — it is served at its own address, outside the App — so its\n * link is that address. A list's link is its key, `/thread/board`, and a\n * dashboard's its own, `/compass/sales-dashboard`: the address bar's once\n * followed (publicAddress.ts).\n */\nimport type { MouseEvent } from 'react';\nimport { shell } from '../shellMode.js';\nimport { go, pageView, state, tableView } from '../core.js';\nimport { hashFor } from '../deeplink.js';\nimport { tabSlug } from '@mistriwork/engine/shared/addressParams.js';\nimport { appListQuery } from './appListModel.js';\nimport { dashPageId, isListRoom, roomPageId, viewRoom } from './appRooms.js';\nimport { registerViewOpener } from '../uiBridge.js';\nimport { shown } from '../addressMount.js';\n\nexport interface ViewLink {\n href: string;\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\n/** A walk entry as a link a reader can also open in a new tab: its address, and the walk followed in place. */\nfunction linkTo(entry: Parameters<typeof go>[0], mode: 'push' | 'reset'): ViewLink {\n const connection = state.activeConnection ?? null;\n /* The App's addresses are the shell's answer (shellMode.ts): a link names one of the App's views, so it is drawn\n where the App shell is. */\n const addresses = shell().addresses;\n return {\n // The walk's own form only where the App's book has no word for it (an App not yet loaded).\n href: shown(\n (connection ? addresses?.address(connection, [entry]) : undefined) ??\n hashFor(connection, [entry], { listParams: addresses?.listParams }),\n ),\n onClick: (event) => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n event.preventDefault();\n go(entry, mode);\n },\n };\n}\n\n/** A list, dashboard or signed-in form this reader is served, by key. `adding` opens a list with its New form over it (`…!new`). */\nexport function viewLink(key: string, mode: 'push' | 'reset' = 'push', adding = false): ViewLink | undefined {\n const app = shell().app() as Parameters<typeof viewRoom>[0] | null;\n const room = app ? viewRoom(app, key) : undefined;\n if (!room) return undefined;\n const entry = isListRoom(room)\n ? { ...tableView(room.table, appListQuery(room, 0), adding ? 'new' : undefined), view: key }\n : pageView(roomPageId(room) ?? dashPageId(key));\n return linkTo(entry, mode);\n}\n\n/**\n * One of the App's lists on a refinement of its rows, as a dashboard group opens it: the list's own parameter where\n * it offers the column as a filter (`?status=approved`), `q=` for what those cannot say. Undefined for a key this\n * reader is served no list under, so a caller never falls back to the table's raw rows.\n */\nexport function listEntry(key: string, query: string): Parameters<typeof go>[0] | undefined {\n const app = shell().app() as Parameters<typeof viewRoom>[0] | null;\n const room = app ? viewRoom(app, key) : undefined;\n return room && isListRoom(room) && !room.error ? { ...tableView(room.table, query), view: key } : undefined;\n}\n\nexport function listLink(key: string, query: string): ViewLink | undefined {\n const entry = listEntry(key, query);\n return entry ? linkTo(entry, 'push') : undefined;\n}\n\n/** Follow a list or dashboard this reader is served, as its link would; false when the key names none. */\nfunction openView(key: string, options: { tab?: string; search?: string; filters?: Readonly<Record<string, string>> } = {}): boolean {\n const app = shell().app() as Parameters<typeof viewRoom>[0] | null;\n const room = app ? viewRoom(app, key) : undefined;\n if (!room) return false;\n if (!isListRoom(room)) {\n go(pageView(dashPageId(key)));\n return true;\n }\n /* A tab, a search and filters are the words an address says (publicAddress.ts addressQuestion), so a list\n opened here is the list that address opens: the same tab lit, the same boxes filled. */\n const params = new URLSearchParams();\n if (options.tab) params.set('tab', tabSlug(options.tab));\n if (options.search) params.set('search', options.search);\n for (const [column, value] of Object.entries(options.filters ?? {})) params.set(column, value);\n const asked = params.size ? (shell().addresses?.viewEntry(key, params.toString()) as Parameters<typeof go>[0] | null) : null;\n go(asked ?? { ...tableView(room.table, appListQuery(room, 0)), view: key });\n return true;\n}\nregisterViewOpener(openView);\n\n/** A public form's own page: `/{app}/form/{key}`. */\nexport function formLink(key: string): ViewLink {\n return { href: shown(`/${encodeURIComponent(state.activeConnection ?? '')}/form/${encodeURIComponent(key)}`) };\n}\n","/** A dashboard note is authored guidance, with at most one available next room. */\nimport type { AppIconName } from '@mistriwork/engine/shared/appIcons.js';\nimport { Icon } from './Icon.js';\nimport { useListNavigation } from './listNavigation.js';\nimport type { AppLinkAction } from '@mistriwork/engine/shared/appLinks.js';\nimport { shell } from '../shellMode.js';\n\ninterface DashboardNoteProps {\n title?: string;\n text: string;\n icon?: AppIconName;\n action?: AppLinkAction;\n row?: Readonly<Record<string, unknown>>;\n /** A page's note is plain, quiet or a callout; a dashboard's may be its banner. */\n variant?: 'quiet' | 'callout' | 'banner';\n /** A banner's short tag over its title. */\n eyebrow?: string;\n /** A banner's picture, already an address. */\n image?: { src: string; alt: string };\n}\n\nexport function DashboardNote({ title, text, icon, action, row, variant, eyebrow, image }: DashboardNoteProps) {\n /* The shell's navigation, not viewLink itself: a record page draws notes\n too, and viewLink reaches back into the page modules through the walk. */\n const navigate = useListNavigation();\n /* A call to action into another App of the suite is the App framework's (shellMode.ts): none where the shell has none. */\n const { TargetAction } = shell().slots;\n const link = action && 'view' in action ? navigate?.(action.view) : undefined;\n const paragraphs = text\n .split(/\\n\\s*\\n/)\n .map((paragraph) => paragraph.trim())\n .filter(Boolean);\n const words = (\n <>\n {icon && <Icon name={icon} size={28} className=\"dashboard-note-icon\" />}\n {eyebrow && <span className=\"dashboard-note-eyebrow\">{eyebrow}</span>}\n {title && <h2 className=\"dashboard-note-title\">{title}</h2>}\n {paragraphs.map((paragraph, index) => (\n <p key={index} className=\"dashboard-note-text\">\n {paragraph}\n </p>\n ))}\n {action && link && (\n <a className=\"dashboard-note-action\" {...link}>\n {action.label}\n {variant === 'banner' && <Icon name=\"caret-right\" size={14} />}\n </a>\n )}\n {action && 'to' in action && TargetAction && <TargetAction label={action.label} to={action.to} row={row} />}\n </>\n );\n /* A banner's words and its picture are two columns; the picture is sized by the banner, never by its file, so\n it arriving moves nothing. */\n if (variant === 'banner')\n return (\n <div className={`dashboard-note is-banner${image ? ' has-image' : ''}`}>\n <div className=\"dashboard-note-words\">{words}</div>\n {image && (\n <span className=\"dashboard-note-picture\">\n <img src={image.src} alt={image.alt} decoding=\"async\" />\n </span>\n )}\n </div>\n );\n return <div className={`dashboard-note${variant ? ` is-${variant}` : ''}`}>{words}</div>;\n}\n"],"ignoreList":[0,6,7,8,9,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAa,YAAyB,sBAAM,WAAW,SAAS,mBAAmB,gBAAgB,cAAc;CAC/G,MAAM,EACJ,WACA,QACA,cAAc,cACd,OACA,GAAG,iBACD;CAYJ,OARgB,iBAAiB,OAAO,gBAAgB;EACtD,OAAA,EAHA,YAGI;EACJ,KAAK;EACL,OAAO,CAAC;GACN,MAAM;GACN,oBAAoB;EACtB,GAAG,YAAY;CACjB,CACa;AACf,CAAC;AACD,IAAA,QAAA,IAAA,aAA6B,cAAc,UAAU,cAAc;;;;;;;;;;;;;;;;;;;;ACZnE,IAAM,MAAM;;;;;;;;AASZ,IAAM,c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