@objectstack/console 17.6.0 → 17.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/CHANGELOG.md +428 -0
  2. package/dist/.objectstack-injection.json +2 -2
  3. package/dist/.objectui-sha +1 -1
  4. package/dist/assets/{ActionResultDialog-4kHDGnT3.js → ActionResultDialog-ChYnuROr.js} +3 -3
  5. package/dist/assets/{AiPendingActionsPage-JjOddm0h.js → AiPendingActionsPage-Dh3-i4BB.js} +1 -1
  6. package/dist/assets/{ApiConsolePage-BgS26lbp.js → ApiConsolePage-CKYEqlMs.js} +1 -1
  7. package/dist/assets/{AppDocsIndex-BDoH5ECM.js → AppDocsIndex-B5Tky2xg.js} +1 -1
  8. package/dist/assets/{AppManagementPage-CCgKmNTj.js → AppManagementPage-ZwyvnHpM.js} +1 -1
  9. package/dist/assets/ApprovalsInboxPage-DD4fe0Em.js +1 -0
  10. package/dist/assets/AuditLogPage-Sed6iMqP.js +1 -0
  11. package/dist/assets/BookPage-DYjUsQIc.js +1 -0
  12. package/dist/assets/{ComponentNavView-B5g9c6fx.js → ComponentNavView-DrlxM4SY.js} +1 -1
  13. package/dist/assets/CreateViewDialog-Cp72x_O7.js +1 -0
  14. package/dist/assets/{DashboardView-BOcovpPd.js → DashboardView-juicRxcP.js} +1 -1
  15. package/dist/assets/DocPage-CxJaQ-pC.js +1 -0
  16. package/dist/assets/{DocsIndex-DwW2QsYY.js → DocsIndex-LALVtIVR.js} +1 -1
  17. package/dist/assets/{DocsLayout-D63StSgd.js → DocsLayout-BAwlJQQf.js} +1 -1
  18. package/dist/assets/{DocsSlug-CP9fcabi.js → DocsSlug-CkF1E-Zs.js} +1 -1
  19. package/dist/assets/ExpressionProvider-Dr0e99r1.js +1 -0
  20. package/dist/assets/FlowRunsPage-R3W3t2s4.js +1 -0
  21. package/dist/assets/{IntegrationsPage-DvG0x0Nb.js → IntegrationsPage-DIuFLEbF.js} +2 -2
  22. package/dist/assets/InterfaceListPage-BfoCldGu.js +1 -0
  23. package/dist/assets/{MarketplaceInstalledPage-B7KETQG2.js → MarketplaceInstalledPage-DyjhcUNB.js} +1 -1
  24. package/dist/assets/MarketplacePackagePage-BbO27Pgs.js +4 -0
  25. package/dist/assets/MarketplacePage-DO2_b64U.js +1 -0
  26. package/dist/assets/{MetadataInspector-EP0I3-Kq.js → MetadataInspector-BQyu9pOE.js} +1 -1
  27. package/dist/assets/ObjectDataPage-DIY-yefK.js +1 -0
  28. package/dist/assets/PageView-C-qWu3Jw.js +1 -0
  29. package/dist/assets/ProfilePage-Qp8DL8CF.js +1 -0
  30. package/dist/assets/{PublicFormsPage-D3uCTR-8.js → PublicFormsPage-D3AT2EH9.js} +1 -1
  31. package/dist/assets/RecordDetailView-B3XBEgk2.js +3 -0
  32. package/dist/assets/{RecordFormPage-kiJI-ieF.js → RecordFormPage-CcoZfUJ3.js} +1 -1
  33. package/dist/assets/ReportDefaultInspector-DVcWM6sh.js +1 -0
  34. package/dist/assets/ReportView-pJCFptzp.js +2 -0
  35. package/dist/assets/RuntimeDraftBar-DObTyFu2.js +1 -0
  36. package/dist/assets/SchemaForm-BWSWYMLE.js +3 -0
  37. package/dist/assets/SearchResultsPage-ChVIzFob.js +1 -0
  38. package/dist/assets/{SettingsHub-DP1mrzEN.js → SettingsHub-CPP9FDe8.js} +1 -1
  39. package/dist/assets/{SettingsView-u7mc6pcc.js → SettingsView-CrHAROu9.js} +1 -1
  40. package/dist/assets/{SkeletonDetail-DIwlbHTr.js → SkeletonDetail-CP-35B8x.js} +1 -1
  41. package/dist/assets/{af-DPUgkQl0.js → af-Bhbso4Pg.js} +1 -1
  42. package/dist/assets/ai-BAPiCsNk.js +3 -0
  43. package/dist/assets/app-shell-eager-leaves-D9tgfJOe.js +1 -0
  44. package/dist/assets/{ar-B-6GTIRU.js → ar-DG8TAFtm.js} +1 -1
  45. package/dist/assets/{ar-DZ-wEl298ti.js → ar-DZ-BtSien-d.js} +1 -1
  46. package/dist/assets/{ar-EG-YBT90_S0.js → ar-EG-DpXC0zoY.js} +1 -1
  47. package/dist/assets/{ar-MA-3uT-EYh6.js → ar-MA-D1qVJLyE.js} +1 -1
  48. package/dist/assets/{ar-SA-SiQsjhhc.js → ar-SA-BIYKNgv8.js} +1 -1
  49. package/dist/assets/{ar-TN-CfzXjKzS.js → ar-TN-mUR5Mq3s.js} +1 -1
  50. package/dist/assets/{az-BqAfcNza.js → az-B7IqwHGK.js} +1 -1
  51. package/dist/assets/{be-CQgWXa9_.js → be-CnZyPaSX.js} +1 -1
  52. package/dist/assets/{be-tarask-BmNg0Sir.js → be-tarask--uMMCC7l.js} +1 -1
  53. package/dist/assets/{bg-D3evgRuS.js → bg-CZwuirtY.js} +1 -1
  54. package/dist/assets/{bn-uItkARwm.js → bn-BbOX0r-z.js} +1 -1
  55. package/dist/assets/{bs-DueReOpO.js → bs-B5W75cYR.js} +1 -1
  56. package/dist/assets/{ca-Cr3AHktR.js → ca-Be69LdIM.js} +1 -1
  57. package/dist/assets/{ckb-CTi5BET7.js → ckb-B-nKM1Vn.js} +1 -1
  58. package/dist/assets/{createDerive-CjN1i5vn.js → createDerive-CynsXU-B.js} +1 -1
  59. package/dist/assets/{cs-43mFX9jr.js → cs-qHngxH7l.js} +1 -1
  60. package/dist/assets/{cy-BBSkg3F8.js → cy-DscO2Pgf.js} +1 -1
  61. package/dist/assets/{da-C5oA5qcs.js → da-vibkaLMF.js} +1 -1
  62. package/dist/assets/data-adapter-BDsrq0TX.js +2 -0
  63. package/dist/assets/{de-AT-CApxwJzu.js → de-AT--JneEuBw.js} +1 -1
  64. package/dist/assets/{de-CPtbLlAf.js → de-BCT78XYW.js} +1 -1
  65. package/dist/assets/default-inspector-registry-Dktr6x_q.js +1 -0
  66. package/dist/assets/dist-yh3dYtHt.js +14 -0
  67. package/dist/assets/drillUrlFilters-N0RngQg6.js +1 -0
  68. package/dist/assets/{el-Dto2xBQU.js → el-Cl0y9T2b.js} +1 -1
  69. package/dist/assets/en-AU-By42tTB7.js +1 -0
  70. package/dist/assets/{en-CA-DKuJPN1U.js → en-CA-BqEEoj-Y.js} +1 -1
  71. package/dist/assets/en-GB-Cx8B9nkB.js +1 -0
  72. package/dist/assets/en-IE-CX9nv6uO.js +1 -0
  73. package/dist/assets/en-IN-ByGSBHa4.js +1 -0
  74. package/dist/assets/en-NZ-BPMwa2ZN.js +1 -0
  75. package/dist/assets/en-ZA-lj_N4R6c.js +1 -0
  76. package/dist/assets/{eo-BL8JXIWd.js → eo-oOXROuhF.js} +1 -1
  77. package/dist/assets/{es-BnoaNxsu.js → es-EudscwjH.js} +1 -1
  78. package/dist/assets/{et-tPYLNenO.js → et-CB-5LLh6.js} +1 -1
  79. package/dist/assets/{eu-CUBG6bT0.js → eu-B4-hcseX.js} +1 -1
  80. package/dist/assets/{fa-IR-Rr2d9xSs.js → fa-IR-CogavcMJ.js} +1 -1
  81. package/dist/assets/{fi-B0NVIZsV.js → fi-CIBE0mYa.js} +1 -1
  82. package/dist/assets/{formatLong-1-gt9bpo.js → formatLong-qqgm7lV1.js} +1 -1
  83. package/dist/assets/{fr-CA-CBDvLXFg.js → fr-CA-BugXMutW.js} +1 -1
  84. package/dist/assets/{fr-BbhHek8e.js → fr-CDReXYWW.js} +1 -1
  85. package/dist/assets/{fr-CH-WPNmwPn7.js → fr-CH-fiTiB6X1.js} +1 -1
  86. package/dist/assets/framework-CAuH4h0L.js +35 -0
  87. package/dist/assets/{fy-DvOBbvEF.js → fy-t_GzIAg_.js} +1 -1
  88. package/dist/assets/{gd-BQPiTPX5.js → gd-CSncIxtN.js} +1 -1
  89. package/dist/assets/getIcon-BDkBRQFw.js +1 -0
  90. package/dist/assets/{gl-BJCXK8uO.js → gl-_138Mj2S.js} +1 -1
  91. package/dist/assets/{gu-CctPRz3V.js → gu-COfH-YUT.js} +1 -1
  92. package/dist/assets/{he-CVFMk6p2.js → he-BXL4lOKY.js} +1 -1
  93. package/dist/assets/{hi-Ba30-RwS.js → hi-kXuYI0TJ.js} +1 -1
  94. package/dist/assets/{highlighted-body-OFNGDK62-BQ57IrBV.js → highlighted-body-OFNGDK62-CK7x7Gzm.js} +1 -1
  95. package/dist/assets/{hr-BZUqTbZs.js → hr-DAOsQWzI.js} +1 -1
  96. package/dist/assets/{ht-BLe05tPx.js → ht-Ch8SKz8p.js} +1 -1
  97. package/dist/assets/{hu-2CQ_Mkww.js → hu-q6W_rWPT.js} +1 -1
  98. package/dist/assets/{hy-CclcPG4H.js → hy-0M8OmwnM.js} +1 -1
  99. package/dist/assets/{i18n-BnUsCaSC.js → i18n-DTfZonAM.js} +3 -3
  100. package/dist/assets/i18n-locale-ar-O6rs-Cir.js +4 -0
  101. package/dist/assets/i18n-locale-de-CMc1jk4a.js +4 -0
  102. package/dist/assets/i18n-locale-en-CbRQO81h.js +4 -0
  103. package/dist/assets/i18n-locale-es-t47nyoCX.js +4 -0
  104. package/dist/assets/i18n-locale-fr-E425EqJM.js +4 -0
  105. package/dist/assets/i18n-locale-ja-y_fk77fz.js +4 -0
  106. package/dist/assets/i18n-locale-ko-CdnY2uCg.js +4 -0
  107. package/dist/assets/i18n-locale-pt-BaUOXS6y.js +4 -0
  108. package/dist/assets/i18n-locale-ru-pFlhX9wg.js +4 -0
  109. package/dist/assets/i18n-locale-zh-Dkj4ROTN.js +4 -0
  110. package/dist/assets/i18n-runtime-CdWyaiOD.js +1 -0
  111. package/dist/assets/{id-6JLB8s-f.js → id-BM_H1_jv.js} +1 -1
  112. package/dist/assets/index-ocmkyCt6.js +19 -0
  113. package/dist/assets/index-v2Ijn9Gr.css +2 -0
  114. package/dist/assets/{infrastructure-Cc34lEqb.js → infrastructure-CSnL6ntj.js} +2 -2
  115. package/dist/assets/integration-7NqwVHuJ.js +1 -0
  116. package/dist/assets/{is-to0CWzm1.js → is-B_7jXZfS.js} +1 -1
  117. package/dist/assets/isSameWeek-D90tBsli.js +1 -0
  118. package/dist/assets/{it-ea0B8Ujp.js → it-CBM0J9cD.js} +1 -1
  119. package/dist/assets/{it-CH-DhdfjP5Z.js → it-CH-BQltCNsR.js} +1 -1
  120. package/dist/assets/{ja-B1bzkgDW.js → ja-DBjnsx21.js} +1 -1
  121. package/dist/assets/{ja-Hira-CMrY5hXO.js → ja-Hira-BZfSmj1i.js} +1 -1
  122. package/dist/assets/{ka-DKSXLnXP.js → ka-HwpuKgUY.js} +1 -1
  123. package/dist/assets/{kk-DHwMv8Dn.js → kk-DLKA9paj.js} +1 -1
  124. package/dist/assets/{km-tpLG1xNr.js → km-BU5kermq.js} +1 -1
  125. package/dist/assets/{kn-MLreVnHA.js → kn-BNFqbCoi.js} +1 -1
  126. package/dist/assets/{ko-CI0DBazn.js → ko-D8n4uMqQ.js} +1 -1
  127. package/dist/assets/{lb-CmL572Xe.js → lb-B1empQ7m.js} +1 -1
  128. package/dist/assets/{lt-DRtUOLdw.js → lt-gMukpK3G.js} +1 -1
  129. package/dist/assets/{lv-COSHgkOP.js → lv-D2O5AnsZ.js} +1 -1
  130. package/dist/assets/{match-BQoOW8Cj.js → match-BTF6WqJh.js} +1 -1
  131. package/dist/assets/{match-B-ergJQb.js → match-Cyum2eeW.js} +1 -1
  132. package/dist/assets/{match-dfBS0YSQ.js → match-ScHH8kYk.js} +1 -1
  133. package/dist/assets/mermaid-GHXKKRXX-D4H6EVJQ.js +1 -0
  134. package/dist/assets/metadata-admin-CEhVmXFv.js +9 -0
  135. package/dist/assets/{mk-B0IH_YL_.js → mk-D-Zl0xVN.js} +1 -1
  136. package/dist/assets/{mn-P-QdQ2n3.js → mn-jJbTslgD.js} +1 -1
  137. package/dist/assets/{ms-CtyEOINy.js → ms-CUuJHLA4.js} +1 -1
  138. package/dist/assets/{mt-DfuZ2HRm.js → mt-yIcbfxKY.js} +1 -1
  139. package/dist/assets/{nb-2Hp-5Tnt.js → nb-D9WNypoj.js} +1 -1
  140. package/dist/assets/{nl-BE-mmxbfNoR.js → nl-BE-B1vKiw2h.js} +1 -1
  141. package/dist/assets/{nl-CZ_nLREz.js → nl-DC7b5e90.js} +1 -1
  142. package/dist/assets/{nn-ccWhYsNa.js → nn-uP4yJ9s0.js} +1 -1
  143. package/dist/assets/{oc-z504BFRV.js → oc-DHTqadJI.js} +1 -1
  144. package/dist/assets/{pl-DeQ7ASt-.js → pl-Bxnnizf5.js} +1 -1
  145. package/dist/assets/plugin-calendar-b7C35ANT.js +1 -0
  146. package/dist/assets/plugin-charts-b-yVtmdI.js +7 -0
  147. package/dist/assets/{plugin-chatbot-Ck47EhDX.js → plugin-chatbot-D1KW_oIO.js} +8 -8
  148. package/dist/assets/plugin-dashboard-DTkPoPEb.js +6 -0
  149. package/dist/assets/plugin-form-UIRm-FpQ.js +1 -0
  150. package/dist/assets/plugin-gantt-9dtc8zzX.js +63 -0
  151. package/dist/assets/plugin-grid-Cp4RKtMJ.js +10 -0
  152. package/dist/assets/plugin-kanban-B2JOPZIJ.js +1 -0
  153. package/dist/assets/plugin-map-CBJcVJYk.js +1 -0
  154. package/dist/assets/{plugin-markdown-BOkHcir_.js → plugin-markdown-CNlDzqP-.js} +1 -1
  155. package/dist/assets/plugin-report-IZzgQb-Q.js +59 -0
  156. package/dist/assets/plugin-timeline-DsmtjcJ3.js +1 -0
  157. package/dist/assets/plugin-tree-DTRPBdhe.js +1 -0
  158. package/dist/assets/plugin-view-D9ixsNDG.js +1 -0
  159. package/dist/assets/plugins-views-CnvkdSJK.js +3 -0
  160. package/dist/assets/{pt-BR-D80_lPYF.js → pt-BR-D416seHT.js} +1 -1
  161. package/dist/assets/{pt-CJJ1RmXd.js → pt-DwHBy9_c.js} +1 -1
  162. package/dist/assets/{ro-EuFb2TCj.js → ro-DDf1X3Np.js} +1 -1
  163. package/dist/assets/{ru-CMaVQScp.js → ru-8eM3mcgK.js} +1 -1
  164. package/dist/assets/{runtime-metadata-persistence-ClOTznqa.js → runtime-metadata-persistence-DX29lQ62.js} +1 -1
  165. package/dist/assets/{se-DsfdKLdF.js → se-D4JvQeRX.js} +1 -1
  166. package/dist/assets/{sk-BNV9omI8.js → sk-DvpgttGI.js} +1 -1
  167. package/dist/assets/{sl-DJS_nINU.js → sl-B3gCZ-_a.js} +1 -1
  168. package/dist/assets/{sq-HEgjcbHe.js → sq-CVaTmL0V.js} +1 -1
  169. package/dist/assets/{sr-CO0CFu4X.js → sr-CnH5Ffyz.js} +1 -1
  170. package/dist/assets/{sr-Latn-eE1Idzey.js → sr-Latn-Dw9w61q6.js} +1 -1
  171. package/dist/assets/src-BUry7633.js +2 -0
  172. package/dist/assets/{src-BU7L2v4J.js → src-DMDT5a27.js} +1 -1
  173. package/dist/assets/src-ZxH3AOCu.js +16 -0
  174. package/dist/assets/{studioEntry-WeMfaSGn.js → studioEntry-DAqcBFtr.js} +1 -1
  175. package/dist/assets/{submitRedirect-C2lfZSHt.js → submitRedirect-iy0oOi7I.js} +1 -1
  176. package/dist/assets/{sv-5uTzgQT3.js → sv-CU7wdxyK.js} +1 -1
  177. package/dist/assets/{ta-BzgdkBZG.js → ta-DPH6q0HR.js} +1 -1
  178. package/dist/assets/{te-Ct_pl7ZJ.js → te-BSaThkGV.js} +1 -1
  179. package/dist/assets/{th-DouAlk0-.js → th-NXP8_Qb8.js} +1 -1
  180. package/dist/assets/{tr-3XNBsI40.js → tr-DDXoH663.js} +1 -1
  181. package/dist/assets/types-zod-ChJ30y25.js +1 -0
  182. package/dist/assets/{ug-B9n24h9G.js → ug-Guus6pPe.js} +1 -1
  183. package/dist/assets/ui-components-D8wcRNrt.js +37 -0
  184. package/dist/assets/ui-layout-BYO3rRIl.js +1 -0
  185. package/dist/assets/{uk-DCAenByf.js → uk-uiy4vsp8.js} +1 -1
  186. package/dist/assets/use-book-data-DFTswcKm.js +1 -0
  187. package/dist/assets/{useActionModal-Blp4rhOk.js → useActionModal-h52Z5Pkl.js} +1 -1
  188. package/dist/assets/useCanAuthorMetadata-TDrVrYGB.js +1 -0
  189. package/dist/assets/useDatasetCatalog-BOd0Ybr1.js +1 -0
  190. package/dist/assets/{useNavTargetLabel-BOJncjIb.js → useNavTargetLabel-D8lRdb6O.js} +1 -1
  191. package/dist/assets/useOpenRecordList-C7oqUD3F.js +1 -0
  192. package/dist/assets/{usePackageL10n-Ci9uVkRZ.js → usePackageL10n-Jl2XiF2F.js} +1 -1
  193. package/dist/assets/{useSettingsLabel-CeMnMWsh.js → useSettingsLabel-CSpBDTdy.js} +1 -1
  194. package/dist/assets/{uz-Cyrl-JSeHEqu-.js → uz-Cyrl-Cmb5bvbf.js} +1 -1
  195. package/dist/assets/{uz-DT3s9bZS.js → uz-DJWxoTz4.js} +1 -1
  196. package/dist/assets/vendor-objectstack-C4eD5dbT.js +139 -0
  197. package/dist/assets/{vi-D2p-h6bY.js → vi-Bb3QoIJC.js} +1 -1
  198. package/dist/assets/{zh-CN-DHOKqAit.js → zh-CN-C-Hts1ZR.js} +1 -1
  199. package/dist/assets/{zh-HK-D4iIPY7I.js → zh-HK-CtBAZ_ZS.js} +1 -1
  200. package/dist/assets/{zh-TW-gORQ_tZh.js → zh-TW-B7DDahD-.js} +1 -1
  201. package/dist/chunk-membership.json +28 -26
  202. package/dist/eager-closure.json +107 -101
  203. package/dist/index.html +4 -4
  204. package/dist/sdui.manifest.json +486 -63
  205. package/package.json +1 -1
  206. package/dist/assets/ApprovalsInboxPage-C6S1vk0X.js +0 -1
  207. package/dist/assets/AuditLogPage-v2dKXMuk.js +0 -1
  208. package/dist/assets/BookPage-DwFMcTSN.js +0 -1
  209. package/dist/assets/CreateViewDialog-D3l-tYHM.js +0 -1
  210. package/dist/assets/DocPage-B6AkH5WI.js +0 -1
  211. package/dist/assets/ExpressionProvider-CrL6jhVq.js +0 -1
  212. package/dist/assets/FlowRunsPage-CxdaiUyk.js +0 -1
  213. package/dist/assets/InterfaceListPage-C4wPYohR.js +0 -1
  214. package/dist/assets/MarketplacePackagePage-CfgKDpNH.js +0 -4
  215. package/dist/assets/MarketplacePage-DNEyU5AE.js +0 -1
  216. package/dist/assets/ObjectDataPage-CykEm9MD.js +0 -1
  217. package/dist/assets/PageView-C6u86tni.js +0 -1
  218. package/dist/assets/ProfilePage-C3SjXMzi.js +0 -1
  219. package/dist/assets/RecordDetailView-DgR_zhP4.js +0 -3
  220. package/dist/assets/ReportDefaultInspector-BIinF0EQ.js +0 -1
  221. package/dist/assets/ReportView-BREO-ADE.js +0 -2
  222. package/dist/assets/RuntimeDraftBar-BCWfd2yS.js +0 -1
  223. package/dist/assets/SchemaForm-C4uMMZ13.js +0 -3
  224. package/dist/assets/SearchResultsPage-C6Hw_Lpn.js +0 -1
  225. package/dist/assets/ai-DPBykF2N.js +0 -3
  226. package/dist/assets/app-shell-eager-leaves-Cf2bM6uT.js +0 -1
  227. package/dist/assets/data-adapter-Cymvlczj.js +0 -1
  228. package/dist/assets/default-inspector-registry-Bs6GBn00.js +0 -1
  229. package/dist/assets/dist-BF-ssUpn.js +0 -14
  230. package/dist/assets/drillUrlFilters-hi-2d3DW.js +0 -1
  231. package/dist/assets/en-AU-FVwCiDJO.js +0 -1
  232. package/dist/assets/en-GB-DQ_y5VbJ.js +0 -1
  233. package/dist/assets/en-IE-DaXOhsZW.js +0 -1
  234. package/dist/assets/en-IN-CnRZnAom.js +0 -1
  235. package/dist/assets/en-NZ-CBZLEToK.js +0 -1
  236. package/dist/assets/en-ZA-BE59v0wZ.js +0 -1
  237. package/dist/assets/framework-DFR4HNtj.js +0 -35
  238. package/dist/assets/getIcon-Cfwf-Egt.js +0 -1
  239. package/dist/assets/i18n-locale-ar-92O_xtDZ.js +0 -4
  240. package/dist/assets/i18n-locale-de-T5ic3yH9.js +0 -4
  241. package/dist/assets/i18n-locale-en-rxr7WJYl.js +0 -4
  242. package/dist/assets/i18n-locale-es-D_WOifJ_.js +0 -4
  243. package/dist/assets/i18n-locale-fr-3cvyjMkp.js +0 -4
  244. package/dist/assets/i18n-locale-ja-DXlIkB8I.js +0 -4
  245. package/dist/assets/i18n-locale-ko-DngRpS45.js +0 -4
  246. package/dist/assets/i18n-locale-pt-BkPaFCqZ.js +0 -4
  247. package/dist/assets/i18n-locale-ru-E5wLh-y6.js +0 -4
  248. package/dist/assets/i18n-locale-zh-BL4_Yand.js +0 -4
  249. package/dist/assets/i18n-runtime-97_bDVjP.js +0 -1
  250. package/dist/assets/index-Cadlh4t_.css +0 -2
  251. package/dist/assets/index-D98sa5GF.js +0 -20
  252. package/dist/assets/integration-CeAF4JFT.js +0 -1
  253. package/dist/assets/isSameWeek-DBXaA1Gd.js +0 -1
  254. package/dist/assets/mermaid-GHXKKRXX-Bb17TtNP.js +0 -1
  255. package/dist/assets/metadata-admin-CABUxbJl.js +0 -9
  256. package/dist/assets/plugin-calendar-Cn5HaZU8.js +0 -1
  257. package/dist/assets/plugin-charts-B6RcFWbo.js +0 -7
  258. package/dist/assets/plugin-dashboard-DjEx8e5Y.js +0 -6
  259. package/dist/assets/plugin-form-CLDvL0up.js +0 -1
  260. package/dist/assets/plugin-gantt-CrVrxVdi.js +0 -63
  261. package/dist/assets/plugin-grid-D2rmQEW_.js +0 -11
  262. package/dist/assets/plugin-kanban-BUNHFfIC.js +0 -1
  263. package/dist/assets/plugin-map-y-7RQQC5.js +0 -1
  264. package/dist/assets/plugin-report-mT3jpna0.js +0 -59
  265. package/dist/assets/plugin-timeline-B1EF83D3.js +0 -1
  266. package/dist/assets/plugin-tree-MTHUt3_S.js +0 -1
  267. package/dist/assets/plugin-view-DHJI-ahf.js +0 -1
  268. package/dist/assets/plugins-views-CfkgqD30.js +0 -3
  269. package/dist/assets/src-BUtIBFDA.js +0 -1
  270. package/dist/assets/src-C0eXlKtx.js +0 -16
  271. package/dist/assets/types-zod-DXpXw10W.js +0 -1
  272. package/dist/assets/ui-components-D6cEVg0T.js +0 -37
  273. package/dist/assets/ui-layout-DgVDuPEM.js +0 -1
  274. package/dist/assets/use-book-data-CwRldFxP.js +0 -1
  275. package/dist/assets/useCanAuthorMetadata-BxCMgFRf.js +0 -1
  276. package/dist/assets/useOpenRecordList-BrwJFojQ.js +0 -1
  277. package/dist/assets/vendor-objectstack-DFqu45yM.js +0 -138
