decocms 4.367.1 → 4.367.3

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 (372) hide show
  1. package/dist/client/assets/{AlertCircle-DdgoOwtf.js → AlertCircle-JAw4DKWg.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BLqeL-Kr.js → AreaChart-BFPD44c-.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BgfGskGd.js → ArrowLeft-C4ws2vta.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-JlpBR4ak.js → ArrowRight-CGkzbTs-.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DjsVuNpG.js → ArrowUp-CW9s78t7.js} +1 -1
  6. package/dist/client/assets/{Check-BXALxZkV.js → Check-BnJHwdzA.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-CYg2Tr69.js → CheckCircle-D72wsOXz.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-Xore976n.js → ChevronRight-CIuRctG6.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-doBmaKp2.js → ChevronUp-CUHmZknM.js} +1 -1
  10. package/dist/client/assets/{Copy01-CYJaDzON.js → Copy01-CAnIcRR7.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CKEZM-Nk.js → CreditCard01-Byf14Zko.js} +1 -1
  12. package/dist/client/assets/{Database01-Dy1ntHiO.js → Database01-DhxHwIba.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-k3X_09Zf.js → DotsVertical-DZxfXATf.js} +1 -1
  14. package/dist/client/assets/{Download01-DKDz2dFy.js → Download01-BKhvQC2t.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-BURHauSf.js → ErrorBarContext-IFeY1HCC.js} +1 -1
  16. package/dist/client/assets/{Eye-4t1Q1x_N.js → Eye-CeLsr2wK.js} +1 -1
  17. package/dist/client/assets/{File02-Cdpbi8-q.js → File02-Ic5DSfbF.js} +1 -1
  18. package/dist/client/assets/{GitBranch01-rv2uDVH5.js → GitBranch01-llYG9Xp9.js} +1 -1
  19. package/dist/client/assets/{Globe01-H_L1039P.js → Globe01-BxZcqfmG.js} +1 -1
  20. package/dist/client/assets/{HardDrive-Cxw5uymp.js → HardDrive-D8M2f43J.js} +1 -1
  21. package/dist/client/assets/{Image01-CXL1rUab.js → Image01-CAvGw-jw.js} +1 -1
  22. package/dist/client/assets/{Key01-Z_LVLfYi.js → Key01-MvLRbpTL.js} +1 -1
  23. package/dist/client/assets/{Link01-DKxJL9wE.js → Link01-BFGs7SHa.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-BaNEiZ-Z.js → LinkExternal01-_FElc0p1.js} +1 -1
  25. package/dist/client/assets/{MessageCircle01-nOnaif4r.js → MessageCircle01-BIIEDxFs.js} +1 -1
  26. package/dist/client/assets/{Monitor01-M9EpHieD.js → Monitor01-CgVSaEtw.js} +1 -1
  27. package/dist/client/assets/{Package-bors0uR9.js → Package-rfI0qNYd.js} +1 -1
  28. package/dist/client/assets/{Palette-BTRMSHWm.js → Palette-DWgPkj9P.js} +1 -1
  29. package/dist/client/assets/{Play-zxSLSkrU.js → Play-DkBjQzgn.js} +1 -1
  30. package/dist/client/assets/{Plus-DmIvdJjO.js → Plus-CWME9B9L.js} +1 -1
  31. package/dist/client/assets/{Printer-B-kmat8d.js → Printer-tuedaxzr.js} +1 -1
  32. package/dist/client/assets/{SearchLg-uwCH_Y0q.js → SearchLg-Dqhtv5dc.js} +1 -1
  33. package/dist/client/assets/{SearchMd-Cf2jyLeC.js → SearchMd-CZSs2LSf.js} +1 -1
  34. package/dist/client/assets/{Sector-DK0YvOHU.js → Sector-aLBxu6yc.js} +1 -1
  35. package/dist/client/assets/{Settings02-C3BFmQm6.js → Settings02-BhsH56Xz.js} +1 -1
  36. package/dist/client/assets/{Share07-amH04EUM.js → Share07-CzidgFZ5.js} +1 -1
  37. package/dist/client/assets/{Shield01-CoMwjqAo.js → Shield01-K4aGKNL2.js} +1 -1
  38. package/dist/client/assets/{Stars01-BJVFzy09.js → Stars01-C47JIet8.js} +1 -1
  39. package/dist/client/assets/{Sun-CG_-rnB-.js → Sun-CdOrW_VN.js} +1 -1
  40. package/dist/client/assets/{SwitchHorizontal01-G8wAJ_Hg.js → SwitchHorizontal01-Dqqx_KZP.js} +1 -1
  41. package/dist/client/assets/{Tool01-CzodsTwJ.js → Tool01-j5KBS7L_.js} +1 -1
  42. package/dist/client/assets/{Tool02-vcgsrI0t.js → Tool02-DJpbC_72.js} +1 -1
  43. package/dist/client/assets/{Trash01-DacQZEqw.js → Trash01-CrceRjD2.js} +1 -1
  44. package/dist/client/assets/{TrendUp01-D9hlSqa_.js → TrendUp01-DETtD9qe.js} +1 -1
  45. package/dist/client/assets/{Upload01-COWsdxp9.js → Upload01-B6QCJOOJ.js} +1 -1
  46. package/dist/client/assets/{User01-BvT7Fpbq.js → User01-DLqwauek.js} +1 -1
  47. package/dist/client/assets/{UserSquare-CXNLbwdE.js → UserSquare-CPabtqPY.js} +1 -1
  48. package/dist/client/assets/{Users01-DkoO6Vse.js → Users01-BFSgZvlS.js} +1 -1
  49. package/dist/client/assets/{Users03-1uHPeSQW.js → Users03-DdHJhs5B.js} +1 -1
  50. package/dist/client/assets/{X-BSqsmD1L.js → X-C_wX87Ke.js} +1 -1
  51. package/dist/client/assets/{XCircle-g7V7rkX9.js → XCircle-CHAGLbh6.js} +1 -1
  52. package/dist/client/assets/{XClose-DIddD6Et.js → XClose-wbQg8T5j.js} +1 -1
  53. package/dist/client/assets/{Zap-DLA4I1NQ.js → Zap-Blk6garZ.js} +1 -1
  54. package/dist/client/assets/{ZoomOut-DnzrRxMa.js → ZoomOut-B4s4anLX.js} +1 -1
  55. package/dist/client/assets/{access-gate-DF-Coy0Z.js → access-gate-64zcpMYD.js} +1 -1
  56. package/dist/client/assets/{add-connection-dialog-CXROHrx5.js → add-connection-dialog-BlgJR9S1.js} +1 -1
  57. package/dist/client/assets/{agent-analytics-DNpcK1Gm.js → agent-analytics-BzTuWP3y.js} +1 -1
  58. package/dist/client/assets/agent-app-C9zVa4ys.js +1 -0
  59. package/dist/client/assets/agent-assets-kaujtYut.js +1 -0
  60. package/dist/client/assets/{agent-automation-CHui58AS.js → agent-automation-B4K6SO5X.js} +1 -1
  61. package/dist/client/assets/{agent-automations-B_ep9dv9.js → agent-automations-C-1CPUHo.js} +1 -1
  62. package/dist/client/assets/{agent-connect-sources-TfQK-tl8.js → agent-connect-sources-D1cyYh2R.js} +1 -1
  63. package/dist/client/assets/agent-deck-BYn3-8ZT.js +1 -0
  64. package/dist/client/assets/{agent-e2e-1qCY8Ach.js → agent-e2e-TcP4h5N6.js} +1 -1
  65. package/dist/client/assets/agent-file-SY1u955u.js +1 -0
  66. package/dist/client/assets/{agent-git-Du4VEwxt.js → agent-git-BwwZtE0x.js} +2 -2
  67. package/dist/client/assets/{agent-hosting-DX0ovQKG.js → agent-hosting-CFYwXBfp.js} +1 -1
  68. package/dist/client/assets/{agent-icon-BNs8r1fO.js → agent-icon-CP4wb7Bx.js} +1 -1
  69. package/dist/client/assets/agent-library-file-CPAiSend.js +1 -0
  70. package/dist/client/assets/{agent-monitor-Dki9XKb-.js → agent-monitor-CPiRXYpW.js} +1 -1
  71. package/dist/client/assets/{agent-overview-Bxk83Bj1.js → agent-overview-qi-4gnij.js} +1 -1
  72. package/dist/client/assets/agent-settings-BMrZhBmd.js +1 -0
  73. package/dist/client/assets/agent-site-editor-code-SwjyZSI8.js +2 -0
  74. package/dist/client/assets/{agent-site-editor-content-B0MbcGKz.js → agent-site-editor-content-DHZEWqFy.js} +2 -2
  75. package/dist/client/assets/{agent-site-editor-preview-BXudlzau.js → agent-site-editor-preview-D4HUiy11.js} +3 -3
  76. package/dist/client/assets/{agent-site-editor-D_tYXiIA.js → agent-site-editor-wV3RTwJo.js} +2 -2
  77. package/dist/client/assets/agent-view-C28582_4.js +1 -0
  78. package/dist/client/assets/{agent-view-guard-BOalzzXB.js → agent-view-guard-B_GXgcjD.js} +1 -1
  79. package/dist/client/assets/{agents-list-BYAVvgSK.js → agents-list-88dH8d0e.js} +1 -1
  80. package/dist/client/assets/{ai-providers-Y5YFfgGF.js → ai-providers-BBzNm4vK.js} +1 -1
  81. package/dist/client/assets/{alert-clNuLo0b.js → alert-0hXqrFqy.js} +1 -1
  82. package/dist/client/assets/{alert-dialog-OOEFvLXD.js → alert-dialog-DJ3365Df.js} +1 -1
  83. package/dist/client/assets/{api-keys-D7YwTp1J.js → api-keys-C4z7q_7l.js} +1 -1
  84. package/dist/client/assets/api-keys-DVgRzadm.js +1 -0
  85. package/dist/client/assets/app-editor-ChHTI5Yo.js +1 -0
  86. package/dist/client/assets/{asset-utils-BVwTaEjS.js → asset-utils-Zi5dAmhU.js} +1 -1
  87. package/dist/client/assets/{auth-CvdEaJV2.js → auth-DiBJ6HTw.js} +1 -1
  88. package/dist/client/assets/{auth-catchall-915VHRoy.js → auth-catchall-C7kwTG_2.js} +1 -1
  89. package/dist/client/assets/{auth-entry-f4UNzctv.js → auth-entry-B_CmlfVr.js} +1 -1
  90. package/dist/client/assets/{auth-split-layout-DPITqUgY.js → auth-split-layout-Btl1AmCA.js} +1 -1
  91. package/dist/client/assets/{authenticate-and-persist-oauth-Bt5D1aJI.js → authenticate-and-persist-oauth-C-DK5QxU.js} +1 -1
  92. package/dist/client/assets/{automation-list-row-Btn-B-nL.js → automation-list-row-CUr8umQd.js} +1 -1
  93. package/dist/client/assets/{automation-runs-Bs_GJ0Mx.js → automation-runs-BEf7TmV5.js} +1 -1
  94. package/dist/client/assets/{automations-3-1PN8L4.js → automations-Bd5XDoWz.js} +1 -1
  95. package/dist/client/assets/{autosend-6z8b55g2.js → autosend-CbSGCC_z.js} +1 -1
  96. package/dist/client/assets/{avatar-Bh0VE7CU.js → avatar-D6EG4gpi.js} +1 -1
  97. package/dist/client/assets/{badge-mWPnqtIU.js → badge-CLjnzWV1.js} +1 -1
  98. package/dist/client/assets/{block-document-trAdhSx9.js → block-document-4SYSbn7x.js} +1 -1
  99. package/dist/client/assets/{blocks-preview-workspace-context-D0ptXqYk.js → blocks-preview-workspace-context-MvEJSPQ_.js} +1 -1
  100. package/dist/client/assets/{breadcrumb-_beni89t.js → breadcrumb-C6uIh2gx.js} +1 -1
  101. package/dist/client/assets/{buckets-BYBNe8ia.js → buckets-CySBr1l9.js} +1 -1
  102. package/dist/client/assets/{build-improve-prompt-doc-D-hybPI_.js → build-improve-prompt-doc-CAHrWdK8.js} +1 -1
  103. package/dist/client/assets/{bulk-category-panel-C-ReQn-t.js → bulk-category-panel-C7_VZQYs.js} +1 -1
  104. package/dist/client/assets/{calendar-B2gUskOO.js → calendar-D2NSI-Uo.js} +1 -1
  105. package/dist/client/assets/{capability-load-error-C0GnGW7-.js → capability-load-error-BUVFJ7FB.js} +1 -1
  106. package/dist/client/assets/{cards-CiAl_X__.js → cards-DvlbYgkR.js} +1 -1
  107. package/dist/client/assets/category-editor-DmycqfAD.js +1 -0
  108. package/dist/client/assets/{chart-B8YOBq-X.js → chart-DFnySnLX.js} +1 -1
  109. package/dist/client/assets/{chat-context-UOURpBqM.js → chat-context-BuaJtKiH.js} +1 -1
  110. package/dist/client/assets/{chat-draft-B5MSxR-_.js → chat-draft-jLiQk38U.js} +1 -1
  111. package/dist/client/assets/{checkbox-CEEHjhZX.js → checkbox-DhhXjWWn.js} +1 -1
  112. package/dist/client/assets/{choose-editor-DKIfo22i.js → choose-editor-DaIvuBND.js} +1 -1
  113. package/dist/client/assets/{cli-auth-success-Bpj9B3NE.js → cli-auth-success-qpJPzv7N.js} +1 -1
  114. package/dist/client/assets/{client-icons-ByqemS7h.js → client-icons-FMEp9w57.js} +1 -1
  115. package/dist/client/assets/{collapsible-BkZa6hsW.js → collapsible-BzgQJ9lm.js} +1 -1
  116. package/dist/client/assets/{collection-detail-BgNcj1ol.js → collection-detail-DUP3LeO6.js} +1 -1
  117. package/dist/client/assets/{collection-display-button-qKZaN8ZT.js → collection-display-button-D8RArnc4.js} +1 -1
  118. package/dist/client/assets/{collection-search-D8iv3eg2.js → collection-search-BTyqIFVo.js} +1 -1
  119. package/dist/client/assets/{collection-table-wrapper-aH-MdlHW.js → collection-table-wrapper-SNCTm6bL.js} +1 -1
  120. package/dist/client/assets/{collection-tabs-CVj5y6r4.js → collection-tabs-B2W6RR6x.js} +1 -1
  121. package/dist/client/assets/{command-B7C5C7Y5.js → command-Clfl-nd5.js} +1 -1
  122. package/dist/client/assets/{command-palette-store-CjxZ6IT4.js → command-palette-store-BbfrQfcx.js} +1 -1
  123. package/dist/client/assets/{commerce-onboarding-SbieDR3y.js → commerce-onboarding-CY49Pds0.js} +1 -1
  124. package/dist/client/assets/{companion-mcps-section-CLOb1jOm.js → companion-mcps-section-BdD0QBhg.js} +1 -1
  125. package/dist/client/assets/{connect-e-Zw7t6z.js → connect-CYMCRsXB.js} +1 -1
  126. package/dist/client/assets/{connect-layout-BqRPi9Iy.js → connect-layout-BiLm2_nf.js} +1 -1
  127. package/dist/client/assets/{connection-BqqlnV9S.js → connection-OBd7O6J-.js} +1 -1
  128. package/dist/client/assets/{connection-card-B7nNE-vi.js → connection-card-BHgG4WUC.js} +1 -1
  129. package/dist/client/assets/{connection-detail-CctjSUOt.js → connection-detail-CvIjBFuv.js} +1 -1
  130. package/dist/client/assets/{connection-form-helpers-CGZjLurm.js → connection-form-helpers-DBoRH_1_.js} +1 -1
  131. package/dist/client/assets/{connections-BGL4NLY3.js → connections-Dm8cSxb1.js} +1 -1
  132. package/dist/client/assets/{create-organization-dialog-Bhp8McTp.js → create-organization-dialog-CiG5KBv2.js} +1 -1
  133. package/dist/client/assets/{decofile-api-BN70hIQR.js → decofile-api-D0jjuK2s.js} +1 -1
  134. package/dist/client/assets/{decopilot-DcY6tZci.js → decopilot-BZgK_WKj.js} +1 -1
  135. package/dist/client/assets/{dialog-mUIvGRq9.js → dialog-T6SHF6tg.js} +1 -1
  136. package/dist/client/assets/{discover-BKUG1s4X.js → discover-DQrGBv1I.js} +1 -1
  137. package/dist/client/assets/{domain-settings-B10r9eIu.js → domain-settings-BZpnNB2z.js} +1 -1
  138. package/dist/client/assets/{download-app-dialog-DCvPoe1o.js → download-app-dialog-DgXSTIhm.js} +1 -1
  139. package/dist/client/assets/{drawer-Dx8RWA1y.js → drawer-CEwLHAjr.js} +1 -1
  140. package/dist/client/assets/{dropdown-menu-BREtR-L8.js → dropdown-menu-2R7EcIqz.js} +1 -1
  141. package/dist/client/assets/{editor-BOa0PPPC.js → editor-B-DDSBye.js} +1 -1
  142. package/dist/client/assets/{empty-state-D7Xnneh3.js → empty-state-B4vaZfVn.js} +1 -1
  143. package/dist/client/assets/{empty-state-DFwqUmKQ.js → empty-state-M-2HWd2b.js} +1 -1
  144. package/dist/client/assets/{extract-connection-data-BiMeraJX.js → extract-connection-data-C-i7_Byp.js} +1 -1
  145. package/dist/client/assets/{feature-gate-DMPPa5-x.js → feature-gate-BOpzUCGP.js} +1 -1
  146. package/dist/client/assets/{feature-paywall-DYwohGrL.js → feature-paywall-B6TDdJ96.js} +1 -1
  147. package/dist/client/assets/{file-explorer-CTzLtSY5.js → file-explorer-CQhq5b4s.js} +1 -1
  148. package/dist/client/assets/{file-preview-BFt64WsS.js → file-preview-B2vvETTL.js} +1 -1
  149. package/dist/client/assets/{file-share-button-BnNwXX5z.js → file-share-button-Zf8hU2Fg.js} +1 -1
  150. package/dist/client/assets/{file-type-icon-C1ZF3wAh.js → file-type-icon-CXd8pQq1.js} +1 -1
  151. package/dist/client/assets/{folder-icon-BOdYGMzM.js → folder-icon-2Jjh406i.js} +1 -1
  152. package/dist/client/assets/{form-DQ_IxFJc.js → form-DEQzyl-Z.js} +1 -1
  153. package/dist/client/assets/{gateway-client-TD7qk1zJ.js → gateway-client-DLNW7KMa.js} +1 -1
  154. package/dist/client/assets/{general-DHAVwBud.js → general-BWYX0eIc.js} +1 -1
  155. package/dist/client/assets/{github-icon-0MAxQvrZ.js → github-icon-CrJOrJCi.js} +1 -1
  156. package/dist/client/assets/{home-4CuixH7A.js → home-CokmjUfB.js} +1 -1
  157. package/dist/client/assets/{hooks-8z4xHskl.js → hooks-Cow3V6T6.js} +1 -1
  158. package/dist/client/assets/{hooks-_W3a7WUK.js → hooks-VIquBHyZ.js} +1 -1
  159. package/dist/client/assets/{index-GHrQksGb.js → index-B7kHFiyx.js} +1 -1
  160. package/dist/client/assets/{index-upEARtMg.js → index-BHUvdpQg.js} +1 -1
  161. package/dist/client/assets/{index-DWLxhElz.js → index-C7RTFckf.js} +1 -1
  162. package/dist/client/assets/{index-CGGT_6fr.js → index-CHMhjP76.js} +1 -1
  163. package/dist/client/assets/{index-CH2bkKoB.js → index-CJB5eESL.js} +1 -1
  164. package/dist/client/assets/{index-BOCVYrA7.js → index-CVKN3yqd.js} +1 -1
  165. package/dist/client/assets/{index-tJO3CeUw.js → index-CWvjApMn.js} +1 -1
  166. package/dist/client/assets/{index-BOl5mM-q.js → index-CZXQ4cPi.js} +1 -1
  167. package/dist/client/assets/{index-BzsHOaCZ.js → index-CtTWJzNy.js} +1 -1
  168. package/dist/client/assets/{index-BVY204en.js → index-D9F2hZ3H.js} +1 -1
  169. package/dist/client/assets/{index-DUTmqJR2.js → index-DTtAckpN.js} +1 -1
  170. package/dist/client/assets/{index-B4rsaStI.js → index-DgWiecJC.js} +1 -1
  171. package/dist/client/assets/{index-CFuvn2u8.js → index-DjqfD6aH.js} +1 -1
  172. package/dist/client/assets/{index-6zOcw-_z.js → index-Dsngyxdw.js} +1 -1
  173. package/dist/client/assets/{index-7tyXXYIG.js → index-LqGJKspm.js} +4 -4
  174. package/dist/client/assets/{index-redirect-CrNRrseY.js → index-redirect-cWZ6P9Fa.js} +1 -1
  175. package/dist/client/assets/{infiniteQueryObserver-Bd_Xe1TN.js → infiniteQueryObserver-D63coM0A.js} +1 -1
  176. package/dist/client/assets/{infra-billing-Bkdg0c4a.js → infra-billing-K0cnxhkq.js} +1 -1
  177. package/dist/client/assets/{input-B3Coacmv.js → input-BmnxcFX-.js} +1 -1
  178. package/dist/client/assets/{input-zuyzMVZz.js → input-CP1IqPwA.js} +1 -1
  179. package/dist/client/assets/{input-CdMnZiZ6.js → input-kaJnjge5.js} +1 -1
  180. package/dist/client/assets/{integration-icon-BQ1mVBw6.js → integration-icon-DWYnH6CS.js} +1 -1
  181. package/dist/client/assets/{label-CcvwjKY9.js → label-CycRXo8-.js} +1 -1
  182. package/dist/client/assets/{last-preview-page-DJUY91Ef.js → last-preview-page-CQ1xE-EE.js} +1 -1
  183. package/dist/client/assets/{layout-Bx-JxuJH.js → layout-UP0YxIJD.js} +1 -1
  184. package/dist/client/assets/{legacy-agents-deep-C_d7yysm.js → legacy-agents-deep-BJP4TvVX.js} +1 -1
  185. package/dist/client/assets/{legacy-main-redirect-hXwWhEx_.js → legacy-main-redirect-Dthqqfia.js} +1 -1
  186. package/dist/client/assets/{library-CmTD8FM5.js → library-BFRTDsFO.js} +1 -1
  187. package/dist/client/assets/{login-DZjafLYn.js → login-DnkqrrfW.js} +1 -1
  188. package/dist/client/assets/{markdown-D5lLIYiU.js → markdown-Dmz1YqdU.js} +1 -1
  189. package/dist/client/assets/{mcp-app-renderer-DMt9Mj45.js → mcp-app-renderer-msD9uif_.js} +1 -1
  190. package/dist/client/assets/{mcp-oauth-C2Ax-WHA.js → mcp-oauth-xX_w6J5G.js} +1 -1
  191. package/dist/client/assets/{members-CV2cvXXb.js → members-CJ3Mxxvl.js} +1 -1
  192. package/dist/client/assets/{message-templates-UcOvLxc0.js → message-templates-6cGt-pIL.js} +1 -1
  193. package/dist/client/assets/{mini-report-page-Dh9a9ind.js → mini-report-page-B4Ns89qY.js} +1 -1
  194. package/dist/client/assets/mock-board-DbDpPxx7.js +90 -0
  195. package/dist/client/assets/{monaco-editor-hMK6fFU_.js → monaco-editor-Bx15Pism.js} +1 -1
  196. package/dist/client/assets/{monitoring-stats-row-CVE13oo0.js → monitoring-stats-row-rYjMQ6mt.js} +1 -1
  197. package/dist/client/assets/{multi-select-tKtARyyq.js → multi-select-CYubUj6s.js} +1 -1
  198. package/dist/client/assets/{mustache-oMdVtXN4.js → mustache-D1E2hGFA.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-DdIO8NT8.js → oauth-callback-Dw16VYyc.js} +1 -1
  200. package/dist/client/assets/{oauth-callback-ai-provider-TlGg4tOP.js → oauth-callback-ai-provider-fiDEFYgR.js} +1 -1
  201. package/dist/client/assets/{onboarding-Ub0zuBic.js → onboarding-CUFF9T7W.js} +1 -1
  202. package/dist/client/assets/{optimistic-project-sidebar-views-B-9sdXuu.js → optimistic-project-sidebar-views-D0-i9pGF.js} +1 -1
  203. package/dist/client/assets/{organization-choice-CzQIXa4P.js → organization-choice-K7nAtCuU.js} +1 -1
  204. package/dist/client/assets/{orgs-BRM3PteS.js → orgs-COtED4Mj.js} +1 -1
  205. package/dist/client/assets/{page-seo-form-r0j5X3EW.js → page-seo-form-CgDiqvps.js} +1 -1
  206. package/dist/client/assets/{pair-wB0pyGEY.js → pair-C9pBJLa3.js} +1 -1
  207. package/dist/client/assets/{plan-ladder-DcxOa_K9.js → plan-ladder-Fc9095b7.js} +1 -1
  208. package/dist/client/assets/{popover-B7n3n0Kr.js → popover-CqDWteKd.js} +1 -1
  209. package/dist/client/assets/post-calendar-Bf6TUCPx.js +1 -0
  210. package/dist/client/assets/post-editor-NhF6msAy.js +1 -0
  211. package/dist/client/assets/{preview-content-DXYNRyjB.js → preview-content-DpyA1UES.js} +1 -1
  212. package/dist/client/assets/{preview-dialog-CVBJYhZD.js → preview-dialog-D_2a7nng.js} +1 -1
  213. package/dist/client/assets/{primitives-B-BEySr2.js → primitives-xvmFW9M2.js} +1 -1
  214. package/dist/client/assets/{profile-CaMzH8op.js → profile-CYbA5Ac5.js} +1 -1
  215. package/dist/client/assets/project-app-view-B0AcfaAH.js +1 -0
  216. package/dist/client/assets/{project-feed-w-8IReEj.js → project-feed-DT93rByU.js} +1 -1
  217. package/dist/client/assets/{project-icon-BpNWgNmk.js → project-icon-4fy6jz5e.js} +1 -1
  218. package/dist/client/assets/project-reports-s0B4HdWk.js +1 -0
  219. package/dist/client/assets/project-tasks-DEqsfT_3.js +1 -0
  220. package/dist/client/assets/{prompts-DKbaoq3Z.js → prompts-BV9VgLKz.js} +1 -1
  221. package/dist/client/assets/record-editor-ClCzYt3f.js +1 -0
  222. package/dist/client/assets/redirect-editor-CDrKg3yi.js +1 -0
  223. package/dist/client/assets/registry-DmrsKU6X.js +2 -0
  224. package/dist/client/assets/{registry-layout-sSQ_Re_s.js → registry-layout-B4ymxlVH.js} +1 -1
  225. package/dist/client/assets/reports-B4ocqqeE.js +1 -0
  226. package/dist/client/assets/{reports-Bnp1xUWK.js → reports-BpsBbPeI.js} +1 -1
  227. package/dist/client/assets/reports-tab-BwNrhZ99.js +2 -0
  228. package/dist/client/assets/{repositories-B-B3nysE.js → repositories-B3Yj-p-O.js} +1 -1
  229. package/dist/client/assets/{repository-import-picker-C3le5Vbk.js → repository-import-picker-DJZT2bf1.js} +1 -1
  230. package/dist/client/assets/{repository-picker-AEJ-LXcd.js → repository-picker-ZWXqLUOz.js} +1 -1
  231. package/dist/client/assets/{require-capability-Cu6XAdHn.js → require-capability-D2ozGXMI.js} +1 -1
  232. package/dist/client/assets/{required-auth-layout-OWmh0cRB.js → required-auth-layout-AdYtaYp9.js} +1 -1
  233. package/dist/client/assets/{reset-password-Ch_88gpr.js → reset-password-9ciFm04R.js} +1 -1
  234. package/dist/client/assets/{resizable-YVuw9dmI.js → resizable-DdiAoyYr.js} +1 -1
  235. package/dist/client/assets/{review-settings-CyJPDt4q.js → review-settings-DKxd_W2B.js} +1 -1
  236. package/dist/client/assets/{rich-text-link-control-eNehg68D.js → rich-text-link-control-G1eIsiad.js} +1 -1
  237. package/dist/client/assets/{roles-D3F7v_9T.js → roles-CovnIYj9.js} +1 -1
  238. package/dist/client/assets/{route-DFUmVQUb.js → route-BE6U5YUg.js} +1 -1
  239. package/dist/client/assets/{route-vlLsUt2b.js → route-BVgwrj11.js} +1 -1
  240. package/dist/client/assets/route-DCN2VT7W.js +1 -0
  241. package/dist/client/assets/{runnable-block-editor-x1eaErrG.js → runnable-block-editor-BTuxOpmZ.js} +3 -3
  242. package/dist/client/assets/sandbox-lifecycle-context-DRuSe7YD.js +2 -0
  243. package/dist/client/assets/sandbox-start-errors-BK_aDCyt.js +1 -0
  244. package/dist/client/assets/{schema-DQWsrq7E.js → schema-Dn-PxCJQ.js} +1 -1
  245. package/dist/client/assets/{scroll-area-B9yM5Ryy.js → scroll-area-NimWyBPv.js} +1 -1
  246. package/dist/client/assets/{search-input-BhE4PfQC.js → search-input-DtAj9jJO.js} +1 -1
  247. package/dist/client/assets/{secrets-Cj1rvkY-.js → secrets-CJGI8AA1.js} +1 -1
  248. package/dist/client/assets/{sections-editor-BoHaugHP.js → sections-editor-BReV4_k0.js} +1 -1
  249. package/dist/client/assets/{select-DuiQIVh5.js → select-DTLRO2jP.js} +1 -1
  250. package/dist/client/assets/{select-model-C0XP2o1V.js → select-model-CiYu746H.js} +1 -1
  251. package/dist/client/assets/seo-editor-CBVXWrym.js +1 -0
  252. package/dist/client/assets/{settings-tab-CzbVS5Mz.js → settings-tab-D5ZWBgDS.js} +1 -1
  253. package/dist/client/assets/{sheet-c3fs301B.js → sheet-DcmUstYv.js} +1 -1
  254. package/dist/client/assets/{shell-layout-BXCDxtNa.js → shell-layout-C3r9cZwX.js} +1 -1
  255. package/dist/client/assets/{sidebar-MvEpPYgm.js → sidebar-CYiEz-wg.js} +1 -1
  256. package/dist/client/assets/{skill-preview-COsUucnC.js → skill-preview-B2dbgHoR.js} +1 -1
  257. package/dist/client/assets/{skills-CIZpxnix.js → skills-DZXROjVr.js} +1 -1
  258. package/dist/client/assets/{sso-N53Ugc3r.js → sso-BdkCoZP1.js} +1 -1
  259. package/dist/client/assets/{store-Bc9shtTF.js → store-UwmR5LPt.js} +1 -1
  260. package/dist/client/assets/store-registry-DP7bjXP_.js +2 -0
  261. package/dist/client/assets/{switch-XzCZqEVH.js → switch-DVOjL7QB.js} +1 -1
  262. package/dist/client/assets/{synced-repos-BUMAgO9J.js → synced-repos-n_6ncb-M.js} +1 -1
  263. package/dist/client/assets/{table-DIbp_l9d.js → table-y7Fq_8fL.js} +1 -1
  264. package/dist/client/assets/{tabs-a46RXUx5.js → tabs--SQ9MSoj.js} +1 -1
  265. package/dist/client/assets/{task-board-DgeGTQVc.js → task-board-CT88RfwA.js} +1 -1
  266. package/dist/client/assets/{task-route-zG_8Kz8w.js → task-route-DKkxhcBt.js} +1 -1
  267. package/dist/client/assets/{task-status-Dh1cVJUD.js → task-status-mkrsQtsp.js} +1 -1
  268. package/dist/client/assets/{tasks-CJoFG2AV.js → tasks-BoMO2gaD.js} +1 -1
  269. package/dist/client/assets/tasks-CBhZiB75.js +1 -0
  270. package/dist/client/assets/{textarea-CMbCiP_x.js → textarea-Ciqg70xj.js} +1 -1
  271. package/dist/client/assets/{thread-intent-BdvWnyh1.js → thread-intent-DczG93w-.js} +1 -1
  272. package/dist/client/assets/{thread-route-BMAI4jvc.js → thread-route-Csb0bQYU.js} +1 -1
  273. package/dist/client/assets/{thread-route-BYUOxJfV.js → thread-route-D9RjIb92.js} +1 -1
  274. package/dist/client/assets/{thread-sheet-body-DWIa1Psy.js → thread-sheet-body-BfsG-HPC.js} +1 -1
  275. package/dist/client/assets/{toggle-group-BpHZ2Rek.js → toggle-group-Cl0Nt_2b.js} +1 -1
  276. package/dist/client/assets/{toolbar-icon-button-CnZH_a-Q.js → toolbar-icon-button-CQM6O44g.js} +1 -1
  277. package/dist/client/assets/{tooltip-NOT5TvpW.js → tooltip-DsIeYtk8.js} +1 -1
  278. package/dist/client/assets/{track-B_vC-44V.js → track-Bmhzoq6y.js} +1 -1
  279. package/dist/client/assets/{types-D4bb4LPp.js → types-Uxwa5Ooo.js} +1 -1
  280. package/dist/client/assets/{usage-stats-CGQU1Ksj.js → usage-stats-BsX_MBqv.js} +1 -1
  281. package/dist/client/assets/{use-ai-providers-DZtU4a7C.js → use-ai-providers-CKFqZtob.js} +1 -1
  282. package/dist/client/assets/{use-automations-gpw6hXj-.js → use-automations-GlFDlb_o.js} +1 -1
  283. package/dist/client/assets/{use-autosave-CEQfTSV0.js → use-autosave-DT3tUP8x.js} +1 -1
  284. package/dist/client/assets/{use-commerce-diagnostic-Bm8pHB0W.js → use-commerce-diagnostic-D4lhjg3y.js} +1 -1
  285. package/dist/client/assets/{use-connect-companion-Bi6FmjC1.js → use-connect-companion-6hnymdU2.js} +1 -1
  286. package/dist/client/assets/{use-connection-CAG410NC.js → use-connection-71baAT9J.js} +1 -1
  287. package/dist/client/assets/{use-copy-BCCEejfm.js → use-copy-AldvBwzV.js} +1 -1
  288. package/dist/client/assets/{use-create-virtual-mcp-BJOm-ngO.js → use-create-virtual-mcp-Bkk62U-K.js} +1 -1
  289. package/dist/client/assets/{use-date-fns-locale-Beb2WcsD.js → use-date-fns-locale-7fNXmWDe.js} +1 -1
  290. package/dist/client/assets/{use-debounced-autosave-DKqaLPMf.js → use-debounced-autosave-DWpI7QzW.js} +1 -1
  291. package/dist/client/assets/{use-debounced-value-DW--CGi4.js → use-debounced-value-vcd9fBbq.js} +1 -1
  292. package/dist/client/assets/{use-deco-credits-Cr47M5pI.js → use-deco-credits-BCMPDE0p.js} +1 -1
  293. package/dist/client/assets/{use-decopilot-events-DFWXqRQJ.js → use-decopilot-events-y3CYynsq.js} +1 -1
  294. package/dist/client/assets/{use-delete-connection-CAzQMfwD.js → use-delete-connection-CNw_Su9n.js} +1 -1
  295. package/dist/client/assets/{use-deployment-admin-Cxul1bjy.js → use-deployment-admin-BVvdOjlP.js} +1 -1
  296. package/dist/client/assets/{use-entitlements-B5OCpL90.js → use-entitlements-CXdqFCsK.js} +1 -1
  297. package/dist/client/assets/{use-fast-preview-draft-url-5cYDDJXC.js → use-fast-preview-draft-url-C0fMLzwd.js} +1 -1
  298. package/dist/client/assets/{use-file-configs-KqSjwJ5Q.js → use-file-configs-Bv0ksYAm.js} +1 -1
  299. package/dist/client/assets/{use-infinite-scroll-DTu796P3.js → use-infinite-scroll-CaIDAWPs.js} +1 -1
  300. package/dist/client/assets/{use-join-requests-B-V3jp4-.js → use-join-requests-DqMwbPoZ.js} +1 -1
  301. package/dist/client/assets/{use-main-panel-tabs-DT1ewQsE.js → use-main-panel-tabs-Ctx_tfIw.js} +1 -1
  302. package/dist/client/assets/{use-mcp-auth-status-Dd2NLoP2.js → use-mcp-auth-status-BsIDowWZ.js} +1 -1
  303. package/dist/client/assets/{use-mcp-client-FKhTA-pP.js → use-mcp-client-D8jBM4Gn.js} +1 -1
  304. package/dist/client/assets/{use-mcp-prompts-BxcBhrg0.js → use-mcp-prompts-BI-W9BIZ.js} +1 -1
  305. package/dist/client/assets/{use-mcp-tools-B-mP6VIl.js → use-mcp-tools-BghY6B9H.js} +1 -1
  306. package/dist/client/assets/{use-members-uHE9_Ihn.js → use-members-CpAtdP1_.js} +1 -1
  307. package/dist/client/assets/{use-mobile-7gcXtaOp.js → use-mobile-Dqp4Jkm6.js} +1 -1
  308. package/dist/client/assets/{use-navigate-to-agent-C1krlEI1.js → use-navigate-to-agent-DckkpAZt.js} +1 -1
  309. package/dist/client/assets/{use-open-billing-url-bvxUc97O.js → use-open-billing-url-Casm2GPL.js} +1 -1
  310. package/dist/client/assets/{use-org-auth-client-CG0U5nVg.js → use-org-auth-client-C0d9QdYl.js} +1 -1
  311. package/dist/client/assets/{use-org-fs-Cu_kl9ub.js → use-org-fs-Dlw3vnpa.js} +1 -1
  312. package/dist/client/assets/{use-org-notice-CTR6LVO_.js → use-org-notice-oR0FnSz0.js} +1 -1
  313. package/dist/client/assets/{use-org-sso-pS2f0S9B.js → use-org-sso-6FHDtS1R.js} +1 -1
  314. package/dist/client/assets/{use-organization-roles-Btc3lo7d.js → use-organization-roles-BRfUGpr9.js} +1 -1
  315. package/dist/client/assets/{use-organization-settings-COYwjTmH.js → use-organization-settings-CR_gD2xz.js} +1 -1
  316. package/dist/client/assets/{use-panel-navigate-BJ__p2tn.js → use-panel-navigate-CPCeDjnd.js} +1 -1
  317. package/dist/client/assets/{use-project-native-view-presence-D84bfTQ8.js → use-project-native-view-presence-CHK-UQhq.js} +1 -1
  318. package/dist/client/assets/{use-project-scope-TUxrelMI.js → use-project-scope-OfDo_ODT.js} +1 -1
  319. package/dist/client/assets/{use-registry-connections-ClkWohn9.js → use-registry-connections-CNnDInfj.js} +1 -1
  320. package/dist/client/assets/{use-releases-r-llw2bS.js → use-releases-37cW1ZIN.js} +1 -1
  321. package/dist/client/assets/{use-route-default-main-B5V1SFYB.js → use-route-default-main-TI35rK7_.js} +1 -1
  322. package/dist/client/assets/{use-secrets-g7CJAYOM.js → use-secrets-DUfhij8R.js} +1 -1
  323. package/dist/client/assets/{use-section-preview-base-Dm9Y5bzG.js → use-section-preview-base-CwyR6gN7.js} +1 -1
  324. package/dist/client/assets/{use-session-runtime-C-KbNAJE.js → use-session-runtime-4Wsurepj.js} +1 -1
  325. package/dist/client/assets/{use-tags-Bn18lYbj.js → use-tags-D48vlCoY.js} +1 -1
  326. package/dist/client/assets/{use-task-metadata-DkqwNP5B.js → use-task-metadata-DWEBrPNn.js} +1 -1
  327. package/dist/client/assets/{use-thread-outputs-DX41qrVY.js → use-thread-outputs-DCO0QMln.js} +1 -1
  328. package/dist/client/assets/{use-view-mode-CJqE7xKq.js → use-view-mode-C2bFNRDM.js} +1 -1
  329. package/dist/client/assets/{use-virtual-mcp-BSZ-bXcO.js → use-virtual-mcp-Dpcooz6x.js} +1 -1
  330. package/dist/client/assets/useInfiniteQuery-D7Bn-Wtf.js +1 -0
  331. package/dist/client/assets/{useQueries-C3nFpV34.js → useQueries-CgbxQuEr.js} +1 -1
  332. package/dist/client/assets/useSuspenseInfiniteQuery-xIiKKe3g.js +1 -0
  333. package/dist/client/assets/{users-u-T0fIr0.js → users-BKXLASD6.js} +1 -1
  334. package/dist/client/assets/{utils-C15cMn2u.js → utils-BA5pzGOE.js} +1 -1
  335. package/dist/client/assets/variant-calendar-CMDBbmY-.js +1 -0
  336. package/dist/client/assets/{variant-matcher-override-BVtx6ImJ.js → variant-matcher-override-Cg0JbaMY.js} +1 -1
  337. package/dist/client/assets/{view-mode-toggle-BKffsaTK.js → view-mode-toggle-D0YJ2E_v.js} +1 -1
  338. package/dist/client/assets/{virtual-mcp-BmaMueuo.js → virtual-mcp-eG7E1rwY.js} +1 -1
  339. package/dist/client/index.html +1 -1
  340. package/dist/server/cli.js +1 -1
  341. package/dist/server/server.js +1 -1
  342. package/package.json +1 -1
  343. package/dist/client/assets/agent-app-Cw2C4r27.js +0 -1
  344. package/dist/client/assets/agent-assets-CIbYJxPo.js +0 -1
  345. package/dist/client/assets/agent-deck-DnZT949c.js +0 -1
  346. package/dist/client/assets/agent-file-D7NiOFwe.js +0 -1
  347. package/dist/client/assets/agent-library-file-DN5LWTop.js +0 -1
  348. package/dist/client/assets/agent-settings-DUNPZ5GO.js +0 -1
  349. package/dist/client/assets/agent-site-editor-code-B9IxiAD3.js +0 -2
  350. package/dist/client/assets/agent-view-2DQLRNXO.js +0 -1
  351. package/dist/client/assets/api-keys-C9cD8YKu.js +0 -1
  352. package/dist/client/assets/app-editor-xd8pnTu8.js +0 -1
  353. package/dist/client/assets/category-editor-BdieZfbz.js +0 -1
  354. package/dist/client/assets/mock-board-CVRQmzIM.js +0 -90
  355. package/dist/client/assets/post-calendar-D8zer4mS.js +0 -1
  356. package/dist/client/assets/post-editor-DISYwLg2.js +0 -1
  357. package/dist/client/assets/project-app-view-DRs3Sa2_.js +0 -1
  358. package/dist/client/assets/project-reports-V2QSEwY2.js +0 -1
  359. package/dist/client/assets/project-tasks-BEiifV6g.js +0 -1
  360. package/dist/client/assets/record-editor-SIb3whuJ.js +0 -1
  361. package/dist/client/assets/redirect-editor-0tJchwSd.js +0 -1
  362. package/dist/client/assets/registry-mYP4BRsJ.js +0 -2
  363. package/dist/client/assets/reports-CstMZYaF.js +0 -1
  364. package/dist/client/assets/reports-tab-nZawxQlD.js +0 -2
  365. package/dist/client/assets/route-DWh-Ygcx.js +0 -1
  366. package/dist/client/assets/sandbox-lifecycle-context-PuxU5FPA.js +0 -2
  367. package/dist/client/assets/seo-editor-Cj7-3t9Z.js +0 -1
  368. package/dist/client/assets/store-registry-Bv0M4LRp.js +0 -2
  369. package/dist/client/assets/tasks-IzIm8pv2.js +0 -1
  370. package/dist/client/assets/useInfiniteQuery-B50zYHZp.js +0 -1
  371. package/dist/client/assets/useSuspenseInfiniteQuery-DEvCQfg8.js +0 -1
  372. package/dist/client/assets/variant-calendar-wkFCgj1H.js +0 -1
