decocms 4.584.16 → 4.585.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 (436) hide show
  1. package/dist/client/assets/{AlertCircle-ee1sjQGr.js → AlertCircle-rt5NTcOt.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CNSKfZ8O.js → AreaChart-CX9a7r2e.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BhV4BHrM.js → ArrowLeft-BtflI84P.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-3kziivNC.js → ArrowRight-DckDNEPN.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DgFMMMBQ.js → ArrowUp-BX9rle-Z.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-C9X5S-cQ.js → BookOpen01-Cdt9znE-.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-DuA35Ksh.js → CartesianChart-BjWXwRV3.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-cy5wvzih.js → CategoricalChart-DAGT6hYP.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-CGqAjggj.js → CheckCircle-DQ8gl2jA.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-CGJhfuSb.js → ChevronDown-88QbtNjw.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-5-TBPpUz.js → ChevronSelectorVertical-BfhN49CO.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-BO9DemUb.js → ChevronUp-BwBBvXr-.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-BLkqiDJW.js → CreditCard01-CHpJYShR.js} +1 -1
  14. package/dist/client/assets/{Eye-CO_nPZKQ.js → Eye-C8bzWtOv.js} +1 -1
  15. package/dist/client/assets/{File02-DclovfNb.js → File02-CpMe0sR1.js} +1 -1
  16. package/dist/client/assets/{Globe04-Cx-w92u5.js → Globe04-BGaPJwRM.js} +1 -1
  17. package/dist/client/assets/{Image01-CeQMNu9o.js → Image01-CyjafdfK.js} +1 -1
  18. package/dist/client/assets/{Key01-DMjKHzPy.js → Key01-NBdT0O9W.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-BPF5UUkD.js → LayoutLeft-BI23EoSs.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-BN3icH6a.js → LinkBroken01-DWWxoD2s.js} +1 -1
  21. package/dist/client/assets/{MessageCircle01-jm5EAYEs.js → MessageCircle01-pdZ3c0Ei.js} +1 -1
  22. package/dist/client/assets/{Minus-DoUm1n95.js → Minus-ToHFKPwl.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CM0DIJ9E.js → Monitor01-DQ2oaJ_f.js} +1 -1
  24. package/dist/client/assets/{Play-I05hjYId.js → Play-Dgyu5PiH.js} +1 -1
  25. package/dist/client/assets/{Plus-B_KK3A4P.js → Plus-NIlBePVH.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-DxKvZdt8.js → ReferenceLine-SNMItkZP.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BlPJmXQo.js → SearchMd-BZFf7uAm.js} +1 -1
  28. package/dist/client/assets/{ShoppingBag01-XH61oInk.js → ShoppingBag01-CA3tpOzv.js} +1 -1
  29. package/dist/client/assets/{Sun-CYr05wwt.js → Sun-CGayzxv4.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CGFn_psg.js → SwitchHorizontal01-BCndh-XX.js} +1 -1
  31. package/dist/client/assets/{Tool01-Cnkd4pP7.js → Tool01-CRE8Zr1E.js} +1 -1
  32. package/dist/client/assets/{Tooltip-CwwzGu8p.js → Tooltip-DB98MWaY.js} +1 -1
  33. package/dist/client/assets/{Trash01-CnPGIwZe.js → Trash01-C1sTtIQd.js} +1 -1
  34. package/dist/client/assets/{TrendUp01-BlwMDcra.js → TrendUp01-CkF2n8Hn.js} +1 -1
  35. package/dist/client/assets/{Upload01-Bfre-QV-.js → Upload01-DF54M6Ph.js} +1 -1
  36. package/dist/client/assets/{UserCheck01-CcIH7s2N.js → UserCheck01-D14kK5BQ.js} +1 -1
  37. package/dist/client/assets/{UserSquare-CUb4s2-c.js → UserSquare-DAFK733H.js} +1 -1
  38. package/dist/client/assets/{Users01-BaPkNO1v.js → Users01-8BTVWXNl.js} +1 -1
  39. package/dist/client/assets/{XClose-CtxnajtG.js → XClose-igHVZF4W.js} +1 -1
  40. package/dist/client/assets/{Zap-D4dSEKpa.js → Zap-CZUa6DWb.js} +1 -1
  41. package/dist/client/assets/{access-gate-BcSivdgh.js → access-gate-DT-H-Dma.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-BqEJyMSP.js → add-connection-dialog-CmjWx4NO.js} +1 -1
  43. package/dist/client/assets/agent-app-mFu4qfV_.js +1 -0
  44. package/dist/client/assets/agent-assets-CJbN5bjE.js +1 -0
  45. package/dist/client/assets/{agent-automation-CJwwEuNT.js → agent-automation-DQLWalf1.js} +1 -1
  46. package/dist/client/assets/{agent-automations-CQfQpku1.js → agent-automations-DyupYjyf.js} +1 -1
  47. package/dist/client/assets/{agent-blog-BdGPQ8_2.js → agent-blog-oFjylmup.js} +2 -2
  48. package/dist/client/assets/{agent-blog-post-B9pgUtDH.js → agent-blog-post-DN9dxO82.js} +2 -2
  49. package/dist/client/assets/{agent-calendar-JLP2GBTa.js → agent-calendar-CbXz7NvX.js} +1 -1
  50. package/dist/client/assets/{agent-capabilities-CYFGwKOQ.js → agent-capabilities-B2Kb_ijp.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-DDUrjmJD.js → agent-connect-sources-rfNCNIVh.js} +1 -1
  52. package/dist/client/assets/agent-deck-Bw2cZE6R.js +1 -0
  53. package/dist/client/assets/{agent-e2e-R2Brb1AY.js → agent-e2e-DintiVYM.js} +1 -1
  54. package/dist/client/assets/agent-experiments-DxbZHSvE.js +1 -0
  55. package/dist/client/assets/agent-file-B4IdGvOa.js +1 -0
  56. package/dist/client/assets/{agent-hosting-ZtddB8HN.js → agent-hosting-BW8Utp_Y.js} +1 -1
  57. package/dist/client/assets/{agent-icon-DFyNTmmD.js → agent-icon-BJ2Wx2fE.js} +1 -1
  58. package/dist/client/assets/agent-library-1XqTmW3J.js +1 -0
  59. package/dist/client/assets/agent-library-file-BQTvQaVH.js +1 -0
  60. package/dist/client/assets/agent-overview-nv0B1Vtn.js +1 -0
  61. package/dist/client/assets/{agent-releases-CSV4AdrC.js → agent-releases-D-COO9bm.js} +1 -1
  62. package/dist/client/assets/agent-settings-DmrVI6B5.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-Du4ljJT4.js → agent-site-editor-CRztMY23.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-CNRH9GQU.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-BB_PWv5l.js +1 -0
  66. package/dist/client/assets/agent-site-editor-preview-CN6P394O.js +1 -0
  67. package/dist/client/assets/agent-view-C_kbJ6jO.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-BkW43e8G.js → agent-view-guard-X-bc2zlR.js} +1 -1
  69. package/dist/client/assets/{ai-providers-B2F4VTfq.js → ai-providers-D8Mc6Vyc.js} +1 -1
  70. package/dist/client/assets/{alert-DaQbIayT.js → alert-_oqAOD6X.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-CDIiyHbJ.js → analytics-sections-DQPy3uP4.js} +1 -1
  72. package/dist/client/assets/{api-keys-DV2qjs1c.js → api-keys-D9ZKdCDY.js} +1 -1
  73. package/dist/client/assets/api-keys-D_uSLlKH.js +1 -0
  74. package/dist/client/assets/{app-editor-CsjRVENv.js → app-editor-CC7vXN9x.js} +1 -1
  75. package/dist/client/assets/asset-utils-DDL7Zhst.js +1 -0
  76. package/dist/client/assets/{auth-sBxX13D1.js → auth-DdGqjHXO.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-C4NbHq82.js → auth-catchall-CmxNn2GB.js} +1 -1
  78. package/dist/client/assets/{auth-entry-CeA6avaA.js → auth-entry-C_97myXT.js} +1 -1
  79. package/dist/client/assets/{auth-split-layout-DFVyplfm.js → auth-split-layout-BiPDNEOk.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-Cd-20mVj.js → authenticate-and-persist-oauth-ZxRhWemt.js} +1 -1
  81. package/dist/client/assets/{automation-list-row-DIz_7uV6.js → automation-list-row-mqAbrUKE.js} +1 -1
  82. package/dist/client/assets/{automation-runs-U9DXMN_I.js → automation-runs-D2e4MXIM.js} +1 -1
  83. package/dist/client/assets/{automations-DLrTFxh8.js → automations-B4kujL15.js} +1 -1
  84. package/dist/client/assets/{badge-Ba_DCLD5.js → badge-C-0ziPev.js} +1 -1
  85. package/dist/client/assets/{block-document-Aq3OAP33.js → block-document-DWg9Jn1G.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-1Hmusp23.js → blocks-preview-workspace-context-DhEK2mBx.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-0NdQhV1f.js → blocks-tab-states-pUzFXPTK.js} +1 -1
  88. package/dist/client/assets/{blog-preview-url-Dih-dMCw.js → blog-preview-url-BOmxSryn.js} +1 -1
  89. package/dist/client/assets/{blog-schema-CYnX2CMq.js → blog-schema-CE1tBnsD.js} +1 -1
  90. package/dist/client/assets/{blog-source-gate-CWWyUoRi.js → blog-source-gate-V0t8xMYW.js} +1 -1
  91. package/dist/client/assets/{blog-view-gate-oE1gHZMz.js → blog-view-gate-BO7XupIe.js} +1 -1
  92. package/dist/client/assets/{buckets-Bh4QpekX.js → buckets-D_a3q7Rp.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-CPww4N3Z.js → build-improve-prompt-doc-BGzcibxZ.js} +1 -1
  94. package/dist/client/assets/{calendar-i6vH9oRA.js → calendar-DXtndUQf.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-LShIU80A.js → capability-load-error-BYOGvrqt.js} +1 -1
  96. package/dist/client/assets/{category-editor-BLagxgQw.js → category-editor-j7sSG9YT.js} +1 -1
  97. package/dist/client/assets/{category-tree-CO_9m-hw.js → category-tree-CqfxuXDr.js} +1 -1
  98. package/dist/client/assets/{chart-C99PxQ8i.js → chart-CzbHqflS.js} +1 -1
  99. package/dist/client/assets/{chat-context-ZeSpVj2j.js → chat-context-CzmbAHe8.js} +1 -1
  100. package/dist/client/assets/{chat-draft-DixXhuAl.js → chat-draft-CMZymjc1.js} +1 -1
  101. package/dist/client/assets/{checkbox-yHZpOTt9.js → checkbox-CnO5GKzb.js} +1 -1
  102. package/dist/client/assets/{choose-editor-Ow8vFSp1.js → choose-editor-DSLflE6y.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-DRGrIbSu.js → cli-auth-success-DW_MXZoK.js} +1 -1
  104. package/dist/client/assets/{cms-settings-editor-D6qGypvL.js → cms-settings-editor-VV8k-MFF.js} +1 -1
  105. package/dist/client/assets/{cms-store-drafts-CLXsr0b9.js → cms-store-drafts-D_kzaiOk.js} +1 -1
  106. package/dist/client/assets/{collapsible-Dc4ca33I.js → collapsible-Czfx-LAp.js} +1 -1
  107. package/dist/client/assets/{collection-detail-D2do5Te9.js → collection-detail-2JRT-w_Q.js} +1 -1
  108. package/dist/client/assets/{collection-display-button-R9esRwsq.js → collection-display-button-DkpROg50.js} +1 -1
  109. package/dist/client/assets/{collection-search-CWJ6AHHK.js → collection-search-fi8Jpdhv.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-D1qYH_Vr.js → collection-table-wrapper-B8CD5YXs.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-CCJoVQ-t.js → collection-tabs-C_tkgeK_.js} +1 -1
  112. package/dist/client/assets/{combobox-Cc5RijV8.js → combobox-Q8ZHlgvG.js} +1 -1
  113. package/dist/client/assets/{command-Dg1M4JCf.js → command-Bq8LzPoY.js} +1 -1
  114. package/dist/client/assets/{companion-mcps-section-DWH_OPav.js → companion-mcps-section-ATwmtkbj.js} +1 -1
  115. package/dist/client/assets/{config-CMcG5aXE.js → config-CpgY06XK.js} +1 -1
  116. package/dist/client/assets/{connect-DTJ8Lb0Z.js → connect-BEtqH7dw.js} +1 -1
  117. package/dist/client/assets/{connect-key-DwcLwXDe.js → connect-key-BIkvDwd3.js} +1 -1
  118. package/dist/client/assets/{connect-layout-B9Ri51_N.js → connect-layout-B_lgJ90N.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-DFoGY0c6.js → connect-source-dialog-GkRu49Gr.js} +1 -1
  120. package/dist/client/assets/{connection-D2P4B1Vm.js → connection-BGRWc-KI.js} +1 -1
  121. package/dist/client/assets/{connection-card-CTimlD0g.js → connection-card-BuyifKDO.js} +1 -1
  122. package/dist/client/assets/{connection-detail-CLq96SZi.js → connection-detail-DWfh1vBP.js} +1 -1
  123. package/dist/client/assets/{connection-form-helpers-C0MTL33k.js → connection-form-helpers-DVl_sDCj.js} +1 -1
  124. package/dist/client/assets/{connection-slug-CGQkx9BD.js → connection-slug-BU-gcFLx.js} +1 -1
  125. package/dist/client/assets/{connections-Blix3sTM.js → connections-CYCgeS9i.js} +1 -1
  126. package/dist/client/assets/{content-tab-DksWOtkz.js → content-tab-anxUFFKF.js} +3 -3
  127. package/dist/client/assets/{context-UEmVvZBl.js → context-DMfn82WA.js} +1 -1
  128. package/dist/client/assets/{context-menu-77Z4mScR.js → context-menu-lKQYrmaS.js} +1 -1
  129. package/dist/client/assets/{context-shell-n2LQX250.js → context-shell-DxJ2zBIa.js} +3 -3
  130. package/dist/client/assets/{create-organization-dialog-5XUNCI8z.js → create-organization-dialog-CovUQJjl.js} +1 -1
  131. package/dist/client/assets/{daily-pulse-B11Ng0jZ.js → daily-pulse-eYYXeJUB.js} +1 -1
  132. package/dist/client/assets/{delete-copy-B5PbKStF.js → delete-copy-bwY-nICG.js} +1 -1
  133. package/dist/client/assets/{device-hint-BlkEtJOD.js → device-hint-Eqj86kPk.js} +1 -1
  134. package/dist/client/assets/{discover-76bH9Npb.js → discover-fbAn9icf.js} +1 -1
  135. package/dist/client/assets/{domain-settings-DMjKDVZw.js → domain-settings-BFmlLB0B.js} +1 -1
  136. package/dist/client/assets/{drawer-DVCuatiz.js → drawer-cS0px3h4.js} +1 -1
  137. package/dist/client/assets/{editor-DKlObXWN.js → editor-DOCwgCVw.js} +1 -1
  138. package/dist/client/assets/{editor-classes-DlTZqfff.js → editor-classes-ByZrgCwF.js} +1 -1
  139. package/dist/client/assets/{empty-message-BydjGtkz.js → empty-message-BnLHUiLW.js} +1 -1
  140. package/dist/client/assets/{empty-state-B87jIRUF.js → empty-state-BNznQ4un.js} +1 -1
  141. package/dist/client/assets/{empty-state-DrDY2Uvy.js → empty-state-haYeO0--.js} +1 -1
  142. package/dist/client/assets/{experiments-tab-choice-B92_kGiq.js → experiments-tab-choice-gTPA_Mh1.js} +1 -1
  143. package/dist/client/assets/{extract-connection-data-BBZ3NAYt.js → extract-connection-data-DR98xre0.js} +1 -1
  144. package/dist/client/assets/{feature-gate-BldXfjSV.js → feature-gate-v3Hw92O6.js} +1 -1
  145. package/dist/client/assets/{feature-paywall-CYTrb2Hp.js → feature-paywall-_CmjErfx.js} +1 -1
  146. package/dist/client/assets/{file-explorer-BMmUp2yA.js → file-explorer-Dg2yjMkc.js} +1 -1
  147. package/dist/client/assets/{file-preview-DGOqiP3N.js → file-preview-DQmRHFMz.js} +1 -1
  148. package/dist/client/assets/{file-share-button-BAKT8NFv.js → file-share-button-5oty69zd.js} +1 -1
  149. package/dist/client/assets/{file-type-icon-sj_ejObJ.js → file-type-icon-5ukaLDeF.js} +1 -1
  150. package/dist/client/assets/{folder-icon-B9awY_eB.js → folder-icon-CKc3CbqF.js} +1 -1
  151. package/dist/client/assets/{form-FAPXIq7O.js → form-vgZJ8ykR.js} +1 -1
  152. package/dist/client/assets/{frame-navigation-CoYMhBUE.js → frame-navigation-uIOzC0fQ.js} +1 -1
  153. package/dist/client/assets/{gateway-client-BVWghiMF.js → gateway-client-CEz2o7p6.js} +1 -1
  154. package/dist/client/assets/{general-DMcbEh6R.js → general-CcVyD7wz.js} +1 -1
  155. package/dist/client/assets/{github-icon-KEAtk4MX.js → github-icon-CNkm_QOq.js} +1 -1
  156. package/dist/client/assets/{held-block-view-DDQtd2bN.js → held-block-view-DLTLVbz1.js} +1 -1
  157. package/dist/client/assets/{home-BemwUTPY.js → home-DEyrMuE0.js} +1 -1
  158. package/dist/client/assets/{home-overview-DJ3gY2Dz.js → home-overview-BJHC8k_H.js} +1 -1
  159. package/dist/client/assets/{hosted-reconcile-DVbA9MCD.js → hosted-reconcile-B7PmB0kg.js} +1 -1
  160. package/dist/client/assets/{icon-button-DmJB3HO5.js → icon-button-DAAwLc_Y.js} +1 -1
  161. package/dist/client/assets/index--QRH4qmO.css +1 -0
  162. package/dist/client/assets/{index-779PVYGV.js → index-AJsDmYGI.js} +1 -1
  163. package/dist/client/assets/{index-3k_nlNc7.js → index-BDs-2B47.js} +1 -1
  164. package/dist/client/assets/{index-BRgWMc-5.js → index-BMPeWdJw.js} +6 -6
  165. package/dist/client/assets/{index-CER3O-Er.js → index-BMmbX0gD.js} +1 -1
  166. package/dist/client/assets/{index-CEBVkeBV.js → index-BXSfOUsr.js} +1 -1
  167. package/dist/client/assets/{index-YHYnj2N1.js → index-Behj8iY8.js} +1 -1
  168. package/dist/client/assets/{index-CsHIpbTc.js → index-BuFUNk86.js} +1 -1
  169. package/dist/client/assets/{index-EBRxzWbP.js → index-CCPTG3M6.js} +1 -1
  170. package/dist/client/assets/{index-CSZLbM2Z.js → index-CKEvWalC.js} +1 -1
  171. package/dist/client/assets/{index-BiVCuU3V.js → index-CSLJLC25.js} +1 -1
  172. package/dist/client/assets/{index-g6kNIQoA.js → index-Cl6eQZzh.js} +1 -1
  173. package/dist/client/assets/{index-CH8HRuHa.js → index-Cm1vOK0e.js} +1 -1
  174. package/dist/client/assets/{index-DBsxQlkE.js → index-DASViI_L.js} +1 -1
  175. package/dist/client/assets/{index-0S6WDYoC.js → index-DGJ99-Gb.js} +1 -1
  176. package/dist/client/assets/{index-Bjhw4G6x.js → index-G68rd1Q1.js} +1 -1
  177. package/dist/client/assets/{index-DAQFQP6X.js → index-iNQuijBz.js} +1 -1
  178. package/dist/client/assets/{index-redirect-DLAKhZQB.js → index-redirect-CO9DsboT.js} +1 -1
  179. package/dist/client/assets/{index-CV9lAciS.js → index-uc8MAfE7.js} +1 -1
  180. package/dist/client/assets/{infiniteQueryObserver-DXDiLGwX.js → infiniteQueryObserver-BmYMm5wr.js} +1 -1
  181. package/dist/client/assets/{infra-billing-Ch38HLtg.js → infra-billing-BWqkgHts.js} +1 -1
  182. package/dist/client/assets/{input-Do8NvE59.js → input-BmsdW_BQ.js} +3 -3
  183. package/dist/client/assets/{input-CCPCHy_J.js → input-Bp705GAE.js} +1 -1
  184. package/dist/client/assets/{integration-icon-Cu3N1muw.js → integration-icon-xMpRZNbX.js} +1 -1
  185. package/dist/client/assets/{item-actions-C0r-FbzQ.js → item-actions-Bf8HZ-5j.js} +1 -1
  186. package/dist/client/assets/{jira-icon-D0RV1z5x.js → jira-icon-BMvTcIMX.js} +1 -1
  187. package/dist/client/assets/{label-DJG2lJG2.js → label-CRK3U7ZP.js} +1 -1
  188. package/dist/client/assets/{layout-ChdcSvGo.js → layout-CHGNZWxg.js} +1 -1
  189. package/dist/client/assets/{legacy-admin-welcome-dialog-BY_2I8tZ.js → legacy-admin-welcome-dialog-DpejN_Uy.js} +1 -1
  190. package/dist/client/assets/legacy-agents-deep-D1euSyKS.js +1 -0
  191. package/dist/client/assets/{legacy-main-redirect-D850qNA8.js → legacy-main-redirect-B3en36R6.js} +1 -1
  192. package/dist/client/assets/{library-tab-D8k_wDzC.js → library-tab-DC3m8XDz.js} +1 -1
  193. package/dist/client/assets/library-z4pMyMvK.js +1 -0
  194. package/dist/client/assets/{login-C5GNgjpJ.js → login-SeftNnF0.js} +1 -1
  195. package/dist/client/assets/{markdown-DPpPArEp.js → markdown-BWT_4WJH.js} +1 -1
  196. package/dist/client/assets/{mcp-app-renderer-D-1Hpjx-.js → mcp-app-renderer-YjPzFqL6.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-DAw9xmxO.js → mcp-oauth-DIu8HkzC.js} +1 -1
  198. package/dist/client/assets/{mcp-oauth-DMi3oCsH.js → mcp-oauth-DUQJVV6B.js} +1 -1
  199. package/dist/client/assets/{members-laM8OLrZ.js → members-CJTZpTtw.js} +1 -1
  200. package/dist/client/assets/{memory-DAAWauU_.js → memory-CLaxe2x0.js} +1 -1
  201. package/dist/client/assets/{mock-board-DVLeWzDj.js → mock-board-BaGiiwoI.js} +3 -3
  202. package/dist/client/assets/{monaco-editor-BHpOPihN.js → monaco-editor-BxMnwfXM.js} +1 -1
  203. package/dist/client/assets/{monitoring-D3l_Jm2m.js → monitoring-GRSBuzQc.js} +1 -1
  204. package/dist/client/assets/{monitoring-stats-row-Ri6ispwa.js → monitoring-stats-row-BBOPc2qP.js} +1 -1
  205. package/dist/client/assets/{multi-select-8e4MeokI.js → multi-select-DVZ3FnG7.js} +1 -1
  206. package/dist/client/assets/{mustache-DnvmVEAI.js → mustache-E-ICl6wm.js} +1 -1
  207. package/dist/client/assets/{named-rule-step-WtjJX5Mv.js → named-rule-step-ip9CKl8c.js} +1 -1
  208. package/dist/client/assets/{named-rule-view-DZ8Gl6w8.js → named-rule-view-BHX0uLb-.js} +1 -1
  209. package/dist/client/assets/{new-project-dialog-DEBFbTK4.js → new-project-dialog-IDVZ0s2M.js} +1 -1
  210. package/dist/client/assets/{new-project-store-CgLzwcjn.js → new-project-store-DBh8m9Ki.js} +1 -1
  211. package/dist/client/assets/{oauth-callback--6BD_yzu.js → oauth-callback-DjYIh0u9.js} +1 -1
  212. package/dist/client/assets/{oauth-callback-ai-provider-CcAwHHuH.js → oauth-callback-ai-provider-C3RLK51c.js} +1 -1
  213. package/dist/client/assets/{oauth-consent-DU2TXlly.js → oauth-consent-CECFMIBt.js} +1 -1
  214. package/dist/client/assets/{onboarding-CA0lTQst.js → onboarding-DRz0hsnB.js} +1 -1
  215. package/dist/client/assets/{openai-conversation-kPp7_oUZ.js → openai-conversation-Brbpa4hN.js} +1 -1
  216. package/dist/client/assets/{optimistic-project-sidebar-views-C9pyPAzF.js → optimistic-project-sidebar-views-Bc7ykqLS.js} +1 -1
  217. package/dist/client/assets/{order-monitor-day-xeVDnHLL.js → order-monitor-day-Bf9NXaQ2.js} +1 -1
  218. package/dist/client/assets/{organization-choice-CKU82eUy.js → organization-choice-a8tN-5b7.js} +1 -1
  219. package/dist/client/assets/{orgs-a8ldZbiZ.js → orgs-BH47tVjw.js} +1 -1
  220. package/dist/client/assets/{own-accounts-section-DhFCn8gz.js → own-accounts-section-_AetYnrA.js} +1 -1
  221. package/dist/client/assets/{pair-C-KXBar9.js → pair-Bonyggei.js} +1 -1
  222. package/dist/client/assets/{parse-sections-DPGRvqbM.js → parse-sections-B5CRYtt9.js} +2 -2
  223. package/dist/client/assets/{plan-D6JDzYbv.js → plan-Cb1ij9Nx.js} +1 -1
  224. package/dist/client/assets/{plan-ladder-DuXPk4c4.js → plan-ladder-B-wAiO1o.js} +1 -1
  225. package/dist/client/assets/{plan-usage-card-BdC1KTye.js → plan-usage-card-BhaN2UzC.js} +1 -1
  226. package/dist/client/assets/{popover-DGvrj6fy.js → popover-zwWAAqUd.js} +1 -1
  227. package/dist/client/assets/{post-calendar-DKGqFmih.js → post-calendar-B7jwyYDv.js} +1 -1
  228. package/dist/client/assets/{post-editor-7oUWGzCY.js → post-editor-DaufIzXa.js} +1 -1
  229. package/dist/client/assets/{preview-content-abo2ryKK.js → preview-content-AWMAtXmK.js} +1 -1
  230. package/dist/client/assets/{preview-dialog-CQi5mIZh.js → preview-dialog-BazGoe9K.js} +1 -1
  231. package/dist/client/assets/{preview-panel-CjmJmEqS.js → preview-panel-BUZpP8s8.js} +1 -1
  232. package/dist/client/assets/{preview-tab-DA1SyRp5.js → preview-tab-BiDrtTyp.js} +3 -3
  233. package/dist/client/assets/{product-picker-dialog-BXRcAQat.js → product-picker-dialog-Wj5snGI8.js} +1 -1
  234. package/dist/client/assets/{profile-DUghMPNx.js → profile-D-82qdYz.js} +1 -1
  235. package/dist/client/assets/project-app-view-BZ0asFCv.js +1 -0
  236. package/dist/client/assets/{project-apps-DiSx-TBF.js → project-apps-Ci9IlHkX.js} +1 -1
  237. package/dist/client/assets/{project-icon-D6jtLreJ.js → project-icon-DqFpEPg-.js} +1 -1
  238. package/dist/client/assets/{project-index-pgEW44Q9.js → project-index-Dn3n52T-.js} +1 -1
  239. package/dist/client/assets/project-reports-CHFD_5_U.js +1 -0
  240. package/dist/client/assets/project-tasks-Dcp7unw7.js +1 -0
  241. package/dist/client/assets/{projects-CoL2Czss.js → projects-C-pel4ez.js} +1 -1
  242. package/dist/client/assets/{projects-empty-state-dMAfSAvA.js → projects-empty-state-Bsnv3dFv.js} +1 -1
  243. package/dist/client/assets/{prompts-C1nJJ4vm.js → prompts-CWt1t3VZ.js} +1 -1
  244. package/dist/client/assets/record-editor-Ch7j2D2R.js +1 -0
  245. package/dist/client/assets/{redirect-editor-v_Pws7YC.js → redirect-editor-B6HxpNko.js} +1 -1
  246. package/dist/client/assets/{reports-DeRFKvgR.js → reports-B66FRaYV.js} +1 -1
  247. package/dist/client/assets/reports-XbkN5y4U.js +1 -0
  248. package/dist/client/assets/{reports-onboarding-ByH6wjdu.js → reports-onboarding-C_u0txdS.js} +1 -1
  249. package/dist/client/assets/{reports-tab-DNq4qxR5.js → reports-tab-C7wVFguJ.js} +2 -2
  250. package/dist/client/assets/repositories-D6nxNt_H.js +1 -0
  251. package/dist/client/assets/{repositories-CshiRVJO.js → repositories-DvCEb4S4.js} +1 -1
  252. package/dist/client/assets/{repository-binding-Drae9jEJ.js → repository-binding-BCK2I6Mo.js} +1 -1
  253. package/dist/client/assets/{repository-picker-DcoNDHNX.js → repository-picker-DWJeQ4Uz.js} +1 -1
  254. package/dist/client/assets/{require-capability-58lj_sLx.js → require-capability-CeoHCJST.js} +1 -1
  255. package/dist/client/assets/{required-auth-layout-coJLhqjq.js → required-auth-layout-Bqqrer2s.js} +1 -1
  256. package/dist/client/assets/{reset-password-DmNJhZP_.js → reset-password-DRVc-MEN.js} +1 -1
  257. package/dist/client/assets/{resizable-a5ed0aFn.js → resizable-D7hc5wCS.js} +1 -1
  258. package/dist/client/assets/{resolve-tab-icon-aSYnYRbW.js → resolve-tab-icon-B4dWqPe0.js} +1 -1
  259. package/dist/client/assets/{review-settings-M_0Lgvos.js → review-settings-B6B7lZ4t.js} +1 -1
  260. package/dist/client/assets/{role-color-B1bQbhLW.js → role-color-kB6wk2oV.js} +1 -1
  261. package/dist/client/assets/{roles-Cfs4KbFC.js → roles-zAYKO93B.js} +1 -1
  262. package/dist/client/assets/{route-ln57uUdJ.js → route-B1_dDOSw.js} +1 -1
  263. package/dist/client/assets/route-DdMqAKeK.js +1 -0
  264. package/dist/client/assets/route-Kd6aOvVB.js +1 -0
  265. package/dist/client/assets/{route-page-header-Dm04mhuj.js → route-page-header-DOKA0lPe.js} +1 -1
  266. package/dist/client/assets/{sandbox-git-api-CPqBqV0G.js → sandbox-git-api-MxAem5iH.js} +1 -1
  267. package/dist/client/assets/{sandbox-lifecycle-context-PaxLnfD4.js → sandbox-lifecycle-context-DoYhWfFO.js} +1 -1
  268. package/dist/client/assets/{save-status-BXFvRkAL.js → save-status-Bwv32UwA.js} +1 -1
  269. package/dist/client/assets/{schema-DgI3qSqy.js → schema-CFHsTaYR.js} +1 -1
  270. package/dist/client/assets/{schema-BSbCYY9y.js → schema-Cg4pyiCI.js} +1 -1
  271. package/dist/client/assets/{scroll-area-B2d6jFzS.js → scroll-area-DAamBeOm.js} +1 -1
  272. package/dist/client/assets/{search-input-XDrQYhil.js → search-input-_TDPMfaj.js} +1 -1
  273. package/dist/client/assets/{search-toggle-CBe-B-W_.js → search-toggle-BNJazxMF.js} +1 -1
  274. package/dist/client/assets/{secret-picker-6lDKLE0I.js → secret-picker-45PWWThH.js} +1 -1
  275. package/dist/client/assets/{secrets-mRfQ2zYn.js → secrets-BEHcZkxk.js} +1 -1
  276. package/dist/client/assets/{section-array-field-DRYut2dk.js → section-array-field-DR10vlg7.js} +1 -1
  277. package/dist/client/assets/{sections-2LOxZNGC.js → sections-QNIIZ4TO.js} +1 -1
  278. package/dist/client/assets/{sections-editor-DSw0gf5K.js → sections-editor-OhHN-8Oi.js} +1 -1
  279. package/dist/client/assets/{select-B282Slsg.js → select-Cl-2whSq.js} +1 -1
  280. package/dist/client/assets/{select-model-YSEeD0Az.js → select-model-D19LJE98.js} +1 -1
  281. package/dist/client/assets/{seo-editor-SlMH3Ndc.js → seo-editor-C-sP3Z1-.js} +1 -1
  282. package/dist/client/assets/{separator-C2ELigwU.js → separator-DsDHvFvA.js} +1 -1
  283. package/dist/client/assets/{session-runtime-BH3ADRqu.js → session-runtime-B3tpmEdV.js} +1 -1
  284. package/dist/client/assets/settings-tab-D2eW6VhQ.js +1 -0
  285. package/dist/client/assets/sheet-3DsSjpPg.js +1 -0
  286. package/dist/client/assets/{shell-layout-2a3HocEU.js → shell-layout-Cy4x2w2C.js} +1 -1
  287. package/dist/client/assets/{site-draft-actions-BNgtZ_kM.js → site-draft-actions-ak2wuSnr.js} +1 -1
  288. package/dist/client/assets/{site-draft-view-59J3TeYY.js → site-draft-view-BQq0EpKh.js} +1 -1
  289. package/dist/client/assets/site-editor-BIurhts7.js +1 -0
  290. package/dist/client/assets/{site-editor-toast-CkAw1Cwp.js → site-editor-toast-DyAj-yh9.js} +1 -1
  291. package/dist/client/assets/{skills-BzPEtrNZ.js → skills-CT_xGAxG.js} +1 -1
  292. package/dist/client/assets/{slider-wN_aQalr.js → slider-_egWZNfX.js} +1 -1
  293. package/dist/client/assets/{sortable.esm-DPJjIjEU.js → sortable.esm-DpTBwHPu.js} +1 -1
  294. package/dist/client/assets/{sso-Bs5CI3h8.js → sso-B8Ml5ONn.js} +1 -1
  295. package/dist/client/assets/{suggestion-DWkqugbN.js → suggestion-BUUDUW90.js} +1 -1
  296. package/dist/client/assets/{super-agent-icon-D0WeAH15.js → super-agent-icon-B_bgucC_.js} +1 -1
  297. package/dist/client/assets/{switch-CfemO1do.js → switch-pc6As7Lj.js} +1 -1
  298. package/dist/client/assets/{synced-repos-BKKcIPbN.js → synced-repos-BCR2U4BU.js} +1 -1
  299. package/dist/client/assets/{tab-icon-glyph-CNySjp_I.js → tab-icon-glyph-D-aUvxBU.js} +1 -1
  300. package/dist/client/assets/{table-C9du40XO.js → table-Dy0rd4qk.js} +1 -1
  301. package/dist/client/assets/{tabs-D6Pnw7es.js → tabs-LNTPmT4H.js} +1 -1
  302. package/dist/client/assets/{task-board-CZErK_3f.js → task-board-CgkLyySX.js} +1 -1
  303. package/dist/client/assets/{task-key-BWUT6sLU.js → task-key-PeB83qoV.js} +1 -1
  304. package/dist/client/assets/{task-route-CGCjMBBZ.js → task-route-D-8EO_RF.js} +1 -1
  305. package/dist/client/assets/{task-status-DdY5hqAG.js → task-status-KvQJFF87.js} +1 -1
  306. package/dist/client/assets/{taskboard-analytics-BUGSR3Oh.js → taskboard-analytics-BcLhNaje.js} +1 -1
  307. package/dist/client/assets/tasks-BQIgrwi3.js +1 -0
  308. package/dist/client/assets/{tasks-Cn9XhG4H.js → tasks-CeETZIFY.js} +1 -1
  309. package/dist/client/assets/{textarea-shjcg83Q.js → textarea-i65d3zD6.js} +1 -1
  310. package/dist/client/assets/{thread-analytics-nP1khI2z.js → thread-analytics-Cdiuqyfy.js} +1 -1
  311. package/dist/client/assets/{thread-button-BT5IYGed.js → thread-button-Cv7guHMn.js} +1 -1
  312. package/dist/client/assets/{thread-intent-MQDkwS2K.js → thread-intent-LmIsiguS.js} +1 -1
  313. package/dist/client/assets/{thread-route-CwpmRNHh.js → thread-route-98-Pj7EV.js} +1 -1
  314. package/dist/client/assets/{thread-route-C18glt36.js → thread-route-CSj65J5K.js} +1 -1
  315. package/dist/client/assets/{thread-sheet-body-BY8zn-2X.js → thread-sheet-body-D3GUkLPi.js} +1 -1
  316. package/dist/client/assets/{time-range-picker-BcBC6ty0.js → time-range-picker-Css1Ovl_.js} +1 -1
  317. package/dist/client/assets/{toggle-group-BnrXGKKY.js → toggle-group-B5Qv0TZp.js} +1 -1
  318. package/dist/client/assets/{tool-set-selector-DUOMDF3r.js → tool-set-selector-DoHlrDig.js} +1 -1
  319. package/dist/client/assets/{toolbar-icon-button-2ueMvkvI.js → toolbar-icon-button-vtvpzCZ_.js} +1 -1
  320. package/dist/client/assets/{tooltip-DgFM5mQB.js → tooltip-BBk4QO9B.js} +1 -1
  321. package/dist/client/assets/{tooltipContext-BvjdDC28.js → tooltipContext-DuBQjN-C.js} +1 -1
  322. package/dist/client/assets/{track-CDbXIh-t.js → track-ttGR8dxm.js} +1 -1
  323. package/dist/client/assets/{types-Bca8rqtc.js → types-BRAj2PE2.js} +1 -1
  324. package/dist/client/assets/{url-slug-0nYVauKi.js → url-slug-DrOjUMxX.js} +1 -1
  325. package/dist/client/assets/{usage-stats-DyR6Kq74.js → usage-stats-xir5IhsZ.js} +1 -1
  326. package/dist/client/assets/{use-ai-providers-BM99Jk3f.js → use-ai-providers-B1MpfOF5.js} +1 -1
  327. package/dist/client/assets/{use-api-keys-CwsBcAgd.js → use-api-keys-CiN7H9ts.js} +1 -1
  328. package/dist/client/assets/{use-apply-named-rule-D90SDfPC.js → use-apply-named-rule-Bzqut0Gd.js} +1 -1
  329. package/dist/client/assets/use-ask-in-chat-CKHbH0UO.js +1 -0
  330. package/dist/client/assets/{use-automations-Co69mrXt.js → use-automations-DSG-bEnt.js} +1 -1
  331. package/dist/client/assets/{use-autosave-BoR4WbwP.js → use-autosave-Cm2WfCL_.js} +1 -1
  332. package/dist/client/assets/use-blocks-v8-project-B8tSOiQV.js +1 -0
  333. package/dist/client/assets/use-blog-view-CLaoWWXx.js +1 -0
  334. package/dist/client/assets/{use-chat-layout-state-v3ZvRKOT.js → use-chat-layout-state-Cobo43Bl.js} +1 -1
  335. package/dist/client/assets/{use-cms-publish-actions-tt3YVYFN.js → use-cms-publish-actions-ChEzMzUL.js} +1 -1
  336. package/dist/client/assets/{use-connect-companion-isIbV5OV.js → use-connect-companion-CJdSUXna.js} +1 -1
  337. package/dist/client/assets/{use-connection-wSXmVdCY.js → use-connection-VTUSBGTe.js} +1 -1
  338. package/dist/client/assets/{use-content-sync-BDeJ_Jgu.js → use-content-sync-BXrJzR11.js} +1 -1
  339. package/dist/client/assets/{use-copy-CQS-1CPQ.js → use-copy-Dc7Mx1fC.js} +1 -1
  340. package/dist/client/assets/{use-current-view-C8Qn7lu6.js → use-current-view-AGi0k_-I.js} +1 -1
  341. package/dist/client/assets/{use-date-fns-locale-rXGxQCgx.js → use-date-fns-locale-Bxj0YL2L.js} +1 -1
  342. package/dist/client/assets/{use-debounced-autosave-C2p5-3yn.js → use-debounced-autosave-BDRqjNGS.js} +1 -1
  343. package/dist/client/assets/{use-debounced-value-sPPLBdJe.js → use-debounced-value-CTxCZD5A.js} +1 -1
  344. package/dist/client/assets/{use-deco-credits-Cd6Vxe2k.js → use-deco-credits-B34VYEQw.js} +1 -1
  345. package/dist/client/assets/{use-decopilot-events-Dn0Dm68W.js → use-decopilot-events-DFiNdpMv.js} +1 -1
  346. package/dist/client/assets/{use-delete-block-MPbaqrna.js → use-delete-block-CTKK2Eq4.js} +1 -1
  347. package/dist/client/assets/{use-delete-connection-EcnpG53Z.js → use-delete-connection-C1dHTb1J.js} +1 -1
  348. package/dist/client/assets/{use-deployment-admin-CTEsKWeV.js → use-deployment-admin-BA_JLmwW.js} +1 -1
  349. package/dist/client/assets/{use-entitlements-BXMPYOBS.js → use-entitlements-RVjfgn4l.js} +1 -1
  350. package/dist/client/assets/{use-fast-preview-draft-url-BpA0y2aq.js → use-fast-preview-draft-url-kaqCW9_t.js} +1 -1
  351. package/dist/client/assets/{use-file-configs-Df-dqKVI.js → use-file-configs-DJQqKxP9.js} +1 -1
  352. package/dist/client/assets/{use-id-selection-3iTAqvRR.js → use-id-selection-BzvH47dC.js} +1 -1
  353. package/dist/client/assets/{use-in-settings-D_BySurP.js → use-in-settings-CavkWvLD.js} +1 -1
  354. package/dist/client/assets/{use-inbox-feed-B-8Gmjeu.js → use-inbox-feed-CJ80ZK7C.js} +1 -1
  355. package/dist/client/assets/{use-infinite-scroll-C-t0_BGl.js → use-infinite-scroll-CBxCb09-.js} +1 -1
  356. package/dist/client/assets/{use-join-requests-B0limBIJ.js → use-join-requests-uMBvUkrQ.js} +1 -1
  357. package/dist/client/assets/{use-main-panel-tabs-N1__ahB3.js → use-main-panel-tabs-CAwxHjj4.js} +1 -1
  358. package/dist/client/assets/{use-mcp-auth-status-Buwa7u45.js → use-mcp-auth-status-COkXOT5q.js} +1 -1
  359. package/dist/client/assets/{use-mcp-client-OYKYr7Zc.js → use-mcp-client-D6hvNNod.js} +1 -1
  360. package/dist/client/assets/{use-mcp-prompts-XeLNsblN.js → use-mcp-prompts-Dzcv5Qm_.js} +1 -1
  361. package/dist/client/assets/{use-mcp-tools-Ben5ajiJ.js → use-mcp-tools-CaA0WW-E.js} +1 -1
  362. package/dist/client/assets/{use-mobile-MVZR2Lhp.js → use-mobile-DPeImGih.js} +1 -1
  363. package/dist/client/assets/{use-move-blocks-DNt_Qh-7.js → use-move-blocks-B58hF-QF.js} +1 -1
  364. package/dist/client/assets/{use-navigate-to-agent-0LtKWlxa.js → use-navigate-to-agent-D-LXOG-h.js} +1 -1
  365. package/dist/client/assets/{use-never-published-DCVDrsUC.js → use-never-published-AUwhcJk8.js} +1 -1
  366. package/dist/client/assets/{use-org-fs-Dj5ea7Pp.js → use-org-fs-DMG6vhv9.js} +1 -1
  367. package/dist/client/assets/{use-org-notice-Csddyapx.js → use-org-notice-l577omxO.js} +1 -1
  368. package/dist/client/assets/{use-org-repo-syncs-8CH2dV_u.js → use-org-repo-syncs-anMhrjcF.js} +1 -1
  369. package/dist/client/assets/{use-org-sso-DXCHIqdV.js → use-org-sso-QDNvT__Q.js} +1 -1
  370. package/dist/client/assets/{use-organization-settings-BTioDTeC.js → use-organization-settings-HyX5IrJ4.js} +1 -1
  371. package/dist/client/assets/{use-panel-navigate-B_099k7i.js → use-panel-navigate-yNzK1oeQ.js} +1 -1
  372. package/dist/client/assets/{use-project-native-view-presence-BCWndDk0.js → use-project-native-view-presence-BkAnKN4Z.js} +1 -1
  373. package/dist/client/assets/{use-project-scope-BaNhjjkU.js → use-project-scope-BYK0JAGP.js} +1 -1
  374. package/dist/client/assets/{use-recent-apps-DKTzlYg2.js → use-recent-apps-DbC0yZx7.js} +1 -1
  375. package/dist/client/assets/{use-reports-diagnostic-tqk6GkvN.js → use-reports-diagnostic-BxX26Yaf.js} +1 -1
  376. package/dist/client/assets/{use-sandbox-events-DkGz3U_g.js → use-sandbox-events-DFE5xC3q.js} +1 -1
  377. package/dist/client/assets/{use-secrets-DsTJ_f5f.js → use-secrets-C-F6GU50.js} +1 -1
  378. package/dist/client/assets/{use-section-preview-base-BFP7PpkG.js → use-section-preview-base-DcUNPfko.js} +1 -1
  379. package/dist/client/assets/{use-sidebar-collapsed-Cyq98Qgp.js → use-sidebar-collapsed-Ciu2x6KY.js} +1 -1
  380. package/dist/client/assets/{use-tags-D58r0dtz.js → use-tags-CLlJFBlp.js} +1 -1
  381. package/dist/client/assets/{use-task-board-analytics-Q05GDgAf.js → use-task-board-analytics-CaZfe94R.js} +1 -1
  382. package/dist/client/assets/{use-task-board-item-prs-Y4mOP7Qi.js → use-task-board-item-prs-C_eZiXGh.js} +1 -1
  383. package/dist/client/assets/{use-task-board-items-DHvwjetN.js → use-task-board-items--v3zNW-2.js} +1 -1
  384. package/dist/client/assets/{use-task-board-prompts-Ds3v5gjb.js → use-task-board-prompts-BCHk1uCf.js} +1 -1
  385. package/dist/client/assets/{use-task-metadata-bPw-hNrv.js → use-task-metadata-puiqvF0z.js} +1 -1
  386. package/dist/client/assets/{use-thread-outputs-I2kuvS72.js → use-thread-outputs-vfKngax2.js} +1 -1
  387. package/dist/client/assets/{use-view-draft-kind-DcHRrUPD.js → use-view-draft-kind-CK2Ws293.js} +1 -1
  388. package/dist/client/assets/{use-voice-input-ClQF7v9Y.js → use-voice-input-Bag2UQ5s.js} +1 -1
  389. package/dist/client/assets/useInfiniteQuery-CkG5v2bH.js +1 -0
  390. package/dist/client/assets/{useQueries-Q6q16yJQ.js → useQueries-ClESU-gL.js} +1 -1
  391. package/dist/client/assets/useSuspenseInfiniteQuery-D4hQd0qx.js +1 -0
  392. package/dist/client/assets/{users-BBdssw6s.js → users--4MnD2Ni.js} +1 -1
  393. package/dist/client/assets/{utils-BaccrSLZ.js → utils-GIRCtww_.js} +1 -1
  394. package/dist/client/assets/{variant-calendar-DLupNn-U.js → variant-calendar-DDAccAAH.js} +1 -1
  395. package/dist/client/assets/{variant-matcher-override-3ayykvcg.js → variant-matcher-override-B4viDDF4.js} +1 -1
  396. package/dist/client/assets/{view-header-BIqV3RdZ.js → view-header-BMcVMjG5.js} +1 -1
  397. package/dist/client/assets/{virtual-mcp-DyF6IEhr.js → virtual-mcp-D70Jm3Cf.js} +1 -1
  398. package/dist/client/assets/{watch-sse-pool-DTFf-OSe.js → watch-sse-pool-C79C_cUh.js} +1 -1
  399. package/dist/client/index.html +2 -2
  400. package/dist/server/server.js +705 -705
  401. package/package.json +1 -1
  402. package/dist/client/assets/agent-app--sGlyuqH.js +0 -1
  403. package/dist/client/assets/agent-assets-D9OfQf2S.js +0 -1
  404. package/dist/client/assets/agent-deck-BFHNNp62.js +0 -1
  405. package/dist/client/assets/agent-experiments-Bv_v3TAO.js +0 -1
  406. package/dist/client/assets/agent-file-BXKcmB2N.js +0 -1
  407. package/dist/client/assets/agent-library-Czsy6k8l.js +0 -1
  408. package/dist/client/assets/agent-library-file-BbS3HgpC.js +0 -1
  409. package/dist/client/assets/agent-overview-DM_uEEtA.js +0 -1
  410. package/dist/client/assets/agent-settings-BnZZ1J30.js +0 -1
  411. package/dist/client/assets/agent-site-editor-code-DalNbqMF.js +0 -2
  412. package/dist/client/assets/agent-site-editor-content-C86oatUw.js +0 -1
  413. package/dist/client/assets/agent-site-editor-preview-CNy-hy9W.js +0 -1
  414. package/dist/client/assets/agent-view-BnzkhKY4.js +0 -1
  415. package/dist/client/assets/api-keys-BWtdycqJ.js +0 -1
  416. package/dist/client/assets/asset-utils-545UDhWA.js +0 -1
  417. package/dist/client/assets/index-pbgcO64n.css +0 -1
  418. package/dist/client/assets/legacy-agents-deep-DDm5GBaQ.js +0 -1
  419. package/dist/client/assets/library-UhxMQ0oL.js +0 -1
  420. package/dist/client/assets/project-app-view-DVY_pI8M.js +0 -1
  421. package/dist/client/assets/project-reports-CvZYitaI.js +0 -1
  422. package/dist/client/assets/project-tasks-Cm1BxQuv.js +0 -1
  423. package/dist/client/assets/record-editor-DUtpG1M4.js +0 -1
  424. package/dist/client/assets/reports-CRpT9Jvs.js +0 -1
  425. package/dist/client/assets/repositories-BimQNbUT.js +0 -1
  426. package/dist/client/assets/route-BIUN__VF.js +0 -1
  427. package/dist/client/assets/route-CKUHS8mK.js +0 -1
  428. package/dist/client/assets/settings-tab-CtAuHkvY.js +0 -1
  429. package/dist/client/assets/sheet-BqPaRS1I.js +0 -1
  430. package/dist/client/assets/site-editor-DwanunsO.js +0 -1
  431. package/dist/client/assets/tasks-qN1qstWv.js +0 -1
  432. package/dist/client/assets/use-ask-in-chat-B4aJKUoO.js +0 -1
  433. package/dist/client/assets/use-blocks-v8-project-Dq4zh0zX.js +0 -1
  434. package/dist/client/assets/use-blog-view-DuKgZxsq.js +0 -1
  435. package/dist/client/assets/useInfiniteQuery-CoeKNdsU.js +0 -1
  436. package/dist/client/assets/useSuspenseInfiniteQuery-hY0KLY7U.js +0 -1