@@ -0,0 +1,63 @@
1
+ import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n,v as r}from"./vendor-react-BggL7APJ.js";import{Yn as i,jr as a,ta as o,xn as s}from"./vendor-objectstack-C4eD5dbT.js";import{Ct as c,Si as l,St as u,X as d,Z as f,_i as p,bi as m,bt as h,c as g,di as ee,et as _,fi as te,gi as v,hi as y,ht as ne,m as re,mi as ie,p as ae,pi as oe,rt as b,vi as se,xt as ce}from"./ui-components-D8wcRNrt.js";import{$i as x,Bt as le,Dr as ue,Er as de,Fr as fe,Or as pe,Ot as me,Qi as he,Rt as ge,Tr as _e,Yr as S,Zn as C,_ as ve,br as ye,dt as be,ei as w,fn as xe,in as T,jt as Se,mn as Ce,n as we,ni as Te,pt as Ee,st as De,ti as Oe,u as ke,wr as Ae,xr as je,y as E,zt as Me}from"./framework-CAuH4h0L.js";import{i as D,n as Ne,t as Pe,w as O}from"./i18n-runtime-CdWyaiOD.js";import{r as Fe}from"./vendor-ui-utils-DIUdEYii.js";import{t as Ie}from"./vendor-icon-activity-CkniytwY.js";import{t as Le}from"./vendor-icon-arrow-right-RqsZZ458.js";import{t as Re}from"./vendor-icon-chevron-down-BEf_jTEE.js";import{t as ze}from"./vendor-icon-chevron-left-KnDcuFH1.js";import{t as k}from"./vendor-icon-chevron-right-DbnKwHYQ.js";import{t as Be}from"./vendor-icon-download-C3csYSaD.js";import{t as Ve}from"./vendor-icon-file-down-4-LKF_us.js";import{t as He}from"./vendor-icon-lock-B_psRnly.js";import{t as A}from"./vendor-icon-maximize-2-C215UtMO.js";import{t as Ue}from"./vendor-icon-minimize-2-CTEy4oVG.js";import{t as We}from"./vendor-icon-panel-left-close-CrofkR7D.js";import{t as j}from"./vendor-icon-panel-left-Cml87N0K.js";import{t as Ge}from"./vendor-icon-redo-2-BJ-uEK0D.js";import{t as M}from"./vendor-icon-refresh-cw-BGjSPEfJ.js";import{t as Ke}from"./vendor-icon-save-CuavGNuU.js";import{t as qe}from"./vendor-icon-undo-2-C9MbW2Vb.js";import{t as Je}from"./vendor-icon-wand-sparkles-DGBfehuR.js";import{t as Ye}from"./vendor-icon-zoom-out-IlqZRNIF.js";import{t as Xe}from"./vendor-icon-zoom-in-ShI9ftXk.js";import{c as Ze,o as Qe}from"./plugin-grid-Cp4RKtMJ.js";var N=e(r(),1);s();var $e=864e5,P=e=>String(e).padStart(2,`0`),et=e=>`${e.getFullYear()}-${P(e.getMonth()+1)}-${P(e.getDate())}`;function F(e,t){if(t.skipWeekends){let t=e.getDay();if(t===0||t===6)return!1}return!(t.holidays&&t.holidays.has(et(e)))}function I(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function tt(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function nt(e,t){let n=I(e);for(;!F(n,t);)n=tt(n,1);return n.getTime()}function rt(e,t,n){if(t<=e)return 0;let r=0,i=I(e),a=I(t).getTime();for(;i.getTime()<a;)F(i,n)&&r++,i=tt(i,1);return r}function L(e,t,n){if(t<=0)return I(e).getTime();let r=I(e),i=t;for(;i>0;)F(r,n)&&i--,r=tt(r,1);return r.getTime()}function it(e,t,n){if(t<=0)return I(e).getTime();let r=I(e),i=t;for(;i>0;)r=tt(r,-1),F(r,n)&&i--;return r.getTime()}var R=e=>String(e);function at(e){return e===`ss`||e===`ff`||e===`sf`?e:`fs`}function ot(e){let t=new Set(e.map(e=>R(e.id))),n=[];for(let r of e){let e=R(r.id);for(let i of r.dependencies??[]){let r=typeof i==`object`&&!!i,a=r?i.id:i;if(a==null||a===``)continue;let o=R(a);o!==e&&t.has(o)&&n.push({pred:o,succ:e,type:at(r?i.type:void 0)})}}return n}function st(e){let t=new Set;for(let n of e)n.parent!=null&&n.parent!==``&&t.add(R(n.parent));return t}function z(e,t){let n=new Map,r=new Map;for(let t of e)n.set(t,0),r.set(t,[]);for(let e of t)r.get(e.pred).push(e.succ),n.set(e.succ,(n.get(e.succ)??0)+1);let i=e.filter(e=>(n.get(e)??0)===0),a=[];for(;i.length;){let e=i.shift();a.push(e);for(let t of r.get(e)??[]){let e=(n.get(t)??0)-1;n.set(t,e),e===0&&i.push(t)}}if(a.length<e.length){let t=new Set(a);for(let n of e)t.has(n)||a.push(n);return{order:a,hasCycle:!0}}return{order:a,hasCycle:!1}}function ct(e,t){let n={criticalIds:new Set,criticalEdges:new Set};if(!e.length)return n;let r=new Map;for(let n of e){let e=t?rt(n.start.getTime(),n.end.getTime(),t):(n.end.getTime()-n.start.getTime())/$e;r.set(R(n.id),Number.isFinite(e)&&e>0?e:0)}let i=ot(e),a=e.map(e=>R(e.id)),{order:o,hasCycle:s}=z(a,i);if(s)return n;let c=new Map,l=new Map;for(let e of a)c.set(e,[]),l.set(e,[]);for(let e of i)c.get(e.succ).push(e),l.get(e.pred).push(e);let u=new Map,d=new Map;for(let e of o){let t=0;for(let n of c.get(e)??[])t=Math.max(t,d.get(n.pred)??0);u.set(e,t),d.set(e,t+(r.get(e)??0))}let f=Math.max(0,...a.map(e=>d.get(e)??0)),p=new Map,m=new Map;for(let e=o.length-1;e>=0;e--){let t=o[e],n=l.get(t)??[],i=f;n.length&&(i=Math.min(...n.map(e=>m.get(e.succ)??f))),p.set(t,i),m.set(t,i-(r.get(t)??0))}let h=1e-6,g=new Set;for(let e of a){let t=(m.get(e)??0)-(u.get(e)??0);Math.abs(t)<=h&&g.add(e)}let ee=new Set;for(let e of i)ee.add(e.pred),ee.add(e.succ);for(let e of[...g])!ee.has(e)&&(r.get(e)??0)===0&&g.delete(e);let _=new Set;for(let e of i)g.has(e.pred)&&g.has(e.succ)&&Math.abs((d.get(e.pred)??0)-(u.get(e.succ)??0))<=h&&_.add(`${e.pred}->${e.succ}`);return{criticalIds:g,criticalEdges:_}}function lt(e,t,n){if(!e.length)return{changes:[],skippedLocked:[]};let r=ot(e),i=e.map(e=>R(e.id)),{order:a,hasCycle:o}=z(i,r);if(o)return{changes:[],skippedLocked:[]};let s=st(e),c=new Map;for(let t of e)c.set(R(t.id),t);let l=new Map;for(let t of e){if(t.parent==null||t.parent===``)continue;let e=R(t.parent),n=l.get(e)??[];n.push(t),l.set(e,n)}let u=n?.summaryExtent===`self`,d=e=>u&&e.hasOwnDates!==!1&&!e.locked,f=new Map;for(let e of i)f.set(e,[]);for(let e of r)f.get(e.succ).push(e);let p=new Map,m=new Map;for(let t of e)p.set(R(t.id),t.start.getTime()),m.set(R(t.id),t.end.getTime());let h=[];for(let e of a){let r=c.get(e);if(!r)continue;let i=t?rt(p.get(e),m.get(e),t):m.get(e)-p.get(e),a=r.start.getTime(),o=a;for(let n of f.get(e)??[]){let e=p.get(n.pred),r=m.get(n.pred),a;switch(n.type){case`ss`:a=e;break;case`ff`:a=t?it(r,i,t):r-i;break;case`sf`:a=t?it(e,i,t):e-i;break;default:a=r}a>o&&(o=a)}let l=o>a;if(!s.has(e)||d(r)){if(r.locked){l&&h.push(e);continue}if(l&&!t&&n?.snapStart&&(o=Math.max(o,n.snapStart(o))),t){let n=nt(o,t);p.set(e,n),m.set(e,L(n,i,t))}else p.set(e,o),m.set(e,o+i)}}if(u)for(let t of e){let e=R(t.id);if(!s.has(e)||!d(t))continue;let n=p.get(e)-t.start.getTime();if(n<=0)continue;let r=[...l.get(e)??[]];for(;r.length;){let e=r.pop(),t=R(e.id);if(r.push(...l.get(t)??[]),e.locked)continue;let i=e.start.getTime()+n;if(i>p.get(t)){let e=m.get(t)-p.get(t);p.set(t,i),m.set(t,i+e)}}}let g=[];for(let t of e){let e=R(t.id),n=p.get(e),r=m.get(e);(n!==t.start.getTime()||r!==t.end.getTime())&&g.push({id:e,start:new Date(n),end:new Date(r)})}return{changes:g,skippedLocked:h}}function ut(e,t,n){let r=String(t),i=String(n);if(r===i)return!0;let a=new Map;for(let[t,n]of e){let e=a.get(t);e?e.push(n):a.set(t,[n])}let o=new Set([i]),s=[i];for(;s.length;){let e=s.pop();for(let t of a.get(e)??[]){if(t===r)return!0;o.has(t)||(o.add(t),s.push(t))}}return!1}var dt=6e4;1440*dt;var ft=1440;function B(e){if(typeof e!=`string`)return null;let t=/^(\d{1,2}):(\d{2})$/.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return n<0||n>23||r<0||r>59?null:n*60+r}function pt(e){if(!e||!Array.isArray(e.bands)||e.bands.length===0)return null;let t=B(e.dayStart)??0,n=[];for(let t=0;t<e.bands.length;t++){let r=e.bands[t],i=B(r.start),a=B(r.end);if(i==null||a==null||!r.label)return null;let o=(a-i+ft)%ft||ft;n.push({key:r.key??`band${t}`,label:r.label,color:r.color,durMs:o*dt})}return{dayStartMin:t,bands:n,showMidnight:e.showMidnight!==!1}}function mt(e,t){let n=new Date(e);return n.setHours(0,0,0,0),n.setMinutes(t),n.getTime()>e.getTime()&&n.setDate(n.getDate()-1),n}function ht(e,t){if(t.bands.length===0)return null;let n=mt(e,t.dayStartMin).getTime(),r=e.getTime()-n,i=0;for(let e of t.bands)if(i+=e.durMs,r<i)return e;return t.bands[t.bands.length-1]}function gt(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour12:!1,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),r=e=>Number(n.formatToParts(t).find(t=>t.type===e)?.value??0);return Date.UTC(r(`year`),r(`month`)-1,r(`day`),r(`hour`)%24,r(`minute`),r(`second`))-Math.floor(t.getTime()/1e3)*1e3}function _t(e){let t={delta:0,to:e=>e,from:e=>e,now:()=>new Date};if(!e)return t;try{gt(e,new Date)}catch{return console.warn(`[GanttView] invalid timeZone "${e}" — falling back to the browser zone`),t}let n=t=>gt(e,t)- -t.getTimezoneOffset()*6e4,r=n(new Date);return r===0?t:{delta:r,to:e=>new Date(e.getTime()+n(e)),from:e=>new Date(e.getTime()-n(e)),now:()=>new Date(Date.now()+n(new Date))}}var vt=18e5;function yt(e,t,n){let r=t.getTime(),i=new Map,a=t=>{let n=i.get(t);return n===void 0&&(n=e(new Date(t)).getTime(),i.set(t,n)),n},o=r-(a(r)-r);if(n===`any`&&a(o)===r)return new Date(o);let s=new Set([o]);for(let e=-6;e<=6;e++){let t=o+e*vt;s.add(r-(a(t)-t))}let c=[...s].filter(e=>a(e)===r).sort((e,t)=>e-t);if(c.length>0)return new Date(n===`latest`?c[c.length-1]:c[0]);let l=[...s].filter(e=>a(e)>r).sort((e,t)=>a(e)-a(t));return new Date(l.length>0?l[0]:o)}function bt(e,t){return e.delta===0?t:yt(e.to,t,`any`)}function xt(e,t){return e.delta===0?t:yt(e.from,t,`latest`)}var St={"gantt.column.taskName":`Task Name`,"gantt.column.start":`Start`,"gantt.column.end":`End`,"gantt.toolbar.prevPeriod":`Previous period`,"gantt.toolbar.nextPeriod":`Next period`,"gantt.toolbar.zoomIn":`Zoom in`,"gantt.toolbar.zoomOut":`Zoom out`,"gantt.toolbar.jumpToToday":`Jump to today`,"gantt.toolbar.today":`Today`,"gantt.toolbar.thisWeek":`This week`,"gantt.toolbar.thisMonth":`This month`,"gantt.toolbar.exportPdf":`Export PDF`,"gantt.toolbar.saveLayout":`Save layout`,"gantt.toolbar.showTaskList":`Show task list`,"gantt.toolbar.hideTaskList":`Hide task list`,"gantt.toolbar.viewMode":`Timeline granularity`,"gantt.toolbar.enterFullscreen":`Enter fullscreen`,"gantt.toolbar.exitFullscreen":`Exit fullscreen`,"gantt.toolbar.criticalPath":`Highlight critical path`,"gantt.toolbar.autoSchedule":`Auto-schedule dependencies`,"gantt.toolbar.exportPng":`Export as PNG`,"gantt.toolbar.refresh":`Refresh`,"gantt.toolbar.undo":`Undo`,"gantt.toolbar.redo":`Redo`,"gantt.viewMode.day":`Day`,"gantt.viewMode.week":`Week`,"gantt.viewMode.month":`Month`,"gantt.viewMode.quarter":`Quarter`,"gantt.viewMode.year":`Year`,"gantt.row.expand":`Expand`,"gantt.row.collapse":`Collapse`,"gantt.row.open":`Open details`,"gantt.aria.taskList":`Task list`,"gantt.aria.refreshing":`Refreshing…`,"gantt.tooltip.days":`d`,"gantt.menu.view":`View details`,"gantt.menu.edit":`Edit inline`,"gantt.menu.delete":`Delete`,"gantt.menu.addPredecessor":`Add predecessor…`,"gantt.menu.addSuccessor":`Add successor…`,"gantt.menu.removeDependency":`Remove dependency`,"gantt.menu.noCandidates":`No available tasks`,"gantt.menu.searchTasks":`Search tasks…`,"gantt.delete.title":`Delete this task?`,"gantt.delete.body":`"{{title}}" will be permanently removed. This action cannot be undone.`,"gantt.delete.cancel":`Cancel`,"gantt.delete.confirm":`Delete`,"gantt.delete.deleting":`Deleting…`,"gantt.drawer.fallbackTitle":`Task Details`,"gantt.linkType.fs":`Finish → Start`,"gantt.linkType.ss":`Start → Start`,"gantt.linkType.ff":`Finish → Finish`,"gantt.linkType.sf":`Start → Finish`,"gantt.linkEnd.start":`start`,"gantt.linkEnd.end":`end`,"gantt.link.rejected.self":`A task cannot depend on itself.`,"gantt.link.rejected.locked":`This row is locked and cannot take a new dependency.`,"gantt.link.rejected.group":`A summary row cannot take a dependency — link one of its tasks instead.`,"gantt.link.rejected.cycle":`That link would create a circular dependency.`,"gantt.conflict.title":`Schedule conflict`,"gantt.conflict.body":`This move conflicts with dependency constraints. Auto-reschedule {{count}} affected task(s)?`,"gantt.conflict.body_one":`This move conflicts with dependency constraints. Auto-reschedule {{count}} affected task?`,"gantt.conflict.body_other":`This move conflicts with dependency constraints. Auto-reschedule {{count}} affected tasks?`,"gantt.conflict.confirm":`Auto-reschedule`,"gantt.conflict.cancel":`Keep as is`,"gantt.autoScheduleDlg.title":`Auto-schedule`,"gantt.autoScheduleDlg.body":`Shift {{count}} task(s) later to satisfy dependency links?`,"gantt.autoScheduleDlg.body_one":`Shift {{count}} task later to satisfy dependency links?`,"gantt.autoScheduleDlg.body_other":`Shift {{count}} tasks later to satisfy dependency links?`,"gantt.autoScheduleDlg.skipped":`{{count}} locked task(s) also violate links and were skipped.`,"gantt.autoScheduleDlg.skipped_one":`{{count}} locked task also violates links and was skipped.`,"gantt.autoScheduleDlg.skipped_other":`{{count}} locked tasks also violate links and were skipped.`,"gantt.autoScheduleDlg.confirm":`Apply`,"gantt.autoScheduleDlg.cancel":`Cancel`,"gantt.autoScheduleDlg.none":`All dependencies satisfied — nothing to reschedule.`,"gantt.quickFilter.all":`All`,"gantt.quickFilter.clear":`Clear filters`,"gantt.quickFilter.empty":`No options`,"gantt.quickFilter.resultSummary":`Showing {shown} / {total} tasks`,"gantt.resource.header":`Resource`,"gantt.resource.peak":`Peak`,"gantt.resource.over":`overloaded`,"gantt.resource.empty":`No tasks to allocate.`,"gantt.readOnly":`Read-only`,"gantt.readOnlyHint":`Editing is disabled for this view.`,"gantt.lockedHint":`No edit permission`,"gantt.writeFailed":`Save failed — the change was rolled back`},Ct=new Intl.PluralRules(`en`);function wt(e,t){let n=t?.count,r=(typeof n==`number`&&Number.isFinite(n)?St[`${e}_${Ct.select(n)}`]:void 0)||St[e]||e;if(t)for(let[e,n]of Object.entries(t))r=r.split(`{{${e}}}`).join(String(n));return r}function Tt(){let e=O();return{t:(t,n)=>{let r=e.t(t,n);return typeof r==`string`&&r!==t?r:wt(t,n)},language:e.language}}var V=n(),Et=8;function Dt(e,t){if(t.width<=0)return`move`;let n=Math.min(Et,t.width/3),r=e-t.left;return r<=n?`resize-left`:r>=t.width-n?`resize-right`:`move`}var Ot=110,kt=160,H=.375,At=320,jt=560;function Mt(e){return e<640?140:e<1024?220:Math.round(Math.min(jt,Math.max(At,e*H)))}var U=412;function Nt(e){return e>=U}function Pt(e){return e<640?32:40}var Ft=[`day`,`week`,`month`,`quarter`,`year`],It={day:1,week:7,month:30.44,quarter:91.31,year:365.25},Lt=864e5;function Rt(e,t){let n=new Date(e);return n.setHours(0,0,0,0),t===`week`?n.setDate(n.getDate()-(n.getDay()+6)%7):t===`month`?n.setDate(1):t===`quarter`?n.setMonth(Math.floor(n.getMonth()/3)*3,1):t===`year`&&n.setMonth(0,1),n}function zt(e,t,n){let r=e.length-1,i=0;for(;i<r&&e[i+1]<t;)i++;let a=i;for(;a<r&&e[a]<n;)a++;return{start:i,end:a}}function W(e,t,n){let r=new Date(e);if(n===`day`)r.setDate(r.getDate()+t);else if(n===`week`)r.setDate(r.getDate()+t*7);else{let e=t*(n===`month`?1:n===`quarter`?3:12),i=r.getDate();r.setDate(1),r.setMonth(r.getMonth()+e);let a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();r.setDate(Math.min(i,a))}return r}function Bt(e,t){return(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())-Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))/Lt}function Vt(e,t,n){if(n){let n=t.getTime()-e.getTime();return e=>new Date(e.getTime()+n)}let r=Bt(e,t);return e=>W(e,r,`day`)}function Ht(e,t){return t.getTime()>e.getTime()?ue(t):t}function Ut(e,t){return t.end.getTime()>t.start.getTime()?de(e):_e(e)}function Wt(e,t){return t?`shiftDay`:e===`year`?`decade`:e===`month`||e===`quarter`?`year`:`month`}function Gt(e,t,n=0){if(t===`shiftDay`)return mt(e,n);let r=new Date(e);return r.setHours(0,0,0,0),t===`month`?r.setDate(1):t===`year`?r.setMonth(0,1):(r.setMonth(0,1),r.setFullYear(Math.floor(r.getFullYear()/10)*10)),r}function Kt(e,t,n){return n===`shiftDay`?W(e,t,`day`):n===`month`?W(e,t,`month`):W(e,t*(n===`decade`?10:1),`year`)}function qt(e,t,n){return t===`decade`?`${Math.floor(e.getFullYear()/10)*10}s`:t===`year`?String(e.getFullYear()):t===`shiftDay`?e.toLocaleDateString(n,{year:`numeric`,month:`long`,day:`numeric`}):e.toLocaleDateString(n,{month:`long`,year:`numeric`})}function Jt(e,t,n,r=2){return new Promise(i=>{let a=new Blob([e],{type:`image/svg+xml;charset=utf-8`}),o=URL.createObjectURL(a),s=new Image;s.onload=()=>{let e=document.createElement(`canvas`);e.width=t*r,e.height=n*r;let a=e.getContext(`2d`);a&&(a.fillStyle=`#ffffff`,a.fillRect(0,0,e.width,e.height),a.scale(r,r),a.drawImage(s,0,0)),URL.revokeObjectURL(o),i(e)},s.onerror=()=>{URL.revokeObjectURL(o),i(null)},s.src=o})}function Yt(e,t){let n=document.createElement(`a`);n.href=URL.createObjectURL(e),n.download=t,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(n.href),1e3)}function Xt(e,t,n){let r=e=>{let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t},i=`q ${t} 0 0 ${n} 0 0 cm /Im0 Do Q`,a=[],o=[],s=0,c=e=>{a.push(e),s+=e.length},l=()=>{o.push(s)};c(r(`%PDF-1.3
2
+ %ÿÿÿÿ
3
+ `)),l(),c(r(`1 0 obj
4
+ << /Type /Catalog /Pages 2 0 R >>
5
+ endobj
6
+ `)),l(),c(r(`2 0 obj
7
+ << /Type /Pages /Kids [3 0 R] /Count 1 >>
8
+ endobj
9
+ `)),l(),c(r(`3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${t} ${n}] /Resources << /XObject << /Im0 4 0 R >> >> /Contents 5 0 R >>\nendobj\n`)),l(),c(r(`4 0 obj\n<< /Type /XObject /Subtype /Image /Width ${t} /Height ${n} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length ${e.length} >>\nstream\n`)),c(e),c(r(`
10
+ endstream
11
+ endobj
12
+ `)),l(),c(r(`5 0 obj\n<< /Length ${i.length} >>\nstream\n${i}\nendstream\nendobj\n`));let u=s,d=`xref
13
+ 0 6
14
+ 0000000000 65535 f
15
+ `;for(let e of o)d+=`${String(e).padStart(10,`0`)} 00000 n \n`;return d+=`trailer\n<< /Size 6 /Root 1 0 R >>\nstartxref\n${u}\n%%EOF\n`,c(r(d)),new Blob(a,{type:`application/pdf`})}function Zt(e){let t=e.slice(e.indexOf(`,`)+1),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}var G=`gantt-layout:`;function Qt(e){if(!e||typeof window>`u`)return null;try{let t=window.localStorage.getItem(G+e);if(!t)return null;let n=JSON.parse(t),r=n.viewMode&&Ft.includes(n.viewMode)?n.viewMode:null;if(!r)return null;let i=typeof n.columnWidth==`number`&&isFinite(n.columnWidth)?n.columnWidth:null,a=typeof n.taskListWidth==`number`&&isFinite(n.taskListWidth)?n.taskListWidth:null,o=Array.isArray(n.collapsedIds)?n.collapsedIds.filter(e=>typeof e==`string`):void 0;return{viewMode:r,columnWidth:i,taskListCollapsed:!!n.taskListCollapsed,taskListWidth:a,collapsedIds:o}}catch{return null}}function $t(e,t){if(!(typeof window>`u`))try{window.localStorage.setItem(G+e,JSON.stringify(t))}catch{}}function en({tasks:e,viewMode:t,startDate:n,endDate:r,markers:i,onTaskClick:a,onTaskUpdate:o,onTaskDelete:s,onViewChange:c,onDependencyCreate:u,onBeforeDependencyCreate:d,onDependencyDelete:f,onTaskReorder:p,className:h,inlineEdit:g=!1,autoSchedule:ee=!1,rescheduleOnConflict:_=!1,criticalPathDefault:te=!1,workingCalendar:v,shiftSegments:y,showBaselines:ne=!0,readOnly:re=!1,mobileReadOnly:ie=!1,groupBy:ae,ungroupedLabel:oe=`Ungrouped`,defaultCollapsedDepth:se,summaryExtent:ce=`children`,persistLayoutKey:x,onLayoutChange:le,onRefresh:ue,refreshing:de=!1,dependencyTypes:fe=!0,timeZone:pe,exportFileName:me,interactions:he,onBeforeTaskUpdate:ge}){let S=N.useMemo(()=>_t(pe),[pe]),C=N.useMemo(()=>S.delta===0?e:e.map(e=>({...e,start:S.to(e.start),end:S.to(e.end),baselineStart:e.baselineStart?S.to(e.baselineStart):e.baselineStart,baselineEnd:e.baselineEnd?S.to(e.baselineEnd):e.baselineEnd})),[e,S]),ve=N.useMemo(()=>n&&S.delta!==0?S.to(n):n,[n,S]),ye=N.useMemo(()=>r&&S.delta!==0?S.to(r):r,[r,S]),be=N.useMemo(()=>!i||S.delta===0?i:i.map(e=>typeof e.date==`string`&&Ae(e.date)?{...e,date:_e(e.date)}:{...e,date:S.to(_e(e.date))}),[i,S]),{t:w}=Tt(),T=Pe(),Se=N.useRef(null),{width:Ce}=b(Se),we=Ce||(typeof window<`u`?window.innerWidth:1024),Te=we<640,Ee=re||ie&&Te,De=he?.move!==!1,Oe=he?.resize!==!1,ke=he?.progress!==!1,je=he?.link!==!1,E=N.useMemo(()=>{if(!Ee&&o)return S.delta===0?o:(e,t)=>{let n={...t};n.start instanceof Date&&(n.start=S.from(n.start)),n.end instanceof Date&&(n.end=S.from(n.end)),o(e,n)}},[Ee,o,S]),Me=Ee?void 0:s,D=Ee||!je?void 0:u,Ne=Ee||!je?void 0:f,O=Ee?void 0:p,Ze=!Ee&&g,Qe=!Ee&&ee,$e=!Ee&&_,P=Pt(we),et=N.useRef(void 0);et.current===void 0&&(et.current=Qt(x));let F=et.current,[I,tt]=N.useState(F?F.columnWidth:null),[nt,rt]=N.useState(F?F.taskListWidth??null:null),[L,it]=N.useState(t&&Ft.includes(t)?t:F?.viewMode??`day`);N.useEffect(()=>{t&&Ft.includes(t)&&it(t)},[t]);let R=N.useRef(null),at=N.useRef(null),ot=N.useRef(!0),[st,z]=N.useState(F?F.taskListCollapsed:!1),dt=N.useRef(!1);N.useEffect(()=>{!dt.current&&Te&&(z(!0),dt.current=!0)},[Te]);let ft=Math.max(kt,we-200),B=st?0:nt==null?Mt(we):Math.max(kt,Math.min(nt,ft)),pt=N.useMemo(()=>{if(I!=null||ye||C.length===0)return null;let e=ve?new Date(ve):new Date(Math.min(...C.map(e=>e.start.getTime()))),t=new Date(Math.max(...C.map(e=>e.end.getTime())));ve||e.setDate(e.getDate()-7),t.setDate(t.getDate()+14),e=Rt(e,L),t.setHours(23,59,59,999);let n=Math.max(1,(t.getTime()-e.getTime())/Lt),r=Math.max(0,we-B);if(r<=0)return null;let i=r/n*It[L];if(i<=Ot)return null;let a=Math.min(i,r*.6);return a>Ot?a:null},[I,C,ve,ye,L,we,B]),ht=I??pt??Ot,gt=ht/It[L],vt=Nt(B),[yt,bt]=N.useState(null),[xt,St]=N.useState({}),[Ct,wt]=N.useState(null),H=N.useMemo(()=>{if(!ae)return C;let e=new Set;for(let t of C){let n=t.parent!=null&&t.parent!==``?String(t.parent):null;n&&e.add(n)}let t=new Map;for(let n of C){if(e.has(String(n.id)))continue;let r=ae(n),i=r?String(r.key):`__ungrouped__`,a=r?r.label:oe,o=t.get(i);o||(o={key:i,label:a,items:[]},t.set(i,o)),o.items.push(n)}let n=[];for(let e of t.values()){let t=`__group__${e.key}`,r=e.items[0];n.push({id:t,title:e.label,start:r.start,end:r.end,progress:0,type:`summary`,parent:null,data:{__group:!0}});for(let r of e.items)n.push({...r,parent:t})}return n},[ae,C,oe]),At=N.useMemo(()=>{let e=new Set(H.map(e=>String(e.id))),t=new Map;for(let n of H){let r=n.parent!=null&&n.parent!==``?String(n.parent):null;if(r&&r!==String(n.id)&&e.has(r)){let e=t.get(r);e?e.push(n):t.set(r,[n])}}return t},[H]),jt=N.useMemo(()=>{let e=new Map;for(let t of H)e.set(String(t.id),t);return e},[H]),U=N.useCallback(e=>{let t=[],n=new Set,r=e=>{for(let i of At.get(e)??[]){let e=String(i.id);n.has(e)||(n.add(e),t.push(i),r(e))}};return r(String(e)),t},[At]),[G,en]=N.useState(null),tn=N.useRef(null);N.useEffect(()=>{tn.current=G},[G]);let nn=N.useRef(!1),rn=N.useCallback(e=>{let t=L===`day`&&!!y&&y.bands.length>0,n=(e,t)=>ur.current?ur.current(e,t):W(e,t,`day`),r=new Date(e.originStart),i=new Date(e.originEnd);if(t&&y){let t=Math.min(...y.bands.map(e=>e.durMs));return e.mode===`move`?(r=n(e.originStart,e.unitDelta),i=new Date(e.originEnd.getTime()+(r.getTime()-e.originStart.getTime()))):e.mode===`resize-left`?(r=n(e.originStart,e.unitDelta),i.getTime()-r.getTime()<t&&(r=new Date(i.getTime()-t))):e.mode===`resize-right`&&(i=n(e.originEnd,e.unitDelta),i.getTime()-r.getTime()<t&&(i=new Date(r.getTime()+t))),{start:r,end:i}}let a=t=>Bt(t,n(t,e.unitDelta));if(e.mode===`move`){let t=a(e.originStart);r=W(e.originStart,t,`day`),i=W(e.originEnd,t,`day`)}else if(e.mode===`resize-left`){r=W(e.originStart,a(e.originStart),`day`);let t=W(i,-1,`day`);r.getTime()>t.getTime()&&(r=t)}else if(e.mode===`resize-right`){i=W(e.originEnd,a(e.originEnd),`day`);let t=W(r,1,`day`);i.getTime()<t.getTime()&&(i=t)}return{start:r,end:i}},[L,y]),an=e=>{let t=rn(e);return Ht(t.start,t.end)},on=N.useRef(C);on.current=C;let sn=N.useRef([]),cn=N.useRef([]),[ln,un]=N.useState(0),dn=N.useCallback(e=>{if(!E)return;let t=e.filter(e=>!e.task.locked);(async()=>{let e=t;if(ge){let n=[];for(let e of t){let t;try{t=await ge(e.task,e.changes)!==!1}catch{t=!1}t&&n.push(e)}e=n}let n=[];for(let{task:t,changes:r}of e){let e={},i={},a=!1;for(let n of Object.keys(r)){let o=r[n],s=t[n],c=o instanceof Date&&s instanceof Date?o.getTime()===s.getTime():o===s;e[n]=s,i[n]=o,c||(a=!0)}E(t,r),a&&n.push({taskId:String(t.id),before:e,after:i})}n.length&&(sn.current.push(n),cn.current=[],un(e=>e+1))})()},[E,ge]),[fn,pn]=N.useState(null),mn=N.useCallback(e=>{if(!y)return e;let t=new Date(e);t.setHours(0,0,0,0);for(let n=-1;n<=1;n++){let r=t.getTime()+n*Lt+y.dayStartMin*6e4;for(let t of y.bands){if(r>=e)return r;r+=t.durMs}}return e},[y]),hn=N.useMemo(()=>({summaryExtent:ce,snapStart:y?mn:void 0}),[ce,y,mn]),gn=N.useCallback(e=>{if(!$e)return;let t=new Map;for(let{task:n,changes:r}of e)t.set(String(n.id),{start:r.start??n.start,end:r.end??n.end});let{changes:n}=lt(on.current.map(e=>{let n=t.get(String(e.id));return n?{...e,start:n.start,end:n.end}:e}),v,hn),r=n.filter(e=>{let n=t.get(e.id);return!n||e.start.getTime()!==n.start.getTime()||e.end.getTime()!==n.end.getTime()});r.length&&pn(r)},[$e,v,hn]),_n=N.useCallback(()=>{if(!fn)return;let e=fn.map(e=>{let t=on.current.find(t=>String(t.id)===e.id);return t?{task:t,changes:{start:e.start,end:e.end}}:null}).filter(Boolean);e.length&&dn(e),pn(null)},[fn,dn]),vn=N.useCallback((e,t)=>{if(E)for(let n of e){let e=on.current.find(e=>String(e.id)===n.taskId);e&&E(e,t===`undo`?n.before:n.after)}},[E]),yn=N.useCallback(()=>{let e=sn.current.pop();e&&(vn(e,`undo`),cn.current.push(e),un(e=>e+1))},[vn]),bn=N.useCallback(()=>{let e=cn.current.pop();e&&(vn(e,`redo`),sn.current.push(e),un(e=>e+1))},[vn]),{canUndo:xn,canRedo:Sn}=N.useMemo(()=>({canUndo:sn.current.length>0,canRedo:cn.current.length>0}),[ln]);N.useEffect(()=>{if(!G)return;let e=L===`day`&&!!y&&y.bands.length>0,t=e&&y?gt*Math.min(...y.bands.map(e=>e.durMs))/Lt:gt,n=e=>{let n=tn.current;if(!n)return;let r=Math.round((e.clientX-n.originClientX)/Math.max(t,1));r!==n.unitDelta&&en({...n,unitDelta:r})},r=()=>{let t=tn.current;if(t){if(t.unitDelta!==0){let n=C.find(e=>e.id===t.taskId);if(n&&E){let{start:r,end:i}=rn(t);if(t.group){let i=Vt(t.originStart,r,e),a=[n,...U(n.id).filter(e=>!e.locked)].map(e=>({task:e,changes:{start:i(e.start),end:i(e.end)}}));dn(a),gn(a)}else{let e=[{task:n,changes:{start:r,end:i}}];dn(e),gn(e)}}nn.current=!0,window.setTimeout(()=>{nn.current=!1},0)}en(null)}};return window.addEventListener(`pointermove`,n),window.addEventListener(`pointerup`,r),window.addEventListener(`pointercancel`,r),()=>{window.removeEventListener(`pointermove`,n),window.removeEventListener(`pointerup`,r),window.removeEventListener(`pointercancel`,r)}},[G,ht,gt,L,y,C,E,rn,U,dn,gn]);let Cn=N.useCallback((e,t,n,r)=>{!E||e.data?.__group||e.locked||(n.stopPropagation(),n.preventDefault(),en({taskId:e.id,mode:t,group:r?.group??!1,originStart:new Date(r?.originStart??e.start),originEnd:new Date(r?.originEnd??e.end),originClientX:n.clientX,unitDelta:0}))},[E]),[wn,Tn]=N.useState(null),En=N.useRef(null);N.useEffect(()=>{En.current=wn},[wn]),N.useEffect(()=>{if(!wn)return;let e=e=>{let t=En.current;if(!t)return;let n=Math.min(100,Math.max(0,Math.round(t.originProgress+(e.clientX-t.originClientX)/Math.max(t.barWidth,1)*100)));n!==t.value&&Tn({...t,value:n})},t=()=>{let e=En.current;if(e){if(e.value!==e.originProgress){let t=C.find(t=>t.id===e.taskId);t&&E&&dn([{task:t,changes:{progress:e.value}}]),nn.current=!0,window.setTimeout(()=>{nn.current=!1},0)}Tn(null)}};return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[wn,C,E,dn]);let Dn=N.useMemo(()=>{let e=[];for(let t of C)for(let n of t.dependencies??[]){let r=typeof n==`object`&&n?n.id:n;r!=null&&r!==``&&e.push([String(r),String(t.id)])}return e},[C]),On=N.useCallback((e,t)=>String(t.id)===String(e)?`self`:t.locked?`locked`:t.type===`group`?`group`:ut(Dn,e,t.id)?`cycle`:null,[Dn]),kn=N.useCallback((e,t)=>On(e,t)===null,[On]),An=N.useRef(null),[K,jn]=N.useState(null),Mn=N.useRef(null);N.useEffect(()=>{Mn.current=K},[K]),N.useEffect(()=>{if(!K)return;let e=e=>{let t=An.current?.getBoundingClientRect();if(!t)return;let n=e.clientX-t.left,r=e.clientY-t.top;jn(e=>e&&{...e,x:n,y:r})},t=()=>{let e=Mn.current;if(e&&e.targetId!=null&&D){let t=C.find(t=>String(t.id)===String(e.sourceId)),n=C.find(t=>String(t.id)===String(e.targetId)),r=e.targetEnd??`start`,i=fe?`${e.sourceEnd===`end`?`f`:`s`}${r===`end`?`f`:`s`}`:`fs`;t&&n&&kn(e.sourceId,n)&&(d?.(t,n,i)??!0)&&D(t,n,i)}else e&&e.rejectedReason&&D&&Fe.error(w(`gantt.link.rejected.${e.rejectedReason}`));nn.current=!0,window.setTimeout(()=>{nn.current=!1},0),jn(null)};return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[K,C,D,d,kn,fe,w]);let[Nn,Pn]=N.useState(null),Fn=N.useRef(null);N.useEffect(()=>{if(!Nn)return;let e=e=>{Fn.current&&e.target instanceof Node&&Fn.current.contains(e.target)||Pn(null)},t=e=>{e.key===`Escape`&&Pn(null)};return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`keydown`,t)}},[Nn]);let[In,Ln]=N.useState(null),Rn=N.useRef(null);N.useEffect(()=>{if(!In)return;let e=e=>{Rn.current&&e.target instanceof Node&&Rn.current.contains(e.target)||Ln(null)},t=e=>{e.key===`Escape`&&Ln(null)};return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`keydown`,t)}},[In]);let[zn,Bn]=N.useState(null),[Vn,Hn]=N.useState(``),Un=N.useRef(null);N.useEffect(()=>{if(!zn)return;let e=e=>{Un.current&&e.target instanceof Node&&Un.current.contains(e.target)||Bn(null)},t=e=>{e.key===`Escape`&&Bn(null)};return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`keydown`,t)}},[zn]);let[Wn,Gn]=N.useState(null),Kn=!!(a||E||D||Me),qn=N.useCallback((e,t)=>{t.preventDefault(),t.stopPropagation(),Gn(e.id),Kn&&Pn({x:t.clientX,y:t.clientY,taskId:e.id})},[Kn]),Jn=N.useCallback((e,t,n,r)=>{r.preventDefault(),r.stopPropagation(),(D||Ne)&&Ln({x:r.clientX,y:r.clientY,sourceId:e,targetId:t,type:n})},[D,Ne]),[Yn,Xn]=N.useState(()=>new Set(F?.collapsedIds??[])),Zn=N.useCallback(e=>{Xn(t=>{let n=new Set(t),r=String(e);return n.has(r)?n.delete(r):n.add(r),n})},[]),Qn=N.useRef(F?.collapsedIds!=null);N.useEffect(()=>{if(Qn.current||se==null||H.length===0)return;Qn.current=!0;let e=new Map(H.map(e=>[String(e.id),e])),t=new Set;for(let n of H){let r=n.parent!=null&&n.parent!==``?String(n.parent):null;r&&r!==String(n.id)&&e.has(r)&&t.add(r)}let n=t=>{let n=0,r=new Set([String(t.id)]),i=t.parent!=null&&t.parent!==``?e.get(String(t.parent)):void 0;for(;i&&!r.has(String(i.id));)n+=1,r.add(String(i.id)),i=i.parent!=null&&i.parent!==``?e.get(String(i.parent)):void 0;return n},r=new Set;for(let e of H){let i=String(e.id);t.has(i)&&n(e)>=se&&r.add(i)}r.size&&Xn(e=>e.size?e:r)},[se,H]);let q=N.useMemo(()=>{let e=new Set(H.map(e=>String(e.id))),t=new Map,n=[];for(let r of H){let i=r.parent!=null&&r.parent!==``?String(r.parent):null;if(i&&i!==String(r.id)&&e.has(i)){let e=t.get(i);e?e.push(r):t.set(i,[r])}else n.push(r)}let r=new Map,i=(e,n)=>{let a=String(e.id),o=r.get(a);if(o)return o;let s=t.get(a)??[],c;if(!s.length||n.has(a))c={start:e.start,end:e.end,progress:e.progress};else{n.add(a);let e=null,t=null,r=0,o=0;for(let a of s){let s=i(a,n);(!e||s.start<e)&&(e=s.start),(!t||s.end>t)&&(t=s.end);let c=Math.max(s.end.getTime()-s.start.getTime(),Lt);r+=c*s.progress,o+=c}n.delete(a),c={start:e,end:t,progress:o?r/o:0}}return r.set(a,c),c},a=[],o=new Set,s=e=>{for(let n of t.get(String(e.id))??[])o.has(String(n.id))||(o.add(String(n.id)),s(n))},c=(e,n)=>{let r=String(e.id);if(o.has(r))return;o.add(r);let l=t.get(r)??[],u=l.length>0,d=u||e.type===`summary`,f=u&&ce===`self`&&e.hasOwnDates!==!1,p=u&&!f?i(e,new Set):{start:e.start,end:e.end,progress:e.progress},m=!d&&(e.type===`milestone`||e.end.getTime()<=e.start.getTime());if(a.push({task:e,depth:n,hasChildren:u,isSummary:d,isMilestone:m,...p}),u){if(Yn.has(r))s(e);else for(let e of l)c(e,n+1)}};for(let e of n)c(e,0);for(let e of H)o.has(String(e.id))||c(e,0);return a},[H,Yn,ce]),$n=N.useCallback(e=>{if(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)return;if((e.ctrlKey||e.metaKey)&&(e.key===`z`||e.key===`Z`)){e.preventDefault(),e.shiftKey?bn():yn();return}if((e.ctrlKey||e.metaKey)&&(e.key===`y`||e.key===`Y`)){e.preventDefault(),bn();return}if(!q.length)return;let t=Wn==null?-1:q.findIndex(e=>String(e.task.id)===String(Wn));if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let n=e.key===`ArrowDown`?Math.min(q.length-1,t+1):Math.max(0,t<=0?0:t-1);Gn(q[n].task.id);let r=Q.current;if(r){let e=n*P;e<r.scrollTop?r.scrollTop=e:e+P>r.scrollTop+r.clientHeight&&(r.scrollTop=e+P-r.clientHeight)}return}if(t<0)return;let n=q[t];e.key===`Enter`?(e.preventDefault(),a?.(n.task)):e.key===`Delete`||e.key===`Backspace`?Me&&(e.preventDefault(),Me(n.task)):(e.key===`ArrowRight`&&n.hasChildren&&Yn.has(String(n.task.id))||e.key===`ArrowLeft`&&n.hasChildren&&!Yn.has(String(n.task.id)))&&(e.preventDefault(),Zn(n.task.id))},[q,Wn,a,Me,Yn,Zn,P,yn,bn]),J=N.useMemo(()=>{let e=ve?new Date(ve):S.now(),t=ye?new Date(ye):S.now();return!ve&&C.length>0&&(e=new Date(Math.min(...C.map(e=>e.start.getTime()))),e.setDate(e.getDate()-7)),!ye&&C.length>0&&(t=new Date(Math.max(...C.map(e=>e.end.getTime()))),t.setDate(t.getDate()+14)),e=L===`day`&&y&&y.bands.length>0?mt(e,y.dayStartMin):Rt(e,L),t.setHours(23,59,59,999),{start:e,end:t}},[ve,ye,C,L,y,S]),er=L===`day`&&!!y&&y.bands.length>0,tr=!er&&L===`day`&&!!v&&(!!v.skipWeekends||!!(v.holidays&&v.holidays.size)),nr=N.useCallback(e=>{if(!v)return!0;if(v.skipWeekends){let t=e.getDay();if(t===0||t===6)return!1}if(v.holidays&&v.holidays.size){let t=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`;if(v.holidays.has(t))return!1}return!0},[v]),Y=N.useMemo(()=>{let e=[];if(er&&y){let t=new Date(J.start);for(;t<=J.end;)for(let n of y.bands){let r=n.durMs/Lt*gt;e.push({date:new Date(t),label:n.label,isWeekend:!1,width:r,realMs:n.durMs,bandColor:n.color}),t=new Date(t.getTime()+n.durMs)}return e}let t=new Date(J.start);for(;t<=J.end;){let n=W(t,1,L);if(tr&&!nr(t)){t=n;continue}let r=(n.getTime()-t.getTime())/Lt*gt,i,a;L===`day`?(i=String(t.getDate()),a=t.toLocaleDateString(T,{weekday:`narrow`})):i=L===`week`?t.toLocaleDateString(T,{month:`numeric`,day:`numeric`}):L===`month`?t.toLocaleDateString(T,{month:`short`}):L===`quarter`?`Q${Math.floor(t.getMonth()/3)+1}`:String(t.getFullYear()),e.push({date:new Date(t),label:i,sublabel:a,isWeekend:L===`day`&&(t.getDay()===0||t.getDay()===6),width:r}),t=n}return e},[J,L,gt,T,tr,nr,er,y]),X=N.useMemo(()=>{let e=Array(Y.length+1),t=0;for(let n=0;n<Y.length;n++)e[n]=t,t+=Y[n].width;return e[Y.length]=t,e},[Y]),rr=X[X.length-1],ir=N.useMemo(()=>Y.map(e=>e.date.getTime()),[Y]),ar=N.useMemo(()=>Y.map(e=>e.realMs==null?W(e.date,1,L).getTime()-e.date.getTime():e.realMs),[Y,L]),Z=N.useCallback(e=>{let t=Y.length;if(t===0)return 0;let n=e.getTime(),r=0,i=t-1,a=0;for(;r<=i;){let e=r+i>>1;ir[e]<=n?(a=e,r=e+1):i=e-1}let o=ar[a]||864e5,s=(n-ir[a])/o;return(tr||er)&&(s=Math.max(0,Math.min(s,1))),X[a]+s*Y[a].width},[Y,ir,ar,X,tr,er]),or=N.useCallback(e=>{let t=Y.length;if(t===0)return-1;let n=0,r=t-1,i=0;for(;n<=r;){let t=n+r>>1;X[t]<=e?(i=t,n=t+1):r=t-1}return i},[Y,X]),sr=N.useCallback(e=>{let t=or(e);if(t<0)return new Date(J.start);let n=Y[t].width||1,r=(e-X[t])/n;return new Date(ir[t]+r*(ar[t]||864e5))},[or,Y,ir,ar,X,J]),cr=N.useCallback(e=>{let t=Q.current;at.current==null&&t&&t.clientWidth>0&&(at.current=sr(t.scrollLeft)),R.current=at.current,ot.current=!0,it(e),c?.(e)},[c,sr]);N.useLayoutEffect(()=>{let e=R.current;if(e==null)return;R.current=null;let t=Q.current;if(!t||t.clientWidth===0)return;let n=Math.max(0,t.scrollWidth-t.clientWidth),r=Math.max(0,Math.min(Math.round(Z(Rt(e,L))),n));t.scrollLeft!==r&&(t.scrollLeft=r)},[L,Z]);let lr=N.useCallback((e,t)=>{let n=Y.length;if(n===0||t===0)return new Date(e);let r=e.getTime(),i=0,a=n-1,o=0;for(;i<=a;){let e=i+a>>1;ir[e]<=r?(o=e,i=e+1):a=e-1}let s=Math.min(n-1,Math.max(0,o+t)),c=r-ir[o];return new Date(ir[s]+c)},[Y,ir]),ur=N.useRef(null);ur.current=tr||er?lr:null;let dr=N.useMemo(()=>{let e=[];if(er&&y){let t=0;for(let n of Y){let r=String(mt(n.date,y.dayStartMin).getTime()),i=e[e.length-1];i&&i.key===r?i.width+=n.width:e.push({key:r,label:n.date.toLocaleDateString(T,{month:`short`,day:`numeric`}),width:n.width,offset:t}),t+=n.width}return e}let t=L===`year`?`decade`:L===`month`||L===`quarter`?`year`:`month`,n=0;for(let r of Y){let i=r.date.getFullYear(),a=Math.floor(i/10)*10,o=t===`decade`?String(a):t===`year`?String(i):`${i}-${r.date.getMonth()}`,s=e[e.length-1];s&&s.key===o?s.width+=r.width:e.push({key:o,label:t===`decade`?`${a}s`:t===`year`?String(i):r.date.toLocaleDateString(T,{month:`short`,year:`numeric`}),width:r.width,offset:n}),n+=r.width}return e},[Y,L,T,er,y]),fr=N.useMemo(()=>(be??[]).map((e,t)=>{let n=_e(e.date);return{index:t,label:e.label,color:e.color||`hsl(var(--primary))`,left:Math.round(Z(n)),valid:!isNaN(n.getTime())&&n>=J.start&&n<=J.end}}).filter(e=>e.valid),[be,J,Z]),pr=N.useRef(null),mr=N.useRef(null),hr=N.useRef(null),Q=N.useRef(null);N.useEffect(()=>{let e=Q.current;if(!e)return;let t=()=>{ot.current=!1},n=new Set([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),r=e=>{n.has(e.key)&&t()};return e.addEventListener(`wheel`,t,{passive:!0}),e.addEventListener(`touchstart`,t,{passive:!0}),e.addEventListener(`pointerdown`,t,{passive:!0}),e.addEventListener(`keydown`,r),()=>{e.removeEventListener(`wheel`,t),e.removeEventListener(`touchstart`,t),e.removeEventListener(`pointerdown`,t),e.removeEventListener(`keydown`,r)}},[]);let[gr,_r]=N.useState(null),vr=N.useRef([]),yr=N.useRef(null),[br,xr]=N.useState({top:0,left:0}),[Sr,Cr]=N.useState({width:4e3,height:600}),wr=N.useCallback(()=>{let e=Q.current;if(!e)return;let t=e.clientWidth||4e3,n=e.clientHeight||600;Cr(e=>e.width===t&&e.height===n?e:{width:t,height:n})},[]);N.useLayoutEffect(()=>{wr();let e=Q.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(wr);return t.observe(e),()=>t.disconnect()},[wr]);let Tr=N.useMemo(()=>zt(X,br.left-240,br.left+Sr.width+240),[X,br.left,Sr.width]),Er=N.useMemo(()=>{let e=dr.map(e=>e.offset);return e.push(rr),e},[dr,rr]),Dr=N.useMemo(()=>zt(Er,br.left-240,br.left+Sr.width+240),[Er,br.left,Sr.width]),$=N.useMemo(()=>({startIdx:Math.max(0,Math.floor(br.top/P)-6),endIdx:Math.min(q.length,Math.ceil((br.top+Sr.height)/P)+6)}),[br.top,Sr.height,P,q.length]),Or=q.length*P,kr=Wt(L,er),Ar=N.useMemo(()=>{let e=or(br.left);return Gt(e>=0?Y[e].date:J.start,kr,y?.dayStartMin??0)},[or,br.left,Y,J,kr,y]),jr=N.useMemo(()=>qt(Ar,kr,T),[Ar,kr,T]),Mr=N.useCallback(e=>{let t=Q.current;if(!t)return;let n=Kt(Ar,e,kr),r=Math.max(0,rr-Sr.width),i=Math.max(0,Math.min(Math.round(Z(n)),r));t.scrollLeft=i,xr(e=>e.left===i?e:{...e,left:i})},[Ar,kr,rr,Sr.width,Z]),[Nr,Pr]=N.useState(!1);N.useEffect(()=>{let e=()=>Pr(!!document.fullscreenElement);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]);let Fr=N.useCallback(()=>{let e=Se.current;e&&(document.fullscreenElement?document.exitFullscreen?.():e.requestFullscreen?.())},[]),Ir=N.useRef(null),Lr=N.useCallback(e=>{if(e.touches.length===2){let t=e.touches[0].clientX-e.touches[1].clientX,n=e.touches[0].clientY-e.touches[1].clientY;Ir.current={baseDistance:Math.max(1,Math.sqrt(t*t+n*n)),baseColumn:ht}}},[ht]),Rr=N.useCallback(e=>{if(e.touches.length!==2||!Ir.current)return;let t=e.touches[0].clientX-e.touches[1].clientX,n=e.touches[0].clientY-e.touches[1].clientY,r=Math.max(1,Math.sqrt(t*t+n*n))/Ir.current.baseDistance,i=Math.max(15,Math.min(120,Math.round(Ir.current.baseColumn*r)));tt(i)},[]),zr=N.useCallback(()=>{Ir.current=null},[]),Br=N.useMemo(()=>{let e=S.now();return e<J.start||e>J.end?null:Math.round(Z(e))},[J,Z,S]),Vr=N.useCallback(()=>{if(Br==null||!Q.current)return;let e=Math.max(0,Br-Q.current.clientWidth/2);Q.current.scrollTo({left:e,behavior:`smooth`})},[Br]),Hr=N.useRef(!1);N.useEffect(()=>{if(Hr.current||C.length===0)return;let e=window.requestAnimationFrame(()=>{let e=Q.current;if(!e||e.clientWidth===0)return;let t=Br;if(t==null){let e=new Date(Math.min(...C.map(e=>e.start.getTime())));t=Math.round(Z(e))}e.scrollLeft=Math.max(0,t-e.clientWidth/2),Hr.current=!0});return()=>window.cancelAnimationFrame(e)},[C,Br,Z]);let Ur=N.useCallback((e,t=`left`)=>{let n=Q.current;if(!n||e<J.start||e>J.end)return!1;let r=Math.round(Z(e)),i=t===`center`?r-n.clientWidth/2:r-24;return n.scrollTo({left:Math.max(0,i),behavior:`smooth`}),!0},[J,Z]),Wr=N.useCallback((e,t,n)=>{let r=Q.current;if(!r)return;let i=Z(e),a=Z(t),o=Math.max(0,r.scrollWidth-r.clientWidth),s=Math.min(96,r.clientWidth*.15),c=a-i<=r.clientWidth-s?(i+a)/2-r.clientWidth/2:i-s,l=Math.max(0,Math.min(c,o));vr.current.forEach(e=>window.clearTimeout(e)),vr.current=[],yr.current?.(),yr.current=null,_r(null);let u=()=>{if(n==null)return;let e=window.requestAnimationFrame(()=>{_r(n),vr.current.push(window.setTimeout(()=>_r(e=>e===n?null:e),1500))});yr.current=()=>window.cancelAnimationFrame(e)},d=Math.abs(r.scrollLeft-l)>2;if(r.scrollTo({left:l,behavior:`smooth`}),!d){u();return}let f=`onscrollend`in r,p=!1,m=()=>{p||(p=!0,r.removeEventListener(`scrollend`,m),u())};r.addEventListener(`scrollend`,m),vr.current.push(window.setTimeout(m,f?1500:500)),yr.current=()=>r.removeEventListener(`scrollend`,m)},[Z]);N.useEffect(()=>()=>{vr.current.forEach(e=>window.clearTimeout(e)),yr.current?.()},[]);let Gr=N.useCallback(()=>Ur(Rt(S.now(),`week`)),[Ur,S]),Kr=N.useCallback(()=>Ur(Rt(S.now(),`month`)),[Ur,S]),qr=N.useRef(null),Jr=N.useRef(null),Yr=N.useRef(null),Xr=N.useRef(null),Zr=N.useRef(null),Qr=N.useRef(null),$r=N.useRef(null),ei=N.useRef(null),ti=N.useCallback(()=>{let e=hr.current,t=qr.current,n=Jr.current,r=Yr.current;if(e&&t&&n&&r){let i=e.scrollWidth>e.clientWidth+1;if(t.style.display=i?`block`:`none`,i){let t=n.clientWidth;if(t>0){let n=Math.min(t,Math.max(40,e.clientWidth/e.scrollWidth*t)),i=e.scrollWidth-e.clientWidth,a=i>0?e.scrollLeft/i*(t-n):0;r.style.width=`${n}px`,r.style.transform=`translateX(${a}px)`}}}let i=Zr.current,a=Qr.current,o=$r.current;if(e&&i&&a&&o){let t=e.scrollHeight>e.clientHeight+1;if(i.style.display=t?`block`:`none`,t){let t=a.clientHeight;if(t>0){let n=Math.min(t,Math.max(40,e.clientHeight/e.scrollHeight*t)),r=e.scrollHeight-e.clientHeight,i=r>0?e.scrollTop/r*(t-n):0;o.style.height=`${n}px`,o.style.transform=`translateY(${i}px)`}}}},[]);N.useEffect(()=>{ti()});let ni=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=hr.current,n=Jr.current,r=Yr.current;if(!t||!n||!r)return;Xr.current={startX:e.clientX,startLeft:t.scrollLeft};let i=n.clientWidth,a=r.getBoundingClientRect().width,o=t.scrollWidth-t.clientWidth,s=i-a>0?o/(i-a):0,c=e=>{let n=Xr.current;n&&(t.scrollLeft=n.startLeft+(e.clientX-n.startX)*s)},l=()=>{Xr.current=null,window.removeEventListener(`pointermove`,c),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l)};window.addEventListener(`pointermove`,c),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l)},ri=e=>{if(e.button!==0||e.target!==e.currentTarget)return;let t=hr.current,n=Jr.current,r=Yr.current;if(!t||!n||!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect().width,o=t.scrollWidth-t.clientWidth,s=i.width-a;s<=0||(t.scrollLeft=Math.min(Math.max(e.clientX-i.x-a/2,0),s)/s*o)},ii=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=hr.current,n=Qr.current,r=$r.current;if(!t||!n||!r)return;ei.current={startY:e.clientY,startTop:t.scrollTop};let i=n.clientHeight,a=r.getBoundingClientRect().height,o=t.scrollHeight-t.clientHeight,s=i-a>0?o/(i-a):0,c=e=>{let n=ei.current;n&&(t.scrollTop=n.startTop+(e.clientY-n.startY)*s)},l=()=>{ei.current=null,window.removeEventListener(`pointermove`,c),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l)};window.addEventListener(`pointermove`,c),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l)},ai=e=>{if(e.button!==0||e.target!==e.currentTarget)return;let t=hr.current,n=Qr.current,r=$r.current;if(!t||!n||!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect().height,o=t.scrollHeight-t.clientHeight,s=i.height-a;s<=0||(t.scrollTop=Math.min(Math.max(e.clientY-i.y-a/2,0),s)/s*o)},oi=e=>{let t=e.currentTarget;!ot.current&&t.clientWidth>0&&(at.current=sr(t.scrollLeft)),pr.current&&(pr.current.scrollLeft=t.scrollLeft),ti(),mr.current&&mr.current.scrollTop!==t.scrollTop&&(mr.current.scrollTop=t.scrollTop),xr(e=>e.top===t.scrollTop&&e.left===t.scrollLeft?e:{top:t.scrollTop,left:t.scrollLeft}),wr()},si=e=>{let t=e.currentTarget,n=Q.current;n&&n.scrollTop!==t.scrollTop&&(n.scrollTop=t.scrollTop),xr(e=>e.top===t.scrollTop?e:{...e,top:t.scrollTop})},ci=(e,t)=>{let n=Z(e),r=er&&y?gt*Math.min(...y.bands.map(e=>e.durMs))/Lt:gt;return{left:n,width:Math.max(Z(t)-n,r,3)}},li=G?.group?G.taskId:null,ui=N.useMemo(()=>{if(li==null)return null;let e=new Set([String(li)]);for(let t of U(li))t.locked||e.add(String(t.id));return e},[li,U]),di=N.useMemo(()=>{if(!G||G.group)return null;let e=new Set,t=new Set,n=jt.get(String(G.taskId));for(;n&&n.parent!=null&&n.parent!==``;){let r=String(n.parent);if(t.has(r)||!jt.has(r))break;t.add(r),e.add(r),n=jt.get(r)}return e.size?e:null},[G,jt]),fi=e=>{if(G){if(ui?.has(String(e.task.id))){let t=rn(G),n=Vt(G.originStart,t.start,er);return ci(n(e.start),n(e.end))}if(G.taskId===e.task.id&&!G.group){let e=rn(G);return ci(e.start,e.end)}if(e.isSummary&&di?.has(String(e.task.id))&&(ce!==`self`||e.task.hasOwnDates===!1)){let t=rn(G),n=String(G.taskId),r=null,i=null;for(let a of U(e.task.id)){if((At.get(String(a.id))??[]).length!==0)continue;let e=String(a.id)===n?t.start:a.start,o=String(a.id)===n?t.end:a.end;(!r||e<r)&&(r=e),(!i||o>i)&&(i=o)}if(r&&i)return ci(r,i)}}return ci(e.start,e.end)},pi=N.useMemo(()=>{let e=new Map;q.forEach((t,n)=>e.set(String(t.task.id),n));let t=[];return q.forEach(({task:n},r)=>{for(let i of n.dependencies??[]){let a=typeof i==`object`&&!!i,o=a?i.id:i;if(o==null||o===``)continue;let s=e.get(String(o));if(s==null||s===r)continue;let c=a?i.type:void 0,l=c===`ss`||c===`ff`||c===`sf`?c:`fs`;t.push({key:`${String(o)}->${String(n.id)}:${l}`,sourceId:o,targetId:n.id,type:l,sourceIndex:s,targetIndex:r})}}),t},[q]),mi=Math.max(2,Math.round(P/2)-14),hi=P-mi*2,gi=Math.round(hi/2),_i=Math.max(Math.round(P*.4),12),vi=_i*Math.SQRT2/2,yi=hi,bi=mi,xi=Math.max(3,Math.round(P*.13)),Si=P-xi-1,Ci=`rgba(100, 116, 139, 0.35)`,wi=`rgba(100, 116, 139, 0.6)`,Ti=e=>{let t=q[e.sourceIndex],n=q[e.targetIndex];if(!t||!n)return null;let r=fi(t),i=fi(n),a=e=>e.isSummary?bi+yi/2:P/2,o=e.sourceIndex*P+a(t),s=e.targetIndex*P+a(n),c=e.type===`fs`||e.type===`ff`,l=e.type===`ff`||e.type===`sf`,u=t.isMilestone?r.left+(c?vi:-vi):c?r.left+r.width:r.left,d=n.isMilestone?i.left+(l?vi:-vi):l?i.left+i.width:i.left,f=u+(c?10:-10),p=d+(l?10:-10),m=Math.round,h=[`M ${m(u)} ${m(o)}`,`L ${m(f)} ${m(o)}`];if(l?f>=p:f<=p)h.push(`L ${m(f)} ${m(s)}`,`L ${m(d)} ${m(s)}`);else{let t=s>=o?(e.sourceIndex+1)*P:e.sourceIndex*P;h.push(`L ${m(f)} ${m(t)}`,`L ${m(p)} ${m(t)}`,`L ${m(p)} ${m(s)}`,`L ${m(d)} ${m(s)}`)}return h.join(` `)},Ei=G?.taskId??Ct,[Di,Oi]=N.useState(te),ki=N.useMemo(()=>Di?ct(C,v):null,[Di,C,v]),Ai=N.useCallback(e=>ki?.criticalIds.has(String(e))??!1,[ki]),ji=`#dc2626`,[Mi,Ni]=N.useState(null),[Pi,Fi]=N.useState(!1);N.useEffect(()=>{if(!Pi)return;let e=setTimeout(()=>Fi(!1),2500);return()=>clearTimeout(e)},[Pi]);let Ii=N.useCallback(()=>{if(!E)return;let{changes:e,skippedLocked:t}=lt(C,v,hn);if(!e.length){Fi(!0);return}Ni({changes:e,skipped:t.length})},[C,E,v,hn]),Li=N.useCallback(()=>{if(!Mi)return;let e=[];for(let t of Mi.changes){let n=C.find(e=>String(e.id)===t.id);n&&e.push({task:n,changes:{start:t.start,end:t.end}})}e.length&&dn(e),Ni(null)},[Mi,C,dn]),Ri=N.useCallback(()=>{if(typeof document>`u`||!C.length)return null;let e=e=>String(e).replace(/[&<>"]/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`})[e]),t=Math.max(B,200),n=Math.ceil(t+rr),r=Math.ceil(36+q.length*P),i=ki?.criticalEdges??null,a=[];a.push(`<rect x="0" y="0" width="${n}" height="${r}" fill="#ffffff"/>`),a.push(`<rect x="0" y="0" width="${n}" height="36" fill="#f8fafc"/>`),a.push(`<g transform="translate(${t},0)" font-family="sans-serif" font-size="10" fill="#475569">`),dr.forEach(t=>{a.push(`<line x1="${t.offset.toFixed(1)}" y1="0" x2="${t.offset.toFixed(1)}" y2="36" stroke="#e2e8f0"/>`),a.push(`<text x="${(t.offset+t.width/2).toFixed(1)}" y="12" text-anchor="middle" font-weight="600">${e(t.label)}</text>`)}),Y.forEach((t,n)=>{let i=X[n];a.push(`<line x1="${i.toFixed(1)}" y1="18" x2="${i.toFixed(1)}" y2="${r}" stroke="#eef2f7"/>`),a.push(`<text x="${(i+t.width/2).toFixed(1)}" y="30" text-anchor="middle" fill="#1f2937">${e(t.label)}</text>`)}),a.push(`</g>`),a.push(`<line x1="0" y1="18" x2="${n}" y2="18" stroke="#e2e8f0"/>`),a.push(`<line x1="0" y1="36" x2="${n}" y2="36" stroke="#cbd5e1"/>`),a.push(`<line x1="${t}" y1="0" x2="${t}" y2="${r}" stroke="#cbd5e1"/>`),a.push(`<g transform="translate(0,36)" font-family="sans-serif" font-size="11" fill="#1f2937">`),q.forEach((n,r)=>{let i=r*P;a.push(`<line x1="0" y1="${(i+P).toFixed(1)}" x2="${t}" y2="${(i+P).toFixed(1)}" stroke="#f1f5f9"/>`);let o=8+n.depth*14,s=Math.max(4,Math.floor((t-o)/6.5)),c=n.task.title.length>s?n.task.title.slice(0,s-1)+`…`:n.task.title,l=n.isSummary?` font-weight="600"`:``;a.push(`<text x="${o}" y="${(i+P/2+4).toFixed(1)}"${l}>${e(c)}</text>`)}),a.push(`</g>`);let o=(e,t)=>{let n=t-12;if(n<=9)return``;let r=0,i=``;for(let t of e){let a=t.charCodeAt(0)>255?9:5.5;if(r+a>n)return i.length<e.length?`${i.slice(0,-1)}…`:i;r+=a,i+=t}return i};a.push(`<g transform="translate(${t},36)" font-family="sans-serif" font-size="9">`),q.forEach((t,n)=>{if(t.task.type===`group`)return;let r=n*P,{left:i,width:s}=ci(t.start,t.end),c=Ai(t.task.id),l=c?` stroke="${ji}" stroke-width="2"`:``;if(ne&&t.task.baselineStart&&t.task.baselineEnd){let e=ci(t.task.baselineStart,t.task.baselineEnd);a.push(`<rect x="${e.left.toFixed(1)}" y="${(r+Si).toFixed(1)}" width="${Math.max(2,e.width).toFixed(1)}" height="${xi}" rx="1" fill="${Ci}" stroke="${wi}"/>`)}if(t.isMilestone){let e=i,n=r+P/2,o=_i/2,s=c?ji:t.task.color||`#3b82f6`;a.push(`<polygon points="${e},${n-o} ${e+o},${n} ${e},${n+o} ${e-o},${n}" fill="${s}"/>`)}else if(t.isSummary){let n=t.task.color||`#64748b`;a.push(`<rect x="${i.toFixed(1)}" y="${(r+bi).toFixed(1)}" width="${s.toFixed(1)}" height="${yi}" rx="3" fill="${n}"${l}/>`);let c=s*Math.min(100,Math.max(0,t.progress))/100;a.push(`<rect x="${i.toFixed(1)}" y="${(r+bi).toFixed(1)}" width="${c.toFixed(1)}" height="${yi}" rx="3" fill="rgba(0,0,0,0.2)"/>`);let u=o(t.task.title,s);u&&a.push(`<text x="${(i+6).toFixed(1)}" y="${(r+P/2+3).toFixed(1)}" fill="#ffffff" font-weight="500">${e(u)}</text>`)}else{let n=t.task.color||`#3b82f6`;a.push(`<rect x="${i.toFixed(1)}" y="${(r+mi).toFixed(1)}" width="${s.toFixed(1)}" height="${hi}" rx="3" fill="${n}"${l}/>`);let c=s*Math.min(100,Math.max(0,t.progress))/100;a.push(`<rect x="${i.toFixed(1)}" y="${(r+mi).toFixed(1)}" width="${c.toFixed(1)}" height="${hi}" rx="3" fill="rgba(0,0,0,0.18)"/>`);let u=o(t.task.title,s);u?a.push(`<text x="${(i+6).toFixed(1)}" y="${(r+P/2+3).toFixed(1)}" fill="#ffffff" font-weight="500">${e(u)}</text>`):s>=24&&a.push(`<text x="${(i+s/2).toFixed(1)}" y="${(r+P/2+3).toFixed(1)}" text-anchor="middle" fill="#ffffff">${Math.round(t.progress)}%</text>`)}}),pi.forEach(e=>{let t=Ti(e);if(!t)return;let n=i?.has(`${String(e.sourceId)}->${String(e.targetId)}`)??!1,r=n?ji:`#94a3b8`;a.push(`<path d="${t}" fill="none" stroke="${r}" stroke-width="${n?2:1.5}"/>`)}),Br!=null&&a.push(`<line x1="${Br.toFixed(1)}" y1="0" x2="${Br.toFixed(1)}" y2="${q.length*P}" stroke="#ef4444" stroke-width="1.5"/>`);let s=q.length*P;return fr.forEach(t=>{let n=/var\(/.test(t.color)?`#6366f1`:t.color;if(a.push(`<line x1="${t.left.toFixed(1)}" y1="0" x2="${t.left.toFixed(1)}" y2="${s}" stroke="${e(n)}" stroke-width="1.5"/>`),t.label){let r=t.label.length*6+8;a.push(`<rect x="${(t.left-r/2).toFixed(1)}" y="0" width="${r}" height="14" rx="2" fill="${e(n)}"/>`),a.push(`<text x="${t.left.toFixed(1)}" y="10" text-anchor="middle" font-size="9" font-weight="600" fill="#ffffff">${e(t.label)}</text>`)}}),a.push(`</g>`),{svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${r}" viewBox="0 0 ${n} ${r}">${a.join(``)}</svg>`,W:n,H:r}},[C,q,pi,Ti,ci,Ai,ki,Y,X,rr,B,P,mi,hi,bi,yi,_i,Br,L,ne,Si,xi,Ci,wi,fr,dr]),zi=N.useCallback(()=>{let e=(me??``).replace(/[\\/:*?"<>|\s]+/g,` `).trim()||`gantt`,t=new Date,n=e=>String(e).padStart(2,`0`);return`${e}-${`${t.getFullYear()}${n(t.getMonth()+1)}${n(t.getDate())}-${n(t.getHours())}${n(t.getMinutes())}`}`},[me]),Bi=N.useCallback(async()=>{let e=Ri();if(!e)return;let t=await Jt(e.svg,e.W,e.H);t&&t.toBlob(e=>{e&&Yt(e,`${zi()}.png`)},`image/png`)},[Ri,zi]),Vi=N.useCallback(async()=>{let e=Ri();if(!e)return;let t=await Jt(e.svg,e.W,e.H);t&&Yt(Xt(Zt(t.toDataURL(`image/jpeg`,.92)),t.width,t.height),`${zi()}.pdf`)},[Ri,zi]),[Hi,Ui]=N.useState(!1),Wi=N.useCallback(()=>{let e={viewMode:L,columnWidth:I,taskListCollapsed:st,taskListWidth:nt,collapsedIds:Array.from(Yn)};x&&$t(x,e),le?.(e),Ui(!0)},[L,I,st,nt,Yn,x,le]);return N.useEffect(()=>{if(!Hi)return;let e=setTimeout(()=>Ui(!1),1500);return()=>clearTimeout(e)},[Hi]),(0,V.jsxs)(`div`,{ref:Se,className:l(`flex flex-col h-full bg-background overflow-hidden min-w-0`,h),"data-readonly":Ee?`true`:void 0,"data-mobile-readonly":ie&&Te?`true`:void 0,children:[(0,V.jsx)(`style`,{children:`
16
+ .gantt-resize-handle:hover { background-color: rgba(255, 255, 255, 0.4); }
17
+ .gantt-bar-hover:hover { filter: brightness(1.1); }
18
+ .gantt-row-open-btn { opacity: 0; transition: opacity 0.15s ease; }
19
+ /* :where keeps the row-hover reveal at zero specificity so the
20
+ button's own :hover/:focus-visible full-opacity rule can win. */
21
+ :where(.group\\/task-row:hover) .gantt-row-open-btn { opacity: 0.6; }
22
+ .gantt-row-open-btn:hover, .gantt-row-open-btn:focus-visible { opacity: 1; }
23
+ /* Locate flash: blink the located bar 3× with a thick ring + colored glow so
24
+ it's hard to miss. The ring is an outline (not box-shadow) and the glow
25
+ is a drop-shadow *filter* — both stay clear of the critical-path bar's
26
+ inline box-shadow, which they'd otherwise clobber. */
27
+ @keyframes gantt-flash {
28
+ 0%, 25%, 50%, 100% {
29
+ outline-color: rgba(37, 99, 235, 0);
30
+ filter: drop-shadow(0 0 0 rgba(37, 99, 235, 0));
31
+ }
32
+ 12%, 37%, 62% {
33
+ outline-color: rgba(37, 99, 235, 1);
34
+ filter: drop-shadow(0 0 9px rgba(37, 99, 235, 0.9));
35
+ }
36
+ }
37
+ .gantt-flash {
38
+ outline: 3px solid transparent;
39
+ outline-offset: 3px;
40
+ border-radius: 2px;
41
+ animation: gantt-flash 1.5s ease-in-out;
42
+ }
43
+ @media (min-width: 640px) {
44
+ .gantt-sm-h50 { height: 50px; }
45
+ .gantt-sm-w20 { width: 80px; }
46
+ }
47
+ /* The timeline's NATIVE scrollbars are fully hidden — both axes are
48
+ replaced by the self-drawn bars (horizontal at the bottom, vertical
49
+ on the right). Styling the native bar is a dead end: overlay-scrollbar
50
+ engines (macOS "show while scrolling", embedded Chromium) ignore
51
+ ::-webkit-scrollbar theming yet still flash their own auto-hiding bar
52
+ on scroll, which doubled up with the self-drawn one (two visible
53
+ scrollbars). scrollbar-width:none is honored by overlay engines too;
54
+ the ::-webkit rule covers older WebKit. Wheel/trackpad/programmatic
55
+ scrolling is unaffected. */
56
+ [data-testid="gantt-timeline"] { scrollbar-width: none; }
57
+ [data-testid="gantt-timeline"]::-webkit-scrollbar { display: none; width: 0; height: 0; }
58
+ /* The task-list pane scrolls in lockstep with the timeline, so its own
59
+ vertical scrollbar (butted against the divider) was a confusing second
60
+ bar. Hide it — the pane stays wheel/drag-scrollable and synced. */
61
+ .gantt-task-list::-webkit-scrollbar { width: 0; height: 0; }
62
+ .gantt-task-list { scrollbar-width: none; }
63
+ `}),(0,V.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 p-2 border-b bg-card`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":w(`gantt.toolbar.prevPeriod`),"data-testid":`gantt-toolbar-prev-period`,onClick:()=>Mr(-1),children:(0,V.jsx)(ze,{className:`h-4 w-4`})}),(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":w(`gantt.toolbar.nextPeriod`),"data-testid":`gantt-toolbar-next-period`,onClick:()=>Mr(1),children:(0,V.jsx)(k,{className:`h-4 w-4`})}),(0,V.jsx)(`span`,{className:`font-semibold text-xs sm:text-sm`,"data-testid":`gantt-toolbar-period`,children:jr}),Ee&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground`,"data-testid":`gantt-readonly-badge`,title:w(`gantt.readOnlyHint`),children:[(0,V.jsx)(He,{className:`h-3 w-3`}),w(`gantt.readOnly`)]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex bg-muted rounded-md p-1`,role:`group`,"aria-label":w(`gantt.toolbar.viewMode`),children:Ft.map(e=>(0,V.jsx)(m,{variant:`ghost`,size:`sm`,className:l(`h-6 px-1.5 sm:px-2 text-xs`,L===e&&`bg-background shadow-sm hover:bg-background`),onClick:()=>cr(e),"aria-pressed":L===e,"data-testid":`gantt-view-mode-${e}`,children:w(`gantt.viewMode.${e}`)},e))}),(0,V.jsxs)(`div`,{className:`flex bg-muted rounded-md p-1`,children:[(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>{if(ht>15)tt(Math.max(15,ht-10));else{let e=Ft.indexOf(L);e<Ft.length-1&&(cr(Ft[e+1]),tt(Ot))}},"aria-label":w(`gantt.toolbar.zoomOut`),children:(0,V.jsx)(Ye,{className:`h-3 w-3`})}),(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>{if(ht<120)tt(Math.min(120,ht+10));else{let e=Ft.indexOf(L);e>0&&(cr(Ft[e-1]),tt(Ot))}},"aria-label":w(`gantt.toolbar.zoomIn`),children:(0,V.jsx)(Xe,{className:`h-3 w-3`})})]}),(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>z(e=>!e),"aria-label":w(st?`gantt.toolbar.showTaskList`:`gantt.toolbar.hideTaskList`),"aria-pressed":st,"data-testid":`gantt-toggle-task-list`,children:st?(0,V.jsx)(j,{className:`h-4 w-4`}):(0,V.jsx)(We,{className:`h-4 w-4`})}),(0,V.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:Vr,disabled:Br==null,"aria-label":w(`gantt.toolbar.jumpToToday`),"data-testid":`gantt-jump-today`,children:w(`gantt.toolbar.today`)}),(0,V.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:Gr,"aria-label":w(`gantt.toolbar.thisWeek`),"data-testid":`gantt-jump-week`,children:w(`gantt.toolbar.thisWeek`)}),(0,V.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:Kr,"aria-label":w(`gantt.toolbar.thisMonth`),"data-testid":`gantt-jump-month`,children:w(`gantt.toolbar.thisMonth`)}),ue?(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>void ue(),disabled:de,"aria-label":w(`gantt.toolbar.refresh`),"aria-busy":de,"data-testid":`gantt-refresh`,children:(0,V.jsx)(M,{className:`h-4 w-4`})}):null,E?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:yn,disabled:!xn,"aria-label":w(`gantt.toolbar.undo`),"data-testid":`gantt-undo`,children:(0,V.jsx)(qe,{className:`h-4 w-4`})}),(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:bn,disabled:!Sn,"aria-label":w(`gantt.toolbar.redo`),"data-testid":`gantt-redo`,children:(0,V.jsx)(Ge,{className:`h-4 w-4`})})]}):null,(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>Oi(e=>!e),"aria-label":w(`gantt.toolbar.criticalPath`),"aria-pressed":Di,"data-testid":`gantt-critical-path`,style:Di?{color:ji}:void 0,children:(0,V.jsx)(Ie,{className:`h-4 w-4`})}),Qe&&E?(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:Ii,"aria-label":w(`gantt.toolbar.autoSchedule`),"data-testid":`gantt-auto-schedule`,children:(0,V.jsx)(Je,{className:`h-4 w-4`})}):null,(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:Bi,"aria-label":w(`gantt.toolbar.exportPng`),"data-testid":`gantt-export-png`,children:(0,V.jsx)(Be,{className:`h-4 w-4`})}),(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:Vi,"aria-label":w(`gantt.toolbar.exportPdf`),"data-testid":`gantt-export-pdf`,children:(0,V.jsx)(Ve,{className:`h-4 w-4`})}),le||x?(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:Wi,"aria-label":w(`gantt.toolbar.saveLayout`),"aria-pressed":Hi,"data-testid":`gantt-save-layout`,style:Hi?{color:ji}:void 0,children:(0,V.jsx)(Ke,{className:`h-4 w-4`})}):null,(0,V.jsx)(m,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:Fr,"aria-label":w(Nr?`gantt.toolbar.exitFullscreen`:`gantt.toolbar.enterFullscreen`),"aria-pressed":Nr,"data-testid":`gantt-fullscreen`,children:Nr?(0,V.jsx)(Ue,{className:`h-4 w-4`}):(0,V.jsx)(A,{className:`h-4 w-4`})})]})]}),(0,V.jsxs)(`div`,{className:`relative flex flex-col flex-1 overflow-hidden outline-none focus-visible:ring-1 focus-visible:ring-ring`,tabIndex:0,onKeyDown:$n,"data-testid":`gantt-body`,children:[!st&&B>0&&(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 z-30 group/splitter`,style:{left:B-3,width:7,cursor:`col-resize`},"data-testid":`gantt-list-resize`,role:`separator`,"aria-orientation":`vertical`,onPointerDown:e=>{if(e.button!==0)return;e.preventDefault();let t=e.clientX,n=B,r=Math.max(kt,we-200),i=e=>{let i=Math.max(kt,Math.min(n+(e.clientX-t),r));rt(i)},a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a),document.body.style.cursor=``};document.body.style.cursor=`col-resize`,window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)},onDoubleClick:()=>rt(null),children:(0,V.jsx)(`div`,{className:`absolute inset-y-0 left-1/2 -translate-x-1/2 w-px bg-border group-hover/splitter:w-[3px] group-hover/splitter:bg-primary transition-all`})}),(0,V.jsxs)(`div`,{className:`flex border-b bg-muted/30 shrink-0 h-10 gantt-sm-h50`,children:[(0,V.jsxs)(`div`,{className:`flex items-center font-medium text-xs text-muted-foreground px-2 sm:px-4 border-r bg-card z-20 shadow-sm`,style:{width:B,minWidth:B},children:[(0,V.jsx)(`div`,{className:`flex-1 truncate`,children:w(`gantt.column.taskName`)}),vt&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`w-16 gantt-sm-w20 text-right`,children:w(`gantt.column.start`)}),(0,V.jsx)(`div`,{className:`w-16 gantt-sm-w20 text-right`,children:w(`gantt.column.end`)})]}),a&&(0,V.jsx)(`div`,{className:`w-6 shrink-0 hidden sm:block`,style:{marginLeft:4},"aria-hidden":`true`,"data-testid":`gantt-header-open-spacer`})]}),(0,V.jsx)(`div`,{className:`flex-1 overflow-hidden`,ref:pr,children:(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,style:{width:rr},children:[(0,V.jsx)(`div`,{className:`relative border-b`,style:{height:`45%`},"data-testid":`gantt-header-groups`,children:dr.slice(Dr.start,Dr.end).map(e=>(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 flex items-center justify-center border-r text-[10px] font-medium text-muted-foreground overflow-hidden`,style:{left:e.offset,width:e.width},children:(0,V.jsx)(`span`,{className:`truncate px-1`,children:e.label})},e.key))}),(0,V.jsx)(`div`,{className:`relative flex-1`,"data-testid":`gantt-header-units`,children:Y.slice(Tr.start,Tr.end).map((e,t)=>{let n=Tr.start+t;return(0,V.jsxs)(`div`,{className:l(`absolute top-0 bottom-0 flex items-center justify-center gap-1 border-r text-xs text-muted-foreground overflow-hidden`,e.isWeekend&&`bg-muted/50`),style:{left:X[n],width:e.width,backgroundColor:e.bandColor?`color-mix(in srgb, ${e.bandColor} 16%, transparent)`:void 0},children:[(0,V.jsx)(`span`,{className:`font-medium text-foreground truncate`,children:e.label}),e.sublabel&&ht>=32&&(0,V.jsx)(`span`,{className:`text-[10px] opacity-70`,children:e.sublabel})]},n)})})]})})]}),(0,V.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`gantt-task-list overflow-y-auto overflow-x-hidden border-r bg-card z-10 shadow-sm`,ref:mr,onScroll:si,style:{width:B,minWidth:B},role:`tree`,"aria-label":w(`gantt.aria.taskList`),children:[$.startIdx>0&&(0,V.jsx)(`div`,{style:{height:$.startIdx*P},"aria-hidden":`true`}),q.slice($.startIdx,$.endIdx).map(e=>{let t=e.task,n=Ze&&yt===t.id,r=Yn.has(String(t.id)),i=Wn!=null&&String(Wn)===String(t.id);return(0,V.jsxs)(`div`,{className:l(`group/task-row relative flex items-center border-b px-2 sm:px-4 hover:bg-accent/50 cursor-pointer transition-colors`,i&&`bg-accent/50`),style:{height:P,touchAction:`manipulation`},role:`treeitem`,"data-testid":`gantt-task-row-${t.id}`,"aria-level":e.depth+1,"aria-selected":i,"aria-expanded":e.hasChildren?!r:void 0,draggable:!!O&&!n&&!t.locked,onDragStart:O?e=>{e.dataTransfer.setData(`text/plain`,String(t.id)),e.dataTransfer.effectAllowed=`move`}:void 0,onDragOver:O?e=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`}:void 0,onDrop:O?e=>{e.preventDefault();let n=e.dataTransfer.getData(`text/plain`);if(!n||n===String(t.id))return;let r=jt.get(n);r&&String(r.parent??``)===String(t.parent??``)&&O(r,t)}:void 0,onContextMenu:e=>qn(t,e),onClick:()=>{Gn(t.id),n||Wr(e.start,e.end,t.id)},onDoubleClick:()=>{n||(Ze&&E&&!e.isSummary&&!t.locked?(bt(t.id),St({title:t.title,start:t.start.toLocaleDateString(`en-CA`),end:xe(Ht(t.start,t.end)),progress:String(t.progress)})):a?.(t))},children:[(0,V.jsxs)(`div`,{className:`flex-1 truncate font-medium text-xs sm:text-sm flex items-center gap-2`,style:e.depth>0?{paddingLeft:e.depth*14}:void 0,children:[e.hasChildren?(0,V.jsx)(`button`,{type:`button`,className:`h-4 w-4 shrink-0 flex items-center justify-center text-muted-foreground hover:text-foreground`,style:{marginLeft:-4},onClick:e=>{e.stopPropagation(),Zn(t.id)},"aria-expanded":!r,"aria-label":w(r?`gantt.row.expand`:`gantt.row.collapse`),"data-testid":`gantt-row-toggle-${t.id}`,children:r?(0,V.jsx)(k,{className:`h-3.5 w-3.5`}):(0,V.jsx)(Re,{className:`h-3.5 w-3.5`})}):(0,V.jsx)(`span`,{className:`w-3 shrink-0`,style:{marginLeft:-4},"aria-hidden":`true`}),(0,V.jsx)(`div`,{className:`w-2 h-2 rounded-full shrink-0`,style:{backgroundColor:t.color||`#3b82f6`}}),n?(0,V.jsx)(`input`,{className:`border rounded px-1 py-0.5 text-xs w-full bg-background`,value:xt.title||``,onChange:e=>St(t=>({...t,title:e.target.value})),onKeyDown:e=>{e.key===`Enter`?(dn([{task:t,changes:{title:xt.title,start:_e(xt.start),end:Ut(xt.end,t),progress:Number(xt.progress)||0}}]),bt(null)):e.key===`Escape`&&bt(null)},onClick:e=>e.stopPropagation(),autoFocus:!0}):(0,V.jsxs)(`span`,{className:`flex flex-col min-w-0`,children:[(0,V.jsx)(`span`,{className:l(`truncate`,e.isSummary&&`font-semibold`),"data-testid":`gantt-row-title-${t.id}`,children:t.title}),!vt&&(0,V.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,"data-testid":`gantt-row-dates-${t.id}`,children:[e.start.toLocaleDateString(T,{month:`numeric`,day:`numeric`}),` → `,Ht(e.start,e.end).toLocaleDateString(T,{month:`numeric`,day:`numeric`})]})]})]}),vt&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`w-16 gantt-sm-w20 text-right text-xs text-muted-foreground`,"data-testid":`gantt-row-start-${t.id}`,children:n?(0,V.jsx)(`input`,{type:`date`,className:`border rounded px-1 py-0.5 text-xs w-full bg-background`,value:xt.start||``,onChange:e=>St(t=>({...t,start:e.target.value})),onClick:e=>e.stopPropagation()}):e.start.toLocaleDateString(T,{month:`numeric`,day:`numeric`})}),(0,V.jsx)(`div`,{className:`w-16 gantt-sm-w20 text-right text-xs text-muted-foreground`,"data-testid":`gantt-row-end-${t.id}`,children:n?(0,V.jsx)(`input`,{type:`date`,className:`border rounded px-1 py-0.5 text-xs w-full bg-background`,value:xt.end||``,onChange:e=>St(t=>({...t,end:e.target.value})),onClick:e=>e.stopPropagation()}):Ht(e.start,e.end).toLocaleDateString(T,{month:`numeric`,day:`numeric`})})]}),a&&(0,V.jsx)(`div`,{className:`w-6 shrink-0 hidden sm:block`,style:{marginLeft:4},children:!n&&(0,V.jsx)(`button`,{type:`button`,title:w(`gantt.row.open`),"aria-label":w(`gantt.row.open`),"data-testid":`gantt-row-open-${t.id}`,className:`gantt-row-open-btn h-6 w-6 rounded-md flex items-center justify-center hover:bg-accent text-muted-foreground hover:text-foreground`,onClick:e=>{e.stopPropagation(),a(t)},children:(0,V.jsx)(Le,{className:`h-3.5 w-3.5`})})})]},t.id)}),$.endIdx<q.length&&(0,V.jsx)(`div`,{style:{height:(q.length-$.endIdx)*P},"aria-hidden":`true`})]}),(0,V.jsx)(`div`,{className:`flex-1 overflow-auto bg-background/50 relative [-webkit-overflow-scrolling:touch]`,ref:e=>{hr.current=e,Q.current=e},onScroll:oi,onTouchStart:Lr,onTouchMove:Rr,onTouchEnd:zr,"data-testid":`gantt-timeline`,children:(0,V.jsxs)(`div`,{className:`relative`,style:{width:rr},children:[Br!=null&&(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px z-20 pointer-events-none`,style:{left:Br,backgroundColor:`rgba(239, 68, 68, 0.8)`},"data-testid":`gantt-today-marker`,"aria-label":w(`gantt.toolbar.today`),children:(0,V.jsx)(`div`,{className:`absolute -translate-x-1/2 left-0 text-[10px] font-semibold text-white rounded-sm px-1 py-0.5 whitespace-nowrap z-30`,style:{top:2,backgroundColor:`#ef4444`},children:w(`gantt.toolbar.today`)})}),fr.map(e=>(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px z-20 pointer-events-none`,style:{left:e.left,backgroundColor:e.color},"data-testid":`gantt-marker-${e.index}`,"aria-label":e.label,children:e.label&&(0,V.jsx)(`div`,{className:`absolute -translate-x-1/2 left-0 text-[10px] font-semibold text-white rounded-sm px-1 py-0.5 whitespace-nowrap z-30`,style:{top:2,backgroundColor:e.color},children:e.label})},e.index)),(0,V.jsxs)(`div`,{className:`relative`,ref:An,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 pointer-events-none`,style:{zIndex:0},children:Y.slice(Tr.start,Tr.end).map((e,t)=>{let n=Tr.start+t;return(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0 border-r`,style:{left:X[n],width:e.width,backgroundColor:e.bandColor?`color-mix(in srgb, ${e.bandColor} 8%, transparent)`:e.isWeekend?`hsl(var(--muted) / 0.4)`:void 0}},n)})}),er&&y&&y.showMidnight&&(0,V.jsx)(`div`,{className:`absolute inset-0 pointer-events-none`,style:{zIndex:0},children:Y.slice(Tr.start,Tr.end).map((e,t)=>{let n=Tr.start+t,r=e.realMs??0;if(!r)return null;let i=e.date.getTime(),a=e.date,o=new Date(a.getFullYear(),a.getMonth(),a.getDate()+1,0,0,0,0).getTime();if(o<=i||o>=i+r)return null;let s=X[n]+(o-i)/r*e.width;return(0,V.jsx)(`div`,{className:`absolute top-0 bottom-0`,style:{left:s,borderLeft:`1px dashed hsl(var(--muted-foreground) / 0.4)`},"data-testid":`gantt-midnight-${n}`,"aria-hidden":`true`},`midnight-${n}`)})}),$.startIdx>0&&(0,V.jsx)(`div`,{style:{height:$.startIdx*P},"aria-hidden":`true`}),q.slice($.startIdx,$.endIdx).map((e,t)=>{let n=e.task,r=$.startIdx+t,i=Ai(n.id),a=ci(e.start,e.end),o=ne&&n.baselineStart&&n.baselineEnd?ci(n.baselineStart,n.baselineEnd):null,s=o?(0,V.jsx)(`div`,{className:`absolute pointer-events-none rounded-[1px]`,style:{left:o.left,width:Math.max(2,o.width),top:Si,height:xi,backgroundColor:Ci,border:`1px solid ${wi}`},"data-testid":`gantt-baseline-${n.id}`,"aria-hidden":`true`}):null,c=G?.taskId===n.id,u=ui?.has(String(n.id))??!1,d=di?.has(String(n.id))??!1,f=c||u||d?fi(e):a,p=!!n.locked,m=!!E&&!e.isSummary&&!p,h=m&&De,g=m&&Oe,ee=m&&ke,_=h||g,te=Ee||p,v=K!=null&&K.targetId!=null&&String(K.targetId)===String(n.id)&&String(K.sourceId)!==String(n.id),y=K!=null&&K.rejectedId!=null&&String(K.rejectedId)===String(n.id)?{cursor:`not-allowed`,boxShadow:`0 0 0 2px hsl(var(--destructive))`}:void 0,re=K?e=>{let t=e.currentTarget.getBoundingClientRect(),r=t.width>0&&e.clientX-t.left>t.width/2?`end`:`start`;jn(e=>{if(!e)return e;let t=On(e.sourceId,n);return t===null?{...e,targetId:n.id,targetEnd:r,rejectedId:null,rejectedReason:null}:{...e,targetId:null,targetEnd:null,rejectedId:n.id,rejectedReason:t}})}:void 0,ie=K?e=>{e.target===e.currentTarget&&jn(e=>e&&{...e,targetId:null,targetEnd:null,rejectedId:null,rejectedReason:null})}:void 0,ae=Math.max(1,Math.round((e.end.getTime()-e.start.getTime())/Lt)),oe=(r+1)*P+300>Or&&r*P>300,b=Ct===n.id&&!G&&!wn&&!K?(0,V.jsxs)(`div`,{className:`absolute z-30 pointer-events-none rounded-md border bg-popover text-popover-foreground px-2.5 py-1.5 text-xs shadow-md whitespace-nowrap`,style:{left:Math.max(f.left+8,4),...oe?{bottom:P-8}:{top:P-8}},role:`tooltip`,"data-testid":`gantt-tooltip-${n.id}`,children:[(0,V.jsx)(`div`,{className:`font-semibold`,children:n.title}),n.fields&&n.fields.length>0?(0,V.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`auto 1fr`,columnGap:10,rowGap:2,marginTop:4},children:n.fields.map((e,t)=>(0,V.jsxs)(N.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,V.jsx)(`span`,{style:{fontWeight:500},children:e.value})]},t))}):(0,V.jsxs)(`div`,{className:`text-muted-foreground`,children:[e.start.toLocaleDateString(T,{month:`short`,day:`numeric`}),` → `,Ht(e.start,e.end).toLocaleDateString(T,{month:`short`,day:`numeric`}),` · `,ae,w(`gantt.tooltip.days`),` · `,Math.round(e.progress),`%`]}),n.locked||Ee&&!E?(0,V.jsxs)(`div`,{className:`text-muted-foreground`,style:{marginTop:4},"data-testid":`gantt-tooltip-locked-${n.id}`,children:[`🚫 `,w(`gantt.lockedHint`)]}):null]}):null;if(n.type===`group`)return(0,V.jsx)(`div`,{className:`relative border-b hover:bg-accent/50`,style:{height:P},onPointerMove:ie,children:b},n.id);if(e.isSummary){let t=n.color||`#0d9488`,r=ce===`self`&&n.hasOwnDates!==!1,a=!!E&&De&&!p,o=!!E&&Oe&&r&&!p;return(0,V.jsxs)(`div`,{className:`relative border-b hover:bg-accent/50`,style:{height:P},onPointerMove:ie,children:[s,(0,V.jsxs)(`div`,{className:l(`gantt-bar-hover absolute rounded-sm border shadow-sm flex items-center px-2 select-none group`,a&&`cursor-grab active:cursor-grabbing`,c&&`ring-2 ring-primary z-10`,v&&`ring-2 ring-primary`,gr===n.id&&`gantt-flash z-10`),style:{left:f.left,width:f.width,top:bi,height:yi,cursor:a||o?void 0:te?`not-allowed`:`pointer`,backgroundColor:t,borderColor:i?ji:n.borderColor||`hsl(var(--primary-foreground) / 0.2)`,boxShadow:i?`0 0 0 2px ${ji}`:n.borderColor?`0 0 0 2px ${n.borderColor}`:void 0,...y},"data-critical":i?`true`:void 0,"data-testid":`gantt-summary-bar-${n.id}`,"data-progress":Math.round(e.progress),onMouseEnter:()=>wt(n.id),onMouseLeave:()=>wt(e=>e===n.id?null:e),onPointerMove:re,onPointerDown:t=>{if(t.button===0){if(o){let e=Dt(t.clientX,t.currentTarget.getBoundingClientRect());if(e!==`move`){Cn(n,e,t);return}}a&&Cn(n,`move`,t,{group:!0,originStart:e.start,originEnd:e.end})}},onClick:()=>{nn.current||Gn(n.id)},onContextMenu:e=>qn(n,e),children:[(0,V.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 pointer-events-none`,style:{width:`${Math.round(e.progress)}%`,backgroundColor:`rgba(0, 0, 0, 0.2)`,borderTopLeftRadius:`var(--radius-sm)`,borderBottomLeftRadius:`var(--radius-sm)`}}),o&&f.width>=14&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`gantt-resize-handle absolute left-0 top-0`,style:{width:Et,height:gi,cursor:`ew-resize`},"data-testid":`gantt-task-resize-left-${n.id}`,onPointerDown:e=>{e.button===0&&Cn(n,`resize-left`,e)},onClick:e=>e.stopPropagation()}),(0,V.jsx)(`div`,{className:`gantt-resize-handle absolute right-0 top-0`,style:{width:Et,height:gi,cursor:`ew-resize`},"data-testid":`gantt-task-resize-right-${n.id}`,onPointerDown:e=>{e.button===0&&Cn(n,`resize-right`,e)},onClick:e=>e.stopPropagation()})]}),(0,V.jsx)(`span`,{className:`relative text-[10px] text-white font-medium truncate pointer-events-none`,children:n.title}),D&&!p&&[`start`,`end`].map(e=>{let t=K!=null&&String(K.sourceId)===String(n.id)&&K.sourceEnd===e,r=t||Ct===n.id,i=r&&K==null;return(0,V.jsx)(`div`,{className:`absolute top-1/2 -translate-y-1/2 z-20 flex items-center transition-opacity`,style:{[e===`start`?`left`:`right`]:-28,height:24,width:30,cursor:`crosshair`,opacity:+!!r,pointerEvents:i?`auto`:`none`,justifyContent:e===`start`?`flex-start`:`flex-end`,paddingLeft:e===`start`?4:0,paddingRight:e===`end`?4:0},"data-testid":`gantt-link-dot-${e}-${n.id}`,onPointerDown:t=>{if(t.button!==0)return;t.stopPropagation(),t.preventDefault();let r=An.current?.getBoundingClientRect();jn({sourceId:n.id,sourceEnd:e,x:r?t.clientX-r.left:0,y:r?t.clientY-r.top:0,targetId:null,targetEnd:null,rejectedId:null,rejectedReason:null})},onClick:e=>e.stopPropagation(),children:(0,V.jsx)(`div`,{className:`rounded-full`,style:{height:12,width:12,backgroundColor:`hsl(var(--background))`,border:`2px solid hsl(var(--primary))`,boxShadow:t?`0 0 0 3px hsl(var(--primary) / 0.25)`:`0 1px 2px rgba(0,0,0,0.25)`}})},e)})]}),c&&G&&(0,V.jsxs)(`div`,{className:`absolute z-30 pointer-events-none rounded border bg-popover text-popover-foreground px-1.5 py-0.5 text-[10px] shadow whitespace-nowrap`,style:{left:Math.max(f.left,4),top:bi+yi+2},"data-testid":`gantt-summary-drag-chip-${n.id}`,children:[rn(G).start.toLocaleDateString(T,{month:`numeric`,day:`numeric`}),` → `,an(G).toLocaleDateString(T,{month:`numeric`,day:`numeric`})]}),b]},n.id)}if(e.isMilestone){let e=_i;return(0,V.jsxs)(`div`,{className:`relative border-b hover:bg-accent/50`,style:{height:P},onPointerMove:ie,children:[s,(0,V.jsx)(`div`,{className:l(`gantt-bar-hover absolute rotate-45 rounded-[2px] border shadow-sm select-none`,h&&`cursor-grab active:cursor-grabbing`,c&&`ring-2 ring-primary z-10`,v&&`ring-2 ring-primary`,gr===n.id&&`gantt-flash z-10`),style:{left:f.left-e/2,top:(P-e)/2,width:e,height:e,cursor:h?void 0:te?`not-allowed`:`pointer`,backgroundColor:i?ji:n.color||`#3b82f6`,borderColor:i?ji:n.borderColor||`hsl(var(--primary-foreground) / 0.2)`,boxShadow:i?`0 0 0 2px ${ji}`:n.borderColor?`0 0 0 2px ${n.borderColor}`:void 0,...y},"data-critical":i?`true`:void 0,"data-testid":`gantt-milestone-${n.id}`,onMouseEnter:()=>wt(n.id),onMouseLeave:()=>wt(e=>e===n.id?null:e),onClick:()=>{nn.current||Gn(n.id)},onContextMenu:e=>qn(n,e),onPointerMove:re,onPointerDown:h?e=>{e.button===0&&Cn(n,`move`,e)}:void 0}),b]},n.id)}let se=wn&&wn.taskId===n.id?wn.value:n.progress;return(0,V.jsxs)(`div`,{className:`relative border-b hover:bg-accent/50`,style:{height:P},onPointerMove:ie,onMouseEnter:()=>wt(n.id),onMouseLeave:()=>wt(e=>e===n.id?null:e),children:[c&&(0,V.jsx)(`div`,{className:`absolute rounded-sm border border-dashed pointer-events-none`,style:{left:a.left,width:a.width,top:mi,height:hi,opacity:.35,borderColor:`hsl(var(--primary) / 0.6)`},"aria-hidden":`true`}),s,(0,V.jsxs)(`div`,{className:l(`gantt-bar-hover absolute rounded-sm bg-primary border shadow-sm flex items-center px-2 group select-none`,_&&`cursor-grab active:cursor-grabbing`,c&&`ring-2 ring-primary z-10`,v&&`ring-2 ring-primary`,gr===n.id&&`gantt-flash z-10`),style:{left:f.left,width:f.width,top:mi,height:hi,cursor:_?void 0:te?`not-allowed`:`pointer`,backgroundColor:n.color||`#3b82f6`,borderColor:i?ji:n.borderColor||`hsl(var(--primary-foreground) / 0.2)`,boxShadow:i?`0 0 0 2px ${ji}`:n.borderColor?`0 0 0 2px ${n.borderColor}`:void 0,...y},"data-critical":i?`true`:void 0,"data-testid":`gantt-task-bar-${n.id}`,onClick:()=>{nn.current||Gn(n.id)},onContextMenu:e=>qn(n,e),onPointerMove:re,onPointerDown:_?e=>{if(e.button!==0)return;let t=Dt(e.clientX,e.currentTarget.getBoundingClientRect()),r=t!==`move`&&g?t:h?`move`:null;r&&Cn(n,r,e)}:void 0,children:[g&&f.width>=14&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`gantt-resize-handle absolute left-0 top-0`,style:{width:Et,height:gi,cursor:`ew-resize`},"data-testid":`gantt-task-resize-left-${n.id}`,onPointerDown:e=>{e.button===0&&Cn(n,`resize-left`,e)},onClick:e=>e.stopPropagation()}),(0,V.jsx)(`div`,{className:`gantt-resize-handle absolute right-0 top-0`,style:{width:Et,height:gi,cursor:`ew-resize`},"data-testid":`gantt-task-resize-right-${n.id}`,onPointerDown:e=>{e.button===0&&Cn(n,`resize-right`,e)},onClick:e=>e.stopPropagation()})]}),se>0&&(0,V.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 pointer-events-none`,style:{width:`${se}%`,backgroundColor:`rgba(0, 0, 0, 0.2)`,borderTopLeftRadius:`var(--radius-sm)`,borderBottomLeftRadius:`var(--radius-sm)`}}),ee&&f.width>=30&&(0,V.jsx)(`div`,{className:l(`absolute bottom-0 h-1/2 w-4 -translate-x-1/2 cursor-col-resize flex items-end justify-center pb-px`,wn?.taskId===n.id?`opacity-100`:`opacity-0 group-hover:opacity-100 transition-opacity`),style:{left:`${se}%`},"data-testid":`gantt-progress-handle-${n.id}`,onPointerDown:e=>{e.button===0&&(e.stopPropagation(),e.preventDefault(),Tn({taskId:n.id,originClientX:e.clientX,originProgress:n.progress,barWidth:f.width,value:n.progress}))},onClick:e=>e.stopPropagation(),children:(0,V.jsx)(`div`,{style:{width:0,height:0,borderLeft:`5px solid transparent`,borderRight:`5px solid transparent`,borderBottom:`7px solid #fff`,filter:`drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35))`}})}),D&&!p&&[`start`,`end`].map(e=>{let t=K!=null&&String(K.sourceId)===String(n.id)&&K.sourceEnd===e,r=t||Ct===n.id,i=r&&K==null;return(0,V.jsx)(`div`,{className:`absolute top-1/2 -translate-y-1/2 z-20 flex items-center transition-opacity`,style:{[e===`start`?`left`:`right`]:-28,height:24,width:30,cursor:`crosshair`,opacity:+!!r,pointerEvents:i?`auto`:`none`,justifyContent:e===`start`?`flex-start`:`flex-end`,paddingLeft:e===`start`?4:0,paddingRight:e===`end`?4:0},"data-testid":`gantt-link-dot-${e}-${n.id}`,onPointerDown:t=>{if(t.button!==0)return;t.stopPropagation(),t.preventDefault();let r=An.current?.getBoundingClientRect();jn({sourceId:n.id,sourceEnd:e,x:r?t.clientX-r.left:0,y:r?t.clientY-r.top:0,targetId:null,targetEnd:null,rejectedId:null,rejectedReason:null})},onClick:e=>e.stopPropagation(),children:(0,V.jsx)(`div`,{className:`rounded-full`,style:{height:12,width:12,backgroundColor:`hsl(var(--background))`,border:`2px solid hsl(var(--primary))`,boxShadow:t?`0 0 0 3px hsl(var(--primary) / 0.25)`:`0 1px 2px rgba(0,0,0,0.25)`}})},e)}),(0,V.jsx)(`span`,{className:`relative text-[10px] text-white font-medium truncate pointer-events-none group-hover:opacity-0 transition-opacity`,children:n.title}),(0,V.jsx)(`span`,{className:`absolute inset-0 flex items-center px-2 text-[10px] text-white font-medium truncate opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none`,children:c?`${rn(G).start.toLocaleDateString(T,{month:`numeric`,day:`numeric`})} → ${an(G).toLocaleDateString(T,{month:`numeric`,day:`numeric`})}`:`${Math.round(se)}%`})]}),b]},n.id)}),$.endIdx<q.length&&(0,V.jsx)(`div`,{style:{height:(q.length-$.endIdx)*P},"aria-hidden":`true`}),(pi.length>0||K)&&(0,V.jsxs)(`svg`,{className:`absolute top-0 left-0 pointer-events-none z-10`,width:rr,height:Or,"data-testid":`gantt-links`,"aria-hidden":`true`,children:[(0,V.jsxs)(`defs`,{children:[(0,V.jsx)(`marker`,{id:`gantt-link-arrow`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,V.jsx)(`path`,{d:`M 0 0 L 8 4 L 0 8 z`,fill:`hsl(var(--muted-foreground))`})}),(0,V.jsx)(`marker`,{id:`gantt-link-arrow-active`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,V.jsx)(`path`,{d:`M 0 0 L 8 4 L 0 8 z`,fill:`hsl(var(--primary))`})}),(0,V.jsx)(`marker`,{id:`gantt-link-arrow-critical`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,V.jsx)(`path`,{d:`M 0 0 L 8 4 L 0 8 z`,fill:ji})})]}),pi.map(e=>{let t=Math.min(e.sourceIndex,e.targetIndex);if(Math.max(e.sourceIndex,e.targetIndex)<$.startIdx-6||t>$.endIdx+6)return null;let n=Ti(e);if(!n)return null;let r=Ei!=null&&(String(e.sourceId)===String(Ei)||String(e.targetId)===String(Ei)),i=ki?.criticalEdges.has(`${String(e.sourceId)}->${String(e.targetId)}`)??!1,a=i?`gantt-link-arrow-critical`:r?`gantt-link-arrow-active`:`gantt-link-arrow`,o=!!(Ne||D);return(0,V.jsxs)(N.Fragment,{children:[(0,V.jsx)(`path`,{d:n,fill:`none`,stroke:i?ji:r?`hsl(var(--primary))`:`hsl(var(--muted-foreground))`,strokeOpacity:i||r?1:.7,strokeWidth:i||r?2:1.5,markerEnd:`url(#${a})`,"data-testid":`gantt-link-${e.sourceId}-${e.targetId}`,"data-link-type":e.type,"data-active":r?`true`:`false`,"data-critical":i?`true`:void 0}),o&&(0,V.jsx)(`path`,{d:n,fill:`none`,stroke:`transparent`,strokeWidth:10,style:{pointerEvents:`stroke`,cursor:`context-menu`},"data-testid":`gantt-link-hit-${e.sourceId}-${e.targetId}`,onContextMenu:t=>Jn(e.sourceId,e.targetId,e.type,t)})]},e.key)}),K&&(()=>{let e=q.findIndex(e=>String(e.task.id)===String(K.sourceId));if(e<0)return null;let t=fi(q[e]),n=q[e].isMilestone?t.left+(K.sourceEnd===`start`?-vi:vi):K.sourceEnd===`start`?t.left:t.left+t.width,r=e*P+P/2;return(0,V.jsx)(`path`,{d:`M ${Math.round(n)} ${Math.round(r)} L ${Math.round(K.x)} ${Math.round(K.y)}`,fill:`none`,stroke:`hsl(var(--primary))`,strokeWidth:1.5,strokeDasharray:`4 3`,"data-testid":`gantt-link-draft`})})()]}),K&&(()=>{let e=C.find(e=>String(e.id)===String(K.sourceId));if(!e)return null;let t=K.targetId==null?null:C.find(e=>String(e.id)===String(K.targetId)),n=e=>w(`gantt.linkEnd.${e}`),r=t?`${e.title} (${n(K.sourceEnd)}) → ${t.title} (${n(K.targetEnd??`start`)})`:`${e.title} (${n(K.sourceEnd)})`;return(0,V.jsx)(`div`,{className:`absolute z-30 pointer-events-none rounded-md border bg-popover text-popover-foreground px-2 py-1 text-[11px] font-medium shadow-md whitespace-nowrap`,style:{left:K.x+12,top:K.y+12},"data-testid":`gantt-link-draft-hint`,children:r})})()]})]})}),(0,V.jsx)(`div`,{ref:Zr,className:`shrink-0 border-l bg-card/95 select-none`,style:{width:14,display:`none`},"data-testid":`gantt-vscrollbar`,children:(0,V.jsx)(`div`,{ref:Qr,className:`relative h-full`,onPointerDown:ai,role:`scrollbar`,"aria-controls":`gantt-timeline`,"aria-orientation":`vertical`,children:(0,V.jsx)(`div`,{ref:$r,className:`absolute rounded-full`,style:{left:2,right:2,top:0,height:0,backgroundColor:`rgba(130,130,130,0.55)`,cursor:`grab`},"data-testid":`gantt-vscrollbar-thumb`,onPointerDown:ii})})})]}),(0,V.jsx)(`div`,{ref:qr,className:`shrink-0 border-t bg-card/95 select-none`,style:{position:`sticky`,bottom:0,zIndex:30,display:`none`},"data-testid":`gantt-hscrollbar`,children:(0,V.jsx)(`div`,{ref:Jr,className:`relative`,style:{marginLeft:B,height:14},onPointerDown:ri,role:`scrollbar`,"aria-controls":`gantt-timeline`,"aria-orientation":`horizontal`,children:(0,V.jsx)(`div`,{ref:Yr,className:`absolute rounded-full`,style:{top:2,bottom:2,left:0,width:0,backgroundColor:`rgba(130,130,130,0.55)`,cursor:`grab`},"data-testid":`gantt-hscrollbar-thumb`,onPointerDown:ni})})})]}),Nn&&(()=>{let e=C.find(e=>String(e.id)===String(Nn.taskId));if(!e)return null;let t=q.find(e=>String(e.task.id)===String(Nn.taskId)),n=`w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none`;return(0,V.jsxs)(`div`,{ref:Fn,className:`fixed z-50 min-w-[160px] rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm`,style:{left:Nn.x,top:Nn.y},role:`menu`,"data-testid":`gantt-context-menu`,children:[a&&(0,V.jsx)(`button`,{type:`button`,role:`menuitem`,className:n,"data-testid":`gantt-context-menu-view`,onClick:()=>{Pn(null),a(e)},children:w(`gantt.menu.view`)}),Ze&&E&&t&&!t.isSummary&&!e.locked&&(0,V.jsx)(`button`,{type:`button`,role:`menuitem`,className:n,"data-testid":`gantt-context-menu-edit`,onClick:()=>{Pn(null),bt(e.id),St({title:e.title,start:e.start.toLocaleDateString(`en-CA`),end:xe(Ht(e.start,e.end)),progress:String(e.progress)})},children:w(`gantt.menu.edit`)}),D&&t&&!t.isMilestone&&!e.locked&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{type:`button`,role:`menuitem`,className:n,"data-testid":`gantt-context-menu-add-predecessor`,onClick:()=>{let t=Nn;Pn(null),Hn(``),Bn({x:t.x,y:t.y,taskId:e.id,relation:`pred`})},children:w(`gantt.menu.addPredecessor`)}),(0,V.jsx)(`button`,{type:`button`,role:`menuitem`,className:n,"data-testid":`gantt-context-menu-add-successor`,onClick:()=>{let t=Nn;Pn(null),Hn(``),Bn({x:t.x,y:t.y,taskId:e.id,relation:`succ`})},children:w(`gantt.menu.addSuccessor`)})]}),Me&&!e.locked&&(0,V.jsx)(`button`,{type:`button`,role:`menuitem`,className:l(n,`text-destructive`),"data-testid":`gantt-context-menu-delete`,onClick:()=>{Pn(null),Me(e)},children:w(`gantt.menu.delete`)})]})})(),In&&(()=>{let e=C.find(e=>String(e.id)===String(In.sourceId)),t=C.find(e=>String(e.id)===String(In.targetId));if(!e||!t)return null;let n=`w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none`,r=[`fs`,`ss`,`ff`,`sf`],i=!!t.locked;return(0,V.jsxs)(`div`,{ref:Rn,className:`fixed z-50 min-w-[180px] rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm`,style:{left:In.x,top:In.y},role:`menu`,"data-testid":`gantt-link-context-menu`,children:[(0,V.jsxs)(`div`,{className:`px-3 py-1 text-xs text-muted-foreground truncate`,children:[e.title,` → `,t.title]}),i&&(0,V.jsxs)(`div`,{className:`px-3 py-1 text-xs text-muted-foreground`,"data-testid":`gantt-link-menu-locked`,children:[`🚫 `,w(`gantt.lockedHint`)]}),D&&fe&&r.map(r=>(0,V.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":In.type===r,disabled:i,className:l(n,In.type===r&&`font-semibold`,i&&`opacity-50 cursor-not-allowed hover:bg-transparent`),"data-testid":`gantt-link-menu-type-${r}`,onClick:()=>{i||(Ln(null),r!==In.type&&D(e,t,r))},children:[In.type===r?`✓ `:`\xA0\xA0`,w(`gantt.linkType.${r}`)]},r)),Ne&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`my-1 border-t`}),(0,V.jsx)(`button`,{type:`button`,role:`menuitem`,disabled:i,className:l(n,`text-destructive`,i&&`opacity-50 cursor-not-allowed hover:bg-transparent`),"data-testid":`gantt-link-menu-remove`,onClick:()=>{i||(Ln(null),Ne(e,t))},children:w(`gantt.menu.removeDependency`)})]})]})})(),zn&&D&&(()=>{let e=C.find(e=>String(e.id)===String(zn.taskId));if(!e)return null;let t=new Set(pi.map(e=>`${String(e.sourceId)}->${String(e.targetId)}`)),n=C.filter(n=>{if(String(n.id)===String(e.id)||n.type===`group`||n.locked)return!1;let r=zn.relation===`pred`?`${String(n.id)}->${String(e.id)}`:`${String(e.id)}->${String(n.id)}`;return!t.has(r)}),r=Vn.trim().toLowerCase(),i=r?n.filter(e=>String(e.title??``).toLowerCase().includes(r)):n;return(0,V.jsxs)(`div`,{ref:Un,className:`fixed z-50 min-w-[200px] max-h-[280px] overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm`,style:{left:zn.x,top:zn.y},role:`menu`,"data-testid":`gantt-dep-picker`,children:[(0,V.jsx)(`div`,{className:`px-3 py-1 text-xs text-muted-foreground`,children:zn.relation===`pred`?w(`gantt.menu.addPredecessor`):w(`gantt.menu.addSuccessor`)}),(0,V.jsx)(`div`,{className:`px-2 pb-1`,children:(0,V.jsx)(`input`,{className:`border rounded px-2 py-1 text-sm w-full bg-background`,value:Vn,onChange:e=>Hn(e.target.value),placeholder:w(`gantt.menu.searchTasks`),"data-testid":`gantt-dep-picker-search`,autoFocus:!0})}),i.length===0?(0,V.jsx)(`div`,{className:`px-3 py-1.5 text-muted-foreground`,children:w(`gantt.menu.noCandidates`)}):i.map(t=>(0,V.jsx)(`button`,{type:`button`,role:`menuitem`,className:`w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none truncate`,"data-testid":`gantt-dep-picker-option-${t.id}`,onClick:()=>{Bn(null),zn.relation===`pred`?D(t,e,`fs`):D(e,t,`fs`)},children:t.title},String(t.id)))]})})(),Mi&&(0,V.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/30`,"data-testid":`gantt-autoschedule-overlay`,onClick:()=>Ni(null),children:(0,V.jsxs)(`div`,{className:`min-w-[280px] max-w-[360px] rounded-lg border bg-popover text-popover-foreground shadow-lg p-4`,role:`alertdialog`,"aria-modal":`true`,"data-testid":`gantt-autoschedule-dialog`,onClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`div`,{className:`text-sm font-semibold mb-1`,"data-testid":`gantt-autoschedule-title`,children:w(`gantt.autoScheduleDlg.title`)}),(0,V.jsxs)(`div`,{className:`text-sm text-muted-foreground mb-3`,children:[w(`gantt.autoScheduleDlg.body`,{count:Mi.changes.length}),Mi.skipped>0&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{"data-testid":`gantt-autoschedule-skipped`,children:w(`gantt.autoScheduleDlg.skipped`,{count:Mi.skipped})})]})]}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,className:`px-3 py-1.5 text-sm rounded-md border hover:bg-accent outline-none`,"data-testid":`gantt-autoschedule-cancel`,onClick:()=>Ni(null),children:w(`gantt.autoScheduleDlg.cancel`)}),(0,V.jsx)(`button`,{type:`button`,className:`px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:opacity-90 outline-none`,"data-testid":`gantt-autoschedule-confirm`,onClick:Li,children:w(`gantt.autoScheduleDlg.confirm`)})]})]})}),Pi&&(0,V.jsx)(`div`,{className:`fixed bottom-6 left-1/2 -translate-x-1/2 z-[60] rounded-md border bg-popover text-popover-foreground px-3 py-1.5 text-sm shadow-md`,role:`status`,"data-testid":`gantt-autoschedule-clean`,children:w(`gantt.autoScheduleDlg.none`)}),fn&&(0,V.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/30`,"data-testid":`gantt-conflict-overlay`,onClick:()=>pn(null),children:(0,V.jsxs)(`div`,{className:`min-w-[280px] max-w-[360px] rounded-lg border bg-popover text-popover-foreground shadow-lg p-4`,role:`alertdialog`,"aria-modal":`true`,"data-testid":`gantt-conflict-dialog`,onClick:e=>e.stopPropagation(),children:[(0,V.jsx)(`div`,{className:`text-sm font-semibold mb-1`,"data-testid":`gantt-conflict-title`,children:w(`gantt.conflict.title`)}),(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground mb-3`,children:w(`gantt.conflict.body`,{count:fn.length})}),(0,V.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,className:`px-3 py-1.5 text-sm rounded-md border hover:bg-accent outline-none`,"data-testid":`gantt-conflict-cancel`,onClick:()=>pn(null),children:w(`gantt.conflict.cancel`)}),(0,V.jsx)(`button`,{type:`button`,className:`px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:opacity-90 outline-none`,"data-testid":`gantt-conflict-confirm`,onClick:_n,children:w(`gantt.conflict.confirm`)})]})]})})]})}function tn(e,t,n,r){return t.getTime()===e.getTime()?e.getTime()>=n.getTime()&&e.getTime()<r.getTime():e.getTime()<r.getTime()&&t.getTime()>n.getTime()}function nn(e,t,n){let{assignee:r,effort:i,capacity:a=1,unassignedLabel:o=`Unassigned`}=n,s=e=>typeof a==`function`?a(e):a,c=e=>{let t=i?i(e):1;return Number.isFinite(t)&&t>0?t:0},l=new Map;for(let t of e){let e=r(t),n=e?String(e.key):`__unassigned__`,i=e?e.label:o,a=l.get(n);a||(a={key:n,label:i,items:[]},l.set(n,a)),a.items.push(t)}let u=[];for(let e of l.values()){let n=s(e.key),r=0,i=0,a=t.map(t=>{let a=0;for(let n of e.items)tn(n.start,n.end,t.start,t.end)&&(a+=c(n));a>r&&(r=a);let o=a>n+1e-9;return o&&i++,{load:a,capacity:n,overloaded:o}});u.push({key:e.key,label:e.label,capacity:n,cells:a,peak:r,overloadedCount:i})}return u}var rn={day:26,week:56,month:76,quarter:88,year:104},an=48,on=34,sn=180;function cn(e,t,n){return t===`day`?String(e.getDate()):t===`week`?e.toLocaleDateString(n,{month:`numeric`,day:`numeric`}):t===`month`?e.toLocaleDateString(n,{month:`short`}):t===`year`?String(e.getFullYear()):`Q${Math.floor(e.getMonth()/3)+1}`}function ln({tasks:e,assignee:t,effort:n,capacity:r=1,viewMode:i=`day`,unassignedLabel:a=`Unassigned`,className:o}){let{t:s}=Tt(),c=Pe(),l=rn[i],u=N.useMemo(()=>{if(!e.length)return[];let t=new Date(Math.min(...e.map(e=>e.start.getTime()))),n=new Date(Math.max(...e.map(e=>e.end.getTime()))),r=Rt(t,i),a=W(Rt(n,i),1,i),o=[],s=0;for(;r<a&&s++<4e3;){let e=W(r,1,i);o.push({date:new Date(r),col:{start:new Date(r),end:new Date(e)},label:cn(r,i,c)}),r=e}return o},[e,i,c]),d=N.useMemo(()=>nn(e,u.map(e=>e.col),{assignee:t,effort:n,capacity:r,unassignedLabel:a}),[e,u,t,n,r,a]),f=N.useMemo(()=>{let e=0;for(let t of d)e=Math.max(e,t.peak,t.capacity);return e||1},[d]),p=u.length*l;return e.length?(0,V.jsx)(`div`,{className:o,"data-testid":`resource-workload`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`auto`},children:(0,V.jsxs)(`div`,{style:{display:`flex`,minWidth:sn+p},children:[(0,V.jsxs)(`div`,{style:{width:sn,flexShrink:0},children:[(0,V.jsx)(`div`,{style:{height:28,display:`flex`,alignItems:`center`,padding:`0 12px`,fontSize:12,fontWeight:600,borderBottom:`1px solid hsl(var(--border))`},children:s(`gantt.resource.header`)}),d.map(e=>(0,V.jsxs)(`div`,{"data-testid":`resource-row-${e.key}`,style:{height:an,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:`0 12px`,borderBottom:`1px solid hsl(var(--border) / 0.5)`},children:[(0,V.jsx)(`span`,{style:{fontSize:13,fontWeight:500,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.label}),(0,V.jsxs)(`span`,{"data-testid":`resource-peak-${e.key}`,"data-overloaded":e.overloadedCount>0?`true`:void 0,style:{fontSize:10,color:e.overloadedCount>0?`hsl(var(--destructive))`:`hsl(var(--muted-foreground))`},children:[s(`gantt.resource.peak`),`: `,Math.round(e.peak*100)/100,` / `,e.capacity,e.overloadedCount>0?` · ${e.overloadedCount} ${s(`gantt.resource.over`)}`:``]})]},e.key))]}),(0,V.jsxs)(`div`,{style:{flex:1},children:[(0,V.jsx)(`div`,{style:{display:`flex`,height:28,borderBottom:`1px solid hsl(var(--border))`},children:u.map((e,t)=>(0,V.jsx)(`div`,{style:{width:l,flexShrink:0,textAlign:`center`,fontSize:10,color:`hsl(var(--muted-foreground))`,borderLeft:`1px solid hsl(var(--border) / 0.4)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:e.label},t))}),d.map(e=>{let t=on*(1-Math.min(e.capacity/f,1));return(0,V.jsxs)(`div`,{style:{position:`relative`,display:`flex`,height:an,borderBottom:`1px solid hsl(var(--border) / 0.5)`},children:[(0,V.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,left:0,right:0,top:7+t,borderTop:`1px dashed hsl(var(--muted-foreground) / 0.6)`,pointerEvents:`none`,zIndex:1}}),e.cells.map((t,n)=>{let r=Math.max(t.load>0?2:0,on*Math.min(t.load/f,1));return(0,V.jsx)(`div`,{"data-testid":`resource-cell-${e.key}-${n}`,"data-load":t.load,"data-overloaded":t.overloaded?`true`:void 0,title:`${u[n]?.date.toLocaleDateString(c)} — ${Math.round(t.load*100)/100} / ${t.capacity}`,style:{width:l,flexShrink:0,position:`relative`,borderLeft:`1px solid hsl(var(--border) / 0.4)`,display:`flex`,alignItems:`flex-end`,justifyContent:`center`,paddingBottom:7},children:t.load>0&&(0,V.jsx)(`div`,{style:{width:l-6,height:r,borderRadius:2,backgroundColor:t.overloaded?`hsl(var(--destructive))`:`hsl(var(--primary))`,opacity:t.overloaded?.9:.75}})},n)})]},e.key)})]})]})}):(0,V.jsx)(`div`,{className:o,"data-testid":`resource-workload`,children:(0,V.jsx)(`div`,{className:`flex items-center justify-center h-40 text-sm text-muted-foreground`,children:s(`gantt.resource.empty`)})})}var un={display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,padding:`8px 12px`,borderBottom:`1px solid hsl(var(--border))`,background:`hsl(var(--background))`,fontSize:13},dn={display:`inline-flex`,alignItems:`center`,gap:6,height:30,padding:`0 10px`,borderRadius:6,border:`1px solid hsl(var(--border))`,background:`hsl(var(--background))`,color:`hsl(var(--foreground))`,cursor:`pointer`,whiteSpace:`nowrap`,lineHeight:`28px`},fn={position:`absolute`,top:`calc(100% + 4px)`,left:0,zIndex:50,minWidth:200,maxHeight:320,overflowY:`auto`,padding:4,borderRadius:8,border:`1px solid hsl(var(--border))`,background:`hsl(var(--popover, var(--background)))`,color:`hsl(var(--popover-foreground, var(--foreground)))`,boxShadow:`0 8px 24px rgba(0,0,0,0.18)`},pn={display:`flex`,alignItems:`center`,gap:8,padding:`6px 8px`,borderRadius:6,cursor:`pointer`,userSelect:`none`};function mn({checked:e}){return(0,V.jsx)(`span`,{"aria-hidden":!0,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:15,height:15,flex:`0 0 auto`,borderRadius:3,border:`1px solid ${e?`hsl(var(--primary))`:`hsl(var(--border))`}`,background:e?`hsl(var(--primary))`:`transparent`,color:`hsl(var(--primary-foreground, var(--background)))`,fontSize:11,lineHeight:1},children:e?`✓`:``})}function hn({filter:e,selected:t,onChange:n,labels:r}){let[i,a]=(0,N.useState)(!1),o=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(!i)return;let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[i]);let s=new Set(t),c=t.length,l=e.options.length>0&&c===e.options.length,u=t=>{let r=new Set(s);r.has(t)?r.delete(t):r.add(t),r.size===e.options.length?n([]):n([...r])},d=()=>{n(c>0?[]:e.options.map(e=>e.value))},f=c===0?e.label:c===1?`${e.label}: ${e.options.find(e=>e.value===t[0])?.label??t[0]}`:`${e.label} · ${c}`;return(0,V.jsxs)(`div`,{ref:o,style:{position:`relative`},"data-testid":`quick-filter-${e.field}`,children:[(0,V.jsxs)(`button`,{type:`button`,style:{...dn,borderColor:c>0?`hsl(var(--primary))`:`hsl(var(--border))`,color:c>0?`hsl(var(--primary))`:`hsl(var(--foreground))`},"aria-haspopup":`listbox`,"aria-expanded":i,"data-testid":`quick-filter-trigger-${e.field}`,onClick:()=>a(e=>!e),children:[(0,V.jsx)(`span`,{children:f}),(0,V.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:10,opacity:.7},children:`▾`})]}),i&&(0,V.jsx)(`div`,{role:`listbox`,style:fn,"data-testid":`quick-filter-panel-${e.field}`,children:e.options.length===0?(0,V.jsx)(`div`,{style:{...pn,cursor:`default`,opacity:.6},children:r.empty}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{role:`option`,"aria-selected":l,style:{...pn,fontWeight:600},"data-testid":`quick-filter-all-${e.field}`,onClick:()=>d(),children:[(0,V.jsx)(mn,{checked:l}),(0,V.jsx)(`span`,{children:r.all})]}),(0,V.jsx)(`div`,{style:{height:1,background:`hsl(var(--border))`,margin:`2px 0`}}),e.options.map(t=>{let n=s.has(t.value);return(0,V.jsxs)(`div`,{role:`option`,"aria-selected":n,style:{...pn,background:n?`hsl(var(--accent, var(--muted)))`:`transparent`},"data-testid":`quick-filter-option-${e.field}-${t.value}`,onClick:()=>u(t.value),children:[(0,V.jsx)(mn,{checked:n}),(0,V.jsx)(`span`,{children:t.label})]},t.value)})]})})]})}var gn=({filters:e,value:t,onChange:n,onClear:r,resultCount:i,totalCount:a,labels:o,className:s})=>{if(!e.length)return null;let c=o?.all??`All`,l=o?.empty??`No options`,u=o?.clear??`Clear`,d=e.some(e=>(t[e.field]?.length??0)>0);return(0,V.jsxs)(`div`,{style:un,className:s,"data-testid":`quick-filter-bar`,children:[e.map(e=>(0,V.jsx)(hn,{filter:e,selected:t[e.field]??[],onChange:t=>n(e.field,t),labels:{all:c,empty:l}},e.field)),d&&(0,V.jsx)(`button`,{type:`button`,style:{...dn,height:28,color:`hsl(var(--muted-foreground))`},"data-testid":`quick-filter-clear`,onClick:r,children:u}),o?.resultSummary&&i!=null&&a!=null&&(0,V.jsx)(`span`,{"data-testid":`quick-filter-summary`,style:{marginLeft:`auto`,color:`hsl(var(--muted-foreground))`},children:o.resultSummary(i,a)})]})};function _n(e){if(e==null)return;let t=String(e).toLowerCase().trim();if(t===`milestone`)return`milestone`;if(t===`group`||t===`folder`)return`group`;if(t===`summary`||t===`project`||t===`phase`)return`summary`;if(t===`task`)return`task`}var vn={fs:`fs`,ss:`ss`,ff:`ff`,sf:`sf`,finish_to_start:`fs`,start_to_start:`ss`,finish_to_finish:`ff`,start_to_finish:`sf`,end_to_start:`fs`,end_to_end:`ff`,start_to_end:`sf`};function yn(e){if(e==null||e===``)return[];if(typeof e==`string`)return e.split(`,`).map(e=>e.trim()).filter(Boolean);if(typeof e==`number`)return[e];if(!Array.isArray(e))return[];let t=[];for(let n of e)if(n!=null&&n!==``){if(typeof n==`object`){let e=n.id??n._id??n.task??n.target;if(e==null||e===``)continue;let r=vn[String(n.type??``).toLowerCase().replace(/-/g,`_`)];t.push(r?{id:e,type:r}:{id:e})}else t.push(n)}return t}function bn(e){let t=e instanceof Error?e.message:String(e??``),n=t.indexOf(`{`);if(n>=0)try{let e=JSON.parse(t.slice(n)),r=e?.message??e?.error;if(typeof r==`string`&&r.trim())return r}catch{}return null}function xn(e,t){let n=_e(e);return typeof e==`string`&&Ae(e)?bt(t,n):n}function Sn(e,t){let n=de(e);if(typeof e!=`string`||!Ae(e))return n;let r=bt(t,n);return t.to(r).getTime()===n.getTime()?r:bt(t,new Date(n.getTime()-1))}function Cn(e,t,n,r,i=`start`){if(!(typeof t==`string`?t===`date`:typeof n==`string`&&Ae(n)))return e.toISOString();let a=xt(r,e);return xe(i===`end`?ue(a):a)}var wn=()=>!1,Tn=[...Object.keys(a.shape),`dependencyField`],En=new Set;function Dn(e){if(!wn())return;let t=Tn.filter(t=>e[t]!==void 0);if(t.length===0)return;let n=`${e.type??`gantt`}::${e.objectName??``}::${t.join(`,`)}`;En.has(n)||(En.add(n),console.warn(`[ObjectGantt] The \`gantt\` block configures this chart, so these top-level keys are IGNORED: ${t.map(e=>`\`${e}\``).join(`, `)}. The \`gantt\` block is the authoring shape; the flat top-level spelling is the internal form ObjectView/ListView produce when they flatten \`options.gantt\`, and what the author wrote outranks it. The block is taken WHOLE — the flat keys are not merged into it — so move anything you still need into \`gantt\`, or drop the \`gantt\` block. objectui#6469.`))}function On(e){if(e.gantt){let t=e.gantt,n=a.safeParse(t);return n.success||console.warn(`[ObjectGantt] Invalid gantt configuration:`,n.error.format()),Dn(e),t}return e.startDateField&&e.endDateField?{startDateField:e.startDateField,endDateField:e.endDateField,titleField:e.titleField||`name`,progressField:e.progressField,dependenciesField:e.dependenciesField||e.dependencyField,colorField:e.colorField,borderColorField:e.borderColorField,parentField:e.parentField,typeField:e.typeField,lockField:e.lockField,objectField:e.objectField,summaryExtent:e.summaryExtent,defaultCollapsedDepth:e.defaultCollapsedDepth,tooltipFields:e.tooltipFields,baselineStartField:e.baselineStartField,baselineEndField:e.baselineEndField,groupByField:e.groupByField,resourceView:e.resourceView,assigneeField:e.assigneeField,effortField:e.effortField,capacity:e.capacity,quickFilters:e.quickFilters,autoZoomToFilter:e.autoZoomToFilter,viewMode:e.viewMode,timeSegments:e.timeSegments,interactions:e.interactions,exportFileName:e.exportFileName,timeZone:e.timeZone,dependencyTypes:e.dependencyTypes}:null}var kn=({schema:e,dataSource:t,className:n,onTaskClick:r,onRowClick:a,onBeforeTaskUpdate:s,...m})=>{let[b,x]=(0,N.useState)([]),[ue,de]=(0,N.useState)(!0),[he,_e]=(0,N.useState)(null),[xe,Se]=(0,N.useState)(null),{currency:ke}=D(),Ae=Pe(),{t:O}=Tt(),Ie=(0,N.useCallback)(e=>{Fe.error(O(`gantt.writeFailed`),{description:bn(e)??void 0})},[O]),Le=Me(e,`view-data`),Re=JSON.stringify(Le),ze=(0,N.useMemo)(()=>Le,[Re]),k=On(e),Be=ze?.provider,Ve=Be===`value`,He=(0,N.useContext)(me)?.apiFetch,A=(0,N.useMemo)(()=>C(ze,t??null,{fetch:He}),[ze,t,He]),Ue=(0,N.useRef)(A);Ue.current=A;let We=JSON.stringify(Le?.provider===`api`?{provider:`api`,read:Le.read,write:Le.write}:Le?.provider===`value`?{provider:`value`,items:Le.items}:{provider:Le?.provider??null}),j=le(e,ze)??``,{ready:Ge,def:M}=E(j,Ve?void 0:A),Ke=_(),qe=typeof e.search==`string`&&e.search!==``?e.search:void 0,Je=qe&&Array.isArray(e.searchableFields)&&e.searchableFields.length>0?e.searchableFields:void 0,Ye=Je?JSON.stringify(Je):``,[Xe,$e]=(0,N.useState)(!1),P=Ee(),et=be(e.filter,P),F=(0,N.useRef)(0),I=(0,N.useRef)(!1),tt=(0,N.useRef)(!1),nt=m.data,rt=Array.isArray(nt)&&nt.length>0?nt:null,L=(0,N.useRef)(rt);L.current=rt;let it=(0,N.useCallback)(async({silent:t=!1,inPlace:n=t}={})=>{let r=++F.current,i=()=>F.current===r,a=!t||tt.current;tt.current=a;try{n?$e(!0):de(!0);let t=L.current;if(t){i()&&(x(t),Se(null),_e(null),I.current=!0);return}let r=Ue.current;if(!r||typeof r.find!=`function`)throw Error(`DataSource required for object/api providers`);let a=S(M?.fields),o=!Ke?.isLoaded||!j?a:a.filter(e=>Ke.checkField(j,e,`read`)),s=await r.find(j,{$filter:et,$orderby:pe(e.sort),...Oe(),...o.length>0?{$expand:o}:{},...qe?{$search:qe,...Je?{$searchFields:Je}:{}}:{}}),c=w(s);i()&&(x(c.rows),Se(c),_e(null),I.current=!0)}catch(e){a?i()&&_e(e):console.error(`[ObjectGantt] Failed to refresh data:`,e)}finally{i()&&(tt.current=!1,$e(!1),de(!1))}},[We,t,He,j,Ve,Be,et,e.sort,qe,Ye,M,Ke]),R=rt===null&&!Ve,at=(0,N.useRef)(it);at.current=it,(0,N.useEffect)(()=>{(!R||Ge)&&at.current(I.current?{inPlace:!0}:{})},[We,t,He,j,Ve,Be,et,e.sort,qe,Ye,M,Ke,R,Ge]);let ot=ve(R&&j?j:void 0),st=(0,N.useRef)(0);(0,N.useEffect)(()=>{ot!==st.current&&(st.current=ot,(!R||Ge)&&at.current({silent:!0}))},[ot,R,Ge]);let z=(0,N.useMemo)(()=>{if(!k||!b.length)return[];let{startDateField:e,endDateField:t,titleField:n,progressField:r,dependenciesField:a,colorField:o,borderColorField:s,parentField:c,typeField:l,lockField:u,tooltipFields:p,baselineStartField:m,baselineEndField:h,quickFilters:ee}=k,_=M?.fields??{},te=_t(k.timeZone),v=T(_[o??``]),y=T(_[s??``]),ne=new Map;for(let e of ee??[]){if(!e?.field||!Array.isArray(e.options)||!e.options.length)continue;let t=new Map;for(let n of e.options)typeof n==`string`?t.set(n,n):n&&n.value!=null&&t.set(String(n.value),n.label??String(n.value));t.size&&ne.set(e.field,t)}let ie=(e,t)=>{if(!t)return;let n=t.split(`.`),r=e;for(let e of n){if(r==null)return;r=r[e]}return r},oe=e=>{let t=[ie(e,n),e?.account?.name,e?.opportunity?.name,e?.contact&&[e.contact.first_name,e.contact.last_name].filter(Boolean).join(` `)];for(let e of t)if(e!=null&&String(e).trim()!==``)return String(e);return fe(M,e)},se=(e,t)=>{if(t)return t;let n=_[e]??_[e.split(`.`)[0]];return n?.label?n.label:ge(e)},ce=(e,t)=>{if(e==null||e===``)return`—`;let n=_[t]??_[t.split(`.`)[0]],r=n?.type,a=n?.options;if(Array.isArray(a)&&a.length){let t=a.find(t=>String(t.value)===String(e));if(t)return t.label}if(typeof e!=`object`){let n=ne.get(t)?.get(String(e));if(n!=null)return n}if(r==null&&typeof e==`string`){if(/^\d{4}-\d{2}-\d{2}$/.test(e))return ye(e,void 0,{locale:Ae});if(/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/.test(e)&&!isNaN(new Date(e).getTime()))return je(e,{locale:Ae})}switch(r){case`date`:return ye(e,void 0,{locale:Ae});case`datetime`:return je(e,{locale:Ae});case`number`:case`integer`:case`float`:case`decimal`:{let t=i({type:n?.type,scale:n?.scale});return Ce(Number(e),t===void 0?{locale:Ae,minimumFractionDigits:0,maximumFractionDigits:20}:{locale:Ae,minimumFractionDigits:t,maximumFractionDigits:t})}case`currency`:return d(Number(e),Ne(n,ke),Ae);case`percent`:return g(Number(e),f(n),i({type:n?.type,scale:n?.scale}),Ae);case`boolean`:case`checkbox`:return e?`Yes`:`No`;default:if(Array.isArray(e)){let t=e.map(e=>{if(e==null)return``;if(typeof e==`object`){let t=e;return String(t.name??t.label??t.title??t.id??``)}return String(e)}).filter(Boolean);return t.length?t.join(`, `):`—`}if(typeof e==`object`){let t=e;return String(t.name??t.label??t.title??t.id??`—`)}return String(e)}},x=e=>{if(!p||!p.length)return;let t=[];for(let n of p){let r=typeof n==`string`?n:n?.field;if(!r)continue;let i=typeof n==`object`?n.label:void 0,a=ie(e,r);a==null||a===``||Array.isArray(a)&&a.length===0||t.push({label:se(r,i),value:ce(a,r)})}return t.length?t:void 0};return b.map((n,i)=>{let d=n[e],f=n[t],p=m?n[m]:void 0,g=h?n[h]:void 0,ee=p?xn(p,te):void 0,_=g?Sn(g,te):void 0,ne=oe(n),ie=r?n[r]:0,b=a?n[a]:[],se=o?n[o]:void 0,ce=v(se);if(!ce&&se!=null&&se!==``&&(ce=re(ae(String(se),se))),!ce){let e=n.status??n.state??n.priority??n.severity;if(e!=null&&e!==``){let t=ae(void 0,e);t&&(ce=re(t))}}let le=s?n[s]:void 0,ue=le!=null&&le!==``?y(le)??re(String(le),String(le)):void 0;return{id:n.id||n._id||`task-${i}`,title:ne,start:d?xn(d,te):new Date,end:f?Sn(f,te):new Date,hasOwnDates:!!(d&&f),progress:Math.min(100,Math.max(0,ie||0)),dependencies:yn(b),parent:c?n[c]??null:void 0,type:l?_n(n[l]):void 0,locked:u?!!n[u]:void 0,color:ce,borderColor:ue,baselineStart:ee&&!isNaN(ee.getTime())?ee:void 0,baselineEnd:_&&!isNaN(_.getTime())?_:void 0,fields:x(n),data:n}}).filter(e=>!isNaN(e.start.getTime())&&!isNaN(e.end.getTime()))},[b,k,M,Ae,ke]),ct=(0,N.useMemo)(()=>{let e=k?.groupByField;if(!e)return;let t=M?.fields??{},n=(e,t)=>{if(!t)return;let n=e;for(let e of t.split(`.`)){if(n==null)return;n=n[e]}return n},r=n=>{let r=(t[e]??t[e.split(`.`)[0]])?.options;if(Array.isArray(r)&&r.length){let e=r.find(e=>String(e.value)===String(n));if(e)return e.label}if(typeof n==`object`&&n){let e=n;return String(e.name??e.label??e.title??e.id??n)}return String(n)};return t=>{let i=n(t.data,e);return i==null||i===``?null:{key:typeof i==`object`&&i?String(i.id??i._id??r(i)):i,label:r(i)}}},[k?.groupByField,M]),lt=(0,N.useMemo)(()=>{let e=k?.assigneeField;if(!e)return;let t=M?.fields??{},n=(e,t)=>{if(!t)return;let n=e;for(let e of t.split(`.`)){if(n==null)return;n=n[e]}return n},r=n=>{let r=(t[e]??t[e.split(`.`)[0]])?.options;if(Array.isArray(r)&&r.length){let e=r.find(e=>String(e.value)===String(n));if(e)return e.label}if(typeof n==`object`&&n){let e=n;return String(e.name??e.label??e.title??e.id??n)}return String(n)};return t=>{let i=n(t.data,e);return i==null||i===``?null:{key:typeof i==`object`&&i?String(i.id??i._id??r(i)):i,label:r(i)}}},[k?.assigneeField,M]),ut=(0,N.useMemo)(()=>{let e=k?.effortField;if(e)return t=>{let n=t.data?.[e],r=Number(n);return Number.isFinite(r)&&r>0?r:1}},[k?.effortField]),dt=(0,N.useMemo)(()=>{let t=e.skipWeekends,n=e.holidays;if(t||n&&n.length!==0)return{skipWeekends:!!t,holidays:n&&n.length?new Set(n):void 0}},[e]),ft=(0,N.useMemo)(()=>pt(k?.timeSegments),[k?.timeSegments]),B=(0,N.useCallback)((e,t)=>{if(!e||!t)return null;let n=e;for(let e of t.split(`.`)){if(n==null)return null;n=n[e]}if(n==null||n===``)return null;if(typeof n==`object`){let e=n;return String(e.id??e._id??e.value??e.name??``)}return String(n)},[]),mt=k?.quickFilters,[ht,gt]=(0,N.useState)({});(0,N.useEffect)(()=>{if(!mt?.length||!t||typeof t.find!=`function`)return;let e=M?.fields??{},n=!1;return(async()=>{let r={};for(let n of mt){if(n.options)continue;let i=e[n.field]??e[n.field.split(`.`)[0]],a=i?.type;if(a!==`lookup`&&a!==`master_detail`)continue;let o=i?.reference;if(o)try{let e=await t.find(o,{$top:1e3}),i=Te(e);r[n.field]=i.map(e=>({value:String(e.id??e._id??e.value??``),label:String(e.name??e.label??e.title??e.id??e._id??``)}))}catch(e){console.warn(`[ObjectGantt] Failed to load quick-filter options for "${n.field}":`,e)}}n||gt(e=>({...e,...r}))})(),()=>{n=!0}},[JSON.stringify(mt),t,M]);let vt=(0,N.useMemo)(()=>{if(!mt?.length)return[];let e=M?.fields??{};return mt.map(t=>{let n=e[t.field]??e[t.field.split(`.`)[0]],r=t.label??n?.label??ge(t.field),i;if(t.options?.length)i=t.options.map(e=>typeof e==`object`?{value:String(e.value),label:String(e.label??e.value)}:{value:String(e),label:String(e)});else if(Array.isArray(n?.options)&&n.options.length)i=n.options.map(e=>({value:String(e.value??e),label:String(e.label??e.value??e)}));else if(ht[t.field]?.length)i=ht[t.field];else{let e=new Map;for(let n of b){let r=B(n,t.field);if(r!=null&&!e.has(r)){let i=n;for(let e of t.field.split(`.`))i=i?.[e];let a=i&&typeof i==`object`?String(i.name??i.label??i.title??r):r;e.set(r,a)}}i=[...e.entries()].map(([e,t])=>({value:e,label:t}))}return{field:t.field,label:r,options:i}})},[mt,M,ht,b,B]),yt=e.persistLayout===!1?void 0:`${e.objectName||(ze?.provider===`object`?ze.object:``)||`gantt`}:${e.viewName||`default`}`,bt=yt?`gantt-layout:${yt}:filters`:null,[xt,St]=(0,N.useState)(()=>{if(!bt||typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(bt)||`null`);if(!e||typeof e!=`object`||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e))Array.isArray(r)&&(t[n]=r.filter(e=>typeof e==`string`));return t}catch{return{}}}),Ct=(0,N.useCallback)(()=>{if(!(!bt||typeof window>`u`))try{window.localStorage.setItem(bt,JSON.stringify(xt))}catch{}},[bt,xt]),wt=(0,N.useCallback)((e,t)=>{St(n=>({...n,[e]:t}))},[]),Et=(0,N.useCallback)(()=>St({}),[]),Dt=(0,N.useCallback)(e=>!!k?.objectField&&!String(e?.[k.objectField]??``).trim(),[k?.objectField]),Ot=(0,N.useCallback)(e=>{let t=(k?.objectField?String(e[k.objectField]??``).trim():``)||j,n=e.id??e._id;if(!t||n==null)return null;let r=j?Qe(j,n):null;return{objectName:t,recordId:n,href:!j||t===j?r:r?.replace(`/${j}/record/`,`/${t}/record/`)??null}},[k?.objectField,j]),kt=(0,N.useMemo)(()=>{let e=Object.entries(xt).filter(([,e])=>e.length>0);if(!e.length)return z;let t=new Map(z.map(e=>[String(e.id),e])),n=new Set;for(let r of z){if(!e.every(([e,t])=>{let n=B(r.data,e);return n!=null&&t.includes(n)}))continue;let i=r;for(;i&&!n.has(String(i.id));)n.add(String(i.id)),i=i.parent==null?void 0:t.get(String(i.parent))}return z.filter(e=>n.has(String(e.id)))},[z,xt,B]),H=(0,N.useMemo)(()=>{if(k?.autoZoomToFilter!==!1||!z.length)return null;let e=1/0,t=-1/0;for(let n of z){let r=n.start.getTime(),i=n.end.getTime();e=Math.min(e,r),t=Math.max(t,i>r?i-1:r)}return{start:new Date(e),end:new Date(t)}},[z,k?.autoZoomToFilter]),At=e.navigation??{mode:`drawer`},jt=At.mode===`drawer`||At.mode===`modal`||At.mode===`split`||At.mode===`popover`,Mt=(0,N.useCallback)((e,t)=>{if(typeof window>`u`)return;let n=String(e),r=z.find(e=>{let t=e.data;return!!t&&String(t.id??t._id)===n})?.data,i=r?Ot(r)?.href??null:j?Qe(j,e):null;if(i){if(t===`new_window`){window.open(i,`_blank`);return}window.history.pushState({},``,i),window.dispatchEvent(new PopStateEvent(`popstate`))}},[z,Ot,j]),U=De({navigation:At,objectName:e.objectName,onNavigate:Mt,onRowClick:jt?void 0:a}),{anchorRef:Nt,anchorCaptureProps:Pt}=c(),[Ft,It]=(0,N.useState)(null),Lt=U.isOverlay&&U.isOpen?U.selectedRecord:null;(0,N.useEffect)(()=>{if(!Lt){It(null);return}let e=Ot(Lt);if(!e){It(null);return}let{objectName:n,recordId:r}=e;if(ze?.provider!==`api`&&n===j||!t||typeof t.findOne!=`function`){It(null);return}let i=`${n}:${r}`,a=!1;return(async()=>{try{let[e,o]=await Promise.all([t.findOne(n,String(r)),typeof t.getObjectSchema==`function`?t.getObjectSchema(n).catch(()=>null):Promise.resolve(null)]);a||It(e?{key:i,record:e,schema:o}:null)}catch(e){console.error(`[ObjectGantt] Failed to fetch drawer record, falling back to row payload:`,e),a||It(null)}})(),()=>{a=!0}},[Lt,Ot,ze?.provider,j,t]);let Rt=(0,N.useCallback)(async(e,t)=>{if(!k||!A||typeof A.update!=`function`)return;let{startDateField:n,endDateField:r,titleField:i,progressField:a}=k,o=M?.fields,s=e.data??{},c=_t(k.timeZone),l={};if(t.start instanceof Date&&(l[n]=Cn(t.start,o?.[n]?.type,s[n],c)),t.end instanceof Date&&(l[r]=Cn(t.end,o?.[r]?.type,s[r],c,`end`)),typeof t.title==`string`&&i&&(l[i]=t.title),typeof t.progress==`number`&&a&&(l[a]=t.progress),Object.keys(l).length===0)return;let u=e.data?.id??e.data?._id??e.id;if(u==null)return;let d=b;x(e=>e.map(e=>String(e.id??e._id)===String(u)?{...e,...l}:e));try{await A.update(j,String(u),l),it({silent:!0})}catch(e){console.error(`[ObjectGantt] Failed to persist task update:`,e),x(d),Ie(e)}},[k,A,j,b,it,Ie,M]),zt=(e,t)=>{let n=t.some(e=>typeof e==`object`&&e.type&&e.type!==`fs`);return!n&&typeof e==`string`?t.map(e=>String(typeof e==`object`?e.id:e)).join(`,`):n?t.map(e=>typeof e==`object`?e.type&&e.type!==`fs`?{id:e.id,type:e.type}:e.id:e):t.map(e=>typeof e==`object`?e.id:e)},W=(0,N.useCallback)(async(e,t,n)=>{let r=k?.dependenciesField;if(!r||!A||typeof A.update!=`function`)return;let i=zt(t,n),a=b;x(t=>t.map(t=>String(t.id??t._id)===String(e)?{...t,[r]:i}:t));try{await A.update(j,String(e),{[r]:i}),it({silent:!0})}catch(e){console.error(`[ObjectGantt] Failed to persist dependency:`,e),x(a),Ie(e)}},[k,A,j,b,it,Ie]),Bt=(0,N.useCallback)(async(e,t,n=`fs`)=>{let r=e.data?.id??e.data?._id??e.id,i=t.data?.id??t.data?._id??t.id;if(r==null||i==null)return;let a=k?.dependenciesField;if(!a)return;let o=b.find(e=>String(e.id??e._id)===String(i))?.[a],s=yn(o),c=e=>String(typeof e==`object`?e.id:e),l=s.find(e=>c(e)===String(r)),u=l&&typeof l==`object`?l.type??`fs`:`fs`;if(l&&u===n)return;let d=n===`fs`?r:{id:r,type:n},f=l?s.map(e=>c(e)===String(r)?d:e):[...s,d];await W(i,o,f)},[k,b,W]),Vt=(0,N.useCallback)(async(e,t)=>{let n=e.data?.id??e.data?._id??e.id,r=t.data?.id??t.data?._id??t.id;if(n==null||r==null)return;let i=k?.dependenciesField;if(!i)return;let a=b.find(e=>String(e.id??e._id)===String(r))?.[i],o=yn(a),s=e=>String(typeof e==`object`?e.id:e),c=o.filter(e=>s(e)!==String(n));c.length!==o.length&&await W(r,a,c)},[k,b,W]),[Ht,Ut]=(0,N.useState)(null),[Wt,Gt]=(0,N.useState)(!1),Kt=(0,N.useCallback)(e=>{Ut(e)},[]),qt=(0,N.useCallback)(async()=>{if(!Ht)return;if(!A?.delete){Ut(null);return}let e=Ht.data?.id??Ht.data?._id??Ht.id;if(e==null){Ut(null);return}Gt(!0);let t=b;x(t=>t.filter(t=>String(t.id??t._id)!==String(e)));try{if(await A.delete(j,String(e))===!1)throw Error(O(`gantt.writeFailed`));Ut(null),it({silent:!0})}catch(e){console.error(`[ObjectGantt] Failed to delete:`,e),x(t),Ut(null),Ie(e)}finally{Gt(!1)}},[Ht,A,j,b,it,Ie,O]);if(ue)return(0,V.jsx)(`div`,{className:n,children:(0,V.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,V.jsx)(`div`,{className:`text-muted-foreground`,children:`Loading Gantt chart...`})})});if(he)return(0,V.jsx)(`div`,{className:n,children:(0,V.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,V.jsxs)(`div`,{className:`text-destructive`,children:[`Error: `,he.message]})})});if(!k)return(0,V.jsx)(`div`,{className:n,children:(0,V.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,V.jsx)(`div`,{className:`text-muted-foreground`,children:`Gantt configuration required. Please specify startDateField, endDateField, and titleField.`})})});let Jt=n=>{if(!U.isOverlay||!U.isOpen||!U.selectedRecord)return null;let r=U.selectedRecord,i=Ot(r);if(!i||Dt(r))return null;let{objectName:a,recordId:o}=i,s=i.href??void 0,c=k?.titleField?String(r[k.titleField]??O(`gantt.drawer.fallbackTitle`)):O(`gantt.drawer.fallbackTitle`),l=!!e.readOnly||(k?.lockField?!!r[k.lockField]:!1),d=Ft?.key===`${a}:${o}`?Ft:null,f=d?.record??r,p=d?.schema??(a===j?M:void 0),m=d&&t?t:A;return(0,V.jsx)(h,{...U,title:c,mainContent:n,popoverAnchorRef:Nt,storageKey:u(a),legacyStorageKey:ce(a),width:U.width??`min(960px, 60vw)`,children:()=>(0,V.jsx)(`div`,{className:`px-6 pt-6 pb-6`,children:(0,V.jsx)(Ze,{record:f,objectName:a,recordId:o,dataSource:m??void 0,objectSchema:p,onClose:U.close,fullPageHref:s,onFieldSave:l?void 0:async(e,t)=>{if(m?.update){try{await m.update(a,String(o),{[e]:t})}catch(e){let t=bn(e);throw t?Error(t):e}d&&It(n=>n&&n.key===d.key?{...n,record:{...n.record,[e]:t}}:n),x(n=>n.map(n=>String(n.id??n._id)===String(o)?{...n,[e]:t}:n)),it({silent:!0})}},onDelete:l?void 0:async()=>{if(A?.delete){try{if(await A.delete(a,String(o))===!1)throw Error(O(`gantt.writeFailed`))}catch(e){throw Ie(e),e}x(e=>e.filter(e=>String(e.id??e._id)!==String(o)))}}})})})},Yt=(0,V.jsxs)(`div`,{className:l(`flex h-full min-h-0 flex-col`,n),...Pt,children:[vt.length>0&&(0,V.jsx)(gn,{filters:vt,value:xt,onChange:wt,onClear:Et,resultCount:kt.length,totalCount:z.length,labels:{all:O(`gantt.quickFilter.all`),clear:O(`gantt.quickFilter.clear`),empty:O(`gantt.quickFilter.empty`),resultSummary:(e,t)=>O(`gantt.quickFilter.resultSummary`).replace(`{shown}`,String(e)).replace(`{total}`,String(t))}}),(0,V.jsxs)(`div`,{className:`relative flex-1 min-h-[420px]`,children:[(0,V.jsx)(ne,{active:Xe,ariaLabel:O(`gantt.aria.refreshing`)}),k?.resourceView&&lt?(0,V.jsx)(ln,{tasks:kt,assignee:lt,effort:ut,capacity:k?.capacity??1,viewMode:k?.viewMode||`day`}):(0,V.jsx)(en,{tasks:kt,viewMode:k?.viewMode,startDate:H?.start,endDate:H?.end,onTaskClick:e=>{Dt(e.data)||U.handleClick(e.data),r?.(e.data)},onTaskUpdate:Rt,onTaskDelete:Kt,onDependencyCreate:k?.dependenciesField?Bt:void 0,onDependencyDelete:k?.dependenciesField?Vt:void 0,markers:e.markers,autoSchedule:!!k?.dependenciesField,rescheduleOnConflict:!!k?.dependenciesField,criticalPathDefault:!!e.criticalPath,workingCalendar:dt,shiftSegments:ft,showBaselines:e.showBaselines!==!1,readOnly:!!e.readOnly,mobileReadOnly:e.mobileReadOnly!==!1,persistLayoutKey:yt,onLayoutChange:bt?Ct:void 0,groupBy:ct,defaultCollapsedDepth:k?.defaultCollapsedDepth,summaryExtent:k?.summaryExtent,interactions:k?.interactions,dependencyTypes:k?.dependencyTypes,timeZone:k?.timeZone,onBeforeTaskUpdate:s,exportFileName:String(k?.exportFileName??o(e.label,Ae)??M?.label??e.objectName??``)||void 0,inlineEdit:!0,onRefresh:(ze?.provider===`object`||ze?.provider===`api`)&&typeof A?.find==`function`?()=>it({silent:!0}):void 0,refreshing:Xe})]}),xe&&(0,V.jsx)(we,{result:xe}),(0,V.jsx)(ee,{open:!!Ht,onOpenChange:e=>{!e&&!Wt&&Ut(null)},children:(0,V.jsxs)(ie,{children:[(0,V.jsxs)(p,{children:[(0,V.jsx)(se,{children:O(`gantt.delete.title`)}),(0,V.jsx)(y,{children:Ht?O(`gantt.delete.body`,{title:Ht.title}):null})]}),(0,V.jsxs)(v,{children:[(0,V.jsx)(oe,{disabled:Wt,children:O(`gantt.delete.cancel`)}),(0,V.jsx)(te,{onClick:e=>{e.preventDefault(),qt()},disabled:Wt,"data-testid":`gantt-delete-confirm`,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:O(Wt?`gantt.delete.deleting`:`gantt.delete.confirm`)})]})]})})]});if(U.isOverlay&&U.mode===`split`&&U.isOpen&&U.selectedRecord){let e=Jt(Yt);if(e)return(0,V.jsx)(V.Fragment,{children:e})}return(0,V.jsxs)(V.Fragment,{children:[Yt,Jt()]})},An=t({GanttView:()=>en,ObjectGantt:()=>kn,ObjectGanttRenderer:()=>jn,QuickFilterBar:()=>gn,ResourceWorkload:()=>ln,bandAt:()=>ht,computeWorkload:()=>nn,normalizeDependencies:()=>yn,normalizeShiftSegments:()=>pt,normalizeTaskType:()=>_n,parseHHMM:()=>B,shiftDayStart:()=>mt}),K={filter:!0,sort:!0},jn=x(({schema:e})=>{let{dataSource:t}=Se()||{},n=t??void 0;return(0,V.jsx)(ke,{schema:e,mapping:K,dataSource:n,testId:`object-gantt`,errorTitle:`This gantt chart’s data source could not be resolved`,children:e=>(0,V.jsx)(kn,{schema:e,dataSource:n})})});he.register(`object-gantt`,jn,{namespace:`plugin-gantt`,label:`Object Gantt`,category:`view`,inputs:[{name:`objectName`,type:`string`,description:"ObjectQL object name. The record source is one of `data`, `staticData` and `objectName`; the `object-gantt` schema refuses a block that declares none of them, unless the node's `dataSource.object` names the object, which then lands on this key."},{name:`gantt`,type:`object`,description:"Gantt-timeline configuration, the author face — the same block `ListViewSchema.gantt` declares, and the one the renderer validates this node against. Taken WHOLE when present: the flat top-level spelling beside it is ignored. The spec requires `startDateField`, `endDateField` and `titleField`, which name the record fields a task's bar starts at, ends at and is titled by; the other members (`progressField`, `colorField`, `dependenciesField`, `parentField`, `viewMode`, `exportFileName`, …) are optional."},{name:`data`,type:`object`,description:"A `{ provider, … }` data-source configuration, read FIRST on the record-source ladder: a gantt carrying one never reaches `staticData` and never queries `objectName`. `{ provider: 'value', items }` charts those rows, `{ provider: 'object', object }` queries that object and `{ provider: 'api', read }` reads through that request. A bare array is not this key’s shape and is not a record source: the gantt falls through to `staticData`, then `objectName`, so inline rows belong under `staticData`."},{name:`staticData`,type:`array`,description:"Inline records, read SECOND on the record-source ladder: a `data` configuration wins and this key is then never reached, while `objectName` is read AFTER it, so a gantt carrying both charts these rows and never queries that object. `filter` and `sort` narrow and order these rows exactly as they do fetched ones."},{name:`filter`,type:`array`,description:"Base query filter in the rule-array form `[{ field, operator, value }, ...]`, narrowing the tasks the gantt charts — from every record source it reads: the object, an `api` request, or inline rows. Context tokens such as `{current_user_id}` are resolved first, then the filter is lowered to `$filter` on the query. The MongoDB-style record form is not this key’s shape."},{name:`sort`,type:`array`,description:"Task order in `[{ field, order }]` form, ordering the rows the gantt charts. Lowered to `$orderby` on the same query."},{name:`navigation`,type:`object`,description:"What a task click opens — the `{ mode, size, openNewTab, preventNavigation }` block a list view declares. With the key ABSENT a click opens the task's record in a drawer, this renderer's own default. `mode` is an overlay (`drawer`, `modal`, `split`, `popover`), `new_window`, `page` or `none`, and a block written without `mode` takes the spec's `page` default. `drawer`, `modal` and `popover` open the task's record in that overlay, and `split` opens it beside the chart, which stays drawn; `none` opens nothing. `page` opens the task's record page in the same tab and `new_window` opens it in a new tab. The gantt builds that address itself from the page it is on and does not use a record navigator the host publishes, so a host that publishes one changes nothing: on the object's own list or view route (`…/OBJECT/view/VIEW`) the address is the record page `…/OBJECT/record/ID`, while on any other page, such as a custom page, `/OBJECT/record/ID` is appended to the current address. The object is `data.object` when `data` is the object provider, else `objectName`; on inline rows that name neither there is no record to open, and every mode, the default drawer included, opens nothing. `preventNavigation: true` opens nothing whatever the mode, `openNewTab: true` opens the record page in a new tab and outranks every mode except `none`, and `size` sets the overlay width."},{name:`label`,type:[`string`,`object`],description:'Gantt label — the second link of the exported PNG/PDF file-name chain, after `gantt.exportFileName` and before the bound object\'s own label. A string is used as written, and an inline locale map (`{ en, "zh-CN", … }`) gives the entry for the display locale. The chart draws it nowhere else.'},{name:`skipWeekends`,type:`boolean`,description:`Measure duration and auto-schedule math in WORKING days, skipping Saturdays and Sundays. The day view also folds the Saturday and Sunday columns out of its axis.`},{name:`holidays`,type:`array`,of:`string`,description:"Additional non-working dates for the working calendar, ISO `yyyy-mm-dd` strings; folded into a Set for the duration math. A non-empty list turns the working calendar on by itself, without `skipWeekends`, and the day view folds each listed date's column out of its axis."},{name:`persistLayout`,type:`boolean`,description:"Opt OUT of layout and filter-chip persistence — only an explicit `false` disables it; the storage key is `objectName:viewName`. The object half is `objectName`, else `data.object`, and `gantt` on inline rows that name neither. With `false` the toolbar has no save-layout button and nothing is stored."},{name:`viewName`,type:`string`,description:"Layout-persistence scope, the second half of the `objectName:viewName` storage key (renderer default `'default'`). Two gantts on the same object with different names keep separate saved layouts, and a gantt restores only the layout saved under its own name."},{name:`markers`,type:`array`,description:"Extra vertical reference lines drawn like the Today marker ({ date, label?, color? }). `date` places the line, and a date outside the chart's range draws none; `label` is the text drawn against it; `color` is its CSS colour, the theme's primary colour when omitted."},{name:`criticalPath`,type:`boolean`,description:`Seed the critical-path highlight ON; the toolbar toggle stays available either way`},{name:`showBaselines`,type:`boolean`,description:"Render the planned-vs-actual baseline bars — ON unless an explicit `false` disables it. A task draws one only when `gantt.baselineStartField` and `gantt.baselineEndField` give it both baseline dates."},{name:`readOnly`,type:`boolean`,description:`Disable every write path on this gantt and lock the record drawer. A task click still opens the record, read-only.`},{name:`mobileReadOnly`,type:`boolean`,description:"Auto read-only on narrow viewports — ON unless an explicit `false` disables it. Narrow is under 640px: the chart's own width once it is measured, the viewport's until then. A narrow chart's own write paths are gated as under `readOnly`, read-only badge included, but the record drawer is locked by `readOnly` alone, so a task's record still opens writable. `false` keeps a narrow chart editable, and `readOnly: true` locks the chart and the drawer at any width."}]});export{An as t};