@decocms/mesh 2.71.0 → 2.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/client/assets/{AlertCircle-B2r4RYCl.js → AlertCircle-CHm1uTvc.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-DL3E-1B5.js → ArrowUp-CsvTcSKO.js} +1 -1
  3. package/dist/client/assets/{Calendar-BJyFA5MR.js → Calendar-RaRlGUMn.js} +1 -1
  4. package/dist/client/assets/{Check-VEx1ONnd.js → Check-CTaDpFbx.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-hgwi-82I.js → CheckCircle-BUL08lD-.js} +1 -1
  6. package/dist/client/assets/{CheckDone01-DIhXP9ft.js → CheckDone01-C9iBTpWu.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-B9Mxx2fi.js → ChevronDown-BmbIYWgz.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-in3TmXpP.js → ChevronRight-C7PRdwhN.js} +1 -1
  9. package/dist/client/assets/{Code01-QyeCluYo.js → Code01-BHb1dfFm.js} +1 -1
  10. package/dist/client/assets/{Copy01-JjoULgm7.js → Copy01-BHrubS15.js} +1 -1
  11. package/dist/client/assets/{DotsHorizontal-CO7zK7Nc.js → DotsHorizontal-BKEGXeRq.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DjjH7_Y2.js → DotsVertical-6bV4Jb02.js} +1 -1
  13. package/dist/client/assets/{Download01-CiJpDnb8.js → Download01-DCCcXkST.js} +1 -1
  14. package/dist/client/assets/{Edit01-DUGutI3c.js → Edit01-Ck6L4sn5.js} +1 -1
  15. package/dist/client/assets/{File02-DLP0uk3c.js → File02-Bdk2SiT1.js} +1 -1
  16. package/dist/client/assets/{File06-DCxDcy-i.js → File06-g3-IRgq5.js} +1 -1
  17. package/dist/client/assets/{FilterLines-Cc5F0HuO.js → FilterLines-CZJIfYWV.js} +1 -1
  18. package/dist/client/assets/{Globe02-BWyDEbcv.js → Globe02-nY9R9qg_.js} +1 -1
  19. package/dist/client/assets/{Grid01-DQKfO4pL.js → Grid01-CzUkHZSJ.js} +1 -1
  20. package/dist/client/assets/{Home02-DwMa7Dxn.js → Home02-D9mVq7KP.js} +1 -1
  21. package/dist/client/assets/{Image01-CURk6BcD.js → Image01-C213KIPf.js} +1 -1
  22. package/dist/client/assets/{Inbox01-BzO-o9k3.js → Inbox01-CXr_wpYC.js} +1 -1
  23. package/dist/client/assets/{InfoCircle-CwNQC8tM.js → InfoCircle-DEUMb_Ke.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-Css-DquB.js → LinkExternal01-CmQ2HPM6.js} +1 -1
  25. package/dist/client/assets/{List-CavdzHis.js → List-hntTIiNx.js} +1 -1
  26. package/dist/client/assets/{Loading01-CM7djb9Q.js → Loading01-B78uc8_j.js} +1 -1
  27. package/dist/client/assets/{Lock01-B6ThbWMN.js → Lock01-rY0GklCm.js} +1 -1
  28. package/dist/client/assets/{Pin01-D3bkVyHA.js → Pin01-B6bFgA7L.js} +1 -1
  29. package/dist/client/assets/{Play-BoQgM5dI.js → Play-CMxteKat.js} +1 -1
  30. package/dist/client/assets/{Plus-BhKqidCj.js → Plus-B1DSIk_Y.js} +1 -1
  31. package/dist/client/assets/{SearchMd-DZNqxRa2.js → SearchMd-rxhL9uWW.js} +1 -1
  32. package/dist/client/assets/{Settings01-P-PH04Nm.js → Settings01-BBpmfPia.js} +1 -1
  33. package/dist/client/assets/{Share07-BUD3TbCH.js → Share07-DNr4Gv0F.js} +1 -1
  34. package/dist/client/assets/{Terminal-CI6nX2Ah.js → Terminal-CvqFIFfF.js} +1 -1
  35. package/dist/client/assets/{Tool01-CMlMVnUR.js → Tool01-BWEJZQCA.js} +1 -1
  36. package/dist/client/assets/{Trash01-SLyaMDks.js → Trash01-CNJdNb2Z.js} +1 -1
  37. package/dist/client/assets/{Upload01-D7JbiLex.js → Upload01-CtypJgSZ.js} +1 -1
  38. package/dist/client/assets/{Users03-Chku9Yx2.js → Users03-B_SbeQBk.js} +1 -1
  39. package/dist/client/assets/{X-2IB63Q0x.js → X-mZzFkOTX.js} +1 -1
  40. package/dist/client/assets/{XClose-DSG07tz8.js → XClose-BwAC8sFB.js} +1 -1
  41. package/dist/client/assets/{agent-connections-preview-d9Roi18q.js → agent-connections-preview-DieWCUjN.js} +1 -1
  42. package/dist/client/assets/agent-detail-CViIjBwu.js +1 -0
  43. package/dist/client/assets/{agents-DdS_0nX9.js → agents-CyHP3pcb.js} +1 -1
  44. package/dist/client/assets/{alert-dialog-BmBtcfYg.js → alert-dialog-BN06wH-l.js} +1 -1
  45. package/dist/client/assets/{auth-catchall-DxqNbjWx.js → auth-catchall-DXrXBOXl.js} +1 -1
  46. package/dist/client/assets/{avatar-ydfTe0xi.js → avatar-2G5ouaDu.js} +1 -1
  47. package/dist/client/assets/{badge-B4Hap73o.js → badge-tOUVTd9z.js} +1 -1
  48. package/dist/client/assets/{binder-BMOA5_jw.js → binder-CbgCr5Rm.js} +1 -1
  49. package/dist/client/assets/{breadcrumb-CfCt3BHC.js → breadcrumb-JfdGMaRd.js} +1 -1
  50. package/dist/client/assets/{button-CIJQcfm2.js → button-BKtq_PYU.js} +1 -1
  51. package/dist/client/assets/{card-v4WZxiU8.js → card-C0u1Pmkw.js} +1 -1
  52. package/dist/client/assets/{checkbox-C09bNjVn.js → checkbox-DmCTNQLX.js} +1 -1
  53. package/dist/client/assets/{circle-alert-DuIKlbT4.js → circle-alert-BNmG-8Wh.js} +1 -1
  54. package/dist/client/assets/{collection-detail-C72vEJV3.js → collection-detail-CGH1Knd0.js} +3 -3
  55. package/dist/client/assets/{collection-search-BhGdJARf.js → collection-search-MQc1JOFA.js} +1 -1
  56. package/dist/client/assets/{collection-tab-D7lvZwh_.js → collection-tab-qHWWI3bH.js} +1 -1
  57. package/dist/client/assets/{collection-table-wrapper-BXL-ZhOo.js → collection-table-wrapper-L4Z0dyO1.js} +1 -1
  58. package/dist/client/assets/{collection-tabs-mdXwReEh.js → collection-tabs-CyRXUdkR.js} +1 -1
  59. package/dist/client/assets/{command-CwW6gorP.js → command-Bqwb_7NQ.js} +1 -1
  60. package/dist/client/assets/{connect-BW6N8ux-.js → connect-D30M34Bx.js} +1 -1
  61. package/dist/client/assets/{connection-card-DNYtrXwy.js → connection-card-CMQL70VR.js} +1 -1
  62. package/dist/client/assets/connection-detail-CQNN_rRv.js +1 -0
  63. package/dist/client/assets/{connections-CUhitW1a.js → connections-B7K4OdQw.js} +1 -1
  64. package/dist/client/assets/constants-DIAAKB_c.js +1 -0
  65. package/dist/client/assets/{constants-BQDDq09c.js → constants-PBHJ4h9F.js} +1 -1
  66. package/dist/client/assets/{create-organization-dialog-BIoGwH68.js → create-organization-dialog-BOgbyqMq.js} +1 -1
  67. package/dist/client/assets/{create-project-dialog-CfrpB8Yx.js → create-project-dialog-BxxiVX3V.js} +1 -1
  68. package/dist/client/assets/{dialog-Dn-qFsZM.js → dialog-B8Jtq_Yp.js} +1 -1
  69. package/dist/client/assets/{dropdown-menu-CFkIMuHp.js → dropdown-menu-C6Z4raJE.js} +1 -1
  70. package/dist/client/assets/{dynamic-plugin-layout-zcSRj9Fz.js → dynamic-plugin-layout-CDgkhjuC.js} +1 -1
  71. package/dist/client/assets/{empty-state-Bu5U3yVT.js → empty-state-B8XrD0Ub.js} +1 -1
  72. package/dist/client/assets/{empty-state-DfPGxaKS.js → empty-state-BXisfxVt.js} +1 -1
  73. package/dist/client/assets/{env-vars-editor-C889wc3R.js → env-vars-editor-8a4L674b.js} +1 -1
  74. package/dist/client/assets/{error-boundary-DRPYIYcG.js → error-boundary-D9qG4zZt.js} +1 -1
  75. package/dist/client/assets/{extract-connection-data-5ZTgwgJP.js → extract-connection-data-CCyj_Y1X.js} +1 -1
  76. package/dist/client/assets/{file-browser-CXMrgCnS.js → file-browser-DInIgvl2.js} +2 -2
  77. package/dist/client/assets/{form-CfZFG_36.js → form-DQap4sDh.js} +1 -1
  78. package/dist/client/assets/{grid-view-Chlr-V3g.js → grid-view-BKnSWUuB.js} +1 -1
  79. package/dist/client/assets/{home-CpZLe8AA.js → home-DvvANWHB.js} +1 -1
  80. package/dist/client/assets/{index-C4bOwCDG.js → index--tmJoUux.js} +6 -6
  81. package/dist/client/assets/{index-9tcRb7FE.js → index-BMXxQz0A.js} +1 -1
  82. package/dist/client/assets/index-C76QOf8q.js +1 -0
  83. package/dist/client/assets/{index-D5tmQFLM.js → index-CCcWAtA_.js} +27 -27
  84. package/dist/client/assets/{index-C6nYoI1C.css → index-CP_rYaE5.css} +1 -1
  85. package/dist/client/assets/{index-C9OcAHbi.js → index-D12lWWsR.js} +1 -1
  86. package/dist/client/assets/index-D5w8F0R7.js +1 -0
  87. package/dist/client/assets/{index-DtXqymrr.js → index-DFZdUy6e.js} +1 -1
  88. package/dist/client/assets/{index-BN26Duct.js → index-UwBLOz8J.js} +1 -1
  89. package/dist/client/assets/index-sFvIWgLs.js +1 -0
  90. package/dist/client/assets/{infiniteQueryObserver-CraWSqSX.js → infiniteQueryObserver-BdhSYRBe.js} +1 -1
  91. package/dist/client/assets/{input-BPn8NjNN.js → input-Dh6Cjukb.js} +1 -1
  92. package/dist/client/assets/{integration-icon-W7oxbRNq.js → integration-icon-Biu6JpM0.js} +1 -1
  93. package/dist/client/assets/{layout-BJr5Ak4k.js → layout-DWXfRazY.js} +1 -1
  94. package/dist/client/assets/{localstorage-keys-D5oAXPM1.js → localstorage-keys-BWsOCDUX.js} +1 -1
  95. package/dist/client/assets/{login-D4OqmnB6.js → login-DoPkmmdP.js} +1 -1
  96. package/dist/client/assets/{mcp-oauth-CNM1XpIG.js → mcp-oauth-BQMyy4a5.js} +1 -1
  97. package/dist/client/assets/{mcp-server-card-DesKazdH.js → mcp-server-card-DxnHyWDy.js} +1 -1
  98. package/dist/client/assets/{mcp-server-detail-Ys0ijxeQ.js → mcp-server-detail-BzBDrjZ5.js} +2 -2
  99. package/dist/client/assets/members-pjR_l8r-.js +3 -0
  100. package/dist/client/assets/{monaco-editor-CXE6czoW.js → monaco-editor-XyXN2SEV.js} +1 -1
  101. package/dist/client/assets/{monitoring-dsK6d0ku.js → monitoring-BiXkhP0l.js} +1 -1
  102. package/dist/client/assets/{oauth-callback-Cm1jfTrr.js → oauth-callback-COK_3Woz.js} +1 -1
  103. package/dist/client/assets/{page-Csuu4Y_T.js → page-Ca4TsO7U.js} +1 -1
  104. package/dist/client/assets/page-zhioOXqc.js +1 -0
  105. package/dist/client/assets/{plugin-empty-state-DGmTq0Hq.js → plugin-empty-state-BWDzgwMT.js} +1 -1
  106. package/dist/client/assets/{plugin-header-DS1bXx8D.js → plugin-header-Dm-T5OvY.js} +1 -1
  107. package/dist/client/assets/{popover-BnV2Ekkf.js → popover-Bn1QrYWJ.js} +1 -1
  108. package/dist/client/assets/{project-layout-DTHugbyC.js → project-layout-DQQxPJ7M.js} +1 -1
  109. package/dist/client/assets/{project-settings-UiQng0xL.js → project-settings-Bq572DKS.js} +1 -1
  110. package/dist/client/assets/{projects-list-B5fuxwCT.js → projects-list-D2y67tOl.js} +1 -1
  111. package/dist/client/assets/{registry-utils-DRiNpsKU.js → registry-utils-eTnhYK1Z.js} +1 -1
  112. package/dist/client/assets/{resizable-SZr0q_hI.js → resizable-Cth4qfOJ.js} +1 -1
  113. package/dist/client/assets/{select-iLE4SSQV.js → select-CJ01X7RE.js} +1 -1
  114. package/dist/client/assets/{shell-layout-Dvp4ZClm.js → shell-layout-Dmklwlc_.js} +2 -2
  115. package/dist/client/assets/{spinner-RsSCOmvl.js → spinner-CoIaSc2j.js} +1 -1
  116. package/dist/client/assets/{store-invite-DfN36OHe.js → store-invite-CM-bUgIj.js} +1 -1
  117. package/dist/client/assets/{switch-CZLIUnPD.js → switch-TZYuSAHJ.js} +1 -1
  118. package/dist/client/assets/{table-r40t1ij6.js → table-B7Ue2bk2.js} +1 -1
  119. package/dist/client/assets/{tasks-CnTQLuu3.js → tasks-DvdoE4Ok.js} +1 -1
  120. package/dist/client/assets/{textarea-CCeQpN_N.js → textarea-D6y1LKj_.js} +1 -1
  121. package/dist/client/assets/{tools-list-C3NaEQdF.js → tools-list-fxJEZlSp.js} +1 -1
  122. package/dist/client/assets/{typewriter-title-DESUJewE.js → typewriter-title-DR6tdNBL.js} +1 -1
  123. package/dist/client/assets/{use-binding-DMMSXp8M.js → use-binding-ucSDtQ56.js} +1 -1
  124. package/dist/client/assets/{use-connection-BSXprdTB.js → use-connection-BCPygOxC.js} +1 -1
  125. package/dist/client/assets/{use-create-virtual-mcp-Ca9rNRBg.js → use-create-virtual-mcp-u-AAtHmy.js} +1 -1
  126. package/dist/client/assets/use-deco-chat-open-DsNk3kZu.js +23 -0
  127. package/dist/client/assets/{use-install-from-registry-Bo257Imu.js → use-install-from-registry-f8JxKFFW.js} +1 -1
  128. package/dist/client/assets/{use-list-state-oI5CPziH.js → use-list-state-oNgAMbdK.js} +1 -1
  129. package/dist/client/assets/use-llm-Lxpo1ior.js +1 -0
  130. package/dist/client/assets/{use-mcp-prompts-IDdNIVsz.js → use-mcp-prompts-WwyO9-Nk.js} +1 -1
  131. package/dist/client/assets/{use-mcp-tools-1PW8j013.js → use-mcp-tools-eSLltC3i.js} +1 -1
  132. package/dist/client/assets/{use-mobile-Bji8rN8h.js → use-mobile-BUK8Wer1.js} +1 -1
  133. package/dist/client/assets/{use-organization-settings-DGMFFXzb.js → use-organization-settings-BR3GSp3x.js} +1 -1
  134. package/dist/client/assets/{use-project-Cs5eD30p.js → use-project-DLsFLh3O.js} +1 -1
  135. package/dist/client/assets/{use-virtual-mcp-CK08RGTF.js → use-virtual-mcp-ByfXJ3SB.js} +1 -1
  136. package/dist/client/assets/useInfiniteQuery-BcqgMbS1.js +1 -0
  137. package/dist/client/assets/{useMutation-CapnNHWF.js → useMutation-Cn2d2ilG.js} +1 -1
  138. package/dist/client/assets/useQuery-Dp4Sp9Q1.js +1 -0
  139. package/dist/client/assets/utils-CnoQZeDK.js +1 -0
  140. package/dist/client/assets/{view-mode-toggle-CoDook_S.js → view-mode-toggle-BJkt6e92.js} +1 -1
  141. package/dist/client/assets/{workflow-DDUMG-O3.js → workflow-BP45xRRH.js} +1 -1
  142. package/dist/client/index.html +2 -2
  143. package/dist/server/cli.js +167 -167
  144. package/dist/server/migrate.js +106 -106
  145. package/dist/server/server.js +146 -146
  146. package/package.json +1 -1
  147. package/dist/client/assets/agent-detail-DJwQyYDX.js +0 -1
  148. package/dist/client/assets/connection-detail-LtP9Y3ux.js +0 -1
  149. package/dist/client/assets/constants-CaS5DRuf.js +0 -1
  150. package/dist/client/assets/index-Bq-YlXEQ.js +0 -1
  151. package/dist/client/assets/index-C4-4zqx1.js +0 -1
  152. package/dist/client/assets/index-N9GUWdsk.js +0 -1
  153. package/dist/client/assets/members-Dg6HqXRE.js +0 -3
  154. package/dist/client/assets/page-BHnHevI-.js +0 -1
  155. package/dist/client/assets/use-deco-chat-open-C4c4LN3K.js +0 -23
  156. package/dist/client/assets/useInfiniteQuery-23ZWmdg7.js +0 -1
  157. package/dist/client/assets/useQuery-C7wGFtkw.js +0 -1
  158. package/dist/client/assets/utils-63Yxgxyo.js +0 -1