@@ -1 +1 @@
1
- import{c as j,ar as W,at as q,b as E,r as z,d as G,j as o,aR as $,R as I,P as N,n as U,B as k,b5 as V}from"./index-BRgWMc-5.js";import{u as K}from"./use-mobile-MVZR2Lhp.js";import{T as Y,a as Z,c as J}from"./tooltip-DgFM5mQB.js";import{t as Q,a as X}from"./MessageCircle01-jm5EAYEs.js";import{s as ee}from"./XClose-CtxnajtG.js";import{b as te}from"./thread-button-BT5IYGed.js";import{T as ne}from"./toolbar-icon-button-2ueMvkvI.js";import{b as se,R as oe,a as D}from"./resizable-a5ed0aFn.js";import{c as re,r as ie,m as le}from"./use-chat-layout-state-v3ZvRKOT.js";import{R as ae}from"./route-page-header-Dm04mhuj.js";import"./index-3k_nlNc7.js";import"./use-sidebar-collapsed-Cyq98Qgp.js";import"./sheet-BqPaRS1I.js";import"./use-in-settings-D_BySurP.js";import"./use-panel-navigate-B_099k7i.js";import"./thread-route-C18glt36.js";import"./use-project-scope-BaNhjjkU.js";import"./repository-binding-Drae9jEJ.js";import"./use-mcp-client-OYKYr7Zc.js";import"./auth-sBxX13D1.js";import"./LayoutLeft-BPF5UUkD.js";import"./use-current-view-C8Qn7lu6.js";function A(t,e){const n=typeof t=="number"?t:Number(t);return!Number.isFinite(n)||n<=0||n>=100?e:n}function ce(t,e){const n=j.c(8);let r;n[0]!==e?(r=c=>A(c,e),n[0]=e,n[1]=r):r=n[1];const[i,l]=W(t,r);let s;n[2]!==e||n[3]!==i?(s=A(i,e),n[2]=e,n[3]=i,n[4]=s):s=n[4];let a;return n[5]!==l||n[6]!==s?(a=[s,l],n[5]=l,n[6]=s,n[7]=a):a=n[7],a}const ue=33;function de(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=q.sidePanelWidth(),t[0]=e):e=t[0],ce(e,ue)}const P="chat-layout-thread",M="chat-layout-content",H="320px",O=z.createContext(null);function Fe(){return T()}function fe(){return z.use(O)}function T(){const t=z.use(O);if(!t)throw new Error("ChatLayout regions require a ChatLayout");return t}function he(t){const e=j.c(22),{children:n,...r}=t,i=K(),l=G(),s=z.useRef(null),[a,c]=de(),{threadOpen:u,contentOpen:d}=r,h=re(r),m=u&&d?a:h.side,p=100-m,y=b=>{const v=b.getLayout(),w=v[P],S=v[M];typeof w!="number"||typeof S!="number"||Math.abs(w-m)<.001&&Math.abs(S-p)<.001||b.setLayout({[P]:m,[M]:p})},C=ie(r);let x;e[0]!==i||e[1]!==r||e[2]!==C?(x={...r,isMobile:i,mobileSurface:C},e[0]=i,e[1]=r,e[2]=C,e[3]=x):x=e[3];const f=x;let g;e[4]!==i||e[5]!==r||e[6]!==l||e[7]!==f?(g=i&&!r.threadless&&o.jsx(te,{open:f.mobileSurface==="chat",onToggle:()=>{l({to:".",search:b=>({...b,...le(f.mobileSurface==="chat"?"main":"chat")}),replace:!0})}}),e[4]=i,e[5]=r,e[6]=l,e[7]=f,e[8]=g):g=e[8];let L;e[9]!==n||e[10]!==d||e[11]!==p||e[12]!==i||e[13]!==c||e[14]!==y||e[15]!==u||e[16]!==m?(L=i?o.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:n}):o.jsx(oe,{ref:b=>{if(s.current=b,!b)return;let v=!0;return queueMicrotask(()=>{v&&y(b)}),()=>{v=!1,s.current===b&&(s.current=null)}},defaultLayout:{[P]:m,[M]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0",style:{overflow:"visible"},onLayoutChanged:(b,v)=>{const{isUserInteraction:w}=v;if(!w){const B=s.current;B&&y(B);return}const S=b[P];u&&d&&typeof S=="number"&&S>0&&S<100&&c(S)},children:n}),e[9]=n,e[10]=d,e[11]=p,e[12]=i,e[13]=c,e[14]=y,e[15]=u,e[16]=m,e[17]=L):L=e[17];let _;return e[18]!==g||e[19]!==L||e[20]!==f?(_=o.jsxs(O,{value:f,children:[g,L]}),e[18]=g,e[19]=L,e[20]=f,e[21]=_):_=e[21],_}function me(t){const e=j.c(14),{children:n,topbar:r}=t,i=T();if(i.isMobile){let u;return e[0]!==n||e[1]!==i.mobileSurface||e[2]!==r?(u=i.mobileSurface==="chat"?o.jsxs(N,{variant:"plain","data-slot":"chat-layout-thread",children:[r,o.jsx(N.Content,{"data-testid":"chat-panel",children:n})]}):null,e[0]=n,e[1]=i.mobileSurface,e[2]=r,e[3]=u):u=e[3],u}if(!i.threadOpen)return null;let l;e[4]!==i.contentOpen?(l=i.contentOpen&&o.jsx(se,{className:"bg-sidebar"}),e[4]=i.contentOpen,e[5]=l):l=e[5];let s;e[6]!==n?(s=o.jsx(N.Content,{"data-testid":"chat-panel",children:n}),e[6]=n,e[7]=s):s=e[7];let a;e[8]!==s||e[9]!==r?(a=o.jsx(D,{id:P,defaultSize:"33%",minSize:H,className:"min-w-0 overflow-hidden bg-sidebar",children:o.jsx("div",{className:"h-full min-h-0 p-0.5",children:o.jsxs(N,{"data-testid":"side-panel",children:[r,s]})})}),e[8]=s,e[9]=r,e[10]=a):a=e[10];let c;return e[11]!==l||e[12]!==a?(c=o.jsxs(o.Fragment,{children:[l,a]}),e[11]=l,e[12]=a,e[13]=c):c=e[13],c}function F(t){const e=j.c(10),{label:n,pressed:r,onClick:i,children:l}=t;let s;e[0]!==l||e[1]!==n||e[2]!==i||e[3]!==r?(s=o.jsx(Y,{asChild:!0,children:o.jsx(ne,{"aria-label":n,"aria-pressed":r,onClick:i,children:l})}),e[0]=l,e[1]=n,e[2]=i,e[3]=r,e[4]=s):s=e[4];let a;e[5]!==n?(a=o.jsx(Z,{side:"bottom",children:n}),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==s||e[8]!==a?(c=o.jsxs(J,{children:[s,a]}),e[7]=s,e[8]=a,e[9]=c):c=e[9],c}function pe(){const t=j.c(12),e=E(),n=T();if(n.isMobile||n.threadless)return null;const r=!n.threadOpen;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("span",{"aria-hidden":!0,className:"mr-1.5 h-4 w-px shrink-0 bg-border"}),t[0]=i):i=t[0];let l;t[1]!==r||t[2]!==n.toggleFullscreen||t[3]!==e?(l=r?o.jsxs(k,{variant:"ghost",size:"sm","aria-pressed":r,className:"h-7 gap-1.5 px-2 text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",onClick:n.toggleFullscreen,children:[o.jsx(Q,{size:16}),e("page.exitFullscreen")]}):o.jsx(F,{label:e("page.enterFullscreen"),pressed:r,onClick:n.toggleFullscreen,children:o.jsx(X,{size:16})}),t[1]=r,t[2]=n.toggleFullscreen,t[3]=e,t[4]=l):l=t[4];let s;t[5]!==r||t[6]!==n.toggleContent||t[7]!==e?(s=!r&&o.jsx(F,{label:e("page.closeMainPanel"),onClick:n.toggleContent,children:o.jsx(ee,{size:16})}),t[5]=r,t[6]=n.toggleContent,t[7]=e,t[8]=s):s=t[8];let a;return t[9]!==l||t[10]!==s?(a=o.jsxs("div",{className:"flex items-center gap-0.5",children:[i,l,s]}),t[9]=l,t[10]=s,t[11]=a):a=t[11],a}function Ke(){const t=j.c(9),e=E(),n=K(),r=fe();if(n||!r||r.threadless||r.contentOpen)return null;const i=r.toggleContent;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(xe,{}),t[0]=l):l=t[0];let s;t[1]!==e?(s=e("page.openMainPanel"),t[1]=e,t[2]=s):s=t[2];let a;t[3]!==r.toggleContent||t[4]!==s?(a=o.jsxs(k,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 px-2 text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",onClick:i,children:[l,s]}),t[3]=r.toggleContent,t[4]=s,t[5]=a):a=t[5];let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("span",{"aria-hidden":!0,className:"mx-1 h-4 w-px shrink-0 bg-border"}),t[6]=c):c=t[6];let u;return t[7]!==a?(u=o.jsxs(o.Fragment,{children:[a,c]}),t[7]=a,t[8]=u):u=t[8],u}function xe(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"shrink-0",children:o.jsx("path",{d:"M4 5v14M8 12h12m0 0-6-6m6 6-6 6"})}),t[0]=e):e=t[0],e}function ge({children:t,routeId:e}){return t}function R(t){const e=j.c(26),{children:n,actions:r,drawer:i,aside:l}=t,s=T();if(s.isMobile&&s.mobileSurface!=="main")return null;const a=s.isMobile?"plain":"card";let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(pe,{}),e[0]=c):c=e[0];let u;e[1]!==r||e[2]!==s.contentNavigation?(u=o.jsx(ae,{navigation:s.contentNavigation,actions:r,trailingActions:c}),e[1]=r,e[2]=s.contentNavigation,e[3]=u):u=e[3];let d;e[4]!==n||e[5]!==s.contentKey?(d=o.jsx($,{children:o.jsx(ge,{routeId:s.contentKey,children:n})}),e[4]=n,e[5]=s.contentKey,e[6]=d):d=e[6];let h;e[7]!==s.contentKey||e[8]!==d?(h=o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(I,{children:d},s.contentKey)}),e[7]=s.contentKey,e[8]=d,e[9]=h):h=e[9];let m;e[10]!==i||e[11]!==h?(m=o.jsxs(N.Content,{children:[h,i]}),e[10]=i,e[11]=h,e[12]=m):m=e[12];let p;e[13]!==u||e[14]!==m?(p=o.jsxs(U.Breadcrumbs.Provider,{children:[u,m]}),e[13]=u,e[14]=m,e[15]=p):p=e[15];let y;e[16]!==a||e[17]!==p?(y=o.jsx(N,{"data-testid":"main-panel",variant:a,children:p}),e[16]=a,e[17]=p,e[18]=y):y=e[18];const C=y;if(s.isMobile)return C;if(!s.contentOpen)return null;let x;e[19]!==C?(x=o.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:C}),e[19]=C,e[20]=x):x=e[20];let f;e[21]!==l?(f=l&&o.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:o.jsx(N,{"data-testid":"aside-panel",children:o.jsx(I,{children:o.jsx($,{children:l})},z.isValidElement(l)?l.key??void 0:void 0)})}),e[21]=l,e[22]=f):f=e[22];let g;return e[23]!==f||e[24]!==x?(g=o.jsx(D,{id:M,defaultSize:"67%",minSize:H,className:"min-w-0 overflow-hidden bg-sidebar",children:o.jsxs("div",{className:"flex h-full min-h-0",children:[x,f]})}),e[23]=f,e[24]=x,e[25]=g):g=e[25],g}function De(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(R,{children:o.jsx(V,{})}),t[0]=e):e=t[0],e}function He(t){const e=j.c(18),{error:n,reset:r}=t,i=E();let l;e[0]!==i?(l=i("common.errorBoundary.somethingWentWrong"),e[0]=i,e[1]=l):l=e[1];let s;e[2]!==l?(s=o.jsx("h2",{className:"text-lg font-medium",children:l}),e[2]=l,e[3]=s):s=e[3];let a;e[4]!==n.message||e[5]!==i?(a=n.message||i("common.errorBoundary.unexpectedError"),e[4]=n.message,e[5]=i,e[6]=a):a=e[6];let c;e[7]!==a?(c=o.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:a}),e[7]=a,e[8]=c):c=e[8];let u;e[9]!==i?(u=i("common.errorBoundary.tryAgain"),e[9]=i,e[10]=u):u=e[10];let d;e[11]!==r||e[12]!==u?(d=o.jsx(k,{variant:"outline",onClick:r,children:u}),e[11]=r,e[12]=u,e[13]=d):d=e[13];let h;return e[14]!==s||e[15]!==c||e[16]!==d?(h=o.jsx(R,{children:o.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[s,c,d]})}),e[14]=s,e[15]=c,e[16]=d,e[17]=h):h=e[17],h}const We=Object.assign(he,{Thread:me,Content:R});export{We as ChatLayout,He as ChatLayoutError,De as ChatLayoutPending,Ke as OpenMainPanelButton,Fe as useChatLayout,fe as useOptionalChatLayout};
1
+ import{c as j,ar as W,at as q,b as E,r as z,d as G,j as o,aR as $,R as I,P as N,n as U,B as k,b5 as V}from"./index-BMPeWdJw.js";import{u as K}from"./use-mobile-DPeImGih.js";import{T as Y,a as Z,c as J}from"./tooltip-BBk4QO9B.js";import{t as Q,a as X}from"./MessageCircle01-pdZ3c0Ei.js";import{s as ee}from"./XClose-igHVZF4W.js";import{b as te}from"./thread-button-Cv7guHMn.js";import{T as ne}from"./toolbar-icon-button-vtvpzCZ_.js";import{b as se,R as oe,a as D}from"./resizable-D7hc5wCS.js";import{c as re,r as ie,m as le}from"./use-chat-layout-state-Cobo43Bl.js";import{R as ae}from"./route-page-header-DOKA0lPe.js";import"./index-BDs-2B47.js";import"./use-sidebar-collapsed-Ciu2x6KY.js";import"./sheet-3DsSjpPg.js";import"./use-in-settings-CavkWvLD.js";import"./use-panel-navigate-yNzK1oeQ.js";import"./thread-route-CSj65J5K.js";import"./use-project-scope-BYK0JAGP.js";import"./repository-binding-BCK2I6Mo.js";import"./use-mcp-client-D6hvNNod.js";import"./auth-DdGqjHXO.js";import"./LayoutLeft-BI23EoSs.js";import"./use-current-view-AGi0k_-I.js";function A(t,e){const n=typeof t=="number"?t:Number(t);return!Number.isFinite(n)||n<=0||n>=100?e:n}function ce(t,e){const n=j.c(8);let r;n[0]!==e?(r=c=>A(c,e),n[0]=e,n[1]=r):r=n[1];const[i,l]=W(t,r);let s;n[2]!==e||n[3]!==i?(s=A(i,e),n[2]=e,n[3]=i,n[4]=s):s=n[4];let a;return n[5]!==l||n[6]!==s?(a=[s,l],n[5]=l,n[6]=s,n[7]=a):a=n[7],a}const ue=33;function de(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=q.sidePanelWidth(),t[0]=e):e=t[0],ce(e,ue)}const P="chat-layout-thread",M="chat-layout-content",H="320px",O=z.createContext(null);function Fe(){return T()}function fe(){return z.use(O)}function T(){const t=z.use(O);if(!t)throw new Error("ChatLayout regions require a ChatLayout");return t}function he(t){const e=j.c(22),{children:n,...r}=t,i=K(),l=G(),s=z.useRef(null),[a,c]=de(),{threadOpen:u,contentOpen:d}=r,h=re(r),m=u&&d?a:h.side,p=100-m,y=b=>{const v=b.getLayout(),w=v[P],S=v[M];typeof w!="number"||typeof S!="number"||Math.abs(w-m)<.001&&Math.abs(S-p)<.001||b.setLayout({[P]:m,[M]:p})},C=ie(r);let x;e[0]!==i||e[1]!==r||e[2]!==C?(x={...r,isMobile:i,mobileSurface:C},e[0]=i,e[1]=r,e[2]=C,e[3]=x):x=e[3];const f=x;let g;e[4]!==i||e[5]!==r||e[6]!==l||e[7]!==f?(g=i&&!r.threadless&&o.jsx(te,{open:f.mobileSurface==="chat",onToggle:()=>{l({to:".",search:b=>({...b,...le(f.mobileSurface==="chat"?"main":"chat")}),replace:!0})}}),e[4]=i,e[5]=r,e[6]=l,e[7]=f,e[8]=g):g=e[8];let L;e[9]!==n||e[10]!==d||e[11]!==p||e[12]!==i||e[13]!==c||e[14]!==y||e[15]!==u||e[16]!==m?(L=i?o.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:n}):o.jsx(oe,{ref:b=>{if(s.current=b,!b)return;let v=!0;return queueMicrotask(()=>{v&&y(b)}),()=>{v=!1,s.current===b&&(s.current=null)}},defaultLayout:{[P]:m,[M]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0",style:{overflow:"visible"},onLayoutChanged:(b,v)=>{const{isUserInteraction:w}=v;if(!w){const B=s.current;B&&y(B);return}const S=b[P];u&&d&&typeof S=="number"&&S>0&&S<100&&c(S)},children:n}),e[9]=n,e[10]=d,e[11]=p,e[12]=i,e[13]=c,e[14]=y,e[15]=u,e[16]=m,e[17]=L):L=e[17];let _;return e[18]!==g||e[19]!==L||e[20]!==f?(_=o.jsxs(O,{value:f,children:[g,L]}),e[18]=g,e[19]=L,e[20]=f,e[21]=_):_=e[21],_}function me(t){const e=j.c(14),{children:n,topbar:r}=t,i=T();if(i.isMobile){let u;return e[0]!==n||e[1]!==i.mobileSurface||e[2]!==r?(u=i.mobileSurface==="chat"?o.jsxs(N,{variant:"plain","data-slot":"chat-layout-thread",children:[r,o.jsx(N.Content,{"data-testid":"chat-panel",children:n})]}):null,e[0]=n,e[1]=i.mobileSurface,e[2]=r,e[3]=u):u=e[3],u}if(!i.threadOpen)return null;let l;e[4]!==i.contentOpen?(l=i.contentOpen&&o.jsx(se,{className:"bg-sidebar"}),e[4]=i.contentOpen,e[5]=l):l=e[5];let s;e[6]!==n?(s=o.jsx(N.Content,{"data-testid":"chat-panel",children:n}),e[6]=n,e[7]=s):s=e[7];let a;e[8]!==s||e[9]!==r?(a=o.jsx(D,{id:P,defaultSize:"33%",minSize:H,className:"min-w-0 overflow-hidden bg-sidebar",children:o.jsx("div",{className:"h-full min-h-0 p-0.5",children:o.jsxs(N,{"data-testid":"side-panel",children:[r,s]})})}),e[8]=s,e[9]=r,e[10]=a):a=e[10];let c;return e[11]!==l||e[12]!==a?(c=o.jsxs(o.Fragment,{children:[l,a]}),e[11]=l,e[12]=a,e[13]=c):c=e[13],c}function F(t){const e=j.c(10),{label:n,pressed:r,onClick:i,children:l}=t;let s;e[0]!==l||e[1]!==n||e[2]!==i||e[3]!==r?(s=o.jsx(Y,{asChild:!0,children:o.jsx(ne,{"aria-label":n,"aria-pressed":r,onClick:i,children:l})}),e[0]=l,e[1]=n,e[2]=i,e[3]=r,e[4]=s):s=e[4];let a;e[5]!==n?(a=o.jsx(Z,{side:"bottom",children:n}),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==s||e[8]!==a?(c=o.jsxs(J,{children:[s,a]}),e[7]=s,e[8]=a,e[9]=c):c=e[9],c}function pe(){const t=j.c(12),e=E(),n=T();if(n.isMobile||n.threadless)return null;const r=!n.threadOpen;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("span",{"aria-hidden":!0,className:"mr-1.5 h-4 w-px shrink-0 bg-border"}),t[0]=i):i=t[0];let l;t[1]!==r||t[2]!==n.toggleFullscreen||t[3]!==e?(l=r?o.jsxs(k,{variant:"ghost",size:"sm","aria-pressed":r,className:"h-7 gap-1.5 px-2 text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",onClick:n.toggleFullscreen,children:[o.jsx(Q,{size:16}),e("page.exitFullscreen")]}):o.jsx(F,{label:e("page.enterFullscreen"),pressed:r,onClick:n.toggleFullscreen,children:o.jsx(X,{size:16})}),t[1]=r,t[2]=n.toggleFullscreen,t[3]=e,t[4]=l):l=t[4];let s;t[5]!==r||t[6]!==n.toggleContent||t[7]!==e?(s=!r&&o.jsx(F,{label:e("page.closeMainPanel"),onClick:n.toggleContent,children:o.jsx(ee,{size:16})}),t[5]=r,t[6]=n.toggleContent,t[7]=e,t[8]=s):s=t[8];let a;return t[9]!==l||t[10]!==s?(a=o.jsxs("div",{className:"flex items-center gap-0.5",children:[i,l,s]}),t[9]=l,t[10]=s,t[11]=a):a=t[11],a}function Ke(){const t=j.c(9),e=E(),n=K(),r=fe();if(n||!r||r.threadless||r.contentOpen)return null;const i=r.toggleContent;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(xe,{}),t[0]=l):l=t[0];let s;t[1]!==e?(s=e("page.openMainPanel"),t[1]=e,t[2]=s):s=t[2];let a;t[3]!==r.toggleContent||t[4]!==s?(a=o.jsxs(k,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 px-2 text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",onClick:i,children:[l,s]}),t[3]=r.toggleContent,t[4]=s,t[5]=a):a=t[5];let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("span",{"aria-hidden":!0,className:"mx-1 h-4 w-px shrink-0 bg-border"}),t[6]=c):c=t[6];let u;return t[7]!==a?(u=o.jsxs(o.Fragment,{children:[a,c]}),t[7]=a,t[8]=u):u=t[8],u}function xe(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"shrink-0",children:o.jsx("path",{d:"M4 5v14M8 12h12m0 0-6-6m6 6-6 6"})}),t[0]=e):e=t[0],e}function ge({children:t,routeId:e}){return t}function R(t){const e=j.c(26),{children:n,actions:r,drawer:i,aside:l}=t,s=T();if(s.isMobile&&s.mobileSurface!=="main")return null;const a=s.isMobile?"plain":"card";let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(pe,{}),e[0]=c):c=e[0];let u;e[1]!==r||e[2]!==s.contentNavigation?(u=o.jsx(ae,{navigation:s.contentNavigation,actions:r,trailingActions:c}),e[1]=r,e[2]=s.contentNavigation,e[3]=u):u=e[3];let d;e[4]!==n||e[5]!==s.contentKey?(d=o.jsx($,{children:o.jsx(ge,{routeId:s.contentKey,children:n})}),e[4]=n,e[5]=s.contentKey,e[6]=d):d=e[6];let h;e[7]!==s.contentKey||e[8]!==d?(h=o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(I,{children:d},s.contentKey)}),e[7]=s.contentKey,e[8]=d,e[9]=h):h=e[9];let m;e[10]!==i||e[11]!==h?(m=o.jsxs(N.Content,{children:[h,i]}),e[10]=i,e[11]=h,e[12]=m):m=e[12];let p;e[13]!==u||e[14]!==m?(p=o.jsxs(U.Breadcrumbs.Provider,{children:[u,m]}),e[13]=u,e[14]=m,e[15]=p):p=e[15];let y;e[16]!==a||e[17]!==p?(y=o.jsx(N,{"data-testid":"main-panel",variant:a,children:p}),e[16]=a,e[17]=p,e[18]=y):y=e[18];const C=y;if(s.isMobile)return C;if(!s.contentOpen)return null;let x;e[19]!==C?(x=o.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:C}),e[19]=C,e[20]=x):x=e[20];let f;e[21]!==l?(f=l&&o.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:o.jsx(N,{"data-testid":"aside-panel",children:o.jsx(I,{children:o.jsx($,{children:l})},z.isValidElement(l)?l.key??void 0:void 0)})}),e[21]=l,e[22]=f):f=e[22];let g;return e[23]!==f||e[24]!==x?(g=o.jsx(D,{id:M,defaultSize:"67%",minSize:H,className:"min-w-0 overflow-hidden bg-sidebar",children:o.jsxs("div",{className:"flex h-full min-h-0",children:[x,f]})}),e[23]=f,e[24]=x,e[25]=g):g=e[25],g}function De(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(R,{children:o.jsx(V,{})}),t[0]=e):e=t[0],e}function He(t){const e=j.c(18),{error:n,reset:r}=t,i=E();let l;e[0]!==i?(l=i("common.errorBoundary.somethingWentWrong"),e[0]=i,e[1]=l):l=e[1];let s;e[2]!==l?(s=o.jsx("h2",{className:"text-lg font-medium",children:l}),e[2]=l,e[3]=s):s=e[3];let a;e[4]!==n.message||e[5]!==i?(a=n.message||i("common.errorBoundary.unexpectedError"),e[4]=n.message,e[5]=i,e[6]=a):a=e[6];let c;e[7]!==a?(c=o.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:a}),e[7]=a,e[8]=c):c=e[8];let u;e[9]!==i?(u=i("common.errorBoundary.tryAgain"),e[9]=i,e[10]=u):u=e[10];let d;e[11]!==r||e[12]!==u?(d=o.jsx(k,{variant:"outline",onClick:r,children:u}),e[11]=r,e[12]=u,e[13]=d):d=e[13];let h;return e[14]!==s||e[15]!==c||e[16]!==d?(h=o.jsx(R,{children:o.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[s,c,d]})}),e[14]=s,e[15]=c,e[16]=d,e[17]=h):h=e[17],h}const We=Object.assign(he,{Thread:me,Content:R});export{We as ChatLayout,He as ChatLayoutError,De as ChatLayoutPending,Ke as OpenMainPanelButton,Fe as useChatLayout,fe as useOptionalChatLayout};
@@ -1,4 +1,4 @@
1
- import{N as P,q as De,c as k,R as Ie,r as Pe,t as se,v as E,w as Oe,T as H,x as je,y as M,z as L,A as ve,D as Q,B as Z,C as Fe,G as _e,H as Ve,I as Ke,J as q,f as Xe}from"./usage-stats-DyR6Kq74.js";const qe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ue=P.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",k(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,o,l,r,s;const c=(t=(n=e.attrs)===null||n===void 0?void 0:n.src)!==null&&t!==void 0?t:"",i=(o=(l=e.attrs)===null||l===void 0?void 0:l.alt)!==null&&o!==void 0?o:"",a=(r=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&r!==void 0?r:"";return a?`![${i}](${c} "${a}")`:`![${i}](${c})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:o}=this.options.resize,l=new Set(["src","width","height"]);return({node:r,getPos:s,HTMLAttributes:c,editor:i})=>{const a=document.createElement("img");a.draggable=!1;const d=k(this.options.HTMLAttributes,c);Object.entries(d).forEach(([w,S])=>{if(S!=null)switch(w){case"src":case"width":case"height":break;default:a.setAttribute(w,S)}}),d.src!==null&&(a.src=d.src);let u={...c};const f=w=>{if(typeof w=="string"&&w!==""){a.getAttribute("src")!==w&&(a.src=w);return}a.hasAttribute("src")&&a.removeAttribute("src"),a.src!==""&&(a.src="")};f(c.src);const p=w=>{if(w.type!==r.type)return!1;const S=i.extensionManager.attributes.filter(A=>A.type===w.type.name),y=Pe(w,S);return Object.keys(u).forEach(A=>{!l.has(A)&&!(A in y)&&a.removeAttribute(A)}),Object.entries(y).forEach(([A,R])=>{l.has(A)||(R!=null?a.setAttribute(A,R):a.removeAttribute(A))}),f(y.src),u=y,!0},h=new Ie({element:a,editor:i,node:r,getPos:s,onResize:(w,S)=>{a.style.width=`${w}px`,a.style.height=`${S}px`},onCommit:(w,S)=>{const y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:w,height:S}).run()},onUpdate:p,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:o===!0}}),g=h.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",a.complete&&a.naturalWidth>0?m():(a.onload=m,a.onerror=m),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[De({find:qe,type:this.type,getAttributes:e=>{const[,,t,n,o]=e;return{src:n,alt:t,title:o}}})]}});var un=Ue;let ee,te;if(typeof WeakMap<"u"){let e=new WeakMap;ee=t=>e.get(t),te=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;ee=o=>{for(let l=0;l<e.length;l+=2)if(e[l]==o)return e[l+1]},te=(o,l)=>(n==10&&(n=0),e[n++]=o,e[n++]=l)}var C=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,l=t/this.width|0;let r=o+1,s=l+1;for(let c=1;r<this.width&&this.map[t+c]==n;c++)r++;for(let c=1;s<this.height&&this.map[t+this.width*c]==n;c++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(e,t){const{left:n,right:o,top:l,bottom:r}=this.findCell(e),{left:s,right:c,top:i,bottom:a}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(l,i),right:Math.max(o,c),bottom:Math.max(r,a)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let l=e.left;l<e.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==e.left&&l&&this.map[r-1]==s||o==e.top&&o&&this.map[r-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==e){let s=t+e*this.width;const c=(e+1)*this.width;for(;s<c&&this.map[s]<l;)s++;return s==c?r-1:this.map[s]}l=r}}static get(e){return ee(e)||te(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=t*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=e.child(a);d++;for(let h=0;;h++){for(;l<o.length&&o[l]!=0;)l++;if(h==u.childCount)break;const g=u.child(h),{colspan:m,rowspan:w,colwidth:S}=g.attrs;for(let y=0;y<w;y++){if(y+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-y});break}const A=l+y*t;for(let R=0;R<m;R++){o[A+R]==0?o[A+R]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:m-R});const O=S&&S[R];if(O){const D=(A+R)%t*2,G=s[D];G==null||G!=O&&s[D+1]==1?(s[D]=O,s[D+1]=1):G==O&&s[D+1]++}}}l+=m,d+=g.nodeSize}const f=(a+1)*t;let p=0;for(;l<f;)o[l++]==0&&p++;p&&(r||(r=[])).push({type:"missing",row:a,n:p}),d++}(t===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const c=new C(t,n,o,r);let i=!1;for(let a=0;!i&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(i=!0);return i&&Ye(c,s,e),c}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const l=e.child(o);let r=0;if(n)for(let s=0;s<o;s++){const c=e.child(s);for(let i=0;i<c.childCount;i++){const a=c.child(i);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const c=l.child(s);r+=c.attrs.colspan,c.attrs.rowspan>1&&(n=!0)}t==-1?t=r:t!=r&&(t=Math.max(t,r))}return t}function Ye(e,t,n){e.problems||(e.problems=[]);const o={};for(let l=0;l<e.map.length;l++){const r=e.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let c=null;const i=s.attrs;for(let a=0;a<i.colspan;a++){const d=t[(l+a)%e.width*2];d!=null&&(!i.colwidth||i.colwidth[a]!=d)&&((c||(c=Qe(i)))[a]=d)}c&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:c})}}function Qe(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function v(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],l=o.spec.tableRole;l&&(t[l]=o)}}return t}const $=new se("selectingCells");function W(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Ze(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function T(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function J(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=W(t.$head)||et(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function et(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ne(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function tt(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Re(e,t,n){const o=e.node(-1),l=C.get(o),r=e.start(-1),s=l.nextCell(e.pos-r,t,n);return s==null?null:e.node(0).resolve(r+s)}function B(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(t,0,0)}return o}function nt(e,t,n){const o=v(t.type.schema).header_cell;for(let l=0;l<e.height;l++)if(t.nodeAt(e.map[n+l*e.width]).type!=o)return!1;return!0}var b=class N extends E{constructor(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.rectBetween(t.pos-r,n.pos-r),c=t.node(0),i=l.cellsInRect(s).filter(d=>d!=n.pos-r);i.unshift(n.pos-r);const a=i.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new je(c.resolve(f),c.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),l=t.resolve(n.map(this.$headCell.pos));if(ne(o)&&ne(l)&&ie(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?N.rowSelection(o,l):r&&this.isColSelection()?N.colSelection(o,l):new N(o,l)}return H.between(o,l)}content(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let i=l.top;i<l.bottom;i++){const a=[];for(let d=i*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const p=n.findCell(f);let h=t.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const g=l.left-p.left,m=p.right-l.right;if(g>0||m>0){let w=h.attrs;if(g>0&&(w=B(w,0,g)),m>0&&(w=B(w,w.colspan-m,m)),p.left<l.left){if(h=h.type.createAndFill(w),!h)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else h=h.type.create(w,h.content)}if(p.top<l.top||p.bottom>l.bottom){const w={...h.attrs,rowspan:Math.min(p.bottom,l.bottom)-Math.max(p.top,l.top)};p.top<l.top?h=h.type.createAndFill(w):h=h.type.create(w,h.content)}a.push(h)}s.push(t.child(i).copy(M.from(a)))}const c=this.isColSelection()&&this.isRowSelection()?t:s;return new L(M.from(c),1,1)}replace(t,n=L.empty){const o=t.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:c,$to:i}=l[s],a=t.mapping.slice(o);t.replace(a.map(c.pos),a.map(i.pos),s?L.empty:n)}const r=E.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);r&&t.setSelection(r)}replaceWith(t,n){this.replace(t,new L(M.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=C.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)t(n.nodeAt(r[s]),l+r[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.top<=c.top?(s.top>0&&(t=i.resolve(r+l.map[s.left])),c.bottom<l.height&&(n=i.resolve(r+l.map[l.width*(l.height-1)+c.right-1]))):(c.top>0&&(n=i.resolve(r+l.map[c.left])),s.bottom<l.height&&(t=i.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new N(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,c=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,c)==n.width}eq(t){return t instanceof N&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.left<=c.left?(s.left>0&&(t=i.resolve(r+l.map[s.top*l.width])),c.right<l.width&&(n=i.resolve(r+l.map[l.width*(c.top+1)-1]))):(c.left>0&&(n=i.resolve(r+l.map[c.top*l.width])),s.right<l.width&&(t=i.resolve(r+l.map[l.width*(s.top+1)-1]))),new N(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new N(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new N(t.resolve(n),t.resolve(o))}getBookmark(){return new ot(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;E.jsonID("cell",b);var ot=class Te{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Te(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):E.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),Q.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,l=e.depth;for(;l>=0&&!(e.after(l+1)<e.end(l));l--,n++);for(let r=t.depth;r>=0&&!(t.before(r+1)>t.start(r));r--,o--);return n==o&&/row|table/.test(e.node(l).type.spec.tableRole)}function st({$from:e,$to:t}){let n,o;for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&t.parentOffset===0}function it(e,t,n){const o=(t||e).selection,l=(t||e).doc;let r,s;if(o instanceof Fe&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=b.create(l,o.from);else if(s=="row"){const c=l.resolve(o.from+1);r=b.rowSelection(c,c)}else if(!n){const c=C.get(o.node),i=o.from+1,a=i+c.map[c.width*c.height-1];r=b.create(l,i+1,a)}}else o instanceof H&&rt(o)?r=H.create(l,o.from):o instanceof H&&st(o)&&(r=H.create(l,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}const ct=new se("fix-tables");function Me(e,t,n,o){const l=e.childCount,r=t.childCount;e:for(let s=0,c=0;s<r;s++){const i=t.child(s);for(let a=c,d=Math.min(l,s+3);a<d;a++)if(e.child(a)==i){c=a+1,n+=i.nodeSize;continue e}o(i,n),c<l&&e.child(c).sameMarkup(i)?Me(e.child(c),i,n+1,o):i.nodesBetween(0,i.content.size,o,n+1),n+=i.nodeSize}}function ze(e,t){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=at(e,l,r,n))};return t?t.doc!=e.doc&&Me(t.doc,e.doc,0,o):e.doc.descendants(o),n}function at(e,t,n,o){const l=C.get(t);if(!l.problems)return o;o||(o=e.tr);const r=[];for(let i=0;i<l.height;i++)r.push(0);for(let i=0;i<l.problems.length;i++){const a=l.problems[i];if(a.type=="collision"){const d=t.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,B(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+t.nodeSize)}}let s,c;for(let i=0;i<r.length;i++)r[i]&&(s==null&&(s=i),c=i);for(let i=0,a=n+1;i<l.height;i++){const d=t.child(i),u=a+d.nodeSize,f=r[i];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);const h=[];for(let m=0;m<f;m++){const w=v(e.schema)[p].createAndFill();w&&h.push(w)}const g=(i==0||s==i-1)&&c==i?a+1:u-1;o.insert(o.mapping.map(g),h)}a=u}return o.setMeta(ct,{fixTables:!0})}function z(e){const t=e.selection,n=J(e),o=n.node(-1),l=n.start(-1),r=C.get(o);return{...t instanceof b?r.rectBetween(t.$anchorCell.pos-l,t.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function Ne(e,{map:t,tableStart:n,table:o},l){let r=l>0?-1:0;nt(t,o,l+r)&&(r=l==0||l==t.width?null:0);for(let s=0;s<t.height;s++){const c=s*t.width+l;if(l>0&&l<t.width&&t.map[c-1]==t.map[c]){const i=t.map[c],a=o.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,xe(a.attrs,l-t.colCount(i))),s+=a.attrs.rowspan-1}else{const i=r==null?v(o.type.schema).cell:o.nodeAt(t.map[c+r]).type,a=t.positionAt(s,l,o);e.insert(e.mapping.map(n+a),i.createAndFill())}}return e}function dt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.left))}return!0}function ut(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},l){const r=e.mapping.maps.length;for(let s=0;s<t.height;){const c=s*t.width+l,i=t.map[c],a=n.nodeAt(i),d=a.attrs;if(l>0&&t.map[c-1]==i||l<t.width-1&&t.map[c+1]==i)e.setNodeMarkup(e.mapping.slice(r).map(o+i),null,B(d,l-t.colCount(i)));else{const u=e.mapping.slice(r).map(o+i);e.delete(u,u+a.nodeSize)}s+=d.rowspan}}function ht(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;ft(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(r)}t(o)}return!0}function pt(e,t,n){var o;const l=v(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if(((o=t.nodeAt(e.map[r+n*e.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Ee(e,{map:t,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let c=l>0?-1:0;pt(t,o,l+c)&&(c=l==0||l==t.height?null:0);for(let a=0,d=t.width*l;a<t.width;a++,d++)if(l>0&&l<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],f=o.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var i;const u=c==null?v(o.type.schema).cell:(i=o.nodeAt(t.map[d+c*t.width]))===null||i===void 0?void 0:i.type,f=u?.createAndFill();f&&s.push(f)}return e.insert(r,v(o.type.schema).row.create(null,s)),e}function mt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.top))}return!0}function gt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.bottom))}return!0}function wt(e,{map:t,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,c=e.mapping.maps.length;e.delete(r+o,s+o);const i=new Set;for(let a=0,d=l*t.width;a<t.width;a++,d++){const u=t.map[d];if(!i.has(u)){if(i.add(u),l>0&&u==t.map[d-t.width]){const f=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<t.height&&u==t.map[d+t.width]){const f=n.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),g=t.positionAt(l+1,a,n);e.insert(e.mapping.slice(c).map(o+g),h),a+=p.colspan-1}}}}function bt(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;wt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(n.table)}t(o)}return!0}function ce(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Ct({width:e,height:t,map:n},o){let l=o.top*e+o.left,r=l,s=(o.bottom-1)*e+o.left,c=l+(o.right-o.left-1);for(let i=o.top;i<o.bottom;i++){if(o.left>0&&n[r]==n[r-1]||o.right<e&&n[c]==n[c+1])return!0;r+=e,c+=e}for(let i=o.left;i<o.right;i++){if(o.top>0&&n[l]==n[l-e]||o.bottom<t&&n[s]==n[s+e])return!0;l++,s++}return!1}function ae(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=z(e),{map:l}=o;if(Ct(l,o))return!1;if(t){const r=e.tr,s={};let c=M.empty,i,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],p=o.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,i==null)i=f,a=p;else{ce(p)||(c=c.append(p.content));const h=r.mapping.map(f+o.tableStart);r.delete(h,h+p.nodeSize)}}if(i==null||a==null)return!0;if(r.setNodeMarkup(i+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),c.size>0){const d=i+1+a.content.size,u=ce(a)?i+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,c)}r.setSelection(new b(r.doc.resolve(i+o.tableStart))),t(r)}return!0}function de(e,t){const n=v(e.schema);return yt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function yt(e){return(t,n)=>{const o=t.selection;let l,r;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Ze(o.$from),!l)return!1;r=(s=W(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let c=l.attrs;const i=[],a=c.colwidth;c.rowspan>1&&(c={...c,rowspan:1}),c.colspan>1&&(c={...c,colspan:1});const d=z(t),u=t.tr;for(let p=0;p<d.right-d.left;p++)i.push(a?{...c,colwidth:a&&a[p]?[a[p]]:null}:c);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=l.nodeSize);for(let g=d.left,m=0;g<d.right;g++,m++)g==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),e({node:l,row:p,col:g}).createAndFill(i[m]))}u.setNodeMarkup(r,e({node:l,row:d.top,col:d.left}),i[0]),o instanceof b&&u.setSelection(new b(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function At(e,t){return function(n,o){if(!T(n))return!1;const l=J(n);if(l.nodeAfter.attrs[e]===t)return!1;if(o){const r=n.tr;n.selection instanceof b?n.selection.forEachCell((s,c)=>{s.attrs[e]!==t&&r.setNodeMarkup(c,null,{...s.attrs,[e]:t})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[e]:t}),o(r)}return!0}}function St(e){return function(t,n){if(!T(t))return!1;if(n){const o=v(t.schema),l=z(t),r=t.tr,s=l.map.cellsInRect(e=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:e=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),c=s.map(i=>l.table.nodeAt(i));for(let i=0;i<s.length;i++)c[i].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[i],o.cell,c[i].attrs);if(r.steps.length===0)for(let i=0;i<s.length;i++)r.setNodeMarkup(l.tableStart+s[i],o.header_cell,c[i].attrs);n(r)}return!0}}function ue(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let l=0;l<o.length;l++){const r=t.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function I(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?St(e):function(n,o){if(!T(n))return!1;if(o){const l=v(n.schema),r=z(n),s=n.tr,c=ue("row",r,l),i=ue("column",r,l),a=(e==="column"?c:e==="row"&&i)?1:0,d=e=="column"?{left:0,top:a,right:1,bottom:r.map.height}:e=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=e=="column"?i?l.cell:l.header_cell:e=="row"?c?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const p=f+r.tableStart,h=s.doc.nodeAt(p);h&&s.setNodeMarkup(p,u,h.attrs)}),o(s)}return!0}}I("row",{useDeprecatedLogic:!0});I("column",{useDeprecatedLogic:!0});const vt=I("cell",{useDeprecatedLogic:!0});function Rt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,l=e.before();o>=0;o--){const r=e.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),l=e.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function fe(e){return function(t,n){if(!T(t))return!1;const o=Rt(J(t),e);if(o==null)return!1;if(n){const l=t.doc.resolve(o);n(t.tr.setSelection(H.between(l,tt(l))).scrollIntoView())}return!0}}function xt(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function j(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,l=v(e.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new L(l,0,0))}),o.docChanged&&t(o)}return!0}function Tt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const l=t.child(0),r=l.type.spec.tableRole,s=l.type.schema,c=[];if(r=="row")for(let i=0;i<t.childCount;i++){let a=t.child(i).content;const d=i?0:Math.max(0,n-1),u=i<t.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=oe(v(s).row,new L(a,d,u)).content),c.push(a)}else if(r=="cell"||r=="header_cell")c.push(n||o?oe(v(s).row,new L(t,n,o)).content:t);else return null;return Mt(s,c)}function Mt(e,t){const n=[];for(let l=0;l<t.length;l++){const r=t[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:c,colspan:i}=r.child(s).attrs;for(let a=l;a<l+c;a++)n[a]=(n[a]||0)+i}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=t.length&&t.push(M.empty),n[l]<o){const r=v(e).cell.createAndFill(),s=[];for(let c=n[l];c<o;c++)s.push(r);t[l]=t[l].append(M.from(s))}return{height:t.length,width:o,rows:t}}function oe(e,t){const n=e.createAndFill();return new _e(n).replace(0,n.content.size,t).doc}function zt({width:e,height:t,rows:n},o,l){if(e!=o){const r=[],s=[];for(let c=0;c<n.length;c++){const i=n[c],a=[];for(let d=r[c]||0,u=0;d<o;u++){let f=i.child(u%i.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(B(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)r[c+p]=(r[c+p]||0)+f.attrs.colspan}s.push(M.from(a))}n=s,e=o}if(t!=l){const r=[];for(let s=0,c=0;s<l;s++,c++){const i=[],a=n[c%t];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),i.push(u)}r.push(M.from(i))}n=r,t=l}return{width:e,height:t,rows:n}}function Nt(e,t,n,o,l,r,s){const c=e.doc.type.schema,i=v(c);let a,d;if(l>t.width)for(let u=0,f=0;u<t.height;u++){const p=n.child(u);f+=p.nodeSize;const h=[];let g;p.lastChild==null||p.lastChild.type==i.cell?g=a||(a=i.cell.createAndFill()):g=d||(d=i.header_cell.createAndFill());for(let m=t.width;m<l;m++)h.push(g);e.insert(e.mapping.slice(s).map(f-1+o),h)}if(r>t.height){const u=[];for(let h=0,g=(t.height-1)*t.width;h<Math.max(t.width,l);h++){const m=h>=t.width?!1:n.nodeAt(t.map[g+h]).type==i.header_cell;u.push(m?d||(d=i.header_cell.createAndFill()):a||(a=i.cell.createAndFill()))}const f=i.row.create(null,M.from(u)),p=[];for(let h=t.height;h<r;h++)p.push(f);e.insert(e.mapping.slice(s).map(o+n.nodeSize-2),p)}return!!(a||d)}function he(e,t,n,o,l,r,s,c){if(s==0||s==t.height)return!1;let i=!1;for(let a=l;a<r;a++){const d=s*t.width+a,u=t.map[d];if(t.map[d-t.width]==u){i=!0;const f=n.nodeAt(u),{top:p,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f.attrs,rowspan:s-p}),e.insert(e.mapping.slice(c).map(t.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return i}function pe(e,t,n,o,l,r,s,c){if(s==0||s==t.width)return!1;let i=!1;for(let a=l;a<r;a++){const d=a*t.width+s,u=t.map[d];if(t.map[d-1]==u){i=!0;const f=n.nodeAt(u),p=t.colCount(u),h=e.mapping.slice(c).map(u+o);e.setNodeMarkup(h,null,B(f.attrs,s-p,f.attrs.colspan-(s-p))),e.insert(h+f.nodeSize,f.type.createAndFill(B(f.attrs,0,s-p))),a+=f.attrs.rowspan-1}}return i}function me(e,t,n,o,l){let r=n?e.doc.nodeAt(n-1):e.doc;if(!r)throw new Error("No table found");let s=C.get(r);const{top:c,left:i}=o,a=i+l.width,d=c+l.height,u=e.tr;let f=0;function p(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=C.get(r),f=u.mapping.maps.length}Nt(u,s,r,n,a,d,f)&&p(),he(u,s,r,n,i,a,c,f)&&p(),he(u,s,r,n,i,a,d,f)&&p(),pe(u,s,r,n,c,d,i,f)&&p(),pe(u,s,r,n,c,d,a,f)&&p();for(let h=c;h<d;h++){const g=s.positionAt(h,i,r),m=s.positionAt(h,a,r);u.replace(u.mapping.slice(f).map(g+n),u.mapping.slice(f).map(m+n),new L(l.rows[h-c],0,0))}p(),u.setSelection(new b(u.doc.resolve(n+s.positionAt(c,i,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),t(u)}const Et=Oe({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:j,"Mod-Backspace":j,Delete:j,"Mod-Delete":j});function K(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof b)return K(n,o,E.near(r.$headCell,t));if(e!="horiz"&&!r.empty)return!1;const s=He(l,e,t);if(s==null)return!1;if(e=="horiz")return K(n,o,E.near(n.doc.resolve(r.head+t),t));{const c=n.doc.resolve(s),i=Re(c,e,t);let a;return i?a=E.near(i,1):t<0?a=E.near(n.doc.resolve(c.before(-1)),-1):a=E.near(n.doc.resolve(c.after(-1)),1),K(n,o,a)}}}function _(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof b)s=r;else{const i=He(l,e,t);if(i==null)return!1;s=new b(n.doc.resolve(i))}const c=Re(s.$headCell,e,t);return c?K(n,o,new b(s.$anchorCell,c)):!1}}function Ht(e,t){const n=e.state.doc,o=W(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function $t(e,t,n){if(!T(e.state))return!1;let o=Tt(n);const l=e.state.selection;if(l instanceof b){o||(o={width:1,height:1,rows:[M.from(oe(v(e.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),c=C.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=zt(o,c.right-c.left,c.bottom-c.top),me(e.state,e.dispatch,s,c,o),!0}else if(o){const r=J(e.state),s=r.start(-1);return me(e.state,e.dispatch,s,C.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function Lt(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ge(e,t.target);let l;if(t.shiftKey&&e.state.selection instanceof b)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(l=W(e.state.selection.$anchor))!=null&&((n=Y(e,t))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,t),t.preventDefault();else if(!o)return;function r(i,a){let d=Y(e,a);const u=$.getState(e.state)==null;if(!d||!ie(i,d))if(u)d=i;else return;const f=new b(i,d);if(u||!e.state.selection.eq(f)){const p=e.state.tr.setSelection(f);u&&p.setMeta($,i.pos),e.dispatch(p)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",c),$.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta($,-1))}function c(i){const a=i,d=$.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(ge(e,a.target)!=o&&(u=Y(e,t),!u))return s();u&&r(u,a)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",c)}function He(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),c=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?s:null}}return null}function ge(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Y(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:l}=n;return o>=0&&W(e.state.doc.resolve(o))||W(e.state.doc.resolve(l))}var kt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),le(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,le(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function le(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:p,colwidth:h}=a.child(u).attrs;for(let g=0;g<p;g++,f++){const m=l==f?r:h&&h[g],w=m?m+"px":"";if(s+=m||o,m||(c=!1),i)i.style.width!=w&&(i.style.width=w),i=i.nextSibling;else{const S=document.createElement("col");S.style.width=w,t.appendChild(S)}}}for(;i;){var d;const u=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=u}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const x=new se("tableColumnResizing");function Wt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=kt,lastColumnResizable:l=!0}={}){const r=new ve({key:x,state:{init(s,c){var i;const a=(i=r.spec)===null||i===void 0||(i=i.props)===null||i===void 0?void 0:i.nodeViews,d=v(c.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Bt(-1,!1)},apply(s,c){return c.apply(s)}},props:{attributes:s=>{const c=x.getState(s);return c&&c.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,c)=>{Dt(s,c,e,l)},mouseleave:s=>{It(s)},mousedown:(s,c)=>{Pt(s,c,t,n)}},decorations:s=>{const c=x.getState(s);if(c&&c.activeHandle>-1)return Vt(s,c.activeHandle)},nodeViews:{}}});return r}var Bt=class X{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(x);if(o&&o.setHandle!=null)return new X(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new X(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let l=t.mapping.map(n.activeHandle,-1);return ne(t.doc.resolve(l))||(l=-1),new X(l,n.dragging)}return n}};function Dt(e,t,n,o){if(!e.editable)return;const l=x.getState(e.state);if(l&&!l.dragging){const r=jt(t.target);let s=-1;if(r){const{left:c,right:i}=r.getBoundingClientRect();t.clientX-c<=n?s=we(e,t,"left",n):i-t.clientX<=n&&(s=we(e,t,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const c=e.state.doc.resolve(s),i=c.node(-1),a=C.get(i),d=c.start(-1);if(a.colCount(c.pos-d)+c.nodeAfter.attrs.colspan-1==a.width-1)return}$e(e,s)}}}function It(e){if(!e.editable)return;const t=x.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function Pt(e,t,n,o){var l;if(!e.editable)return!1;const r=(l=e.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=x.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const c=e.state.doc.nodeAt(s.activeHandle),i=Ot(e,s.activeHandle,c.attrs);e.dispatch(e.state.tr.setMeta(x,{setDragging:{startX:t.clientX,startWidth:i}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=x.getState(e.state);f?.dragging&&(Ft(e,f.activeHandle,be(f.dragging,u,n)),e.dispatch(e.state.tr.setMeta(x,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=x.getState(e.state);if(f&&f.dragging){const p=be(f.dragging,u,n);Ce(e,f.activeHandle,p,o)}}return Ce(e,s.activeHandle,i,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),t.preventDefault(),!0}function Ot(e,t,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=e.domAtPos(t);let s=r.node.childNodes[r.offset].offsetWidth,c=n;if(o)for(let i=0;i<n;i++)o[i]&&(s-=o[i],c--);return s/c}function jt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function we(e,t,n,o){const l=n=="right"?-o:o,r=e.posAtCoords({left:t.clientX+l,top:t.clientY});if(!r)return-1;const{pos:s}=r,c=W(e.state.doc.resolve(s));if(!c)return-1;if(n=="right")return c.pos;const i=C.get(c.node(-1)),a=c.start(-1),d=i.map.indexOf(c.pos-a);return d%i.width==0?-1:a+i.map[d-1]}function be(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(x,{setHandle:t}))}function Ft(e,t,n){const o=e.state.doc.resolve(t),l=o.node(-1),r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,i=e.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+c;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,p=f.colspan==1?0:c-r.colCount(u);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():_t(f.colspan);h[p]=n,i.setNodeMarkup(s+u,null,{...f,colwidth:h})}i.docChanged&&e.dispatch(i)}function Ce(e,t,n,o){const l=e.state.doc.resolve(t),r=l.node(-1),s=l.start(-1),c=C.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let i=e.domAtPos(l.start(-1)).node;for(;i&&i.nodeName!="TABLE";)i=i.parentNode;i&&le(r,i.firstChild,i,o,c,n)}function _t(e){return Array(e).fill(0)}function Vt(e,t){const n=[],o=e.doc.resolve(t),l=o.node(-1);if(!l)return Q.empty;const r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=c+a*r.width;if((c==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var i;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((i=x.getState(e))===null||i===void 0)&&i.dragging&&n.push(Z.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(f,p))}}return Q.create(e.doc,n)}function Kt({allowTableNodeSelection:e=!1}={}){return new ve({key:$,state:{init(){return null},apply(t,n){const o=t.getMeta($);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:l,pos:r}=t.mapping.mapResult(n);return l?null:r}},props:{decorations:lt,handleDOMEvents:{mousedown:Lt},createSelectionBetween(t){return $.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Ht,handleKeyDown:Et,handlePaste:$t},appendTransaction(t,n,o){return it(o,ze(o,n),e)}})}function U(e){return e==="left"||e==="right"||e==="center"?e:null}function Xt(e){const t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return U(t||n)}function qt(e){return U(e?.align)}function Le(){return{default:null,parseHTML:e=>Xt(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function Ut(e){var t;const n=e.parentElement,o=e.closest("table");if(!n||!o)return null;const l=Array.from(n.children).indexOf(e),r=(t=o.querySelectorAll("colgroup > col")[l])===null||t===void 0?void 0:t.getAttribute("width");return r?[parseInt(r,10)]:null}function ke(e){const t=e.getAttribute("colwidth");return t?t.split(",").map(n=>parseInt(n,10)):Ut(e)}const Jt=/[ \t\r\n\f]+/g;function We(e){var t;return e.children.length>0?!1:((t=e.textContent)!==null&&t!==void 0?t:"").replace(Jt,"")===""}function Be(e){const t=e.createAndFill();if(!t)throw new Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}const Gt=P.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",k(this.options.HTMLAttributes,e),0]}}),Yt=P.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",k(this.options.HTMLAttributes,e),0]}}),Qt=P.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",k(this.options.HTMLAttributes,e),0]}});function re(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ye(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a!==null)for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:h,colwidth:g}=a.child(f).attrs;for(let m=0;m<h;m+=1,p+=1){const w=l===p?r:g&&g[m],S=w?`${w}px`:"";if(s+=w||o,w||(c=!1),i){if(i.style.width!==S){const[y,A]=re(o,w);i.style.setProperty(y,A)}i=i.nextSibling}else{const y=document.createElement("col"),[A,R]=re(o,w);y.style.setProperty(A,R),t.appendChild(y)}}}for(;i;){var d;const f=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=f}const u=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);c&&!u?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var Zt=class{constructor(e,t,n,o={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[l,r]of Object.entries(o))r!=null&&(l==="style"?this.table.style.cssText=String(r):this.table.setAttribute(l,String(r)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ye(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,ye(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){const t=e.target,n=this.dom.contains(t),o=this.contentDOM.contains(t);return!!(n&&!o&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function en(e,t,n,o){let l=0,r=!0;const s=[],c=e.firstChild;if(!c)return{};for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let h=0;h<f;h+=1,u+=1){const g=n===u?o:p&&p[h];l+=g||t,g||(r=!1);const[m,w]=re(t,g);s.push(["col",{style:`${m}: ${w}`}])}}const i=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:i,tableMinWidth:a}}function Ae(e,t){return e.createAndFill()}function tn(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const o=e.nodes[n];o.spec.tableRole&&(t[o.spec.tableRole]=o)}),e.cached.tableNodeTypes=t,t}function nn(e,t,n,o,l){const r=tn(e),s=[],c=[];for(let a=0;a<n;a+=1){const d=Ae(r.cell);if(d&&c.push(d),o){const u=Ae(r.header_cell);u&&s.push(u)}}const i=[];for(let a=0;a<t;a+=1)i.push(r.row.createChecked(null,o&&a===0?s:c));return r.table.createChecked(null,i)}function on(e){return e instanceof b}const V=({editor:e})=>{const{selection:t}=e.state;if(!on(t))return!1;let n=0;const o=q(t.ranges[0].$from,l=>l.type.name==="table");return o?.node.descendants(l=>{if(l.type.name==="table")return!1;["tableCell","tableHeader"].includes(l.type.name)&&(n+=1)}),n!==t.ranges.length?!1:(e.commands.deleteTable(),!0)};function Se(e,t){const n=e.mapping.map(t),o=q(e.selection.$from,s=>s.type.name==="table");if(o?.pos===n)return;const l=e.doc.nodeAt(n);if(!l)return;const r=n+l.nodeSize-1;e.setSelection(H.near(e.doc.resolve(r),-1))}function ln(e){let t="",n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let o=0;for(;n+o<e.length&&e[n+o]==="`";)o+=1;let l=n+o,r=!1;for(;l<e.length;){if(e[l]!=="`"){l+=1;continue}let s=0;for(;l+s<e.length&&e[l+s]==="`";)s+=1;if(s===o){const c=e.slice(n+o,l);t+=e.slice(n,n+o)+c.replace(/\\\||\|/g,i=>i==="|"?"\\|":i)+e.slice(l,l+o),n=l+o,r=!0;break}l+=s}r||(t+=e.slice(n,n+o),n+=o)}return t}function rn(e){return e.split(`
1
+ import{N as P,q as De,c as k,R as Ie,r as Pe,t as se,v as E,w as Oe,T as H,x as je,y as M,z as L,A as ve,D as Q,B as Z,C as Fe,G as _e,H as Ve,I as Ke,J as q,f as Xe}from"./usage-stats-xir5IhsZ.js";const qe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ue=P.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",k(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,o,l,r,s;const c=(t=(n=e.attrs)===null||n===void 0?void 0:n.src)!==null&&t!==void 0?t:"",i=(o=(l=e.attrs)===null||l===void 0?void 0:l.alt)!==null&&o!==void 0?o:"",a=(r=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&r!==void 0?r:"";return a?`![${i}](${c} "${a}")`:`![${i}](${c})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:o}=this.options.resize,l=new Set(["src","width","height"]);return({node:r,getPos:s,HTMLAttributes:c,editor:i})=>{const a=document.createElement("img");a.draggable=!1;const d=k(this.options.HTMLAttributes,c);Object.entries(d).forEach(([w,S])=>{if(S!=null)switch(w){case"src":case"width":case"height":break;default:a.setAttribute(w,S)}}),d.src!==null&&(a.src=d.src);let u={...c};const f=w=>{if(typeof w=="string"&&w!==""){a.getAttribute("src")!==w&&(a.src=w);return}a.hasAttribute("src")&&a.removeAttribute("src"),a.src!==""&&(a.src="")};f(c.src);const p=w=>{if(w.type!==r.type)return!1;const S=i.extensionManager.attributes.filter(A=>A.type===w.type.name),y=Pe(w,S);return Object.keys(u).forEach(A=>{!l.has(A)&&!(A in y)&&a.removeAttribute(A)}),Object.entries(y).forEach(([A,R])=>{l.has(A)||(R!=null?a.setAttribute(A,R):a.removeAttribute(A))}),f(y.src),u=y,!0},h=new Ie({element:a,editor:i,node:r,getPos:s,onResize:(w,S)=>{a.style.width=`${w}px`,a.style.height=`${S}px`},onCommit:(w,S)=>{const y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:w,height:S}).run()},onUpdate:p,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:o===!0}}),g=h.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",a.complete&&a.naturalWidth>0?m():(a.onload=m,a.onerror=m),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[De({find:qe,type:this.type,getAttributes:e=>{const[,,t,n,o]=e;return{src:n,alt:t,title:o}}})]}});var un=Ue;let ee,te;if(typeof WeakMap<"u"){let e=new WeakMap;ee=t=>e.get(t),te=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;ee=o=>{for(let l=0;l<e.length;l+=2)if(e[l]==o)return e[l+1]},te=(o,l)=>(n==10&&(n=0),e[n++]=o,e[n++]=l)}var C=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,l=t/this.width|0;let r=o+1,s=l+1;for(let c=1;r<this.width&&this.map[t+c]==n;c++)r++;for(let c=1;s<this.height&&this.map[t+this.width*c]==n;c++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(e,t){const{left:n,right:o,top:l,bottom:r}=this.findCell(e),{left:s,right:c,top:i,bottom:a}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(l,i),right:Math.max(o,c),bottom:Math.max(r,a)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let l=e.left;l<e.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==e.left&&l&&this.map[r-1]==s||o==e.top&&o&&this.map[r-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==e){let s=t+e*this.width;const c=(e+1)*this.width;for(;s<c&&this.map[s]<l;)s++;return s==c?r-1:this.map[s]}l=r}}static get(e){return ee(e)||te(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=t*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=e.child(a);d++;for(let h=0;;h++){for(;l<o.length&&o[l]!=0;)l++;if(h==u.childCount)break;const g=u.child(h),{colspan:m,rowspan:w,colwidth:S}=g.attrs;for(let y=0;y<w;y++){if(y+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-y});break}const A=l+y*t;for(let R=0;R<m;R++){o[A+R]==0?o[A+R]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:m-R});const O=S&&S[R];if(O){const D=(A+R)%t*2,G=s[D];G==null||G!=O&&s[D+1]==1?(s[D]=O,s[D+1]=1):G==O&&s[D+1]++}}}l+=m,d+=g.nodeSize}const f=(a+1)*t;let p=0;for(;l<f;)o[l++]==0&&p++;p&&(r||(r=[])).push({type:"missing",row:a,n:p}),d++}(t===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const c=new C(t,n,o,r);let i=!1;for(let a=0;!i&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(i=!0);return i&&Ye(c,s,e),c}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const l=e.child(o);let r=0;if(n)for(let s=0;s<o;s++){const c=e.child(s);for(let i=0;i<c.childCount;i++){const a=c.child(i);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const c=l.child(s);r+=c.attrs.colspan,c.attrs.rowspan>1&&(n=!0)}t==-1?t=r:t!=r&&(t=Math.max(t,r))}return t}function Ye(e,t,n){e.problems||(e.problems=[]);const o={};for(let l=0;l<e.map.length;l++){const r=e.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let c=null;const i=s.attrs;for(let a=0;a<i.colspan;a++){const d=t[(l+a)%e.width*2];d!=null&&(!i.colwidth||i.colwidth[a]!=d)&&((c||(c=Qe(i)))[a]=d)}c&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:c})}}function Qe(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function v(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],l=o.spec.tableRole;l&&(t[l]=o)}}return t}const $=new se("selectingCells");function W(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Ze(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function T(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function J(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=W(t.$head)||et(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function et(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ne(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function tt(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Re(e,t,n){const o=e.node(-1),l=C.get(o),r=e.start(-1),s=l.nextCell(e.pos-r,t,n);return s==null?null:e.node(0).resolve(r+s)}function B(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(t,0,0)}return o}function nt(e,t,n){const o=v(t.type.schema).header_cell;for(let l=0;l<e.height;l++)if(t.nodeAt(e.map[n+l*e.width]).type!=o)return!1;return!0}var b=class N extends E{constructor(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.rectBetween(t.pos-r,n.pos-r),c=t.node(0),i=l.cellsInRect(s).filter(d=>d!=n.pos-r);i.unshift(n.pos-r);const a=i.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new je(c.resolve(f),c.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),l=t.resolve(n.map(this.$headCell.pos));if(ne(o)&&ne(l)&&ie(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?N.rowSelection(o,l):r&&this.isColSelection()?N.colSelection(o,l):new N(o,l)}return H.between(o,l)}content(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let i=l.top;i<l.bottom;i++){const a=[];for(let d=i*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const p=n.findCell(f);let h=t.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const g=l.left-p.left,m=p.right-l.right;if(g>0||m>0){let w=h.attrs;if(g>0&&(w=B(w,0,g)),m>0&&(w=B(w,w.colspan-m,m)),p.left<l.left){if(h=h.type.createAndFill(w),!h)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else h=h.type.create(w,h.content)}if(p.top<l.top||p.bottom>l.bottom){const w={...h.attrs,rowspan:Math.min(p.bottom,l.bottom)-Math.max(p.top,l.top)};p.top<l.top?h=h.type.createAndFill(w):h=h.type.create(w,h.content)}a.push(h)}s.push(t.child(i).copy(M.from(a)))}const c=this.isColSelection()&&this.isRowSelection()?t:s;return new L(M.from(c),1,1)}replace(t,n=L.empty){const o=t.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:c,$to:i}=l[s],a=t.mapping.slice(o);t.replace(a.map(c.pos),a.map(i.pos),s?L.empty:n)}const r=E.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);r&&t.setSelection(r)}replaceWith(t,n){this.replace(t,new L(M.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=C.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)t(n.nodeAt(r[s]),l+r[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.top<=c.top?(s.top>0&&(t=i.resolve(r+l.map[s.left])),c.bottom<l.height&&(n=i.resolve(r+l.map[l.width*(l.height-1)+c.right-1]))):(c.top>0&&(n=i.resolve(r+l.map[c.left])),s.bottom<l.height&&(t=i.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new N(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,c=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,c)==n.width}eq(t){return t instanceof N&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.left<=c.left?(s.left>0&&(t=i.resolve(r+l.map[s.top*l.width])),c.right<l.width&&(n=i.resolve(r+l.map[l.width*(c.top+1)-1]))):(c.left>0&&(n=i.resolve(r+l.map[c.top*l.width])),s.right<l.width&&(t=i.resolve(r+l.map[l.width*(s.top+1)-1]))),new N(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new N(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new N(t.resolve(n),t.resolve(o))}getBookmark(){return new ot(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;E.jsonID("cell",b);var ot=class Te{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Te(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):E.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),Q.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,l=e.depth;for(;l>=0&&!(e.after(l+1)<e.end(l));l--,n++);for(let r=t.depth;r>=0&&!(t.before(r+1)>t.start(r));r--,o--);return n==o&&/row|table/.test(e.node(l).type.spec.tableRole)}function st({$from:e,$to:t}){let n,o;for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&t.parentOffset===0}function it(e,t,n){const o=(t||e).selection,l=(t||e).doc;let r,s;if(o instanceof Fe&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=b.create(l,o.from);else if(s=="row"){const c=l.resolve(o.from+1);r=b.rowSelection(c,c)}else if(!n){const c=C.get(o.node),i=o.from+1,a=i+c.map[c.width*c.height-1];r=b.create(l,i+1,a)}}else o instanceof H&&rt(o)?r=H.create(l,o.from):o instanceof H&&st(o)&&(r=H.create(l,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}const ct=new se("fix-tables");function Me(e,t,n,o){const l=e.childCount,r=t.childCount;e:for(let s=0,c=0;s<r;s++){const i=t.child(s);for(let a=c,d=Math.min(l,s+3);a<d;a++)if(e.child(a)==i){c=a+1,n+=i.nodeSize;continue e}o(i,n),c<l&&e.child(c).sameMarkup(i)?Me(e.child(c),i,n+1,o):i.nodesBetween(0,i.content.size,o,n+1),n+=i.nodeSize}}function ze(e,t){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=at(e,l,r,n))};return t?t.doc!=e.doc&&Me(t.doc,e.doc,0,o):e.doc.descendants(o),n}function at(e,t,n,o){const l=C.get(t);if(!l.problems)return o;o||(o=e.tr);const r=[];for(let i=0;i<l.height;i++)r.push(0);for(let i=0;i<l.problems.length;i++){const a=l.problems[i];if(a.type=="collision"){const d=t.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,B(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+t.nodeSize)}}let s,c;for(let i=0;i<r.length;i++)r[i]&&(s==null&&(s=i),c=i);for(let i=0,a=n+1;i<l.height;i++){const d=t.child(i),u=a+d.nodeSize,f=r[i];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);const h=[];for(let m=0;m<f;m++){const w=v(e.schema)[p].createAndFill();w&&h.push(w)}const g=(i==0||s==i-1)&&c==i?a+1:u-1;o.insert(o.mapping.map(g),h)}a=u}return o.setMeta(ct,{fixTables:!0})}function z(e){const t=e.selection,n=J(e),o=n.node(-1),l=n.start(-1),r=C.get(o);return{...t instanceof b?r.rectBetween(t.$anchorCell.pos-l,t.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function Ne(e,{map:t,tableStart:n,table:o},l){let r=l>0?-1:0;nt(t,o,l+r)&&(r=l==0||l==t.width?null:0);for(let s=0;s<t.height;s++){const c=s*t.width+l;if(l>0&&l<t.width&&t.map[c-1]==t.map[c]){const i=t.map[c],a=o.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,xe(a.attrs,l-t.colCount(i))),s+=a.attrs.rowspan-1}else{const i=r==null?v(o.type.schema).cell:o.nodeAt(t.map[c+r]).type,a=t.positionAt(s,l,o);e.insert(e.mapping.map(n+a),i.createAndFill())}}return e}function dt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.left))}return!0}function ut(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},l){const r=e.mapping.maps.length;for(let s=0;s<t.height;){const c=s*t.width+l,i=t.map[c],a=n.nodeAt(i),d=a.attrs;if(l>0&&t.map[c-1]==i||l<t.width-1&&t.map[c+1]==i)e.setNodeMarkup(e.mapping.slice(r).map(o+i),null,B(d,l-t.colCount(i)));else{const u=e.mapping.slice(r).map(o+i);e.delete(u,u+a.nodeSize)}s+=d.rowspan}}function ht(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;ft(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(r)}t(o)}return!0}function pt(e,t,n){var o;const l=v(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if(((o=t.nodeAt(e.map[r+n*e.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Ee(e,{map:t,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let c=l>0?-1:0;pt(t,o,l+c)&&(c=l==0||l==t.height?null:0);for(let a=0,d=t.width*l;a<t.width;a++,d++)if(l>0&&l<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],f=o.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var i;const u=c==null?v(o.type.schema).cell:(i=o.nodeAt(t.map[d+c*t.width]))===null||i===void 0?void 0:i.type,f=u?.createAndFill();f&&s.push(f)}return e.insert(r,v(o.type.schema).row.create(null,s)),e}function mt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.top))}return!0}function gt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.bottom))}return!0}function wt(e,{map:t,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,c=e.mapping.maps.length;e.delete(r+o,s+o);const i=new Set;for(let a=0,d=l*t.width;a<t.width;a++,d++){const u=t.map[d];if(!i.has(u)){if(i.add(u),l>0&&u==t.map[d-t.width]){const f=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<t.height&&u==t.map[d+t.width]){const f=n.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),g=t.positionAt(l+1,a,n);e.insert(e.mapping.slice(c).map(o+g),h),a+=p.colspan-1}}}}function bt(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;wt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(n.table)}t(o)}return!0}function ce(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Ct({width:e,height:t,map:n},o){let l=o.top*e+o.left,r=l,s=(o.bottom-1)*e+o.left,c=l+(o.right-o.left-1);for(let i=o.top;i<o.bottom;i++){if(o.left>0&&n[r]==n[r-1]||o.right<e&&n[c]==n[c+1])return!0;r+=e,c+=e}for(let i=o.left;i<o.right;i++){if(o.top>0&&n[l]==n[l-e]||o.bottom<t&&n[s]==n[s+e])return!0;l++,s++}return!1}function ae(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=z(e),{map:l}=o;if(Ct(l,o))return!1;if(t){const r=e.tr,s={};let c=M.empty,i,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],p=o.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,i==null)i=f,a=p;else{ce(p)||(c=c.append(p.content));const h=r.mapping.map(f+o.tableStart);r.delete(h,h+p.nodeSize)}}if(i==null||a==null)return!0;if(r.setNodeMarkup(i+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),c.size>0){const d=i+1+a.content.size,u=ce(a)?i+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,c)}r.setSelection(new b(r.doc.resolve(i+o.tableStart))),t(r)}return!0}function de(e,t){const n=v(e.schema);return yt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function yt(e){return(t,n)=>{const o=t.selection;let l,r;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Ze(o.$from),!l)return!1;r=(s=W(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let c=l.attrs;const i=[],a=c.colwidth;c.rowspan>1&&(c={...c,rowspan:1}),c.colspan>1&&(c={...c,colspan:1});const d=z(t),u=t.tr;for(let p=0;p<d.right-d.left;p++)i.push(a?{...c,colwidth:a&&a[p]?[a[p]]:null}:c);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=l.nodeSize);for(let g=d.left,m=0;g<d.right;g++,m++)g==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),e({node:l,row:p,col:g}).createAndFill(i[m]))}u.setNodeMarkup(r,e({node:l,row:d.top,col:d.left}),i[0]),o instanceof b&&u.setSelection(new b(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function At(e,t){return function(n,o){if(!T(n))return!1;const l=J(n);if(l.nodeAfter.attrs[e]===t)return!1;if(o){const r=n.tr;n.selection instanceof b?n.selection.forEachCell((s,c)=>{s.attrs[e]!==t&&r.setNodeMarkup(c,null,{...s.attrs,[e]:t})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[e]:t}),o(r)}return!0}}function St(e){return function(t,n){if(!T(t))return!1;if(n){const o=v(t.schema),l=z(t),r=t.tr,s=l.map.cellsInRect(e=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:e=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),c=s.map(i=>l.table.nodeAt(i));for(let i=0;i<s.length;i++)c[i].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[i],o.cell,c[i].attrs);if(r.steps.length===0)for(let i=0;i<s.length;i++)r.setNodeMarkup(l.tableStart+s[i],o.header_cell,c[i].attrs);n(r)}return!0}}function ue(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let l=0;l<o.length;l++){const r=t.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function I(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?St(e):function(n,o){if(!T(n))return!1;if(o){const l=v(n.schema),r=z(n),s=n.tr,c=ue("row",r,l),i=ue("column",r,l),a=(e==="column"?c:e==="row"&&i)?1:0,d=e=="column"?{left:0,top:a,right:1,bottom:r.map.height}:e=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=e=="column"?i?l.cell:l.header_cell:e=="row"?c?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const p=f+r.tableStart,h=s.doc.nodeAt(p);h&&s.setNodeMarkup(p,u,h.attrs)}),o(s)}return!0}}I("row",{useDeprecatedLogic:!0});I("column",{useDeprecatedLogic:!0});const vt=I("cell",{useDeprecatedLogic:!0});function Rt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,l=e.before();o>=0;o--){const r=e.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),l=e.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function fe(e){return function(t,n){if(!T(t))return!1;const o=Rt(J(t),e);if(o==null)return!1;if(n){const l=t.doc.resolve(o);n(t.tr.setSelection(H.between(l,tt(l))).scrollIntoView())}return!0}}function xt(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function j(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,l=v(e.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new L(l,0,0))}),o.docChanged&&t(o)}return!0}function Tt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const l=t.child(0),r=l.type.spec.tableRole,s=l.type.schema,c=[];if(r=="row")for(let i=0;i<t.childCount;i++){let a=t.child(i).content;const d=i?0:Math.max(0,n-1),u=i<t.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=oe(v(s).row,new L(a,d,u)).content),c.push(a)}else if(r=="cell"||r=="header_cell")c.push(n||o?oe(v(s).row,new L(t,n,o)).content:t);else return null;return Mt(s,c)}function Mt(e,t){const n=[];for(let l=0;l<t.length;l++){const r=t[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:c,colspan:i}=r.child(s).attrs;for(let a=l;a<l+c;a++)n[a]=(n[a]||0)+i}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=t.length&&t.push(M.empty),n[l]<o){const r=v(e).cell.createAndFill(),s=[];for(let c=n[l];c<o;c++)s.push(r);t[l]=t[l].append(M.from(s))}return{height:t.length,width:o,rows:t}}function oe(e,t){const n=e.createAndFill();return new _e(n).replace(0,n.content.size,t).doc}function zt({width:e,height:t,rows:n},o,l){if(e!=o){const r=[],s=[];for(let c=0;c<n.length;c++){const i=n[c],a=[];for(let d=r[c]||0,u=0;d<o;u++){let f=i.child(u%i.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(B(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)r[c+p]=(r[c+p]||0)+f.attrs.colspan}s.push(M.from(a))}n=s,e=o}if(t!=l){const r=[];for(let s=0,c=0;s<l;s++,c++){const i=[],a=n[c%t];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),i.push(u)}r.push(M.from(i))}n=r,t=l}return{width:e,height:t,rows:n}}function Nt(e,t,n,o,l,r,s){const c=e.doc.type.schema,i=v(c);let a,d;if(l>t.width)for(let u=0,f=0;u<t.height;u++){const p=n.child(u);f+=p.nodeSize;const h=[];let g;p.lastChild==null||p.lastChild.type==i.cell?g=a||(a=i.cell.createAndFill()):g=d||(d=i.header_cell.createAndFill());for(let m=t.width;m<l;m++)h.push(g);e.insert(e.mapping.slice(s).map(f-1+o),h)}if(r>t.height){const u=[];for(let h=0,g=(t.height-1)*t.width;h<Math.max(t.width,l);h++){const m=h>=t.width?!1:n.nodeAt(t.map[g+h]).type==i.header_cell;u.push(m?d||(d=i.header_cell.createAndFill()):a||(a=i.cell.createAndFill()))}const f=i.row.create(null,M.from(u)),p=[];for(let h=t.height;h<r;h++)p.push(f);e.insert(e.mapping.slice(s).map(o+n.nodeSize-2),p)}return!!(a||d)}function he(e,t,n,o,l,r,s,c){if(s==0||s==t.height)return!1;let i=!1;for(let a=l;a<r;a++){const d=s*t.width+a,u=t.map[d];if(t.map[d-t.width]==u){i=!0;const f=n.nodeAt(u),{top:p,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f.attrs,rowspan:s-p}),e.insert(e.mapping.slice(c).map(t.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return i}function pe(e,t,n,o,l,r,s,c){if(s==0||s==t.width)return!1;let i=!1;for(let a=l;a<r;a++){const d=a*t.width+s,u=t.map[d];if(t.map[d-1]==u){i=!0;const f=n.nodeAt(u),p=t.colCount(u),h=e.mapping.slice(c).map(u+o);e.setNodeMarkup(h,null,B(f.attrs,s-p,f.attrs.colspan-(s-p))),e.insert(h+f.nodeSize,f.type.createAndFill(B(f.attrs,0,s-p))),a+=f.attrs.rowspan-1}}return i}function me(e,t,n,o,l){let r=n?e.doc.nodeAt(n-1):e.doc;if(!r)throw new Error("No table found");let s=C.get(r);const{top:c,left:i}=o,a=i+l.width,d=c+l.height,u=e.tr;let f=0;function p(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=C.get(r),f=u.mapping.maps.length}Nt(u,s,r,n,a,d,f)&&p(),he(u,s,r,n,i,a,c,f)&&p(),he(u,s,r,n,i,a,d,f)&&p(),pe(u,s,r,n,c,d,i,f)&&p(),pe(u,s,r,n,c,d,a,f)&&p();for(let h=c;h<d;h++){const g=s.positionAt(h,i,r),m=s.positionAt(h,a,r);u.replace(u.mapping.slice(f).map(g+n),u.mapping.slice(f).map(m+n),new L(l.rows[h-c],0,0))}p(),u.setSelection(new b(u.doc.resolve(n+s.positionAt(c,i,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),t(u)}const Et=Oe({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:j,"Mod-Backspace":j,Delete:j,"Mod-Delete":j});function K(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof b)return K(n,o,E.near(r.$headCell,t));if(e!="horiz"&&!r.empty)return!1;const s=He(l,e,t);if(s==null)return!1;if(e=="horiz")return K(n,o,E.near(n.doc.resolve(r.head+t),t));{const c=n.doc.resolve(s),i=Re(c,e,t);let a;return i?a=E.near(i,1):t<0?a=E.near(n.doc.resolve(c.before(-1)),-1):a=E.near(n.doc.resolve(c.after(-1)),1),K(n,o,a)}}}function _(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof b)s=r;else{const i=He(l,e,t);if(i==null)return!1;s=new b(n.doc.resolve(i))}const c=Re(s.$headCell,e,t);return c?K(n,o,new b(s.$anchorCell,c)):!1}}function Ht(e,t){const n=e.state.doc,o=W(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function $t(e,t,n){if(!T(e.state))return!1;let o=Tt(n);const l=e.state.selection;if(l instanceof b){o||(o={width:1,height:1,rows:[M.from(oe(v(e.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),c=C.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=zt(o,c.right-c.left,c.bottom-c.top),me(e.state,e.dispatch,s,c,o),!0}else if(o){const r=J(e.state),s=r.start(-1);return me(e.state,e.dispatch,s,C.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function Lt(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ge(e,t.target);let l;if(t.shiftKey&&e.state.selection instanceof b)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(l=W(e.state.selection.$anchor))!=null&&((n=Y(e,t))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,t),t.preventDefault();else if(!o)return;function r(i,a){let d=Y(e,a);const u=$.getState(e.state)==null;if(!d||!ie(i,d))if(u)d=i;else return;const f=new b(i,d);if(u||!e.state.selection.eq(f)){const p=e.state.tr.setSelection(f);u&&p.setMeta($,i.pos),e.dispatch(p)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",c),$.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta($,-1))}function c(i){const a=i,d=$.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(ge(e,a.target)!=o&&(u=Y(e,t),!u))return s();u&&r(u,a)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",c)}function He(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),c=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?s:null}}return null}function ge(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Y(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:l}=n;return o>=0&&W(e.state.doc.resolve(o))||W(e.state.doc.resolve(l))}var kt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),le(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,le(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function le(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:p,colwidth:h}=a.child(u).attrs;for(let g=0;g<p;g++,f++){const m=l==f?r:h&&h[g],w=m?m+"px":"";if(s+=m||o,m||(c=!1),i)i.style.width!=w&&(i.style.width=w),i=i.nextSibling;else{const S=document.createElement("col");S.style.width=w,t.appendChild(S)}}}for(;i;){var d;const u=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=u}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const x=new se("tableColumnResizing");function Wt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=kt,lastColumnResizable:l=!0}={}){const r=new ve({key:x,state:{init(s,c){var i;const a=(i=r.spec)===null||i===void 0||(i=i.props)===null||i===void 0?void 0:i.nodeViews,d=v(c.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Bt(-1,!1)},apply(s,c){return c.apply(s)}},props:{attributes:s=>{const c=x.getState(s);return c&&c.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,c)=>{Dt(s,c,e,l)},mouseleave:s=>{It(s)},mousedown:(s,c)=>{Pt(s,c,t,n)}},decorations:s=>{const c=x.getState(s);if(c&&c.activeHandle>-1)return Vt(s,c.activeHandle)},nodeViews:{}}});return r}var Bt=class X{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(x);if(o&&o.setHandle!=null)return new X(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new X(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let l=t.mapping.map(n.activeHandle,-1);return ne(t.doc.resolve(l))||(l=-1),new X(l,n.dragging)}return n}};function Dt(e,t,n,o){if(!e.editable)return;const l=x.getState(e.state);if(l&&!l.dragging){const r=jt(t.target);let s=-1;if(r){const{left:c,right:i}=r.getBoundingClientRect();t.clientX-c<=n?s=we(e,t,"left",n):i-t.clientX<=n&&(s=we(e,t,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const c=e.state.doc.resolve(s),i=c.node(-1),a=C.get(i),d=c.start(-1);if(a.colCount(c.pos-d)+c.nodeAfter.attrs.colspan-1==a.width-1)return}$e(e,s)}}}function It(e){if(!e.editable)return;const t=x.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function Pt(e,t,n,o){var l;if(!e.editable)return!1;const r=(l=e.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=x.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const c=e.state.doc.nodeAt(s.activeHandle),i=Ot(e,s.activeHandle,c.attrs);e.dispatch(e.state.tr.setMeta(x,{setDragging:{startX:t.clientX,startWidth:i}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=x.getState(e.state);f?.dragging&&(Ft(e,f.activeHandle,be(f.dragging,u,n)),e.dispatch(e.state.tr.setMeta(x,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=x.getState(e.state);if(f&&f.dragging){const p=be(f.dragging,u,n);Ce(e,f.activeHandle,p,o)}}return Ce(e,s.activeHandle,i,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),t.preventDefault(),!0}function Ot(e,t,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=e.domAtPos(t);let s=r.node.childNodes[r.offset].offsetWidth,c=n;if(o)for(let i=0;i<n;i++)o[i]&&(s-=o[i],c--);return s/c}function jt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function we(e,t,n,o){const l=n=="right"?-o:o,r=e.posAtCoords({left:t.clientX+l,top:t.clientY});if(!r)return-1;const{pos:s}=r,c=W(e.state.doc.resolve(s));if(!c)return-1;if(n=="right")return c.pos;const i=C.get(c.node(-1)),a=c.start(-1),d=i.map.indexOf(c.pos-a);return d%i.width==0?-1:a+i.map[d-1]}function be(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(x,{setHandle:t}))}function Ft(e,t,n){const o=e.state.doc.resolve(t),l=o.node(-1),r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,i=e.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+c;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,p=f.colspan==1?0:c-r.colCount(u);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():_t(f.colspan);h[p]=n,i.setNodeMarkup(s+u,null,{...f,colwidth:h})}i.docChanged&&e.dispatch(i)}function Ce(e,t,n,o){const l=e.state.doc.resolve(t),r=l.node(-1),s=l.start(-1),c=C.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let i=e.domAtPos(l.start(-1)).node;for(;i&&i.nodeName!="TABLE";)i=i.parentNode;i&&le(r,i.firstChild,i,o,c,n)}function _t(e){return Array(e).fill(0)}function Vt(e,t){const n=[],o=e.doc.resolve(t),l=o.node(-1);if(!l)return Q.empty;const r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=c+a*r.width;if((c==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var i;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((i=x.getState(e))===null||i===void 0)&&i.dragging&&n.push(Z.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(f,p))}}return Q.create(e.doc,n)}function Kt({allowTableNodeSelection:e=!1}={}){return new ve({key:$,state:{init(){return null},apply(t,n){const o=t.getMeta($);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:l,pos:r}=t.mapping.mapResult(n);return l?null:r}},props:{decorations:lt,handleDOMEvents:{mousedown:Lt},createSelectionBetween(t){return $.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Ht,handleKeyDown:Et,handlePaste:$t},appendTransaction(t,n,o){return it(o,ze(o,n),e)}})}function U(e){return e==="left"||e==="right"||e==="center"?e:null}function Xt(e){const t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return U(t||n)}function qt(e){return U(e?.align)}function Le(){return{default:null,parseHTML:e=>Xt(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function Ut(e){var t;const n=e.parentElement,o=e.closest("table");if(!n||!o)return null;const l=Array.from(n.children).indexOf(e),r=(t=o.querySelectorAll("colgroup > col")[l])===null||t===void 0?void 0:t.getAttribute("width");return r?[parseInt(r,10)]:null}function ke(e){const t=e.getAttribute("colwidth");return t?t.split(",").map(n=>parseInt(n,10)):Ut(e)}const Jt=/[ \t\r\n\f]+/g;function We(e){var t;return e.children.length>0?!1:((t=e.textContent)!==null&&t!==void 0?t:"").replace(Jt,"")===""}function Be(e){const t=e.createAndFill();if(!t)throw new Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}const Gt=P.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",k(this.options.HTMLAttributes,e),0]}}),Yt=P.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",k(this.options.HTMLAttributes,e),0]}}),Qt=P.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",k(this.options.HTMLAttributes,e),0]}});function re(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ye(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a!==null)for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:h,colwidth:g}=a.child(f).attrs;for(let m=0;m<h;m+=1,p+=1){const w=l===p?r:g&&g[m],S=w?`${w}px`:"";if(s+=w||o,w||(c=!1),i){if(i.style.width!==S){const[y,A]=re(o,w);i.style.setProperty(y,A)}i=i.nextSibling}else{const y=document.createElement("col"),[A,R]=re(o,w);y.style.setProperty(A,R),t.appendChild(y)}}}for(;i;){var d;const f=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=f}const u=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);c&&!u?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var Zt=class{constructor(e,t,n,o={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[l,r]of Object.entries(o))r!=null&&(l==="style"?this.table.style.cssText=String(r):this.table.setAttribute(l,String(r)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ye(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,ye(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){const t=e.target,n=this.dom.contains(t),o=this.contentDOM.contains(t);return!!(n&&!o&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function en(e,t,n,o){let l=0,r=!0;const s=[],c=e.firstChild;if(!c)return{};for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let h=0;h<f;h+=1,u+=1){const g=n===u?o:p&&p[h];l+=g||t,g||(r=!1);const[m,w]=re(t,g);s.push(["col",{style:`${m}: ${w}`}])}}const i=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:i,tableMinWidth:a}}function Ae(e,t){return e.createAndFill()}function tn(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const o=e.nodes[n];o.spec.tableRole&&(t[o.spec.tableRole]=o)}),e.cached.tableNodeTypes=t,t}function nn(e,t,n,o,l){const r=tn(e),s=[],c=[];for(let a=0;a<n;a+=1){const d=Ae(r.cell);if(d&&c.push(d),o){const u=Ae(r.header_cell);u&&s.push(u)}}const i=[];for(let a=0;a<t;a+=1)i.push(r.row.createChecked(null,o&&a===0?s:c));return r.table.createChecked(null,i)}function on(e){return e instanceof b}const V=({editor:e})=>{const{selection:t}=e.state;if(!on(t))return!1;let n=0;const o=q(t.ranges[0].$from,l=>l.type.name==="table");return o?.node.descendants(l=>{if(l.type.name==="table")return!1;["tableCell","tableHeader"].includes(l.type.name)&&(n+=1)}),n!==t.ranges.length?!1:(e.commands.deleteTable(),!0)};function Se(e,t){const n=e.mapping.map(t),o=q(e.selection.$from,s=>s.type.name==="table");if(o?.pos===n)return;const l=e.doc.nodeAt(n);if(!l)return;const r=n+l.nodeSize-1;e.setSelection(H.near(e.doc.resolve(r),-1))}function ln(e){let t="",n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let o=0;for(;n+o<e.length&&e[n+o]==="`";)o+=1;let l=n+o,r=!1;for(;l<e.length;){if(e[l]!=="`"){l+=1;continue}let s=0;for(;l+s<e.length&&e[l+s]==="`";)s+=1;if(s===o){const c=e.slice(n+o,l);t+=e.slice(n,n+o)+c.replace(/\\\||\|/g,i=>i==="|"?"\\|":i)+e.slice(l,l+o),n=l+o,r=!0;break}l+=s}r||(t+=e.slice(n,n+o),n+=o)}return t}function rn(e){return e.split(`
2
2
  `).map(t=>!t.includes("|")||!t.includes("`")?t:ln(t)).join(`
3
3
  `)}function sn(e){return(e||"").replace(/\s+/g," ").trim()}function cn(e,t,n={}){var o;const l=(o=n.cellLineSeparator)!==null&&o!==void 0?o:"";if(!e||!e.content||e.content.length===0)return"";const r=[];e.content.forEach(h=>{const g=[];h.content&&h.content.forEach(m=>{let w="";m.content&&Array.isArray(m.content)&&m.content.length>1?w=m.content.map(R=>t.renderChildren(R)).join(l):w=m.content?t.renderChildren(m.content):"";const S=sn(w.split(l).join(`
4
4
  `).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),y=m.type==="tableHeader",A=qt(m.attrs);g.push({text:S,isHeader:y,align:A})}),r.push(g)});const s=r.reduce((h,g)=>Math.max(h,g.length),0);if(s===0)return"";const c=Array.from({length:s}).fill(0);r.forEach(h=>{for(let m=0;m<s;m+=1){var g;const w=(((g=h[m])===null||g===void 0?void 0:g.text)||"").length;w>c[m]&&(c[m]=w),c[m]<3&&(c[m]=3)}});const i=(h,g)=>h+" ".repeat(Math.max(0,g-h.length)),a=r[0],d=a.some(h=>h.isHeader),u=Array.from({length:s}).fill(null);r.forEach(h=>{for(let m=0;m<s;m+=1){var g;!u[m]&&(!((g=h[m])===null||g===void 0)&&g.align)&&(u[m]=h[m].align)}});let f=`
@@ -1 +1 @@
1
- import{c as f,f as p,av as u,j as s,b5 as x,N as a}from"./index-BRgWMc-5.js";import{C as j}from"./capability-load-error-LShIU80A.js";function d(){const t=f.c(19);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:g,error:c}=u();if(g){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(x,{}),t[1]=e):e=t[1],e}if(c){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("monitoring:view")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("members:manage")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}let n;return t[17]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[17]=r,t[18]=n):n=t[18],n}export{d as default};
1
+ import{c as f,f as p,av as u,j as s,b5 as x,N as a}from"./index-BMPeWdJw.js";import{C as j}from"./capability-load-error-BYOGvrqt.js";function d(){const t=f.c(19);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:g,error:c}=u();if(g){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(x,{}),t[1]=e):e=t[1],e}if(c){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("monitoring:view")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("members:manage")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}let n;return t[17]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[17]=r,t[18]=n):n=t[18],n}export{d as default};
@@ -1,4 +1,4 @@
1
- import{c as ue,r as xe,d as ns,a4 as ht,b as Pe,j as t,B as je,t as dt,aW as Wt,ak as as,K as bt,i as Et,a5 as As,m as ot,gE as _s,o as cs,h as Ks,d_ as Us,ab as Vs,L as qs,u as Hs,n as _t,E as Yt,R as Bs,dU as Js,hd as Gs,T as Qs,W as Ws,I as Xt}from"./index-BRgWMc-5.js";import{S as Ys}from"./search-input-XDrQYhil.js";import{E as Ht}from"./empty-state-B87jIRUF.js";import{R as Xs}from"./require-capability-58lj_sLx.js";import{f as js}from"./pair-C-KXBar9.js";import{b as ts}from"./use-connection-wSXmVdCY.js";import{g as Ps}from"./connection-slug-CGQkx9BD.js";import{B as Lt}from"./badge-Ba_DCLD5.js";import{P as ds,a as ms,b as us}from"./popover-DGvrj6fy.js";import{c as Pt,T as Dt,a as Rt,b as Zs}from"./tooltip-DgFM5mQB.js";import{z as fs,e as Ut,bw as el,aw as Ns,K as tl}from"./agent-icon-DFyNTmmD.js";import{i as sl}from"./Key01-DMjKHzPy.js";import{i as ll}from"./Play-I05hjYId.js";import{MonacoCodeEditor as bs}from"./monaco-editor-BHpOPihN.js";import{u as rl}from"./use-mcp-client-OYKYr7Zc.js";import{u as il}from"./repository-binding-Drae9jEJ.js";import{n as Ot}from"./LinkBroken01-BN3icH6a.js";import{c as ol}from"./SwitchHorizontal01-CGFn_psg.js";import{s as nl}from"./Plus-B_KK3A4P.js";import{s as al}from"./Trash01-CnPGIwZe.js";import{M as zt}from"./multi-select-8e4MeokI.js";import{b as yt,a as wt,c as ze,d as St,S as Ct}from"./select-B282Slsg.js";import{e as ys,T as cl}from"./time-range-picker-BcBC6ty0.js";import{T as dl}from"./textarea-shjcg83Q.js";import{C as Ds}from"./collection-tabs-CCJoVQ-t.js";import{S as ml}from"./switch-CfemO1do.js";import{L as ul}from"./label-DJG2lJG2.js";import{I as It}from"./integration-icon-Cu3N1muw.js";import{A as fl,a as xl,b as pl}from"./alert-DaQbIayT.js";import{K as gt}from"./monitoring-stats-row-Ri6ispwa.js";import{b as Bt}from"./use-entitlements-BXMPYOBS.js";import{g as gl,b as ws,f as Nt,c as Zt,d as hl,e as Ss,a as xs,h as vl,i as ps,T as jl,j as Nl,r as bl,k as yl}from"./thread-sheet-body-BY8zn-2X.js";import{u as wl}from"./useSuspenseInfiniteQuery-hY0KLY7U.js";import{c as Sl,S as Cl,b as Rs,a as Ls}from"./sheet-BqPaRS1I.js";import{c as _e,b as vt,d as Jt,e as Gt,T as ge,a as Qt}from"./table-C9du40XO.js";import{t as ss}from"./ChevronDown-CGJhfuSb.js";import{n as ls}from"./ChevronUp-BO9DemUb.js";import{u as Os}from"./use-id-selection-3iTAqvRR.js";import{u as Fs}from"./use-infinite-scroll-C-t0_BGl.js";import{u as Il}from"./useInfiniteQuery-CoeKNdsU.js";import{g as Tl}from"./task-status-DdY5hqAG.js";import{u as kl,d as Ml}from"./use-automations-Co69mrXt.js";import{A as _l}from"./automation-runs-U9DXMN_I.js";import{i as Pl}from"./ArrowLeft-BhV4BHrM.js";import{E as Cs}from"./empty-state-DrDY2Uvy.js";import{O as $s}from"./watch-sse-pool-DTFf-OSe.js";import{t as Dl}from"./task-key-BWUT6sLU.js";import{b as Rl,r as Ll,O as Ol,e as Fl}from"./order-monitor-day-xeVDnHLL.js";import{F as $l}from"./feature-gate-BldXfjSV.js";import"./SearchMd-BlPJmXQo.js";import"./access-gate-BcSivdgh.js";import"./capability-load-error-LShIU80A.js";import"./Tool01-Cnkd4pP7.js";import"./ArrowRight-3kziivNC.js";import"./collapsible-Dc4ca33I.js";import"./use-copy-CQS-1CPQ.js";import"./usage-stats-DyR6Kq74.js";import"./utils-CVEq3hMx.js";import"./markdown-DPpPArEp.js";import"./chat-context-ZeSpVj2j.js";import"./use-panel-navigate-B_099k7i.js";import"./thread-route-C18glt36.js";import"./use-project-scope-BaNhjjkU.js";import"./use-view-draft-kind-DcHRrUPD.js";import"./use-blog-view-DuKgZxsq.js";import"./use-organization-settings-BTioDTeC.js";import"./schema-BSbCYY9y.js";import"./task-board-CZErK_3f.js";import"./thread-intent-MQDkwS2K.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./session-runtime-BH3ADRqu.js";import"./use-ai-providers-BM99Jk3f.js";import"./use-current-view-C8Qn7lu6.js";import"./use-in-settings-D_BySurP.js";import"./use-decopilot-events-Dn0Dm68W.js";import"./use-mobile-MVZR2Lhp.js";import"./File02-DclovfNb.js";import"./gateway-client-BVWghiMF.js";import"./form-FAPXIq7O.js";import"./UserCheck01-CcIH7s2N.js";import"./use-task-board-items-DHvwjetN.js";import"./config-CMcG5aXE.js";import"./AlertCircle-ee1sjQGr.js";import"./CheckCircle-CGqAjggj.js";import"./Eye-CO_nPZKQ.js";import"./task-route-CGCjMBBZ.js";import"./project-index-pgEW44Q9.js";import"./TrendUp01-BlwMDcra.js";import"./shell-layout-2a3HocEU.js";import"./Globe04-Cx-w92u5.js";import"./UserSquare-CUb4s2-c.js";import"./use-deployment-admin-CTEsKWeV.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-CtxnajtG.js";import"./use-org-notice-Csddyapx.js";import"./Monitor01-CM0DIJ9E.js";import"./Zap-D4dSEKpa.js";import"./command-Dg1M4JCf.js";import"./index-BiVCuU3V.js";import"./project-icon-D6jtLreJ.js";import"./use-navigate-to-agent-0LtKWlxa.js";import"./use-debounced-value-sPPLBdJe.js";import"./new-project-dialog-DEBFbTK4.js";import"./repository-picker-DcoNDHNX.js";import"./github-icon-KEAtk4MX.js";import"./collection-search-CWJ6AHHK.js";import"./BookOpen01-C9X5S-cQ.js";import"./ShoppingBag01-XH61oInk.js";import"./new-project-store-CgLzwcjn.js";import"./legacy-admin-welcome-dialog-BY_2I8tZ.js";import"./drawer-DVCuatiz.js";import"./required-auth-layout-coJLhqjq.js";import"./use-org-sso-DXCHIqdV.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-D-1Hpjx-.js";import"./types-Bca8rqtc.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./Image01-CeQMNu9o.js";import"./use-mcp-prompts-XeLNsblN.js";import"./use-thread-outputs-I2kuvS72.js";import"./file-type-icon-sj_ejObJ.js";import"./index-3k_nlNc7.js";import"./ArrowUp-DgFMMMBQ.js";import"./ChevronSelectorVertical-5-TBPpUz.js";import"./CreditCard01-BLkqiDJW.js";import"./MessageCircle01-jm5EAYEs.js";import"./LayoutLeft-BPF5UUkD.js";import"./Minus-DoUm1n95.js";import"./Sun-CYr05wwt.js";import"./Upload01-Bfre-QV-.js";import"./Users01-BaPkNO1v.js";import"./editor-DKlObXWN.js";import"./auth-sBxX13D1.js";import"./checkbox-yHZpOTt9.js";import"./index-BdQq_4o_.js";import"./scroll-area-B2d6jFzS.js";import"./calendar-i6vH9oRA.js";import"./chart-C99PxQ8i.js";import"./CategoricalChart-cy5wvzih.js";import"./index-779PVYGV.js";import"./tooltipContext-BvjdDC28.js";import"./CartesianChart-DuA35Ksh.js";import"./AreaChart-CNSKfZ8O.js";import"./infiniteQueryObserver-DXDiLGwX.js";import"./useQueries-Q6q16yJQ.js";import"./ReferenceLine-DxKvZdt8.js";import"./feature-paywall-CYTrb2Hp.js";import"./plan-ladder-DuXPk4c4.js";const rs={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},zl=["eq","contains","exists","in"];function El(s){return zl.includes(s)}function jt(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),i=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${i}`}).join(",")}function Al(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,i,...m]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:i&&El(i)?i:"eq",value:decodeURIComponent(m.join(":")||"")}}).filter(e=>e!==void 0)}function Vt(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{c as ue,r as xe,d as ns,a4 as ht,b as Pe,j as t,B as je,t as dt,aW as Wt,ak as as,K as bt,i as Et,a5 as As,m as ot,gE as _s,o as cs,h as Ks,d_ as Us,ab as Vs,L as qs,u as Hs,n as _t,E as Yt,R as Bs,dU as Js,hd as Gs,T as Qs,W as Ws,I as Xt}from"./index-BMPeWdJw.js";import{S as Ys}from"./search-input-_TDPMfaj.js";import{E as Ht}from"./empty-state-BNznQ4un.js";import{R as Xs}from"./require-capability-CeoHCJST.js";import{f as js}from"./pair-Bonyggei.js";import{b as ts}from"./use-connection-VTUSBGTe.js";import{g as Ps}from"./connection-slug-BU-gcFLx.js";import{B as Lt}from"./badge-C-0ziPev.js";import{P as ds,a as ms,b as us}from"./popover-zwWAAqUd.js";import{c as Pt,T as Dt,a as Rt,b as Zs}from"./tooltip-BBk4QO9B.js";import{z as fs,e as Ut,bw as el,aw as Ns,K as tl}from"./agent-icon-BJ2Wx2fE.js";import{i as sl}from"./Key01-NBdT0O9W.js";import{i as ll}from"./Play-Dgyu5PiH.js";import{MonacoCodeEditor as bs}from"./monaco-editor-BxMnwfXM.js";import{u as rl}from"./use-mcp-client-D6hvNNod.js";import{u as il}from"./repository-binding-BCK2I6Mo.js";import{n as Ot}from"./LinkBroken01-DWWxoD2s.js";import{c as ol}from"./SwitchHorizontal01-BCndh-XX.js";import{s as nl}from"./Plus-NIlBePVH.js";import{s as al}from"./Trash01-C1sTtIQd.js";import{M as zt}from"./multi-select-DVZ3FnG7.js";import{b as yt,a as wt,c as ze,d as St,S as Ct}from"./select-Cl-2whSq.js";import{e as ys,T as cl}from"./time-range-picker-Css1Ovl_.js";import{T as dl}from"./textarea-i65d3zD6.js";import{C as Ds}from"./collection-tabs-C_tkgeK_.js";import{S as ml}from"./switch-pc6As7Lj.js";import{L as ul}from"./label-CRK3U7ZP.js";import{I as It}from"./integration-icon-xMpRZNbX.js";import{A as fl,a as xl,b as pl}from"./alert-_oqAOD6X.js";import{K as gt}from"./monitoring-stats-row-BBOPc2qP.js";import{b as Bt}from"./use-entitlements-RVjfgn4l.js";import{g as gl,b as ws,f as Nt,c as Zt,d as hl,e as Ss,a as xs,h as vl,i as ps,T as jl,j as Nl,r as bl,k as yl}from"./thread-sheet-body-D3GUkLPi.js";import{u as wl}from"./useSuspenseInfiniteQuery-D4hQd0qx.js";import{c as Sl,S as Cl,b as Rs,a as Ls}from"./sheet-3DsSjpPg.js";import{c as _e,b as vt,d as Jt,e as Gt,T as ge,a as Qt}from"./table-Dy0rd4qk.js";import{t as ss}from"./ChevronDown-88QbtNjw.js";import{n as ls}from"./ChevronUp-BwBBvXr-.js";import{u as Os}from"./use-id-selection-BzvH47dC.js";import{u as Fs}from"./use-infinite-scroll-CBxCb09-.js";import{u as Il}from"./useInfiniteQuery-CkG5v2bH.js";import{g as Tl}from"./task-status-KvQJFF87.js";import{u as kl,d as Ml}from"./use-automations-DSG-bEnt.js";import{A as _l}from"./automation-runs-D2e4MXIM.js";import{i as Pl}from"./ArrowLeft-BtflI84P.js";import{E as Cs}from"./empty-state-haYeO0--.js";import{O as $s}from"./watch-sse-pool-C79C_cUh.js";import{t as Dl}from"./task-key-PeB83qoV.js";import{b as Rl,r as Ll,O as Ol,e as Fl}from"./order-monitor-day-Bf9NXaQ2.js";import{F as $l}from"./feature-gate-v3Hw92O6.js";import"./SearchMd-BZFf7uAm.js";import"./access-gate-DT-H-Dma.js";import"./capability-load-error-BYOGvrqt.js";import"./Tool01-CRE8Zr1E.js";import"./ArrowRight-DckDNEPN.js";import"./collapsible-Czfx-LAp.js";import"./use-copy-Dc7Mx1fC.js";import"./usage-stats-xir5IhsZ.js";import"./utils-CVEq3hMx.js";import"./markdown-BWT_4WJH.js";import"./chat-context-CzmbAHe8.js";import"./use-panel-navigate-yNzK1oeQ.js";import"./thread-route-CSj65J5K.js";import"./use-project-scope-BYK0JAGP.js";import"./use-view-draft-kind-CK2Ws293.js";import"./use-blog-view-CLaoWWXx.js";import"./use-organization-settings-HyX5IrJ4.js";import"./schema-Cg4pyiCI.js";import"./task-board-CgkLyySX.js";import"./thread-intent-LmIsiguS.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./session-runtime-B3tpmEdV.js";import"./use-ai-providers-B1MpfOF5.js";import"./use-current-view-AGi0k_-I.js";import"./use-in-settings-CavkWvLD.js";import"./use-decopilot-events-DFiNdpMv.js";import"./use-mobile-DPeImGih.js";import"./File02-CpMe0sR1.js";import"./gateway-client-CEz2o7p6.js";import"./form-vgZJ8ykR.js";import"./UserCheck01-D14kK5BQ.js";import"./use-task-board-items--v3zNW-2.js";import"./config-CpgY06XK.js";import"./AlertCircle-rt5NTcOt.js";import"./CheckCircle-DQ8gl2jA.js";import"./Eye-C8bzWtOv.js";import"./task-route-D-8EO_RF.js";import"./project-index-Dn3n52T-.js";import"./TrendUp01-CkF2n8Hn.js";import"./shell-layout-Cy4x2w2C.js";import"./Globe04-BGaPJwRM.js";import"./UserSquare-DAFK733H.js";import"./use-deployment-admin-BA_JLmwW.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-igHVZF4W.js";import"./use-org-notice-l577omxO.js";import"./Monitor01-DQ2oaJ_f.js";import"./Zap-CZUa6DWb.js";import"./command-Bq8LzPoY.js";import"./index-CSLJLC25.js";import"./project-icon-DqFpEPg-.js";import"./use-navigate-to-agent-D-LXOG-h.js";import"./use-debounced-value-CTxCZD5A.js";import"./new-project-dialog-IDVZ0s2M.js";import"./repository-picker-DWJeQ4Uz.js";import"./github-icon-CNkm_QOq.js";import"./collection-search-fi8Jpdhv.js";import"./BookOpen01-Cdt9znE-.js";import"./ShoppingBag01-CA3tpOzv.js";import"./new-project-store-DBh8m9Ki.js";import"./legacy-admin-welcome-dialog-DpejN_Uy.js";import"./drawer-cS0px3h4.js";import"./required-auth-layout-Bqqrer2s.js";import"./use-org-sso-QDNvT__Q.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-YjPzFqL6.js";import"./types-BRAj2PE2.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./Image01-CyjafdfK.js";import"./use-mcp-prompts-Dzcv5Qm_.js";import"./use-thread-outputs-vfKngax2.js";import"./file-type-icon-5ukaLDeF.js";import"./index-BDs-2B47.js";import"./ArrowUp-BX9rle-Z.js";import"./ChevronSelectorVertical-BfhN49CO.js";import"./CreditCard01-CHpJYShR.js";import"./MessageCircle01-pdZ3c0Ei.js";import"./LayoutLeft-BI23EoSs.js";import"./Minus-ToHFKPwl.js";import"./Sun-CGayzxv4.js";import"./Upload01-DF54M6Ph.js";import"./Users01-8BTVWXNl.js";import"./editor-DOCwgCVw.js";import"./auth-DdGqjHXO.js";import"./checkbox-CnO5GKzb.js";import"./index-BdQq_4o_.js";import"./scroll-area-DAamBeOm.js";import"./calendar-DXtndUQf.js";import"./chart-CzbHqflS.js";import"./CategoricalChart-DAGT6hYP.js";import"./index-AJsDmYGI.js";import"./tooltipContext-DuBQjN-C.js";import"./CartesianChart-BjWXwRV3.js";import"./AreaChart-CX9a7r2e.js";import"./infiniteQueryObserver-BmYMm5wr.js";import"./useQueries-ClESU-gL.js";import"./ReferenceLine-SNMItkZP.js";import"./feature-paywall-_CmjErfx.js";import"./plan-ladder-B-wAiO1o.js";const rs={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},zl=["eq","contains","exists","in"];function El(s){return zl.includes(s)}function jt(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),i=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${i}`}).join(",")}function Al(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,i,...m]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:i&&El(i)?i:"eq",value:decodeURIComponent(m.join(":")||"")}}).filter(e=>e!==void 0)}function Vt(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function Is(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[l,...i]=e.split("=");return{key:l||"",operator:"eq",value:i.join("=")}}if(e.includes("~")){const[l,...i]=e.split("~");return{key:l||"",operator:"contains",value:i.join("~")}}if(e.includes("@")){const[l,...i]=e.split("@");return{key:l||"",operator:"in",value:i.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Kl(s){const e={},l={},i=[],m={};for(const n of s)if(n.key.trim())switch(n.operator){case"eq":n.value&&(e[n.key]=n.value);break;case"contains":n.value&&(l[n.key]=`%${n.value}%`);break;case"exists":i.push(n.key);break;case"in":n.value&&(m[n.key]=n.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(l).length>0?l:void 0,propertyKeys:i.length>0?i:void 0,propertyInValues:Object.keys(m).length>0?m:void 0}}function Ts(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};const e=s._decocms_truncated;if(typeof e=="string"&&e.length>0)return{content:e,isTruncated:!0,originalSize:e.length};let l;try{l=JSON.stringify(s,null,2)}catch{return{content:"[Unable to serialize JSON]",isTruncated:!1,originalSize:0}}const i=l.length;return i<=rs.maxJsonRenderSize?{content:l,isTruncated:!1,originalSize:i}:{content:l.slice(0,rs.maxJsonRenderSize)+`
4
4
 
@@ -1 +1 @@
1
- import{e2 as g,e3 as d,e4 as v}from"./index-BRgWMc-5.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",o=c&&r==="forward",n=a&&r==="backward",f=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
1
+ import{e2 as g,e3 as d,e4 as v}from"./index-BMPeWdJw.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",o=c&&r==="forward",n=a&&r==="backward",f=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
@@ -1 +1 @@
1
- import{c as k,j as s,i2 as de,b as G,i3 as ue,r as le,i4 as xe,i5 as re,gE as T,gT as W,B as J,d_ as V,a7 as pe}from"./index-BRgWMc-5.js";import{i as he}from"./CreditCard01-BLkqiDJW.js";import{B as L}from"./badge-Ba_DCLD5.js";import{M as je}from"./multi-select-8e4MeokI.js";import{S as be,d as ve,c as Be,a as Ne,b as Se}from"./select-B282Slsg.js";import{T as $,a as ye,b as ie,c as F,d as Te,e as we}from"./table-C9du40XO.js";import{C as ke,X as Ue,Y as Ce}from"./CartesianChart-DuA35Ksh.js";import{T as De}from"./Tooltip-CwwzGu8p.js";import{a as _e,A as Me}from"./AreaChart-CNSKfZ8O.js";import{c2 as Re}from"./CategoricalChart-cy5wvzih.js";import{R as Le}from"./require-capability-58lj_sLx.js";import"./checkbox-yHZpOTt9.js";import"./Minus-DoUm1n95.js";import"./ChevronDown-CGJhfuSb.js";import"./command-Dg1M4JCf.js";import"./index-BiVCuU3V.js";import"./SearchMd-BlPJmXQo.js";import"./popover-DGvrj6fy.js";import"./index-BdQq_4o_.js";import"./index-3k_nlNc7.js";import"./ChevronUp-BO9DemUb.js";import"./index-779PVYGV.js";import"./access-gate-BcSivdgh.js";import"./capability-load-error-LShIU80A.js";const Q=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}),ne=["B","KB","MB","GB","TB","PB"];function oe(t){if(t<=0)return"0 B";const e=Math.min(ne.length-1,Math.floor(Math.log(t)/Math.log(1024))),n=t/1024**e;return`${n.toFixed(n>=100||e===0?0:1)} ${ne[e]}`}const X=50,$e="https://assets.decocache.com/decocms/45f9e905-046b-4aeb-8420-0377a7d0d041/deco_Transferencia.pdf",Fe=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"});function ce(t){return new Date(`${t.slice(0,10)}T00:00:00Z`)}function ee(t){return ce(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"})}function Ie(){const t=new Date;return Array.from({length:12},(e,n)=>{const l=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-n,1));return{value:l.toISOString().slice(0,10),label:l.toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"})}})}function Pe(t){return new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ae(t){const e=k.c(30),{usage:n,metric:l,colorNum:o,formatValue:f,height:i}=t,a=`var(--chart-${o})`,d=`infra-billing-${l}`;let g;e[0]!==n?(g=n.map(Ae),e[0]=n,e[1]=g):g=e[1];const x=g;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b={left:0,right:4,top:8,bottom:0},e[2]=b):b=e[2];let r,p;e[3]!==a?(r=s.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.25}),p=s.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),e[3]=a,e[4]=r,e[5]=p):(r=e[4],p=e[5]);let h;e[6]!==d||e[7]!==r||e[8]!==p?(h=s.jsx("defs",{children:s.jsxs("linearGradient",{id:d,x1:"0",y1:"0",x2:"0",y2:"1",children:[r,p]})}),e[6]=d,e[7]=r,e[8]=p,e[9]=h):h=e[9];let u;e[10]!==f||e[11]!==i?(u=i>100&&s.jsxs(s.Fragment,{children:[s.jsx(ke,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(Ue,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),s.jsx(Ce,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},tickFormatter:f,width:68})]}),e[10]=f,e[11]=i,e[12]=u):u=e[12];let B,v;e[13]===Symbol.for("react.memo_cache_sentinel")?(B={stroke:"var(--border)",strokeDasharray:"4 4"},v={background:"var(--background)",border:"1px solid var(--border)",borderRadius:8,fontSize:12},e[13]=B,e[14]=v):(B=e[13],v=e[14]);let j;e[15]!==f?(j=s.jsx(De,{cursor:B,contentStyle:v,formatter:C=>f(Number(C)||0)}),e[15]=f,e[16]=j):j=e[16];const y=`url(#${d})`;let N;e[17]!==a||e[18]!==l||e[19]!==y?(N=s.jsx(_e,{type:"linear",dataKey:l,stroke:a,strokeWidth:2,fill:y,dot:!1}),e[17]=a,e[18]=l,e[19]=y,e[20]=N):N=e[20];let m;e[21]!==x||e[22]!==N||e[23]!==h||e[24]!==u||e[25]!==j?(m=s.jsxs(Me,{data:x,margin:b,children:[h,u,j,N]}),e[21]=x,e[22]=N,e[23]=h,e[24]=u,e[25]=j,e[26]=m):m=e[26];let S;return e[27]!==i||e[28]!==m?(S=s.jsx(Re,{width:"100%",height:i,children:m}),e[27]=i,e[28]=m,e[29]=S):S=e[29],S}function Ae(t){return{...t,label:Pe(t.date)}}function Z(t,e){return t.reduce((n,l)=>n+l[e],0)}function Ee(){const t=k.c(39),e=G(),{sites:n,isLoading:l}=ue(),[o,f]=le.useState(null),i=Ie(),[a,d]=le.useState(i[0].value);let g;t[0]!==o||t[1]!==n?(g=o??n.slice(0,X),t[0]=o,t[1]=n,t[2]=g):g=t[2];const x=g,b=!o&&n.length>X,{data:r,isLoading:p}=xe(x,a),h=re();if(l){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(V,{className:"h-64 w-full"}),t[3]=c):c=t[3],c}if(n.length===0){let c;t[4]!==e?(c=e("settings.infraBilling.noSites"),t[4]=e,t[5]=c):c=t[5];let w;return t[6]!==c?(w=s.jsx(T,{className:"p-6 text-sm text-muted-foreground",children:c}),t[6]=c,t[7]=w):w=t[7],w}const u=r?.usage??[],B=r?.pageviewsAvailable??!1,v=!!r&&!r.usageUnavailable,j=(c,w)=>v?w(Z(u,c)):"—",y=[{key:"pageviews",title:e("settings.infraBilling.pageviews"),description:e("settings.infraBilling.pageviewsDescription"),colorNum:1,total:B&&v?Q.format(Z(u,"pageviews")):"—"},{key:"requests",title:e("settings.infraBilling.requests"),description:e("settings.infraBilling.requestsDescription"),colorNum:2,total:j("requests",Ze)},{key:"dataTransferBytes",title:e("settings.infraBilling.dataTransfer"),description:e("settings.infraBilling.dataTransferDescription"),colorNum:3,total:j("dataTransferBytes",oe)}],N=Oe;let m;t[8]!==r?.teams?(m=r?.teams??[],t[8]=r?.teams,t[9]=m):m=t[9];const S=m;let C;t[10]!==r?.siteSlugsWithoutTeam?(C=r?.siteSlugsWithoutTeam??[],t[10]=r?.siteSlugsWithoutTeam,t[11]=C):C=t[11];const Y=C,U=S.length===1?S[0]:void 0,D=U?.billing??null,te=S.length+(Y.length>0?1:0)>1,K=Z(u,"pageviews"),se=K>0?Z(u,"requests")/K:0,me=B&&v&&K>0?se.toFixed(se<10?1:0):"—";let I;t[12]!==r?.billingUnavailable||t[13]!==U||t[14]!==e||t[15]!==S.length?(I=r?.billingUnavailable?e("settings.infraBilling.billingUnavailable"):S.length>1?e("settings.infraBilling.multipleTeams",{count:String(S.length)}):U?fe(U,e):e("settings.infraBilling.noTeam"),t[12]=r?.billingUnavailable,t[13]=U,t[14]=e,t[15]=S.length,t[16]=I):I=t[16];const ge=I;let _;t[17]!==n?(_=n.map(qe),t[17]=n,t[18]=_):_=t[18];let M;t[19]!==e?(M=e("settings.infraBilling.siteLabel"),t[19]=e,t[20]=M):M=t[20];let P;t[21]!==x||t[22]!==_||t[23]!==M?(P=s.jsx(je,{className:"w-auto min-w-56 max-w-full",options:_,defaultValue:x,maxCount:2,placeholder:M,onValueChange:f}),t[21]=x,t[22]=_,t[23]=M,t[24]=P):P=t[24];let R;t[25]!==e?(R=e("settings.infraBilling.monthLabel"),t[25]=e,t[26]=R):R=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{}),t[27]=A):A=t[27];let E;t[28]!==R?(E=s.jsx(Se,{className:"w-48","aria-label":R,children:A}),t[28]=R,t[29]=E):E=t[29];let z;t[30]!==x.length||t[31]!==e?(z=x.length===0&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.pickASite")}),t[30]=x.length,t[31]=e,t[32]=z):z=t[32];let q;t[33]!==e||t[34]!==b?(q=b&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.tooManySites",{count:String(X)})}),t[33]=e,t[34]=b,t[35]=q):q=t[35];let O;return t[36]!==r?.usageUnavailable||t[37]!==e?(O=r?.usageUnavailable&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.warehouseUnavailable")}),t[36]=r?.usageUnavailable,t[37]=e,t[38]=O):O=t[38],s.jsxs("div",{className:"flex flex-col gap-8",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4",children:[P,s.jsxs(be,{value:a,onValueChange:d,children:[E,s.jsx(ve,{children:i.map(ze)})]})]}),z,q,O,x.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(W,{title:e("settings.infraBilling.summaryTitle"),children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-4",children:[s.jsxs(T,{className:"flex-1 flex flex-col gap-4 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:e("settings.infraBilling.detailsTitle")})]}),U&&D?.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:h.isPending,onClick:()=>h.mutate(U.siteSlugs),children:e("settings.infraBilling.manageButton")})]}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[D?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.currentPlan")}),p?s.jsx(V,{className:"h-5 w-16"}):s.jsx(L,{variant:D.planType==="free"?"secondary":"success",children:e(`settings.infraBilling.plan.${D.planType}`)})]}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:D.nextBillingDate?ee(D.nextBillingDate):"—"})]})]}):!p&&s.jsx("p",{className:"text-xs text-muted-foreground",children:ge}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.requestsPerPageview")}),s.jsx("span",{className:"font-medium tabular-nums",children:me})]})]})]}),y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-2 p-4",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i.find(w=>w.value===a)?.label})]}),p?s.jsx(V,{className:"h-8 w-24"}):s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:c.total}),s.jsx("div",{className:"-mx-2",children:s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:64})})]},c.key))]})}),s.jsx(W,{title:e("settings.infraBilling.metricsTitle"),children:s.jsx("div",{className:"flex flex-col xl:flex-row gap-4 px-4",children:y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-3 p-4",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:220})]},c.key))})}),s.jsx(W,{title:e("settings.infraBilling.invoicesTitle"),children:s.jsx("div",{className:"flex flex-col gap-4 px-4",children:r?r.billingUnavailable?s.jsx(T,{className:"p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.billingUnavailable")}):s.jsxs(s.Fragment,{children:[S.map(c=>s.jsx(Ge,{team:c,showSites:te},c.siteSlugs.join(","))),Y.length>0&&s.jsxs(T,{className:"flex flex-col gap-1 p-4",children:[te&&s.jsx("span",{className:"text-sm font-medium",children:Y.join(", ")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.infraBilling.noTeam")})]})]}):s.jsx(T,{size:"flush",children:s.jsx(V,{className:"m-4 h-24"})})})})]})]})}function ze(t){return s.jsx(Be,{value:t.value,children:t.label},t.value)}function qe(t){return{label:t,value:t}}function Oe(t){return t==="dataTransferBytes"?oe:Ve}function Ve(t){return Q.format(t)}function Ze(t){return Q.format(t)}function fe(t,e){return t.unavailableReason==="partial_team"?e("settings.infraBilling.partialTeam"):e("settings.infraBilling.billingUnavailable")}function Ge(t){const e=k.c(13),{team:n,showSites:l}=t,o=G(),f=re(),i=n.billing;let a;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==o||e[4]!==n.siteSlugs?(a=l&&s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[s.jsx("span",{className:"text-sm font-medium",children:n.siteSlugs.join(", ")}),i&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[s.jsx(L,{variant:i.planType==="free"?"secondary":"success",children:o(`settings.infraBilling.plan.${i.planType}`)}),i.nextBillingDate&&s.jsxs("span",{className:"flex gap-1.5",children:[s.jsx("span",{className:"text-muted-foreground",children:o("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:ee(i.nextBillingDate)})]}),i.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:f.isPending,onClick:()=>f.mutate(n.siteSlugs),children:o("settings.infraBilling.manageButton")})]})]}),e[0]=i,e[1]=f,e[2]=l,e[3]=o,e[4]=n.siteSlugs,e[5]=a):a=e[5];let d;e[6]!==i||e[7]!==o||e[8]!==n?(d=i?i.invoices.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:o("settings.infraBilling.noInvoices")}):s.jsx(Ye,{invoices:i.invoices}):s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:fe(n,o)}),e[6]=i,e[7]=o,e[8]=n,e[9]=d):d=e[9];let g;return e[10]!==a||e[11]!==d?(g=s.jsxs(T,{size:"flush",className:"gap-0 overflow-x-auto",children:[a,d]}),e[10]=a,e[11]=d,e[12]=g):g=e[12],g}function Ye(t){const e=k.c(40),{invoices:n}=t,l=G();let o;e[0]!==n?(o=n.some(Ke),e[0]=n,e[1]=o):o=e[1];const f=o;let i;e[2]!==l?(i=l("settings.infraBilling.invoiceReference"),e[2]=l,e[3]=i):i=e[3];let a;e[4]!==i?(a=s.jsx($,{children:i}),e[4]=i,e[5]=a):a=e[5];let d;e[6]!==l?(d=l("settings.infraBilling.invoiceDue"),e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=s.jsx($,{children:d}),e[8]=d,e[9]=g):g=e[9];let x;e[10]!==l?(x=l("settings.infraBilling.invoiceAmount"),e[10]=l,e[11]=x):x=e[11];let b;e[12]!==x?(b=s.jsx($,{children:x}),e[12]=x,e[13]=b):b=e[13];let r;e[14]!==l?(r=l("settings.infraBilling.invoiceStatus"),e[14]=l,e[15]=r):r=e[15];let p;e[16]!==r?(p=s.jsx($,{children:r}),e[16]=r,e[17]=p):p=e[17];let h;e[18]!==l?(h=l("settings.infraBilling.invoiceDocuments"),e[18]=l,e[19]=h):h=e[19];let u;e[20]!==h?(u=s.jsx($,{children:h}),e[20]=h,e[21]=u):u=e[21];let B;e[22]!==u||e[23]!==a||e[24]!==g||e[25]!==b||e[26]!==p?(B=s.jsx(ye,{children:s.jsxs(ie,{children:[a,g,b,p,u]})}),e[22]=u,e[23]=a,e[24]=g,e[25]=b,e[26]=p,e[27]=B):B=e[27];let v;if(e[28]!==n||e[29]!==l||e[30]!==f){let N;e[32]!==l||e[33]!==f?(N=m=>s.jsxs(ie,{children:[s.jsx(F,{children:m.referenceMonth?ce(m.referenceMonth).toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"—"}),s.jsx(F,{children:m.dueDate?ee(m.dueDate):"—"}),s.jsx(F,{className:"tabular-nums",children:Fe.format(m.value)}),s.jsx(F,{children:s.jsx(We,{status:m.status})}),s.jsxs(F,{className:"flex gap-2",children:[m.nfUrl&&s.jsx(H,{href:m.nfUrl,label:l("settings.infraBilling.invoiceNf")}),m.bankSlipUrl&&s.jsx(H,{href:m.bankSlipUrl,label:l("settings.infraBilling.invoiceBankSlip")}),!m.bankSlipUrl&&!f&&m.nfUrl&&s.jsx(H,{href:$e,label:l("settings.infraBilling.invoiceBankTransfer")}),!m.nfUrl&&!m.bankSlipUrl&&"—"]})]},m.id),e[32]=l,e[33]=f,e[34]=N):N=e[34],v=n.map(N),e[28]=n,e[29]=l,e[30]=f,e[31]=v}else v=e[31];let j;e[35]!==v?(j=s.jsx(Te,{children:v}),e[35]=v,e[36]=j):j=e[36];let y;return e[37]!==B||e[38]!==j?(y=s.jsxs(we,{children:[B,j]}),e[37]=B,e[38]=j,e[39]=y):y=e[39],y}function Ke(t){return!!t.bankSlipUrl}function H(t){const e=k.c(4),{href:n,label:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{size:14}),e[0]=o):o=e[0];let f;return e[1]!==n||e[2]!==l?(f=s.jsx(J,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",children:[o,l]})}),e[1]=n,e[2]=l,e[3]=f):f=e[3],f}function We(t){const e=k.c(14),{status:n}=t,l=G(),o=n.toLowerCase();if(o==="paid"){let i;e[0]!==l?(i=l("settings.infraBilling.statusPaid"),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==i?(a=s.jsx(L,{variant:"success",children:i}),e[2]=i,e[3]=a):a=e[3],a}if(o==="overdue"){let i;e[4]!==l?(i=l("settings.infraBilling.statusOverdue"),e[4]=l,e[5]=i):i=e[5];let a;return e[6]!==i?(a=s.jsx(L,{variant:"destructive",children:i}),e[6]=i,e[7]=a):a=e[7],a}if(o==="registered"){let i;e[8]!==l?(i=l("settings.infraBilling.statusPending"),e[8]=l,e[9]=i):i=e[9];let a;return e[10]!==i?(a=s.jsx(L,{variant:"warning",children:i}),e[10]=i,e[11]=a):a=e[11],a}let f;return e[12]!==n?(f=s.jsx(L,{variant:"secondary",children:n}),e[12]=n,e[13]=f):f=e[13],f}function Xe(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(de,{group:"billing",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Bt(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Le,{capability:"members:manage",area:"billing",children:s.jsx(Xe,{})}),t[0]=e):e=t[0],e}export{Bt as default};
1
+ import{c as k,j as s,i2 as de,b as G,i3 as ue,r as le,i4 as xe,i5 as re,gE as T,gT as W,B as J,d_ as V,a7 as pe}from"./index-BMPeWdJw.js";import{i as he}from"./CreditCard01-CHpJYShR.js";import{B as L}from"./badge-C-0ziPev.js";import{M as je}from"./multi-select-DVZ3FnG7.js";import{S as be,d as ve,c as Be,a as Ne,b as Se}from"./select-Cl-2whSq.js";import{T as $,a as ye,b as ie,c as F,d as Te,e as we}from"./table-Dy0rd4qk.js";import{C as ke,X as Ue,Y as Ce}from"./CartesianChart-BjWXwRV3.js";import{T as De}from"./Tooltip-DB98MWaY.js";import{a as _e,A as Me}from"./AreaChart-CX9a7r2e.js";import{c2 as Re}from"./CategoricalChart-DAGT6hYP.js";import{R as Le}from"./require-capability-CeoHCJST.js";import"./checkbox-CnO5GKzb.js";import"./Minus-ToHFKPwl.js";import"./ChevronDown-88QbtNjw.js";import"./command-Bq8LzPoY.js";import"./index-CSLJLC25.js";import"./SearchMd-BZFf7uAm.js";import"./popover-zwWAAqUd.js";import"./index-BdQq_4o_.js";import"./index-BDs-2B47.js";import"./ChevronUp-BwBBvXr-.js";import"./index-AJsDmYGI.js";import"./access-gate-DT-H-Dma.js";import"./capability-load-error-BYOGvrqt.js";const Q=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}),ne=["B","KB","MB","GB","TB","PB"];function oe(t){if(t<=0)return"0 B";const e=Math.min(ne.length-1,Math.floor(Math.log(t)/Math.log(1024))),n=t/1024**e;return`${n.toFixed(n>=100||e===0?0:1)} ${ne[e]}`}const X=50,$e="https://assets.decocache.com/decocms/45f9e905-046b-4aeb-8420-0377a7d0d041/deco_Transferencia.pdf",Fe=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"});function ce(t){return new Date(`${t.slice(0,10)}T00:00:00Z`)}function ee(t){return ce(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"})}function Ie(){const t=new Date;return Array.from({length:12},(e,n)=>{const l=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-n,1));return{value:l.toISOString().slice(0,10),label:l.toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"})}})}function Pe(t){return new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ae(t){const e=k.c(30),{usage:n,metric:l,colorNum:o,formatValue:f,height:i}=t,a=`var(--chart-${o})`,d=`infra-billing-${l}`;let g;e[0]!==n?(g=n.map(Ae),e[0]=n,e[1]=g):g=e[1];const x=g;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b={left:0,right:4,top:8,bottom:0},e[2]=b):b=e[2];let r,p;e[3]!==a?(r=s.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.25}),p=s.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),e[3]=a,e[4]=r,e[5]=p):(r=e[4],p=e[5]);let h;e[6]!==d||e[7]!==r||e[8]!==p?(h=s.jsx("defs",{children:s.jsxs("linearGradient",{id:d,x1:"0",y1:"0",x2:"0",y2:"1",children:[r,p]})}),e[6]=d,e[7]=r,e[8]=p,e[9]=h):h=e[9];let u;e[10]!==f||e[11]!==i?(u=i>100&&s.jsxs(s.Fragment,{children:[s.jsx(ke,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(Ue,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),s.jsx(Ce,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},tickFormatter:f,width:68})]}),e[10]=f,e[11]=i,e[12]=u):u=e[12];let B,v;e[13]===Symbol.for("react.memo_cache_sentinel")?(B={stroke:"var(--border)",strokeDasharray:"4 4"},v={background:"var(--background)",border:"1px solid var(--border)",borderRadius:8,fontSize:12},e[13]=B,e[14]=v):(B=e[13],v=e[14]);let j;e[15]!==f?(j=s.jsx(De,{cursor:B,contentStyle:v,formatter:C=>f(Number(C)||0)}),e[15]=f,e[16]=j):j=e[16];const y=`url(#${d})`;let N;e[17]!==a||e[18]!==l||e[19]!==y?(N=s.jsx(_e,{type:"linear",dataKey:l,stroke:a,strokeWidth:2,fill:y,dot:!1}),e[17]=a,e[18]=l,e[19]=y,e[20]=N):N=e[20];let m;e[21]!==x||e[22]!==N||e[23]!==h||e[24]!==u||e[25]!==j?(m=s.jsxs(Me,{data:x,margin:b,children:[h,u,j,N]}),e[21]=x,e[22]=N,e[23]=h,e[24]=u,e[25]=j,e[26]=m):m=e[26];let S;return e[27]!==i||e[28]!==m?(S=s.jsx(Re,{width:"100%",height:i,children:m}),e[27]=i,e[28]=m,e[29]=S):S=e[29],S}function Ae(t){return{...t,label:Pe(t.date)}}function Z(t,e){return t.reduce((n,l)=>n+l[e],0)}function Ee(){const t=k.c(39),e=G(),{sites:n,isLoading:l}=ue(),[o,f]=le.useState(null),i=Ie(),[a,d]=le.useState(i[0].value);let g;t[0]!==o||t[1]!==n?(g=o??n.slice(0,X),t[0]=o,t[1]=n,t[2]=g):g=t[2];const x=g,b=!o&&n.length>X,{data:r,isLoading:p}=xe(x,a),h=re();if(l){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(V,{className:"h-64 w-full"}),t[3]=c):c=t[3],c}if(n.length===0){let c;t[4]!==e?(c=e("settings.infraBilling.noSites"),t[4]=e,t[5]=c):c=t[5];let w;return t[6]!==c?(w=s.jsx(T,{className:"p-6 text-sm text-muted-foreground",children:c}),t[6]=c,t[7]=w):w=t[7],w}const u=r?.usage??[],B=r?.pageviewsAvailable??!1,v=!!r&&!r.usageUnavailable,j=(c,w)=>v?w(Z(u,c)):"—",y=[{key:"pageviews",title:e("settings.infraBilling.pageviews"),description:e("settings.infraBilling.pageviewsDescription"),colorNum:1,total:B&&v?Q.format(Z(u,"pageviews")):"—"},{key:"requests",title:e("settings.infraBilling.requests"),description:e("settings.infraBilling.requestsDescription"),colorNum:2,total:j("requests",Ze)},{key:"dataTransferBytes",title:e("settings.infraBilling.dataTransfer"),description:e("settings.infraBilling.dataTransferDescription"),colorNum:3,total:j("dataTransferBytes",oe)}],N=Oe;let m;t[8]!==r?.teams?(m=r?.teams??[],t[8]=r?.teams,t[9]=m):m=t[9];const S=m;let C;t[10]!==r?.siteSlugsWithoutTeam?(C=r?.siteSlugsWithoutTeam??[],t[10]=r?.siteSlugsWithoutTeam,t[11]=C):C=t[11];const Y=C,U=S.length===1?S[0]:void 0,D=U?.billing??null,te=S.length+(Y.length>0?1:0)>1,K=Z(u,"pageviews"),se=K>0?Z(u,"requests")/K:0,me=B&&v&&K>0?se.toFixed(se<10?1:0):"—";let I;t[12]!==r?.billingUnavailable||t[13]!==U||t[14]!==e||t[15]!==S.length?(I=r?.billingUnavailable?e("settings.infraBilling.billingUnavailable"):S.length>1?e("settings.infraBilling.multipleTeams",{count:String(S.length)}):U?fe(U,e):e("settings.infraBilling.noTeam"),t[12]=r?.billingUnavailable,t[13]=U,t[14]=e,t[15]=S.length,t[16]=I):I=t[16];const ge=I;let _;t[17]!==n?(_=n.map(qe),t[17]=n,t[18]=_):_=t[18];let M;t[19]!==e?(M=e("settings.infraBilling.siteLabel"),t[19]=e,t[20]=M):M=t[20];let P;t[21]!==x||t[22]!==_||t[23]!==M?(P=s.jsx(je,{className:"w-auto min-w-56 max-w-full",options:_,defaultValue:x,maxCount:2,placeholder:M,onValueChange:f}),t[21]=x,t[22]=_,t[23]=M,t[24]=P):P=t[24];let R;t[25]!==e?(R=e("settings.infraBilling.monthLabel"),t[25]=e,t[26]=R):R=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{}),t[27]=A):A=t[27];let E;t[28]!==R?(E=s.jsx(Se,{className:"w-48","aria-label":R,children:A}),t[28]=R,t[29]=E):E=t[29];let z;t[30]!==x.length||t[31]!==e?(z=x.length===0&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.pickASite")}),t[30]=x.length,t[31]=e,t[32]=z):z=t[32];let q;t[33]!==e||t[34]!==b?(q=b&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.tooManySites",{count:String(X)})}),t[33]=e,t[34]=b,t[35]=q):q=t[35];let O;return t[36]!==r?.usageUnavailable||t[37]!==e?(O=r?.usageUnavailable&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.warehouseUnavailable")}),t[36]=r?.usageUnavailable,t[37]=e,t[38]=O):O=t[38],s.jsxs("div",{className:"flex flex-col gap-8",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4",children:[P,s.jsxs(be,{value:a,onValueChange:d,children:[E,s.jsx(ve,{children:i.map(ze)})]})]}),z,q,O,x.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(W,{title:e("settings.infraBilling.summaryTitle"),children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-4",children:[s.jsxs(T,{className:"flex-1 flex flex-col gap-4 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:e("settings.infraBilling.detailsTitle")})]}),U&&D?.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:h.isPending,onClick:()=>h.mutate(U.siteSlugs),children:e("settings.infraBilling.manageButton")})]}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[D?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.currentPlan")}),p?s.jsx(V,{className:"h-5 w-16"}):s.jsx(L,{variant:D.planType==="free"?"secondary":"success",children:e(`settings.infraBilling.plan.${D.planType}`)})]}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:D.nextBillingDate?ee(D.nextBillingDate):"—"})]})]}):!p&&s.jsx("p",{className:"text-xs text-muted-foreground",children:ge}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.requestsPerPageview")}),s.jsx("span",{className:"font-medium tabular-nums",children:me})]})]})]}),y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-2 p-4",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i.find(w=>w.value===a)?.label})]}),p?s.jsx(V,{className:"h-8 w-24"}):s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:c.total}),s.jsx("div",{className:"-mx-2",children:s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:64})})]},c.key))]})}),s.jsx(W,{title:e("settings.infraBilling.metricsTitle"),children:s.jsx("div",{className:"flex flex-col xl:flex-row gap-4 px-4",children:y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-3 p-4",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:220})]},c.key))})}),s.jsx(W,{title:e("settings.infraBilling.invoicesTitle"),children:s.jsx("div",{className:"flex flex-col gap-4 px-4",children:r?r.billingUnavailable?s.jsx(T,{className:"p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.billingUnavailable")}):s.jsxs(s.Fragment,{children:[S.map(c=>s.jsx(Ge,{team:c,showSites:te},c.siteSlugs.join(","))),Y.length>0&&s.jsxs(T,{className:"flex flex-col gap-1 p-4",children:[te&&s.jsx("span",{className:"text-sm font-medium",children:Y.join(", ")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.infraBilling.noTeam")})]})]}):s.jsx(T,{size:"flush",children:s.jsx(V,{className:"m-4 h-24"})})})})]})]})}function ze(t){return s.jsx(Be,{value:t.value,children:t.label},t.value)}function qe(t){return{label:t,value:t}}function Oe(t){return t==="dataTransferBytes"?oe:Ve}function Ve(t){return Q.format(t)}function Ze(t){return Q.format(t)}function fe(t,e){return t.unavailableReason==="partial_team"?e("settings.infraBilling.partialTeam"):e("settings.infraBilling.billingUnavailable")}function Ge(t){const e=k.c(13),{team:n,showSites:l}=t,o=G(),f=re(),i=n.billing;let a;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==o||e[4]!==n.siteSlugs?(a=l&&s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[s.jsx("span",{className:"text-sm font-medium",children:n.siteSlugs.join(", ")}),i&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[s.jsx(L,{variant:i.planType==="free"?"secondary":"success",children:o(`settings.infraBilling.plan.${i.planType}`)}),i.nextBillingDate&&s.jsxs("span",{className:"flex gap-1.5",children:[s.jsx("span",{className:"text-muted-foreground",children:o("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:ee(i.nextBillingDate)})]}),i.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:f.isPending,onClick:()=>f.mutate(n.siteSlugs),children:o("settings.infraBilling.manageButton")})]})]}),e[0]=i,e[1]=f,e[2]=l,e[3]=o,e[4]=n.siteSlugs,e[5]=a):a=e[5];let d;e[6]!==i||e[7]!==o||e[8]!==n?(d=i?i.invoices.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:o("settings.infraBilling.noInvoices")}):s.jsx(Ye,{invoices:i.invoices}):s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:fe(n,o)}),e[6]=i,e[7]=o,e[8]=n,e[9]=d):d=e[9];let g;return e[10]!==a||e[11]!==d?(g=s.jsxs(T,{size:"flush",className:"gap-0 overflow-x-auto",children:[a,d]}),e[10]=a,e[11]=d,e[12]=g):g=e[12],g}function Ye(t){const e=k.c(40),{invoices:n}=t,l=G();let o;e[0]!==n?(o=n.some(Ke),e[0]=n,e[1]=o):o=e[1];const f=o;let i;e[2]!==l?(i=l("settings.infraBilling.invoiceReference"),e[2]=l,e[3]=i):i=e[3];let a;e[4]!==i?(a=s.jsx($,{children:i}),e[4]=i,e[5]=a):a=e[5];let d;e[6]!==l?(d=l("settings.infraBilling.invoiceDue"),e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=s.jsx($,{children:d}),e[8]=d,e[9]=g):g=e[9];let x;e[10]!==l?(x=l("settings.infraBilling.invoiceAmount"),e[10]=l,e[11]=x):x=e[11];let b;e[12]!==x?(b=s.jsx($,{children:x}),e[12]=x,e[13]=b):b=e[13];let r;e[14]!==l?(r=l("settings.infraBilling.invoiceStatus"),e[14]=l,e[15]=r):r=e[15];let p;e[16]!==r?(p=s.jsx($,{children:r}),e[16]=r,e[17]=p):p=e[17];let h;e[18]!==l?(h=l("settings.infraBilling.invoiceDocuments"),e[18]=l,e[19]=h):h=e[19];let u;e[20]!==h?(u=s.jsx($,{children:h}),e[20]=h,e[21]=u):u=e[21];let B;e[22]!==u||e[23]!==a||e[24]!==g||e[25]!==b||e[26]!==p?(B=s.jsx(ye,{children:s.jsxs(ie,{children:[a,g,b,p,u]})}),e[22]=u,e[23]=a,e[24]=g,e[25]=b,e[26]=p,e[27]=B):B=e[27];let v;if(e[28]!==n||e[29]!==l||e[30]!==f){let N;e[32]!==l||e[33]!==f?(N=m=>s.jsxs(ie,{children:[s.jsx(F,{children:m.referenceMonth?ce(m.referenceMonth).toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"—"}),s.jsx(F,{children:m.dueDate?ee(m.dueDate):"—"}),s.jsx(F,{className:"tabular-nums",children:Fe.format(m.value)}),s.jsx(F,{children:s.jsx(We,{status:m.status})}),s.jsxs(F,{className:"flex gap-2",children:[m.nfUrl&&s.jsx(H,{href:m.nfUrl,label:l("settings.infraBilling.invoiceNf")}),m.bankSlipUrl&&s.jsx(H,{href:m.bankSlipUrl,label:l("settings.infraBilling.invoiceBankSlip")}),!m.bankSlipUrl&&!f&&m.nfUrl&&s.jsx(H,{href:$e,label:l("settings.infraBilling.invoiceBankTransfer")}),!m.nfUrl&&!m.bankSlipUrl&&"—"]})]},m.id),e[32]=l,e[33]=f,e[34]=N):N=e[34],v=n.map(N),e[28]=n,e[29]=l,e[30]=f,e[31]=v}else v=e[31];let j;e[35]!==v?(j=s.jsx(Te,{children:v}),e[35]=v,e[36]=j):j=e[36];let y;return e[37]!==B||e[38]!==j?(y=s.jsxs(we,{children:[B,j]}),e[37]=B,e[38]=j,e[39]=y):y=e[39],y}function Ke(t){return!!t.bankSlipUrl}function H(t){const e=k.c(4),{href:n,label:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{size:14}),e[0]=o):o=e[0];let f;return e[1]!==n||e[2]!==l?(f=s.jsx(J,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",children:[o,l]})}),e[1]=n,e[2]=l,e[3]=f):f=e[3],f}function We(t){const e=k.c(14),{status:n}=t,l=G(),o=n.toLowerCase();if(o==="paid"){let i;e[0]!==l?(i=l("settings.infraBilling.statusPaid"),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==i?(a=s.jsx(L,{variant:"success",children:i}),e[2]=i,e[3]=a):a=e[3],a}if(o==="overdue"){let i;e[4]!==l?(i=l("settings.infraBilling.statusOverdue"),e[4]=l,e[5]=i):i=e[5];let a;return e[6]!==i?(a=s.jsx(L,{variant:"destructive",children:i}),e[6]=i,e[7]=a):a=e[7],a}if(o==="registered"){let i;e[8]!==l?(i=l("settings.infraBilling.statusPending"),e[8]=l,e[9]=i):i=e[9];let a;return e[10]!==i?(a=s.jsx(L,{variant:"warning",children:i}),e[10]=i,e[11]=a):a=e[11],a}let f;return e[12]!==n?(f=s.jsx(L,{variant:"secondary",children:n}),e[12]=n,e[13]=f):f=e[13],f}function Xe(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(de,{group:"billing",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Bt(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Le,{capability:"members:manage",area:"billing",children:s.jsx(Xe,{})}),t[0]=e):e=t[0],e}export{Bt as default};