@@ -1,4 +1,4 @@
1
- import{cr as Pt,cs as Dt,ct as P,ab as d,cu as ce,cv as He,cw as Lt,cx as kt,at as jt,bp as x,br as W,bq as oe,aa as T,cy as m,bt as F,cz as Zt,cA as A,bs as $t,t as ye,r as J,c as we,M as Ut,x as Ft,j as Bt}from"./index-7tyXXYIG.js";import{u as Vt}from"./use-mcp-client-FKhTA-pP.js";import{d as zt,e as Ye}from"./backoff-8mStPHYB.js";import{T as Ge,a as qe,b as Xe}from"./task-board-DgeGTQVc.js";const Qe={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},Ke=Object.values(Qe);var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const n={};for(const i of s)n[i]=i;return n},t.getValidEnumValues=s=>{const n=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of n)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(n){return s[n]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const n=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&n.push(i);return n},t.find=(s,n)=>{for(const i of s)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,n=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=r,t.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(re||(re={}));var Oe;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Oe||(Oe={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class de extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},r={_errors:[]},s=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let o=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(a(i))):o[u]=o[u]||{_errors:[]},o=o[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof de))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const n=s.path[0];a[n]=a[n]||[],a[n].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}de.create=t=>new de(t);var Re;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Re||(Re={}));var g;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(g||(g={}));class Z{constructor(e){this.value=e}value;subs=new Set;get=()=>this.value;set=e=>{Object.is(e,this.value)||(this.value=e,this.subs.forEach(a=>a()))};update=e=>{this.set(e(this.value))};subscribe=e=>(this.subs.add(e),()=>{this.subs.delete(e)})}var et="vercel.ai.error",Jt=Symbol.for(et),Ne,xe,$=class tt extends(xe=Error,Ne=Jt,xe){constructor({name:e,message:a,cause:r}){super(a),this[Ne]=!0,this.name=e,this.cause=r}static isInstance(e){return tt.hasMarker(e,et)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function at(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var rt="AI_InvalidArgumentError",st=`vercel.ai.error.${rt}`,Wt=Symbol.for(st),Pe,De,Ht=class extends(De=$,Pe=Wt,De){constructor({message:t,cause:e,argument:a}){super({name:rt,message:t,cause:e}),this[Pe]=!0,this.argument=a}static isInstance(t){return $.hasMarker(t,st)}},nt="AI_JSONParseError",ot=`vercel.ai.error.${nt}`,Yt=Symbol.for(ot),Le,ke,je=class extends(ke=$,Le=Yt,ke){constructor({text:t,cause:e}){super({name:nt,message:`JSON parsing failed: Text: ${t}.
1
+ import{cr as Pt,cs as Dt,ct as P,ab as d,cu as ce,cv as He,cw as Lt,cx as kt,at as jt,bp as x,br as W,bq as oe,aa as T,cy as m,bt as F,cz as Zt,cA as A,bs as $t,t as ye,r as J,c as we,M as Ut,x as Ft,j as Bt}from"./index-LqGJKspm.js";import{u as Vt}from"./use-mcp-client-D8jBM4Gn.js";import{d as zt,e as Ye}from"./backoff-8mStPHYB.js";import{T as Ge,a as qe,b as Xe}from"./task-board-CT88RfwA.js";const Qe={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},Ke=Object.values(Qe);var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const n={};for(const i of s)n[i]=i;return n},t.getValidEnumValues=s=>{const n=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of n)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(n){return s[n]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const n=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&n.push(i);return n},t.find=(s,n)=>{for(const i of s)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,n=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=r,t.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(re||(re={}));var Oe;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Oe||(Oe={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class de extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},r={_errors:[]},s=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let o=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(a(i))):o[u]=o[u]||{_errors:[]},o=o[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof de))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const n=s.path[0];a[n]=a[n]||[],a[n].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}de.create=t=>new de(t);var Re;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Re||(Re={}));var g;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(g||(g={}));class Z{constructor(e){this.value=e}value;subs=new Set;get=()=>this.value;set=e=>{Object.is(e,this.value)||(this.value=e,this.subs.forEach(a=>a()))};update=e=>{this.set(e(this.value))};subscribe=e=>(this.subs.add(e),()=>{this.subs.delete(e)})}var et="vercel.ai.error",Jt=Symbol.for(et),Ne,xe,$=class tt extends(xe=Error,Ne=Jt,xe){constructor({name:e,message:a,cause:r}){super(a),this[Ne]=!0,this.name=e,this.cause=r}static isInstance(e){return tt.hasMarker(e,et)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function at(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var rt="AI_InvalidArgumentError",st=`vercel.ai.error.${rt}`,Wt=Symbol.for(st),Pe,De,Ht=class extends(De=$,Pe=Wt,De){constructor({message:t,cause:e,argument:a}){super({name:rt,message:t,cause:e}),this[Pe]=!0,this.argument=a}static isInstance(t){return $.hasMarker(t,st)}},nt="AI_JSONParseError",ot=`vercel.ai.error.${nt}`,Yt=Symbol.for(ot),Le,ke,je=class extends(ke=$,Le=Yt,ke){constructor({text:t,cause:e}){super({name:nt,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${at(e)}`,cause:e}),this[Le]=!0,this.text=t}static isInstance(t){return $.hasMarker(t,ot)}},it="AI_TypeValidationError",lt=`vercel.ai.error.${it}`,Gt=Symbol.for(lt),Ze,$e,q=class be extends($e=$,Ze=Gt,$e){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const n=[];r.entityName&&n.push(r.entityName),r.entityId&&n.push(`id: "${r.entityId}"`),s+=n.join(", "),s+=")"}super({name:it,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${at(a)}`,cause:a}),this[Ze]=!0,this.value=e,this.context=r}static isInstance(e){return $.hasMarker(e,lt)}static wrap({value:e,cause:a,context:r}){var s,n,i;return be.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((n=a.context)==null?void 0:n.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new be({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const n=a.length,i=new Array(e);for(let o=0;o<e;o++)i[o]=a[Math.random()*n|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new Ht({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var qt=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Xt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Ue(t){const e=JSON.parse(t);return e===null||typeof e!="object"||qt.test(t)===!1&&Xt.test(t)===!1?e:Qt(e)}function Qt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const n=r[s];n&&typeof n=="object"&&e.push(n)}}}return t}function Kt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ue(t)}try{return Ue(t)}finally{Error.stackTraceLimit=e}}function Ae(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=V(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(V):V(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(V)),t.allOf!=null&&(t.allOf=t.allOf.map(V)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(V));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=V(e[a]);return t}function V(t){return typeof t=="boolean"?t:Ae(t)}var ea=Symbol("Let zodToJsonSchema decide on which parser to use"),Fe={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},ta=t=>typeof t=="string"?{...Fe,name:t}:{...Fe,...t};function L(){return{}}function aa(t,e){var a,r,s;const n={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==g.ZodAny&&(n.items=E(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(n.minItems=t.minLength.value),t.maxLength&&(n.maxItems=t.maxLength.value),t.exactLength&&(n.minItems=t.exactLength.value,n.maxItems=t.exactLength.value),n}function ra(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function sa(){return{type:"boolean"}}function ut(t,e){return E(t.type._def,e)}var na=(t,e)=>E(t.innerType._def,e);function ct(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,n)=>ct(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return oa(t)}}var oa=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function ia(t,e){return{...E(t.innerType._def,e),default:t.defaultValue()}}function la(t,e){return e.effectStrategy==="input"?E(t.schema._def,e):L()}function ua(t){return{type:"string",enum:Array.from(t.values)}}var ca=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function da(t,e){const a=[E(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),E(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(ca(s))r.push(...s.allOf);else{let n=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...o}=s;n=o}r.push(n)}}),r.length?{allOf:r}:void 0}function pa(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var ge=void 0,k={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(ge===void 0&&(ge=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ge),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function dt(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":j(a,"email",r.message,e);break;case"format:idn-email":j(a,"idn-email",r.message,e);break;case"pattern:zod":N(a,k.email,r.message,e);break}break;case"url":j(a,"uri",r.message,e);break;case"uuid":j(a,"uuid",r.message,e);break;case"regex":N(a,r.regex,r.message,e);break;case"cuid":N(a,k.cuid,r.message,e);break;case"cuid2":N(a,k.cuid2,r.message,e);break;case"startsWith":N(a,RegExp(`^${ve(r.value,e)}`),r.message,e);break;case"endsWith":N(a,RegExp(`${ve(r.value,e)}$`),r.message,e);break;case"datetime":j(a,"date-time",r.message,e);break;case"date":j(a,"date",r.message,e);break;case"time":j(a,"time",r.message,e);break;case"duration":j(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{N(a,RegExp(ve(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&j(a,"ipv4",r.message,e),r.version!=="v4"&&j(a,"ipv6",r.message,e);break}case"base64url":N(a,k.base64url,r.message,e);break;case"jwt":N(a,k.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&N(a,k.ipv4Cidr,r.message,e),r.version!=="v4"&&N(a,k.ipv6Cidr,r.message,e);break}case"emoji":N(a,k.emoji(),r.message,e);break;case"ulid":{N(a,k.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{j(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{N(a,k.base64,r.message,e);break}}break}case"nanoid":N(a,k.nanoid,r.message,e)}return a}function ve(t,e){return e.patternStrategy==="escape"?ha(t):t}var fa=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ha(t){let e="";for(let a=0;a<t.length;a++)fa.has(t[a])||(e+="\\"),e+=t[a];return e}function j(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function N(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Be(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Be(e,r)}function Be(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let n="",i=!1,o=!1,p=!1;for(let u=0;u<s.length;u++){if(i){n+=s[u],i=!1;continue}if(r.i){if(o){if(s[u].match(/[a-z]/)){p?(n+=s[u],n+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(n+=s[u],p=!0):n+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){n+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){n+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(s[u]==="$"){n+=`($|(?=[\r
@@ -1,2 +1,2 @@
1
- import{o as X,h as U,j as V,D as z,p as H,q as W}from"./index-CGGT_6fr.js";import{eA as Y,eB as G,ef as J,eC as Z,r as q,c as B,z as ee,K as te}from"./index-7tyXXYIG.js";var we=X;function ne(n){var e;const{char:o,allowSpaces:t,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:a,$position:r}=n,d=t&&!s,f=W(o),g=new RegExp(`\\s${f}$`),u=a?"^":"",m=s?"":f,h=d?new RegExp(`${u}${f}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${u}(?:^)?${f}[^\\s${m}]*`,"gm"),p=((e=r.nodeBefore)===null||e===void 0?void 0:e.isText)&&r.nodeBefore.text;if(!p)return null;const y=r.pos-p.length,c=Array.from(p.matchAll(h)).pop();if(!c||c.input===void 0||c.index===void 0)return null;const S=c.input.slice(Math.max(0,c.index-1),c.index),v=new RegExp(`^[${i?.join("")}\0]?$`).test(S);if(i!==null&&!v)return null;const w=y+c.index;let l=w+c[0].length;return d&&g.test(p.slice(l-1,l+1))&&(c[0]+=" ",l+=1),w<r.pos&&l>=r.pos?{range:{from:w,to:l},query:c[0].slice(o.length),text:c[0]}:null}function oe(n){return n.docChanged?n.steps.some(e=>{const o=e.slice;if(!o?.content)return!1;const t=o.content.textBetween(0,o.content.size,`
1
+ import{o as X,h as U,j as V,D as z,p as H,q as W}from"./index-CHMhjP76.js";import{eA as Y,eB as G,ef as J,eC as Z,r as q,c as B,z as ee,K as te}from"./index-LqGJKspm.js";var we=X;function ne(n){var e;const{char:o,allowSpaces:t,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:a,$position:r}=n,d=t&&!s,f=W(o),g=new RegExp(`\\s${f}$`),u=a?"^":"",m=s?"":f,h=d?new RegExp(`${u}${f}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${u}(?:^)?${f}[^\\s${m}]*`,"gm"),p=((e=r.nodeBefore)===null||e===void 0?void 0:e.isText)&&r.nodeBefore.text;if(!p)return null;const y=r.pos-p.length,c=Array.from(p.matchAll(h)).pop();if(!c||c.input===void 0||c.index===void 0)return null;const S=c.input.slice(Math.max(0,c.index-1),c.index),v=new RegExp(`^[${i?.join("")}\0]?$`).test(S);if(i!==null&&!v)return null;const w=y+c.index;let l=w+c[0].length;return d&&g.test(p.slice(l-1,l+1))&&(c[0]+=" ",l+=1),w<r.pos&&l>=r.pos?{range:{from:w,to:l},query:c[0].slice(o.length),text:c[0]}:null}function oe(n){return n.docChanged?n.steps.some(e=>{const o=e.slice;if(!o?.content)return!1;const t=o.content.textBetween(0,o.content.size,`
2
2
  `);return/\s/.test(t)}):!1}function se(n){return()=>{const e=n.state.selection.$anchor.pos,{top:o,right:t,bottom:s,left:i}=n.view.coordsAtPos(e);try{return new DOMRect(i,o,t-i,s-o)}catch{return null}}}function le(n,e,o,t){return o?()=>{const s=t.getState(n.state),i=s?.decorationId,a=e.dom.querySelector(`[data-decoration-id="${i}"]`);return a?.getBoundingClientRect()||null}:se(n)}function ae({match:n,dismissedRange:e,state:o,transaction:t,editor:s,shouldResetDismissed:i,effectiveAllowSpaces:a}){return i?.({editor:s,state:o,range:e,match:n,transaction:t,allowSpaces:a})?!1:a?n.range.from===e.from:n.range.from===e.from&&!oe(t)}function ie({view:n,pluginKeyRef:e}){const o=n.state.tr.setMeta(e,{exit:!0});n.dispatch(o)}function re({pluginKey:n,decorationTag:e,decorationClass:o,decorationContent:t,decorationEmptyClass:s,renderer:i,dispatchExit:a}){return{handleKeyDown(r,d){var f;const g=n.getState(r.state);if(!g.active)return!1;if(d.key==="Escape"||d.key==="Esc"){var u;return i==null||(u=i.onKeyDown)===null||u===void 0||u.call(i,{view:r,event:d,range:g.range}),a(r),!0}return(i==null||(f=i.onKeyDown)===null||f===void 0?void 0:f.call(i,{view:r,event:d,range:g.range}))||!1},decorations(r){const{active:d,range:f,decorationId:g,query:u}=n.getState(r);if(!d)return null;const m=!u?.length,h=[o];return m&&h.push(s),z.create(r.doc,[H.inline(f.from,f.to,{nodeName:e,class:h.join(" "),"data-decoration-id":g||void 0,"data-decoration-content":t})])}}}function ue({editor:n,char:e,effectiveAllowSpaces:o,allowToIncludeChar:t,allowedPrefixes:s,startOfLine:i,findSuggestionMatch:a,allow:r,shouldShow:d,shouldKeepDismissed:f,pluginKey:g}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,m,h,p){const{isEditable:y}=n,{composing:c}=n.view,{selection:S}=u,{empty:v,from:w}=S,l={...m},D=u.getMeta(g);if(D&&D.exit)return l.active=!1,l.decorationId=null,l.range={from:0,to:0},l.query=null,l.text=null,l.dismissedRange=m.active?{...m.range}:m.dismissedRange,l;if(l.composing=c,u.docChanged&&l.dismissedRange!==null&&(l.dismissedRange={from:u.mapping.map(l.dismissedRange.from),to:u.mapping.map(l.dismissedRange.to)}),y&&(v||n.view.composing)){(w<m.range.from||w>m.range.to)&&!c&&!m.composing&&(l.active=!1);const x=a({char:e,allowSpaces:o,allowToIncludeChar:t,allowedPrefixes:s,startOfLine:i,$position:S.$from}),C=`id_${Math.floor(Math.random()*4294967295)}`;x&&r({editor:n,state:p,range:x.range,isActive:m.active})&&(!d||d({editor:n,range:x.range,query:x.query,text:x.text,transaction:u}))?(l.dismissedRange!==null&&!f({match:x,dismissedRange:l.dismissedRange,state:p,transaction:u})&&(l.dismissedRange=null),l.dismissedRange===null?(l.active=!0,l.decorationId=m.decorationId||C,l.range=x.range,l.query=x.query,l.text=x.text):l.active=!1):(x||(l.dismissedRange=null),l.active=!1)}else l.active=!1;return l.active||(l.decorationId=null,l.range={from:0,to:0},l.query=null,l.text=null),l}}}function ce({editor:n,items:e}){let o=null,t=null,s=null;const i=()=>{t!==null&&(clearTimeout(t),t=null),s?.(),s=null},a=f=>new Promise(g=>{s=g,t=setTimeout(()=>{t=null;const u=s;s=null,u?.()},f)}),r=()=>{o?.abort(),i(),o=null};return{abort:r,fetch:async(f,g)=>{r(),o=new AbortController;const u=o;if(g>0&&await a(g),o!==u||u.signal.aborted)return{status:"aborted"};try{const m=await e({editor:n,query:f,signal:u.signal});return o!==u||u.signal.aborted?{status:"aborted"}:{status:"resolved",items:m}}catch{return o!==u||u.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function de({placement:n,offset:e,flip:o,floatingUi:t}){var s,i,a,r;const d=[Y({mainAxis:(s=e.mainAxis)!==null&&s!==void 0?s:4,crossAxis:(i=e.crossAxis)!==null&&i!==void 0?i:0})];return o&&d.push(G()),!(t==null||(a=t.middleware)===null||a===void 0)&&a.length&&d.push(...t.middleware),{placement:n,strategy:(r=t?.strategy)!==null&&r!==void 0?r:"absolute",middleware:d}}function fe(n){if(n instanceof HTMLElement)return n;if(typeof n=="string")try{const e=document.querySelector(n);if(e)return e}catch{return document.body}return document.body}function ge({getReferenceRect:n,contextElement:e,config:o,container:t,dismissOnOutsideClick:s,dismiss:i}){return(a,r={})=>{const d={getBoundingClientRect:()=>{var p;return(p=n())!==null&&p!==void 0?p:new DOMRect},contextElement:e};let f=!1;const g=!a.isConnected;g&&fe(t).appendChild(a),r.onPosition||(a.style.visibility="hidden",a.style.width="max-content");const m=J(d,a,()=>{Z(d,a,{placement:o.placement,strategy:o.strategy,middleware:o.middleware}).then(({x:p,y,placement:c,strategy:S})=>{if(r.onPosition){r.onPosition({x:p,y,placement:c,strategy:S});return}Object.assign(a.style,{position:S,left:`${p}px`,top:`${y}px`}),f||(f=!0,a.style.visibility="")})},r.autoUpdate);let h;return s&&(h=p=>{const y=p.target;!(y instanceof Node)||a.contains(y)||e.contains(y)||i()},document.addEventListener("pointerdown",h,!0)),()=>{m(),h&&document.removeEventListener("pointerdown",h,!0),g&&a.remove()}}}function me({editor:n,pluginKey:e,items:o,renderer:t,minQueryLength:s,debounce:i,initialItems:a,placement:r,offset:d,container:f,flip:g,floatingUi:u,dismissOnOutsideClick:m,command:h,clientRectFor:p,dispatchExit:y}){let c;const S=ce({editor:n,items:o}),v=de({placement:r,offset:d,flip:g,floatingUi:u});function w(l,D){switch(l){case"started":var x;t==null||(x=t.onStart)===null||x===void 0||x.call(t,D);break;case"updated":var C;t==null||(C=t.onUpdate)===null||C===void 0||C.call(t,D);break;case"stopped":var R;t==null||(R=t.onExit)===null||R===void 0||R.call(t,D)}}return{update:async(l,D)=>{var x,C;const R=e.getState(D),A=e.getState(l.state);if(!R||!A)return;let E=null;const P=R.query!==A.query,_=R.text!==A.text,N=R.range.from!==A.range.from||R.range.to!==A.range.to,O=P||_||N;if(!R.active&&A.active)E="started";else if(R.active&&!A.active)E="stopped";else if(A.active&&O)E="updated";else return;const T=E==="stopped"?R:A,$=l.dom.querySelector(`[data-decoration-id="${T.decorationId}"]`),b=p(l,$),M=s===0||(T.query?T.query.length>=s:!1),F=(E==="started"||E==="updated")&&M;if(c={editor:n,range:T.range,query:T.query||"",text:T.text||"",items:a??[],command:L=>h({editor:n,range:T.range,props:L}),decorationNode:$,clientRect:b,loading:F,placement:r,offset:{mainAxis:(x=d.mainAxis)!==null&&x!==void 0?x:4,crossAxis:(C=d.crossAxis)!==null&&C!==void 0?C:0},container:f,flip:g,floatingUi:v,mount:ge({getReferenceRect:b,contextElement:l.dom,config:v,container:f,dismissOnOutsideClick:m,dismiss:()=>y(n.view)})},E==="started"){var k;t==null||(k=t.onBeforeStart)===null||k===void 0||k.call(t,c)}if(E==="updated"){var I;t==null||(I=t.onBeforeUpdate)===null||I===void 0||I.call(t,c)}if(E==="started"&&w(E,c),E==="started"||E==="updated")if(!F)S.abort(),c={...c,items:a??[],loading:!1};else{c={...c,items:a??[],loading:!0},E="updated",w(E,c);const L=await S.fetch(T.query||"",i);if(L.status==="aborted")return;const K=e.getState(l.state);if(!K?.active){S.abort();return}c=L.status==="resolved"?{...c,items:L.items,loading:!1}:{...c,loading:!1}}if(E==="stopped"){S.abort(),w(E,c),c=void 0;return}E==="updated"&&w(E,c)},destroy:()=>{var l;S.abort(),c&&(t==null||(l=t.onExit)===null||l===void 0||l.call(t,c))}}}const j=new U("suggestion");function Q({pluginKey:n=j,editor:e,char:o="@",allowSpaces:t=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:a=!1,decorationTag:r="span",decorationClass:d="suggestion",decorationContent:f="",decorationEmptyClass:g="is-empty",command:u=()=>null,items:m=()=>[],minQueryLength:h=0,debounce:p=0,initialItems:y,placement:c="bottom-start",offset:S={},container:v,flip:w=!0,floatingUi:l,dismissOnOutsideClick:D=!0,render:x=()=>({}),allow:C=()=>!0,findSuggestionMatch:R=ne,shouldShow:A,shouldResetDismissed:E}){const P=x?.(),_=t&&!s,N=($,b)=>le(e,$,b,n);function O($){return ae({...$,editor:e,shouldResetDismissed:E,effectiveAllowSpaces:_})}const T=$=>ie({view:$,pluginKeyRef:n});return new V({key:n,view:()=>me({editor:e,pluginKey:n,items:m,renderer:P,minQueryLength:h,debounce:p,initialItems:y,placement:c,offset:S,container:v,flip:w,floatingUi:l,dismissOnOutsideClick:D,command:u,clientRectFor:N,dispatchExit:T}),state:ue({editor:e,char:o,effectiveAllowSpaces:_,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:R,allow:C,shouldShow:A,shouldKeepDismissed:O,pluginKey:n}),props:re({pluginKey:n,decorationTag:r,decorationClass:d,decorationContent:f,decorationEmptyClass:g,renderer:P,dispatchExit:T})})}function Re(n,e=j){const o=n.state.tr.setMeta(e,{exit:!0});n.dispatch(o)}var qe=Q;function pe(n){const e=B.c(24),{editor:o,query:t,items:s,onSelect:i,onClose:a}=n,[r,d]=q.useState(0),f=q.useRef(s),g=q.useRef(r),u=q.useRef(i),m=q.useRef(a),h=q.useDeferredValue(t);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{d(0)},e[0]=p):p=e[0];let y;e[1]!==h?(y=[h],e[1]=h,e[2]=y):y=e[2],q.useEffect(p,y);let c,S;e[3]!==s.length||e[4]!==r?(c=()=>{r>=s.length&&s.length>0&&d(0)},S=[s.length,r],e[3]=s.length,e[4]=r,e[5]=c,e[6]=S):(c=e[5],S=e[6]),q.useEffect(c,S);let v,w;e[7]!==s?(v=()=>{f.current=s},w=[s],e[7]=s,e[8]=v,e[9]=w):(v=e[8],w=e[9]),q.useEffect(v,w);let l,D;e[10]!==r?(l=()=>{g.current=r},D=[r],e[10]=r,e[11]=l,e[12]=D):(l=e[11],D=e[12]),q.useEffect(l,D);let x,C;e[13]!==i?(C=()=>{u.current=i},x=[i],e[13]=i,e[14]=x,e[15]=C):(x=e[14],C=e[15]),q.useEffect(C,x);let R,A;e[16]!==a?(R=()=>{m.current=a},A=[a],e[16]=a,e[17]=R,e[18]=A):(R=e[17],A=e[18]),q.useEffect(R,A);let E,P;e[19]!==o?(E=()=>{if(o?.isDestroyed)return;let O;try{O=o.view.dom}catch{return}if(!O)return;const T=b=>{const M=f.current;if(!M.length)return!1;const F=()=>d(I=>(I+1)%M.length),k=()=>d(I=>(I-1+M.length)%M.length);switch(b.key){case"ArrowUp":return b.preventDefault(),k(),!0;case"ArrowDown":return b.preventDefault(),F(),!0;case"Tab":return b.preventDefault(),b.shiftKey?k():F(),!0;case"Home":return b.preventDefault(),d(0),!0;case"End":return b.preventDefault(),d(M.length-1),!0;case"Enter":{if(b.isComposing)return!1;b.preventDefault();const I=g.current;return I!==-1&&M[I]&&u.current?.(M[I],I),!0}case"Escape":return b.preventDefault(),m.current?.(),!0;default:return!1}},$=b=>{T(b)};return O.addEventListener("keydown",$,!0),()=>{O?.removeEventListener("keydown",$,!0)}},P=[o],e[19]=o,e[20]=E,e[21]=P):(E=e[20],P=e[21]),q.useEffect(E,P);const _=s.length?r:void 0;let N;return e[22]!==_?(N={selectedIndex:_,setSelectedIndex:d},e[22]=_,e[23]=N):N=e[23],N}function ye(n,e){switch(e.type){case"SET_SELECTED_ITEM":return{...n,selectedItem:e.payload};case"ON_START":return{...n,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...n,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return n}}const ve=q.createContext(void 0);function xe(){const n=q.useContext(ve);if(!n)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return n}function be(n){const e=B.c(16),{editor:o,char:t,pluginKey:s,allow:i,onOpenChange:a}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=r):r=e[0];const[d,f]=q.useReducer(ye,r);let g;e[1]!==a?(g=y=>{a?.(y)},e[1]=a,e[2]=g):g=e[2];const u=q.useEffectEvent(g);let m;e[3]!==t||e[4]!==i||e[5]!==o||e[6]!==u||e[7]!==s?(m=()=>{if(o?.isDestroyed)return;const y=s instanceof U?s:new U(s);o.state.plugins.find(v=>v.spec.key===y)&&o.unregisterPlugin(y);const S=Q({pluginKey:y,editor:o,char:t,allow(v){const w=o.state.doc.resolve(v.range.from);for(let l=w.depth;l>0;l--)if(w.node(l).type.name==="image")return!1;return!(i&&!i(v))},command(){},render:()=>({onStart:v=>{f({type:"ON_START",payload:{element:v.decorationNode??null,query:v.query,range:v.range}}),u(!0)},onUpdate:v=>{f({type:"ON_UPDATE",payload:{element:v.decorationNode??null,query:v.query,range:v.range}})},onKeyDown:v=>v.event.key==="Escape"?(f({type:"ON_EXIT"}),!0):!1,onExit:()=>{f({type:"ON_EXIT"}),u(!1)}}),items:he});return o.registerPlugin(S),()=>{o?.isDestroyed||o.unregisterPlugin(y)}},e[3]=t,e[4]=i,e[5]=o,e[6]=u,e[7]=s,e[8]=m):m=e[8];let h;e[9]!==t||e[10]!==i||e[11]!==o||e[12]!==s?(h=[o,s,t,f,i],e[9]=t,e[10]=i,e[11]=o,e[12]=s,e[13]=h):h=e[13],q.useEffect(m,h);let p;return e[14]!==d?(p={state:d,dispatch:f},e[14]=d,e[15]=p):p=e[15],p}function he(){return[]}function Ce({editor:n,queryKey:e,queryFn:o,onSelect:t}){const{state:s,dispatch:i}=xe(),a=q.useDeferredValue(s.query),{data:r}=ee({queryKey:te.suggestionItems(e,s.open,a),queryFn:()=>s.open?o({query:a}):[]}),d=()=>{i({type:"ON_EXIT"})},f=async(u,m)=>{if(!(s.selectedItem!==null||!s.range)){i({type:"SET_SELECTED_ITEM",payload:u});try{const{view:h}=n,y=h.state.selection.$to.nodeAfter?.text?.startsWith(" "),c=s.range?{...s.range}:{from:0,to:0};y&&s.range&&(c.to+=1),await t({range:c,item:u})===!1?i({type:"SET_SELECTED_ITEM",payload:null}):d()}catch{d()}}},{selectedIndex:g}=pe({editor:n,query:a,items:r,onSelect:f,onClose:d});return{selectedItem:s.selectedItem,items:r,selectedIndex:g,close:d,onSelect:f}}export{ve as S,xe as a,Ce as b,qe as c,Re as e,we as s,be as u};
@@ -1 +1 @@
1
- import{r as l,b2 as ce,j as p,b8 as _,b7 as T,b5 as C,bc as le,b1 as de,bo as ue,bk as fe,bd as me}from"./index-7tyXXYIG.js";import{e as Y}from"./select-DuiQIVh5.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[H,Se,pe]=le(M),[W]=fe(M,[pe]),[he,V]=W(M),q=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:b=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),w=r==="horizontal"?ge:ve,[S=[],K]=ce({prop:h,defaultProp:b,onChange:x=>{[...m.current][f.current]?.focus(),i(x)}}),j=l.useRef(S);function B(x){const y=ye(S,x);I(x,y)}function se(x){I(x,f.current)}function ae(){const x=j.current[f.current];S[f.current]!==x&&d(S)}function I(x,y,{commit:k}={commit:!1}){const U=_e(c),z=Ce(Math.round((x-n)/c)*c+n,U),A=Y(z,[n,s]);K((E=[])=>{const P=xe(E,A,y);if(Ee(P,u*c)){f.current=P.indexOf(A);const F=String(P)!==String(E);return F&&k&&d(P),F?P:E}else return E})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(H.Provider,{scope:e.__scopeSlider,children:p.jsx(H.Slot,{scope:e.__scopeSlider,children:p.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(j.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&I(n,0,{commit:!0}),onEndKeyDown:()=>!a&&I(s,S.length-1,{commit:!0}),onStepKeyDown:({event:x,direction:y})=>{if(!a){const z=$.includes(x.key)||x.shiftKey&&X.includes(x.key)?10:1,A=f.current,E=S[A],P=c*z*y;I(E+P,A,{commit:!0})}}})})})})});q.displayName=M;var[J,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:b,...h}=e,[i,d]=l.useState(null),v=C(t,w=>d(w)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function D(w){const S=R.current||i.getBoundingClientRect(),K=[0,S.width],B=O(K,f?[o,n]:[n,o]);return R.current=S,B(w-S.left)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=D(w.clientX);r?.(S)},onSlideMove:w=>{const S=D(w.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:w=>{const K=G[f?"from-left":"from-right"].includes(w.key);b?.({event:w,direction:K?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...b}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],w=O(f,v?[n,o]:[o,n]);return d.current=m,w(g-m.top)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...b,ref:i,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...b}=e,h=V(M,o);return p.jsx(T.span,{...b,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):$.concat(X).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,b=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...b):0,i=100-Math.max(...b);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(be,{...e,ref:c,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=V(L,o),a=Q(L,o),[u,b]=l.useState(null),h=C(t,D=>b(D)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(H.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var we="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=we;function xe(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function De(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function Ee(e,t){if(t>0){const o=De(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ie=q,Ae=te,Te=ne,Ve=oe;export{Ie as R,Ae as T,Te as a,Ve as b};
1
+ import{r as l,b2 as ce,j as p,b8 as _,b7 as T,b5 as C,bc as le,b1 as de,bo as ue,bk as fe,bd as me}from"./index-LqGJKspm.js";import{e as Y}from"./select-DTLRO2jP.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[H,Se,pe]=le(M),[W]=fe(M,[pe]),[he,V]=W(M),q=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:b=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),w=r==="horizontal"?ge:ve,[S=[],K]=ce({prop:h,defaultProp:b,onChange:x=>{[...m.current][f.current]?.focus(),i(x)}}),j=l.useRef(S);function B(x){const y=ye(S,x);I(x,y)}function se(x){I(x,f.current)}function ae(){const x=j.current[f.current];S[f.current]!==x&&d(S)}function I(x,y,{commit:k}={commit:!1}){const U=_e(c),z=Ce(Math.round((x-n)/c)*c+n,U),A=Y(z,[n,s]);K((E=[])=>{const P=xe(E,A,y);if(Ee(P,u*c)){f.current=P.indexOf(A);const F=String(P)!==String(E);return F&&k&&d(P),F?P:E}else return E})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(H.Provider,{scope:e.__scopeSlider,children:p.jsx(H.Slot,{scope:e.__scopeSlider,children:p.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(j.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&I(n,0,{commit:!0}),onEndKeyDown:()=>!a&&I(s,S.length-1,{commit:!0}),onStepKeyDown:({event:x,direction:y})=>{if(!a){const z=$.includes(x.key)||x.shiftKey&&X.includes(x.key)?10:1,A=f.current,E=S[A],P=c*z*y;I(E+P,A,{commit:!0})}}})})})})});q.displayName=M;var[J,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:b,...h}=e,[i,d]=l.useState(null),v=C(t,w=>d(w)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function D(w){const S=R.current||i.getBoundingClientRect(),K=[0,S.width],B=O(K,f?[o,n]:[n,o]);return R.current=S,B(w-S.left)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=D(w.clientX);r?.(S)},onSlideMove:w=>{const S=D(w.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:w=>{const K=G[f?"from-left":"from-right"].includes(w.key);b?.({event:w,direction:K?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...b}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],w=O(f,v?[n,o]:[o,n]);return d.current=m,w(g-m.top)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...b,ref:i,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...b}=e,h=V(M,o);return p.jsx(T.span,{...b,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):$.concat(X).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,b=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...b):0,i=100-Math.max(...b);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(be,{...e,ref:c,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=V(L,o),a=Q(L,o),[u,b]=l.useState(null),h=C(t,D=>b(D)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(H.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var we="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=we;function xe(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function De(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function Ee(e,t){if(t>0){const o=De(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ie=q,Ae=te,Te=ne,Ve=oe;export{Ie as R,Ae as T,Te as a,Ve as b};
@@ -1 +1 @@
1
- import{c as h,M as j,dE as v,j as p,N as f,a1 as d,G as x}from"./index-7tyXXYIG.js";import{L as E}from"./legacy-main-redirect-hXwWhEx_.js";import"./thread-route-BYUOxJfV.js";const N=x("/shell/$org/org-shell/");function O(){const e=h.c(24),{org:r}=j(),a=N.useSearch(),{main:n,virtualmcpid:o}=a;if(n!==void 0){let t;e[0]!==n||e[1]!==r.slug||e[2]!==a||e[3]!==o?(t=v({org:r.slug,agentId:o,main:n,search:a}),e[0]=n,e[1]=r.slug,e[2]=a,e[3]=o,e[4]=t):t=e[4];const s=t;if(s?.kind==="canonical"){let l;return e[5]!==s?(l=p.jsx(E,{target:s}),e[5]=s,e[6]=l):l=e[6],l}}let u;e[7]!==o?(u=o?.trim()||null,e[7]=o,e[8]=u):u=e[8];const g=u;if(g){let t;e[9]!==r.slug||e[10]!==g?(t={org:r.slug,agentId:g},e[9]=r.slug,e[10]=g,e[11]=t):t=e[11];let s;e[12]!==a?(s={...a,virtualmcpid:void 0},e[12]=a,e[13]=s):s=e[13];let l;return e[14]!==t||e[15]!==s?(l=p.jsx(f,{to:d.projects,params:t,search:s,hash:!0,replace:!0}),e[14]=t,e[15]=s,e[16]=l):l=e[16],l}let i;e[17]!==r.slug?(i={org:r.slug},e[17]=r.slug,e[18]=i):i=e[18];let c;e[19]!==a?(c={...a,virtualmcpid:void 0},e[19]=a,e[20]=c):c=e[20];let m;return e[21]!==i||e[22]!==c?(m=p.jsx(f,{to:d.home,params:i,search:c,hash:!0,replace:!0}),e[21]=i,e[22]=c,e[23]=m):m=e[23],m}export{O as default};
1
+ import{c as h,M as j,dE as v,j as p,N as f,a1 as d,G as x}from"./index-LqGJKspm.js";import{L as E}from"./legacy-main-redirect-Dthqqfia.js";import"./thread-route-D9RjIb92.js";const N=x("/shell/$org/org-shell/");function O(){const e=h.c(24),{org:r}=j(),a=N.useSearch(),{main:n,virtualmcpid:o}=a;if(n!==void 0){let t;e[0]!==n||e[1]!==r.slug||e[2]!==a||e[3]!==o?(t=v({org:r.slug,agentId:o,main:n,search:a}),e[0]=n,e[1]=r.slug,e[2]=a,e[3]=o,e[4]=t):t=e[4];const s=t;if(s?.kind==="canonical"){let l;return e[5]!==s?(l=p.jsx(E,{target:s}),e[5]=s,e[6]=l):l=e[6],l}}let u;e[7]!==o?(u=o?.trim()||null,e[7]=o,e[8]=u):u=e[8];const g=u;if(g){let t;e[9]!==r.slug||e[10]!==g?(t={org:r.slug,agentId:g},e[9]=r.slug,e[10]=g,e[11]=t):t=e[11];let s;e[12]!==a?(s={...a,virtualmcpid:void 0},e[12]=a,e[13]=s):s=e[13];let l;return e[14]!==t||e[15]!==s?(l=p.jsx(f,{to:d.projects,params:t,search:s,hash:!0,replace:!0}),e[14]=t,e[15]=s,e[16]=l):l=e[16],l}let i;e[17]!==r.slug?(i={org:r.slug},e[17]=r.slug,e[18]=i):i=e[18];let c;e[19]!==a?(c={...a,virtualmcpid:void 0},e[19]=a,e[20]=c):c=e[20];let m;return e[21]!==i||e[22]!==c?(m=p.jsx(f,{to:d.home,params:i,search:c,hash:!0,replace:!0}),e[21]=i,e[22]=c,e[23]=m):m=e[23],m}export{O as default};
@@ -1 +1 @@
1
- import{r as s,b1 as L,b2 as B,j as d,ek as q,b7 as x,b5 as E,ei as K,b8 as C,ej as k,da as T,bk as _,bd as U,bo as V}from"./index-7tyXXYIG.js";var I="Radio",[z,w]=_(I),[H,W]=z(I),P=s.forwardRef((t,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:a,value:l="on",onCheck:f,form:R,...v}=t,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:a,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":j(e),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:i,onClick:C(t.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:a,form:R,style:{transform:"translateX(-100%)"}})]})});P.displayName=I;var g="RadioIndicator",G=s.forwardRef((t,c)=>{const{__scopeRadio:o,forceMount:n,...e}=t,r=W(g,o);return d.jsx(T,{present:n||r.checked,children:d.jsx(x.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});G.displayName=g;var X="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:t,control:c,checked:o,bubbles:n=!0,...e},r)=>{const a=s.useRef(null),l=E(a,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=a.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=X;function j(t){return t?"checked":"unchecked"}var Y=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[J]=_(y,[k,w]),A=k(),N=w(),[Q,Z]=J(y),D=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:a=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=t,i=A(o),u=L(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(Q,{scope:o,name:n,required:a,disabled:l,value:b,onValueChange:h,children:d.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":a,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=t,r=Z(M,o),a=r.disabled||n,l=A(o),f=N(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{Y.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(K,{asChild:!0,...l,focusable:!a,active:p,children:d.jsx(P,{disabled:a,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,...n}=t,e=N(o);return d.jsx(G,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,te=F;export{re as I,oe as R,te as a};
1
+ import{r as s,b1 as L,b2 as B,j as d,ek as q,b7 as x,b5 as E,ei as K,b8 as C,ej as k,da as T,bk as _,bd as U,bo as V}from"./index-LqGJKspm.js";var I="Radio",[z,w]=_(I),[H,W]=z(I),P=s.forwardRef((t,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:a,value:l="on",onCheck:f,form:R,...v}=t,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:a,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":j(e),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:i,onClick:C(t.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:a,form:R,style:{transform:"translateX(-100%)"}})]})});P.displayName=I;var g="RadioIndicator",G=s.forwardRef((t,c)=>{const{__scopeRadio:o,forceMount:n,...e}=t,r=W(g,o);return d.jsx(T,{present:n||r.checked,children:d.jsx(x.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});G.displayName=g;var X="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:t,control:c,checked:o,bubbles:n=!0,...e},r)=>{const a=s.useRef(null),l=E(a,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=a.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=X;function j(t){return t?"checked":"unchecked"}var Y=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[J]=_(y,[k,w]),A=k(),N=w(),[Q,Z]=J(y),D=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:a=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=t,i=A(o),u=L(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(Q,{scope:o,name:n,required:a,disabled:l,value:b,onValueChange:h,children:d.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":a,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=t,r=Z(M,o),a=r.disabled||n,l=A(o),f=N(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{Y.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(K,{asChild:!0,...l,focusable:!a,active:p,children:d.jsx(P,{disabled:a,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,...n}=t,e=N(o);return d.jsx(G,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,te=F;export{re as I,oe as R,te as a};
@@ -1,4 +1,4 @@
1
- import{c as oo,r as H,b as rc,ac as Lf,j as D,h as $f,B as rl,ab as il,aa as zf,ad as Bf,d_ as ic,d$ as Ff,aw as Hf,dH as Vt,e0 as Vf,l as sc}from"./index-7tyXXYIG.js";import{d as jf,g as Wf}from"./gateway-client-TD7qk1zJ.js";import{d as Kf,c as Uf,e as _f,b as qf,D as Jf}from"./dialog-mUIvGRq9.js";import{a as Gf,F as Yf,b as Xf,c as Qf,d as Zf,f as eh}from"./form-DQ_IxFJc.js";import{I as th}from"./input-B3Coacmv.js";import{t as sl}from"./utils-CVEq3hMx.js";import{T as nh,a as rh,c as ih}from"./tooltip-NOT5TvpW.js";function sh(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?il().min(1,e):il();return zf(n)}function oh(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function cx(t){const e=oo.c(74),{prompt:n,setPrompt:r,onSubmit:i,defaultValues:s}=t,o=H.useId(),l=rc();let a,c;if(e[0]!==n||e[1]!==l){const ce=sh(n,l("chat.dialogPromptArguments.required"));c=Bf,a=Lf(ce),e[0]=n,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==s||e[5]!==n?(u=n?oh(n,s):{},e[4]=s,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==a||e[8]!==u?(d={resolver:a,defaultValues:u,mode:"onChange"},e[7]=a,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==i||e[14]!==r?(g=async ce=>{await i(ce),r(null),f.reset()},e[12]=f,e[13]=i,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=ce=>{ce||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!n)return null;let S;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(S=n.title||jf(n.name,Wf(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=S):S=e[22];let C;e[23]!==S?(C=D.jsx(Kf,{children:D.jsx("span",{className:"capitalize",children:S})}),e[23]=S,e[24]=C):C=e[24];let v;e[25]!==n.description?(v=n.description&&D.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=v):v=e[26];let R;e[27]!==v||e[28]!==C?(R=D.jsxs(Uf,{children:[C,v]}),e[27]=v,e[28]=C,e[29]=R):R=e[29];let w;e[30]!==f||e[31]!==m?(w=ce=>{ce.stopPropagation(),f.handleSubmit(m)(ce)},e[30]=f,e[31]=m,e[32]=w):w=e[32];let N;if(e[33]!==p||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==l){let ce;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(ce=Yt=>D.jsx(Yf,{control:f.control,name:Yt.name,render:Pf=>{const{field:nl}=Pf;return D.jsxs(Xf,{children:[D.jsxs(Qf,{className:"text-xs",children:[Yt.name,Yt.required?null:D.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),D.jsx(Zf,{children:D.jsx(th,{...nl,value:nl.value??"",required:Yt.required,placeholder:Yt.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),D.jsx(eh,{})]})}},Yt.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=ce):ce=e[41],N=p.map(ce),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=N}else N=e[37];let I;e[42]!==b?(I=()=>b(!1),e[42]=b,e[43]=I):I=e[43];const Z=f.formState.isSubmitting;let le;e[44]!==l?(le=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=le):le=e[45];let ae;e[46]!==f.formState.isSubmitting||e[47]!==I||e[48]!==le?(ae=D.jsx(rl,{type:"button",variant:"ghost",onClick:I,disabled:Z,children:le}),e[46]=f.formState.isSubmitting,e[47]=I,e[48]=le,e[49]=ae):ae=e[49];let V;e[50]!==f.formState.isSubmitting||e[51]!==l?(V=f.formState.isSubmitting?D.jsxs("span",{className:"flex items-center gap-2",children:[D.jsx($f,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=V):V=e[52];let q;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==V?(q=D.jsx(rl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:V}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=V,e[56]=q):q=e[56];let z;e[57]!==ae||e[58]!==q?(z=D.jsxs(_f,{children:[ae,q]}),e[57]=ae,e[58]=q,e[59]=z):z=e[59];let J;e[60]!==o||e[61]!==w||e[62]!==N||e[63]!==z?(J=D.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:w,children:[N,z]}),e[60]=o,e[61]=w,e[62]=N,e[63]=z,e[64]=J):J=e[64];let Oe;e[65]!==f||e[66]!==J?(Oe=D.jsx(Gf,{...f,children:J}),e[65]=f,e[66]=J,e[67]=Oe):Oe=e[67];let he;e[68]!==R||e[69]!==Oe?(he=D.jsxs(qf,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[R,Oe]}),e[68]=R,e[69]=Oe,e[70]=he):he=e[70];let Et;return e[71]!==b||e[72]!==he?(Et=D.jsx(Jf,{open:!0,onOpenChange:b,children:he}),e[71]=b,e[72]=he,e[73]=Et):Et=e[73],Et}var ol=Object.defineProperty,lh=(t,e)=>{let n={};for(var r in t)ol(n,r,{get:t[r],enumerable:!0});return ol(n,Symbol.toStringTag,{value:"Module"}),n};function re(t){this.content=t}re.prototype={constructor:re,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new re(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new re(n)},addToStart:function(t,e){return new re([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new re(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new re(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=re.from(t),t.size?new re(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=re.from(t),t.size?new re(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=re.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};re.from=function(t){if(t instanceof re)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new re(e)};function oc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)n++;return a&&a<o.length&&a<l.length&&cc(o.charCodeAt(a-1))&&ac(o.charCodeAt(a))&&n--,n}if(i.content.size||s.content.size){let o=oc(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function lc(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let c=o.text,u=l.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&cc(c.charCodeAt(d-1))&&ac(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(o.content.size||l.content.size){let c=lc(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}function ac(t){return t>=56320&&t<57344}function cc(t){return t>=55296&&t<56320}class k{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new k(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,n){return e==n?k.empty:e==0&&n==this.content.length?this:new k(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return oc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return lc(this,e,n,r)}findIndex(e){if(e==0)return gr(0,e);if(e==this.size)return gr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?gr(n+1,s):gr(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return k.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new k(n||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Wi={index:0,offset:0};function gr(t,e){return Wi.index=t,Wi.offset=e,Wi}function Lr(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Lr(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Lr(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $=class ks{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Lr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ks.none;if(e instanceof ks)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$.none=[];class Jn extends Error{}class M{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=dc(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,n){return new M(uc(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return M.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(k.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new M(e,r,i)}}M.empty=new M(k.empty,0,0);function uc(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(uc(s.content,e-i-1,n-i-1)))}function dc(t,e,n,r,i,s){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=dc(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function ah(t,e,n){if(n.openStart>t.depth)throw new Jn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Jn("Inconsistent open depths");return fc(t,e,n,0)}function fc(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=fc(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return Pt(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=ch(n,t);return Pt(s,pc(t,o,l,e,r))}else return Pt(s,$r(t,e,r))}function hc(t,e){if(!e.type.compatibleContent(t.type))throw new Jn("Cannot join "+e.type.name+" onto "+t.type.name)}function Ss(t,e,n){let r=t.node(n);return hc(r,e.node(n)),r}function It(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function In(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(It(t.nodeAfter,r),s++));for(let l=s;l<o;l++)It(i.child(l),r);e&&e.depth==n&&e.textOffset&&It(e.nodeBefore,r)}function Pt(t,e){if(!t.type.validContent(e))throw new Jn("Invalid content for node "+t.type.name);return t.copy(e)}function pc(t,e,n,r,i){let s=t.depth>i&&Ss(t,e,i+1),o=r.depth>i&&Ss(n,r,i+1),l=[];return In(null,t,i,l),s&&o&&e.index(i)==n.index(i)?(hc(s,o),It(Pt(s,pc(t,e,n,r,i+1)),l)):(s&&It(Pt(s,$r(t,e,i+1)),l),In(e,n,i,l),o&&It(Pt(o,$r(n,r,i+1)),l)),In(r,null,i,l),new k(l)}function $r(t,e,n){let r=[];if(In(null,t,n,r),t.depth>n){let i=Ss(t,e,n+1);It(Pt(i,$r(t,e,n+1)),r)}return In(e,null,n,r),new k(r)}function ch(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(k.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Gn{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new zr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new Gn(n,r,s)}static resolveCached(e,n){let r=ll.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else ll.set(e,r=new uh);let i=r.elts[r.i]=Gn.resolve(e,n);return r.i=(r.i+1)%dh,i}}class uh{constructor(){this.elts=[],this.i=0}}const dh=12,ll=new WeakMap;class zr{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const fh=Object.create(null);let Lt=class xs{constructor(e,n,r,i=$.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Lr(this.attrs,n||e.defaultAttrs||fh)&&$.sameSet(this.marks,r||$.none)}copy(e=null){return e==this.content?this:new xs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new xs(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return M.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),l=i.start(o),c=i.node(o).content.cut(i.pos-l,s.pos-l);return new M(c,i.depth-o,s.depth-o)}replace(e,n,r){return ah(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Gn.resolveCached(this,e)}resolveNoCache(e){return Gn.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),mc(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=k.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Lt.prototype.text=void 0;class Br extends Lt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Br(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Br(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function mc(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class jt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new hh(e,n);if(r.next==null)return jt.empty;let i=gc(r);r.next&&r.err("Unexpected trailing text");let s=Sh(kh(i));return xh(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
1
+ import{c as oo,r as H,b as rc,ac as Lf,j as D,h as $f,B as rl,ab as il,aa as zf,ad as Bf,d_ as ic,d$ as Ff,aw as Hf,dH as Vt,e0 as Vf,l as sc}from"./index-LqGJKspm.js";import{d as jf,g as Wf}from"./gateway-client-DLNW7KMa.js";import{d as Kf,c as Uf,e as _f,b as qf,D as Jf}from"./dialog-T6SHF6tg.js";import{a as Gf,F as Yf,b as Xf,c as Qf,d as Zf,f as eh}from"./form-DEQzyl-Z.js";import{I as th}from"./input-BmnxcFX-.js";import{t as sl}from"./utils-CVEq3hMx.js";import{T as nh,a as rh,c as ih}from"./tooltip-DsIeYtk8.js";function sh(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?il().min(1,e):il();return zf(n)}function oh(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function cx(t){const e=oo.c(74),{prompt:n,setPrompt:r,onSubmit:i,defaultValues:s}=t,o=H.useId(),l=rc();let a,c;if(e[0]!==n||e[1]!==l){const ce=sh(n,l("chat.dialogPromptArguments.required"));c=Bf,a=Lf(ce),e[0]=n,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==s||e[5]!==n?(u=n?oh(n,s):{},e[4]=s,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==a||e[8]!==u?(d={resolver:a,defaultValues:u,mode:"onChange"},e[7]=a,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==i||e[14]!==r?(g=async ce=>{await i(ce),r(null),f.reset()},e[12]=f,e[13]=i,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=ce=>{ce||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!n)return null;let S;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(S=n.title||jf(n.name,Wf(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=S):S=e[22];let C;e[23]!==S?(C=D.jsx(Kf,{children:D.jsx("span",{className:"capitalize",children:S})}),e[23]=S,e[24]=C):C=e[24];let v;e[25]!==n.description?(v=n.description&&D.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=v):v=e[26];let R;e[27]!==v||e[28]!==C?(R=D.jsxs(Uf,{children:[C,v]}),e[27]=v,e[28]=C,e[29]=R):R=e[29];let w;e[30]!==f||e[31]!==m?(w=ce=>{ce.stopPropagation(),f.handleSubmit(m)(ce)},e[30]=f,e[31]=m,e[32]=w):w=e[32];let N;if(e[33]!==p||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==l){let ce;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(ce=Yt=>D.jsx(Yf,{control:f.control,name:Yt.name,render:Pf=>{const{field:nl}=Pf;return D.jsxs(Xf,{children:[D.jsxs(Qf,{className:"text-xs",children:[Yt.name,Yt.required?null:D.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),D.jsx(Zf,{children:D.jsx(th,{...nl,value:nl.value??"",required:Yt.required,placeholder:Yt.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),D.jsx(eh,{})]})}},Yt.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=ce):ce=e[41],N=p.map(ce),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=N}else N=e[37];let I;e[42]!==b?(I=()=>b(!1),e[42]=b,e[43]=I):I=e[43];const Z=f.formState.isSubmitting;let le;e[44]!==l?(le=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=le):le=e[45];let ae;e[46]!==f.formState.isSubmitting||e[47]!==I||e[48]!==le?(ae=D.jsx(rl,{type:"button",variant:"ghost",onClick:I,disabled:Z,children:le}),e[46]=f.formState.isSubmitting,e[47]=I,e[48]=le,e[49]=ae):ae=e[49];let V;e[50]!==f.formState.isSubmitting||e[51]!==l?(V=f.formState.isSubmitting?D.jsxs("span",{className:"flex items-center gap-2",children:[D.jsx($f,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=V):V=e[52];let q;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==V?(q=D.jsx(rl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:V}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=V,e[56]=q):q=e[56];let z;e[57]!==ae||e[58]!==q?(z=D.jsxs(_f,{children:[ae,q]}),e[57]=ae,e[58]=q,e[59]=z):z=e[59];let J;e[60]!==o||e[61]!==w||e[62]!==N||e[63]!==z?(J=D.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:w,children:[N,z]}),e[60]=o,e[61]=w,e[62]=N,e[63]=z,e[64]=J):J=e[64];let Oe;e[65]!==f||e[66]!==J?(Oe=D.jsx(Gf,{...f,children:J}),e[65]=f,e[66]=J,e[67]=Oe):Oe=e[67];let he;e[68]!==R||e[69]!==Oe?(he=D.jsxs(qf,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[R,Oe]}),e[68]=R,e[69]=Oe,e[70]=he):he=e[70];let Et;return e[71]!==b||e[72]!==he?(Et=D.jsx(Jf,{open:!0,onOpenChange:b,children:he}),e[71]=b,e[72]=he,e[73]=Et):Et=e[73],Et}var ol=Object.defineProperty,lh=(t,e)=>{let n={};for(var r in t)ol(n,r,{get:t[r],enumerable:!0});return ol(n,Symbol.toStringTag,{value:"Module"}),n};function re(t){this.content=t}re.prototype={constructor:re,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new re(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new re(n)},addToStart:function(t,e){return new re([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new re(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new re(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=re.from(t),t.size?new re(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=re.from(t),t.size?new re(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=re.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};re.from=function(t){if(t instanceof re)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new re(e)};function oc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)n++;return a&&a<o.length&&a<l.length&&cc(o.charCodeAt(a-1))&&ac(o.charCodeAt(a))&&n--,n}if(i.content.size||s.content.size){let o=oc(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function lc(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let c=o.text,u=l.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&cc(c.charCodeAt(d-1))&&ac(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(o.content.size||l.content.size){let c=lc(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}function ac(t){return t>=56320&&t<57344}function cc(t){return t>=55296&&t<56320}class k{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new k(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,n){return e==n?k.empty:e==0&&n==this.content.length?this:new k(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return oc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return lc(this,e,n,r)}findIndex(e){if(e==0)return gr(0,e);if(e==this.size)return gr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?gr(n+1,s):gr(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return k.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new k(n||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Wi={index:0,offset:0};function gr(t,e){return Wi.index=t,Wi.offset=e,Wi}function Lr(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Lr(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Lr(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $=class ks{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Lr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ks.none;if(e instanceof ks)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$.none=[];class Jn extends Error{}class M{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=dc(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,n){return new M(uc(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return M.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(k.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new M(e,r,i)}}M.empty=new M(k.empty,0,0);function uc(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(uc(s.content,e-i-1,n-i-1)))}function dc(t,e,n,r,i,s){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=dc(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function ah(t,e,n){if(n.openStart>t.depth)throw new Jn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Jn("Inconsistent open depths");return fc(t,e,n,0)}function fc(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=fc(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return Pt(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=ch(n,t);return Pt(s,pc(t,o,l,e,r))}else return Pt(s,$r(t,e,r))}function hc(t,e){if(!e.type.compatibleContent(t.type))throw new Jn("Cannot join "+e.type.name+" onto "+t.type.name)}function Ss(t,e,n){let r=t.node(n);return hc(r,e.node(n)),r}function It(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function In(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(It(t.nodeAfter,r),s++));for(let l=s;l<o;l++)It(i.child(l),r);e&&e.depth==n&&e.textOffset&&It(e.nodeBefore,r)}function Pt(t,e){if(!t.type.validContent(e))throw new Jn("Invalid content for node "+t.type.name);return t.copy(e)}function pc(t,e,n,r,i){let s=t.depth>i&&Ss(t,e,i+1),o=r.depth>i&&Ss(n,r,i+1),l=[];return In(null,t,i,l),s&&o&&e.index(i)==n.index(i)?(hc(s,o),It(Pt(s,pc(t,e,n,r,i+1)),l)):(s&&It(Pt(s,$r(t,e,i+1)),l),In(e,n,i,l),o&&It(Pt(o,$r(n,r,i+1)),l)),In(r,null,i,l),new k(l)}function $r(t,e,n){let r=[];if(In(null,t,n,r),t.depth>n){let i=Ss(t,e,n+1);It(Pt(i,$r(t,e,n+1)),r)}return In(e,null,n,r),new k(r)}function ch(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(k.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Gn{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new zr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new Gn(n,r,s)}static resolveCached(e,n){let r=ll.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else ll.set(e,r=new uh);let i=r.elts[r.i]=Gn.resolve(e,n);return r.i=(r.i+1)%dh,i}}class uh{constructor(){this.elts=[],this.i=0}}const dh=12,ll=new WeakMap;class zr{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const fh=Object.create(null);let Lt=class xs{constructor(e,n,r,i=$.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Lr(this.attrs,n||e.defaultAttrs||fh)&&$.sameSet(this.marks,r||$.none)}copy(e=null){return e==this.content?this:new xs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new xs(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return M.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),l=i.start(o),c=i.node(o).content.cut(i.pos-l,s.pos-l);return new M(c,i.depth-o,s.depth-o)}replace(e,n,r){return ah(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Gn.resolveCached(this,e)}resolveNoCache(e){return Gn.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),mc(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=k.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Lt.prototype.text=void 0;class Br extends Lt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Br(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Br(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function mc(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class jt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new hh(e,n);if(r.next==null)return jt.empty;let i=gc(r);r.next&&r.err("Unexpected trailing text");let s=Sh(kh(i));return xh(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
2
2
  `)}}jt.empty=new jt(!0);class hh{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function gc(t){let e=[];do e.push(ph(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function ph(t){let e=[];do e.push(mh(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function mh(t){let e=bh(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=gh(t,e);else break;return e}function al(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function gh(t,e){let n=al(t),r=n;return t.eat(",")&&(t.next!="}"?r=al(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function yh(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function bh(t){if(t.eat("(")){let e=gc(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=yh(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function kh(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;i(c,l=n())}else if(o.type=="star"){let a=n();return r(l,a),i(s(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=n();return i(s(o.expr,l),a),i(s(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=n();i(s(o.expr,a),u),a=u}if(o.max==-1)i(s(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=n();r(a,u),i(s(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function yc(t,e){return e-t}function cl(t,e){let n=[];return r(e),n.sort(yc);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:l,to:a}=s[o];!l&&n.indexOf(a)==-1&&r(a)}}}function Sh(t){let e=Object.create(null);return n(cl(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<i.length;u++)i[u][0]==l&&(c=i[u][1]);cl(t,a).forEach(u=>{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new jt(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let l=i[o][1].sort(yc);s.next.push({type:i[o][0],next:e[l.join(",")]||n(l)})}return s}}function xh(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let l=0;l<i.next.length;l++){let{type:a,next:c}=i.next[l];o.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function bc(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function kc(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Sc(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}function xc(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Mh(t,r,e[r]);return n}let ul=class Cc{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=xc(e,r.attrs),this.defaultAttrs=bc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==jt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:kc(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Lt(this,this.computeAttrs(e),k.from(n),$.setFrom(r))}createChecked(e=null,n,r){return n=k.from(n),this.checkContent(n),new Lt(this,this.computeAttrs(e),n,$.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=k.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(k.empty,!0);return s?new Lt(this,e,n.append(s),$.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Sc(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:$.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new Cc(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Ch(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class Mh{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Ch(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class vi{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=xc(e,i.attrs),this.excluded=null;let s=bc(this.attrs);this.instance=s?new $(this,s):null}create(e=null){return!e&&this.instance?this.instance:new $(this,kc(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new vi(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Sc(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Mc{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=re.from(e.nodes),n.marks=re.from(e.marks||{}),this.nodes=ul.compile(this.spec.nodes,this),this.marks=vi.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=jt.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?dl(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:dl(this,o.split(" "))}this.nodeFromJSON=i=>Lt.fromJSON(this,i),this.markFromJSON=i=>$.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ul){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Br(r,r.defaultAttrs,e,$.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function dl(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let l in t.marks){let a=t.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Eh(t){return t.tag!=null}function Th(t){return t.style!=null}class Fe{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Eh(i))this.tags.push(i);else if(Th(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new hl(this,n,!1);return r.addAll(e,$.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new hl(this,n,!0);return r.addAll(e,$.none,n.from,n.to),M.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Ah(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(o.getAttrs){let a=o.getAttrs(n);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=pl(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=pl(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Fe(e,Fe.schemaRules(e)))}}const Ec={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},wh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tc={ol:!0,ul:!0},Yn=1,Cs=2,Pn=4;function fl(t,e,n){return e!=null?(e?Yn:0)|(e==="full"?Cs:0):t&&t.whitespace=="pre"?Yn|Cs:n&~Pn}class yr{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=$.none,this.match=s||(o&Pn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(k.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Yn)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=k.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ec.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class hl{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=fl(null,n.preserveWhitespace,0)|(r?Pn:0);i?s=new yr(i.type,i.attrs,$.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new yr(null,null,$.none,!0,null,o):s=new yr(e.schema.topNodeType,null,$.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&Cs?"full":this.localPreserveWS||(i.options&Yn)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(o.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;Tc.hasOwnProperty(o)&&this.parser.normalizeLists&&vh(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:wh.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Ec.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=a&&a.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(s,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,n.attrs||null,r,n.preserveWhitespace);a&&(s=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,s=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=$.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):ml(l.type,e.type))&&(o=l.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=fl(e,s,o.options);o.options&Pn&&o.content.length==0&&(l|=Pn);let a=$.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):ml(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new yr(e,n,a,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Yn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function vh(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Tc.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Ah(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function pl(t){let e={};for(let n in t)e[n]=t[n];return e}function ml(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class et{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=br(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let l=0,a=0;for(;l<s.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)i=s.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,n);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return br(n).createTextNode(e.text);let{dom:r,contentDOM:i}=Or(br(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Or(br(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:Or(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new et(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=gl(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return gl(e.marks)}}function gl(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function br(t){return t.document||window.document}const yl=new WeakMap;function Nh(t){let e=yl.get(t);return e===void 0&&yl.set(t,e=Oh(t)),e}function Oh(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Or(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=Nh(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let l,a=n?t.createElementNS(n,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(t.createTextNode(f));else{let{dom:h,contentDOM:p}=Or(t,f,n,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const wc=65535,vc=Math.pow(2,16);function Dh(t,e){return t+e*vc}function bl(t){return t&wc}function Rh(t){return(t-(t&wc))/vc}const Ac=1,Nc=2,Dr=4,Oc=8;class Ms{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Oc)>0}get deletedBefore(){return(this.delInfo&(Ac|Dr))>0}get deletedAfter(){return(this.delInfo&(Nc|Dr))>0}get deletedAcross(){return(this.delInfo&Dr)>0}}class xe{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&xe.empty)return xe.empty}recover(e){let n=0,r=bl(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Rh(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let c=this.ranges[l+s],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:n:n,h=a+i+(f<0?0:u);if(r)return h;let p=e==(n<0?a:d)?null:Dh(l/3,e-a),g=e==a?Nc:e==d?Ac:Dr;return(n<0?e!=a:e!=d)&&(g|=Oc),new Ms(h,g,p)}i+=u-c}return r?e+i:new Ms(e+i,0,null)}touches(e,n){let r=0,i=bl(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+s],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),a=o+(this.inverted?0:s),c=this.ranges[i+n],u=this.ranges[i+r];e(l,l+c,a,a+u),s+=u-c}}invert(){return new xe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?xe.empty:new xe(e<0?[0,-e,0]:[0,0,e])}}xe.empty=new xe([]);class Xn{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Xn(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Xn;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],l=o.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new Ms(e,i,null)}}const Ki=Object.create(null);class fe{getMap(){return xe.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ki[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ki)throw new RangeError("Duplicate use of step JSON ID "+e);return Ki[e]=n,n.prototype.jsonID=e,n}}class G{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new G(e,null)}static fail(e){return new G(null,e)}static fromReplace(e,n,r,i){try{return G.ok(e.replace(n,r,i))}catch(s){if(s instanceof Jn)return G.fail(s.message);throw s}}}function lo(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(lo(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return k.fromArray(r)}class dt extends fe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new M(lo(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return G.fromReplace(e,this.from,this.to,s)}invert(){return new Re(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new dt(n.pos,r.pos,this.mark)}merge(e){return e instanceof dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new dt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new dt(n.from,n.to,e.markFromJSON(n.mark))}}fe.jsonID("addMark",dt);class Re extends fe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new M(lo(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return G.fromReplace(e,this.from,this.to,r)}invert(){return new dt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Re(n.pos,r.pos,this.mark)}merge(e){return e instanceof Re&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Re(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Re(n.from,n.to,e.markFromJSON(n.mark))}}fe.jsonID("removeMark",Re);class ft extends fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return G.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return G.fromReplace(e,this.pos,this.pos+1,new M(k.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new ft(this.pos,n.marks[i]);return new ft(this.pos,this.mark)}}return new Wt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ft(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ft(n.pos,e.markFromJSON(n.mark))}}fe.jsonID("addNodeMark",ft);class Wt extends fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return G.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return G.fromReplace(e,this.pos,this.pos+1,new M(k.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ft(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Wt(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Wt(n.pos,e.markFromJSON(n.mark))}}fe.jsonID("removeNodeMark",Wt);class _ extends fe{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Es(e,this.from,this.to)?G.fail("Structure replace would overwrite content"):G.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new xe([this.from,this.to-this.from,this.slice.size])}invert(e){return new _(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&_.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new _(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof _)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?M.empty:new M(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new _(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?M.empty:new M(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new _(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new _(n.from,n.to,M.fromJSON(e,n.slice),!!n.structure)}}_.MAP_BIAS=1;fe.jsonID("replace",_);class te extends fe{constructor(e,n,r,i,s,o,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Es(e,this.from,this.gapFrom)||Es(e,this.gapTo,this.to)))return G.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return G.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?G.fromReplace(e,this.from,this.to,r):G.fail("Content does not fit in gap")}getMap(){return new xe([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new te(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new te(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new te(n.from,n.to,n.gapFrom,n.gapTo,M.fromJSON(e,n.slice),n.insert,!!n.structure)}}fe.jsonID("replaceAround",te);function Es(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Ih(t,e,n,r){let i=[],s=[],o,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:i.push(o=new Re(f,h,d[g])));l&&l.to==f?l.to=h:s.push(l=new dt(f,h,r))}}),i.forEach(a=>t.step(a)),s.forEach(a=>t.step(a))}function Ph(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(r instanceof vi){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,n);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<i.length;h++){let p=i[h];p.step==s-1&&d.eq(i[h].style)&&(f=p)}f?(f.to=c,f.step=s):i.push({style:d,from:Math.max(l,e),to:c,step:s})}}}),i.forEach(o=>t.step(new Re(o.from,o.to,o.style)))}function ao(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<s.childCount;a++){let c=s.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new _(l,u,M.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new Re(l,u,c.marks[f]));if(i&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new M(k.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new _(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);t.replace(l,l,new M(a,0,0))}for(let a=o.length-1;a>=0;a--)t.step(o[a])}function Lh(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Sn(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),l=t.$from.index(r)+i,a=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(l,a,n))return r;if(r==0||o.type.spec.isolating||!Lh(o,l,a))break;l&&(i=1),a<o.childCount&&(s=1)}return null}function $h(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),l=i.after(s+1),a=o,c=l,u=k.empty,d=0;for(let p=s,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=s,g=!1;p>n;p--)g||i.after(p+1)<i.end(p)?(g=!0,f=k.from(i.node(p).copy(f)),h++):c++;t.step(new te(a,c,o,l,new M(u.append(f),d,h),u.size-d,!0))}function co(t,e,n=null,r=t){let i=zh(t,e),s=i&&Bh(r,e);return s?i.map(kl).concat({type:e,attrs:n}).concat(s.map(kl)):null}function kl(t){return{type:t,attrs:null}}function zh(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function Bh(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<i;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:o}function Fh(t,e,n){let r=k.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let l=n[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new te(i,s,i,s,new M(r,0,0),n.length,!0))}function Hh(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,a)&&Vh(t.doc,t.mapping.slice(s).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Rc(t,o,l,s),ao(t,t.mapping.slice(s).map(l,1),r,void 0,c===null);let u=t.mapping.slice(s),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return t.step(new te(d,f,d+1,f-1,new M(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&Dc(t,o,l,s),!1}})}function Dc(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Rc(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
@@ -1 +1 @@
1
- import{c2 as _}from"./index-7tyXXYIG.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
1
+ import{c2 as _}from"./index-LqGJKspm.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
@@ -1 +1 @@
1
- import{c as L,d as V,u as $,I as k,J as K,b as I,l as H,j as s,o as F,r as v,af as W,E as q,av as G,B as U}from"./index-7tyXXYIG.js";import{u as J}from"./use-mobile-7gcXtaOp.js";import{P as C}from"./index-DUTmqJR2.js";import{a as R,R as Y,b as Q}from"./resizable-YVuw9dmI.js";import{a as X}from"./thread-route-BYUOxJfV.js";import{u as Z}from"./use-panel-navigate-BJ__p2tn.js";import{u as ee}from"./use-route-default-main-B5V1SFYB.js";import{b as te}from"./hooks-8z4xHskl.js";import{t as ne,i as ae}from"./MessageCircle01-nOnaif4r.js";import{T as oe,a as se,c as le}from"./tooltip-NOT5TvpW.js";import{p as re,T as ie}from"./toolbar-icon-button-CnZH_a-Q.js";function ce(n){return!!n.harness_id||!!n.title&&n.title!=="New chat"}function ue(n){return n.threadOpen||n.contentOpen?n:{...n,threadOpen:!0}}function de(n){const e=n.entityMetadata?.defaultMainView??null,a=e==null||e.type==="chat",r=n.mainPanelParam??(n.panelNamed||!!n.routeDefaultMain||!a),o=n.routeDefaultMain?!1:a||n.entityMetadata?.chatDefaultOpen===!0||n.threadHasMessages===!0,t=n.threadVisibilityExplicit?n.sidePanelParamValue===!0:o;return ue({threadOpen:t,contentOpen:r})}function z(n,e){switch(n.type){case"toggleThread":return e.threadOpen?e.contentOpen?{sidepanel:!1}:null:{sidepanel:!0};case"toggleContent":return e.contentOpen?{mainpanel:!1,sidepanel:!0}:{mainpanel:!0};case"openThread":return e.threadOpen?null:{sidepanel:!0}}}function he(n){return n.threadOpen&&n.contentOpen?{side:33,main:67}:n.threadOpen?{side:100,main:0}:n.contentOpen?{side:0,main:100}:{side:0,main:0}}function fe(n){const{threadOpen:e,contentOpen:a}=n.visibility;return e&&(n.threadVisibilityExplicit||!a)?"chat":a?"main":"chat"}function Ie(n){return n==="main"?{sidepanel:!1,mainpanel:!0}:{sidepanel:!0,mainpanel:!1}}function Re(n){const e=L.c(26),a=V();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const o=$(r),{threads:t}=te(),c=ee(),i=Z(),l=X();let d;if(e[1]!==n||e[2]!==i||e[3]!==c||e[4]!==o.mainpanel||e[5]!==o.sidepanel||e[6]!==l||e[7]!==t){const g=l!=null?t.find(P=>P.id===l):void 0;d=de({entityMetadata:n,mainPanelParam:o.mainpanel,panelNamed:i!==void 0,threadVisibilityExplicit:o.sidepanel!==void 0,sidePanelParamValue:o.sidepanel,routeDefaultMain:c,threadHasMessages:g?ce(g):!1}),e[1]=n,e[2]=i,e[3]=c,e[4]=o.mainpanel,e[5]=o.sidepanel,e[6]=l,e[7]=t,e[8]=d}else d=e[8];const{threadOpen:u,contentOpen:h}=d;let p;e[9]!==h||e[10]!==u?(p={threadOpen:u,contentOpen:h},e[9]=h,e[10]=u,e[11]=p):p=e[11];const f=p;let y;e[12]!==a?(y=(g,P)=>{a({to:".",search:D=>({...D,...g}),replace:P?.replace??!1})},e[12]=a,e[13]=y):y=e[13];const m=y;let x;e[14]!==m||e[15]!==f?(x=()=>{const g=z({type:"toggleContent"},f);g&&m(g,{replace:!0})},e[14]=m,e[15]=f,e[16]=x):x=e[16];const b=x;let S;e[17]!==m||e[18]!==f?(S=()=>{const g=z({type:"toggleThread"},f);g&&m(g,{replace:!0})},e[17]=m,e[18]=f,e[19]=S):S=e[19];const j=S,T=o.sidepanel!==void 0;let O;return e[20]!==h||e[21]!==T||e[22]!==u||e[23]!==b||e[24]!==j?(O={threadOpen:u,contentOpen:h,threadVisibilityExplicit:T,toggleContent:b,toggleThread:j},e[20]=h,e[21]=T,e[22]=u,e[23]=b,e[24]=j,e[25]=O):O=e[25],O}function E(n,e){const a=typeof n=="number"?n:Number(n);return!Number.isFinite(a)||a<=0||a>=100?e:a}function pe(n,e){const a=L.c(8);let r;a[0]!==e?(r=l=>E(l,e),a[0]=e,a[1]=r):r=a[1];const[o,t]=k(n,r);let c;a[2]!==e||a[3]!==o?(c=E(o,e),a[2]=e,a[3]=o,a[4]=c):c=a[4];let i;return a[5]!==t||a[6]!==c?(i=[c,t],a[5]=t,a[6]=c,a[7]=i):i=a[7],i}const me=33;function ge(){const n=L.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=K.sidePanelWidth(),n[0]=e):e=n[0],pe(e,me)}function B(n){const e=L.c(25),{side:a,open:r,disabled:o,onToggle:t}=n,c=I();let i;e[0]!==r||e[1]!==a||e[2]!==c?(i=c(r?a==="left"?"agentShellLayout.toggleButtons.hideChat":"agentShellLayout.toggleButtons.hidePanel":a==="left"?"agentShellLayout.toggleButtons.showChat":"agentShellLayout.toggleButtons.showPanel"),e[0]=r,e[1]=a,e[2]=c,e[3]=i):i=e[3];const l=i;let d;e[4]!==t||e[5]!==r||e[6]!==a?(d=()=>{F("agent_toolbar_toggled",{button:a==="left"?"chat":"main",next_state:r?"closed":"open"}),t()},e[4]=t,e[5]=r,e[6]=a,e[7]=d):d=e[7];const u=d;if(a==="left"){let m,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=H("flex h-10 md:h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-sm disabled:opacity-40",re()),x=s.jsx(ne,{size:16}),e[8]=m,e[9]=x):(m=e[8],x=e[9]);let b;return e[10]!==o||e[11]!==l||e[12]!==u||e[13]!==m?(b=s.jsxs("button",{type:"button",disabled:o,onClick:u,className:m,children:[x,l]}),e[10]=o,e[11]=l,e[12]=u,e[13]=m,e[14]=b):b=e[14],b}let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ae,{size:16}),e[15]=h):h=e[15];let p;e[16]!==o||e[17]!==l||e[18]!==u?(p=s.jsx(oe,{asChild:!0,children:s.jsx(ie,{"aria-label":l,disabled:o,onClick:u,className:"size-7 rounded-md disabled:opacity-40",children:h})}),e[16]=o,e[17]=l,e[18]=u,e[19]=p):p=e[19];let f;e[20]!==l?(f=s.jsx(se,{side:"bottom",children:l}),e[20]=l,e[21]=f):f=e[21];let y;return e[22]!==p||e[23]!==f?(y=s.jsxs(le,{children:[p,f]}),e[22]=p,e[23]=f,e[24]=y):y=e[24],y}const N="chat-layout-thread",_="chat-layout-content",A=v.createContext(null);function be(){return M()}function M(){const n=v.use(A);if(!n)throw new Error("ChatLayout regions require a ChatLayout");return n}function ye(n){const e=L.c(16),{children:a,...r}=n,o=J(),t=v.useRef(null),[c,i]=ge(),{threadOpen:l,contentOpen:d}=r,u=he(r),h=l&&d?c:u.side,p=100-h,f=j=>{const T=j.getLayout(),O=T[N],g=T[_];typeof O!="number"||typeof g!="number"||Math.abs(O-h)<.001&&Math.abs(g-p)<.001||j.setLayout({[N]:h,[_]:p})},y=fe({visibility:r,threadVisibilityExplicit:r.threadVisibilityExplicit});let m;e[0]!==o||e[1]!==r||e[2]!==y?(m={...r,isMobile:o,mobileSurface:y},e[0]=o,e[1]=r,e[2]=y,e[3]=m):m=e[3];const x=m;let b;e[4]!==a||e[5]!==d||e[6]!==p||e[7]!==o||e[8]!==i||e[9]!==f||e[10]!==l||e[11]!==h?(b=o?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(Y,{ref:j=>{if(t.current=j,!j)return;let T=!0;return queueMicrotask(()=>{T&&f(j)}),()=>{T=!1,t.current===j&&(t.current=null)}},defaultLayout:{[N]:h,[_]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(j,T)=>{const{isUserInteraction:O}=T;if(!O){const P=t.current;P&&f(P);return}const g=j[N];l&&d&&typeof g=="number"&&g>0&&g<100&&i(g)},children:a}),e[4]=a,e[5]=d,e[6]=p,e[7]=o,e[8]=i,e[9]=f,e[10]=l,e[11]=h,e[12]=b):b=e[12];let S;return e[13]!==b||e[14]!==x?(S=s.jsx(A,{value:x,children:b}),e[13]=b,e[14]=x,e[15]=S):S=e[15],S}function xe(n){const e=L.c(15),{children:a,topbar:r}=n,o=M();if(o.isMobile){let h;return e[0]!==a||e[1]!==o.mobileSurface?(h=o.mobileSurface==="chat"?s.jsx(C,{variant:"plain","data-slot":"chat-layout-thread",children:s.jsx(C.Content,{"data-testid":"chat-panel",children:a})}):null,e[0]=a,e[1]=o.mobileSurface,e[2]=h):h=e[2],h}const t=o.threadOpen?"":void 0;let c;e[3]!==a||e[4]!==o.threadOpen||e[5]!==r?(c=o.threadOpen&&s.jsxs(s.Fragment,{children:[r,s.jsx(C.Content,{"data-testid":"chat-panel",children:a})]}),e[3]=a,e[4]=o.threadOpen,e[5]=r,e[6]=c):c=e[6];let i;e[7]!==c?(i=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(C,{"data-testid":"side-panel",children:c})}),e[7]=c,e[8]=i):i=e[8];let l;e[9]!==t||e[10]!==i?(l=s.jsx(R,{id:N,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":t,className:"min-w-0 overflow-hidden bg-sidebar",children:i}),e[9]=t,e[10]=i,e[11]=l):l=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Q,{className:"bg-sidebar"}),e[12]=d):d=e[12];let u;return e[13]!==l?(u=s.jsxs(s.Fragment,{children:[l,d]}),e[13]=l,e[14]=u):u=e[14],u}function je({children:n,routeId:e}){return n}function w(n){const e=L.c(26),{children:a,actions:r,drawer:o}=n,t=M();if(t.isMobile&&t.mobileSurface!=="main")return null;const c=t.isMobile?"plain":"card";let i;e[0]!==r||e[1]!==t.contentActions||e[2]!==t.contentNavigation||e[3]!==t.contentOpen||e[4]!==t.isMobile||e[5]!==t.threadOpen||e[6]!==t.toggleContent||e[7]!==t.toggleThread?(i=!t.isMobile&&t.contentOpen&&s.jsxs(C.Topbar,{children:[s.jsxs(C.Topbar.Left,{className:"gap-0.5",children:[s.jsx(B,{side:"left",open:t.threadOpen,onToggle:t.toggleThread}),t.contentNavigation,s.jsx(C.Topbar.Left.Target,{})]}),s.jsx(C.Topbar.Center,{children:s.jsx("div",{className:"flex min-w-0 items-center @max-sm/panel-header:hidden",children:s.jsx(C.Topbar.Center.Target,{})})}),s.jsxs(C.Topbar.Right,{children:[s.jsx(C.Topbar.Right.Target,{}),t.contentActions,r,s.jsx(B,{side:"right",open:t.contentOpen,onToggle:t.toggleContent})]})]}),e[0]=r,e[1]=t.contentActions,e[2]=t.contentNavigation,e[3]=t.contentOpen,e[4]=t.isMobile,e[5]=t.threadOpen,e[6]=t.toggleContent,e[7]=t.toggleThread,e[8]=i):i=e[8];let l;e[9]!==a||e[10]!==t.contentKey?(l=s.jsx(W,{children:s.jsx(je,{routeId:t.contentKey,children:a})}),e[9]=a,e[10]=t.contentKey,e[11]=l):l=e[11];let d;e[12]!==t.contentKey||e[13]!==l?(d=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(q,{children:l},t.contentKey)}),e[12]=t.contentKey,e[13]=l,e[14]=d):d=e[14];let u;e[15]!==o||e[16]!==d?(u=s.jsxs(C.Content,{children:[d,o]}),e[15]=o,e[16]=d,e[17]=u):u=e[17];let h;e[18]!==c||e[19]!==i||e[20]!==u?(h=s.jsxs(C,{"data-testid":"main-panel",variant:c,children:[i,u]}),e[18]=c,e[19]=i,e[20]=u,e[21]=h):h=e[21];const p=h;let f;return e[22]!==t.contentOpen||e[23]!==t.isMobile||e[24]!==p?(f=t.isMobile?p:s.jsx(R,{id:_,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":t.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsx("div",{className:"h-full min-h-0 p-0.5",children:p})}),e[22]=t.contentOpen,e[23]=t.isMobile,e[24]=p,e[25]=f):f=e[25],f}function Ce(){const n=L.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(w,{children:s.jsx(G,{})}),n[0]=e):e=n[0],e}function Te(n){const e=L.c(18),{error:a,reset:r}=n,o=I();let t;e[0]!==o?(t=o("common.errorBoundary.somethingWentWrong"),e[0]=o,e[1]=t):t=e[1];let c;e[2]!==t?(c=s.jsx("h2",{className:"text-lg font-medium",children:t}),e[2]=t,e[3]=c):c=e[3];let i;e[4]!==a.message||e[5]!==o?(i=a.message||o("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=o,e[6]=i):i=e[6];let l;e[7]!==i?(l=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=l):l=e[8];let d;e[9]!==o?(d=o("common.errorBoundary.tryAgain"),e[9]=o,e[10]=d):d=e[10];let u;e[11]!==r||e[12]!==d?(u=s.jsx(U,{variant:"outline",onClick:r,children:d}),e[11]=r,e[12]=d,e[13]=u):u=e[13];let h;return e[14]!==c||e[15]!==l||e[16]!==u?(h=s.jsx(w,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[c,l,u]})}),e[14]=c,e[15]=l,e[16]=u,e[17]=h):h=e[17],h}const Se=Object.assign(ye,{Thread:xe,Content:w}),Ae=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:Se,ChatLayoutError:Te,ChatLayoutPending:Ce,useChatLayout:be},Symbol.toStringTag,{value:"Module"}));export{Se as C,B as P,be as a,Ae as i,Ie as m,ce as t,Re as u};
1
+ import{c as L,d as V,u as $,I as k,J as K,b as I,l as H,j as s,o as F,r as v,af as W,E as q,av as G,B as U}from"./index-LqGJKspm.js";import{u as J}from"./use-mobile-Dqp4Jkm6.js";import{P as C}from"./index-DTtAckpN.js";import{a as R,R as Y,b as Q}from"./resizable-DdiAoyYr.js";import{a as X}from"./thread-route-D9RjIb92.js";import{u as Z}from"./use-panel-navigate-CPCeDjnd.js";import{u as ee}from"./use-route-default-main-TI35rK7_.js";import{b as te}from"./hooks-Cow3V6T6.js";import{t as ne,i as ae}from"./MessageCircle01-BIIEDxFs.js";import{T as oe,a as se,c as le}from"./tooltip-DsIeYtk8.js";import{p as re,T as ie}from"./toolbar-icon-button-CQM6O44g.js";function ce(n){return!!n.harness_id||!!n.title&&n.title!=="New chat"}function ue(n){return n.threadOpen||n.contentOpen?n:{...n,threadOpen:!0}}function de(n){const e=n.entityMetadata?.defaultMainView??null,a=e==null||e.type==="chat",r=n.mainPanelParam??(n.panelNamed||!!n.routeDefaultMain||!a),o=n.routeDefaultMain?!1:a||n.entityMetadata?.chatDefaultOpen===!0||n.threadHasMessages===!0,t=n.threadVisibilityExplicit?n.sidePanelParamValue===!0:o;return ue({threadOpen:t,contentOpen:r})}function z(n,e){switch(n.type){case"toggleThread":return e.threadOpen?e.contentOpen?{sidepanel:!1}:null:{sidepanel:!0};case"toggleContent":return e.contentOpen?{mainpanel:!1,sidepanel:!0}:{mainpanel:!0};case"openThread":return e.threadOpen?null:{sidepanel:!0}}}function he(n){return n.threadOpen&&n.contentOpen?{side:33,main:67}:n.threadOpen?{side:100,main:0}:n.contentOpen?{side:0,main:100}:{side:0,main:0}}function fe(n){const{threadOpen:e,contentOpen:a}=n.visibility;return e&&(n.threadVisibilityExplicit||!a)?"chat":a?"main":"chat"}function Ie(n){return n==="main"?{sidepanel:!1,mainpanel:!0}:{sidepanel:!0,mainpanel:!1}}function Re(n){const e=L.c(26),a=V();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const o=$(r),{threads:t}=te(),c=ee(),i=Z(),l=X();let d;if(e[1]!==n||e[2]!==i||e[3]!==c||e[4]!==o.mainpanel||e[5]!==o.sidepanel||e[6]!==l||e[7]!==t){const g=l!=null?t.find(P=>P.id===l):void 0;d=de({entityMetadata:n,mainPanelParam:o.mainpanel,panelNamed:i!==void 0,threadVisibilityExplicit:o.sidepanel!==void 0,sidePanelParamValue:o.sidepanel,routeDefaultMain:c,threadHasMessages:g?ce(g):!1}),e[1]=n,e[2]=i,e[3]=c,e[4]=o.mainpanel,e[5]=o.sidepanel,e[6]=l,e[7]=t,e[8]=d}else d=e[8];const{threadOpen:u,contentOpen:h}=d;let p;e[9]!==h||e[10]!==u?(p={threadOpen:u,contentOpen:h},e[9]=h,e[10]=u,e[11]=p):p=e[11];const f=p;let y;e[12]!==a?(y=(g,P)=>{a({to:".",search:D=>({...D,...g}),replace:P?.replace??!1})},e[12]=a,e[13]=y):y=e[13];const m=y;let x;e[14]!==m||e[15]!==f?(x=()=>{const g=z({type:"toggleContent"},f);g&&m(g,{replace:!0})},e[14]=m,e[15]=f,e[16]=x):x=e[16];const b=x;let S;e[17]!==m||e[18]!==f?(S=()=>{const g=z({type:"toggleThread"},f);g&&m(g,{replace:!0})},e[17]=m,e[18]=f,e[19]=S):S=e[19];const j=S,T=o.sidepanel!==void 0;let O;return e[20]!==h||e[21]!==T||e[22]!==u||e[23]!==b||e[24]!==j?(O={threadOpen:u,contentOpen:h,threadVisibilityExplicit:T,toggleContent:b,toggleThread:j},e[20]=h,e[21]=T,e[22]=u,e[23]=b,e[24]=j,e[25]=O):O=e[25],O}function E(n,e){const a=typeof n=="number"?n:Number(n);return!Number.isFinite(a)||a<=0||a>=100?e:a}function pe(n,e){const a=L.c(8);let r;a[0]!==e?(r=l=>E(l,e),a[0]=e,a[1]=r):r=a[1];const[o,t]=k(n,r);let c;a[2]!==e||a[3]!==o?(c=E(o,e),a[2]=e,a[3]=o,a[4]=c):c=a[4];let i;return a[5]!==t||a[6]!==c?(i=[c,t],a[5]=t,a[6]=c,a[7]=i):i=a[7],i}const me=33;function ge(){const n=L.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=K.sidePanelWidth(),n[0]=e):e=n[0],pe(e,me)}function B(n){const e=L.c(25),{side:a,open:r,disabled:o,onToggle:t}=n,c=I();let i;e[0]!==r||e[1]!==a||e[2]!==c?(i=c(r?a==="left"?"agentShellLayout.toggleButtons.hideChat":"agentShellLayout.toggleButtons.hidePanel":a==="left"?"agentShellLayout.toggleButtons.showChat":"agentShellLayout.toggleButtons.showPanel"),e[0]=r,e[1]=a,e[2]=c,e[3]=i):i=e[3];const l=i;let d;e[4]!==t||e[5]!==r||e[6]!==a?(d=()=>{F("agent_toolbar_toggled",{button:a==="left"?"chat":"main",next_state:r?"closed":"open"}),t()},e[4]=t,e[5]=r,e[6]=a,e[7]=d):d=e[7];const u=d;if(a==="left"){let m,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=H("flex h-10 md:h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-sm disabled:opacity-40",re()),x=s.jsx(ne,{size:16}),e[8]=m,e[9]=x):(m=e[8],x=e[9]);let b;return e[10]!==o||e[11]!==l||e[12]!==u||e[13]!==m?(b=s.jsxs("button",{type:"button",disabled:o,onClick:u,className:m,children:[x,l]}),e[10]=o,e[11]=l,e[12]=u,e[13]=m,e[14]=b):b=e[14],b}let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ae,{size:16}),e[15]=h):h=e[15];let p;e[16]!==o||e[17]!==l||e[18]!==u?(p=s.jsx(oe,{asChild:!0,children:s.jsx(ie,{"aria-label":l,disabled:o,onClick:u,className:"size-7 rounded-md disabled:opacity-40",children:h})}),e[16]=o,e[17]=l,e[18]=u,e[19]=p):p=e[19];let f;e[20]!==l?(f=s.jsx(se,{side:"bottom",children:l}),e[20]=l,e[21]=f):f=e[21];let y;return e[22]!==p||e[23]!==f?(y=s.jsxs(le,{children:[p,f]}),e[22]=p,e[23]=f,e[24]=y):y=e[24],y}const N="chat-layout-thread",_="chat-layout-content",A=v.createContext(null);function be(){return M()}function M(){const n=v.use(A);if(!n)throw new Error("ChatLayout regions require a ChatLayout");return n}function ye(n){const e=L.c(16),{children:a,...r}=n,o=J(),t=v.useRef(null),[c,i]=ge(),{threadOpen:l,contentOpen:d}=r,u=he(r),h=l&&d?c:u.side,p=100-h,f=j=>{const T=j.getLayout(),O=T[N],g=T[_];typeof O!="number"||typeof g!="number"||Math.abs(O-h)<.001&&Math.abs(g-p)<.001||j.setLayout({[N]:h,[_]:p})},y=fe({visibility:r,threadVisibilityExplicit:r.threadVisibilityExplicit});let m;e[0]!==o||e[1]!==r||e[2]!==y?(m={...r,isMobile:o,mobileSurface:y},e[0]=o,e[1]=r,e[2]=y,e[3]=m):m=e[3];const x=m;let b;e[4]!==a||e[5]!==d||e[6]!==p||e[7]!==o||e[8]!==i||e[9]!==f||e[10]!==l||e[11]!==h?(b=o?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(Y,{ref:j=>{if(t.current=j,!j)return;let T=!0;return queueMicrotask(()=>{T&&f(j)}),()=>{T=!1,t.current===j&&(t.current=null)}},defaultLayout:{[N]:h,[_]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(j,T)=>{const{isUserInteraction:O}=T;if(!O){const P=t.current;P&&f(P);return}const g=j[N];l&&d&&typeof g=="number"&&g>0&&g<100&&i(g)},children:a}),e[4]=a,e[5]=d,e[6]=p,e[7]=o,e[8]=i,e[9]=f,e[10]=l,e[11]=h,e[12]=b):b=e[12];let S;return e[13]!==b||e[14]!==x?(S=s.jsx(A,{value:x,children:b}),e[13]=b,e[14]=x,e[15]=S):S=e[15],S}function xe(n){const e=L.c(15),{children:a,topbar:r}=n,o=M();if(o.isMobile){let h;return e[0]!==a||e[1]!==o.mobileSurface?(h=o.mobileSurface==="chat"?s.jsx(C,{variant:"plain","data-slot":"chat-layout-thread",children:s.jsx(C.Content,{"data-testid":"chat-panel",children:a})}):null,e[0]=a,e[1]=o.mobileSurface,e[2]=h):h=e[2],h}const t=o.threadOpen?"":void 0;let c;e[3]!==a||e[4]!==o.threadOpen||e[5]!==r?(c=o.threadOpen&&s.jsxs(s.Fragment,{children:[r,s.jsx(C.Content,{"data-testid":"chat-panel",children:a})]}),e[3]=a,e[4]=o.threadOpen,e[5]=r,e[6]=c):c=e[6];let i;e[7]!==c?(i=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(C,{"data-testid":"side-panel",children:c})}),e[7]=c,e[8]=i):i=e[8];let l;e[9]!==t||e[10]!==i?(l=s.jsx(R,{id:N,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":t,className:"min-w-0 overflow-hidden bg-sidebar",children:i}),e[9]=t,e[10]=i,e[11]=l):l=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Q,{className:"bg-sidebar"}),e[12]=d):d=e[12];let u;return e[13]!==l?(u=s.jsxs(s.Fragment,{children:[l,d]}),e[13]=l,e[14]=u):u=e[14],u}function je({children:n,routeId:e}){return n}function w(n){const e=L.c(26),{children:a,actions:r,drawer:o}=n,t=M();if(t.isMobile&&t.mobileSurface!=="main")return null;const c=t.isMobile?"plain":"card";let i;e[0]!==r||e[1]!==t.contentActions||e[2]!==t.contentNavigation||e[3]!==t.contentOpen||e[4]!==t.isMobile||e[5]!==t.threadOpen||e[6]!==t.toggleContent||e[7]!==t.toggleThread?(i=!t.isMobile&&t.contentOpen&&s.jsxs(C.Topbar,{children:[s.jsxs(C.Topbar.Left,{className:"gap-0.5",children:[s.jsx(B,{side:"left",open:t.threadOpen,onToggle:t.toggleThread}),t.contentNavigation,s.jsx(C.Topbar.Left.Target,{})]}),s.jsx(C.Topbar.Center,{children:s.jsx("div",{className:"flex min-w-0 items-center @max-sm/panel-header:hidden",children:s.jsx(C.Topbar.Center.Target,{})})}),s.jsxs(C.Topbar.Right,{children:[s.jsx(C.Topbar.Right.Target,{}),t.contentActions,r,s.jsx(B,{side:"right",open:t.contentOpen,onToggle:t.toggleContent})]})]}),e[0]=r,e[1]=t.contentActions,e[2]=t.contentNavigation,e[3]=t.contentOpen,e[4]=t.isMobile,e[5]=t.threadOpen,e[6]=t.toggleContent,e[7]=t.toggleThread,e[8]=i):i=e[8];let l;e[9]!==a||e[10]!==t.contentKey?(l=s.jsx(W,{children:s.jsx(je,{routeId:t.contentKey,children:a})}),e[9]=a,e[10]=t.contentKey,e[11]=l):l=e[11];let d;e[12]!==t.contentKey||e[13]!==l?(d=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(q,{children:l},t.contentKey)}),e[12]=t.contentKey,e[13]=l,e[14]=d):d=e[14];let u;e[15]!==o||e[16]!==d?(u=s.jsxs(C.Content,{children:[d,o]}),e[15]=o,e[16]=d,e[17]=u):u=e[17];let h;e[18]!==c||e[19]!==i||e[20]!==u?(h=s.jsxs(C,{"data-testid":"main-panel",variant:c,children:[i,u]}),e[18]=c,e[19]=i,e[20]=u,e[21]=h):h=e[21];const p=h;let f;return e[22]!==t.contentOpen||e[23]!==t.isMobile||e[24]!==p?(f=t.isMobile?p:s.jsx(R,{id:_,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":t.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsx("div",{className:"h-full min-h-0 p-0.5",children:p})}),e[22]=t.contentOpen,e[23]=t.isMobile,e[24]=p,e[25]=f):f=e[25],f}function Ce(){const n=L.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(w,{children:s.jsx(G,{})}),n[0]=e):e=n[0],e}function Te(n){const e=L.c(18),{error:a,reset:r}=n,o=I();let t;e[0]!==o?(t=o("common.errorBoundary.somethingWentWrong"),e[0]=o,e[1]=t):t=e[1];let c;e[2]!==t?(c=s.jsx("h2",{className:"text-lg font-medium",children:t}),e[2]=t,e[3]=c):c=e[3];let i;e[4]!==a.message||e[5]!==o?(i=a.message||o("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=o,e[6]=i):i=e[6];let l;e[7]!==i?(l=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=l):l=e[8];let d;e[9]!==o?(d=o("common.errorBoundary.tryAgain"),e[9]=o,e[10]=d):d=e[10];let u;e[11]!==r||e[12]!==d?(u=s.jsx(U,{variant:"outline",onClick:r,children:d}),e[11]=r,e[12]=d,e[13]=u):u=e[13];let h;return e[14]!==c||e[15]!==l||e[16]!==u?(h=s.jsx(w,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[c,l,u]})}),e[14]=c,e[15]=l,e[16]=u,e[17]=h):h=e[17],h}const Se=Object.assign(ye,{Thread:xe,Content:w}),Ae=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:Se,ChatLayoutError:Te,ChatLayoutPending:Ce,useChatLayout:be},Symbol.toStringTag,{value:"Module"}));export{Se as C,B as P,be as a,Ae as i,Ie as m,ce as t,Re as u};
@@ -1 +1 @@
1
- import{c as s,j as r}from"./index-7tyXXYIG.js";import{D as n,b as c}from"./decopilot-DcY6tZci.js";function d(l){const e=s.c(2),{onClose:o}=l;let t;return e[0]!==o?(t=r.jsx(c,{onClose:o}),e[0]=o,e[1]=t):t=e[1],t}function p(l){const e=s.c(4);let o;e[0]!==l?({...o}=l,e[0]=l,e[1]=o):o=e[1];let t;return e[2]!==o?(t=r.jsx(n,{...o}),e[2]=o,e[3]=t):t=e[3],t}export{p as M,d as a};
1
+ import{c as s,j as r}from"./index-LqGJKspm.js";import{D as n,b as c}from"./decopilot-BZgK_WKj.js";function d(l){const e=s.c(2),{onClose:o}=l;let t;return e[0]!==o?(t=r.jsx(c,{onClose:o}),e[0]=o,e[1]=t):t=e[1],t}function p(l){const e=s.c(4);let o;e[0]!==l?({...o}=l,e[0]=l,e[1]=o):o=e[1];let t;return e[2]!==o?(t=r.jsx(n,{...o}),e[2]=o,e[3]=t):t=e[3],t}export{p as M,d as a};
@@ -1 +1 @@
1
- import{r as n,b4 as q,cN as R,aW as Ee,aZ as ke,a_ as Se,ae as xe,cO as j}from"./index-7tyXXYIG.js";var de=1,Ie=.9,Ce=.8,Re=.17,Z=.1,Q=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Q,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Q,I.length))):(h*=Re,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Z>h&&(h=x*Z)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:N=!1,vimBindings:A=!0,...O}=t,U=q(),ne=q(),W=q(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),T(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(W);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),H=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),T(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:W,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?We(s,V):He(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:H.inputId,id:H.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:H},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;N(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function N(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:U,forceMount:ne,keywords:W,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:N,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ne=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Ne,Loading:Ue});function We(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function He(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
1
+ import{r as n,b4 as q,cN as R,aW as Ee,aZ as ke,a_ as Se,ae as xe,cO as j}from"./index-LqGJKspm.js";var de=1,Ie=.9,Ce=.8,Re=.17,Z=.1,Q=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Q,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Q,I.length))):(h*=Re,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Z>h&&(h=x*Z)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:N=!1,vimBindings:A=!0,...O}=t,U=q(),ne=q(),W=q(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),T(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(W);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),H=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),T(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:W,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?We(s,V):He(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:H.inputId,id:H.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:H},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;N(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function N(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:U,forceMount:ne,keywords:W,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:N,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ne=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Ne,Loading:Ue});function We(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function He(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};