@@ -1 +1 @@
1
- import{b4 as _}from"./index-D5tmQFLM.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{b5 as _}from"./index-CCcWAtA_.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};
@@ -0,0 +1 @@
1
+ import{c as o,r as u,j as c}from"./index-CCcWAtA_.js";import{c as a}from"./utils-CnoQZeDK.js";function x(n,e){const s=u.Children.toArray(n);for(const l of s)if(u.isValidElement(l)&&l.type===e)return l;return null}function p(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex flex-col h-full bg-background overflow-hidden",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function b(n){const e=o.c(10),{children:s,className:l}=n;let t;e[0]!==s?(t=x(s,h),e[0]=s,e[1]=t):t=e[1];const r=t;let f;e[2]!==s?(f=x(s,g),e[2]=s,e[3]=f):f=e[3];const m=f;let i;e[4]!==l?(i=a("shrink-0 w-full border-b border-border h-12 overflow-x-auto","flex items-center justify-between gap-3 px-4 min-w-max",l),e[4]=l,e[5]=i):i=e[5];let d;return e[6]!==r||e[7]!==m||e[8]!==i?(d=c.jsxs("div",{className:i,children:[r,m]}),e[6]=r,e[7]=m,e[8]=i,e[9]=d):d=e[9],d}function h(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex items-center gap-2 flex-shrink-0 overflow-hidden",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function g(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex items-center gap-2 flex-shrink-0 overflow-hidden border-l border-border pl-3",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function j(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex-1 overflow-auto",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const w=Object.assign(p,{Header:Object.assign(b,{Left:h,Right:g}),Content:j});export{w as P};
@@ -1 +1 @@
1
- import{C as n,L as r,O as l,P as u,V as C,i as c,p as P,u as p}from"./index-D5tmQFLM.js";import{E as m,b as d,a as L,c as g,u as T,d as x,e as y,f as S,g as E,h as b}from"./use-connection-BSXprdTB.js";import{S as e}from"./constants-BQDDq09c.js";import{K as h,a as O,W as R,c as K,g as _,b as A,d as I,e as W,f as V,h as w,i as D,u as Q,j}from"./constants-BQDDq09c.js";import{u as G,a as N,b as Y,c as k,d as v}from"./use-mcp-tools-1PW8j013.js";import{g as F,l as H,a as J,r as q,u as z,b as X,c as Z,d as $}from"./use-mcp-prompts-IDdNIVsz.js";import{u as es,a as os,b as ts}from"./use-virtual-mcp-CK08RGTF.js";import{a as is,h as ns,i as rs}from"./mcp-oauth-CNM1XpIG.js";import"./useMutation-CapnNHWF.js";import"./useQuery-C7wGFtkw.js";export{n as ConnectionEntitySchema,m as EMPTY_COLLECTION_LIST_RESULT,h as KEYS,r as Locator,l as ORG_ADMIN_PROJECT_SLUG,u as ProjectContextProvider,O as SELF_MCP_ALIAS_ID,e as StreamableHTTPClientTransport,C as VirtualMCPEntitySchema,R as WellKnownOrgMCPId,is as authenticateMcp,d as buildCollectionQueryKey,L as buildOrderByExpression,g as buildWhereExpression,K as createMCPClient,_ as getDecopilotId,F as getPrompt,A as getWellKnownCommunityRegistryConnection,I as getWellKnownDecopilotVirtualMCP,W as getWellKnownMcpStudioConnection,V as getWellKnownOpenRouterConnection,w as getWellKnownRegistryConnection,ns as handleOAuthCallback,rs as isConnectionAuthenticated,D as isDecopilot,c as isStdioParameters,H as listPrompts,J as listResources,P as parseVirtualUrl,q as readResource,T as useCollectionActions,x as useCollectionItem,y as useCollectionList,S as useConnection,E as useConnectionActions,b as useConnections,Q as useMCPClient,j as useMCPClientOptional,z as useMCPPromptsList,X as useMCPPromptsListQuery,Z as useMCPResourcesList,$ as useMCPResourcesListQuery,G as useMCPToolCall,N as useMCPToolCallMutation,Y as useMCPToolCallQuery,k as useMCPToolsList,v as useMCPToolsListQuery,p as useProjectContext,es as useVirtualMCP,os as useVirtualMCPActions,ts as useVirtualMCPs};
1
+ import{C as n,L as r,O as l,P as u,V as C,i as c,p as P,u as p}from"./index-CCcWAtA_.js";import{E as m,b as d,a as L,c as g,u as T,d as x,e as y,f as S,g as E,h as b}from"./use-connection-BCPygOxC.js";import{S as e}from"./constants-PBHJ4h9F.js";import{K as h,a as O,W as R,c as K,g as _,b as A,d as I,e as W,f as V,h as w,i as D,u as Q,j}from"./constants-PBHJ4h9F.js";import{u as G,a as N,b as Y,c as k,d as v}from"./use-mcp-tools-eSLltC3i.js";import{g as F,l as H,a as J,r as q,u as z,b as X,c as Z,d as $}from"./use-mcp-prompts-WwyO9-Nk.js";import{u as es,a as os,b as ts}from"./use-virtual-mcp-ByfXJ3SB.js";import{a as is,h as ns,i as rs}from"./mcp-oauth-BQMyy4a5.js";import"./useMutation-Cn2d2ilG.js";import"./useQuery-Dp4Sp9Q1.js";export{n as ConnectionEntitySchema,m as EMPTY_COLLECTION_LIST_RESULT,h as KEYS,r as Locator,l as ORG_ADMIN_PROJECT_SLUG,u as ProjectContextProvider,O as SELF_MCP_ALIAS_ID,e as StreamableHTTPClientTransport,C as VirtualMCPEntitySchema,R as WellKnownOrgMCPId,is as authenticateMcp,d as buildCollectionQueryKey,L as buildOrderByExpression,g as buildWhereExpression,K as createMCPClient,_ as getDecopilotId,F as getPrompt,A as getWellKnownCommunityRegistryConnection,I as getWellKnownDecopilotVirtualMCP,W as getWellKnownMcpStudioConnection,V as getWellKnownOpenRouterConnection,w as getWellKnownRegistryConnection,ns as handleOAuthCallback,rs as isConnectionAuthenticated,D as isDecopilot,c as isStdioParameters,H as listPrompts,J as listResources,P as parseVirtualUrl,q as readResource,T as useCollectionActions,x as useCollectionItem,y as useCollectionList,S as useConnection,E as useConnectionActions,b as useConnections,Q as useMCPClient,j as useMCPClientOptional,z as useMCPPromptsList,X as useMCPPromptsListQuery,Z as useMCPResourcesList,$ as useMCPResourcesListQuery,G as useMCPToolCall,N as useMCPToolCallMutation,Y as useMCPToolCallQuery,k as useMCPToolsList,v as useMCPToolsListQuery,p as useProjectContext,es as useVirtualMCP,os as useVirtualMCPActions,ts as useVirtualMCPs};
@@ -1,4 +1,4 @@
1
- import{r as U,c as ae,o as Nx,h as Cw,k as _w,j as T,s as Nb,Z as Ix,c0 as wx,bZ as Nw,bu as At,c1 as Iw,u as ci,t as _n,c2 as ww,aX as Rx,c3 as Rw,c4 as dn,c5 as il,c6 as Ow,c7 as al,c8 as Lw,c9 as Dw,ca as Mw,cb as Pw,q as Fw,K as qm,cc as Bw,cd as Uw,ce as Hw,cf as $w,v as Ox,m as Lx,O as as,b4 as jm,bY as Es,g as zw}from"./index-D5tmQFLM.js";import{c as pe}from"./utils-63Yxgxyo.js";import{i as qw}from"./X-2IB63Q0x.js";import{u as ka,S as Ib,a as jw,i as Gw,m as Dx,M as Vw,c as Ww,g as Yw,C as Kw,t as Mx,b as Xw,h as Zw}from"./use-deco-chat-open-C4c4LN3K.js";import{b as di,P as pi,a as fi}from"./popover-BnV2Ekkf.js";import{S as So}from"./spinner-RsSCOmvl.js";import{b as wn,T as Rn,a as On,c as Ao,I as Gm}from"./integration-icon-W7oxbRNq.js";import{d as Px,u as Vm,i as Qr,f as Qw}from"./constants-BQDDq09c.js";import{u as Jw,g as Fx,l as wb,a as Rb,r as eR}from"./use-mcp-prompts-IDdNIVsz.js";import{E as tR,i as nR}from"./error-boundary-DRPYIYcG.js";import{B as et}from"./button-CIJQcfm2.js";import{c as rR,b as iR,e as aR,a as sR,D as oR}from"./dialog-Dn-qFsZM.js";import{a as lR,F as uR,b as cR,c as dR,d as pR,f as fR}from"./form-CfZFG_36.js";import{I as Bx}from"./input-BPn8NjNN.js";import{i as Ux}from"./AlertCircle-B2r4RYCl.js";import{i as hR}from"./ArrowUp-DL3E-1B5.js";import{t as Hh}from"./ChevronDown-B9Mxx2fi.js";import{i as mR}from"./Edit01-DUGutI3c.js";import{t as ia}from"./Users03-Chku9Yx2.js";import{i as Hx}from"./ChevronRight-in3TmXpP.js";import{i as xa}from"./Check-VEx1ONnd.js";import{a as Wm}from"./Copy01-JjoULgm7.js";import{i as gR}from"./Terminal-CI6nX2Ah.js";import{M as $x,s as Ob}from"./monaco-editor-CXE6czoW.js";import{u as bR,L as ER}from"./localstorage-keys-D5oAXPM1.js";import{E as yR}from"./empty-state-Bu5U3yVT.js";import{g as TR,h as SR}from"./use-connection-BSXprdTB.js";import{g as AR}from"./generate-id-Dyweu44Y.js";import{i as zx}from"./SearchMd-DZNqxRa2.js";import{s as kR}from"./Trash01-SLyaMDks.js";import{B as xR}from"./badge-B4Hap73o.js";import{i as vR}from"./Code01-QyeCluYo.js";import{b as CR}from"./use-virtual-mcp-CK08RGTF.js";import{u as _R}from"./use-create-virtual-mcp-Ca9rNRBg.js";const qx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));qx.displayName="Atom02";const jx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"m21.152 10.9-9.015 9.015a5.25 5.25 0 0 1-7.425-7.425l9.016-9.015a3.5 3.5 0 1 1 4.95 4.95l-8.662 8.662a1.75 1.75 0 1 1-2.475-2.475l7.601-7.602"}));jx.displayName="Attachment01";const Gx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));Gx.displayName="Coins01";const Vx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));Vx.displayName="Lightbulb01";const Wx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));Wx.displayName="Stop";const Yx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));Yx.displayName="Target04";const Kx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Kx.displayName="XCircle";function NR(t){const e={};for(const n of t.arguments??[])e[n.name]=n.required?Nb().min(1,"Required"):Nb();return Nx(e)}function IR(t){const e={};for(const n of t.arguments??[])e[n.name]="";return e}function Xx(t){const e=ae.c(64),{prompt:n,setPrompt:r,onSubmit:i}=t,a=U.useId();let s;if(e[0]!==n){const H=n?NR(n):Nx({});s=Cw(H),e[0]=n,e[1]=s}else s=e[1];const l=s;let u;e[2]!==n?(u=n?IR(n):{},e[2]=n,e[3]=u):u=e[3];let c;e[4]!==l||e[5]!==u?(c={resolver:l,defaultValues:u,mode:"onChange"},e[4]=l,e[5]=u,e[6]=c):c=e[6];const d=_w(c);let f;e[7]!==n?.arguments?(f=n?.arguments??[],e[7]=n?.arguments,e[8]=f):f=e[8];const p=f;let h;e[9]!==d||e[10]!==i||e[11]!==r?(h=async H=>{await i(H),r(null),d.reset()},e[9]=d,e[10]=i,e[11]=r,e[12]=h):h=e[12];const g=h;let b;e[13]!==d||e[14]!==r?(b=H=>{H||(d.reset(),r(null))},e[13]=d,e[14]=r,e[15]=b):b=e[15];const E=b;if(!n)return null;let y;e[16]!==n.name||e[17]!==n.title?(y=n.title||n.name.replace(/_/g," "),e[16]=n.name,e[17]=n.title,e[18]=y):y=e[18];let S;e[19]!==y?(S=T.jsx(rR,{children:y}),e[19]=y,e[20]=S):S=e[20];let k;e[21]!==n.description?(k=n.description&&T.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[21]=n.description,e[22]=k):k=e[22];let x;e[23]!==k||e[24]!==S?(x=T.jsxs(iR,{children:[S,k]}),e[23]=k,e[24]=S,e[25]=x):x=e[25];let A;e[26]!==d||e[27]!==g?(A=H=>{H.stopPropagation(),d.handleSubmit(g)(H)},e[26]=d,e[27]=g,e[28]=A):A=e[28];let v;if(e[29]!==p||e[30]!==d.control||e[31]!==d.formState.isSubmitting){let H;e[33]!==d.control||e[34]!==d.formState.isSubmitting?(H=J=>T.jsx(uR,{control:d.control,name:J.name,render:I=>{const{field:X}=I;return T.jsxs(cR,{children:[T.jsxs(dR,{className:"text-xs",children:[J.name,J.required?null:T.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),T.jsx(pR,{children:T.jsx(Bx,{...X,value:X.value??"",required:J.required,placeholder:J.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),T.jsx(fR,{})]})}},J.name),e[33]=d.control,e[34]=d.formState.isSubmitting,e[35]=H):H=e[35],v=p.map(H),e[29]=p,e[30]=d.control,e[31]=d.formState.isSubmitting,e[32]=v}else v=e[32];let w;e[36]!==E?(w=()=>E(!1),e[36]=E,e[37]=w):w=e[37];let N;e[38]!==d.formState.isSubmitting||e[39]!==w?(N=T.jsx(et,{type:"button",variant:"ghost",onClick:w,disabled:d.formState.isSubmitting,children:"Cancel"}),e[38]=d.formState.isSubmitting,e[39]=w,e[40]=N):N=e[40];const _=!d.formState.isValid||d.formState.isSubmitting;let D;e[41]!==d.formState.isSubmitting?(D=d.formState.isSubmitting?T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsx(So,{size:"xs"}),"Loading..."]}):"Use prompt",e[41]=d.formState.isSubmitting,e[42]=D):D=e[42];let M;e[43]!==a||e[44]!==_||e[45]!==D?(M=T.jsx(et,{type:"submit",form:a,disabled:_,children:D}),e[43]=a,e[44]=_,e[45]=D,e[46]=M):M=e[46];let q;e[47]!==N||e[48]!==M?(q=T.jsxs(aR,{children:[N,M]}),e[47]=N,e[48]=M,e[49]=q):q=e[49];let P;e[50]!==a||e[51]!==A||e[52]!==v||e[53]!==q?(P=T.jsxs("form",{id:a,className:"space-y-4 py-4",autoComplete:"off",onSubmit:A,children:[v,q]}),e[50]=a,e[51]=A,e[52]=v,e[53]=q,e[54]=P):P=e[54];let F;e[55]!==d||e[56]!==P?(F=T.jsx(lR,{...d,children:P}),e[55]=d,e[56]=P,e[57]=F):F=e[57];let $;e[58]!==x||e[59]!==F?($=T.jsxs(sR,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[x,F]}),e[58]=x,e[59]=F,e[60]=$):$=e[60];let G;return e[61]!==E||e[62]!==$?(G=T.jsx(oR,{open:!0,onOpenChange:E,children:$}),e[61]=E,e[62]=$,e[63]=G):G=e[63],G}function at(t){this.content=t}at.prototype={constructor:at,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),a=r.content.slice();return i==-1?a.push(n||t,e):(a[i+1]=e,n&&(a[i]=n)),new at(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new at(n)},addToStart:function(t,e){return new at([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new at(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),a=r.find(t);return i.splice(a==-1?i.length:a,0,e,n),new at(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=at.from(t),t.size?new at(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=at.from(t),t.size?new at(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=at.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}};at.from=function(t){if(t instanceof at)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new at(e)};function Zx(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),a=e.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let s=0;i.text[s]==a.text[s];s++)n++;return n}if(i.content.size||a.content.size){let s=Zx(i.content,a.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Qx(t,e,n,r){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let s=t.child(--i),o=e.child(--a),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let u=0,c=Math.min(s.text.length,o.text.length);for(;u<c&&s.text[s.text.length-u-1]==o.text[o.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let u=Qx(s.content,o.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class W{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,a){for(let s=0,o=0;o<n;s++){let l=this.content[s],u=o+l.nodeSize;if(u>e&&r(l,i+o,a||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}o=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let a="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let u=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&r&&(s?s=!1:a+=r),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new W(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 a=0,s=0;s<n;a++){let o=this.content[a],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),i+=o.nodeSize),s=l}return new W(r,i)}cutByIndex(e,n){return e==n?W.empty:e==0&&n==this.content.length?this:new W(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new W(i,a)}addToStart(e){return new W([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new W(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 Zx(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Qx(this,e,n,r)}findIndex(e){if(e==0)return Fa(0,e);if(e==this.size)return Fa(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),a=r+i.nodeSize;if(a>=e)return a==e?Fa(n+1,a):Fa(n,r);r=a}}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 W.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new W(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return W.empty;let n,r=0;for(let i=0;i<e.length;i++){let a=e[i];r+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(n||(n=e.slice(0,i)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new W(n||e,r)}static from(e){if(!e)return W.empty;if(e instanceof W)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new W([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}W.empty=new W([],0);const sl={index:0,offset:0};function Fa(t,e){return sl.index=t,sl.offset=e,sl}function ys(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(!ys(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ys(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let _e=class $h{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))n||(n=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!r&&a.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(a)}}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&&ys(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 $h.none;if(e instanceof $h)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};_e.none=[];class Ts extends Error{}class ee{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=ev(this.content,e+this.openStart,n);return r&&new ee(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ee(Jx(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 ee.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 ee(W.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)r++;for(let a=e.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new ee(e,r,i)}}ee.empty=new ee(W.empty,0,0);function Jx(t,e,n){let{index:r,offset:i}=t.findIndex(e),a=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(i==e||a.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,a.copy(Jx(a.content,e-i-1,n-i-1)))}function ev(t,e,n,r){let{index:i,offset:a}=t.findIndex(e),s=t.maybeChild(i);if(a==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=ev(s.content,e-a-1,n,s);return o&&t.replaceChild(i,s.copy(o))}function wR(t,e,n){if(n.openStart>t.depth)throw new Ts("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ts("Inconsistent open depths");return tv(t,e,n,0)}function tv(t,e,n,r){let i=t.index(r),a=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=tv(t,e,n,r+1);return a.copy(a.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return br(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=RR(n,t);return br(a,rv(t,s,o,e,r))}else return br(a,Ss(t,e,r))}function nv(t,e){if(!e.type.compatibleContent(t.type))throw new Ts("Cannot join "+e.type.name+" onto "+t.type.name)}function zh(t,e,n){let r=t.node(n);return nv(r,e.node(n)),r}function gr(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 Ui(t,e,n,r){let i=(e||t).node(n),a=0,s=e?e.index(n):i.childCount;t&&(a=t.index(n),t.depth>n?a++:t.textOffset&&(gr(t.nodeAfter,r),a++));for(let o=a;o<s;o++)gr(i.child(o),r);e&&e.depth==n&&e.textOffset&&gr(e.nodeBefore,r)}function br(t,e){return t.type.checkContent(e),t.copy(e)}function rv(t,e,n,r,i){let a=t.depth>i&&zh(t,e,i+1),s=r.depth>i&&zh(n,r,i+1),o=[];return Ui(null,t,i,o),a&&s&&e.index(i)==n.index(i)?(nv(a,s),gr(br(a,rv(t,e,n,r,i+1)),o)):(a&&gr(br(a,Ss(t,e,i+1)),o),Ui(e,n,i,o),s&&gr(br(s,Ss(n,r,i+1)),o)),Ui(r,null,i,o),new W(o)}function Ss(t,e,n){let r=[];if(Ui(null,t,n,r),t.depth>n){let i=zh(t,e,n+1);gr(br(i,Ss(t,e,n+1)),r)}return Ui(e,null,n,r),new W(r)}function RR(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let a=n-1;a>=0;a--)i=e.node(a).copy(W.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class aa{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 a=0;a<e;a++)i+=r.child(a).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return _e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var s=0;s<a.length;s++)a[s].type.spec.inclusive===!1&&(!i||!a[s].isInSet(i.marks))&&(a=a[s--].removeFromSet(a));return a}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 a=0;a<r.length;a++)r[a].type.spec.inclusive===!1&&(!i||!r[a].isInSet(i.marks))&&(r=r[a--].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 As(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,a=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(a),u=a-l;if(r.push(s,o,i+l),!u||(s=s.child(o),s.isText))break;a=u-1,i+=l+1}return new aa(n,r,a)}static resolveCached(e,n){let r=Lb.get(e);if(r)for(let a=0;a<r.elts.length;a++){let s=r.elts[a];if(s.pos==n)return s}else Lb.set(e,r=new OR);let i=r.elts[r.i]=aa.resolve(e,n);return r.i=(r.i+1)%LR,i}}class OR{constructor(){this.elts=[],this.i=0}}const LR=12,Lb=new WeakMap;class As{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 DR=Object.create(null);let Xn=class qh{constructor(e,n,r,i=_e.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||W.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&&ys(this.attrs,n||e.defaultAttrs||DR)&&_e.sameSet(this.marks,r||_e.none)}copy(e=null){return e==this.content?this:new qh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new qh(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 ee.empty;let i=this.resolve(e),a=this.resolve(n),s=r?0:i.sharedDepth(n),o=i.start(s),u=i.node(s).content.cut(i.pos-o,a.pos-o);return new ee(u,i.depth-s,a.depth-s)}replace(e,n,r){return wR(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 aa.resolveCached(this,e)}resolveNoCache(e){return aa.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,a=>(r.isInSet(a.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()+")"),iv(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=W.empty,i=0,a=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,a),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(r),s=a&&a.matchFragment(this.content,n);return s?s.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=_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(!_e.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=W.fromJSON(e,n.content),a=e.nodeType(n.type).create(n.attrs,i,r);return a.type.checkAttrs(a.attrs),a}};Xn.prototype.text=void 0;class ks extends Xn{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):iv(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 ks(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ks(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 iv(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class kr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new MR(e,n);if(r.next==null)return kr.empty;let i=av(r);r.next&&r.err("Unexpected trailing text");let a=zR($R(i));return qR(a,r),a}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 a=n;i&&a<r;a++)i=i.matchType(e.child(a).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 a(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return W.from(o.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=a(d,o.concat(c));if(f)return f}}return null}return a(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(),a=i.match;if(a.matchType(e)){let s=[];for(let o=i;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<a.next.length;s++){let{type:o,next:l}=a.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:i}),n[o.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 a=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)a+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return a}).join(`
1
+ import{r as U,c as ae,o as Nx,h as Cw,k as _w,j as T,s as Nb,Z as Ix,c1 as wx,b_ as Nw,bv as At,c2 as Iw,u as ci,t as _n,c3 as ww,aX as Rx,c4 as Rw,c5 as dn,c6 as il,c7 as Ow,c8 as al,c9 as Lw,ca as Dw,cb as Mw,cc as Pw,q as Fw,K as qm,cd as Bw,ce as Uw,cf as Hw,cg as $w,v as Ox,m as Lx,O as as,b5 as jm,bZ as Es,g as zw}from"./index-CCcWAtA_.js";import{c as pe}from"./utils-CnoQZeDK.js";import{i as qw}from"./X-mZzFkOTX.js";import{u as ka,S as Ib,a as jw,i as Gw,m as Dx,M as Vw,c as Ww,g as Yw,C as Kw,t as Mx,b as Xw,h as Zw}from"./use-deco-chat-open-DsNk3kZu.js";import{b as di,P as pi,a as fi}from"./popover-Bn1QrYWJ.js";import{S as So}from"./spinner-CoIaSc2j.js";import{b as wn,T as Rn,a as On,c as Ao,I as Gm}from"./integration-icon-Biu6JpM0.js";import{d as Px,u as Vm,i as Qr,f as Qw}from"./constants-PBHJ4h9F.js";import{u as Jw,g as Fx,l as wb,a as Rb,r as eR}from"./use-mcp-prompts-WwyO9-Nk.js";import{E as tR,i as nR}from"./error-boundary-D9qG4zZt.js";import{B as et}from"./button-BKtq_PYU.js";import{c as rR,b as iR,e as aR,a as sR,D as oR}from"./dialog-B8Jtq_Yp.js";import{a as lR,F as uR,b as cR,c as dR,d as pR,f as fR}from"./form-DQap4sDh.js";import{I as Bx}from"./input-Dh6Cjukb.js";import{i as Ux}from"./AlertCircle-CHm1uTvc.js";import{i as hR}from"./ArrowUp-CsvTcSKO.js";import{t as Hh}from"./ChevronDown-BmbIYWgz.js";import{i as mR}from"./Edit01-Ck6L4sn5.js";import{t as ia}from"./Users03-B_SbeQBk.js";import{i as Hx}from"./ChevronRight-C7PRdwhN.js";import{i as xa}from"./Check-CTaDpFbx.js";import{a as Wm}from"./Copy01-BHrubS15.js";import{i as gR}from"./Terminal-CvqFIFfF.js";import{M as $x,s as Ob}from"./monaco-editor-XyXN2SEV.js";import{u as bR,L as ER}from"./localstorage-keys-BWsOCDUX.js";import{E as yR}from"./empty-state-B8XrD0Ub.js";import{g as TR,h as SR}from"./use-connection-BCPygOxC.js";import{g as AR}from"./generate-id-Dyweu44Y.js";import{i as zx}from"./SearchMd-rxhL9uWW.js";import{s as kR}from"./Trash01-CNJdNb2Z.js";import{B as xR}from"./badge-tOUVTd9z.js";import{i as vR}from"./Code01-BHb1dfFm.js";import{b as CR}from"./use-virtual-mcp-ByfXJ3SB.js";import{u as _R}from"./use-create-virtual-mcp-u-AAtHmy.js";const qx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));qx.displayName="Atom02";const jx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"m21.152 10.9-9.015 9.015a5.25 5.25 0 0 1-7.425-7.425l9.016-9.015a3.5 3.5 0 1 1 4.95 4.95l-8.662 8.662a1.75 1.75 0 1 1-2.475-2.475l7.601-7.602"}));jx.displayName="Attachment01";const Gx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));Gx.displayName="Coins01";const Vx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));Vx.displayName="Lightbulb01";const Wx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));Wx.displayName="Stop";const Yx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));Yx.displayName="Target04";const Kx=({size:t=24,color:e="currentColor",...n})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},U.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Kx.displayName="XCircle";function NR(t){const e={};for(const n of t.arguments??[])e[n.name]=n.required?Nb().min(1,"Required"):Nb();return Nx(e)}function IR(t){const e={};for(const n of t.arguments??[])e[n.name]="";return e}function Xx(t){const e=ae.c(64),{prompt:n,setPrompt:r,onSubmit:i}=t,a=U.useId();let s;if(e[0]!==n){const H=n?NR(n):Nx({});s=Cw(H),e[0]=n,e[1]=s}else s=e[1];const l=s;let u;e[2]!==n?(u=n?IR(n):{},e[2]=n,e[3]=u):u=e[3];let c;e[4]!==l||e[5]!==u?(c={resolver:l,defaultValues:u,mode:"onChange"},e[4]=l,e[5]=u,e[6]=c):c=e[6];const d=_w(c);let f;e[7]!==n?.arguments?(f=n?.arguments??[],e[7]=n?.arguments,e[8]=f):f=e[8];const p=f;let h;e[9]!==d||e[10]!==i||e[11]!==r?(h=async H=>{await i(H),r(null),d.reset()},e[9]=d,e[10]=i,e[11]=r,e[12]=h):h=e[12];const g=h;let b;e[13]!==d||e[14]!==r?(b=H=>{H||(d.reset(),r(null))},e[13]=d,e[14]=r,e[15]=b):b=e[15];const E=b;if(!n)return null;let y;e[16]!==n.name||e[17]!==n.title?(y=n.title||n.name.replace(/_/g," "),e[16]=n.name,e[17]=n.title,e[18]=y):y=e[18];let S;e[19]!==y?(S=T.jsx(rR,{children:y}),e[19]=y,e[20]=S):S=e[20];let k;e[21]!==n.description?(k=n.description&&T.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[21]=n.description,e[22]=k):k=e[22];let x;e[23]!==k||e[24]!==S?(x=T.jsxs(iR,{children:[S,k]}),e[23]=k,e[24]=S,e[25]=x):x=e[25];let A;e[26]!==d||e[27]!==g?(A=H=>{H.stopPropagation(),d.handleSubmit(g)(H)},e[26]=d,e[27]=g,e[28]=A):A=e[28];let v;if(e[29]!==p||e[30]!==d.control||e[31]!==d.formState.isSubmitting){let H;e[33]!==d.control||e[34]!==d.formState.isSubmitting?(H=J=>T.jsx(uR,{control:d.control,name:J.name,render:I=>{const{field:X}=I;return T.jsxs(cR,{children:[T.jsxs(dR,{className:"text-xs",children:[J.name,J.required?null:T.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),T.jsx(pR,{children:T.jsx(Bx,{...X,value:X.value??"",required:J.required,placeholder:J.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),T.jsx(fR,{})]})}},J.name),e[33]=d.control,e[34]=d.formState.isSubmitting,e[35]=H):H=e[35],v=p.map(H),e[29]=p,e[30]=d.control,e[31]=d.formState.isSubmitting,e[32]=v}else v=e[32];let w;e[36]!==E?(w=()=>E(!1),e[36]=E,e[37]=w):w=e[37];let N;e[38]!==d.formState.isSubmitting||e[39]!==w?(N=T.jsx(et,{type:"button",variant:"ghost",onClick:w,disabled:d.formState.isSubmitting,children:"Cancel"}),e[38]=d.formState.isSubmitting,e[39]=w,e[40]=N):N=e[40];const _=!d.formState.isValid||d.formState.isSubmitting;let D;e[41]!==d.formState.isSubmitting?(D=d.formState.isSubmitting?T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsx(So,{size:"xs"}),"Loading..."]}):"Use prompt",e[41]=d.formState.isSubmitting,e[42]=D):D=e[42];let M;e[43]!==a||e[44]!==_||e[45]!==D?(M=T.jsx(et,{type:"submit",form:a,disabled:_,children:D}),e[43]=a,e[44]=_,e[45]=D,e[46]=M):M=e[46];let q;e[47]!==N||e[48]!==M?(q=T.jsxs(aR,{children:[N,M]}),e[47]=N,e[48]=M,e[49]=q):q=e[49];let P;e[50]!==a||e[51]!==A||e[52]!==v||e[53]!==q?(P=T.jsxs("form",{id:a,className:"space-y-4 py-4",autoComplete:"off",onSubmit:A,children:[v,q]}),e[50]=a,e[51]=A,e[52]=v,e[53]=q,e[54]=P):P=e[54];let F;e[55]!==d||e[56]!==P?(F=T.jsx(lR,{...d,children:P}),e[55]=d,e[56]=P,e[57]=F):F=e[57];let $;e[58]!==x||e[59]!==F?($=T.jsxs(sR,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[x,F]}),e[58]=x,e[59]=F,e[60]=$):$=e[60];let G;return e[61]!==E||e[62]!==$?(G=T.jsx(oR,{open:!0,onOpenChange:E,children:$}),e[61]=E,e[62]=$,e[63]=G):G=e[63],G}function at(t){this.content=t}at.prototype={constructor:at,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),a=r.content.slice();return i==-1?a.push(n||t,e):(a[i+1]=e,n&&(a[i]=n)),new at(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new at(n)},addToStart:function(t,e){return new at([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new at(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),a=r.find(t);return i.splice(a==-1?i.length:a,0,e,n),new at(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=at.from(t),t.size?new at(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=at.from(t),t.size?new at(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=at.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}};at.from=function(t){if(t instanceof at)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new at(e)};function Zx(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),a=e.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let s=0;i.text[s]==a.text[s];s++)n++;return n}if(i.content.size||a.content.size){let s=Zx(i.content,a.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Qx(t,e,n,r){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let s=t.child(--i),o=e.child(--a),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let u=0,c=Math.min(s.text.length,o.text.length);for(;u<c&&s.text[s.text.length-u-1]==o.text[o.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let u=Qx(s.content,o.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class W{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,a){for(let s=0,o=0;o<n;s++){let l=this.content[s],u=o+l.nodeSize;if(u>e&&r(l,i+o,a||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}o=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let a="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let u=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&r&&(s?s=!1:a+=r),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new W(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 a=0,s=0;s<n;a++){let o=this.content[a],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),i+=o.nodeSize),s=l}return new W(r,i)}cutByIndex(e,n){return e==n?W.empty:e==0&&n==this.content.length?this:new W(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new W(i,a)}addToStart(e){return new W([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new W(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 Zx(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Qx(this,e,n,r)}findIndex(e){if(e==0)return Fa(0,e);if(e==this.size)return Fa(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),a=r+i.nodeSize;if(a>=e)return a==e?Fa(n+1,a):Fa(n,r);r=a}}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 W.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new W(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return W.empty;let n,r=0;for(let i=0;i<e.length;i++){let a=e[i];r+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(n||(n=e.slice(0,i)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new W(n||e,r)}static from(e){if(!e)return W.empty;if(e instanceof W)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new W([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}W.empty=new W([],0);const sl={index:0,offset:0};function Fa(t,e){return sl.index=t,sl.offset=e,sl}function ys(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(!ys(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ys(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let _e=class $h{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))n||(n=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!r&&a.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(a)}}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&&ys(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 $h.none;if(e instanceof $h)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};_e.none=[];class Ts extends Error{}class ee{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=ev(this.content,e+this.openStart,n);return r&&new ee(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ee(Jx(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 ee.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 ee(W.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)r++;for(let a=e.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new ee(e,r,i)}}ee.empty=new ee(W.empty,0,0);function Jx(t,e,n){let{index:r,offset:i}=t.findIndex(e),a=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(i==e||a.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,a.copy(Jx(a.content,e-i-1,n-i-1)))}function ev(t,e,n,r){let{index:i,offset:a}=t.findIndex(e),s=t.maybeChild(i);if(a==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=ev(s.content,e-a-1,n,s);return o&&t.replaceChild(i,s.copy(o))}function wR(t,e,n){if(n.openStart>t.depth)throw new Ts("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ts("Inconsistent open depths");return tv(t,e,n,0)}function tv(t,e,n,r){let i=t.index(r),a=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=tv(t,e,n,r+1);return a.copy(a.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return br(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=RR(n,t);return br(a,rv(t,s,o,e,r))}else return br(a,Ss(t,e,r))}function nv(t,e){if(!e.type.compatibleContent(t.type))throw new Ts("Cannot join "+e.type.name+" onto "+t.type.name)}function zh(t,e,n){let r=t.node(n);return nv(r,e.node(n)),r}function gr(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 Ui(t,e,n,r){let i=(e||t).node(n),a=0,s=e?e.index(n):i.childCount;t&&(a=t.index(n),t.depth>n?a++:t.textOffset&&(gr(t.nodeAfter,r),a++));for(let o=a;o<s;o++)gr(i.child(o),r);e&&e.depth==n&&e.textOffset&&gr(e.nodeBefore,r)}function br(t,e){return t.type.checkContent(e),t.copy(e)}function rv(t,e,n,r,i){let a=t.depth>i&&zh(t,e,i+1),s=r.depth>i&&zh(n,r,i+1),o=[];return Ui(null,t,i,o),a&&s&&e.index(i)==n.index(i)?(nv(a,s),gr(br(a,rv(t,e,n,r,i+1)),o)):(a&&gr(br(a,Ss(t,e,i+1)),o),Ui(e,n,i,o),s&&gr(br(s,Ss(n,r,i+1)),o)),Ui(r,null,i,o),new W(o)}function Ss(t,e,n){let r=[];if(Ui(null,t,n,r),t.depth>n){let i=zh(t,e,n+1);gr(br(i,Ss(t,e,n+1)),r)}return Ui(e,null,n,r),new W(r)}function RR(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let a=n-1;a>=0;a--)i=e.node(a).copy(W.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class aa{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 a=0;a<e;a++)i+=r.child(a).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return _e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var s=0;s<a.length;s++)a[s].type.spec.inclusive===!1&&(!i||!a[s].isInSet(i.marks))&&(a=a[s--].removeFromSet(a));return a}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 a=0;a<r.length;a++)r[a].type.spec.inclusive===!1&&(!i||!r[a].isInSet(i.marks))&&(r=r[a--].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 As(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,a=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(a),u=a-l;if(r.push(s,o,i+l),!u||(s=s.child(o),s.isText))break;a=u-1,i+=l+1}return new aa(n,r,a)}static resolveCached(e,n){let r=Lb.get(e);if(r)for(let a=0;a<r.elts.length;a++){let s=r.elts[a];if(s.pos==n)return s}else Lb.set(e,r=new OR);let i=r.elts[r.i]=aa.resolve(e,n);return r.i=(r.i+1)%LR,i}}class OR{constructor(){this.elts=[],this.i=0}}const LR=12,Lb=new WeakMap;class As{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 DR=Object.create(null);let Xn=class qh{constructor(e,n,r,i=_e.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||W.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&&ys(this.attrs,n||e.defaultAttrs||DR)&&_e.sameSet(this.marks,r||_e.none)}copy(e=null){return e==this.content?this:new qh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new qh(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 ee.empty;let i=this.resolve(e),a=this.resolve(n),s=r?0:i.sharedDepth(n),o=i.start(s),u=i.node(s).content.cut(i.pos-o,a.pos-o);return new ee(u,i.depth-s,a.depth-s)}replace(e,n,r){return wR(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 aa.resolveCached(this,e)}resolveNoCache(e){return aa.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,a=>(r.isInSet(a.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()+")"),iv(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=W.empty,i=0,a=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,a),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(r),s=a&&a.matchFragment(this.content,n);return s?s.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=_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(!_e.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=W.fromJSON(e,n.content),a=e.nodeType(n.type).create(n.attrs,i,r);return a.type.checkAttrs(a.attrs),a}};Xn.prototype.text=void 0;class ks extends Xn{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):iv(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 ks(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ks(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 iv(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class kr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new MR(e,n);if(r.next==null)return kr.empty;let i=av(r);r.next&&r.err("Unexpected trailing text");let a=zR($R(i));return qR(a,r),a}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 a=n;i&&a<r;a++)i=i.matchType(e.child(a).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 a(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return W.from(o.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=a(d,o.concat(c));if(f)return f}}return null}return a(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(),a=i.match;if(a.matchType(e)){let s=[];for(let o=i;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<a.next.length;s++){let{type:o,next:l}=a.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:i}),n[o.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 a=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)a+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return a}).join(`
2
2
  `)}}kr.empty=new kr(!0);class MR{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 av(t){let e=[];do e.push(PR(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function PR(t){let e=[];do e.push(FR(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function FR(t){let e=HR(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=BR(t,e);else break;return e}function Db(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function BR(t,e){let n=Db(t),r=n;return t.eat(",")&&(t.next!="}"?r=Db(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function UR(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let a in n){let s=n[a];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function HR(t){if(t.eat("(")){let e=av(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=UR(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 $R(t){let e=[[]];return i(a(t,0),n()),e;function n(){return e.push([])-1}function r(s,o,l){let u={term:l,to:o};return e[s].push(u),u}function i(s,o){s.forEach(l=>l.to=o)}function a(s,o){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(a(u,o)),[]);if(s.type=="seq")for(let l=0;;l++){let u=a(s.exprs[l],o);if(l==s.exprs.length-1)return u;i(u,o=n())}else if(s.type=="star"){let l=n();return r(o,l),i(a(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(a(s.expr,o),l),i(a(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(o)].concat(a(s.expr,o));if(s.type=="range"){let l=o;for(let u=0;u<s.min;u++){let c=n();i(a(s.expr,l),c),l=c}if(s.max==-1)i(a(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let c=n();r(l,c),i(a(s.expr,l),c),l=c}return[r(l)]}else{if(s.type=="name")return[r(o,void 0,s.value)];throw new Error("Unknown expr type")}}}}function sv(t,e){return e-t}function Mb(t,e){let n=[];return r(e),n.sort(sv);function r(i){let a=t[i];if(a.length==1&&!a[0].term)return r(a[0].to);n.push(i);for(let s=0;s<a.length;s++){let{term:o,to:l}=a[s];!o&&n.indexOf(l)==-1&&r(l)}}}function zR(t){let e=Object.create(null);return n(Mb(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:o,to:l})=>{if(!o)return;let u;for(let c=0;c<i.length;c++)i[c][0]==o&&(u=i[c][1]);Mb(t,l).forEach(c=>{u||i.push([o,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let a=e[r.join(",")]=new kr(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let o=i[s][1].sort(sv);a.next.push({type:i[s][0],next:e[o.join(",")]||n(o)})}return a}}function qR(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],a=!i.validEnd,s=[];for(let o=0;o<i.next.length;o++){let{type:l,next:u}=i.next[o];s.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),r.indexOf(u)==-1&&r.push(u)}a&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ov(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 lv(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let a=t[r];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function uv(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let a=t[i];a.validate&&a.validate(e[i])}}function cv(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new GR(t,r,e[r]);return n}let Pb=class dv{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=cv(e,r.attrs),this.defaultAttrs=ov(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==kr.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:lv(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xn(this,this.computeAttrs(e),W.from(n),_e.setFrom(r))}createChecked(e=null,n,r){return n=W.from(n),this.checkContent(n),new Xn(this,this.computeAttrs(e),n,_e.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=W.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),a=i&&i.fillBefore(W.empty,!0);return a?new Xn(this,e,n.append(a),_e.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){uv(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:_e.none:e}static compile(e,n){let r=Object.create(null);e.forEach((a,s)=>r[a]=new dv(a,n,s));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 a in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function jR(t,e,n){let r=n.split("|");return i=>{let a=i===null?"null":typeof i;if(r.indexOf(a)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${a}`)}}class GR{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?jR(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class ko{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=cv(e,i.attrs),this.excluded=null;let a=ov(this.attrs);this.instance=a?new _e(this,a):null}create(e=null){return!e&&this.instance?this.instance:new _e(this,lv(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((a,s)=>r[a]=new ko(a,i++,n,s)),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){uv(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let pv=class{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=at.from(e.nodes),n.marks=at.from(e.marks||{}),this.nodes=Pb.compile(this.spec.nodes,this),this.marks=ko.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 a=this.nodes[i],s=a.spec.content||"",o=a.spec.marks;if(a.contentMatch=r[s]||(r[s]=kr.parse(s,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=o=="_"?null:o?Fb(this,o.split(" ")):o==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],s=a.spec.excludes;a.excluded=s==null?[a]:s==""?[]:Fb(this,s.split(" "))}this.nodeFromJSON=i=>Xn.fromJSON(this,i),this.markFromJSON=i=>_e.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 Pb){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 ks(r,r.defaultAttrs,e,_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 Fb(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t.marks[i],s=a;if(a)n.push(a);else for(let o in t.marks){let l=t.marks[o];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function VR(t){return t.tag!=null}function WR(t){return t.style!=null}class Zn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(VR(i))this.tags.push(i);else if(WR(i)){let a=/[^=]*/.exec(i.style)[0];r.indexOf(a)<0&&r.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,n={}){let r=new Ub(this,n,!1);return r.addAll(e,_e.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Ub(this,n,!0);return r.addAll(e,_e.none,n.from,n.to),ee.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(XR(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||n.matchesContext(a.context))){if(a.getAttrs){let s=a.getAttrs(e);if(s===!1)continue;a.attrs=s||void 0}return a}}}matchStyle(e,n,r,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let s=this.styles[a],o=s.style;if(!(o.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let a=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let o=n[s];if((o.priority==null?50:o.priority)<a)break}n.splice(s,0,i)}for(let i in e.marks){let a=e.marks[i].spec.parseDOM;a&&a.forEach(s=>{r(s=Hb(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(s=>{r(s=Hb(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Zn(e,Zn.schemaRules(e)))}}const fv={address:!0,article:!0,aside:!0,blockquote:!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},YR={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},hv={ol:!0,ul:!0},sa=1,jh=2,Hi=4;function Bb(t,e,n){return e!=null?(e?sa:0)|(e==="full"?jh:0):t&&t.whitespace=="pre"?sa|jh:n&~Hi}class Ba{constructor(e,n,r,i,a,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=_e.none,this.match=a||(s&Hi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(W.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&sa)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let a=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let n=W.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(W.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&&!fv.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ub{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,a,s=Bb(null,n.preserveWhitespace,0)|(r?Hi:0);i?a=new Ba(i.type,i.attrs,_e.none,!0,n.topMatch||i.type.contentMatch,s):r?a=new Ba(null,null,_e.none,!0,null,s):a=new Ba(e.schema.topNodeType,null,_e.none,!0,null,s),this.nodes=[a],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,a=i.options&jh?"full":this.localPreserveWS||(i.options&sa)>0,{schema:s}=this.parser;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(a)if(a==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=r.split(/\r?\n|\r/);for(let l=0;l<o.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),o[l]&&this.insertNode(s.text(o[l]),n,!/\S/.test(o[l]));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 o=i.content[i.content.length-1],l=e.previousSibling;(!o||l&&l.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;hv.hasOwnProperty(s)&&this.parser.normalizeLists&&KR(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(l?l.ignore:YR.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(fv.hasOwnProperty(s))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),u&&this.sync(a),this.needsBlock=c}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?o: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 a=this.parser.matchedStyles[i],s=r.getPropertyValue(a);if(s)for(let o=void 0;;){let l=this.parser.matchStyle(a,s,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return n}addElementByRule(e,n,r,i){let a,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(a=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let o=this.top;if(s&&s.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(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}a&&this.sync(o)&&this.open--}addAll(e,n,r,i){let a=r||0;for(let s=r?e.childNodes[r]:e.firstChild,o=i==null?null:e.childNodes[i];s!=o;s=s.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(s,n);this.findAtPoint(e,a)}findPlace(e,n,r){let i,a;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+o)&&(i=u,a=l,!u.length))break;if(l.solid){if(r)break;o+=2}}if(!i)return null;this.sync(a);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(n=this.enterInner(a,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let s=_e.none;for(let o of i.concat(e.marks))(a.type?a.type.allowsMarkType(o.type):$b(o.type,e.type))&&(s=o.addToSet(s));return a.content.push(e.mark(s)),!0}return!1}enter(e,n,r,i){let a=this.findPlace(e.create(n),r,!1);return a&&(a=this.enterInner(e,n,r,!0,i)),a}enterInner(e,n,r,i=!1,a){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=Bb(e,a,s.options);s.options&Hi&&s.content.length==0&&(o|=Hi);let l=_e.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):$b(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Ba(e,n,l,i,null,o)),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|=sa)}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),a=-(r?r.depth+1:0)+(i?0:1),s=(o,l)=>{for(;o>=0;o--){let u=n[o];if(u==""){if(o==n.length-1||o==0)continue;for(;l>=a;l--)if(s(o-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=a?r.node(l-a).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return s(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 KR(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&hv.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function XR(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Hb(t){let e={};for(let n in t)e[n]=t[n];return e}function $b(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let a=[],s=o=>{a.push(o);for(let l=0;l<o.edgeCount;l++){let{type:u,next:c}=o.edge(l);if(u==e||a.indexOf(c)<0&&s(c))return!0}};if(s(i.contentMatch))return!0}}class wr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=ol(n).createDocumentFragment());let i=r,a=[];return e.forEach(s=>{if(a.length||s.marks.length){let o=0,l=0;for(;o<a.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(a[o][0])||u.type.spec.spanning===!1)break;o++,l++}for(;o<a.length;)i=a.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,n);c&&(a.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=ss(ol(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 a=this.serializeMark(e.marks[i],e.isInline,n);a&&((a.contentDOM||a.dom).appendChild(r),r=a.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&ss(ol(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return ss(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new wr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=zb(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return zb(e.marks)}}function zb(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ol(t){return t.document||window.document}const qb=new WeakMap;function ZR(t){let e=qb.get(t);return e===void 0&&qb.set(t,e=QR(t)),e}function QR(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 ss(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(a=ZR(r))&&a.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 s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let o,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:h}=ss(t,f,n,r);if(l.appendChild(p),h){if(o)throw new RangeError("Multiple content holes");o=h}}}return{dom:l,contentDOM:o}}const mv=65535,gv=Math.pow(2,16);function JR(t,e){return t+e*gv}function jb(t){return t&mv}function eO(t){return(t-(t&mv))/gv}const bv=1,Ev=2,ls=4,yv=8;class Gh{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&yv)>0}get deletedBefore(){return(this.delInfo&(bv|ls))>0}get deletedAfter(){return(this.delInfo&(Ev|ls))>0}get deletedAcross(){return(this.delInfo&ls)>0}}class Ut{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Ut.empty)return Ut.empty}recover(e){let n=0,r=jb(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+eO(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,a=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[o+a],c=this.ranges[o+s],d=l+u;if(e<=d){let f=u?e==l?-1:e==d?1:n:n,p=l+i+(f<0?0:c);if(r)return p;let h=e==(n<0?l:d)?null:JR(o/3,e-l),g=e==l?Ev:e==d?bv:ls;return(n<0?e!=l:e!=d)&&(g|=yv),new Gh(p,g,h)}i+=c-u}return r?e+i:new Gh(e+i,0,null)}touches(e,n){let r=0,i=jb(n),a=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[o+a],c=l+u;if(e<=c&&o==i*3)return!0;r+=this.ranges[o+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let s=this.ranges[i],o=s-(this.inverted?a:0),l=s+(this.inverted?0:a),u=this.ranges[i+n],c=this.ranges[i+r];e(o,o+u,l,l+c),a+=c-u}}invert(){return new Ut(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ut.empty:new Ut(e<0?[0,-e,0]:[0,0,e])}}Ut.empty=new Ut([]);class oa{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 oa(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 oa;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 a=this.from;a<this.to;a++){let s=this._maps[a],o=s.mapResult(e,n);if(o.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,e=this._maps[l].recover(o.recover);continue}}i|=o.delInfo,e=o.pos}return r?e:new Gh(e,i,null)}}const ll=Object.create(null);class ht{getMap(){return Ut.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ll[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 ll)throw new RangeError("Duplicate use of step JSON ID "+e);return ll[e]=n,n.prototype.jsonID=e,n}}class Ge{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ge(e,null)}static fail(e){return new Ge(null,e)}static fromReplace(e,n,r,i){try{return Ge.ok(e.replace(n,r,i))}catch(a){if(a instanceof Ts)return Ge.fail(a.message);throw a}}}function Ym(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let a=t.child(i);a.content.size&&(a=a.copy(Ym(a.content,e,a))),a.isInline&&(a=e(a,n,i)),r.push(a)}return W.fromArray(r)}class Gn extends ht{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)),a=new ee(Ym(n.content,(s,o)=>!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ge.fromReplace(e,this.from,this.to,a)}invert(){return new tn(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 Gn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Gn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Gn(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 Gn(n.from,n.to,e.markFromJSON(n.mark))}}ht.jsonID("addMark",Gn);class tn extends ht{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 ee(Ym(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ge.fromReplace(e,this.from,this.to,r)}invert(){return new Gn(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 tn(n.pos,r.pos,this.mark)}merge(e){return e instanceof tn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new tn(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 tn(n.from,n.to,e.markFromJSON(n.mark))}}ht.jsonID("removeMark",tn);class Vn extends ht{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ge.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ge.fromReplace(e,this.pos,this.pos+1,new ee(W.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 Vn(this.pos,n.marks[i]);return new Vn(this.pos,this.mark)}}return new xr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Vn(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 Vn(n.pos,e.markFromJSON(n.mark))}}ht.jsonID("addNodeMark",Vn);class xr extends ht{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ge.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ge.fromReplace(e,this.pos,this.pos+1,new ee(W.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Vn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new xr(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 xr(n.pos,e.markFromJSON(n.mark))}}ht.jsonID("removeNodeMark",xr);class Qe extends ht{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Vh(e,this.from,this.to)?Ge.fail("Structure replace would overwrite content"):Ge.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ut([this.from,this.to-this.from,this.slice.size])}invert(e){return new Qe(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Qe(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Qe)||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?ee.empty:new ee(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Qe(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?ee.empty:new ee(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Qe(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 Qe(n.from,n.to,ee.fromJSON(e,n.slice),!!n.structure)}}ht.jsonID("replace",Qe);class nt extends ht{constructor(e,n,r,i,a,s,o=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=a,this.insert=s,this.structure=o}apply(e){if(this.structure&&(Vh(e,this.from,this.gapFrom)||Vh(e,this.gapTo,this.to)))return Ge.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ge.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ge.fromReplace(e,this.from,this.to,r):Ge.fail("Content does not fit in gap")}getMap(){return new Ut([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 nt(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),a=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new nt(n.pos,r.pos,i,a,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 nt(n.from,n.to,n.gapFrom,n.gapTo,ee.fromJSON(e,n.slice),n.insert,!!n.structure)}}ht.jsonID("replaceAround",nt);function Vh(t,e,n){let r=t.resolve(e),i=n-e,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let s=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function tO(t,e,n,r){let i=[],a=[],s,o;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,n),h=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(h)||(s&&s.to==f&&s.mark.eq(d[g])?s.to=p:i.push(s=new tn(f,p,d[g])));o&&o.to==f?o.to=p:a.push(o=new Gn(f,p,r))}}),i.forEach(l=>t.step(l)),a.forEach(l=>t.step(l))}function nO(t,e,n,r){let i=[],a=0;t.doc.nodesBetween(e,n,(s,o)=>{if(!s.isInline)return;a++;let l=null;if(r instanceof ko){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(o+s.nodeSize,n);for(let c=0;c<l.length;c++){let d=l[c],f;for(let p=0;p<i.length;p++){let h=i[p];h.step==a-1&&d.eq(i[p].style)&&(f=h)}f?(f.to=u,f.step=a):i.push({style:d,from:Math.max(o,e),to:u,step:a})}}}),i.forEach(s=>t.step(new tn(s.from,s.to,s.style)))}function Km(t,e,n,r=n.contentMatch,i=!0){let a=t.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l<a.childCount;l++){let u=a.child(l),c=o+u.nodeSize,d=r.matchType(u.type);if(!d)s.push(new Qe(o,c,ee.empty));else{r=d;for(let f=0;f<u.marks.length;f++)n.allowsMarkType(u.marks[f].type)||t.step(new tn(o,c,u.marks[f]));if(i&&u.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(u.text);)h||(h=new ee(W.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new Qe(o+f.index,o+f.index+f[0].length,h))}}o=c}if(!r.validEnd){let l=r.fillBefore(W.empty,!0);t.replace(o,o,new ee(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function rO(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function hi(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,a=0;;--r){let s=t.$from.node(r),o=t.$from.index(r)+i,l=t.$to.indexAfter(r)-a;if(r<t.depth&&s.canReplace(o,l,n))return r;if(r==0||s.type.spec.isolating||!rO(s,o,l))break;o&&(i=1),l<s.childCount&&(a=1)}return null}function iO(t,e,n){let{$from:r,$to:i,depth:a}=e,s=r.before(a+1),o=i.after(a+1),l=s,u=o,c=W.empty,d=0;for(let h=a,g=!1;h>n;h--)g||r.index(h)>0?(g=!0,c=W.from(r.node(h).copy(c)),d++):l--;let f=W.empty,p=0;for(let h=a,g=!1;h>n;h--)g||i.after(h+1)<i.end(h)?(g=!0,f=W.from(i.node(h).copy(f)),p++):u++;t.step(new nt(l,u,s,o,new ee(c.append(f),d,p),c.size-d,!0))}function Xm(t,e,n=null,r=t){let i=aO(t,e),a=i&&sO(r,e);return a?i.map(Gb).concat({type:e,attrs:n}).concat(a.map(Gb)):null}function Gb(t){return{type:t,attrs:null}}function aO(t,e){let{parent:n,startIndex:r,endIndex:i}=t,a=n.contentMatchAt(r).findWrapping(e);if(!a)return null;let s=a.length?a[0]:e;return n.canReplaceWith(r,i,s)?a:null}function sO(t,e){let{parent:n,startIndex:r,endIndex:i}=t,a=n.child(r),s=e.contentMatch.findWrapping(a.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:s}function oO(t,e,n){let r=W.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let o=n[s].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=W.from(n[s].type.create(n[s].attrs,r))}let i=e.start,a=e.end;t.step(new nt(i,a,i,a,new ee(r,0,0),n.length,!0))}function lO(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(e,n,(s,o)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&uO(t.doc,t.mapping.slice(a).map(o),r)){let u=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?u=!1:!p&&h&&(u=!0)}u===!1&&Sv(t,s,o,a),Km(t,t.mapping.slice(a).map(o,1),r,void 0,u===null);let c=t.mapping.slice(a),d=c.map(o,1),f=c.map(o+s.nodeSize,1);return t.step(new nt(d,f,d+1,f-1,new ee(W.from(r.create(l,null,s.marks)),0,0),1,!0)),u===!0&&Tv(t,s,o,a),!1}})}function Tv(t,e,n,r){e.forEach((i,a)=>{if(i.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(i.text);){let l=t.mapping.slice(r).map(n+1+a+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Sv(t,e,n,r){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+a);t.replaceWith(s,s+1,e.type.schema.text(`
@@ -0,0 +1 @@
1
+ import{r as n,at as L,aY as R,R as ke,x as Ee,y as xe,w as Se,aZ as q}from"./index-CCcWAtA_.js";const Ce=({size:t=24,color:l="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:l,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M17 9a1.99 1.99 0 0 0-.586-1.414A1.994 1.994 0 0 0 15 7m0 8a6 6 0 1 0-5.946-5.193c.058.434.087.651.068.789a.853.853 0 0 1-.117.346c-.068.121-.187.24-.426.479l-5.11 5.11c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C3 17.296 3 17.418 3 17.663V19.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H7v-2h2v-2h2l1.58-1.58c.238-.238.357-.357.478-.425a.852.852 0 0 1 .346-.117c.138-.02.355.01.789.068.264.036.533.054.807.054Z"}));Ce.displayName="Key01";var de=1,Ie=.9,Re=.8,Ae=.17,X=.1,Q=.999,Me=.9999,$e=.99,De=/[\\\/_+.#"@\[\(\{&]/,Ke=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:$e;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,S,k,C;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:De.test(t.charAt(i-1))?(h*=Re,k=t.slice(u,i-1).match(Ke),k&&u>0&&(h*=Math.pow(Q,k.length))):Fe.test(t.charAt(i-1))?(h*=Ie,C=t.slice(u,i-1).match(ve),C&&u>0&&(h*=Math.pow(Q,C.length))):(h*=Ae,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Me)),(h<X&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(S=ee(t,l,r,f,i+1,c+2,d),S*X>h&&(h=S*X)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Le(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var j='[cmdk-group=""]',_='[cmdk-group-items=""]',Ve='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",K="data-value",je=(t,l,r)=>Le(t,l,r),pe=n.createContext(void 0),P=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=F(()=>{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=F(()=>new Set),u=F(()=>new Map),c=F(()=>new Map),d=F(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:S,shouldFilter:k,loop:C,disablePointerSelection:H=!1,vimBindings:A=!0,...B}=t,N=L(),ne=L(),U=L(),M=n.useRef(null),w=Ye();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,E.emit()}},[p]),$(()=>{w(6,ae)},[]);let E=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,x;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")Z(),T(),w(1,Y);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(U);y?y.focus():(a=document.getElementById(N))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,E.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(x=(g=v.current).onValueChange)==null||x.call(g,y);return}}E.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),W=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(),E.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,()=>{Z(),T(),r.current.value||Y(),E.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{Z(),s?.getAttribute("id")===e&&Y(),E.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:N,inputId:U,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:je;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(x=>{let y=e.get(x);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;V().sort((a,m)=>{var g,x;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((x=e.get(y))!=null?x: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(`${j}[${K}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function Y(){let e=V().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(K);E.setState("value",o||void 0)}function Z(){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 x=(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:[],O=le(x,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,x]of u.current)for(let y of x)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(j))==null?void 0:o.querySelector(Ve))==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 V(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function G(e){let o=V()[e];o&&E.setState("value",o.getAttribute(K))}function J(e){var o;let s=D(),a=V(),m=a.findIndex(x=>x===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&&E.setState("value",g.getAttribute(K))}function ue(e){let o=D(),s=o?.closest(j),a;for(;s&&!a;)s=e>0?We(s,j):Te(s,j),a=s?.querySelector(fe);a?E.setState("value",a.getAttribute(K)):J(e)}let ie=()=>G(V().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):J(1)},ce=e=>{e.preventDefault(),e.metaKey?G(0):e.altKey?ue(-1):J(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,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(),G(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:W.inputId,id:W.labelId,style:Ge},b),z(t,e=>n.createElement(he.Provider,{value:E},n.createElement(pe.Provider,{value:W},e))))}),qe=n.forwardRef((t,l)=>{var r,f;let u=L(),c=n.useRef(null),d=n.useContext(ge),v=P(),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(),S=I(w=>w.value&&w.value===p.current),k=I(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,C),()=>w.removeEventListener(te,C)},[k,t.onSelect,t.disabled]);function C(){var w,E;H(),(E=(w=b.current).onSelect)==null||E.call(w,p.current)}function H(){h.setState("value",p.current,!0)}if(!k)return null;let{disabled:A,value:B,onSelect:N,forceMount:ne,keywords:U,...M}=t;return n.createElement(R.div,{ref:q(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!S,"data-disabled":!!A,"data-selected":!!S,onPointerMove:A||v.getDisablePointerSelection()?void 0:H,onClick:A?void 0:C},t.children)}),Pe=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=L(),v=n.useRef(null),b=n.useRef(null),i=L(),p=P(),h=I(k=>u||p.filter()===!1?!0:k.search?k.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let S=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:q(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,k=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:S},k))))}),Be=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=I(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:q(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=I(i=>i.search),v=I(i=>i.selectedItemId),b=P();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)}})}),ze=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=I(i=>i.selectedItemId),b=P();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,S=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let k=i.offsetHeight;p.style.setProperty("--cmdk-list-height",k.toFixed(1)+"px")})});return S.observe(i),()=>{cancelAnimationFrame(h),S.unobserve(i)}}},[]),n.createElement(R.div,{ref:q(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:q(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),He=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(ke,{open:r,onOpenChange:f},n.createElement(Ee,{container:d},n.createElement(xe,{"cmdk-overlay":"",className:u}),n.createElement(Se,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ne=n.forwardRef((t,l)=>I(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)))}),Xe=Object.assign(be,{List:ze,Item:qe,Input:Oe,Group:Pe,Separator:Be,Dialog:He,Empty:Ne,Loading:Ue});function We(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(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 F(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function I(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=P();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(K,v),u.current=v}),u}var Ye=()=>{let[t,l]=n.useState(),r=F(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ze(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(Ze(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Xe as _,Ce as i};
@@ -1 +1 @@
1
- import{a3 as d,a4 as f,a5 as v,a6 as b}from"./index-D5tmQFLM.js";var N=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:f()})}getOptimisticResult(e){return e.behavior=f(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:P,isError:c,isRefetchError:g}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:v(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:g&&!h&&!n,isRefetching:P&&!o&&!u}}};export{N as I};
1
+ import{a3 as d,a4 as f,a5 as v,a6 as b}from"./index-CCcWAtA_.js";var N=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:f()})}getOptimisticResult(e){return e.behavior=f(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:P,isError:c,isRefetchError:g}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:v(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:g&&!h&&!n,isRefetching:P&&!o&&!u}}};export{N as I};
@@ -1 +1 @@
1
- import{c as s,j as a}from"./index-D5tmQFLM.js";import{c as d}from"./utils-63Yxgxyo.js";function p(l){const e=s.c(10);let i,r,t;e[0]!==l?({className:i,type:t,...r}=l,e[0]=l,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let n;e[4]!==i?(n=d("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] bg-background","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==n||e[8]!==t?(o=a.jsx("input",{type:t,"data-slot":"input",className:n,...r}),e[6]=r,e[7]=n,e[8]=t,e[9]=o):o=e[9],o}export{p as I};
1
+ import{c as s,j as a}from"./index-CCcWAtA_.js";import{c as d}from"./utils-CnoQZeDK.js";function p(l){const e=s.c(10);let i,r,t;e[0]!==l?({className:i,type:t,...r}=l,e[0]=l,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let n;e[4]!==i?(n=d("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] bg-background","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==n||e[8]!==t?(o=a.jsx("input",{type:t,"data-slot":"input",className:n,...r}),e[6]=r,e[7]=n,e[8]=t,e[9]=o):o=e[9],o}export{p as I};
@@ -1 +1 @@
1
- import{j as d,av as z,aw as J,r as l,at as Q,am as ee,as as te,al as $,au as oe,_ as ne,an as R,aD as re,aE as se,ax as G,aq as ae,aI as ie,aF as le,c as j}from"./index-D5tmQFLM.js";import{R as ce}from"./index-9tcRb7FE.js";import{c as O}from"./utils-63Yxgxyo.js";var[D]=ae("Tooltip",[G]),N=G(),F="TooltipProvider",ue=700,S="tooltip.open",[de,M]=D(F),B=o=>{const{__scopeTooltip:e,delayDuration:t=ue,skipDelayDuration:n=300,disableHoverableContent:r=!1,children:s}=o,i=l.useRef(!0),c=l.useRef(!1),a=l.useRef(0);return l.useEffect(()=>{const u=a.current;return()=>window.clearTimeout(u)},[]),d.jsx(de,{scope:e,isOpenDelayedRef:i,delayDuration:t,onOpen:l.useCallback(()=>{window.clearTimeout(a.current),i.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:s})};B.displayName=F;var I="Tooltip",[pe,L]=D(I),q=o=>{const{__scopeTooltip:e,children:t,open:n,defaultOpen:r,onOpenChange:s,disableHoverableContent:i,delayDuration:c}=o,a=M(I,o.__scopeTooltip),u=N(e),[p,m]=l.useState(null),x=Q(),f=l.useRef(0),v=i??a.disableHoverableContent,g=c??a.delayDuration,h=l.useRef(!1),[y,T]=ee({prop:n,defaultProp:r??!1,onChange:P=>{P?(a.onOpen(),document.dispatchEvent(new CustomEvent(S))):a.onClose(),s?.(P)},caller:I}),C=l.useMemo(()=>y?h.current?"delayed-open":"instant-open":"closed",[y]),w=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,h.current=!1,T(!0)},[T]),b=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),E=l.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{h.current=!0,T(!0),f.current=0},g)},[g,T]);return l.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(te,{...u,children:d.jsx(pe,{scope:e,contentId:x,open:y,stateAttribute:C,trigger:p,onTriggerChange:m,onTriggerEnter:l.useCallback(()=>{a.isOpenDelayedRef.current?E():w()},[a.isOpenDelayedRef,E,w]),onTriggerLeave:l.useCallback(()=>{v?b():(window.clearTimeout(f.current),f.current=0)},[b,v]),onOpen:w,onClose:b,disableHoverableContent:v,children:t})})};q.displayName=I;var A="TooltipTrigger",V=l.forwardRef((o,e)=>{const{__scopeTooltip:t,...n}=o,r=L(A,t),s=M(A,t),i=N(t),c=l.useRef(null),a=$(e,c,r.onTriggerChange),u=l.useRef(!1),p=l.useRef(!1),m=l.useCallback(()=>u.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),d.jsx(oe,{asChild:!0,...i,children:d.jsx(ne.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...n,ref:a,onPointerMove:R(o.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),p.current=!0)}),onPointerLeave:R(o.onPointerLeave,()=>{r.onTriggerLeave(),p.current=!1}),onPointerDown:R(o.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:R(o.onFocus,()=>{u.current||r.onOpen()}),onBlur:R(o.onBlur,r.onClose),onClick:R(o.onClick,r.onClose)})})});V.displayName=A;var H="TooltipPortal",[fe,me]=D(H,{forceMount:void 0}),U=o=>{const{__scopeTooltip:e,forceMount:t,children:n,container:r}=o,s=L(H,e);return d.jsx(fe,{scope:e,forceMount:t,children:d.jsx(z,{present:t||s.open,children:d.jsx(J,{asChild:!0,container:r,children:n})})})};U.displayName=H;var _="TooltipContent",W=l.forwardRef((o,e)=>{const t=me(_,o.__scopeTooltip),{forceMount:n=t.forceMount,side:r="top",...s}=o,i=L(_,o.__scopeTooltip);return d.jsx(z,{present:n||i.open,children:i.disableHoverableContent?d.jsx(Y,{side:r,...s,ref:e}):d.jsx(xe,{side:r,...s,ref:e})})}),xe=l.forwardRef((o,e)=>{const t=L(_,o.__scopeTooltip),n=M(_,o.__scopeTooltip),r=l.useRef(null),s=$(e,r),[i,c]=l.useState(null),{trigger:a,onClose:u}=t,p=r.current,{onPointerInTransitChange:m}=n,x=l.useCallback(()=>{c(null),m(!1)},[m]),f=l.useCallback((v,g)=>{const h=v.currentTarget,y={x:v.clientX,y:v.clientY},T=Te(y,h.getBoundingClientRect()),C=ye(y,T),w=Ce(g.getBoundingClientRect()),b=we([...C,...w]);c(b),m(!0)},[m]);return l.useEffect(()=>()=>x(),[x]),l.useEffect(()=>{if(a&&p){const v=h=>f(h,p),g=h=>f(h,a);return a.addEventListener("pointerleave",v),p.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",v),p.removeEventListener("pointerleave",g)}}},[a,p,f,x]),l.useEffect(()=>{if(i){const v=g=>{const h=g.target,y={x:g.clientX,y:g.clientY},T=a?.contains(h)||p?.contains(h),C=!be(y,i);T?x():C&&(x(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[a,p,i,u,x]),d.jsx(Y,{...o,ref:s})}),[he,ve]=D(I,{isInside:!1}),ge=ie("TooltipContent"),Y=l.forwardRef((o,e)=>{const{__scopeTooltip:t,children:n,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:i,...c}=o,a=L(_,t),u=N(t),{onClose:p}=a;return l.useEffect(()=>(document.addEventListener(S,p),()=>document.removeEventListener(S,p)),[p]),l.useEffect(()=>{if(a.trigger){const m=x=>{x.target?.contains(a.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[a.trigger,p]),d.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:d.jsxs(se,{"data-state":a.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(ge,{children:n}),d.jsx(he,{scope:t,isInside:!0,children:d.jsx(ce,{id:a.contentId,role:"tooltip",children:r||n})})]})})});W.displayName=_;var Z="TooltipArrow",X=l.forwardRef((o,e)=>{const{__scopeTooltip:t,...n}=o,r=N(t);return ve(Z,t).isInside?null:d.jsx(le,{...r,...n,ref:e})});X.displayName=Z;function Te(o,e){const t=Math.abs(e.top-o.y),n=Math.abs(e.bottom-o.y),r=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,n,r,s)){case s:return"left";case r:return"right";case t:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function ye(o,e,t=5){const n=[];switch(e){case"top":n.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":n.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":n.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":n.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return n}function Ce(o){const{top:e,right:t,bottom:n,left:r}=o;return[{x:r,y:e},{x:t,y:e},{x:t,y:n},{x:r,y:n}]}function be(o,e){const{x:t,y:n}=o;let r=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const c=e[s],a=e[i],u=c.x,p=c.y,m=a.x,x=a.y;p>n!=x>n&&t<(m-u)*(n-p)/(x-p)+u&&(r=!r)}return r}function we(o){const e=o.slice();return e.sort((t,n)=>t.x<n.x?-1:t.x>n.x?1:t.y<n.y?-1:t.y>n.y?1:0),Ee(e)}function Ee(o){if(o.length<=1)return o.slice();const e=[];for(let n=0;n<o.length;n++){const r=o[n];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))e.pop();else break}e.push(r)}e.pop();const t=[];for(let n=o.length-1;n>=0;n--){const r=o[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Pe=B,Re=q,_e=V,je=U,Ie=W,Le=X;const K=({size:o=24,color:e="currentColor",...t})=>l.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},l.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));K.displayName="Container";function ke(o){const e=j.c(6);let t,n;e[0]!==o?({delayDuration:n,...t}=o,e[0]=o,e[1]=t,e[2]=n):(t=e[1],n=e[2]);const r=n===void 0?0:n;let s;return e[3]!==r||e[4]!==t?(s=d.jsx(Pe,{"data-slot":"tooltip-provider",delayDuration:r,...t}),e[3]=r,e[4]=t,e[5]=s):s=e[5],s}function ze(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=d.jsx(ke,{children:d.jsx(Re,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=n):n=e[3],n}function $e(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=d.jsx(_e,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=n):n=e[3],n}function Ge(o){const e=j.c(13);let t,n,r,s;e[0]!==o?({className:n,sideOffset:s,children:t,...r}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=r,e[4]=s):(t=e[1],n=e[2],r=e[3],s=e[4]);const i=s===void 0?0:s;let c;e[5]!==n?(c=O("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",n),e[5]=n,e[6]=c):c=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Le,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==i||e[11]!==c?(u=d.jsx(je,{children:d.jsxs(Ie,{"data-slot":"tooltip-content",sideOffset:i,className:c,...r,children:[t,a]})}),e[8]=t,e[9]=r,e[10]=i,e[11]=c,e[12]=u):u=e[12],u}const Oe={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},De={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},Ne={"2xs":8,xs:12,sm:16,md:24,lg:32};function Fe(o){const e=j.c(7),{icon:t,name:n,size:r,className:s,fallbackIcon:i}=o,c=r===void 0?"md":r,a=t??"no-icon";let u;return e[0]!==s||e[1]!==i||e[2]!==t||e[3]!==n||e[4]!==c||e[5]!==a?(u=d.jsx(Se,{icon:t,name:n,size:c,className:s,fallbackIcon:i},a),e[0]=s,e[1]=i,e[2]=t,e[3]=n,e[4]=c,e[5]=a,e[6]=u):u=e[6],u}function Se(o){const e=j.c(24),{icon:t,name:n,size:r,className:s,fallbackIcon:i}=o,c=r===void 0?"md":r,[a,u]=l.useState(!1),p=!!t&&a,m=Oe[c],x=De[c];let f;e[0]!==s||e[1]!==m||e[2]!==x?(f=O("rounded-lg border border-border shrink-0 overflow-hidden aspect-square",m,x,s),e[0]=s,e[1]=m,e[2]=x,e[3]=f):f=e[3];const v=t||void 0,g=!p&&"hidden";let h;e[4]!==g?(h=O("h-full w-full object-cover",g),e[4]=g,e[5]=h):h=e[5];let y,T;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>u(!1),T=()=>u(!0),e[6]=y,e[7]=T):(y=e[6],T=e[7]);let C;e[8]!==n||e[9]!==v||e[10]!==h?(C=d.jsx("img",{src:v,alt:n,className:h,onError:y,onLoad:T}),e[8]=n,e[9]=v,e[10]=h,e[11]=C):C=e[11];const w=p&&"hidden";let b;e[12]!==w?(b=O("h-full w-full flex items-center justify-center bg-muted/20",w),e[12]=w,e[13]=b):b=e[13];let E;e[14]!==i||e[15]!==c?(E=i??d.jsx(K,{size:Ne[c],className:"text-muted-foreground"}),e[14]=i,e[15]=c,e[16]=E):E=e[16];let P;e[17]!==b||e[18]!==E?(P=d.jsx("div",{className:b,children:E}),e[17]=b,e[18]=E,e[19]=P):P=e[19];let k;return e[20]!==C||e[21]!==P||e[22]!==f?(k=d.jsxs("div",{className:f,children:[C,P]}),e[20]=C,e[21]=P,e[22]=f,e[23]=k):k=e[23],k}export{Fe as I,$e as T,Ge as a,ze as b,ke as c,K as n};
1
+ import{j as d,av as z,aw as J,r as l,at as Q,am as ee,as as te,al as $,au as oe,_ as ne,an as R,aD as re,aE as se,ax as G,aq as ae,aI as ie,aF as le,c as j}from"./index-CCcWAtA_.js";import{R as ce}from"./index-BMXxQz0A.js";import{c as O}from"./utils-CnoQZeDK.js";var[D]=ae("Tooltip",[G]),N=G(),F="TooltipProvider",ue=700,S="tooltip.open",[de,M]=D(F),B=o=>{const{__scopeTooltip:e,delayDuration:t=ue,skipDelayDuration:n=300,disableHoverableContent:r=!1,children:s}=o,i=l.useRef(!0),c=l.useRef(!1),a=l.useRef(0);return l.useEffect(()=>{const u=a.current;return()=>window.clearTimeout(u)},[]),d.jsx(de,{scope:e,isOpenDelayedRef:i,delayDuration:t,onOpen:l.useCallback(()=>{window.clearTimeout(a.current),i.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:s})};B.displayName=F;var I="Tooltip",[pe,L]=D(I),q=o=>{const{__scopeTooltip:e,children:t,open:n,defaultOpen:r,onOpenChange:s,disableHoverableContent:i,delayDuration:c}=o,a=M(I,o.__scopeTooltip),u=N(e),[p,m]=l.useState(null),x=Q(),f=l.useRef(0),v=i??a.disableHoverableContent,g=c??a.delayDuration,h=l.useRef(!1),[y,T]=ee({prop:n,defaultProp:r??!1,onChange:P=>{P?(a.onOpen(),document.dispatchEvent(new CustomEvent(S))):a.onClose(),s?.(P)},caller:I}),C=l.useMemo(()=>y?h.current?"delayed-open":"instant-open":"closed",[y]),w=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,h.current=!1,T(!0)},[T]),b=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),E=l.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{h.current=!0,T(!0),f.current=0},g)},[g,T]);return l.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(te,{...u,children:d.jsx(pe,{scope:e,contentId:x,open:y,stateAttribute:C,trigger:p,onTriggerChange:m,onTriggerEnter:l.useCallback(()=>{a.isOpenDelayedRef.current?E():w()},[a.isOpenDelayedRef,E,w]),onTriggerLeave:l.useCallback(()=>{v?b():(window.clearTimeout(f.current),f.current=0)},[b,v]),onOpen:w,onClose:b,disableHoverableContent:v,children:t})})};q.displayName=I;var A="TooltipTrigger",V=l.forwardRef((o,e)=>{const{__scopeTooltip:t,...n}=o,r=L(A,t),s=M(A,t),i=N(t),c=l.useRef(null),a=$(e,c,r.onTriggerChange),u=l.useRef(!1),p=l.useRef(!1),m=l.useCallback(()=>u.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),d.jsx(oe,{asChild:!0,...i,children:d.jsx(ne.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...n,ref:a,onPointerMove:R(o.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),p.current=!0)}),onPointerLeave:R(o.onPointerLeave,()=>{r.onTriggerLeave(),p.current=!1}),onPointerDown:R(o.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:R(o.onFocus,()=>{u.current||r.onOpen()}),onBlur:R(o.onBlur,r.onClose),onClick:R(o.onClick,r.onClose)})})});V.displayName=A;var H="TooltipPortal",[fe,me]=D(H,{forceMount:void 0}),U=o=>{const{__scopeTooltip:e,forceMount:t,children:n,container:r}=o,s=L(H,e);return d.jsx(fe,{scope:e,forceMount:t,children:d.jsx(z,{present:t||s.open,children:d.jsx(J,{asChild:!0,container:r,children:n})})})};U.displayName=H;var _="TooltipContent",W=l.forwardRef((o,e)=>{const t=me(_,o.__scopeTooltip),{forceMount:n=t.forceMount,side:r="top",...s}=o,i=L(_,o.__scopeTooltip);return d.jsx(z,{present:n||i.open,children:i.disableHoverableContent?d.jsx(Y,{side:r,...s,ref:e}):d.jsx(xe,{side:r,...s,ref:e})})}),xe=l.forwardRef((o,e)=>{const t=L(_,o.__scopeTooltip),n=M(_,o.__scopeTooltip),r=l.useRef(null),s=$(e,r),[i,c]=l.useState(null),{trigger:a,onClose:u}=t,p=r.current,{onPointerInTransitChange:m}=n,x=l.useCallback(()=>{c(null),m(!1)},[m]),f=l.useCallback((v,g)=>{const h=v.currentTarget,y={x:v.clientX,y:v.clientY},T=Te(y,h.getBoundingClientRect()),C=ye(y,T),w=Ce(g.getBoundingClientRect()),b=we([...C,...w]);c(b),m(!0)},[m]);return l.useEffect(()=>()=>x(),[x]),l.useEffect(()=>{if(a&&p){const v=h=>f(h,p),g=h=>f(h,a);return a.addEventListener("pointerleave",v),p.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",v),p.removeEventListener("pointerleave",g)}}},[a,p,f,x]),l.useEffect(()=>{if(i){const v=g=>{const h=g.target,y={x:g.clientX,y:g.clientY},T=a?.contains(h)||p?.contains(h),C=!be(y,i);T?x():C&&(x(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[a,p,i,u,x]),d.jsx(Y,{...o,ref:s})}),[he,ve]=D(I,{isInside:!1}),ge=ie("TooltipContent"),Y=l.forwardRef((o,e)=>{const{__scopeTooltip:t,children:n,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:i,...c}=o,a=L(_,t),u=N(t),{onClose:p}=a;return l.useEffect(()=>(document.addEventListener(S,p),()=>document.removeEventListener(S,p)),[p]),l.useEffect(()=>{if(a.trigger){const m=x=>{x.target?.contains(a.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[a.trigger,p]),d.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:d.jsxs(se,{"data-state":a.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(ge,{children:n}),d.jsx(he,{scope:t,isInside:!0,children:d.jsx(ce,{id:a.contentId,role:"tooltip",children:r||n})})]})})});W.displayName=_;var Z="TooltipArrow",X=l.forwardRef((o,e)=>{const{__scopeTooltip:t,...n}=o,r=N(t);return ve(Z,t).isInside?null:d.jsx(le,{...r,...n,ref:e})});X.displayName=Z;function Te(o,e){const t=Math.abs(e.top-o.y),n=Math.abs(e.bottom-o.y),r=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,n,r,s)){case s:return"left";case r:return"right";case t:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function ye(o,e,t=5){const n=[];switch(e){case"top":n.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":n.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":n.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":n.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return n}function Ce(o){const{top:e,right:t,bottom:n,left:r}=o;return[{x:r,y:e},{x:t,y:e},{x:t,y:n},{x:r,y:n}]}function be(o,e){const{x:t,y:n}=o;let r=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const c=e[s],a=e[i],u=c.x,p=c.y,m=a.x,x=a.y;p>n!=x>n&&t<(m-u)*(n-p)/(x-p)+u&&(r=!r)}return r}function we(o){const e=o.slice();return e.sort((t,n)=>t.x<n.x?-1:t.x>n.x?1:t.y<n.y?-1:t.y>n.y?1:0),Ee(e)}function Ee(o){if(o.length<=1)return o.slice();const e=[];for(let n=0;n<o.length;n++){const r=o[n];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))e.pop();else break}e.push(r)}e.pop();const t=[];for(let n=o.length-1;n>=0;n--){const r=o[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Pe=B,Re=q,_e=V,je=U,Ie=W,Le=X;const K=({size:o=24,color:e="currentColor",...t})=>l.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},l.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));K.displayName="Container";function ke(o){const e=j.c(6);let t,n;e[0]!==o?({delayDuration:n,...t}=o,e[0]=o,e[1]=t,e[2]=n):(t=e[1],n=e[2]);const r=n===void 0?0:n;let s;return e[3]!==r||e[4]!==t?(s=d.jsx(Pe,{"data-slot":"tooltip-provider",delayDuration:r,...t}),e[3]=r,e[4]=t,e[5]=s):s=e[5],s}function ze(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=d.jsx(ke,{children:d.jsx(Re,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=n):n=e[3],n}function $e(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=d.jsx(_e,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=n):n=e[3],n}function Ge(o){const e=j.c(13);let t,n,r,s;e[0]!==o?({className:n,sideOffset:s,children:t,...r}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=r,e[4]=s):(t=e[1],n=e[2],r=e[3],s=e[4]);const i=s===void 0?0:s;let c;e[5]!==n?(c=O("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",n),e[5]=n,e[6]=c):c=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Le,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==i||e[11]!==c?(u=d.jsx(je,{children:d.jsxs(Ie,{"data-slot":"tooltip-content",sideOffset:i,className:c,...r,children:[t,a]})}),e[8]=t,e[9]=r,e[10]=i,e[11]=c,e[12]=u):u=e[12],u}const Oe={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},De={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},Ne={"2xs":8,xs:12,sm:16,md:24,lg:32};function Fe(o){const e=j.c(7),{icon:t,name:n,size:r,className:s,fallbackIcon:i}=o,c=r===void 0?"md":r,a=t??"no-icon";let u;return e[0]!==s||e[1]!==i||e[2]!==t||e[3]!==n||e[4]!==c||e[5]!==a?(u=d.jsx(Se,{icon:t,name:n,size:c,className:s,fallbackIcon:i},a),e[0]=s,e[1]=i,e[2]=t,e[3]=n,e[4]=c,e[5]=a,e[6]=u):u=e[6],u}function Se(o){const e=j.c(24),{icon:t,name:n,size:r,className:s,fallbackIcon:i}=o,c=r===void 0?"md":r,[a,u]=l.useState(!1),p=!!t&&a,m=Oe[c],x=De[c];let f;e[0]!==s||e[1]!==m||e[2]!==x?(f=O("rounded-lg border border-border shrink-0 overflow-hidden aspect-square",m,x,s),e[0]=s,e[1]=m,e[2]=x,e[3]=f):f=e[3];const v=t||void 0,g=!p&&"hidden";let h;e[4]!==g?(h=O("h-full w-full object-cover",g),e[4]=g,e[5]=h):h=e[5];let y,T;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>u(!1),T=()=>u(!0),e[6]=y,e[7]=T):(y=e[6],T=e[7]);let C;e[8]!==n||e[9]!==v||e[10]!==h?(C=d.jsx("img",{src:v,alt:n,className:h,onError:y,onLoad:T}),e[8]=n,e[9]=v,e[10]=h,e[11]=C):C=e[11];const w=p&&"hidden";let b;e[12]!==w?(b=O("h-full w-full flex items-center justify-center bg-muted/20",w),e[12]=w,e[13]=b):b=e[13];let E;e[14]!==i||e[15]!==c?(E=i??d.jsx(K,{size:Ne[c],className:"text-muted-foreground"}),e[14]=i,e[15]=c,e[16]=E):E=e[16];let P;e[17]!==b||e[18]!==E?(P=d.jsx("div",{className:b,children:E}),e[17]=b,e[18]=E,e[19]=P):P=e[19];let k;return e[20]!==C||e[21]!==P||e[22]!==f?(k=d.jsxs("div",{className:f,children:[C,P]}),e[20]=C,e[21]=P,e[22]=f,e[23]=k):k=e[23],k}export{Fe as I,$e as T,Ge as a,ze as b,ke as c,K as n};
@@ -1 +1 @@
1
- import{r,c as p,Z as w,j as n}from"./index-D5tmQFLM.js";import{P as x}from"./index-Bq-YlXEQ.js";const R=r.createContext(null);function H(m){const e=p.c(3),{children:l}=m,t=r.useContext(R);if(!t?.tabsEl)return null;let s;return e[0]!==l||e[1]!==t.tabsEl?(s=w.createPortal(l,t.tabsEl),e[0]=l,e[1]=t.tabsEl,e[2]=s):s=e[2],s}function L(m){const e=p.c(3),{children:l}=m,t=r.useContext(R);if(!t?.actionsEl)return null;let s;return e[0]!==l||e[1]!==t.actionsEl?(s=w.createPortal(l,t.actionsEl),e[0]=l,e[1]=t.actionsEl,e[2]=s):s=e[2],s}function $(m){const e=p.c(18),{children:l,breadcrumb:t}=m,[s,y]=r.useState(null),[j,C]=r.useState(null),S=r.useRef(null),V=r.useRef(null);let E;e[0]===Symbol.for("react.memo_cache_sentinel")?(E=c=>{S.current=c,c&&y(c)},e[0]=E):E=e[0];const g=E;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=c=>{V.current=c,c&&C(c)},e[1]=b):b=e[1];const v=b;let a;e[2]!==j||e[3]!==s?(a={tabsEl:s,actionsEl:j},e[2]=j,e[3]=s,e[4]=a):a=e[4];let o;e[5]!==t?(o=n.jsx(x.Header.Left,{children:t}),e[5]=t,e[6]=o):o=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(x.Header.Right,{children:[n.jsx("div",{ref:g,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),n.jsx("div",{ref:v,className:"flex items-center gap-2 shrink-0"})]}),e[7]=h):h=e[7];let i;e[8]!==o?(i=n.jsxs(x.Header,{children:[o,h]}),e[8]=o,e[9]=i):i=e[9];let f;e[10]!==l?(f=n.jsx(x.Content,{children:l}),e[10]=l,e[11]=f):f=e[11];let u;e[12]!==i||e[13]!==f?(u=n.jsxs(x,{children:[i,f]}),e[12]=i,e[13]=f,e[14]=u):u=e[14];let d;return e[15]!==a||e[16]!==u?(d=n.jsx(R,{value:a,children:u}),e[15]=a,e[16]=u,e[17]=d):d=e[17],d}export{L as V,$ as a,H as b};
1
+ import{r,c as p,Z as w,j as n}from"./index-CCcWAtA_.js";import{P as x}from"./index-D5w8F0R7.js";const R=r.createContext(null);function H(m){const e=p.c(3),{children:l}=m,t=r.useContext(R);if(!t?.tabsEl)return null;let s;return e[0]!==l||e[1]!==t.tabsEl?(s=w.createPortal(l,t.tabsEl),e[0]=l,e[1]=t.tabsEl,e[2]=s):s=e[2],s}function L(m){const e=p.c(3),{children:l}=m,t=r.useContext(R);if(!t?.actionsEl)return null;let s;return e[0]!==l||e[1]!==t.actionsEl?(s=w.createPortal(l,t.actionsEl),e[0]=l,e[1]=t.actionsEl,e[2]=s):s=e[2],s}function $(m){const e=p.c(18),{children:l,breadcrumb:t}=m,[s,y]=r.useState(null),[j,C]=r.useState(null),S=r.useRef(null),V=r.useRef(null);let E;e[0]===Symbol.for("react.memo_cache_sentinel")?(E=c=>{S.current=c,c&&y(c)},e[0]=E):E=e[0];const g=E;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=c=>{V.current=c,c&&C(c)},e[1]=b):b=e[1];const v=b;let a;e[2]!==j||e[3]!==s?(a={tabsEl:s,actionsEl:j},e[2]=j,e[3]=s,e[4]=a):a=e[4];let o;e[5]!==t?(o=n.jsx(x.Header.Left,{children:t}),e[5]=t,e[6]=o):o=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(x.Header.Right,{children:[n.jsx("div",{ref:g,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),n.jsx("div",{ref:v,className:"flex items-center gap-2 shrink-0"})]}),e[7]=h):h=e[7];let i;e[8]!==o?(i=n.jsxs(x.Header,{children:[o,h]}),e[8]=o,e[9]=i):i=e[9];let f;e[10]!==l?(f=n.jsx(x.Content,{children:l}),e[10]=l,e[11]=f):f=e[11];let u;e[12]!==i||e[13]!==f?(u=n.jsxs(x,{children:[i,f]}),e[12]=i,e[13]=f,e[14]=u):u=e[14];let d;return e[15]!==a||e[16]!==u?(d=n.jsx(R,{value:a,children:u}),e[15]=a,e[16]=u,e[17]=d):d=e[17],d}export{L as V,$ as a,H as b};
@@ -1 +1 @@
1
- import{c as O,v as I}from"./index-D5tmQFLM.js";import{u as M}from"./useQuery-C7wGFtkw.js";import{u as x}from"./useMutation-CapnNHWF.js";function L(t){try{return JSON.parse(t)}catch{return}}function v(t,s){const e=localStorage.getItem(t),o=e?L(e):void 0,n=typeof s=="function"?s(o):o??s;if(o===void 0||n!==o)try{const a=JSON.stringify(n);localStorage.setItem(t,a)}catch{}return n}function A(t,s){const e=O.c(25),o=I();let n;e[0]!==t?(n=["localStorage",t],e[0]=t,e[1]=n):n=e[1];const a=n;let r,i;e[2]!==s||e[3]!==t?(r=()=>v(t,s),i=()=>v(t,s),e[2]=s,e[3]=t,e[4]=r,e[5]=i):(r=e[4],i=e[5]);let m;e[6]!==a||e[7]!==r||e[8]!==i?(m={queryKey:a,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},e[6]=a,e[7]=r,e[8]=i,e[9]=m):m=e[9];const{data:y}=M(m);let l;e[10]!==t?(l=async c=>{const $=JSON.stringify(c);return localStorage.setItem(t,$),c},e[10]=t,e[11]=l):l=e[11];let h;e[12]!==o||e[13]!==a?(h=c=>{o.setQueryData(a,c)},e[12]=o,e[13]=a,e[14]=h):h=e[14];let u;e[15]!==l||e[16]!==h?(u={mutationFn:l,onSuccess:h},e[15]=l,e[16]=h,e[17]=u):u=e[17];const g=x(u);let d;e[18]!==g||e[19]!==o||e[20]!==a?(d=c=>{const $=o.getQueryData(a),C=typeof c=="function"?c($):c;g.mutate(C)},e[18]=g,e[19]=o,e[20]=a,e[21]=d):d=e[21];const S=d,p=y;let f;return e[22]!==S||e[23]!==p?(f=[p,S],e[22]=S,e[23]=p,e[24]=f):f=e[24],f}const D={assistantChatThreads:t=>`mesh:assistant-chat:threads:${t}`,messages:(t,s)=>`mesh:messages:${t}:${s}`,decoChatOpen:()=>"mesh:decochat:open",chatSelectedModel:t=>`mesh:chat:selectedModel:${t}`,chatSelectedMode:t=>`mesh:chat:selectedMode:${t}`,assistantChatActiveThread:t=>`mesh:assistant-chat:active-thread:${t}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:t=>`mesh:store:selected-registry:${t}`,orgHomeQuickstart:t=>`mesh:org-home:quickstart:${t}`,storeShowStdio:()=>"mesh:store:show-stdio",developerMode:()=>"mesh:user:developer-mode",pluginConnection:(t,s)=>`mesh:plugin:connection:${t}:${s}`};export{D as L,A as u};
1
+ import{c as O,v as I}from"./index-CCcWAtA_.js";import{u as M}from"./useQuery-Dp4Sp9Q1.js";import{u as x}from"./useMutation-Cn2d2ilG.js";function L(t){try{return JSON.parse(t)}catch{return}}function v(t,s){const e=localStorage.getItem(t),o=e?L(e):void 0,n=typeof s=="function"?s(o):o??s;if(o===void 0||n!==o)try{const a=JSON.stringify(n);localStorage.setItem(t,a)}catch{}return n}function A(t,s){const e=O.c(25),o=I();let n;e[0]!==t?(n=["localStorage",t],e[0]=t,e[1]=n):n=e[1];const a=n;let r,i;e[2]!==s||e[3]!==t?(r=()=>v(t,s),i=()=>v(t,s),e[2]=s,e[3]=t,e[4]=r,e[5]=i):(r=e[4],i=e[5]);let m;e[6]!==a||e[7]!==r||e[8]!==i?(m={queryKey:a,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},e[6]=a,e[7]=r,e[8]=i,e[9]=m):m=e[9];const{data:y}=M(m);let l;e[10]!==t?(l=async c=>{const $=JSON.stringify(c);return localStorage.setItem(t,$),c},e[10]=t,e[11]=l):l=e[11];let h;e[12]!==o||e[13]!==a?(h=c=>{o.setQueryData(a,c)},e[12]=o,e[13]=a,e[14]=h):h=e[14];let u;e[15]!==l||e[16]!==h?(u={mutationFn:l,onSuccess:h},e[15]=l,e[16]=h,e[17]=u):u=e[17];const g=x(u);let d;e[18]!==g||e[19]!==o||e[20]!==a?(d=c=>{const $=o.getQueryData(a),C=typeof c=="function"?c($):c;g.mutate(C)},e[18]=g,e[19]=o,e[20]=a,e[21]=d):d=e[21];const S=d,p=y;let f;return e[22]!==S||e[23]!==p?(f=[p,S],e[22]=S,e[23]=p,e[24]=f):f=e[24],f}const D={assistantChatThreads:t=>`mesh:assistant-chat:threads:${t}`,messages:(t,s)=>`mesh:messages:${t}:${s}`,decoChatOpen:()=>"mesh:decochat:open",chatSelectedModel:t=>`mesh:chat:selectedModel:${t}`,chatSelectedMode:t=>`mesh:chat:selectedMode:${t}`,assistantChatActiveThread:t=>`mesh:assistant-chat:active-thread:${t}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:t=>`mesh:store:selected-registry:${t}`,orgHomeQuickstart:t=>`mesh:org-home:quickstart:${t}`,storeShowStdio:()=>"mesh:store:show-stdio",developerMode:()=>"mesh:user:developer-mode",pluginConnection:(t,s)=>`mesh:plugin:connection:${t}:${s}`};export{D as L,A as u};
@@ -1 +1 @@
1
- import{ad as k,r as p,g as j,j as e,f as z,S as L,N as R,c as U}from"./index-D5tmQFLM.js";import{u as T}from"./useMutation-CapnNHWF.js";import{B as P}from"./button-CIJQcfm2.js";import{I as E}from"./input-BPn8NjNN.js";import{c as b}from"./utils-63Yxgxyo.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function G(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{G as default};
1
+ import{ad as k,r as p,g as j,j as e,f as z,S as L,N as R,c as U}from"./index-CCcWAtA_.js";import{u as T}from"./useMutation-Cn2d2ilG.js";import{B as P}from"./button-BKtq_PYU.js";import{I as E}from"./input-Dh6Cjukb.js";import{c as b}from"./utils-CnoQZeDK.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function G(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{G as default};
@@ -1 +1 @@
1
- import{a9 as P,aa as $,ab as V,ac as x}from"./index-D5tmQFLM.js";function I(n){let e=0;for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}const T=new Map,O="mcp:oauth:callback:";class N{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`,this._windowMode=e.windowMode??"popup";const t=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...t&&{scope:t}},T.set(I(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const s=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${s},top=${o},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){T.delete(I(this.serverUrl))}}async function K(n){const e=n.meshUrl??window.location.origin,t=new URL(`/mcp/${n.connectionId}`,e),r=new N({serverUrl:t.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope,windowMode:n.windowMode}),s={fn:null};try{const o=new Promise((l,u)=>{const w=n.timeout||12e4;let m,h=!1;const M=r.state(),g=`${O}${M}`,d=()=>{window.removeEventListener("message",A),window.removeEventListener("storage",b),clearTimeout(m);try{localStorage.removeItem(g)}catch{}};s.fn=a=>{h||(h=!0,d(),u(a))};const S=async a=>{if(h)return;if(h=!0,!a.success){d(),u(new Error(a.error||"OAuth authentication failed"));return}const{code:k,state:C}=a;if(!k){d(),u(new Error("Missing authorization code"));return}if(r.getStoredState()!==C){d(),u(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const y=(await P(t))?.authorization_servers?.[0]||t,U=await $(y),p=r.clientInformation();if(!p){d(),u(new Error("Client information not found"));return}const L=r.codeVerifier(),R=await V(y,{metadata:U,clientInformation:p,authorizationCode:k,codeVerifier:L,redirectUri:r.redirectUrl,resource:new URL(t)});d(),l({tokens:R,clientId:p.client_id??null,clientSecret:"client_secret"in p?p.client_secret:null,tokenEndpoint:U?.token_endpoint??null})}catch(v){d(),u(v)}},A=async a=>{a.origin===window.location.origin&&a.data?.type==="mcp:oauth:callback"&&await S(a.data)},b=async a=>{if(!(a.key!==g||!a.newValue))try{const k=JSON.parse(a.newValue);await S(k)}catch{}};window.addEventListener("message",A),window.addEventListener("storage",b),m=setTimeout(()=>{h||(h=!0,d(),u(new Error("OAuth authentication timeout")))},w)});if(o.catch(()=>{}),await x(r,{serverUrl:t})==="REDIRECT"){const l=await o;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint},error:null}}const i=r.tokens(),c=r.clientInformation();return{token:i?.access_token||null,tokenInfo:i?{accessToken:i.access_token,refreshToken:i.refresh_token??null,expiresIn:i.expires_in??null,scope:i.scope??null,clientId:c?.client_id??null,clientSecret:c&&"client_secret"in c?c.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return s.fn&&s.fn(o instanceof Error?o:new Error(String(o))),{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{r.cleanup()}}function _(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${O}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function W(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const r=n.get("error"),s=n.get("error_description");let o=t;if(t)try{const i=atob(t),c=JSON.parse(i);c.clientState&&(o=c.clientState)}catch{}if(r){const i=s||r;return _({type:"mcp:oauth:callback",success:!1,error:i},o),{success:!1,error:i}}if(!e||!t){const i="Missing code or state parameter";return _({type:"mcp:oauth:callback",success:!1,error:i},o),{success:!1,error:i}}return t=o||t,_({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}function E(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function z(n){try{const e=E();return(e?new URL(n,e):new URL(n)).pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}async function H(n,e){try{const t=`/api/connections/${n}/oauth-token/status`,r=e?new URL(t,e).href:t,s=await fetch(r,{credentials:e?"omit":"include"});return s.ok?{hasToken:(await s.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function j({url:n,token:e,meshUrl:t}){try{const r=new Headers;r.set("Content-Type","application/json"),r.set("Accept","application/json, text/event-stream");const s=await fetch(n,{method:"POST",headers:r,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),o=z(n),f=E(),i=t??(f?new URL(n,f).origin:new URL(n).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(o?await H(o,i):{hasToken:!1}).hasToken};let c;try{const w=await s.json();c=w.error||w.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:c||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:c||`HTTP ${s.status}`}}catch(r){return console.error("[isConnectionAuthenticated] Error:",r),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:r.message}}}export{K as a,W as h,j as i};
1
+ import{a9 as P,aa as $,ab as V,ac as x}from"./index-CCcWAtA_.js";function I(n){let e=0;for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}const T=new Map,O="mcp:oauth:callback:";class N{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`,this._windowMode=e.windowMode??"popup";const t=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...t&&{scope:t}},T.set(I(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const s=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${s},top=${o},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){T.delete(I(this.serverUrl))}}async function K(n){const e=n.meshUrl??window.location.origin,t=new URL(`/mcp/${n.connectionId}`,e),r=new N({serverUrl:t.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope,windowMode:n.windowMode}),s={fn:null};try{const o=new Promise((l,u)=>{const w=n.timeout||12e4;let m,h=!1;const M=r.state(),g=`${O}${M}`,d=()=>{window.removeEventListener("message",A),window.removeEventListener("storage",b),clearTimeout(m);try{localStorage.removeItem(g)}catch{}};s.fn=a=>{h||(h=!0,d(),u(a))};const S=async a=>{if(h)return;if(h=!0,!a.success){d(),u(new Error(a.error||"OAuth authentication failed"));return}const{code:k,state:C}=a;if(!k){d(),u(new Error("Missing authorization code"));return}if(r.getStoredState()!==C){d(),u(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const y=(await P(t))?.authorization_servers?.[0]||t,U=await $(y),p=r.clientInformation();if(!p){d(),u(new Error("Client information not found"));return}const L=r.codeVerifier(),R=await V(y,{metadata:U,clientInformation:p,authorizationCode:k,codeVerifier:L,redirectUri:r.redirectUrl,resource:new URL(t)});d(),l({tokens:R,clientId:p.client_id??null,clientSecret:"client_secret"in p?p.client_secret:null,tokenEndpoint:U?.token_endpoint??null})}catch(v){d(),u(v)}},A=async a=>{a.origin===window.location.origin&&a.data?.type==="mcp:oauth:callback"&&await S(a.data)},b=async a=>{if(!(a.key!==g||!a.newValue))try{const k=JSON.parse(a.newValue);await S(k)}catch{}};window.addEventListener("message",A),window.addEventListener("storage",b),m=setTimeout(()=>{h||(h=!0,d(),u(new Error("OAuth authentication timeout")))},w)});if(o.catch(()=>{}),await x(r,{serverUrl:t})==="REDIRECT"){const l=await o;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint},error:null}}const i=r.tokens(),c=r.clientInformation();return{token:i?.access_token||null,tokenInfo:i?{accessToken:i.access_token,refreshToken:i.refresh_token??null,expiresIn:i.expires_in??null,scope:i.scope??null,clientId:c?.client_id??null,clientSecret:c&&"client_secret"in c?c.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return s.fn&&s.fn(o instanceof Error?o:new Error(String(o))),{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{r.cleanup()}}function _(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${O}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function W(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const r=n.get("error"),s=n.get("error_description");let o=t;if(t)try{const i=atob(t),c=JSON.parse(i);c.clientState&&(o=c.clientState)}catch{}if(r){const i=s||r;return _({type:"mcp:oauth:callback",success:!1,error:i},o),{success:!1,error:i}}if(!e||!t){const i="Missing code or state parameter";return _({type:"mcp:oauth:callback",success:!1,error:i},o),{success:!1,error:i}}return t=o||t,_({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}function E(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function z(n){try{const e=E();return(e?new URL(n,e):new URL(n)).pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}async function H(n,e){try{const t=`/api/connections/${n}/oauth-token/status`,r=e?new URL(t,e).href:t,s=await fetch(r,{credentials:e?"omit":"include"});return s.ok?{hasToken:(await s.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function j({url:n,token:e,meshUrl:t}){try{const r=new Headers;r.set("Content-Type","application/json"),r.set("Accept","application/json, text/event-stream");const s=await fetch(n,{method:"POST",headers:r,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),o=z(n),f=E(),i=t??(f?new URL(n,f).origin:new URL(n).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(o?await H(o,i):{hasToken:!1}).hasToken};let c;try{const w=await s.json();c=w.error||w.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:c||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:c||`HTTP ${s.status}`}}catch(r){return console.error("[isConnectionAuthenticated] Error:",r),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:r.message}}}export{K as a,W as h,j as i};
@@ -1 +1 @@
1
- import{r as B,c as V,j as a}from"./index-D5tmQFLM.js";import{I as O,T as q,a as J,b as K}from"./integration-icon-W7oxbRNq.js";import{B as Q}from"./button-CIJQcfm2.js";import{s as X}from"./Globe02-BWyDEbcv.js";import{i as Y}from"./Lock01-B6ThbWMN.js";import{s as ee}from"./Plus-BhKqidCj.js";import{i as te}from"./Terminal-CI6nX2Ah.js";import{C as se}from"./card-v4WZxiU8.js";import{c as M}from"./utils-63Yxgxyo.js";import{g as le}from"./github-icon-Dp3wHhYE.js";const U=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";const W=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 10 4.08 10 5.2 10Zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 22 4.08 22 5.2 22Z"}));W.displayName="Server01";function ie(s){if(!s.includes("/"))return s;const e=s.split("/"),l=e[0],i=e[1];if(!l||!i)return s;if(l.includes(".")){const n=l.split("."),r=n[n.length-1]||l,o=i.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!o||o.length<2?r:o}return i}function ae(s){const e=V.c(2),{protocol:l,className:i}=s;let n;return e[0]!==i?(n={http:a.jsx(X,{className:i}),sse:a.jsx(W,{className:i}),stdio:a.jsx(te,{className:i})},e[0]=i,e[1]=n):n=e[1],n[l]}function ne(s){switch(s){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function re(s){const e=V.c(9),{protocol:l}=s;let i;e[0]!==l?(i=M("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[l]),e[0]=l,e[1]=i):i=e[1];let n,r;e[2]!==l?(n=a.jsx(ae,{protocol:l,className:"w-3 h-3"}),r=ne(l),e[2]=l,e[3]=n,e[4]=r):(n=e[3],r=e[4]);let o;return e[5]!==i||e[6]!==n||e[7]!==r?(o=a.jsxs("div",{className:i,children:[n,r]}),e[5]=i,e[6]=n,e[7]=r,e[8]=o):o=e[8],o}function oe(s){const e=V.c(68),{icon:l,displayName:i,description:n,onClick:r}=s,t=(s.variant??"store")==="server",f=t?s.hostname:null,m=t?s.protocol:null,c=t?s.isInstalling:!1,d=t?s.actionLabel:void 0,p=t?null:s.scopeName,_=t?!1:s.isVerified,x=t?!0:s.canInstall,H=t?"p-4":"p-6";let u;e[0]!==H?(u=M("cursor-pointer hover:bg-muted/50 transition-colors",H),e[0]=H,e[1]=u):u=e[1];const R=t?"gap-3":"gap-4";let h;e[2]!==R?(h=M("flex flex-col h-full relative",R),e[2]=R,e[3]=h):h=e[3];const Z=t?"sm":"md";let g;e[4]!==i||e[5]!==l||e[6]!==Z?(g=a.jsx(O,{icon:l,name:i,size:Z,className:"shadow-sm shrink-0"}),e[4]=i,e[5]=l,e[6]=Z,e[7]=g):g=e[7];const G=t?"text-sm":"text-base";let v;e[8]!==G?(v=M("flex items-center gap-2 font-medium min-w-0",G),e[8]=G,e[9]=v):v=e[9];let j;e[10]!==i?(j=a.jsx("span",{className:"truncate",children:i}),e[10]=i,e[11]=j):j=e[11];let N;e[12]!==t||e[13]!==_?(N=!t&&_&&a.jsx(U,{size:16,className:"text-success shrink-0"}),e[12]=t,e[13]=_,e[14]=N):N=e[14];let C;e[15]!==x||e[16]!==t?(C=!t&&!x&&a.jsx(Y,{size:16,className:"text-muted-foreground shrink-0"}),e[15]=x,e[16]=t,e[17]=C):C=e[17];let k;e[18]!==t||e[19]!==m?(k=t&&m&&a.jsx(re,{protocol:m}),e[18]=t,e[19]=m,e[20]=k):k=e[20];let b;e[21]!==C||e[22]!==k||e[23]!==v||e[24]!==j||e[25]!==N?(b=a.jsx(q,{asChild:!0,children:a.jsxs("div",{className:v,children:[j,N,C,k]})}),e[21]=C,e[22]=k,e[23]=v,e[24]=j,e[25]=N,e[26]=b):b=e[26];let w;e[27]!==i?(w=a.jsx("p",{children:i}),e[27]=i,e[28]=w):w=e[28];let y;e[29]!==x||e[30]!==t?(y=!t&&!x&&a.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[29]=x,e[30]=t,e[31]=y):y=e[31];let I;e[32]!==w||e[33]!==y?(I=a.jsxs(J,{children:[w,y]}),e[32]=w,e[33]=y,e[34]=I):I=e[34];let $;e[35]!==b||e[36]!==I?($=a.jsxs(K,{children:[b,I]}),e[35]=b,e[36]=I,e[37]=$):$=e[37];let L;e[38]!==f||e[39]!==t||e[40]!==p?(L=(p||f)&&a.jsx("div",{className:M("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:p||f}),e[38]=f,e[39]=t,e[40]=p,e[41]=L):L=e[41];let P;e[42]!==$||e[43]!==L?(P=a.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[$,L]})}),e[42]=$,e[43]=L,e[44]=P):P=e[44];let S;e[45]!==P||e[46]!==g?(S=a.jsxs("div",{className:"flex gap-3",children:[g,P]}),e[45]=P,e[46]=g,e[47]=S):S=e[47];let T;e[48]!==n?(T=n&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:n}),e[48]=n,e[49]=T):T=e[49];let E;e[50]!==n||e[51]!==t?(E=!n&&!t&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[50]=n,e[51]=t,e[52]=E):E=e[52];let z;e[53]!==d||e[54]!==c||e[55]!==t||e[56]!==r?(z=t&&a.jsxs(Q,{variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),r()},disabled:c,className:"w-full mt-auto cursor-pointer",children:[a.jsx(ee,{size:16}),c?"Connecting...":d||"Connect"]}),e[53]=d,e[54]=c,e[55]=t,e[56]=r,e[57]=z):z=e[57];let D;e[58]!==S||e[59]!==T||e[60]!==E||e[61]!==z||e[62]!==h?(D=a.jsxs("div",{className:h,children:[S,T,E,z]}),e[58]=S,e[59]=T,e[60]=E,e[61]=z,e[62]=h,e[63]=D):D=e[63];let A;return e[64]!==r||e[65]!==u||e[66]!==D?(A=a.jsx(se,{className:u,onClick:r,children:D}),e[64]=r,e[65]=u,e[66]=D,e[67]=A):A=e[67],A}function ce(s){const e=s.title||s.server.title||s.id||"Unnamed Item",l=s._meta?.["mcp.mesh"],i=l?.short_description||l?.mesh_description||s.server.description||null,n=s.server.icons?.[0]?.src||le(s.server.repository)||null,r=l?.verified??!1,o=(s.server.remotes?.length??0)>0,t=(s.server.packages?.length??0)>0,f=o||t;let m=e,c=null;if(e.includes("/")){const d=e.split("/");d.length>=2&&(c=d[0]||null,m=ie(e))}if(!c){const d=l?.scopeName,p=l?.appName;d&&p?c=`${d}/${p}`:d&&(c=d)}return l?.friendly_name&&(m=l.friendly_name),{icon:n,scopeName:c,displayName:m,description:i,isVerified:r,canInstall:f}}function Ne(s){const e=V.c(12),{items:l,title:i,onItemClick:n}=s;if(l.length===0)return null;let r;e[0]!==i?(r=i&&a.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:a.jsx("h2",{className:"text-lg font-medium",children:i})}),e[0]=i,e[1]=r):r=e[1];let o;if(e[2]!==l||e[3]!==n){let m;e[5]!==n?(m=c=>{const d=ce(c);return a.jsx(oe,{...d,onClick:()=>n(c)},c.id)},e[5]=n,e[6]=m):m=e[6],o=l.map(m),e[2]=l,e[3]=n,e[4]=o}else o=e[4];let t;e[7]!==o?(t=a.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=t):t=e[8];let f;return e[9]!==r||e[10]!==t?(f=a.jsxs("div",{className:"flex flex-col gap-4",children:[r,t]}),e[9]=r,e[10]=t,e[11]=f):f=e[11],f}export{Ne as M,oe as a,W as b,ie as e};
1
+ import{r as B,c as V,j as a}from"./index-CCcWAtA_.js";import{I as O,T as q,a as J,b as K}from"./integration-icon-Biu6JpM0.js";import{B as Q}from"./button-BKtq_PYU.js";import{s as X}from"./Globe02-nY9R9qg_.js";import{i as Y}from"./Lock01-rY0GklCm.js";import{s as ee}from"./Plus-B1DSIk_Y.js";import{i as te}from"./Terminal-CvqFIFfF.js";import{C as se}from"./card-C0u1Pmkw.js";import{c as M}from"./utils-CnoQZeDK.js";import{g as le}from"./github-icon-Dp3wHhYE.js";const U=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";const W=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 10 4.08 10 5.2 10Zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 22 4.08 22 5.2 22Z"}));W.displayName="Server01";function ie(s){if(!s.includes("/"))return s;const e=s.split("/"),l=e[0],i=e[1];if(!l||!i)return s;if(l.includes(".")){const n=l.split("."),r=n[n.length-1]||l,o=i.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!o||o.length<2?r:o}return i}function ae(s){const e=V.c(2),{protocol:l,className:i}=s;let n;return e[0]!==i?(n={http:a.jsx(X,{className:i}),sse:a.jsx(W,{className:i}),stdio:a.jsx(te,{className:i})},e[0]=i,e[1]=n):n=e[1],n[l]}function ne(s){switch(s){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function re(s){const e=V.c(9),{protocol:l}=s;let i;e[0]!==l?(i=M("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[l]),e[0]=l,e[1]=i):i=e[1];let n,r;e[2]!==l?(n=a.jsx(ae,{protocol:l,className:"w-3 h-3"}),r=ne(l),e[2]=l,e[3]=n,e[4]=r):(n=e[3],r=e[4]);let o;return e[5]!==i||e[6]!==n||e[7]!==r?(o=a.jsxs("div",{className:i,children:[n,r]}),e[5]=i,e[6]=n,e[7]=r,e[8]=o):o=e[8],o}function oe(s){const e=V.c(68),{icon:l,displayName:i,description:n,onClick:r}=s,t=(s.variant??"store")==="server",f=t?s.hostname:null,m=t?s.protocol:null,c=t?s.isInstalling:!1,d=t?s.actionLabel:void 0,p=t?null:s.scopeName,_=t?!1:s.isVerified,x=t?!0:s.canInstall,H=t?"p-4":"p-6";let u;e[0]!==H?(u=M("cursor-pointer hover:bg-muted/50 transition-colors",H),e[0]=H,e[1]=u):u=e[1];const R=t?"gap-3":"gap-4";let h;e[2]!==R?(h=M("flex flex-col h-full relative",R),e[2]=R,e[3]=h):h=e[3];const Z=t?"sm":"md";let g;e[4]!==i||e[5]!==l||e[6]!==Z?(g=a.jsx(O,{icon:l,name:i,size:Z,className:"shadow-sm shrink-0"}),e[4]=i,e[5]=l,e[6]=Z,e[7]=g):g=e[7];const G=t?"text-sm":"text-base";let v;e[8]!==G?(v=M("flex items-center gap-2 font-medium min-w-0",G),e[8]=G,e[9]=v):v=e[9];let j;e[10]!==i?(j=a.jsx("span",{className:"truncate",children:i}),e[10]=i,e[11]=j):j=e[11];let N;e[12]!==t||e[13]!==_?(N=!t&&_&&a.jsx(U,{size:16,className:"text-success shrink-0"}),e[12]=t,e[13]=_,e[14]=N):N=e[14];let C;e[15]!==x||e[16]!==t?(C=!t&&!x&&a.jsx(Y,{size:16,className:"text-muted-foreground shrink-0"}),e[15]=x,e[16]=t,e[17]=C):C=e[17];let k;e[18]!==t||e[19]!==m?(k=t&&m&&a.jsx(re,{protocol:m}),e[18]=t,e[19]=m,e[20]=k):k=e[20];let b;e[21]!==C||e[22]!==k||e[23]!==v||e[24]!==j||e[25]!==N?(b=a.jsx(q,{asChild:!0,children:a.jsxs("div",{className:v,children:[j,N,C,k]})}),e[21]=C,e[22]=k,e[23]=v,e[24]=j,e[25]=N,e[26]=b):b=e[26];let w;e[27]!==i?(w=a.jsx("p",{children:i}),e[27]=i,e[28]=w):w=e[28];let y;e[29]!==x||e[30]!==t?(y=!t&&!x&&a.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[29]=x,e[30]=t,e[31]=y):y=e[31];let I;e[32]!==w||e[33]!==y?(I=a.jsxs(J,{children:[w,y]}),e[32]=w,e[33]=y,e[34]=I):I=e[34];let $;e[35]!==b||e[36]!==I?($=a.jsxs(K,{children:[b,I]}),e[35]=b,e[36]=I,e[37]=$):$=e[37];let L;e[38]!==f||e[39]!==t||e[40]!==p?(L=(p||f)&&a.jsx("div",{className:M("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:p||f}),e[38]=f,e[39]=t,e[40]=p,e[41]=L):L=e[41];let P;e[42]!==$||e[43]!==L?(P=a.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[$,L]})}),e[42]=$,e[43]=L,e[44]=P):P=e[44];let S;e[45]!==P||e[46]!==g?(S=a.jsxs("div",{className:"flex gap-3",children:[g,P]}),e[45]=P,e[46]=g,e[47]=S):S=e[47];let T;e[48]!==n?(T=n&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:n}),e[48]=n,e[49]=T):T=e[49];let E;e[50]!==n||e[51]!==t?(E=!n&&!t&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[50]=n,e[51]=t,e[52]=E):E=e[52];let z;e[53]!==d||e[54]!==c||e[55]!==t||e[56]!==r?(z=t&&a.jsxs(Q,{variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),r()},disabled:c,className:"w-full mt-auto cursor-pointer",children:[a.jsx(ee,{size:16}),c?"Connecting...":d||"Connect"]}),e[53]=d,e[54]=c,e[55]=t,e[56]=r,e[57]=z):z=e[57];let D;e[58]!==S||e[59]!==T||e[60]!==E||e[61]!==z||e[62]!==h?(D=a.jsxs("div",{className:h,children:[S,T,E,z]}),e[58]=S,e[59]=T,e[60]=E,e[61]=z,e[62]=h,e[63]=D):D=e[63];let A;return e[64]!==r||e[65]!==u||e[66]!==D?(A=a.jsx(se,{className:u,onClick:r,children:D}),e[64]=r,e[65]=u,e[66]=D,e[67]=A):A=e[67],A}function ce(s){const e=s.title||s.server.title||s.id||"Unnamed Item",l=s._meta?.["mcp.mesh"],i=l?.short_description||l?.mesh_description||s.server.description||null,n=s.server.icons?.[0]?.src||le(s.server.repository)||null,r=l?.verified??!1,o=(s.server.remotes?.length??0)>0,t=(s.server.packages?.length??0)>0,f=o||t;let m=e,c=null;if(e.includes("/")){const d=e.split("/");d.length>=2&&(c=d[0]||null,m=ie(e))}if(!c){const d=l?.scopeName,p=l?.appName;d&&p?c=`${d}/${p}`:d&&(c=d)}return l?.friendly_name&&(m=l.friendly_name),{icon:n,scopeName:c,displayName:m,description:i,isVerified:r,canInstall:f}}function Ne(s){const e=V.c(12),{items:l,title:i,onItemClick:n}=s;if(l.length===0)return null;let r;e[0]!==i?(r=i&&a.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:a.jsx("h2",{className:"text-lg font-medium",children:i})}),e[0]=i,e[1]=r):r=e[1];let o;if(e[2]!==l||e[3]!==n){let m;e[5]!==n?(m=c=>{const d=ce(c);return a.jsx(oe,{...d,onClick:()=>n(c)},c.id)},e[5]=n,e[6]=m):m=e[6],o=l.map(m),e[2]=l,e[3]=n,e[4]=o}else o=e[4];let t;e[7]!==o?(t=a.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=t):t=e[8];let f;return e[9]!==r||e[10]!==t?(f=a.jsxs("div",{className:"flex flex-col gap-4",children:[r,t]}),e[9]=r,e[10]=t,e[11]=f):f=e[11],f}export{Ne as M,oe as a,W as b,ie as e};