decocms 4.513.7 → 4.514.1

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 (525) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-C7oRfBvq.js → ActiveShapeUtils-VLdZwTWH.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-Dr8-y7L0.js → AlertCircle-Chv0zwfM.js} +1 -1
  3. package/dist/client/assets/{AreaChart-DxgH6rKB.js → AreaChart-xRBpMPmy.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-bw15twJo.js → ArrowLeft-P5MTc2kM.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-B5saELrq.js → ArrowUp-B9orjFiD.js} +1 -1
  6. package/dist/client/assets/{BarChart-BjUiD6cJ.js → BarChart-BLqplpUZ.js} +1 -1
  7. package/dist/client/assets/{Building02-CVSwXera.js → Building02-Bhj7SR-R.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-yDLikkrw.js → CartesianChart-BjPyBEv_.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-DF7o1YJ4.js → CategoricalChart-sikMJnQl.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-DS2hb5oP.js → CheckCircle-BOOTvtN7.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-CLuT1zAP.js → ChevronSelectorVertical-CKvNz838.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-Da3KAAR7.js → ChevronUp-UOllpHWY.js} +1 -1
  13. package/dist/client/assets/{Copy01-Dn1u-2Zy.js → Copy01-CsZzLh_E.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-DGwiu3_R.js → CreditCard01-Bji4icQZ.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-CNUAKCA1.js → DotsVertical-BaN_NJ8K.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-CNTq4Zkp.js → ErrorBarContext-D_W32jld.js} +1 -1
  17. package/dist/client/assets/{Globe04-B44qaniR.js → Globe04-BOt08kHg.js} +1 -1
  18. package/dist/client/assets/{Image01-hRrNF-M-.js → Image01-Ffg_Ow_R.js} +1 -1
  19. package/dist/client/assets/{Key01-DYxB6pya.js → Key01-BVuT8y7b.js} +1 -1
  20. package/dist/client/assets/{Link01-4vw5jtmA.js → Link01-Du3sgYhY.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-CIPqinmW.js → LinkBroken01-D3nON0AT.js} +1 -1
  22. package/dist/client/assets/Minus-qI5XA_m8.js +1 -0
  23. package/dist/client/assets/{Monitor01-Brf4xOs8.js → Monitor01-DPFmNrHU.js} +1 -1
  24. package/dist/client/assets/{Play-D0AVCW7c.js → Play-CKRH5LhK.js} +1 -1
  25. package/dist/client/assets/{Plus-CaUk_FLH.js → Plus-Dr-ysAIN.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-BgQgv_tf.js → ReferenceLine-DTjjPG4Y.js} +1 -1
  27. package/dist/client/assets/{SearchMd-DLWoWucQ.js → SearchMd-D_t1juud.js} +1 -1
  28. package/dist/client/assets/{Sector-N8qw7UTi.js → Sector-B0wid3BW.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-B4RZkB_f.js → ShoppingBag01-CVVvTwrH.js} +1 -1
  30. package/dist/client/assets/{Sun-B00MbfKh.js → Sun-Cgn1IQVJ.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-BzSCnRCW.js → SwitchHorizontal01-CEx9qTgC.js} +1 -1
  32. package/dist/client/assets/Tool01-Dys7Z5ab.js +1 -0
  33. package/dist/client/assets/{Trash01-CqUcDLSi.js → Trash01--FklAmhG.js} +1 -1
  34. package/dist/client/assets/{Upload01-DMpQSW4j.js → Upload01-BeT7SqGm.js} +1 -1
  35. package/dist/client/assets/{User01-B8psxoPR.js → User01-C3IPjJ5l.js} +1 -1
  36. package/dist/client/assets/{UserSquare-C87_Ow7C.js → UserSquare-CaU54i61.js} +1 -1
  37. package/dist/client/assets/{Users01-D8pzXgR8.js → Users01-BZXT5qAC.js} +1 -1
  38. package/dist/client/assets/{XClose-Dfy4H4Df.js → XClose-Cjrx49Z1.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-CGUQd16X.js → ZoomOut-Bi4ExiY7.js} +1 -1
  40. package/dist/client/assets/{access-gate-CDyNIkXG.js → access-gate-DMrwc1hr.js} +1 -1
  41. package/dist/client/assets/active-indicator-CCMhAsc_.js +1 -0
  42. package/dist/client/assets/add-connection-dialog-CtRrIzJJ.js +1 -0
  43. package/dist/client/assets/agent-analytics-Bnwy_Gqw.js +2 -0
  44. package/dist/client/assets/agent-app-ZIqUjeyR.js +1 -0
  45. package/dist/client/assets/agent-assets-DwMNxzbi.js +1 -0
  46. package/dist/client/assets/agent-automation-02Z5hyQu.js +20 -0
  47. package/dist/client/assets/agent-automations-CFPQlvb2.js +1 -0
  48. package/dist/client/assets/agent-connect-sources-Iuxi1z0Z.js +1 -0
  49. package/dist/client/assets/agent-deck-BbRRpKSj.js +1 -0
  50. package/dist/client/assets/agent-e2e-CF9xjkgd.js +1 -0
  51. package/dist/client/assets/agent-experiments-CFFDp5bP.js +1 -0
  52. package/dist/client/assets/agent-file-BMs4cJrj.js +1 -0
  53. package/dist/client/assets/agent-hosting-BkhWgDEP.js +1 -0
  54. package/dist/client/assets/agent-icon-sWZwj0Es.js +1 -0
  55. package/dist/client/assets/agent-library-B-Wls_Sg.js +1 -0
  56. package/dist/client/assets/agent-library-file-wqWJ8B3w.js +1 -0
  57. package/dist/client/assets/agent-monitor-5rJ2SPuO.js +1 -0
  58. package/dist/client/assets/agent-overview-c6SNk0le.js +1 -0
  59. package/dist/client/assets/agent-releases-D570Q4Mh.js +2 -0
  60. package/dist/client/assets/agent-settings-B8J4yqzP.js +1 -0
  61. package/dist/client/assets/agent-site-editor-code-KKCPuRYa.js +2 -0
  62. package/dist/client/assets/agent-site-editor-content-lFAgfEzB.js +1 -0
  63. package/dist/client/assets/agent-site-editor-preview-BtpIiq0Q.js +1 -0
  64. package/dist/client/assets/{agent-site-editor-Sbn76JsU.js → agent-site-editor-uS5XJ69l.js} +17 -17
  65. package/dist/client/assets/agent-view-DV9c8H6A.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-DC3OSkRt.js → agent-view-guard-D6Xp5buw.js} +1 -1
  67. package/dist/client/assets/agents-list-DOombnHa.js +1 -0
  68. package/dist/client/assets/ai-providers-tmz_JP24.js +6 -0
  69. package/dist/client/assets/alert-VfejUnRf.js +1 -0
  70. package/dist/client/assets/alert-dialog-XdiY2J_y.js +7 -0
  71. package/dist/client/assets/analytics-sections-ji2C2qln.js +1 -0
  72. package/dist/client/assets/api-keys-DGmfxaaK.js +1 -0
  73. package/dist/client/assets/api-keys-wu5nx6nR.js +1 -0
  74. package/dist/client/assets/app-editor-Cu9bylSk.js +1 -0
  75. package/dist/client/assets/{asset-utils-EMf-xj3-.js → asset-utils-CKM5FMXp.js} +1 -1
  76. package/dist/client/assets/{auth-BUCalyQg.js → auth-CR47t1GM.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-D0OSJt--.js → auth-catchall-B1w-i5RZ.js} +1 -1
  78. package/dist/client/assets/auth-entry-oRjY0cnq.js +1 -0
  79. package/dist/client/assets/{auth-split-layout-CqIIL5cn.js → auth-split-layout-CiycErWO.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-KmGsQ7Rw.js → authenticate-and-persist-oauth-D5GDklWs.js} +1 -1
  81. package/dist/client/assets/automation-list-row-CCxYnaw4.js +1 -0
  82. package/dist/client/assets/automation-runs-CbO3I7fA.js +1 -0
  83. package/dist/client/assets/automations-DFS7mz__.js +1 -0
  84. package/dist/client/assets/{autosend-DXt3gh_V.js → autosend-DnRIvL7O.js} +1 -1
  85. package/dist/client/assets/avatar-x6P8tYtf.js +1 -0
  86. package/dist/client/assets/badge-0pHsypn4.js +1 -0
  87. package/dist/client/assets/block-document-D_lHlXH9.js +3 -0
  88. package/dist/client/assets/{blocks-preview-workspace-context-BW_d0PQH.js → blocks-preview-workspace-context--l_lynd7.js} +1 -1
  89. package/dist/client/assets/blocks-tab-states-llhicB0-.js +20 -0
  90. package/dist/client/assets/blog-schema-XUQos-wQ.js +1 -0
  91. package/dist/client/assets/buckets-FE463cqq.js +1 -0
  92. package/dist/client/assets/{build-improve-prompt-doc-Bc54QDB4.js → build-improve-prompt-doc-R7g2gEoJ.js} +1 -1
  93. package/dist/client/assets/{calendar-Xs6wdWPB.js → calendar-Dt43s5dd.js} +1 -1
  94. package/dist/client/assets/{capability-load-error-CTAYiETg.js → capability-load-error-BwHvNdC3.js} +1 -1
  95. package/dist/client/assets/category-editor-ChXNS4Vx.js +1 -0
  96. package/dist/client/assets/{chart-CORGJWsK.js → chart-BtbkFiWd.js} +1 -1
  97. package/dist/client/assets/{chat-context-q6pkU4Vf.js → chat-context-DHXBy843.js} +6 -6
  98. package/dist/client/assets/{chat-draft-CxsMQwFW.js → chat-draft-DZ2UGoju.js} +1 -1
  99. package/dist/client/assets/checkbox-J7NM8Nxa.js +1 -0
  100. package/dist/client/assets/choose-editor-sfJnCc8D.js +1 -0
  101. package/dist/client/assets/{cli-auth-success-SvU9VUFl.js → cli-auth-success-C3tfQ2C3.js} +1 -1
  102. package/dist/client/assets/{client-icons-Bf_jg3TD.js → client-icons-Cv4YCEZF.js} +1 -1
  103. package/dist/client/assets/cms-settings-editor-DfS-CnoD.js +1 -0
  104. package/dist/client/assets/{collapsible-BY1Seh2g.js → collapsible-C5IcK6_6.js} +1 -1
  105. package/dist/client/assets/collection-detail-CE3RN1bQ.js +1 -0
  106. package/dist/client/assets/collection-display-button-XyzcBi3s.js +1 -0
  107. package/dist/client/assets/{collection-search-B-5U_qP0.js → collection-search-EaUyhqe3.js} +1 -1
  108. package/dist/client/assets/collection-table-wrapper-AoIZEo7k.js +1 -0
  109. package/dist/client/assets/collection-tabs-CvrE77Fy.js +1 -0
  110. package/dist/client/assets/{column-rules-qdNVr_CJ.js → column-rules-Uuv3kpod.js} +1 -1
  111. package/dist/client/assets/combobox-GJu0SOmd.js +1 -0
  112. package/dist/client/assets/{coming-soon-page-DArmsjGV.js → coming-soon-page-C252kDGK.js} +1 -1
  113. package/dist/client/assets/command-CxL64Rh6.js +1 -0
  114. package/dist/client/assets/companion-mcps-section-dLU7TCqp.js +1 -0
  115. package/dist/client/assets/config-MIIbcSQe.js +1 -0
  116. package/dist/client/assets/connect-CPLWL7jD.js +9 -0
  117. package/dist/client/assets/connect-layout-DKbxeOaE.js +1 -0
  118. package/dist/client/assets/{connection-ByKWMYw_.js → connection-Dwyi3srb.js} +1 -1
  119. package/dist/client/assets/{connection-card-fTcKF10T.js → connection-card-Fd6iPvoW.js} +1 -1
  120. package/dist/client/assets/connection-detail-2wc1W9tk.js +1 -0
  121. package/dist/client/assets/connection-form-helpers-Be0GZ2Fr.js +1 -0
  122. package/dist/client/assets/connections-CXtzZLwk.js +1 -0
  123. package/dist/client/assets/content-tab-C6Yd-gaA.js +22 -0
  124. package/dist/client/assets/context-CTmvExSC.js +1 -0
  125. package/dist/client/assets/{context-menu-BXueaN2d.js → context-menu-Sl80TmNB.js} +1 -1
  126. package/dist/client/assets/context-shell-Luc3_ZNi.js +197 -0
  127. package/dist/client/assets/{core.esm-CRtLiDZz.js → core.esm-3Ntqpx6o.js} +2 -2
  128. package/dist/client/assets/{create-organization-dialog-C4Y0emfE.js → create-organization-dialog-Y8ioappi.js} +1 -1
  129. package/dist/client/assets/{daily-pulse-CIrtyrdA.js → daily-pulse-BokyOzAt.js} +1 -1
  130. package/dist/client/assets/discover-NdJwdhLd.js +1 -0
  131. package/dist/client/assets/{domain-settings-B0NQXKWl.js → domain-settings-DjKwxNmK.js} +1 -1
  132. package/dist/client/assets/{drawer-CgIff6c2.js → drawer-2qaZT3bV.js} +1 -1
  133. package/dist/client/assets/{editor-B3mInGrz.js → editor-D4klHvzy.js} +1 -1
  134. package/dist/client/assets/editor-classes-BBdx-JSY.js +1 -0
  135. package/dist/client/assets/{empty-state-CrGmAT1k.js → empty-state-CLeOp2iF.js} +1 -1
  136. package/dist/client/assets/empty-state-kKu94zqY.js +1 -0
  137. package/dist/client/assets/{extract-connection-data-BINlvp6q.js → extract-connection-data-BRxw-vDj.js} +1 -1
  138. package/dist/client/assets/{feature-gate-CO2kUTpS.js → feature-gate-DtQbinUr.js} +1 -1
  139. package/dist/client/assets/{feature-paywall-pO5N9aZ0.js → feature-paywall-BvbLf2vN.js} +1 -1
  140. package/dist/client/assets/file-explorer-CRhBeOh6.js +2 -0
  141. package/dist/client/assets/file-preview-sewMgnQS.js +1 -0
  142. package/dist/client/assets/file-share-button-CvBuOPBB.js +3 -0
  143. package/dist/client/assets/{file-type-icon-D66MjYUZ.js → file-type-icon-L81OHsVz.js} +1 -1
  144. package/dist/client/assets/folder-icon-yKBQ26US.js +2 -0
  145. package/dist/client/assets/{form-BDq24hv6.js → form-oexeEAr5.js} +1 -1
  146. package/dist/client/assets/general-DjPGqCh1.js +1 -0
  147. package/dist/client/assets/home-x3m8wBSJ.js +1 -0
  148. package/dist/client/assets/{hosted-publish-feedback-BWTEMXo-.js → hosted-publish-feedback-GSHWRd1_.js} +1 -1
  149. package/dist/client/assets/{icon-button-D7DkXPm6.js → icon-button-DfIZISrS.js} +1 -1
  150. package/dist/client/assets/{index-CnFj2VzS.js → index-5UrkGUsp.js} +1 -1
  151. package/dist/client/assets/index-B-ZICxtp.js +1 -0
  152. package/dist/client/assets/{index-2AvhxrGF.js → index-B50XV3gp.js} +1 -1
  153. package/dist/client/assets/{index-C15EALb7.js → index-BAK2VowX.js} +1 -1
  154. package/dist/client/assets/index-BNHeiq0Q.js +1 -0
  155. package/dist/client/assets/index-C0_wKyXa.js +4 -0
  156. package/dist/client/assets/index-CWfwo1z9.css +1 -0
  157. package/dist/client/assets/{index-BpdNOm6A.js → index-CYAP4xje.js} +1 -1
  158. package/dist/client/assets/index-CiDUJoU5.js +4 -0
  159. package/dist/client/assets/{index-BAMJsKZC.js → index-Cyd8Z3z7.js} +23 -23
  160. package/dist/client/assets/{index-L2sJXZRT.js → index-DlkvGq_Y.js} +1 -1
  161. package/dist/client/assets/index-DlxFtSYK.js +2 -0
  162. package/dist/client/assets/{index-DCfyI4nr.js → index-DpopmD-d.js} +1 -1
  163. package/dist/client/assets/{index-Dfl75K1t.js → index-DwUSgMrk.js} +38 -38
  164. package/dist/client/assets/{index-CBygj5xH.js → index-no3MX84i.js} +2 -2
  165. package/dist/client/assets/index-rABmEORU.js +5 -0
  166. package/dist/client/assets/{index-redirect-abhy0hCb.js → index-redirect-B1_VIFp-.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-ClHpbKHL.js → infiniteQueryObserver-fD19WDlu.js} +1 -1
  168. package/dist/client/assets/infra-billing-DeTird2m.js +1 -0
  169. package/dist/client/assets/input-BcdjLg5X.js +17 -0
  170. package/dist/client/assets/input-YsL3Z14x.js +1 -0
  171. package/dist/client/assets/{integration-icon-CjRJJK7e.js → integration-icon-CGlpUTQF.js} +1 -1
  172. package/dist/client/assets/{jira-icon-DErmkgBq.js → jira-icon-DpMHb8bf.js} +1 -1
  173. package/dist/client/assets/{label-vST9B_zD.js → label-9iahSV8V.js} +1 -1
  174. package/dist/client/assets/{layout-Gxe43rXe.js → layout-4cUTvlr5.js} +1 -1
  175. package/dist/client/assets/{legacy-agents-deep-BfHNa36K.js → legacy-agents-deep-CE1ZIf89.js} +1 -1
  176. package/dist/client/assets/{legacy-main-redirect-DYsSPAs0.js → legacy-main-redirect-BOOZ04G2.js} +1 -1
  177. package/dist/client/assets/library-BzLsSIpk.js +1 -0
  178. package/dist/client/assets/{location-BjlyegC2.js → location-V0VwTJTt.js} +1 -1
  179. package/dist/client/assets/{login-W2r99PnM.js → login-Di_zn9Rr.js} +1 -1
  180. package/dist/client/assets/{markdown-WjT3O7Yl.js → markdown-DQgkOB--.js} +3 -3
  181. package/dist/client/assets/{mcp-app-renderer-DRnWxtxP.js → mcp-app-renderer-E0Rb-X88.js} +2 -2
  182. package/dist/client/assets/{mcp-oauth-DhGcrPZn.js → mcp-oauth-Bvn81zXq.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-tbYTQeai.js → mcp-oauth-DQ15yEaL.js} +1 -1
  184. package/dist/client/assets/members-4brJt64W.js +1 -0
  185. package/dist/client/assets/{memory-DF3z-jf4.js → memory-C7XTx0yg.js} +2 -2
  186. package/dist/client/assets/mini-report-page-Dd9QKBqa.js +1 -0
  187. package/dist/client/assets/mock-board-Ds2_Ixhv.js +81 -0
  188. package/dist/client/assets/{monaco-editor-Dn76gAcx.js → monaco-editor-pm8M8s-N.js} +2 -2
  189. package/dist/client/assets/monitoring-GFsyOhLD.js +1 -0
  190. package/dist/client/assets/monitoring-stats-row-DSg2pS6E.js +1 -0
  191. package/dist/client/assets/multi-select-uR1MVHE3.js +1 -0
  192. package/dist/client/assets/{mustache-De5yIPqS.js → mustache-Kcmg3c_A.js} +1 -1
  193. package/dist/client/assets/{new-project-dialog-DWBJxe2s.js → new-project-dialog-zI2HVFQT.js} +1 -1
  194. package/dist/client/assets/{oauth-callback-D5U2NrXh.js → oauth-callback-B-8An67A.js} +1 -1
  195. package/dist/client/assets/{oauth-callback-ai-provider-DxPpDYvA.js → oauth-callback-ai-provider-C2GrwmUm.js} +1 -1
  196. package/dist/client/assets/onboarding-C5CJ17Jm.js +1 -0
  197. package/dist/client/assets/openai-conversation-B8Y0DM4W.js +3 -0
  198. package/dist/client/assets/{optimistic-project-sidebar-views-C0cO7F22.js → optimistic-project-sidebar-views-DbcREcFy.js} +1 -1
  199. package/dist/client/assets/{order-monitor-day-QXWmu69V.js → order-monitor-day-CkXiopdS.js} +1 -1
  200. package/dist/client/assets/organization-choice-BsHIbX2m.js +1 -0
  201. package/dist/client/assets/{orgs-BxWXdeOL.js → orgs-CYS6Kjbu.js} +1 -1
  202. package/dist/client/assets/{page-seo-form-CG-qEPcj.js → page-seo-form-DiFnoI3j.js} +1 -1
  203. package/dist/client/assets/pair-BVAQv2mv.js +48 -0
  204. package/dist/client/assets/plan-CFOdn8Gq.js +1 -0
  205. package/dist/client/assets/{plan-ladder-BYQb9LH4.js → plan-ladder-hFJpqSg5.js} +1 -1
  206. package/dist/client/assets/popover-kKTDdvYS.js +1 -0
  207. package/dist/client/assets/post-calendar-fLDkPFOG.js +1 -0
  208. package/dist/client/assets/post-editor-kAgu7v4k.js +2 -0
  209. package/dist/client/assets/{preview-content-DKsnwXbk.js → preview-content-BmpJoYAF.js} +1 -1
  210. package/dist/client/assets/{preview-dialog-CbP43Gmi.js → preview-dialog-1doPIjMd.js} +1 -1
  211. package/dist/client/assets/{preview-panel-BcsdNlh3.js → preview-panel-CD98bDar.js} +1 -1
  212. package/dist/client/assets/preview-tab-CNqKfb-E.js +551 -0
  213. package/dist/client/assets/product-picker-dialog-D5ZR-4jN.js +1 -0
  214. package/dist/client/assets/profile-Bx09OmQG.js +1 -0
  215. package/dist/client/assets/project-app-view-i9ZXlEA5.js +1 -0
  216. package/dist/client/assets/project-apps-DjY-pfpC.js +1 -0
  217. package/dist/client/assets/project-feed-AQtypsNP.js +1 -0
  218. package/dist/client/assets/project-icon-DzYy4wKu.js +1 -0
  219. package/dist/client/assets/project-reports-CkkyEEQq.js +1 -0
  220. package/dist/client/assets/project-tasks-C6uZ3VD_.js +1 -0
  221. package/dist/client/assets/projects-Bl4qWgcF.js +1 -0
  222. package/dist/client/assets/{projects-empty-state-DC2csJcM.js → projects-empty-state-VSVQUIX3.js} +1 -1
  223. package/dist/client/assets/{prompts-CZxZPA4q.js → prompts-XJP0lHjx.js} +1 -1
  224. package/dist/client/assets/record-editor-DQnsC6va.js +1 -0
  225. package/dist/client/assets/redirect-editor-zBgb8pHu.js +1 -0
  226. package/dist/client/assets/{reports-enM7SgQ5.js → reports-BE9tpjsQ.js} +2 -2
  227. package/dist/client/assets/reports-BkHs6ceB.js +1 -0
  228. package/dist/client/assets/reports-onboarding-djvrypII.js +1 -0
  229. package/dist/client/assets/reports-tab-DTd-sN5F.js +2 -0
  230. package/dist/client/assets/repositories-jscn92Gx.js +1 -0
  231. package/dist/client/assets/repositories-lD386pbK.js +1 -0
  232. package/dist/client/assets/{repository-binding-CeR4BnTI.js → repository-binding-Ctv5jACU.js} +1 -1
  233. package/dist/client/assets/{repository-import-picker-Cyu_oqW_.js → repository-import-picker-DXFAIhGC.js} +1 -1
  234. package/dist/client/assets/{repository-picker-nkOuiQyx.js → repository-picker-C-87Ak81.js} +1 -1
  235. package/dist/client/assets/{require-capability-D9vWIFzq.js → require-capability-BOhrH32F.js} +1 -1
  236. package/dist/client/assets/{required-auth-layout-DLWEf_ml.js → required-auth-layout-BOZelCHP.js} +1 -1
  237. package/dist/client/assets/{reset-password-Di43QH7d.js → reset-password-D_RSIa3W.js} +1 -1
  238. package/dist/client/assets/{resizable-DrblSvH-.js → resizable-CcGplCtq.js} +1 -1
  239. package/dist/client/assets/{resolve-tab-icon-Cn1kjNtM.js → resolve-tab-icon-Dy1gZT8r.js} +1 -1
  240. package/dist/client/assets/review-settings-DJRBjChO.js +1 -0
  241. package/dist/client/assets/roles-IPKUXurs.js +1 -0
  242. package/dist/client/assets/route-CEyEwTNJ.js +1 -0
  243. package/dist/client/assets/route-DYdh0lyb.js +1 -0
  244. package/dist/client/assets/route-DkxQ33qF.js +1 -0
  245. package/dist/client/assets/{sandbox-lifecycle-context-B7L9kJQk.js → sandbox-lifecycle-context-B_iyl6NM.js} +1 -1
  246. package/dist/client/assets/{schema-BnxatK0k.js → schema-C9VtMeBM.js} +1 -1
  247. package/dist/client/assets/{schema-DweHpmdK.js → schema-CIU-vy-M.js} +1 -1
  248. package/dist/client/assets/{scroll-area-D4jamxk5.js → scroll-area-BgPjdFUv.js} +1 -1
  249. package/dist/client/assets/search-input-6roNTbiB.js +1 -0
  250. package/dist/client/assets/search-toggle-6uVgZqDd.js +1 -0
  251. package/dist/client/assets/{secret-ciphertext-uupbc2jA.js → secret-ciphertext-DFilJK15.js} +1 -1
  252. package/dist/client/assets/{secret-picker-CZg0ZavN.js → secret-picker-DRod6Suz.js} +1 -1
  253. package/dist/client/assets/secrets-wckAePsp.js +1 -0
  254. package/dist/client/assets/sections-editor-DvRXHJYg.js +4 -0
  255. package/dist/client/assets/{sections-ClTsoWOj.js → sections-ogB-svMV.js} +1 -1
  256. package/dist/client/assets/select-DSSug2fd.js +1 -0
  257. package/dist/client/assets/select-model-qiewDWcs.js +1 -0
  258. package/dist/client/assets/seo-editor-BTHpHgYq.js +1 -0
  259. package/dist/client/assets/{separator-x0saGhsc.js → separator-RD1Gkb6T.js} +1 -1
  260. package/dist/client/assets/settings-tab-_PnJc2CP.js +1 -0
  261. package/dist/client/assets/sheet-B-tTREXV.js +1 -0
  262. package/dist/client/assets/shell-layout-CCN75UAi.js +1 -0
  263. package/dist/client/assets/site-editor-59L0Aud8.js +1 -0
  264. package/dist/client/assets/{site-editor-toast-BBiagqFO.js → site-editor-toast-CWvkPJE7.js} +1 -1
  265. package/dist/client/assets/skills-BTCtj4sL.js +1 -0
  266. package/dist/client/assets/slider-axq58KTi.js +1 -0
  267. package/dist/client/assets/{sortable.esm-CiWkMI5k.js → sortable.esm-DUpSK4fM.js} +1 -1
  268. package/dist/client/assets/{sso-CbBgQbQ6.js → sso-DIJKG0Gf.js} +1 -1
  269. package/dist/client/assets/{suggestion-MTVcBuMB.js → suggestion-Be-l0Vt9.js} +2 -2
  270. package/dist/client/assets/switch-CPLmKtep.js +1 -0
  271. package/dist/client/assets/{symbol-3z2SP5L0.js → symbol-Bevi1KjX.js} +1 -1
  272. package/dist/client/assets/synced-repos-CDGSA9__.js +1 -0
  273. package/dist/client/assets/{tab-icon-glyph-D0nUUha7.js → tab-icon-glyph-DYfErhsy.js} +1 -1
  274. package/dist/client/assets/{table-34IUcwFv.js → table-B1WNxn6C.js} +1 -1
  275. package/dist/client/assets/tabs-CBoEFGVa.js +1 -0
  276. package/dist/client/assets/task-assignee-avatar-DNUvYoRs.js +1 -0
  277. package/dist/client/assets/{task-board-HULGRfOW.js → task-board-CDUMGTb-.js} +1 -1
  278. package/dist/client/assets/{task-route-Ce0gmf6w.js → task-route-BpUah0sB.js} +1 -1
  279. package/dist/client/assets/{task-status-EXrg0ZVz.js → task-status-Bxq1hmIf.js} +1 -1
  280. package/dist/client/assets/taskboard-analytics-DiMdGRcj.js +1 -0
  281. package/dist/client/assets/tasks-C43XRe6P.js +4 -0
  282. package/dist/client/assets/tasks-D3vb1Iwc.js +1 -0
  283. package/dist/client/assets/textarea-CQ_TkrdE.js +1 -0
  284. package/dist/client/assets/thread-analytics-D_JGJCHX.js +1 -0
  285. package/dist/client/assets/{thread-intent-CLVOCoii.js → thread-intent-DYNUY6FR.js} +1 -1
  286. package/dist/client/assets/{thread-route-Dcyau0Uq.js → thread-route-Cr8HKNDQ.js} +1 -1
  287. package/dist/client/assets/thread-route-xZCxiRJg.js +1 -0
  288. package/dist/client/assets/thread-sheet-body-CRJYPU36.js +1 -0
  289. package/dist/client/assets/{time-range-picker-Cnad4hdN.js → time-range-picker-CsKO958P.js} +1 -1
  290. package/dist/client/assets/toggle-group-CaNHwi3W.js +1 -0
  291. package/dist/client/assets/{tool-namespace-B34zfZd8.js → tool-namespace-D8-HQWQE.js} +1 -1
  292. package/dist/client/assets/{toolbar-icon-button-Bk8X_nOI.js → toolbar-icon-button-pGWMZONn.js} +1 -1
  293. package/dist/client/assets/{tooltip-BntBAGAM.js → tooltip-7xQKXZXx.js} +1 -1
  294. package/dist/client/assets/{tooltipContext-DXMyjDX5.js → tooltipContext-BM_DUTQp.js} +1 -1
  295. package/dist/client/assets/{track-BzAXAHNU.js → track-5WqIg6Tn.js} +1 -1
  296. package/dist/client/assets/{types-Ep1zDBBM.js → types-DmsgcF8m.js} +6 -6
  297. package/dist/client/assets/{url-slug-DUZRhSs8.js → url-slug-CMhgSj9A.js} +1 -1
  298. package/dist/client/assets/{usage-stats-BqiobWm8.js → usage-stats-BKxLD2_l.js} +2 -2
  299. package/dist/client/assets/{use-ai-providers-BjL_410_.js → use-ai-providers-Dp4Hkjtx.js} +1 -1
  300. package/dist/client/assets/{use-automations-D3fYuk85.js → use-automations-J0jLeJwk.js} +1 -1
  301. package/dist/client/assets/{use-autosave-C5kOmKNl.js → use-autosave-DmDY7YGA.js} +1 -1
  302. package/dist/client/assets/{use-chat-layout-state-pFcrZZ0z.js → use-chat-layout-state-DeeoSPAs.js} +1 -1
  303. package/dist/client/assets/{use-clock-tick-B0Rju5iF.js → use-clock-tick-C6h2MMIi.js} +1 -1
  304. package/dist/client/assets/use-connect-companion-hQGadPnV.js +1 -0
  305. package/dist/client/assets/{use-connection-uNG89bZG.js → use-connection-mXOC3Xuo.js} +1 -1
  306. package/dist/client/assets/{use-content-sync-B0qEZVBT.js → use-content-sync-mkwV3WFd.js} +1 -1
  307. package/dist/client/assets/{use-copy-C3XLF-5W.js → use-copy-D9a2GtFe.js} +1 -1
  308. package/dist/client/assets/{use-create-virtual-mcp-BKCuACo2.js → use-create-virtual-mcp-DtlfKOSb.js} +1 -1
  309. package/dist/client/assets/{use-date-fns-locale-BwLo95LG.js → use-date-fns-locale-Dv1VJI3I.js} +1 -1
  310. package/dist/client/assets/{use-debounced-autosave-XLYKP6s7.js → use-debounced-autosave-BZlwz5E9.js} +1 -1
  311. package/dist/client/assets/{use-debounced-value-3xzq4nqk.js → use-debounced-value-DJVnkGFg.js} +1 -1
  312. package/dist/client/assets/{use-deco-credits-D-50LuKO.js → use-deco-credits-BCAKdpOu.js} +1 -1
  313. package/dist/client/assets/{use-decopilot-events-lsitv-U4.js → use-decopilot-events-DYkAp_m7.js} +1 -1
  314. package/dist/client/assets/use-delete-connection-C00H7ulN.js +1 -0
  315. package/dist/client/assets/{use-deployment-admin-BJum6mLZ.js → use-deployment-admin-ByxIcPI9.js} +1 -1
  316. package/dist/client/assets/{use-fast-preview-draft-url-2-EI09Yr.js → use-fast-preview-draft-url-apL5qVv1.js} +1 -1
  317. package/dist/client/assets/{use-file-configs-DfE7CnIY.js → use-file-configs-DJCoczIU.js} +1 -1
  318. package/dist/client/assets/{use-inbox-feed-CiHmMhAj.js → use-inbox-feed-CgTcDvrj.js} +1 -1
  319. package/dist/client/assets/{use-infinite-scroll-BkN3ZRt7.js → use-infinite-scroll-AsnNIlBn.js} +1 -1
  320. package/dist/client/assets/{use-join-requests-D5yahqJC.js → use-join-requests-BJCQZeJg.js} +1 -1
  321. package/dist/client/assets/{use-main-panel-tabs-Ce_y4iMs.js → use-main-panel-tabs-CwksoiNK.js} +1 -1
  322. package/dist/client/assets/{use-main-schema-v8-DEN4NEnl.js → use-main-schema-v8-Cys0il1A.js} +1 -1
  323. package/dist/client/assets/{use-mcp-auth-status-Cs99DRAT.js → use-mcp-auth-status-mE5X1aBV.js} +1 -1
  324. package/dist/client/assets/use-mcp-client-CvE7itXw.js +10 -0
  325. package/dist/client/assets/{use-mcp-prompts-BuuMlmL5.js → use-mcp-prompts-B71f8Oap.js} +1 -1
  326. package/dist/client/assets/{use-mcp-tools-CYJBaX_7.js → use-mcp-tools-DT06t5rX.js} +1 -1
  327. package/dist/client/assets/{use-members-CrbKs_C5.js → use-members-CAjyx4dy.js} +1 -1
  328. package/dist/client/assets/{use-mobile-CoktYqCA.js → use-mobile-D6Ou0NEP.js} +1 -1
  329. package/dist/client/assets/{use-navigate-to-agent-CfMrStJi.js → use-navigate-to-agent-DqPVTZYN.js} +1 -1
  330. package/dist/client/assets/{use-open-billing-url-CNnCylra.js → use-open-billing-url-NfOqGe8U.js} +1 -1
  331. package/dist/client/assets/{use-org-auth-client-C0BFh8TT.js → use-org-auth-client-D54JUqPS.js} +1 -1
  332. package/dist/client/assets/{use-org-fs-T9B43KSX.js → use-org-fs-CnHNkGa0.js} +1 -1
  333. package/dist/client/assets/{use-org-repo-syncs-BEqn98wH.js → use-org-repo-syncs-B-iMqLC4.js} +1 -1
  334. package/dist/client/assets/{use-org-sso-BbRo0Ut_.js → use-org-sso-CWjER8s_.js} +1 -1
  335. package/dist/client/assets/{use-organization-roles-lcGgKXoG.js → use-organization-roles-BaFyhF9z.js} +1 -1
  336. package/dist/client/assets/{use-organization-settings-DX9QxFXB.js → use-organization-settings-B4xXaxr4.js} +1 -1
  337. package/dist/client/assets/use-panel-navigate-CwRBX20z.js +1 -0
  338. package/dist/client/assets/{use-project-native-view-presence-tyHZj_Ny.js → use-project-native-view-presence-fFpbo52Y.js} +1 -1
  339. package/dist/client/assets/{use-project-scope-jYZSUZz_.js → use-project-scope-CwXHOags.js} +1 -1
  340. package/dist/client/assets/use-recent-apps-Bm3Mq1hd.js +1 -0
  341. package/dist/client/assets/{use-releases-CfA2F4jK.js → use-releases-COy4R50l.js} +1 -1
  342. package/dist/client/assets/{use-reports-diagnostic-Dju7BGsx.js → use-reports-diagnostic-Bf7x0h8K.js} +1 -1
  343. package/dist/client/assets/{use-secrets-CfU9WX5Q.js → use-secrets-Db7kDjN7.js} +1 -1
  344. package/dist/client/assets/use-section-preview-base-yuSGDzoI.js +1 -0
  345. package/dist/client/assets/use-sidebar-collapsed-2XEtdu2i.js +1 -0
  346. package/dist/client/assets/{use-tags-DqawlBDR.js → use-tags-BPUktrrg.js} +1 -1
  347. package/dist/client/assets/{use-task-board-analytics-CCVxOb5z.js → use-task-board-analytics-Dt--SO4K.js} +1 -1
  348. package/dist/client/assets/{use-task-board-events-C_nDyMhs.js → use-task-board-events-DHmzNQpi.js} +1 -1
  349. package/dist/client/assets/{use-task-board-item-prs-Djpb1Kqq.js → use-task-board-item-prs-DpiWhUD6.js} +1 -1
  350. package/dist/client/assets/{use-task-metadata-RdAp3Psx.js → use-task-metadata-DJlGx95B.js} +1 -1
  351. package/dist/client/assets/{use-thread-analytics-vpAXd4tf.js → use-thread-analytics-RjdStU-G.js} +1 -1
  352. package/dist/client/assets/{use-thread-outputs-AQZDZ-Me.js → use-thread-outputs-hOt5_FqT.js} +1 -1
  353. package/dist/client/assets/useInfiniteQuery-DLjfiCcz.js +1 -0
  354. package/dist/client/assets/{useQueries-DYxCze5b.js → useQueries-CTk9HeNu.js} +1 -1
  355. package/dist/client/assets/useSuspenseInfiniteQuery-DJIJLbRA.js +1 -0
  356. package/dist/client/assets/users-DSisYmgQ.js +1 -0
  357. package/dist/client/assets/{utils-CsCjfn_2.js → utils-BtlQk18r.js} +1 -1
  358. package/dist/client/assets/variant-calendar-DM6JVe9j.js +1 -0
  359. package/dist/client/assets/{variant-draft-pointer-D9wG_BAr.js → variant-draft-pointer-DGsbM6lw.js} +1 -1
  360. package/dist/client/assets/{virtual-mcp-BRjQCMrx.js → virtual-mcp-C-TlHAqf.js} +1 -1
  361. package/dist/client/assets/{watch-sse-pool-CpyfbzKA.js → watch-sse-pool-wUe9D5Rq.js} +1 -1
  362. package/dist/client/index.html +2 -2
  363. package/dist/server/server.js +484 -484
  364. package/package.json +1 -1
  365. package/dist/client/assets/Tool01-CCvEj2ig.js +0 -1
  366. package/dist/client/assets/add-connection-dialog-COYKS3-h.js +0 -1
  367. package/dist/client/assets/agent-analytics-Cjimp4I3.js +0 -2
  368. package/dist/client/assets/agent-app-Dm2Q_Y28.js +0 -1
  369. package/dist/client/assets/agent-assets-9wdWM8im.js +0 -1
  370. package/dist/client/assets/agent-automation-Dse0O06l.js +0 -20
  371. package/dist/client/assets/agent-automations-eFJFkh79.js +0 -1
  372. package/dist/client/assets/agent-connect-sources-CE_fusHE.js +0 -1
  373. package/dist/client/assets/agent-deck-Dl8H6e7Z.js +0 -1
  374. package/dist/client/assets/agent-e2e-S-3oUZjD.js +0 -1
  375. package/dist/client/assets/agent-experiments-BZ5s-pYA.js +0 -1
  376. package/dist/client/assets/agent-file-CGHwvl0k.js +0 -1
  377. package/dist/client/assets/agent-hosting-CIoSw33S.js +0 -1
  378. package/dist/client/assets/agent-icon-Ck1HHwjS.js +0 -1
  379. package/dist/client/assets/agent-library-BkTWLlnk.js +0 -1
  380. package/dist/client/assets/agent-library-file-BS42xyZD.js +0 -1
  381. package/dist/client/assets/agent-monitor-BO8PHHjA.js +0 -1
  382. package/dist/client/assets/agent-overview-DpfQ-aTA.js +0 -1
  383. package/dist/client/assets/agent-releases-BrFQqDPl.js +0 -2
  384. package/dist/client/assets/agent-settings-BBP4ibAV.js +0 -1
  385. package/dist/client/assets/agent-site-editor-code-CJOa5UpN.js +0 -2
  386. package/dist/client/assets/agent-site-editor-content-pcCCjT9D.js +0 -1
  387. package/dist/client/assets/agent-site-editor-preview-BlzuE9E3.js +0 -1
  388. package/dist/client/assets/agent-view-CQpCMbZg.js +0 -1
  389. package/dist/client/assets/agents-list-CDK_yCRI.js +0 -1
  390. package/dist/client/assets/ai-providers-WyXFCfKK.js +0 -6
  391. package/dist/client/assets/alert-DDsKGOlA.js +0 -1
  392. package/dist/client/assets/alert-dialog-CdX0WJgE.js +0 -7
  393. package/dist/client/assets/analytics-sections-C0cA72FI.js +0 -1
  394. package/dist/client/assets/api-keys-BiACkSl3.js +0 -1
  395. package/dist/client/assets/api-keys-vaFVbldn.js +0 -1
  396. package/dist/client/assets/app-editor-DAppi0wZ.js +0 -1
  397. package/dist/client/assets/auth-entry-0MItOYPB.js +0 -1
  398. package/dist/client/assets/automation-list-row-BthCY9eh.js +0 -1
  399. package/dist/client/assets/automation-runs-o6LdIvao.js +0 -1
  400. package/dist/client/assets/automations-CrS9UK_O.js +0 -1
  401. package/dist/client/assets/avatar-CEkqz-fA.js +0 -1
  402. package/dist/client/assets/badge-BzleDbER.js +0 -1
  403. package/dist/client/assets/block-document-CyrqLFxN.js +0 -3
  404. package/dist/client/assets/blocks-tab-states-S9Kv7CBl.js +0 -20
  405. package/dist/client/assets/blog-schema-C4_MnlKC.js +0 -1
  406. package/dist/client/assets/board-analytics-BF-SADkB.js +0 -1
  407. package/dist/client/assets/buckets-BlH967CC.js +0 -1
  408. package/dist/client/assets/category-editor-CtoEGxaZ.js +0 -1
  409. package/dist/client/assets/checkbox-CFJH9BPU.js +0 -1
  410. package/dist/client/assets/choose-editor-CYwXqgpB.js +0 -1
  411. package/dist/client/assets/cms-settings-editor-DtCgs5b4.js +0 -1
  412. package/dist/client/assets/collection-detail-B2jwEnTE.js +0 -1
  413. package/dist/client/assets/collection-display-button-D9eLaj8f.js +0 -1
  414. package/dist/client/assets/collection-table-wrapper-C3Sq91on.js +0 -1
  415. package/dist/client/assets/collection-tabs-CNPABMbS.js +0 -1
  416. package/dist/client/assets/combobox-CNtAcM6N.js +0 -1
  417. package/dist/client/assets/command-Ci3cf65Q.js +0 -1
  418. package/dist/client/assets/companion-mcps-section-CAp5mGvk.js +0 -1
  419. package/dist/client/assets/config-BDyxSbhG.js +0 -1
  420. package/dist/client/assets/connect-CfYMlBCa.js +0 -9
  421. package/dist/client/assets/connect-layout-Dtk5q8Ff.js +0 -1
  422. package/dist/client/assets/connection-detail-DauHKo-b.js +0 -1
  423. package/dist/client/assets/connection-form-helpers-BUWBJaHi.js +0 -1
  424. package/dist/client/assets/connections-o17r4lvj.js +0 -1
  425. package/dist/client/assets/content-tab-CDIQdFY6.js +0 -22
  426. package/dist/client/assets/context-BILSO9Oc.js +0 -1
  427. package/dist/client/assets/context-shell-nnrd7FeT.js +0 -30
  428. package/dist/client/assets/discover-Bw3u4SUp.js +0 -1
  429. package/dist/client/assets/editor-classes-Dh7s7KNE.js +0 -1
  430. package/dist/client/assets/empty-state-5YwXi_7R.js +0 -1
  431. package/dist/client/assets/file-explorer-CAi8cI4n.js +0 -2
  432. package/dist/client/assets/file-preview-B9hKxAYI.js +0 -1
  433. package/dist/client/assets/file-share-button-CCjiCa6m.js +0 -3
  434. package/dist/client/assets/flat-project-CbXy-IBz.js +0 -1
  435. package/dist/client/assets/folder-icon-DLUZphZo.js +0 -2
  436. package/dist/client/assets/general-2P63tge_.js +0 -1
  437. package/dist/client/assets/get-initials-D-f_fDFw.js +0 -1
  438. package/dist/client/assets/home-CDP8nTo9.js +0 -1
  439. package/dist/client/assets/index-C_HSWEzQ.js +0 -2
  440. package/dist/client/assets/index-DDndbO_S.js +0 -4
  441. package/dist/client/assets/index-DVOa5DKI.js +0 -81
  442. package/dist/client/assets/index-GQJyR46N.js +0 -4
  443. package/dist/client/assets/index-Pi-s-kcZ.js +0 -1
  444. package/dist/client/assets/index-kOW30gcj.js +0 -5
  445. package/dist/client/assets/index-pFm7t22i.css +0 -1
  446. package/dist/client/assets/index-wpJdtJMA.js +0 -1
  447. package/dist/client/assets/infra-billing-CUqHLbkr.js +0 -1
  448. package/dist/client/assets/input-BspCfOSh.js +0 -1
  449. package/dist/client/assets/input-CYQLD8P6.js +0 -17
  450. package/dist/client/assets/library-J8tWZ5kP.js +0 -1
  451. package/dist/client/assets/library-tab-DpChe3Oc.js +0 -168
  452. package/dist/client/assets/members-B-sc0OYP.js +0 -1
  453. package/dist/client/assets/mini-report-page-Dsai9GKl.js +0 -1
  454. package/dist/client/assets/mock-board-pBq2hymy.js +0 -1
  455. package/dist/client/assets/monitoring-H6E4qKaj.js +0 -1
  456. package/dist/client/assets/monitoring-stats-row-Elg2qzhe.js +0 -1
  457. package/dist/client/assets/multi-select-CUNie3kQ.js +0 -1
  458. package/dist/client/assets/onboarding-DNF1uUd4.js +0 -1
  459. package/dist/client/assets/openai-conversation-mn8dD0tq.js +0 -3
  460. package/dist/client/assets/organization-choice-BXhxwrhw.js +0 -1
  461. package/dist/client/assets/pair-BAh_rtfQ.js +0 -48
  462. package/dist/client/assets/plan-CfNaQn8P.js +0 -1
  463. package/dist/client/assets/popover-CltvtP7j.js +0 -1
  464. package/dist/client/assets/post-calendar-DtsRD0BB.js +0 -1
  465. package/dist/client/assets/post-editor-Bsz0jGpx.js +0 -2
  466. package/dist/client/assets/preview-tab-CfPGWoZZ.js +0 -551
  467. package/dist/client/assets/product-picker-dialog-C1yhPV4m.js +0 -1
  468. package/dist/client/assets/profile-C9APkMYB.js +0 -1
  469. package/dist/client/assets/project-app-view-B7OEysJl.js +0 -1
  470. package/dist/client/assets/project-apps-CpG_eHUm.js +0 -1
  471. package/dist/client/assets/project-feed-D6ZdsF6M.js +0 -1
  472. package/dist/client/assets/project-icon-BuiTrqnq.js +0 -1
  473. package/dist/client/assets/project-reports-DnqnYJVS.js +0 -1
  474. package/dist/client/assets/project-tasks-Baem7wqr.js +0 -1
  475. package/dist/client/assets/projects-Dbsz1R9W.js +0 -1
  476. package/dist/client/assets/record-editor-Cc6nCqy1.js +0 -1
  477. package/dist/client/assets/redirect-editor-Czcc1h3v.js +0 -1
  478. package/dist/client/assets/reports-CIjIkssH.js +0 -1
  479. package/dist/client/assets/reports-onboarding-mNgETpr6.js +0 -1
  480. package/dist/client/assets/reports-tab-uYYJuIsI.js +0 -2
  481. package/dist/client/assets/repositories-CdhOGfu_.js +0 -1
  482. package/dist/client/assets/repositories-SAQW8pIt.js +0 -1
  483. package/dist/client/assets/review-settings-BdYuIkO8.js +0 -1
  484. package/dist/client/assets/roles-K5FDY6nJ.js +0 -1
  485. package/dist/client/assets/route-B_dDu8dc.js +0 -1
  486. package/dist/client/assets/route-DPBPBesX.js +0 -1
  487. package/dist/client/assets/route-k25TBS11.js +0 -1
  488. package/dist/client/assets/search-input-C43mz2qI.js +0 -1
  489. package/dist/client/assets/search-toggle-DJGOXZ2e.js +0 -1
  490. package/dist/client/assets/secrets-Bj9KJYtM.js +0 -1
  491. package/dist/client/assets/sections-editor-BzCesfXD.js +0 -4
  492. package/dist/client/assets/select-Che713bi.js +0 -1
  493. package/dist/client/assets/select-model-DWQBXwqD.js +0 -1
  494. package/dist/client/assets/seo-editor-BqyTpV_N.js +0 -1
  495. package/dist/client/assets/settings-tab-5vg9K_mk.js +0 -1
  496. package/dist/client/assets/sheet-GHFRmJIe.js +0 -1
  497. package/dist/client/assets/shell-layout-CQ32Qhku.js +0 -1
  498. package/dist/client/assets/site-editor-DrIEYE6g.js +0 -1
  499. package/dist/client/assets/skills-D6XX-KTb.js +0 -1
  500. package/dist/client/assets/slider-Ot1ZckhS.js +0 -1
  501. package/dist/client/assets/switch-DMMNXYVM.js +0 -1
  502. package/dist/client/assets/synced-repos-BNmgaGcr.js +0 -1
  503. package/dist/client/assets/tabs-DcgINuCK.js +0 -1
  504. package/dist/client/assets/task-assignee-avatar-Dq1zRgtZ.js +0 -1
  505. package/dist/client/assets/taskboard-analytics-Af2fX21J.js +0 -1
  506. package/dist/client/assets/tasks-BITlMDB1.js +0 -4
  507. package/dist/client/assets/tasks-BwGddAXN.js +0 -1
  508. package/dist/client/assets/textarea-BouaqET7.js +0 -1
  509. package/dist/client/assets/thread-analytics-qopGR3eE.js +0 -1
  510. package/dist/client/assets/thread-route-CRIeJ9cd.js +0 -1
  511. package/dist/client/assets/thread-sheet-body-D1u2Dd0I.js +0 -1
  512. package/dist/client/assets/toggle-group-BhUb_In4.js +0 -1
  513. package/dist/client/assets/use-connect-companion-BYo4bOt5.js +0 -1
  514. package/dist/client/assets/use-delete-connection-_1Gj9u9K.js +0 -1
  515. package/dist/client/assets/use-ensure-project-folder-B5XtpMjE.js +0 -1
  516. package/dist/client/assets/use-mcp-client-Bq9mPLRa.js +0 -10
  517. package/dist/client/assets/use-panel-navigate-dU6rubbO.js +0 -1
  518. package/dist/client/assets/use-recent-apps-CunSErYp.js +0 -1
  519. package/dist/client/assets/use-section-preview-base-BQWRaK5P.js +0 -1
  520. package/dist/client/assets/use-sidebar-collapsed-CV40kq5Y.js +0 -1
  521. package/dist/client/assets/useInfiniteQuery-BgRNBC3A.js +0 -1
  522. package/dist/client/assets/useSuspenseInfiniteQuery-BamkyUys.js +0 -1
  523. package/dist/client/assets/users-C8oXHT4k.js +0 -1
  524. package/dist/client/assets/variant-calendar-CeRaHJen.js +0 -1
  525. package/dist/client/assets/view-mode-toggle-WmKvpLKC.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as T,b as be,j as o,r as te,av as Ne,B as we,h as _e}from"./index-DwUSgMrk.js";import{a5 as he}from"./agent-icon-sWZwj0Es.js";import{S as ve}from"./scroll-area-BgPjdFUv.js";import{O as ye,ai as Ee,q as Pe,s as Te,aj as Re,o as Ce,aJ as Fe}from"./blocks-tab-states-llhicB0-.js";import{x as Ke}from"./secret-ciphertext-DFilJK15.js";import{u as ze,a as De,P as $e}from"./page-seo-form-DiFnoI3j.js";import{a as je}from"./Image01-Ffg_Ow_R.js";import{u as Be,K as Ie}from"./site-editor-toast-CWvkPJE7.js";import"./AlertCircle-Chv0zwfM.js";import"./Tool01-Dys7Z5ab.js";import"./ArrowUp-B9orjFiD.js";import"./ArrowLeft-P5MTc2kM.js";import"./LinkBroken01-D3nON0AT.js";import"./ShoppingBag01-CVVvTwrH.js";import"./ZoomOut-Bi4ExiY7.js";import"./Building02-Bhj7SR-R.js";import"./CheckCircle-BOOTvtN7.js";import"./ChevronUp-UOllpHWY.js";import"./ChevronSelectorVertical-CKvNz838.js";import"./UserSquare-CaU54i61.js";import"./Copy01-CsZzLh_E.js";import"./CreditCard01-Bji4icQZ.js";import"./DotsVertical-BaN_NJ8K.js";import"./Globe04-BOt08kHg.js";import"./SwitchHorizontal01-CEx9qTgC.js";import"./Key01-BVuT8y7b.js";import"./Link01-Du3sgYhY.js";import"./Minus-qI5XA_m8.js";import"./Monitor01-DPFmNrHU.js";import"./Sun-Cgn1IQVJ.js";import"./Play-CKRH5LhK.js";import"./Plus-Dr-ysAIN.js";import"./SearchMd-D_t1juud.js";import"./Trash01--FklAmhG.js";import"./Upload01-BeT7SqGm.js";import"./User01-C3IPjJ5l.js";import"./Users01-BZXT5qAC.js";import"./XClose-Cjrx49Z1.js";import"./index-BdQq_4o_.js";import"./input-BcdjLg5X.js";import"./usage-stats-BKxLD2_l.js";import"./tool-namespace-D8-HQWQE.js";import"./form-oexeEAr5.js";import"./label-9iahSV8V.js";import"./utils-CVEq3hMx.js";import"./markdown-DQgkOB--.js";import"./use-copy-D9a2GtFe.js";import"./location-V0VwTJTt.js";import"./use-mobile-D6Ou0NEP.js";import"./use-panel-navigate-CwRBX20z.js";import"./thread-route-Cr8HKNDQ.js";import"./use-project-scope-CwXHOags.js";import"./repository-binding-Ctv5jACU.js";import"./use-mcp-client-CvE7itXw.js";import"./auth-CR47t1GM.js";import"./tooltip-7xQKXZXx.js";import"./index-B50XV3gp.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-decopilot-events-DYkAp_m7.js";import"./thread-intent-DYNUY6FR.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-wUe9D5Rq.js";import"./task-board-CDUMGTb-.js";import"./schema-C9VtMeBM.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-DHXBy843.js";import"./autosend-DnRIvL7O.js";import"./use-ai-providers-Dp4Hkjtx.js";import"./use-organization-settings-B4xXaxr4.js";import"./icon-button-DfIZISrS.js";import"./file-type-icon-L81OHsVz.js";import"./shell-layout-CCN75UAi.js";import"./avatar-x6P8tYtf.js";import"./use-clock-tick-C6h2MMIi.js";import"./command-CxL64Rh6.js";import"./index-5UrkGUsp.js";import"./integration-icon-CGlpUTQF.js";import"./project-icon-DzYy4wKu.js";import"./new-project-dialog-zI2HVFQT.js";import"./repository-import-picker-DXFAIhGC.js";import"./use-navigate-to-agent-DqPVTZYN.js";import"./repository-picker-C-87Ak81.js";import"./useInfiniteQuery-DLjfiCcz.js";import"./infiniteQueryObserver-fD19WDlu.js";import"./collection-search-EaUyhqe3.js";import"./use-debounced-value-DJVnkGFg.js";import"./required-auth-layout-BOZelCHP.js";import"./use-org-sso-CWjER8s_.js";import"./chat-draft-DZ2UGoju.js";import"./select-DSSug2fd.js";import"./tabs-CBoEFGVa.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-BCAKdpOu.js";import"./toggle-group-CaNHwi3W.js";import"./use-open-billing-url-NfOqGe8U.js";import"./index-C0_wKyXa.js";import"./checkbox-J7NM8Nxa.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-kKTDdvYS.js";import"./drawer-2qaZT3bV.js";import"./input-YsL3Z14x.js";import"./suggestion-Be-l0Vt9.js";import"./use-mcp-prompts-B71f8Oap.js";import"./use-org-fs-CnHNkGa0.js";import"./question-004-sINsf4GQ.js";import"./use-members-CAjyx4dy.js";import"./use-org-auth-client-D54JUqPS.js";import"./feature-paywall-BvbLf2vN.js";import"./plan-ladder-hFJpqSg5.js";import"./add-connection-dialog-CtRrIzJJ.js";import"./extract-connection-data-BRxw-vDj.js";import"./metadata-D72DunRR.js";import"./connection-Dwyi3srb.js";import"./url-slug-CMhgSj9A.js";import"./connection-card-Fd6iPvoW.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CQ_TkrdE.js";import"./use-connection-mXOC3Xuo.js";import"./schema-CIU-vy-M.js";import"./connection-form-helpers-Be0GZ2Fr.js";import"./authenticate-and-persist-oauth-D5GDklWs.js";import"./mcp-oauth-Bvn81zXq.js";import"./mcp-oauth-DQ15yEaL.js";import"./collection-tabs-CvrE77Fy.js";import"./badge-0pHsypn4.js";import"./use-infinite-scroll-AsnNIlBn.js";import"./useSuspenseInfiniteQuery-DJIJLbRA.js";import"./use-task-board-events-DHmzNQpi.js";import"./use-chat-layout-state-DeeoSPAs.js";import"./utils-BtlQk18r.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BVAQv2mv.js";import"./collapsible-C5IcK6_6.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-E0Rb-X88.js";import"./types-DmsgcF8m.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-B-tTREXV.js";import"./use-thread-outputs-hOt5_FqT.js";import"./switch-CPLmKtep.js";import"./monaco-editor-pm8M8s-N.js";import"./editor-D4klHvzy.js";import"./calendar-Dt43s5dd.js";import"./editor-classes-BBdx-JSY.js";import"./core.esm-3Ntqpx6o.js";import"./sortable.esm-DUpSK4fM.js";import"./combobox-GJu0SOmd.js";import"./alert-dialog-XdiY2J_y.js";import"./search-input-6roNTbiB.js";import"./use-file-configs-DJCoczIU.js";import"./asset-utils-CKM5FMXp.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-git-api-CRxdlhrN.js";import"./sandbox-url-D3mC8qhT.js";import"./empty-state-CLeOp2iF.js";import"./alert-VfejUnRf.js";import"./use-main-schema-v8-Cys0il1A.js";import"./index-DlxFtSYK.js";function M(d){return typeof d=="string"&&d.trim()?d:void 0}function ge(d,e){if(d){if(e)try{const t=new URL(d,e).href;return ye(t)}catch{return}return ye(d)}}function Le(d){if(!d)return{};const e=M(d.title),t=M(d.titleTemplate);return{title:e&&t?.includes("%s")?t.replace(/%s/g,e):e,description:M(d.description),image:M(d.image),favicon:M(d.favicon)}}function Oe(d){if(!d)return"example.com";try{return new URL(d).host}catch{return"example.com"}}const Ue=[{id:"google",labelKey:"sectionsEditor.seoPreview.platformGoogle",color:"#4285F4",layout:"search"},{id:"facebook",labelKey:"sectionsEditor.seoPreview.platformFacebook",color:"#1877F2",layout:"card"},{id:"twitter",labelKey:"sectionsEditor.seoPreview.platformTwitter",color:"#0f1419",layout:"card"},{id:"linkedin",labelKey:"sectionsEditor.seoPreview.platformLinkedin",color:"#0A66C2",layout:"card"},{id:"whatsapp",labelKey:"sectionsEditor.seoPreview.platformWhatsapp",color:"#25D366",layout:"chat"},{id:"telegram",labelKey:"sectionsEditor.seoPreview.platformTelegram",color:"#229ED9",layout:"chat"},{id:"slack",labelKey:"sectionsEditor.seoPreview.platformSlack",color:"#611f69",layout:"attachment"},{id:"discord",labelKey:"sectionsEditor.seoPreview.platformDiscord",color:"#5865F2",layout:"attachment"}];function ue(d){const e=T.c(10),{src:t,className:a,iconSize:y}=d,l=y===void 0?20:y;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==a||e[2]!==t?(p=o.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:a,style:m}),e[1]=a,e[2]=t,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let i;e[5]!==l?(i=o.jsx(je,{size:l}),e[5]=l,e[6]=i):i=e[6];let n;return e[7]!==a||e[8]!==i?(n=o.jsx("div",{className:a,style:s,children:i}),e[7]=a,e[8]=i,e[9]=n):n=e[9],n}function Ae(d){const e=T.c(33),{seo:t,host:a,path:y,t:l}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#fff",border:"1px solid #dadce0"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={background:"#f1f3f4"},e[1]=i):i=e[1];let n;e[2]!==t.favicon?(n=o.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:i,children:t.favicon?o.jsx("img",{src:t.favicon,alt:"",className:"size-full object-cover"}):o.jsx(je,{size:12,color:"#9aa0a6"})}),e[2]=t.favicon,e[3]=n):n=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#202124"},e[4]=m):m=e[4];let p;e[5]!==a?(p=o.jsx("div",{className:"truncate text-[13px] leading-tight",style:m,children:a}),e[5]=a,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#4d5156"},e[7]=f):f=e[7];let r;e[8]!==a||e[9]!==y?(r=o.jsxs("div",{className:"truncate text-[12px] leading-tight",style:f,children:[a,y]}),e[8]=a,e[9]=y,e[10]=r):r=e[10];let c;e[11]!==p||e[12]!==r?(c=o.jsxs("div",{className:"min-w-0",children:[p,r]}),e[11]=p,e[12]=r,e[13]=c):c=e[13];let x;e[14]!==n||e[15]!==c?(x=o.jsxs("div",{className:"flex items-center gap-2",children:[n,c]}),e[14]=n,e[15]=c,e[16]=x):x=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#1a0dab"},e[17]=u):u=e[17];let h;e[18]!==t.title||e[19]!==l?(h=t.title??l("sectionsEditor.seoPreview.fallbackTitle"),e[18]=t.title,e[19]=l,e[20]=h):h=e[20];let v;e[21]!==h?(v=o.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:u,children:h}),e[21]=h,e[22]=v):v=e[22];let b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b={color:"#4d5156"},e[23]=b):b=e[23];let S;e[24]!==t.description||e[25]!==l?(S=t.description??l("sectionsEditor.seoPreview.fallbackDescription"),e[24]=t.description,e[25]=l,e[26]=S):S=e[26];let j;e[27]!==S?(j=o.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:b,children:S}),e[27]=S,e[28]=j):j=e[28];let k;return e[29]!==v||e[30]!==j||e[31]!==x?(k=o.jsxs("div",{className:"rounded-lg p-3 text-left",style:s,children:[x,v,j]}),e[29]=v,e[30]=j,e[31]=x,e[32]=k):k=e[32],k}function Me(d){const e=T.c(26),{seo:t,host:a,t:y}=d;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={background:"#fff",border:"1px solid #e2e8f0"},e[0]=l):l=e[0];let s;e[1]!==t.image?(s=o.jsx(ue,{src:t.image,className:"h-40 w-full"}),e[1]=t.image,e[2]=s):s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={borderTop:"1px solid #e2e8f0"},e[3]=i):i=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n={color:"#8a9099"},e[4]=n):n=e[4];let m;e[5]!==a?(m=o.jsx("div",{className:"truncate text-[11px]",style:n,children:a}),e[5]=a,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[7]=p):p=e[7];let f;e[8]!==t.title||e[9]!==y?(f=t.title??y("sectionsEditor.seoPreview.fallbackTitle"),e[8]=t.title,e[9]=y,e[10]=f):f=e[10];let r;e[11]!==f?(r=o.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:p,children:f}),e[11]=f,e[12]=r):r=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[13]=c):c=e[13];let x;e[14]!==t.description||e[15]!==y?(x=t.description??y("sectionsEditor.seoPreview.fallbackDescription"),e[14]=t.description,e[15]=y,e[16]=x):x=e[16];let u;e[17]!==x?(u=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:x}),e[17]=x,e[18]=u):u=e[18];let h;e[19]!==u||e[20]!==m||e[21]!==r?(h=o.jsxs("div",{className:"px-3 py-2",style:i,children:[m,r,u]}),e[19]=u,e[20]=m,e[21]=r,e[22]=h):h=e[22];let v;return e[23]!==h||e[24]!==s?(v=o.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:l,children:[s,h]}),e[23]=h,e[24]=s,e[25]=v):v=e[25],v}function Ge(d){const e=T.c(36),{seo:t,host:a,accent:y,t:l}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f0f2f5"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={color:"#3b4045"},e[1]=i):i=e[1];let n;e[2]!==l?(n=l("sectionsEditor.seoPreview.chatCardHint"),e[2]=l,e[3]=n):n=e[3];let m;e[4]!==n?(m=o.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:i,children:n}),e[4]=n,e[5]=m):m=e[5];const p=`3px solid ${y}`;let f;e[6]!==p?(f={background:"#fff",borderLeft:p},e[6]=p,e[7]=f):f=e[7];let r;e[8]!==t.image?(r=o.jsx(ue,{src:t.image,className:"h-28 w-full",iconSize:18}),e[8]=t.image,e[9]=r):r=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#1c2024"},e[10]=c):c=e[10];let x;e[11]!==t.title||e[12]!==l?(x=t.title??l("sectionsEditor.seoPreview.fallbackTitle"),e[11]=t.title,e[12]=l,e[13]=x):x=e[13];let u;e[14]!==x?(u=o.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:c,children:x}),e[14]=x,e[15]=u):u=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h={color:"#60666c"},e[16]=h):h=e[16];let v;e[17]!==t.description||e[18]!==l?(v=t.description??l("sectionsEditor.seoPreview.fallbackDescription"),e[17]=t.description,e[18]=l,e[19]=v):v=e[19];let b;e[20]!==v?(b=o.jsx("div",{className:"line-clamp-2 text-[11px]",style:h,children:v}),e[20]=v,e[21]=b):b=e[21];let S;e[22]===Symbol.for("react.memo_cache_sentinel")?(S={color:"#8a9099"},e[22]=S):S=e[22];let j;e[23]!==a?(j=o.jsx("div",{className:"mt-0.5 text-[10px]",style:S,children:a}),e[23]=a,e[24]=j):j=e[24];let k;e[25]!==u||e[26]!==b||e[27]!==j?(k=o.jsxs("div",{className:"px-2.5 py-1.5",children:[u,b,j]}),e[25]=u,e[26]=b,e[27]=j,e[28]=k):k=e[28];let g;e[29]!==k||e[30]!==f||e[31]!==r?(g=o.jsxs("div",{className:"overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-md))]",style:f,children:[r,k]}),e[29]=k,e[30]=f,e[31]=r,e[32]=g):g=e[32];let N;return e[33]!==g||e[34]!==m?(N=o.jsxs("div",{className:"rounded-lg p-2 text-left",style:s,children:[m,g]}),e[33]=g,e[34]=m,e[35]=N):N=e[35],N}function He(d){const e=T.c(39),{seo:t,host:a,accent:y,dark:l,t:s}=d,i=l?"#2b2d31":"#fff",n=l?"#00a8fc":"#1264a3",m=l?"#dbdee1":"#3b4045",p=l?"#949ba4":"#8a9099",f=l?"none":"1px solid #e2e8f0";let r;e[0]!==i||e[1]!==f?(r={background:i,border:f},e[0]=i,e[1]=f,e[2]=r):r=e[2];const c=`3px solid ${y}`;let x;e[3]!==c?(x={borderLeft:c,borderRadius:2},e[3]=c,e[4]=x):x=e[4];let u;e[5]!==p?(u={color:p},e[5]=p,e[6]=u):u=e[6];let h;e[7]!==a||e[8]!==u?(h=o.jsx("div",{className:"text-[10px]",style:u,children:a}),e[7]=a,e[8]=u,e[9]=h):h=e[9];let v;e[10]!==n?(v={color:n},e[10]=n,e[11]=v):v=e[11];let b;e[12]!==t.title||e[13]!==s?(b=t.title??s("sectionsEditor.seoPreview.fallbackTitle"),e[12]=t.title,e[13]=s,e[14]=b):b=e[14];let S;e[15]!==v||e[16]!==b?(S=o.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:v,children:b}),e[15]=v,e[16]=b,e[17]=S):S=e[17];let j;e[18]!==m?(j={color:m},e[18]=m,e[19]=j):j=e[19];let k;e[20]!==t.description||e[21]!==s?(k=t.description??s("sectionsEditor.seoPreview.fallbackDescription"),e[20]=t.description,e[21]=s,e[22]=k):k=e[22];let g;e[23]!==j||e[24]!==k?(g=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:j,children:k}),e[23]=j,e[24]=k,e[25]=g):g=e[25];let N;e[26]!==g||e[27]!==h||e[28]!==S?(N=o.jsxs("div",{className:"min-w-0 flex-1",children:[h,S,g]}),e[26]=g,e[27]=h,e[28]=S,e[29]=N):N=e[29];let w;e[30]!==t.image?(w=o.jsx(ue,{src:t.image,className:"size-14 shrink-0 rounded-[var(--studio-control-radius,var(--radius))]",iconSize:16}),e[30]=t.image,e[31]=w):w=e[31];let _;e[32]!==N||e[33]!==w||e[34]!==x?(_=o.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:x,children:[N,w]}),e[32]=N,e[33]=w,e[34]=x,e[35]=_):_=e[35];let E;return e[36]!==_||e[37]!==r?(E=o.jsx("div",{className:"rounded-lg p-2.5 text-left",style:r,children:_}),e[36]=_,e[37]=r,e[38]=E):E=e[38],E}function Ve(d){const e=T.c(21),{platform:t,seo:a,host:y,path:l,t:s}=d;let i;e[0]!==y||e[1]!==l||e[2]!==t.color||e[3]!==t.id||e[4]!==t.layout||e[5]!==a||e[6]!==s?(i=t.layout==="search"?o.jsx(Ae,{seo:a,host:y,path:l,t:s}):t.layout==="card"?o.jsx(Me,{seo:a,host:y,path:l,t:s}):t.layout==="chat"?o.jsx(Ge,{seo:a,host:y,path:l,accent:t.color,t:s}):o.jsx(He,{seo:a,host:y,path:l,accent:t.color,dark:t.id==="discord",t:s}),e[0]=y,e[1]=l,e[2]=t.color,e[3]=t.id,e[4]=t.layout,e[5]=a,e[6]=s,e[7]=i):i=e[7];const n=i;let m;e[8]!==t.color?(m=o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:t.color}}),e[8]=t.color,e[9]=m):m=e[9];let p;e[10]!==t.labelKey||e[11]!==s?(p=s(t.labelKey),e[10]=t.labelKey,e[11]=s,e[12]=p):p=e[12];let f;e[13]!==p?(f=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p}),e[13]=p,e[14]=f):f=e[14];let r;e[15]!==m||e[16]!==f?(r=o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[m,f]}),e[15]=m,e[16]=f,e[17]=r):r=e[17];let c;return e[18]!==n||e[19]!==r?(c=o.jsxs("div",{children:[r,n]}),e[18]=n,e[19]=r,e[20]=c):c=e[20],c}function qe(d){const e=T.c(18),{seo:t,url:a,path:y}=d,l=y===void 0?"/":y,s=be();let i,n,m;if(e[0]!==t||e[1]!==a){const v=Le(t);i=v,n=ge(v.image,a),m=ge(v.favicon,a),e[0]=t,e[1]=a,e[2]=i,e[3]=n,e[4]=m}else i=e[2],n=e[3],m=e[4];let p;e[5]!==i||e[6]!==n||e[7]!==m?(p={...i,image:n,favicon:m},e[5]=i,e[6]=n,e[7]=m,e[8]=p):p=e[8];const f=p;let r;e[9]!==a?(r=Oe(a),e[9]=a,e[10]=r):r=e[10];const c=r,x=l==="/"?"":l;let u;e[11]!==x||e[12]!==c||e[13]!==s||e[14]!==f?(u=Ue.map(v=>o.jsx(Ve,{platform:v,seo:f,host:c,path:x,t:s},v.id)),e[11]=x,e[12]=c,e[13]=s,e[14]=f,e[15]=u):u=e[15];let h;return e[16]!==u?(h=o.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:u}),e[16]=u,e[17]=h):h=e[17],h}function Xi(d){const e=T.c(73),{orgSlug:t,virtualMcpId:a,branch:y,decofile:l,meta:s,target:i,previewBaseUrl:n,onSaved:m,onEditDefaultSeo:p,onBack:f}=d,r=be(),c=Ee(l,i,s),x=Be(a,y);let u;e[0]!==x?(u=Ie(x),e[0]=x,e[1]=u):u=e[1];const h=!u,v=c?.seoData,b=i.kind==="site"?"site":i.pageKey,[S,j]=te.useState(b),[k,g]=te.useState(null),[N,w]=te.useState(0),[_,E]=te.useState(void 0);S!==b&&(j(b),g(null),E(void 0),w(We));const{persistSeo:K,persistRawSeo:oe,flush:ie,isPending:se}=ze({orgSlug:t,virtualMcpId:a,branch:y,target:i,resolved:c,onSaved:m}),G=i.kind==="page",Se=G?c?.rawSeoData:void 0,A=_!==void 0?_:Se,ke=G?Pe(A)??void 0:void 0,P=k??ke??v??{},R=c?De(P,c):null,z=R&&(!G||Te(A))?Ke(R,s):null;let H;e[2]!==s?(H=Re(s),e[2]=s,e[3]=H):H=e[3];const re=H;let C,V;e[4]!==l||e[5]!==P||e[6]!==s||e[7]!==i.kind?(C=i.kind==="page"?Ce(l,s)?.seoData??{}:{},V=i.kind==="page"?Xe(C,P):P,e[4]=l,e[5]=P,e[6]=s,e[7]=i.kind,e[8]=C,e[9]=V):(C=e[8],V=e[9]);const le=V;let q;e[10]!==K||e[11]!==c||e[12]!==g?(q=F=>{if(!c)return;const xe=F;g(xe),K(xe)},e[10]=K,e[11]=c,e[12]=g,e[13]=q):q=e[13];const ae=q;let J;e[14]!==g?(J=()=>g(null),e[14]=g,e[15]=J):J=e[15];const ce=J;let W;e[16]!==w?(W=()=>w(Je),e[16]=w,e[17]=W):W=e[17];const ne=W;let Q;e[18]!==ie||e[19]!==f?(Q=()=>{ie(),f?.()},e[18]=ie,e[19]=f,e[20]=Q):Q=e[20];const me=Q,D=i.kind==="page"?i.path:"/";let X;e[21]!==D||e[22]!==n||e[23]!==i.kind?(X=i.kind==="page"&&n?Qe(D,n):n??null,e[21]=D,e[22]=n,e[23]=i.kind,e[24]=X):X=e[24];const de=X;let Y;e[25]!==c||e[26]!==r||e[27]!==i.kind?(Y=i.kind==="site"?r("sectionsEditor.seoEditor.noSiteSeoBlock"):r(c?"sectionsEditor.seoEditor.noSeoSchema":"sectionsEditor.seoEditor.couldNotLoadSeo"),e[25]=c,e[26]=r,e[27]=i.kind,e[28]=Y):Y=e[28];const pe=Y,Z=G&&c,fe=i.kind==="site"&&c&&z;let $;e[29]!==me||e[30]!==r||e[31]!==i.kind||e[32]!==i.pageName?($=i.kind==="page"?o.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx("button",{type:"button",onClick:me,title:i.pageName,className:"min-w-0 truncate rounded-[var(--studio-control-radius,var(--radius-md))] px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:i.pageName}),o.jsx(Ne,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(he,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:r("sectionsEditor.seoEditor.defaultSeoLabel")}),o.jsxs("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:["· ",r("sectionsEditor.seoEditor.appliedToEveryPage")]})]}),e[29]=me,e[30]=r,e[31]=i.kind,e[32]=i.pageName,e[33]=$):$=e[33];let B;e[34]!==se?(B=se&&o.jsx(_e,{className:"size-3.5 text-muted-foreground"}),e[34]=se,e[35]=B):B=e[35];let I;e[36]!==p||e[37]!==r||e[38]!==i.kind?(I=i.kind==="page"&&p&&o.jsxs(we,{type:"button",variant:"outline",size:"sm",onClick:p,children:[o.jsx(he,{size:14}),r("sectionsEditor.seoEditor.editDefaultSeoButton")]}),e[36]=p,e[37]=r,e[38]=i.kind,e[39]=I):I=e[39];let L;e[40]!==B||e[41]!==I?(L=o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[B,I]}),e[40]=B,e[41]=I,e[42]=L):L=e[42];let O;e[43]!==$||e[44]!==L?(O=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[$,L]}),e[43]=$,e[44]=L,e[45]=O):O=e[45];let U;e[46]!==R||e[47]!==h||e[48]!==ne||e[49]!==ce||e[50]!==re||e[51]!==A||e[52]!==P||e[53]!==pe||e[54]!==N||e[55]!==ae||e[56]!==D||e[57]!==oe||e[58]!==K||e[59]!==le||e[60]!==de||e[61]!==c||e[62]!==z||e[63]!==g||e[64]!==E||e[65]!==Z||e[66]!==fe||e[67]!==C||e[68]!==r?(U=!c||!Z&&!fe?o.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:pe}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsx(ve,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-5 py-4",children:Z?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:r("sectionsEditor.seoEditor.emptyFieldsHint")}),o.jsx($e,{rawSeo:A,innerSeo:P,defaultResolveType:re,seoSchema:z,activeResolveType:R,seoTypeOptions:c.seoTypeOptions,formResetKey:N,siteDefaultSeo:C,onPersistRaw:F=>{E(F),oe(F)},onInnerChange:F=>{g(F),K(F)},onClearForm:ce,onBumpFormKey:ne,asyncRenderAvailable:h})]}):z&&R&&o.jsx(Fe,{schema:z,resolveType:R,value:P,formResetKey:N,onChange:ae})})}),o.jsx(ve,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"@container px-5 py-4",children:o.jsx(qe,{seo:le,url:de,path:D})})})]}),e[46]=R,e[47]=h,e[48]=ne,e[49]=ce,e[50]=re,e[51]=A,e[52]=P,e[53]=pe,e[54]=N,e[55]=ae,e[56]=D,e[57]=oe,e[58]=K,e[59]=le,e[60]=de,e[61]=c,e[62]=z,e[63]=g,e[64]=E,e[65]=Z,e[66]=fe,e[67]=C,e[68]=r,e[69]=U):U=e[69];let ee;return e[70]!==O||e[71]!==U?(ee=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[O,U]}),e[70]=O,e[71]=U,e[72]=ee):ee=e[72],ee}function Je(d){return d+1}function We(d){return d+1}function Qe(d,e){try{return new URL(d,e).href}catch{return e}}function Xe(d,e){const t=e.__resolveType,a=d.__resolveType;if(typeof t=="string"&&typeof a=="string"&&t!==a)return{...e};const y={...d};for(const[l,s]of Object.entries(e))l!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(y[l]=s));return y}export{Xi as SeoEditor};
@@ -1 +1 @@
1
- import{c as d,l as p,j as f,d_ as m}from"./index-Dfl75K1t.js";function x(l){const t=d.c(12);let o,a,r,i;t[0]!==l?({className:o,orientation:r,decorative:i,...a}=l,t[0]=l,t[1]=o,t[2]=a,t[3]=r,t[4]=i):(o=t[1],a=t[2],r=t[3],i=t[4]);const s=r===void 0?"horizontal":r,c=i===void 0?!0:i;let e;t[5]!==o?(e=p("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",o),t[5]=o,t[6]=e):e=t[6];let n;return t[7]!==c||t[8]!==s||t[9]!==a||t[10]!==e?(n=f.jsx(m,{"data-slot":"separator-root",decorative:c,orientation:s,className:e,...a}),t[7]=c,t[8]=s,t[9]=a,t[10]=e,t[11]=n):n=t[11],n}export{x as S};
1
+ import{c as p,l as d,j as f,e1 as m}from"./index-DwUSgMrk.js";function x(l){const t=p.c(12);let o,a,r,i;t[0]!==l?({className:o,orientation:r,decorative:i,...a}=l,t[0]=l,t[1]=o,t[2]=a,t[3]=r,t[4]=i):(o=t[1],a=t[2],r=t[3],i=t[4]);const s=r===void 0?"horizontal":r,c=i===void 0?!0:i;let e;t[5]!==o?(e=d("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",o),t[5]=o,t[6]=e):e=t[6];let n;return t[7]!==c||t[8]!==s||t[9]!==a||t[10]!==e?(n=f.jsx(m,{"data-slot":"separator-root",decorative:c,orientation:s,className:e,...a}),t[7]=c,t[8]=s,t[9]=a,t[10]=e,t[11]=n):n=t[11],n}export{x as S};
@@ -0,0 +1 @@
1
+ import{c as e,j as o}from"./index-DwUSgMrk.js";import{V as a}from"./index-CiDUJoU5.js";function p(s){const t=e.c(2),{virtualMcpId:r}=s;let i;return t[0]!==r?(i=o.jsx(a,{virtualMcpId:r}),t[0]=r,t[1]=i):i=t[1],i}export{p as S};
@@ -0,0 +1 @@
1
+ import{c as n,l as f,j as i,dz as S,dn as $,aJ as w,dA as z,dp as C,dB as B,aY as R,dq as k}from"./index-DwUSgMrk.js";function P(o){const e=n.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx($,{"data-slot":"sheet",...t}),e[2]=t,e[3]=s):s=e[3],s}function D(o){const e=n.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(C,{"data-slot":"sheet-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=f("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(k,{"data-slot":"sheet-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function T(o){const e=n.c(22);let t,s,a,l,p,m;e[0]!==o?({className:s,children:t,side:l,size:p,hideCloseButton:m,...a}=o,e[0]=o,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=p,e[6]=m):(t=e[1],s=e[2],a=e[3],l=e[4],p=e[5],m=e[6]);const d=l===void 0?"right":l,v=p===void 0?"sm":p,x=m===void 0?!1:m;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(E,{}),e[7]=u):u=e[7];const g=d==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l",b=d==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r",j=(d==="left"||d==="right")&&(v==="lg"?"w-full sm:max-w-xl":"sm:max-w-sm"),N=d==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",y=d==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let r;e[8]!==s||e[9]!==g||e[10]!==b||e[11]!==j||e[12]!==N||e[13]!==y?(r=f("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-200 data-[state=open]:duration-200",g,b,j,N,y,s),e[8]=s,e[9]=g,e[10]=b,e[11]=j,e[12]=N,e[13]=y,e[14]=r):r=e[14];let c;e[15]!==x?(c=!x&&i.jsxs(B,{className:"data-[state=open]:bg-secondary absolute top-4 right-4 opacity-70 transition-opacity hover:opacity-100 focus-ring disabled:pointer-events-none rounded-lg",children:[i.jsx(R,{className:"size-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]}),e[15]=x,e[16]=c):c=e[16];let h;return e[17]!==t||e[18]!==a||e[19]!==r||e[20]!==c?(h=i.jsxs(D,{children:[u,i.jsxs(w,{"data-slot":"sheet-content",className:r,...a,children:[t,c]})]}),e[17]=t,e[18]=a,e[19]=r,e[20]=c,e[21]=h):h=e[21],h}function _(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=f("flex flex-col gap-1.5 p-4",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx("div",{"data-slot":"sheet-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function q(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=f("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx("div",{"data-slot":"sheet-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function A(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=f("text-foreground font-semibold",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(S,{"data-slot":"sheet-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function F(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=f("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(z,{"data-slot":"sheet-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{A as S,T as a,P as b,_ as c,F as d,q as e};
@@ -0,0 +1 @@
1
+ import{c as R,b as J,e as st,j as n,B as F,t as We,b$ as fe,ad as Tt,a as Be,G as Vt,R as Nt,K as Ue,c0 as Wt,c1 as Yt,aw as Ke,l as ht,a_ as Qt,x as gt,r as se,ab as Xt,ac as re,s as _t,v as Pt,q as At,D as Ct,d as Et,a2 as mt,J as Ot,m as He,y as ct,aL as It,c2 as Zt,aR as en,aX as pt,F as tn,c3 as nn,aM as sn,w as on,c4 as an,c5 as rn,c6 as ln,c7 as cn,c8 as dn,a3 as un,u as mn,a4 as fn,c9 as hn,ca as gn,k as $t,cb as rt,cc as pn,cd as yn,O as bn,_ as xn}from"./index-DwUSgMrk.js";import{A as it}from"./avatar-x6P8tYtf.js";import{t as Lt}from"./Building02-Bhj7SR-R.js";import{i as Sn,s as ae}from"./UserSquare-CaU54i61.js";import{aE as wn,aC as vn,H as lt,ac as jn,J as kn,aF as Tn,n as yt,g as Nn,p as _n,k as Pn,aG as An,l as Cn}from"./agent-icon-sWZwj0Es.js";import{s as En}from"./XClose-Cjrx49Z1.js";import{a as On,u as In}from"./use-project-scope-CwXHOags.js";import{u as Dt,a as $n}from"./use-panel-navigate-CwRBX20z.js";import{i as de}from"./CheckCircle-BOOTvtN7.js";import{i as bt}from"./Monitor01-DPFmNrHU.js";import{i as qe}from"./ZoomOut-Bi4ExiY7.js";import{u as Ln}from"./use-clock-tick-C6h2MMIi.js";import{s as xt}from"./Plus-Dr-ysAIN.js";import{a as Dn}from"./Tool01-Dys7Z5ab.js";import{b as le,a as Je,f as Rn,e as Fn,c as Mn,C as zn}from"./command-CxL64Rh6.js";import{I as qn}from"./integration-icon-CGlpUTQF.js";import{P as Kn}from"./project-icon-DzYy4wKu.js";import{a as Bn,m as Hn}from"./use-mcp-client-CvE7itXw.js";import{u as Un,a as Gn,n as Jn}from"./new-project-dialog-zI2HVFQT.js";import{S as Vn,u as Wn}from"./thread-intent-DYNUY6FR.js";import{R as Yn}from"./required-auth-layout-BOZelCHP.js";import{A as Qn}from"./autosend-DnRIvL7O.js";import{u as Xn,a as Zn,b as es,c as ts}from"./thread-route-Cr8HKNDQ.js";import{u as ns}from"./use-org-sso-CWjER8s_.js";function ss(t){const e=R.c(49),{orgName:o,orgSlug:r,orgLogo:s,domain:a}=t,i=J();let c;e[0]!==r||e[1]!==i?(c=async()=>{const p=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r})}),A=await p.json();if(!p.ok||!A.success)throw new Error(A.error??i("common.autoDomainJoinScreen.joinError"));return A},e[0]=r,e[1]=i,e[2]=c):c=e[2];let m;e[3]!==r?(m=p=>{window.location.href=`/${p.slug??r}`},e[3]=r,e[4]=m):m=e[4];let h;e[5]!==i?(h=p=>{We.error(p instanceof Error?p.message:i("common.autoDomainJoinScreen.joinError"))},e[5]=i,e[6]=h):h=e[6];let w;e[7]!==c||e[8]!==m||e[9]!==h?(w={mutationFn:c,onSuccess:m,onError:h},e[7]=c,e[8]=m,e[9]=h,e[10]=w):w=e[10];const u=st(w),y=os;let l;e[11]!==s||e[12]!==o?(l=s?n.jsx(it,{url:s,fallback:o,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Lt,{className:"h-6 w-6 text-primary"})}),e[11]=s,e[12]=o,e[13]=l):l=e[13];let g;e[14]!==o||e[15]!==i?(g=i("common.autoDomainJoinScreen.joinPrompt",{orgName:o}),e[14]=o,e[15]=i,e[16]=g):g=e[16];let f;e[17]!==g?(f=n.jsx("h3",{className:"text-lg font-medium",children:g}),e[17]=g,e[18]=f):f=e[18];let d;e[19]!==a||e[20]!==i?(d=i("common.autoDomainJoinScreen.joinDescription",{domain:a}),e[19]=a,e[20]=i,e[21]=d):d=e[21];let x;e[22]!==d?(x=n.jsx("p",{className:"text-sm text-muted-foreground",children:d}),e[22]=d,e[23]=x):x=e[23];let b;e[24]!==f||e[25]!==x?(b=n.jsxs("div",{className:"space-y-2",children:[f,x]}),e[24]=f,e[25]=x,e[26]=b):b=e[26];let S;e[27]!==u?(S=()=>u.mutate(),e[27]=u,e[28]=S):S=e[28];let j;e[29]!==u.isPending||e[30]!==o||e[31]!==i?(j=u.isPending?i("common.autoDomainJoinScreen.joining"):i("common.autoDomainJoinScreen.enterOrg",{orgName:o}),e[29]=u.isPending,e[30]=o,e[31]=i,e[32]=j):j=e[32];let P;e[33]!==u.isPending||e[34]!==S||e[35]!==j?(P=n.jsx(F,{onClick:S,disabled:u.isPending,children:j}),e[33]=u.isPending,e[34]=S,e[35]=j,e[36]=P):P=e[36];const k=u.isPending;let v;e[37]!==i?(v=i("common.goHome"),e[37]=i,e[38]=v):v=e[38];let T;e[39]!==u.isPending||e[40]!==v?(T=n.jsx(F,{variant:"ghost",onClick:y,disabled:k,children:v}),e[39]=u.isPending,e[40]=v,e[41]=T):T=e[41];let N;e[42]!==P||e[43]!==T?(N=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[P,T]}),e[42]=P,e[43]=T,e[44]=N):N=e[44];let _;return e[45]!==b||e[46]!==N||e[47]!==l?(_=n.jsxs(fe,{children:[l,b,N]}),e[45]=b,e[46]=N,e[47]=l,e[48]=_):_=e[48],_}function os(){window.location.href="/"}function St(t){const e=R.c(25),{orgSlug:o,orgName:r,reason:s}=t,a=J(),i=is,c=s==="not-found",m=c?Sn:Tt;let h;e[0]!==c||e[1]!==a?(h=a(c?"common.noAccessScreen.organizationNotFound":"common.noAccessScreen.noAccess"),e[0]=c,e[1]=a,e[2]=h):h=e[2];const w=h;let u;e[3]!==c||e[4]!==r||e[5]!==o||e[6]!==a?(u=c?n.jsxs(n.Fragment,{children:[a("common.noAccessScreen.couldNotFind")," ",n.jsx("strong",{children:o}),"."]}):n.jsxs(n.Fragment,{children:[a("common.noAccessScreen.noAccessTo")," ",n.jsx("strong",{children:r??o}),".",n.jsx("br",{}),a("common.noAccessScreen.askAdminToInvite")]}),e[3]=c,e[4]=r,e[5]=o,e[6]=a,e[7]=u):u=e[7];const y=u;let l;e[8]!==m?(l=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(m,{className:"h-6 w-6 text-muted-foreground"})}),e[8]=m,e[9]=l):l=e[9];let g;e[10]!==w?(g=n.jsx("h3",{className:"text-lg font-medium",children:w}),e[10]=w,e[11]=g):g=e[11];let f;e[12]!==y?(f=n.jsx("p",{className:"text-sm text-muted-foreground",children:y}),e[12]=y,e[13]=f):f=e[13];let d;e[14]!==g||e[15]!==f?(d=n.jsxs("div",{className:"space-y-2",children:[g,f]}),e[14]=g,e[15]=f,e[16]=d):d=e[16];let x;e[17]!==a?(x=a("common.goHome"),e[17]=a,e[18]=x):x=e[18];let b;e[19]!==x?(b=n.jsx(F,{onClick:i,children:x}),e[19]=x,e[20]=b):b=e[20];let S;return e[21]!==l||e[22]!==d||e[23]!==b?(S=n.jsxs(fe,{children:[l,d,b]}),e[21]=l,e[22]=d,e[23]=b,e[24]=S):S=e[24],S}function is(){window.location.href="/"}function as(t){const e=R.c(59),{invitationId:o,orgName:r,orgSlug:s,orgLogo:a}=t,i=J();let c;e[0]!==o?(c=async()=>{const C=await Be.organization.acceptInvitation({invitationId:o});if(C.error)throw new Error(C.error.message);return C.data},e[0]=o,e[1]=c):c=e[1];let m;e[2]!==s?(m=()=>{Vt(),window.location.href=`/${s}`},e[2]=s,e[3]=m):m=e[3];let h;e[4]!==i?(h=C=>{We.error(C instanceof Error?C.message:i("common.pendingInviteScreen.failedToAccept"))},e[4]=i,e[5]=h):h=e[5];let w;e[6]!==c||e[7]!==m||e[8]!==h?(w={mutationFn:c,onSuccess:m,onError:h},e[6]=c,e[7]=m,e[8]=h,e[9]=w):w=e[9];const u=st(w);let y;e[10]!==o?(y=async()=>{const C=await Be.organization.rejectInvitation({invitationId:o});if(C.error)throw new Error(C.error.message);return C.data},e[10]=o,e[11]=y):y=e[11];let l,g;e[12]!==i?(l=()=>{We.success(i("common.pendingInviteScreen.invitationDeclined")),window.location.href="/"},g=C=>{We.error(C instanceof Error?C.message:i("common.pendingInviteScreen.failedToDecline"))},e[12]=i,e[13]=l,e[14]=g):(l=e[13],g=e[14]);let f;e[15]!==y||e[16]!==l||e[17]!==g?(f={mutationFn:y,onSuccess:l,onError:g},e[15]=y,e[16]=l,e[17]=g,e[18]=f):f=e[18];const d=st(f),x=u.isPending||d.isPending;let b;e[19]!==a||e[20]!==r?(b=a?n.jsx(it,{url:a,fallback:r,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(wn,{className:"h-6 w-6 text-primary"})}),e[19]=a,e[20]=r,e[21]=b):b=e[21];let S;e[22]!==r||e[23]!==i?(S=i("common.pendingInviteScreen.invitedTo",{orgName:r}),e[22]=r,e[23]=i,e[24]=S):S=e[24];let j;e[25]!==S?(j=n.jsx("h3",{className:"text-lg font-medium",children:S}),e[25]=S,e[26]=j):j=e[26];let P;e[27]!==i?(P=i("common.pendingInviteScreen.acceptDescription"),e[27]=i,e[28]=P):P=e[28];let k;e[29]!==P?(k=n.jsx("p",{className:"text-sm text-muted-foreground",children:P}),e[29]=P,e[30]=k):k=e[30];let v;e[31]!==j||e[32]!==k?(v=n.jsxs("div",{className:"space-y-2",children:[j,k]}),e[31]=j,e[32]=k,e[33]=v):v=e[33];let T;e[34]!==u?(T=()=>u.mutate(),e[34]=u,e[35]=T):T=e[35];let N;e[36]!==u.isPending||e[37]!==i?(N=u.isPending?i("common.pendingInviteScreen.acceptingButton"):i("common.pendingInviteScreen.acceptButton"),e[36]=u.isPending,e[37]=i,e[38]=N):N=e[38];let _;e[39]!==x||e[40]!==T||e[41]!==N?(_=n.jsx(F,{onClick:T,disabled:x,children:N}),e[39]=x,e[40]=T,e[41]=N,e[42]=_):_=e[42];let p;e[43]!==d?(p=()=>d.mutate(),e[43]=d,e[44]=p):p=e[44];let A;e[45]!==d.isPending||e[46]!==i?(A=d.isPending?i("common.pendingInviteScreen.decliningButton"):i("common.pendingInviteScreen.declineButton"),e[45]=d.isPending,e[46]=i,e[47]=A):A=e[47];let $;e[48]!==x||e[49]!==p||e[50]!==A?($=n.jsx(F,{variant:"ghost",onClick:p,disabled:x,children:A}),e[48]=x,e[49]=p,e[50]=A,e[51]=$):$=e[51];let I;e[52]!==_||e[53]!==$?(I=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[_,$]}),e[52]=_,e[53]=$,e[54]=I):I=e[54];let D;return e[55]!==v||e[56]!==I||e[57]!==b?(D=n.jsxs(fe,{children:[b,v,I]}),e[55]=v,e[56]=I,e[57]=b,e[58]=D):D=e[58],D}function rs(t){const e=R.c(23),{orgName:o,orgLogo:r}=t,s=J();let a;e[0]!==r||e[1]!==o?(a=r?n.jsx(it,{url:r,fallback:o,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full","aria-hidden":"true",children:n.jsx(vn,{className:"h-6 w-6 text-primary"})}),e[0]=r,e[1]=o,e[2]=a):a=e[2];let i;e[3]!==s?(i=s("common.requestPendingScreen.title"),e[3]=s,e[4]=i):i=e[4];let c;e[5]!==i?(c=n.jsx("h3",{className:"text-lg font-medium",children:i}),e[5]=i,e[6]=c):c=e[6];let m;e[7]!==o||e[8]!==s?(m=s("common.requestPendingScreen.description",{orgName:o}),e[7]=o,e[8]=s,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[10]=m,e[11]=h):h=e[11];let w;e[12]!==c||e[13]!==h?(w=n.jsxs("div",{className:"space-y-2",children:[c,h]}),e[12]=c,e[13]=h,e[14]=w):w=e[14];let u;e[15]!==s?(u=s("common.goHome"),e[15]=s,e[16]=u):u=e[16];let y;e[17]!==u?(y=n.jsx(F,{variant:"ghost",onClick:ls,children:u}),e[17]=u,e[18]=y):y=e[18];let l;return e[19]!==a||e[20]!==w||e[21]!==y?(l=n.jsxs(fe,{children:[a,w,y]}),e[19]=a,e[20]=w,e[21]=y,e[22]=l):l=e[22],l}function ls(){window.location.href="/"}function cs(t){const e=R.c(45),{orgName:o,orgSlug:r,orgLogo:s,domain:a}=t,i=J();let c;e[0]!==r?(c=async()=>{const _=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r})}),p=await _.json();if(!_.ok||!p.success)throw new Error(p.error??"Failed to request access");return p},e[0]=r,e[1]=c):c=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=us,e[2]=m):m=e[2];let h;e[3]!==i?(h=_=>{We.error(_ instanceof Error?_.message:i("common.requestToJoinScreen.failedToRequest"))},e[3]=i,e[4]=h):h=e[4];let w;e[5]!==c||e[6]!==h?(w={mutationFn:c,onSuccess:m,onError:h},e[5]=c,e[6]=h,e[7]=w):w=e[7];const u=st(w);let y;e[8]!==s||e[9]!==o?(y=s?n.jsx(it,{url:s,fallback:o,shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Lt,{className:"h-6 w-6 text-primary"})}),e[8]=s,e[9]=o,e[10]=y):y=e[10];let l;e[11]!==o||e[12]!==i?(l=i("common.requestToJoinScreen.title",{orgName:o}),e[11]=o,e[12]=i,e[13]=l):l=e[13];let g;e[14]!==l?(g=n.jsx("h3",{className:"text-lg font-medium",children:l}),e[14]=l,e[15]=g):g=e[15];let f;e[16]!==a||e[17]!==i?(f=i("common.requestToJoinScreen.description",{domain:a}),e[16]=a,e[17]=i,e[18]=f):f=e[18];let d;e[19]!==f?(d=n.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[19]=f,e[20]=d):d=e[20];let x;e[21]!==g||e[22]!==d?(x=n.jsxs("div",{className:"space-y-2",children:[g,d]}),e[21]=g,e[22]=d,e[23]=x):x=e[23];let b;e[24]!==u?(b=()=>u.mutate(),e[24]=u,e[25]=b):b=e[25];let S;e[26]!==u.isPending||e[27]!==i?(S=u.isPending?i("common.requestToJoinScreen.requesting"):i("common.requestToJoinScreen.requestButton"),e[26]=u.isPending,e[27]=i,e[28]=S):S=e[28];let j;e[29]!==u.isPending||e[30]!==b||e[31]!==S?(j=n.jsx(F,{onClick:b,disabled:u.isPending,children:S}),e[29]=u.isPending,e[30]=b,e[31]=S,e[32]=j):j=e[32];const P=u.isPending;let k;e[33]!==i?(k=i("common.goHome"),e[33]=i,e[34]=k):k=e[34];let v;e[35]!==u.isPending||e[36]!==k?(v=n.jsx(F,{variant:"ghost",onClick:ds,disabled:P,children:k}),e[35]=u.isPending,e[36]=k,e[37]=v):v=e[37];let T;e[38]!==j||e[39]!==v?(T=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[j,v]}),e[38]=j,e[39]=v,e[40]=T):T=e[40];let N;return e[41]!==x||e[42]!==T||e[43]!==y?(N=n.jsxs(fe,{children:[y,x,T]}),e[41]=x,e[42]=T,e[43]=y,e[44]=N):N=e[44],N}function ds(){window.location.href="/"}function us(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function ms(t){const e=R.c(7);let o;e[0]!==t?(o=Ue.orgAccessStatus(t),e[0]=t,e[1]=o):o=e[1];let r;e[2]!==t?(r=async()=>{const a=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!a.ok)throw new Error(`org-access-status failed (${a.status})`);return await a.json()},e[2]=t,e[3]=r):r=e[3];let s;return e[4]!==o||e[5]!==r?(s={queryKey:o,queryFn:r,refetchOnWindowFocus:!1},e[4]=o,e[5]=r,e[6]=s):s=e[6],Nt(s)}function fs({orgSlug:t}){const{data:e}=ms(t);if(e.status!=="member"){Wt()?.org===t&&Yt();const o=localStorage.getItem(Ke.lastOrgSlug())===t;if(o&&localStorage.removeItem(Ke.lastOrgSlug()),o&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?n.jsx(St,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(as,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(ss,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?n.jsx(cs,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?n.jsx(rs,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):n.jsx(St,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function Rt(t){const e=R.c(42),{ariaLabel:o,dismissLabel:r,eyebrow:s,title:a,description:i,icon:c,children:m,footerLeading:h,actions:w,onDismiss:u,tone:y}=t,l=y===void 0?"neutral":y,g=h||w;let f;e[0]!==l?(f=l==="system"&&n.jsx("div",{className:"h-0.5 bg-special"}),e[0]=l,e[1]=f):f=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(En,{size:14}),e[2]=d):d=e[2];let x;e[3]!==r||e[4]!==u?(x=n.jsx(F,{size:"icon-sm",variant:"ghost","aria-label":r,className:"absolute right-2 top-2 z-10 text-muted-foreground",onClick:u,children:d}),e[3]=r,e[4]=u,e[5]=x):x=e[5];const b=c&&"flex items-start gap-3",S=m&&"pb-3";let j;e[6]!==b||e[7]!==S?(j=ht("p-4 pr-11",b,S),e[6]=b,e[7]=S,e[8]=j):j=e[8];let P;e[9]!==c?(P=c&&n.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-special/10 text-special",children:c}),e[9]=c,e[10]=P):P=e[10];let k;e[11]!==s?(k=s&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s}),e[11]=s,e[12]=k):k=e[12];let v;e[13]!==a?(v=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:a}),e[13]=a,e[14]=v):v=e[14];let T;e[15]!==i?(T=i&&n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i}),e[15]=i,e[16]=T):T=e[16];let N;e[17]!==v||e[18]!==T||e[19]!==k?(N=n.jsxs("div",{children:[k,v,T]}),e[17]=v,e[18]=T,e[19]=k,e[20]=N):N=e[20];let _;e[21]!==m?(_=m&&n.jsx("div",{className:"mt-3",children:m}),e[21]=m,e[22]=_):_=e[22];let p;e[23]!==N||e[24]!==_?(p=n.jsxs("div",{className:"min-w-0 flex-1",children:[N,_]}),e[23]=N,e[24]=_,e[25]=p):p=e[25];let A;e[26]!==p||e[27]!==j||e[28]!==P?(A=n.jsxs("div",{className:j,children:[P,p]}),e[26]=p,e[27]=j,e[28]=P,e[29]=A):A=e[29];let $;e[30]!==w||e[31]!==h||e[32]!==g||e[33]!==l?($=g&&n.jsxs("div",{className:ht("flex items-center justify-between gap-3 px-4 py-2.5",l==="system"?"border-t border-border bg-muted/50":"pt-0"),children:[n.jsx("div",{className:"min-w-0 text-xs text-muted-foreground",children:h}),n.jsx("div",{className:"flex shrink-0 items-center gap-2",children:w})]}),e[30]=w,e[31]=h,e[32]=g,e[33]=l,e[34]=$):$=e[34];let I;return e[35]!==o||e[36]!==A||e[37]!==$||e[38]!==f||e[39]!==x||e[40]!==l?(I=n.jsxs("div",{role:"dialog","aria-label":o,"data-slot":"announcement-card","data-tone":l,className:"relative w-full overflow-hidden rounded-lg bg-popover shadow-soft animate-in fade-in slide-in-from-bottom-2 duration-300",children:[f,x,A,$]}),e[35]=o,e[36]=A,e[37]=$,e[38]=f,e[39]=x,e[40]=l,e[41]=I):I=e[41],I}const hs={switcher:"tour-layout-switcher",nav:"tour-layout-nav",tasks:"tour-layout-tasks",projects:"tour-layout-projects",account:"tour-layout-account",recentActivity:"tour-layout-recent-activity",siteEditor:"tour-layout-site-editor",surfaceTabs:"tour-layout-surface-tabs",branchPicker:"tour-layout-branch-picker",automations:"tour-layout-automations",settings:"tour-layout-settings"};function Ft(t){return`[data-tour="${hs[t]}"]`}const gs=[{scope:"shell",anchor:"switcher",titleKey:"layoutTour.switcher.title",descKey:"layoutTour.switcher.description",side:"right"},{scope:"shell",anchor:"nav",titleKey:"layoutTour.nav.title",descKey:"layoutTour.nav.description",side:"right"},{scope:"shell",anchor:"tasks",titleKey:"layoutTour.tasks.title",descKey:"layoutTour.tasks.description",side:"right"},{scope:"project",anchor:"siteEditor",titleKey:"layoutTour.siteEditor.title",descKey:"layoutTour.siteEditor.description",side:"right"},{scope:"project",anchor:"automations",titleKey:"layoutTour.automations.title",descKey:"layoutTour.automations.description",side:"right"},{scope:"shell",anchor:"settings",titleKey:"layoutTour.settings.title",descKey:"layoutTour.settings.description",side:"right"},{scope:"shell",anchor:"projects",titleKey:"layoutTour.projects.title",descKey:"layoutTour.projects.description",side:"right"},{scope:"shell",anchor:"account",titleKey:"layoutTour.account.title",descKey:"layoutTour.account.description",side:"right"},{scope:"siteEditor",anchor:"surfaceTabs",titleKey:"layoutTour.surfaceTabs.title",descKey:"layoutTour.surfaceTabs.description",side:"bottom"},{scope:"siteEditor",anchor:"branchPicker",titleKey:"layoutTour.branchPicker.title",descKey:"layoutTour.branchPicker.description",side:"bottom"},{scope:"orgHome",anchor:"recentActivity",titleKey:"layoutTour.recentActivity.title",descKey:"layoutTour.recentActivity.description",side:"top"}];function ps(t){return gs.filter(e=>e.scope==="shell"||e.scope==="orgHome"&&t.onOrgHome||e.scope==="project"&&t.inProject||e.scope==="siteEditor"&&t.onSiteEditor)}function ys(t,e){return ps(e).map(o=>({element:Ft(o.anchor),popover:{title:t(o.titleKey),description:t(o.descKey),side:o.side,align:"center"}}))}const bs=Ft("switcher"),xs=30;function Mt(t){const e=document.querySelector(t);return e instanceof HTMLElement&&e.offsetParent!==null}function Ss(t,e){return ys(t,e).filter(o=>typeof o.element=="string"&&Mt(o.element))}function ws(t,e){return{showProgress:!0,progressText:t("layoutTour.progress"),nextBtnText:t("layoutTour.next"),prevBtnText:t("layoutTour.prev"),doneBtnText:t("layoutTour.done"),showButtons:["next","previous"],smoothScroll:!0,allowClose:!0,disableActiveInteraction:!0,stagePadding:6,stageRadius:8,waitForElement:0,skipMissingElement:!0,popoverClass:"layout-tour-popover",onPopoverRender:(o,{driver:r})=>{if(o.footerButtons.querySelector(".layout-tour-skip"))return;const s=document.createElement("button");s.type="button",s.className="driver-popover-footer-btn layout-tour-skip",s.textContent=t("layoutTour.skip"),s.addEventListener("click",()=>r.destroy()),o.footerButtons.insertBefore(s,o.footerButtons.firstChild)},onDestroyed:()=>{Ve=!1},steps:e}}let Ve=!1;async function vs(){return(await Qt(()=>import("./driver.js-Dj4CfABu.js"),[])).driver}function js(t,e){if(Ve)return;Ve=!0;let o=0;const r=()=>{if(!Mt(bs)&&o++<xs){requestAnimationFrame(r);return}const s=Ss(t,e);if(s.length===0){Ve=!1;return}vs().then(a=>{a(ws(t,s)).drive()}).catch(()=>{Ve=!1})};r()}function ks(t){return t!=="off"}function si(t){if(!t.hasSource)return[];const e=["site-editor"];return ks(t.cmsMode)&&e.push("content"),t.runtime==="sandbox"&&e.push("code"),e}function zt(t){return t==="site-editor"||t==="content"||t==="code"||t.startsWith("code:")}function oi(t){return t.reportsOnly&&!t.onReportAgent&&zt(t.tabId)}const qt=[{id:"new-layout",date:"2026-09-22",eyebrow:"Now Available",title:"New Layout",bullets:[{icon:bt,title:"Unified page headers",body:"Every page now has a clear header with navigation breadcrumbs and actions, making it easy to orient yourself and move around."},{icon:lt,title:"Consistent navigation and controls",body:"Settings and project pages use a predictable sidebar instead of scattered tabs. Buttons, inputs and toolbars share one shape and one height, and the layout adapts to smaller screens."},{icon:jn,title:"Site editor redesigned",body:"Try the redesigned blocks editor from Profile & Preferences. Blocks share consistent actions, variants appear beside their block in the header, and section selection is searchable."}],cta:{label:"Take a tour",action:"start-tour"}},{id:"unified-workspace-layout",date:"2026-09-01",eyebrow:"Now Available",title:"A new way around Studio",bullets:[{icon:gt,title:"Unified org switcher",body:"Organizations and agents now share one control at the top of the sidebar. Search it to jump straight to any agent, including ones in your other organizations."},{icon:ae,title:"Your org at a glance",body:"The organization home now opens on the agents your team built and the tasks they are running — no empty board to fill in first."},{icon:bt,title:"Simplified CMS",body:"The CMS opens over the page you are previewing rather than somewhere else, so changing a section never costs you your place."}],cta:{label:"Take the tour",action:"start-tour"}},{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:ae,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:de,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:qe,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:ae,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:de,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:qe,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:de,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:ae,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:qe,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:ae,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:de,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:qe,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:ae,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:de,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:qe,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:ae,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:lt,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:de,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:gt,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:qe,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:de,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:ae,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:lt,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:ae,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:kn,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],ot="studio.release-feed.v1",dt=new Set;let ue="",me={},ut=!1;function Ts(){if(ut)return ue||"{}";try{return localStorage.getItem(ot)??"{}"}catch{return ue||"{}"}}function Kt(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function wt(){const t=Ts();return t!==ue&&(ue=t,me=Kt(t)),me}function Ns(t){dt.add(t);const e=o=>{if(!(o.key!==ot&&o.key!==null)){try{const r=localStorage.getItem(ot)??"{}",a={...Kt(r),...me};me=a,ue=JSON.stringify(a)}catch{}t()}};return window.addEventListener("storage",e),()=>{dt.delete(t),window.removeEventListener("storage",e)}}function _s(t){me=t,ue=JSON.stringify(t);try{localStorage.setItem(ot,ue),ut=!1}catch{ut=!0}dt.forEach(e=>e())}function Ps(){const t=R.c(7),e=se.useSyncExternalStore(Ns,wt,wt);let o;t[0]!==e?(o=m=>!!e[m],t[0]=e,t[1]=o):o=t[1];const r=o,s=As;let a;t[2]!==e?(a=qt.reduce((m,h)=>e[h.id]?m:m+1,0),t[2]=e,t[3]=a):a=t[3];const i=a;let c;return t[4]!==r||t[5]!==i?(c={isSeen:r,markSeen:s,unseenCount:i},t[4]=r,t[5]=i,t[6]=c):c=t[6],c}function As(t){me[t]||_s({...me,[t]:{seenAt:new Date().toISOString()}})}const Cs=720*60*60*1e3,Es=10080*60*1e3;function Os(t){const[e,o,r]=t.split("-").map(Number);return!e||!o||!r?new Date(t).getTime():new Date(e,o-1,r).getTime()}function Is(t){const e=qt[0];if(!e)return null;const o=Os(e.date),r=t-o;return r<0||r>Cs?null:e}function $s(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function Ls(t,e){const o=$s(t);return o===null?!1:e-o>=Es}function Ds(){const t=R.c(46),e=J(),o=On(),r=Xt(),s=Dt(),a=!!o,i=r===re.home&&!o;let c;t[0]!==s||t[1]!==a?(c=a&&!!s&&zt(s),t[0]=s,t[1]=a,t[2]=c):c=t[2];const m=c,{data:h}=Be.useSession(),{isSeen:w,markSeen:u}=Ps(),y=Ln(6e4);let l,g,f;if(t[3]!==w||t[4]!==y||t[5]!==h?.user?.createdAt){f=Symbol.for("react.early_return_sentinel");e:{if(l=Is(y),!l){f=null;break e}if(!Ls(h?.user?.createdAt,y)){f=null;break e}g=w(l.id)}t[3]=w,t[4]=y,t[5]=h?.user?.createdAt,t[6]=l,t[7]=g,t[8]=f}else l=t[6],g=t[7],f=t[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;if(g)return null;let d;t[9]!==l.id||t[10]!==a||t[11]!==u||t[12]!==i||t[13]!==m||t[14]!==e?(d=()=>{u(l.id),js(e,{onOrgHome:i,inProject:a,onSiteEditor:m})},t[9]=l.id,t[10]=a,t[11]=u,t[12]=i,t[13]=m,t[14]=e,t[15]=d):d=t[15];const x=d;let b;t[16]!==e?(b=e("announcements.release.ariaLabel"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==e?(S=e("announcements.release.dismiss"),t[18]=e,t[19]=S):S=t[19];const j=l.eyebrow,P=l.title;let k;t[20]!==l.id||t[21]!==u?(k=()=>u(l.id),t[20]=l.id,t[21]=u,t[22]=k):k=t[22];let v;t[23]!==l.id||t[24]!==l.learnMoreHref||t[25]!==u||t[26]!==e?(v=l.learnMoreHref?n.jsx("a",{href:l.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:()=>u(l.id),className:"underline-offset-2 hover:text-foreground hover:underline",children:e("announcements.release.learnMore")}):null,t[23]=l.id,t[24]=l.learnMoreHref,t[25]=u,t[26]=e,t[27]=v):v=t[27];let T;t[28]!==l.cta||t[29]!==l.id||t[30]!==u||t[31]!==x?(T=l.cta?"href"in l.cta?n.jsx(F,{asChild:!0,size:"sm",onClick:()=>u(l.id),children:n.jsx("a",{href:l.cta.href,children:l.cta.label})}):n.jsx(F,{size:"sm",onClick:x,children:l.cta.label}):null,t[28]=l.cta,t[29]=l.id,t[30]=u,t[31]=x,t[32]=T):T=t[32];let N;t[33]!==l.bullets?(N=l.bullets.map(Rs),t[33]=l.bullets,t[34]=N):N=t[34];let _;t[35]!==N?(_=n.jsx("ul",{className:"flex flex-col gap-3",children:N}),t[35]=N,t[36]=_):_=t[36];let p;return t[37]!==l.eyebrow||t[38]!==l.title||t[39]!==T||t[40]!==_||t[41]!==b||t[42]!==S||t[43]!==k||t[44]!==v?(p=n.jsx(Rt,{ariaLabel:b,dismissLabel:S,eyebrow:j,title:P,onDismiss:k,footerLeading:v,actions:T,children:_}),t[37]=l.eyebrow,t[38]=l.title,t[39]=T,t[40]=_,t[41]=b,t[42]=S,t[43]=k,t[44]=v,t[45]=p):p=t[45],p}function Rs(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const Bt=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),ce=Bt?"⌘":"Ctrl",G={commandPalette:{keys:[ce,"K"],description:"Command palette"},keyboardShortcuts:{keys:["?"],description:"Keyboard shortcuts"},back:{keys:[ce,"["],description:"Back to previous"},focusChatInput:{keys:[ce,"L"],description:"Focus chat input"},saveAndFormat:{keys:[ce,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[ce,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[ce,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",ce,"S"],description:"New task"},toggleDaemon:{keys:[ce,"D"],description:"Toggle daemon logs"}},Fs=[{label:"General",shortcuts:[G.commandPalette,G.keyboardShortcuts,G.back,G.newTask,G.toggleDaemon]},{label:"Editor",shortcuts:[G.saveAndFormat]},{label:"Chat",shortcuts:[G.focusChatInput,G.togglePlanMode,G.sendMessage,G.newLine]},{label:"Questions",shortcuts:[G.selectOption]},{label:"Monitoring",shortcuts:[G.applyFilter]}];function vt(t){return Bt?t.metaKey:t.ctrlKey}function Ms(t){if(!(t instanceof HTMLElement))return!1;if(t.isContentEditable)return!0;const e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"}function zs(t){const e=R.c(11),{open:o,onOpenChange:r}=t,s=J();let a;e[0]!==s?(a=s("common.keyboardShortcutsDialog.title"),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==a?(i=n.jsx(_t,{children:n.jsx(Pt,{children:a})}),e[2]=a,e[3]=i):i=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex flex-col gap-4",children:Fs.map(qs)}),e[4]=c):c=e[4];let m;e[5]!==i?(m=n.jsxs(At,{className:"sm:max-w-md",children:[i,c]}),e[5]=i,e[6]=m):m=e[6];let h;return e[7]!==r||e[8]!==o||e[9]!==m?(h=n.jsx(Ct,{open:o,onOpenChange:r,children:m}),e[7]=r,e[8]=o,e[9]=m,e[10]=h):h=e[10],h}function qs(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(Ks)})]},t.label)}function Ks(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(Bs)})]},t.description)}function Bs(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const jt=8;function Hs(t){const{org:e}=mt(),o=Bn({connectionId:Ot,orgId:e.id,orgSlug:e.slug}),{data:r}=He({queryKey:Ue.globalSearch(e.id,t,jt),enabled:!!o&&t.trim().length>=2,staleTime:15e3,retry:!1,queryFn:async()=>{if(!o)return[];try{return(await o.callTool({name:"GLOBAL_SEARCH",arguments:{query:t,limit:jt}})).structuredContent?.items??[]}catch{return[]}}});return r??[]}function Us(t){const e=R.c(195),{open:o,onOpenChange:r}=t,s=J(),a=Et(),{org:i}=mt(),{projects:c,hasProjects:m}=In(),[h,w]=se.useState(""),u=se.useDeferredValue(h),y=Hs(u);let l;e[0]!==r?(l=()=>{r(!1),w("")},e[0]=r,e[1]=l):l=e[1];const g=l;let f;e[2]!==g?(f=(q,W)=>{ct("command_palette_used",{kind:W}),q(),g()},e[2]=g,e[3]=f):f=e[3];const d=f;let x;e[4]!==a||e[5]!==i.id||e[6]!==i.slug?(x=q=>{if(q.type==="connection"){if(!q.slug){a({to:"/$org/settings/connections",params:{org:i.slug},search:{tab:"all"}});return}a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:q.slug}});return}if(q.type==="task"){a({to:re.tasks,params:{org:i.slug,taskKey:q.key??void 0}});return}const W=It(i.id).id;Zt(a,en({org:i.slug,agentId:q.virtual_mcp_id??W,superAgentId:W}),{search:()=>({thread:q.id}),replace:!1})},e[4]=a,e[5]=i.id,e[6]=i.slug,e[7]=x):x=e[7];const b=x;let S;e[8]!==h?(S=[h],e[8]=h,e[9]=S):S=e[9];const j=S;let P,k,v,T,N,_,p,A,$,I,D,C,M;if(e[10]!==g||e[11]!==d||e[12]!==m||e[13]!==y||e[14]!==a||e[15]!==r||e[16]!==o||e[17]!==b||e[18]!==i.slug||e[19]!==c||e[20]!==j||e[21]!==s||e[22]!==h){const q=y.filter(Js),W=y.filter(Gs);let Y;e[36]!==i.slug?(Y={org:i.slug},e[36]=i.slug,e[37]=Y):Y=e[37];const L=Y;let Q;e[38]!==s?(Q=s("sidebar.navDestinations.home"),e[38]=s,e[39]=Q):Q=e[39];let Ge;e[40]===Symbol.for("react.memo_cache_sentinel")?(Ge=n.jsx(Nn,{"aria-hidden":"true"}),e[40]=Ge):Ge=e[40];let oe;e[41]!==L||e[42]!==Q?(oe={key:"home",label:Q,icon:Ge,to:re.home,params:L},e[41]=L,e[42]=Q,e[43]=oe):oe=e[43];let B;e[44]!==s?(B=s("sidebar.navDestinations.reports"),e[44]=s,e[45]=B):B=e[45];let X;e[46]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(_n,{"aria-hidden":"true"}),e[46]=X):X=e[46];let Z;e[47]!==L||e[48]!==B?(Z={key:"reports",label:B,icon:X,to:re.reports,params:L},e[47]=L,e[48]=B,e[49]=Z):Z=e[49];let ee;e[50]!==s?(ee=s("sidebar.navDestinations.tasks"),e[50]=s,e[51]=ee):ee=e[51];let te;e[52]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(yt,{"aria-hidden":"true"}),e[52]=te):te=e[52];let H;e[53]!==i.slug?(H={org:i.slug,taskKey:void 0},e[53]=i.slug,e[54]=H):H=e[54];let U;e[55]!==ee||e[56]!==H?(U={key:"tasks",label:ee,icon:te,to:re.tasks,params:H},e[55]=ee,e[56]=H,e[57]=U):U=e[57];let ne;e[58]!==s?(ne=s("sidebar.navDestinations.library"),e[58]=s,e[59]=ne):ne=e[59];let ie;e[60]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(Pn,{"aria-hidden":"true"}),e[60]=ie):ie=e[60];let E;e[61]!==L||e[62]!==ne?(E={key:"library",label:ne,icon:ie,to:re.library,params:L},e[61]=L,e[62]=ne,e[63]=E):E=e[63];let z;e[64]!==s?(z=s("sidebar.navDestinations.discover"),e[64]=s,e[65]=z):z=e[65];let Qe;e[66]===Symbol.for("react.memo_cache_sentinel")?(Qe=n.jsx(An,{"aria-hidden":"true"}),e[66]=Qe):Qe=e[66];let he;e[67]!==L||e[68]!==z?(he={key:"discover",label:z,icon:Qe,to:re.discover,params:L},e[67]=L,e[68]=z,e[69]=he):he=e[69];let Xe;e[70]!==oe||e[71]!==Z||e[72]!==U||e[73]!==E||e[74]!==he?(Xe=[oe,Z,U,E,he],e[70]=oe,e[71]=Z,e[72]=U,e[73]=E,e[74]=he,e[75]=Xe):Xe=e[75];const at=Xe;k=Rn,T=o,e[76]!==g||e[77]!==r?(N=O=>O?r(!0):g(),e[76]=g,e[77]=r,e[78]=N):N=e[78],e[79]!==s?(_=s("commandPalette.title"),e[79]=s,e[80]=_):_=e[80],e[81]!==s?(p=s("commandPalette.description"),e[81]=s,e[82]=p):p=e[82];let ge;e[83]!==s?(ge=s("commandPalette.placeholder"),e[83]=s,e[84]=ge):ge=e[84];let pe;e[85]!==s?(pe=s("commandPalette.placeholder"),e[85]=s,e[86]=pe):pe=e[86],e[87]!==ge||e[88]!==pe||e[89]!==h?(A=n.jsx(Fn,{placeholder:ge,"aria-label":pe,value:h,onValueChange:w}),e[87]=ge,e[88]=pe,e[89]=h,e[90]=A):A=e[90],P=Mn;let ye;e[91]!==s?(ye=s("commandPalette.empty"),e[91]=s,e[92]=ye):ye=e[92],e[93]!==ye?($=n.jsx(zn,{children:ye}),e[93]=ye,e[94]=$):$=e[94];let be;e[95]!==s?(be=s("commandPalette.goTo"),e[95]=s,e[96]=be):be=e[96];let xe;e[97]!==at||e[98]!==d||e[99]!==a?(xe=at.map(O=>n.jsxs(le,{onSelect:()=>d(()=>a({to:O.to,params:O.params}),"destination"),children:[O.icon,n.jsx("span",{children:O.label})]},O.key)),e[97]=at,e[98]=d,e[99]=a,e[100]=xe):xe=e[100],e[101]!==be||e[102]!==xe?(I=n.jsx(Je,{heading:be,children:xe}),e[101]=be,e[102]=xe,e[103]=I):I=e[103],e[104]!==d||e[105]!==m||e[106]!==a||e[107]!==i.slug||e[108]!==c||e[109]!==s?(D=m&&n.jsx(Je,{heading:s("commandPalette.projects"),children:c.map(O=>n.jsxs(le,{value:`project ${O.title}`,onSelect:()=>d(()=>a({to:re.projects,params:{org:i.slug,agentId:O.id}}),"project"),children:[n.jsx(Kn,{icon:O.icon,name:O.title,"aria-hidden":"true"}),n.jsx("span",{children:O.title})]},O.id))}),e[104]=d,e[105]=m,e[106]=a,e[107]=i.slug,e[108]=c,e[109]=s,e[110]=D):D=e[110];let Se;e[111]!==s?(Se=s("commandPalette.actions"),e[111]=s,e[112]=Se):Se=e[112];let we;e[113]!==s?(we=s("commandPalette.newProject"),e[113]=s,e[114]=we):we=e[114];let ve;e[115]!==d||e[116]!==a||e[117]!==L?(ve=()=>d(()=>a({to:re.home,params:L}),"new_project"),e[115]=d,e[116]=a,e[117]=L,e[118]=ve):ve=e[118];let Ze;e[119]===Symbol.for("react.memo_cache_sentinel")?(Ze=n.jsx(xt,{"aria-hidden":"true"}),e[119]=Ze):Ze=e[119];let je;e[120]!==s?(je=s("commandPalette.newProject"),e[120]=s,e[121]=je):je=e[121];let ke;e[122]!==je?(ke=n.jsx("span",{children:je}),e[122]=je,e[123]=ke):ke=e[123];let Te;e[124]!==we||e[125]!==ve||e[126]!==ke?(Te=n.jsxs(le,{value:we,onSelect:ve,children:[Ze,ke]}),e[124]=we,e[125]=ve,e[126]=ke,e[127]=Te):Te=e[127];let Ne;e[128]!==s?(Ne=s("commandPalette.inviteTeammate"),e[128]=s,e[129]=Ne):Ne=e[129];let _e;e[130]!==d||e[131]!==a||e[132]!==L?(_e=()=>d(()=>a({to:"/$org/settings/members",params:L}),"invite"),e[130]=d,e[131]=a,e[132]=L,e[133]=_e):_e=e[133];let et;e[134]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(Cn,{"aria-hidden":"true"}),e[134]=et):et=e[134];let Pe;e[135]!==s?(Pe=s("commandPalette.inviteTeammate"),e[135]=s,e[136]=Pe):Pe=e[136];let Ae;e[137]!==Pe?(Ae=n.jsx("span",{children:Pe}),e[137]=Pe,e[138]=Ae):Ae=e[138];let Ce;e[139]!==Ne||e[140]!==_e||e[141]!==Ae?(Ce=n.jsxs(le,{value:Ne,onSelect:_e,children:[et,Ae]}),e[139]=Ne,e[140]=_e,e[141]=Ae,e[142]=Ce):Ce=e[142];let Ee;e[143]!==s?(Ee=s("commandPalette.addConnection"),e[143]=s,e[144]=Ee):Ee=e[144];let Oe;e[145]!==d||e[146]!==a||e[147]!==L?(Oe=()=>d(()=>a({to:"/$org/settings/connections",params:L,search:{tab:"all"}}),"add_connection"),e[145]=d,e[146]=a,e[147]=L,e[148]=Oe):Oe=e[148];let tt;e[149]===Symbol.for("react.memo_cache_sentinel")?(tt=n.jsx(xt,{"aria-hidden":"true"}),e[149]=tt):tt=e[149];let Ie;e[150]!==s?(Ie=s("commandPalette.addConnection"),e[150]=s,e[151]=Ie):Ie=e[151];let $e;e[152]!==Ie?($e=n.jsx("span",{children:Ie}),e[152]=Ie,e[153]=$e):$e=e[153];let Le;e[154]!==Ee||e[155]!==Oe||e[156]!==$e?(Le=n.jsxs(le,{value:Ee,onSelect:Oe,children:[tt,$e]}),e[154]=Ee,e[155]=Oe,e[156]=$e,e[157]=Le):Le=e[157];let De;e[158]!==s?(De=s("commandPalette.settings"),e[158]=s,e[159]=De):De=e[159];let Re;e[160]!==d||e[161]!==a||e[162]!==L?(Re=()=>d(()=>a({to:"/$org/settings/general",params:L}),"settings"),e[160]=d,e[161]=a,e[162]=L,e[163]=Re):Re=e[163];let nt;e[164]===Symbol.for("react.memo_cache_sentinel")?(nt=n.jsx(Dn,{"aria-hidden":"true"}),e[164]=nt):nt=e[164];let Fe;e[165]!==s?(Fe=s("commandPalette.settings"),e[165]=s,e[166]=Fe):Fe=e[166];let Me;e[167]!==Fe?(Me=n.jsx("span",{children:Fe}),e[167]=Fe,e[168]=Me):Me=e[168];let ze;e[169]!==De||e[170]!==Re||e[171]!==Me?(ze=n.jsxs(le,{value:De,onSelect:Re,children:[nt,Me]}),e[169]=De,e[170]=Re,e[171]=Me,e[172]=ze):ze=e[172],e[173]!==Se||e[174]!==Te||e[175]!==Ce||e[176]!==Le||e[177]!==ze?(C=n.jsxs(Je,{heading:Se,children:[Te,Ce,Le,ze]}),e[173]=Se,e[174]=Te,e[175]=Ce,e[176]=Le,e[177]=ze,e[178]=C):C=e[178],M=q.length>0&&n.jsx(Je,{heading:s("commandPalette.connections"),children:q.map(O=>n.jsxs(le,{value:`${O.title} ${O.id}`,keywords:j,onSelect:()=>d(()=>b(O),"connection"),children:[n.jsx(qn,{icon:O.icon,name:O.title,size:"2xs","aria-hidden":"true"}),n.jsx("span",{className:"truncate",children:O.title})]},`connection:${O.id}`))}),v=W.length>0&&n.jsx(Je,{heading:s("commandPalette.results"),children:W.map(O=>n.jsxs(le,{value:`${O.title} ${O.id}`,keywords:j,onSelect:()=>d(()=>b(O),O.type),children:[O.type==="thread"?n.jsx(Tn,{"aria-hidden":"true"}):n.jsx(yt,{"aria-hidden":"true"}),n.jsx("span",{className:"truncate",children:O.title}),O.type==="task"&&O.key&&n.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:O.key})]},`${O.type}:${O.id}`))}),e[10]=g,e[11]=d,e[12]=m,e[13]=y,e[14]=a,e[15]=r,e[16]=o,e[17]=b,e[18]=i.slug,e[19]=c,e[20]=j,e[21]=s,e[22]=h,e[23]=P,e[24]=k,e[25]=v,e[26]=T,e[27]=N,e[28]=_,e[29]=p,e[30]=A,e[31]=$,e[32]=I,e[33]=D,e[34]=C,e[35]=M}else P=e[23],k=e[24],v=e[25],T=e[26],N=e[27],_=e[28],p=e[29],A=e[30],$=e[31],I=e[32],D=e[33],C=e[34],M=e[35];let K;e[179]!==P||e[180]!==v||e[181]!==$||e[182]!==I||e[183]!==D||e[184]!==C||e[185]!==M?(K=n.jsxs(P,{children:[$,I,D,C,M,v]}),e[179]=P,e[180]=v,e[181]=$,e[182]=I,e[183]=D,e[184]=C,e[185]=M,e[186]=K):K=e[186];let V;return e[187]!==k||e[188]!==T||e[189]!==N||e[190]!==_||e[191]!==p||e[192]!==A||e[193]!==K?(V=n.jsxs(k,{open:T,onOpenChange:N,title:_,description:p,children:[A,K]}),e[187]=k,e[188]=T,e[189]=N,e[190]=_,e[191]=p,e[192]=A,e[193]=K,e[194]=V):V=e[194],V}function Gs(t){return t.type!=="connection"}function Js(t){return t.type==="connection"}const Ye=new Vn(!1);function Vs(){Ye.set(!0)}function Ws(){Ye.set(!1)}function Ys(){const t=R.c(2),e=se.useSyncExternalStore(Ye.subscribe,Ye.get);let o;return t[0]!==e?(o=[e,Ye.set],t[0]=e,t[1]=o):o=t[1],o}const Qs=300*1e3,Xs=2;function Zs(t,e,o){return!e||e===o?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function eo(t,e){return t.count>=Xs&&t.version!==null&&t.version!==e}function to(){const t=R.c(31),e=J();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:Ue.appVersionCheck(),queryFn:so,refetchInterval:Qs,refetchIntervalInBackground:!0,staleTime:0},t[0]=o):o=t[0];const{data:r,dataUpdatedAt:s}=He(o),[a,i]=se.useState(0);let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c={version:null,count:0},t[1]=c):c=t[1];const[m,h]=se.useState(c);s!==a&&(i(s),h(T=>Zs(T,r,"4.514.1")));const[w,u]=se.useState(null);if(!eo(m,w))return null;let y;t[2]!==e?(y=e("announcements.version.ariaLabel"),t[2]=e,t[3]=y):y=t[3];let l;t[4]!==e?(l=e("announcements.version.dismiss"),t[4]=e,t[5]=l):l=t[5];let g;t[6]!==e?(g=e("announcements.version.eyebrow"),t[6]=e,t[7]=g):g=t[7];let f;t[8]!==e?(f=e("announcements.version.title"),t[8]=e,t[9]=f):f=t[9];let d;t[10]!==e?(d=e("announcements.version.description"),t[10]=e,t[11]=d):d=t[11];let x;t[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(pt,{size:16}),t[12]=x):x=t[12];let b;t[13]!==m.version?(b=()=>u(m.version),t[13]=m.version,t[14]=b):b=t[14];let S;t[15]!==e?(S=e("announcements.version.currentSession",{version:"4.514.1"}),t[15]=e,t[16]=S):S=t[16];let j;t[17]!==e?(j=e("announcements.version.refresh"),t[17]=e,t[18]=j):j=t[18];let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(pt,{size:14}),t[19]=P):P=t[19];let k;t[20]!==j?(k=n.jsxs(F,{size:"sm",onClick:no,children:[j,P]}),t[20]=j,t[21]=k):k=t[21];let v;return t[22]!==k||t[23]!==y||t[24]!==l||t[25]!==g||t[26]!==f||t[27]!==d||t[28]!==b||t[29]!==S?(v=n.jsx(Rt,{ariaLabel:y,dismissLabel:l,eyebrow:g,title:f,description:d,icon:x,tone:"system",onDismiss:b,footerLeading:S,actions:k}),t[22]=k,t[23]=y,t[24]=l,t[25]=g,t[26]=f,t[27]=d,t[28]=b,t[29]=S,t[30]=v):v=t[30],v}function no(){return window.location.reload()}async function so(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}function oo(t){return{has(){try{return localStorage.getItem(t)==="1"}catch{return!1}},mark(){try{localStorage.setItem(t,"1")}catch{}}}}const io=Date.parse("2026-07-21T00:00:00Z"),kt=t=>oo(Ke.ptBrAnnouncementSeen(t));function ao(){const t=R.c(35),e=J(),[o,r]=tn(),{data:s,isPending:a}=Be.useSession(),i=s?.user,c=i?.id,m=i?.createdAt,h=m!=null&&new Date(m).getTime()<io,w=nn()==="pt-BR",u=!a&&!!c&&h&&w&&o.language==="en"&&!kt(c).has(),[y,l]=se.useState(!1),[g,f]=se.useState(!1);!y&&!a&&(l(!0),u&&c&&(kt(c).mark(),r(lo),f(!0),ct("pt_br_auto_switch_shown")));let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=V=>{ct("pt_br_auto_switch_closed",{action:V}),f(!1)},t[0]=d):d=t[0];const x=d;let b;t[1]!==r?(b=()=>{r(ro),x("switch-back")},t[1]=r,t[2]=b):b=t[2];const S=b;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=V=>!V&&x("dismiss"),t[3]=j):j=t[3];let P;t[4]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx("div",{className:"text-4xl","aria-hidden":"true",children:"🇧🇷"}),t[4]=P):P=t[4];let k;t[5]!==e?(k=e("announcements.ptBr.title"),t[5]=e,t[6]=k):k=t[6];let v;t[7]!==k?(v=n.jsx(Pt,{children:k}),t[7]=k,t[8]=v):v=t[8];let T;t[9]!==e?(T=e("announcements.ptBr.description"),t[9]=e,t[10]=T):T=t[10];let N;t[11]!==T?(N=n.jsx(sn,{children:T}),t[11]=T,t[12]=N):N=t[12];let _;t[13]!==v||t[14]!==N?(_=n.jsxs(_t,{children:[v,N]}),t[13]=v,t[14]=N,t[15]=_):_=t[15];let p;t[16]!==e?(p=e("announcements.ptBr.switchBack"),t[16]=e,t[17]=p):p=t[17];let A;t[18]!==S||t[19]!==p?(A=n.jsx(F,{variant:"outline",onClick:S,children:p}),t[18]=S,t[19]=p,t[20]=A):A=t[20];let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($=()=>x("ok"),t[21]=$):$=t[21];let I;t[22]!==e?(I=e("announcements.ptBr.ok"),t[22]=e,t[23]=I):I=t[23];let D;t[24]!==I?(D=n.jsx(F,{onClick:$,children:I}),t[24]=I,t[25]=D):D=t[25];let C;t[26]!==A||t[27]!==D?(C=n.jsxs(on,{children:[A,D]}),t[26]=A,t[27]=D,t[28]=C):C=t[28];let M;t[29]!==C||t[30]!==_?(M=n.jsxs(At,{className:"sm:max-w-md",children:[P,_,C]}),t[29]=C,t[30]=_,t[31]=M):M=t[31];let K;return t[32]!==g||t[33]!==M?(K=n.jsx(Ct,{open:g,onOpenChange:j,children:M}),t[32]=g,t[33]=M,t[34]=K):K=t[34],K}function ro(t){return{...t,language:"en"}}function lo(t){return{...t,language:"pt-BR"}}function co(t){const e=an(t);return typeof e=="string"?e:void 0}function uo(){return co("experiment-pipeline-check"),null}function mo(t){const e=R.c(1),{activeOrg:o}=t;if(!o)return null;rn(o.id,{name:o.name??void 0,slug:o.slug??void 0}),ln();let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(uo,{}),e[0]=r):r=e[0],r}function fo(t){const{prev:e,virtualMcpId:o,decopilotId:r,savedLayout:s,opts:a,autosendValue:i}=t,c={mainpanel:void 0};o?c.virtualmcpid=o:e.virtualmcpid&&(c.virtualmcpid=e.virtualmcpid);const m=typeof e.virtualmcpid=="string"?e.virtualmcpid:r,w=(o??m)!==m;let u,y;return a?.panel?y=a.panel:a?.newThread&&!w&&cn(e.tabId)?(y=e.tabId,c.mainpanel=e.mainpanel,u=e.sidepanel):s?(y=s.tab,s.sidepanel!==void 0&&(u=s.sidepanel),s.mainpanel!==void 0&&(c.mainpanel=s.mainpanel)):!w&&e.tabId&&!dn(e.tabId)&&(y=e.tabId),u!==void 0&&(c.sidepanel=u),a?.autosend&&(c.autosend=i),{tabId:y,search:c}}const Ht="studio:thread-layout:v4",ho=50;function Ut(t){const e={};return t===null||typeof t!="object"||(typeof t.tab=="string"&&(e.tab=t.tab),typeof t.mainpanel=="boolean"&&(e.mainpanel=t.mainpanel),typeof t.sidepanel=="boolean"&&(e.sidepanel=t.sidepanel)),e}function go(t,e,o,r=ho){const s=t.filter(([a])=>a!==e);for(s.push([e,Ut(o)]);s.length>r;)s.shift();return s}function ft(){try{const t=sessionStorage.getItem(Ht);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(o=>Array.isArray(o)&&o.length===2&&typeof o[0]=="string"):[]}catch{return[]}}function Gt(t){try{sessionStorage.setItem(Ht,JSON.stringify(t))}catch{}}function po(t,e){t&&Gt(go(ft(),t,e))}function yo(t){if(!t)return null;const e=ft().find(([o])=>o===t);return e?Ut(e[1]):null}function ii(t){if(!t)return;const e=ft(),o=e.filter(([r])=>r!==t);o.length!==e.length&&Gt(o)}function Jt(t){return{queryKey:Ue.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function ai(t){const e=R.c(10);let o;e[0]!==t?(o=Jt(t),e[0]=t,e[1]=o):o=e[1];const r=He(o);let s;e[2]!==r.data?.prompts?(s=r.data?.prompts??[],e[2]=r.data?.prompts,e[3]=s):s=e[3];let a;e[4]!==r.data?.tiles?(a=r.data?.tiles??[],e[4]=r.data?.tiles,e[5]=a):a=e[5];let i;return e[6]!==r.isLoading||e[7]!==s||e[8]!==a?(i={isLoading:r.isLoading,prompts:s,tiles:a},e[6]=r.isLoading,e[7]=s,e[8]=a,e[9]=i):i=e[9],i}function bo(t){const e=R.c(31),{orgSlug:o,orgName:r,domain:s}=t,a=J();let i;e[0]!==o?(i=()=>{window.location.href=`/api/${encodeURIComponent(o)}/sso/authorize`},e[0]=o,e[1]=i):i=e[1];const c=i,m=xo;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full","aria-hidden":"true",children:n.jsx(Tt,{className:"h-6 w-6 text-primary"})}),e[2]=h):h=e[2];let w;e[3]!==a?(w=a("common.ssoRequiredScreen.title"),e[3]=a,e[4]=w):w=e[4];let u;e[5]!==w?(u=n.jsx("h3",{className:"text-lg font-medium",children:w}),e[5]=w,e[6]=u):u=e[6];let y;e[7]!==s||e[8]!==r||e[9]!==a?(y=r?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:r})," ",a("common.ssoRequiredScreen.requiresSsoAuth"),s?` ${a("common.ssoRequiredScreen.via",{domain:s})}`:"","."]}):a("common.ssoRequiredScreen.orgRequiresSsoAuth"),e[7]=s,e[8]=r,e[9]=a,e[10]=y):y=e[10];let l;e[11]!==y?(l=n.jsx("p",{className:"text-sm text-muted-foreground",children:y}),e[11]=y,e[12]=l):l=e[12];let g;e[13]!==u||e[14]!==l?(g=n.jsxs("div",{className:"space-y-2",children:[u,l]}),e[13]=u,e[14]=l,e[15]=g):g=e[15];let f;e[16]!==a?(f=a("common.ssoRequiredScreen.signInWithSso"),e[16]=a,e[17]=f):f=e[17];let d;e[18]!==c||e[19]!==f?(d=n.jsx(F,{onClick:c,children:f}),e[18]=c,e[19]=f,e[20]=d):d=e[20];let x;e[21]!==a?(x=a("common.goBack"),e[21]=a,e[22]=x):x=e[22];let b;e[23]!==x?(b=n.jsx(F,{variant:"ghost",onClick:m,children:x}),e[23]=x,e[24]=b):b=e[24];let S;e[25]!==b||e[26]!==d?(S=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[d,b]}),e[25]=b,e[26]=d,e[27]=S):S=e[27];let j;return e[28]!==S||e[29]!==g?(j=n.jsxs(fe,{children:[h,g,S]}),e[28]=S,e[29]=g,e[30]=j):j=e[30],j}function xo(){window.location.href="/"}function So(t){const e=R.c(27),{notice:o,orgSlug:r}=t,s=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:n.jsx(un,{className:"h-6 w-6 text-destructive"})}),e[0]=a):a=e[0];let i;e[1]!==o.title?(i=n.jsx("h3",{className:"text-lg font-medium",children:o.title}),e[1]=o.title,e[2]=i):i=e[2];let c;e[3]!==o.message?(c=n.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:o.message}),e[3]=o.message,e[4]=c):c=e[4];let m;e[5]!==i||e[6]!==c?(m=n.jsxs("div",{className:"space-y-2",children:[i,c]}),e[5]=i,e[6]=c,e[7]=m):m=e[7];let h;e[8]!==o.ctaLabel||e[9]!==o.ctaUrl?(h=o.ctaUrl&&o.ctaLabel?n.jsx(F,{asChild:!0,children:n.jsx("a",{href:o.ctaUrl,target:"_blank",rel:"noreferrer noopener",children:o.ctaLabel})}):null,e[8]=o.ctaLabel,e[9]=o.ctaUrl,e[10]=h):h=e[10];const w=`/${encodeURIComponent(r)}/settings/infra-billing`;let u;e[11]!==s?(u=s("common.blockedOrgScreen.goToBilling"),e[11]=s,e[12]=u):u=e[12];let y;e[13]!==w||e[14]!==u?(y=n.jsx(F,{variant:"outline",asChild:!0,children:n.jsx("a",{href:w,children:u})}),e[13]=w,e[14]=u,e[15]=y):y=e[15];let l;e[16]!==s?(l=s("common.blockedOrgScreen.switchOrg"),e[16]=s,e[17]=l):l=e[17];let g;e[18]!==l?(g=n.jsx(F,{variant:"ghost",asChild:!0,children:n.jsx("a",{href:"/",children:l})}),e[18]=l,e[19]=g):g=e[19];let f;e[20]!==g||e[21]!==h||e[22]!==y?(f=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[h,y,g]}),e[20]=g,e[21]=h,e[22]=y,e[23]=f):f=e[23];let d;return e[24]!==f||e[25]!==m?(d=n.jsxs(fe,{children:[a,m,f]}),e[24]=f,e[25]=m,e[26]=d):d=e[26],d}function wo(t){const e=R.c(8);let o;e[0]!==t?(o=Ue.orgNotice(t??""),e[0]=t,e[1]=o):o=e[1];let r;e[2]!==t?(r=async()=>{const i=await fetch(`/api/${t}/notice`,{credentials:"include"});return i.ok?(await i.json()).notice??null:null},e[2]=t,e[3]=r):r=e[3];const s=!!t;let a;return e[4]!==o||e[5]!==r||e[6]!==s?(a={queryKey:o,queryFn:r,enabled:s,staleTime:6e4},e[4]=o,e[5]=r,e[6]=s,e[7]=a):a=e[7],He(a)}const vo="/settings/infra-billing";function jo(t){return(t.endsWith("/")?t.slice(0,-1):t).endsWith(vo)}function ko(t){const e=R.c(7),{org:o,children:r}=t;let s;e[0]!==o.id||e[1]!==o.name?(s={id:o.id,organizationId:o.id,slug:"_org",name:o.name,ui:null},e[0]=o.id,e[1]=o.name,e[2]=s):s=e[2];const a=s;let i;return e[3]!==r||e[4]!==o||e[5]!==a?(i=n.jsx(xn,{org:o,project:a,children:r}),e[3]=r,e[4]=o,e[5]=a,e[6]=i):i=e[6],i}function To(){const t=Et(),e=Wn(),{org:o}=mt(),r=mn({strict:!1}),s=Dt(),{openPanel:a,closePanel:i}=$n(),c=Xn(),m=Zn(),h=es(),w=ts(),u=(f,d=!0)=>t({to:".",search:f,replace:d}),y=()=>u(f=>({...f,sidepanel:!0})),l=(f,d,x)=>{const b=!!m&&m===f;m&&!b&&po(m,{tab:s,mainpanel:r.mainpanel,sidepanel:r.sidepanel});const S=b?null:yo(f),j=It(o.id).id,P=fo({prev:{virtualmcpid:c,tabId:s,mainpanel:r.mainpanel,sidepanel:r.sidepanel},virtualMcpId:d,decopilotId:j,savedLayout:S,opts:x,autosendValue:Qn});return w(f,()=>P.search,{virtualMcpId:d,view:{tabId:P.tabId}})};return{openSidePanel:y,setTaskId:l,createNewTask:async(f,d,x)=>{const b=crypto.randomUUID(),S=f??h;try{await e?.create({id:b,virtual_mcp_id:S,...d?{branch:d}:{}})}catch{}l(b,S,{...x,newThread:!0})},openTab:a,closeTab:i}}const No=new Set(["/$org/","/$org/home"]);function _o(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:Po},t[0]=e):e=t[0],$t(e)}function Po(t){const e=t.matches.at(-1)?.fullPath;return e!==void 0&&No.has(e)}function Ao(){const t=R.c(63);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const r=fn(e)?.params.org,[s,a]=se.useState(!1),[i,c]=Ys(),[m,h]=Un(),w=hn(),u=_o(),y=r??"";let l;t[1]!==y?(l=Jt(y),t[1]=y,t[2]=l):l=t[2];const g=!!r&&u;let f;t[3]!==l||t[4]!==g?(f={...l,enabled:g},t[3]=l,t[4]=g,t[5]=f):f=t[5],He(f);const{data:d}=Be.useSession(),x=d?.user?.id;let b;t[6]!==r||t[7]!==x?(b=r&&x?gn(x,r):null,t[6]=r,t[7]=x,t[8]=b):b=t[8];const S=b;let j,P;t[9]!==w?(j=()=>{const E=z=>{if(vt(z)&&z.code==="KeyK"){z.preventDefault(),Vs();return}if(z.key==="?"&&!Ms(z.target)){z.preventDefault(),a(!0);return}vt(z)&&z.code==="BracketLeft"&&w.history.canGoBack()&&(z.preventDefault(),w.history.back())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},P=[w],t[9]=w,t[10]=j,t[11]=P):(j=t[10],P=t[11]),se.useEffect(j,P);let k;t[12]!==r?(k=Ue.activeOrganization(r),t[12]=r,t[13]=k):k=t[13];let v;t[14]!==r||t[15]!==x?(v=async()=>{if(!r)return null;performance.mark("mesh:active-org-fetch:start");const{data:E}=await Be.organization.getFullOrganization({query:{organizationSlug:r}}).finally(Eo),z=rt(E);return E&&!z&&localStorage.setItem(Ke.lastOrgSlug(),r),x&&E&&yn(x,r,E),E},t[14]=r,t[15]=x,t[16]=v):v=t[16];const T=S?S.data:void 0,N=S?.updatedAt;let _;t[17]!==T||t[18]!==N||t[19]!==k||t[20]!==v?(_={queryKey:k,queryFn:v,initialData:T,initialDataUpdatedAt:N,gcTime:1/0,refetchOnWindowFocus:!1},t[17]=T,t[18]=N,t[19]=k,t[20]=v,t[21]=_):_=t[21];const{data:p}=Nt(_),A=p?.id,$=p?.slug,{data:I}=ns(A,$),D=!!I?.ssoRequired&&!I.authenticated,{data:C}=wo($);let M;t[22]===Symbol.for("react.memo_cache_sentinel")?(M={select:Co},t[22]=M):M=t[22];const K=$t(M),V=C?.severity==="block"&&!jo(K),q=A??"",W=$??"";let Y;t[23]!==q||t[24]!==W?(Y=Hn({connectionId:Ot,orgId:q,orgSlug:W}),t[23]=q,t[24]=W,t[25]=Y):Y=t[25];const L=!!A&&!!$;let Q;if(t[26]!==Y||t[27]!==L?(Q={...Y,enabled:L},t[26]=Y,t[27]=L,t[28]=Q):Q=t[28],He(Q),(!p||rt(p)||D||V)&&Ws(),!p){let E;return t[29]!==r?(E=n.jsx(fs,{orgSlug:r}),t[29]=r,t[30]=E):E=t[30],E}if(rt(p)){localStorage.getItem(Ke.lastOrgSlug())===r&&localStorage.removeItem(Ke.lastOrgSlug());let E;return t[31]!==p.name?(E=n.jsx(pn,{orgName:p.name}),t[31]=p.name,t[32]=E):E=t[32],E}if(V&&C){let E;return t[33]!==p.slug||t[34]!==C?(E=n.jsx(So,{notice:C,orgSlug:p.slug}),t[33]=p.slug,t[34]=C,t[35]=E):E=t[35],E}if(D){let E;return t[36]!==p.id||t[37]!==p.name||t[38]!==p.slug||t[39]!==I.domain?(E=n.jsx(bo,{orgId:p.id,orgSlug:p.slug,orgName:p.name,domain:I.domain}),t[36]=p.id,t[37]=p.name,t[38]=p.slug,t[39]=I.domain,t[40]=E):E=t[40],E}const oe=p.logo??null;let B;t[41]!==p||t[42]!==oe?(B={...p,logo:oe},t[41]=p,t[42]=oe,t[43]=B):B=t[43];let X;t[44]!==p?(X=n.jsx(mo,{activeOrg:p}),t[44]=p,t[45]=X):X=t[45];let Z;t[46]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(bn,{}),t[46]=Z):Z=t[46];let ee;t[47]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex w-[min(360px,calc(100vw-3rem))] flex-col gap-3",children:[n.jsx(Ds,{}),n.jsx(to,{})]}),t[47]=ee):ee=t[47];let te;t[48]!==i||t[49]!==c?(te=i&&n.jsx(Us,{open:i,onOpenChange:c}),t[48]=i,t[49]=c,t[50]=te):te=t[50];let H;t[51]!==m||t[52]!==h?(H=m&&n.jsx(Gn,{open:!0,onOpenChange:h,source:Jn()}),t[51]=m,t[52]=h,t[53]=H):H=t[53];let U;t[54]!==s?(U=n.jsx(zs,{open:s,onOpenChange:a}),t[54]=s,t[55]=U):U=t[55];let ne;t[56]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(ao,{}),t[56]=ne):ne=t[56];let ie;return t[57]!==B||t[58]!==X||t[59]!==te||t[60]!==H||t[61]!==U?(ie=n.jsxs(ko,{org:B,children:[X,Z,ee,te,H,U,ne]}),t[57]=B,t[58]=X,t[59]=te,t[60]=H,t[61]=U,t[62]=ie):ie=t[62],ie}function Co(t){return t.location.pathname}function Eo(){performance.mark("mesh:active-org-fetch:end"),performance.measure("mesh:active-org-fetch","mesh:active-org-fetch:start","mesh:active-org-fetch:end")}function Oo(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Yn,{children:n.jsx(Ao,{})}),t[0]=e):e=t[0],e}const ri=Object.freeze(Object.defineProperty({__proto__:null,default:Oo,usePanelActions:To},Symbol.toStringTag,{value:"Module"}));export{G as K,hs as L,To as a,vt as b,ks as c,Ms as d,ai as e,ii as f,ri as g,zt as i,Vs as o,si as r,oi as s,wo as u};
@@ -0,0 +1 @@
1
+ import{c as u,r as g,j as n,F,Z as G,_ as H,a as E,k as P,b as O,n as y,L as M}from"./index-DwUSgMrk.js";import{C as V}from"./chat-context-DHXBy843.js";import{C as x}from"./index-BNHeiq0Q.js";import{L}from"./index-B-ZICxtp.js";import{B as K}from"./blocks-preview-workspace-context--l_lynd7.js";import{e as T,p as W,s as J,a as U,r as z,T as $,u as R,b as Z}from"./site-editor-toast-CWvkPJE7.js";import{u as q,L as B,P as Q,S as X}from"./preview-tab-CNqKfb-E.js";import{C as Y}from"./content-tab-C6Yd-gaA.js";import{T as tt}from"./tab-icon-glyph-DYfErhsy.js";import{r as et}from"./resolve-tab-icon-Dy1gZT8r.js";import ot from"./agent-site-editor-uS5XJ69l.js";import"./use-panel-navigate-CwRBX20z.js";import"./thread-route-Cr8HKNDQ.js";import"./use-project-scope-CwXHOags.js";import"./repository-binding-Ctv5jACU.js";import"./use-mcp-client-CvE7itXw.js";import"./auth-CR47t1GM.js";import"./autosend-DnRIvL7O.js";import"./thread-intent-DYNUY6FR.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-wUe9D5Rq.js";import"./task-board-CDUMGTb-.js";import"./schema-C9VtMeBM.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-DYkAp_m7.js";import"./use-ai-providers-Dp4Hkjtx.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-B4xXaxr4.js";import"./use-mobile-D6Ou0NEP.js";import"./use-sidebar-collapsed-2XEtdu2i.js";import"./use-chat-layout-state-DeeoSPAs.js";import"./agent-icon-sWZwj0Es.js";import"./AlertCircle-Chv0zwfM.js";import"./Tool01-Dys7Z5ab.js";import"./ArrowUp-B9orjFiD.js";import"./ArrowLeft-P5MTc2kM.js";import"./LinkBroken01-D3nON0AT.js";import"./ShoppingBag01-CVVvTwrH.js";import"./ZoomOut-Bi4ExiY7.js";import"./Building02-Bhj7SR-R.js";import"./CheckCircle-BOOTvtN7.js";import"./ChevronUp-UOllpHWY.js";import"./ChevronSelectorVertical-CKvNz838.js";import"./UserSquare-CaU54i61.js";import"./Copy01-CsZzLh_E.js";import"./CreditCard01-Bji4icQZ.js";import"./DotsVertical-BaN_NJ8K.js";import"./Image01-Ffg_Ow_R.js";import"./Globe04-BOt08kHg.js";import"./SwitchHorizontal01-CEx9qTgC.js";import"./Key01-BVuT8y7b.js";import"./Link01-Du3sgYhY.js";import"./Minus-qI5XA_m8.js";import"./Monitor01-DPFmNrHU.js";import"./Sun-Cgn1IQVJ.js";import"./Play-CKRH5LhK.js";import"./Plus-Dr-ysAIN.js";import"./SearchMd-D_t1juud.js";import"./Trash01--FklAmhG.js";import"./Upload01-BeT7SqGm.js";import"./User01-C3IPjJ5l.js";import"./Users01-BZXT5qAC.js";import"./XClose-Cjrx49Z1.js";import"./tooltip-7xQKXZXx.js";import"./index-B50XV3gp.js";import"./toolbar-icon-button-pGWMZONn.js";import"./shell-layout-CCN75UAi.js";import"./avatar-x6P8tYtf.js";import"./use-clock-tick-C6h2MMIi.js";import"./command-CxL64Rh6.js";import"./index-5UrkGUsp.js";import"./integration-icon-CGlpUTQF.js";import"./project-icon-DzYy4wKu.js";import"./new-project-dialog-zI2HVFQT.js";import"./label-9iahSV8V.js";import"./repository-import-picker-DXFAIhGC.js";import"./use-navigate-to-agent-DqPVTZYN.js";import"./repository-picker-C-87Ak81.js";import"./useInfiniteQuery-DLjfiCcz.js";import"./infiniteQueryObserver-fD19WDlu.js";import"./collection-search-EaUyhqe3.js";import"./use-debounced-value-DJVnkGFg.js";import"./required-auth-layout-BOZelCHP.js";import"./use-org-sso-CWjER8s_.js";import"./sheet-B-tTREXV.js";import"./resizable-CcGplCtq.js";import"./core.esm-3Ntqpx6o.js";import"./sortable.esm-DUpSK4fM.js";import"./context-menu-Sl80TmNB.js";import"./create-organization-dialog-Y8ioappi.js";import"./alert-dialog-XdiY2J_y.js";import"./form-oexeEAr5.js";import"./project-apps-DjY-pfpC.js";import"./use-recent-apps-Bm3Mq1hd.js";import"./input-BcdjLg5X.js";import"./usage-stats-BKxLD2_l.js";import"./tool-namespace-D8-HQWQE.js";import"./utils-CVEq3hMx.js";import"./markdown-DQgkOB--.js";import"./use-copy-D9a2GtFe.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./icon-button-DfIZISrS.js";import"./file-type-icon-L81OHsVz.js";import"./chat-draft-DZ2UGoju.js";import"./select-DSSug2fd.js";import"./index-BdQq_4o_.js";import"./tabs-CBoEFGVa.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-BCAKdpOu.js";import"./toggle-group-CaNHwi3W.js";import"./use-open-billing-url-NfOqGe8U.js";import"./index-C0_wKyXa.js";import"./checkbox-J7NM8Nxa.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-kKTDdvYS.js";import"./drawer-2qaZT3bV.js";import"./input-YsL3Z14x.js";import"./suggestion-Be-l0Vt9.js";import"./use-mcp-prompts-B71f8Oap.js";import"./use-org-fs-CnHNkGa0.js";import"./question-004-sINsf4GQ.js";import"./use-members-CAjyx4dy.js";import"./use-org-auth-client-D54JUqPS.js";import"./feature-paywall-BvbLf2vN.js";import"./plan-ladder-hFJpqSg5.js";import"./add-connection-dialog-CtRrIzJJ.js";import"./extract-connection-data-BRxw-vDj.js";import"./metadata-D72DunRR.js";import"./connection-Dwyi3srb.js";import"./url-slug-CMhgSj9A.js";import"./connection-card-Fd6iPvoW.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CQ_TkrdE.js";import"./use-connection-mXOC3Xuo.js";import"./schema-CIU-vy-M.js";import"./connection-form-helpers-Be0GZ2Fr.js";import"./authenticate-and-persist-oauth-D5GDklWs.js";import"./mcp-oauth-Bvn81zXq.js";import"./mcp-oauth-DQ15yEaL.js";import"./collection-tabs-CvrE77Fy.js";import"./badge-0pHsypn4.js";import"./use-infinite-scroll-AsnNIlBn.js";import"./useSuspenseInfiniteQuery-DJIJLbRA.js";import"./use-task-board-events-DHmzNQpi.js";import"./use-main-schema-v8-Cys0il1A.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-BtlQk18r.js";import"./index-DlxFtSYK.js";import"./pair-BVAQv2mv.js";import"./collapsible-C5IcK6_6.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-E0Rb-X88.js";import"./types-DmsgcF8m.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-thread-outputs-hOt5_FqT.js";import"./sandbox-git-api-CRxdlhrN.js";import"./blocks-tab-states-llhicB0-.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./secret-ciphertext-DFilJK15.js";import"./alert-VfejUnRf.js";import"./switch-CPLmKtep.js";import"./scroll-area-BgPjdFUv.js";import"./monaco-editor-pm8M8s-N.js";import"./editor-D4klHvzy.js";import"./calendar-Dt43s5dd.js";import"./editor-classes-BBdx-JSY.js";import"./combobox-GJu0SOmd.js";import"./search-input-6roNTbiB.js";import"./use-file-configs-DJCoczIU.js";import"./asset-utils-CKM5FMXp.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./empty-state-CLeOp2iF.js";import"./sandbox-lifecycle-context-B_iyl6NM.js";import"./variant-draft-pointer-DGsbM6lw.js";import"./section-preview-url-7zfngvgW.js";import"./use-fast-preview-draft-url-apL5qVv1.js";import"./useQueries-CTk9HeNu.js";import"./device-hint-SeLRi17j.js";import"./virtual-mcp-C-TlHAqf.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-DJlGx95B.js";import"./mustache-Kcmg3c_A.js";import"./use-content-sync-mkwV3WFd.js";import"./empty-state-kKu94zqY.js";import"./separator-RD1Gkb6T.js";import"./use-releases-COy4R50l.js";import"./serial-task-queue-CGOeQgpr.js";import"./hosted-publish-feedback-GSHWRd1_.js";import"./save-changes-debug-nBi-n9eV.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const it=e=>e;function rt(e){const t=u.c(10),{candidates:o,invalidLink:c,shell:m,editor:i}=e,r=c===void 0?!1:c,s=m===void 0?it:m,[p,l]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==i?(h=i(p,f),t[1]=p,t[2]=i,t[3]=h):h=t[3],h}let a;t[4]!==o||t[5]!==r?(a=n.jsx(nt,{candidates:o,invalidLink:r,onConnect:l}),t[4]=o,t[5]=r,t[6]=a):a=t[6];let d;return t[7]!==s||t[8]!==a?(d=s(a),t[7]=s,t[8]=a,t[9]=d):d=t[9],d}function nt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=F(),{language:s}=r;let p;t[0]!==m?(p=D=>m({endpoint:D}),t[0]=m,t[1]=p):p=t[1];let l;t[2]!==o||t[3]!==p?(l={candidates:o,onFound:p},t[2]=o,t[3]=p,t[4]=l):l=t[4];const a=q(l),{state:d,access:f,needsGesture:h}=a;let k;t[5]!==o||t[6]!==s?(k=new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(o.map(T)),t[5]=o,t[6]=s,t[7]=k):k=t[7];const C=k;let j;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(j=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:a.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=a.start,t[10]=h,t[11]=d,t[12]=j):j=t[12];const _=j;let S;return t[13]!==C||t[14]!==i||t[15]!==_?(S=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=S):S=t[16],S}const v="deco-serve",w="working-tree",st={id:"",slug:"",name:"",logo:null},mt={id:v,slug:v},pt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function at(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?W(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&J(o),{candidates:U(o,z()),invalidLink:t&&!o}}const ct=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function lt(){const e=u.c(6),t=O();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:dt},e[0]=o):o=e[0];const c=P(o);let m;e[1]!==t||e[2]!==c?(m=ct.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(M,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(tt,{icon:et({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),e[1]=t,e[2]=c,e[3]=m):m=e[3];let i;return e[4]!==m?(i=n.jsx(y.Tabs,{children:m}),e[4]=m,e[5]=i):i=e[5],i}function dt(e){return e.matches.at(-1)?.staticData.siteEditorView}function N(e){const t=u.c(14),{children:o}=e,c=O(),{connection:m}=Z(v),i=R(v,w);let r,s;if(t[0]!==i||t[1]!==o||t[2]!==m||t[3]!==c){s=Symbol.for("react.early_return_sentinel");t:{if(r=m?T(m.endpoint):"",i.kind==="protocol"){s=o;break t}if(i.kind!=="unavailable"||I(i)){s=n.jsx(X,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=i,t[1]=o,t[2]=m,t[3]=c,t[4]=r,t[5]=s}else r=t[4],s=t[5];if(s!==Symbol.for("react.early_return_sentinel"))return s;let p;t[6]!==i.problem?(p=i.problem??{reason:"not-answering"},t[6]=i.problem,t[7]=p):p=t[7];let l;t[8]!==r||t[9]!==p?(l={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=l):l=t[10];let a;return t[11]!==r||t[12]!==l?(a=n.jsx(B,{wait:l,hosts:r}),t[11]=r,t[12]=l,t[13]=a):a=t[13],a}function ut(e){const t=u.c(6),{onLost:o}=e,c=R(v,w);let m;t[0]!==c?(m=I(c),t[0]=c,t[1]=m):m=t[1];const i=m;let r,s;return t[2]!==i||t[3]!==o?(r=()=>{i&&o()},s=[i,o],t[2]=i,t[3]=o,t[4]=r,t[5]=s):(r=t[4],s=t[5]),g.useEffect(r,s),null}const A={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ft(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ht},e[0]=o):o=e[0];const c=P(o),m=!!t?.user;let i;e[1]!==m?(i={rail:m},e[1]=m,e[2]=i):i=e[2];const r=c??"preview";let s,p,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(lt,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(ot,{}),e[3]=s,e[4]=p,e[5]=l):(s=e[3],p=e[4],l=e[5]);let a;e[6]!==r?(a=n.jsx(L.Content,{children:n.jsxs(x,{...A,threadless:!0,contentKey:r,contentNavigation:s,children:[p,l]})}),e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==i||e[9]!==a?(d=n.jsx(L,{outsideOrg:i,children:a}),e[8]=i,e[9]=a,e[10]=d):d=e[10],d}function ht(e){return e.matches.at(-1)?.staticData.siteEditorView}function vt(e){const t=u.c(8),{children:o}=e,{data:c}=E.useSession(),m=!!c?.user;let i;t[0]!==m?(i={rail:m},t[0]=m,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(x.Thread,{children:null}),t[2]=r):r=t[2];let s;t[3]!==o?(s=n.jsx(L.Content,{children:n.jsxs(x,{...A,threadless:!0,contentKey:"guide",children:[r,n.jsx(x.Content,{children:o})]})}),t[3]=o,t[4]=s):s=t[4];let p;return t[5]!==i||t[6]!==s?(p=n.jsx(L,{outsideOrg:i,children:s}),t[5]=i,t[6]=s,t[7]=p):p=t[7],p}const b=()=>{},xt={connection:null,set:b,clear:b};function qi(){const e=u.c(3),[t]=g.useState(at);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(G,{value:!0,children:n.jsx(H,{org:st,project:mt,children:n.jsx(rt,{candidates:t.candidates,invalidLink:t.invalidLink,shell:jt,editor:kt})})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function kt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(ut,{onLost:t}),n.jsx(V,{value:pt,children:n.jsx(K,{children:n.jsx(ft,{})})})]})}function jt(e){return n.jsx($.Provider,{value:xt,children:n.jsx(vt,{children:e})})}function Qi(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(Q,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function Xi(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(Y,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{Xi as SiteEditorContent,Qi as SiteEditorPreview,qi as default};
@@ -1 +1 @@
1
- import{c as P,o as q,m as F,K as m,aV as Ye,aF as Nt,aG as _t,r as U,a as Dt,aw as ce,a2 as xt,au as Rt,b7 as Pt,t as z,j as V}from"./index-Dfl75K1t.js";import{a as We}from"./input-CYQLD8P6.js";import{k as $t,M as At,l as le,s as Re}from"./thread-intent-CLVOCoii.js";import{u as pe,c as Lt}from"./use-main-schema-v8-DEN4NEnl.js";import{b as te}from"./sandbox-url-D3mC8qhT.js";import{s as Ft}from"./utils-CsCjfn_2.js";import{a as Ut}from"./repository-binding-CeR4BnTI.js";import{u as Mt}from"./chat-context-q6pkU4Vf.js";import{i as jt,u as Bt}from"./index-C_HSWEzQ.js";import{v as Qt}from"./sandbox-git-api-CRxdlhrN.js";import{e as Vt}from"./backoff-CrEUbyZT.js";const p={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class T extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new T(t.code,t.message,t.data)}}const K="deco-content",ue={major:1},ze=1;async function Ht(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const de={major:ue.major,minor:ze},Xe=`the endpoint speaks an older ${K} than this client needs (${de.major}.${de.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function W(e,t,n){const o={reason:t,required:{...de}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new T(p.Unsupported,e,o)}function Ze(e){const t=e??{},{protocol:n,version:o}=t;if(n!==K)throw W(`the endpoint speaks ${JSON.stringify(n)}, not ${K}`,"protocol",t);if(o?.major!==ue.major)throw W(`the endpoint speaks ${K} ${String(o?.major)}.x; this client speaks ${ue.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ze)throw W(Xe,"outdated",t);return e}function Pe(e,t){return t.code===p.MethodNotFound&&e.startsWith("changes.")?W(Xe,"outdated"):T.from(t)}function ye(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let c;try{c=await Ht(a)}catch{throw new T(p.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?T.from(l):new T(p.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw Pe(s,c.error);return c.result};return{call:r,describe:async()=>Ze(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((l,d)=>({jsonrpc:"2.0",id:i[d],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,d)=>{const u=c.get(l);return u?u.error?{ok:!1,error:Pe(s[d].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new T(p.InternalError,"no response for this call")}})}}}const fe=".json";[...Array.from({length:9},(e,t)=>`COM${t+1}`),...Array.from({length:9},(e,t)=>`LPT${t+1}`)];new TextEncoder;function Gt(e){return`${encodeURIComponent(e)}${fe}`}function et(e){return e.endsWith(fe)?e.slice(0,-fe.length):e}function Eo(e){const t=et(e);try{return decodeURIComponent(t)}catch{return t}}function Kt(e){let t=et(e),n=0;for(;t.includes("%");){let o;try{o=decodeURIComponent(t)}catch{break}if(o===t)break;t=o,n++}return{name:t,passes:n}}function ko(e){return Kt(Gt(e)).name}const $e=20,Ae=5,Le=500;function Se(e){return e instanceof T?e.code===p.MethodNotFound?!0:e.code===p.Unsupported&&e.data?.reason==="outdated":!1}function he(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function qt(e,t,n){const o=m.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(r?{ifNoneMatch:r.revision}:{}),i=he(r,s);if(i)return i;const a=await t.changesList({});return he(void 0,a)}async function Jt(e,t){const n=[];for(let s=0;s<t.length;s+=$e)n.push(t.slice(s,s+$e));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=Ae){const i=await e.batch(n.slice(s,s+Ae).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function Co(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=Le){const r=t.slice(o,o+Le),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Io(e){return e instanceof T&&e.code===p.Conflict}function tt(e){return e?.kind==="protocol"?e:null}function Oo(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=q();let a;o[2]!==e?(a=tt(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let d;o[4]!==t?(d=m.contentChanges(t??""),o[4]=t,o[5]=d):d=o[5];let u;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(u=l?()=>qt(i,c.client,t):Ye,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=u):u=o[10];let h;return o[11]!==d||o[12]!==u?(h={queryKey:d,queryFn:u,staleTime:0},o[11]=d,o[12]=u,o[13]=h):h=o[13],F(h)}function To(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=tt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=m.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let d;o[7]!==c||o[8]!==a||o[9]!==s?(d=c?()=>Jt(s.client,a):Ye,o[7]=c,o[8]=a,o[9]=s,o[10]=d):d=o[10];let u;return o[11]!==l||o[12]!==d?(u={queryKey:l,queryFn:d,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=d,o[13]=u):u=o[13],F(u)}function nt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function X(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const ot=Nt({endpoint:_t().max(2048).refine(e=>nt(e)&&new URL(e).pathname==="/rpc").transform(X)});function No(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=ot.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function rt(e){const t=ot.safeParse(e);return t.success?t.data:null}const st="studio:deco-serve-last";function _o(e){try{localStorage.setItem(st,JSON.stringify(e))}catch{}}function Do(){try{const e=localStorage.getItem(st);return e?rt(JSON.parse(e)):null}catch{return null}}function xo(e){try{return new URL(X(e)).host}catch{return e}}function Yt(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Wt="http://localhost:4545/rpc",Ro="npx @decocms/blocks serve",Po="npx @decocms/blocks schema";class Ee extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function zt(e){if(e instanceof Ee)return{reason:"not-deco-serve"};if(!(e instanceof T))return{reason:"not-answering"};switch(e.code){case p.Unauthorized:case p.MethodNotFound:return{reason:"outdated"};case p.Unsupported:return Se(e)?{reason:"outdated"}:{reason:"version-mismatch"};case p.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function $o(e,t){if(e)return[X(e.endpoint)];const n=[t?.endpoint,Wt].filter(o=>!!o).map(X);return[...new Set(n)]}const it=U.createContext(null);function Xt(e){const t=P.c(27),n=U.useContext(it),o=pe(n?null:e),{data:r}=Dt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?ce.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=Ue(a);let d;t[4]!==i||t[5]!==s||t[6]!==e?(d=i?ce.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=d):d=t[7];const[u,h]=Ue(d);if(n)return n;let b;t[8]!==c||t[9]!==i?(b=i?rt(c):null,t[8]=c,t[9]=i,t[10]=b):b=t[10];const g=b,k=!!g;let C;t[11]!==o||t[12]!==k?(C=Zt(o,k),t[11]=o,t[12]=k,t[13]=C):C=t[13];const{applies:x,undecided:N}=C,_=x?g:null,I=i&&o==="v8"&&typeof u=="string"?u:null;let O;t[14]!==h||t[15]!==l||t[16]!==i?(O=S=>{i&&(l(S),h(S.endpoint))},t[14]=h,t[15]=l,t[16]=i,t[17]=O):O=t[17];let w;t[18]!==l||t[19]!==i?(w=()=>{i&&l(null)},t[18]=l,t[19]=i,t[20]=w):w=t[20];let y;return t[21]!==_||t[22]!==I||t[23]!==O||t[24]!==w||t[25]!==N?(y={connection:_,undecided:N,lastEndpoint:I,set:O,clear:w},t[21]=_,t[22]=I,t[23]=O,t[24]=w,t[25]=N,t[26]=y):y=t[26],y}function Zt(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Fe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ue(e){const t=P.c(17),n=q(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Fe(e):null,a=()=>e?Fe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:d}=F(l);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=k=>{if(e){try{k===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(k))}catch{}n.setQueryData(s,k)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const h=u,b=e?d??null:null;let g;return t[14]!==h||t[15]!==b?(g=[b,h],t[14]=h,t[15]=b,t[16]=g):g=t[16],g}function Ao(e){return e.kind==="protocol"||e.kind==="unavailable"}function Lo(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function Fo(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function Uo(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&nt(t)?t:null}function Mo(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function at(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function en(e){if(!e.hasProject)return"legacy";const t=at(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function tn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function Me(e){return e.isError||e.errorUpdateCount>0}function nn(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function on(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}function ne(e){return{[$t]:e}}class ke extends Error{status=409;constructor(){super("main's schema changed")}}async function Ce(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code===At}function Ie(e,t,n){e.resetQueries({predicate:o=>{const r=o.queryKey;return r[1]!==t||r[2]!==n?!1:r[0]===m.mainSchemaV8(t,n)[0]||r[0]===m.contentBackend()[0]&&r[4]==="github"}})}function ct(e,t,n){return e.getQueryData(m.mainSchemaV8(t,n))}const lt="__noSchema";function rn(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[lt]:!0}}function jo(e){return!!e&&e[lt]===!0}function ut(e){if(!e.ok)return e.error.code===p.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function sn(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const an=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Bo(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:sn(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(an)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:je(n.resolveType).localeCompare(je(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function je(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function Be(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=Be(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?Be(s[a],r,n):s[a];return i}return e}function Qo(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class Qe extends Error{}class Ve extends Error{}const dt="site-not-owned";async function cn(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function ln(e,t=r=>fetch(r),n,o){const r=ye({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[c,l]of Object.entries(ne("v8")))i.headers.set(c,l);const a=await t(i);if(await cn(a))throw new Ve;if(await Ce(a))throw n?.(),new ke;return a}});try{const s=await Te(r,le(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof Ve)return dt;throw s}}const Oe=5e3;function un(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function dn(e){return new URL(te(e,"rpc"),window.location.origin).href}async function Te(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==K)throw new Ee;const s=Ze(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:le(t.schema)};if(!o)throw new Error("no schema.get");if(ut(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:le(i?.schema)}}throw o.error}async function fn(e,t=n=>fetch(n)){const n=ye({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new Qe;return r}});try{const o=await Te(n);return o.v8Schema?o:null}catch(o){if(o instanceof Qe)return null;throw o}}function ft(e,t){const n=P.c(53),{org:o}=xt(),{connection:r,undecided:s}=Xt(e),{runtime:i}=We(e),a=U.useContext(it),c=pe(a?null:e),l=Lt(e),d=at({hasServeConnection:!!r,runtime:i}),u=Mt()?.taskId??null,h=jt(Bt().lifecycle.phase),b=q(),g=tn({mode:d,mainSchema:c,workingTreeReady:h}),k=g.github&&!!o.slug&&!!e&&!!t;let C;n[0]!==t||n[1]!==o.slug||n[2]!==b||n[3]!==e?(C=()=>ln(un({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ie(b,o.slug,e),ct(b,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=b,n[3]=e,n[4]=C):C=n[4];const x=F({queryKey:m.contentBackend(o.slug,e??"",t??"","github"),queryFn:C,enabled:k,staleTime:Number.POSITIVE_INFINITY,...He}),N=g.sandbox&&!!o.slug&&!!e&&!!t;let _;n[5]!==t||n[6]!==o.slug||n[7]!==u||n[8]!==e?(_=async()=>fn(dn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:u})),n[5]=t,n[6]=o.slug,n[7]=u,n[8]=e,n[9]=_):_=n[9];const I=F({queryKey:m.contentBackend(o.slug,e??"",t??"","sandbox",u??""),queryFn:_,enabled:N,staleTime:Number.POSITIVE_INFINITY,...He}),O=!!r;let w;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(w=m.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=w):w=n[13];let y;n[14]!==r?(y=()=>Te(ye({endpoint:r.endpoint})),n[14]=r,n[15]=y):y=n[15];let S;n[16]!==O||n[17]!==w||n[18]!==y?(S={queryKey:w,queryFn:y,enabled:O,staleTime:Number.POSITIVE_INFINITY,retry:mn,retryDelay:gn,refetchInterval:hn},n[16]=O,n[17]=w,n[18]=y,n[19]=S):S=n[19];const v=F(S);let $;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?($=m.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=$):$=n[23];const A=$;let E;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(E=m.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=E):E=n[27];let D;n[28]!==v.data||n[29]!==A||n[30]!==b?(D=async()=>{try{return await v.data.client.describe()}catch(f){const G=f;throw b.invalidateQueries({queryKey:A,exact:!0},{cancelRefetch:!1}),G}},n[28]=v.data,n[29]=A,n[30]=b,n[31]=D):D=n[31];const R=!!v.data&&!a;let M;n[32]!==E||n[33]!==D||n[34]!==R?(M={queryKey:E,queryFn:D,enabled:R,refetchInterval:Oe,retry:!1},n[32]=E,n[33]=D,n[34]=R,n[35]=M):M=n[35];const Q=F(M).data??v.data?.describe,L=en({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:c,githubSite:x.data===dt?"not-owned":x.data?"v8":x.data===null?"v7":Me(x)?"error":"loading",sandboxSite:vn({data:I.data,isError:Me(I),workingTreeReady:h}),markedV8:l});if(L==="pending"){let f;return n[36]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending"},n[36]=f):f=n[36],f}if(L==="retrying-github"){let f;return n[37]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending",retrying:"github"},n[37]=f):f=n[37],f}if(L==="retrying-sandbox"){let f;return n[38]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending",retrying:"sandbox"},n[38]=f):f=n[38],f}if(L==="legacy"){let f;return n[39]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"legacy"},n[39]=f):f=n[39],f}if(L==="protocol-github"){const f=x.data;let G;return n[40]!==f?(G=ge("github",f,""),n[40]=f,n[41]=G):G=n[41],G}if(L==="site-not-owned-github"){let f;return n[42]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=f):f=n[42],f}if(L==="protocol-sandbox"){let f;return n[43]!==I.data?(f=ge("sandbox",I.data,":sandbox"),n[43]=I.data,n[44]=f):f=n[44],f}if(L==="unavailable-github"){let f;return n[45]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"unavailable",source:"github"},n[45]=f):f=n[45],f}const se=v.error??v.failureReason,ie=r?.endpoint??"";let Y;return n[46]!==Q||n[47]!==v.data||n[48]!==v.failureCount||n[49]!==v.isError||n[50]!==se||n[51]!==ie?(Y=wn({probed:v.data,isError:v.isError,failureCount:v.failureCount,failure:se,describe:Q,endpoint:ie}),n[46]=Q,n[47]=v.data,n[48]=v.failureCount,n[49]=v.isError,n[50]=se,n[51]=ie,n[52]=Y):Y=n[52],Y}function hn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Oe:!1}function gn(e){return Yt(e+1)}function mn(e,t){return!(t instanceof T)&&!(t instanceof Ee)}function vn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const bn=3;function wn(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ge("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<bn?t:{kind:"unavailable",source:"local",problem:zt(e.failure)}:t??{kind:"pending"}}const He={retry:2,refetchInterval:e=>e.state.status==="error"?Oe:!1};function ge(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function ht(e){const t=P.c(13);let n;t[0]!==e?(n=ce.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=Rt(o,null),i=pe(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const h=e?Re(r):null;a=pn({saved:h,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const c=a;let l,d;t[6]!==s?(l=h=>s(Re(h)),d=()=>s(null),t[6]=s,t[7]=l,t[8]=d):(l=t[7],d=t[8]);let u;return t[9]!==c||t[10]!==l||t[11]!==d?(u={...c,setUrl:l,clear:d},t[9]=c,t[10]=l,t[11]=d,t[12]=u):u=t[12],u}function pn(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function yn(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function Ge(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class Ne extends Error{constructor(t,n,o=[]){super(n),this.blocks=t,this.fields=o,this.name="BlockConflictError"}blocks;fields}function _e(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function oe(e,t,n){return["decofile-write",e,t,n]}function Sn(e,t,n){return{id:oe(e,t,n).join(":")}}function De(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function En(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function kn(e,t,n){e.setQueryData(m.decofileDraft(_e(t)),n)}function Cn(e,t){return e.getQueryData(m.decofileDraft(_e(t)))??null}async function In(e,t){const n=await fetch(De(e),{cache:"no-store",headers:{...ne("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function Vo(e){const t=P.c(4);let n;t[0]!==e?(n=m.decofileDraft(e?_e(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:On,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function On(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Tn(e,t){const n=await fetch(De(t),{cache:"no-store",headers:ne("v7")});if(await Ce(n))throw Ie(e,t.orgSlug,t.virtualMcpId),new ke;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&kn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function Ho(e,t){const n=await fetch(De(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new Ne(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return En(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const gt=3e3,Nn=15e3,_n=2*6e4,mt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Dn(e){return e<_n?gt:Nn}function xn(e,t=mt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Dn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let d;try{d=c()}catch{d=void 0}Promise.resolve(d).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const Ke=()=>0;function Rn(e,t,n=mt){const o=U.useRef(t);o.current=t;const[r]=U.useState(()=>({polling:()=>xn(()=>o.current,n),idle:()=>()=>{}}));U.useSyncExternalStore(e?r.polling:r.idle,Ke,Ke)}function vt(e,t){return te(e,t)}function Pn(e,t){return te(e,"preview-fetch",{path:t})}function Go(e){return vt(e,"preview-invoke")}function Ko(e){return vt(e,"catalog-invoke")}function bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function $n(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&bt(n))return n}return null}function An(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??$n();return n&&bt(n)?new URL(t,n).toString():Pn(e,t)}function Ln(e){return An(e,"/.decofile")}function Fn(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function qe(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function Un(e,t){const n=te(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=Fn(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Ft(s.content)}}async function Mn(e,t){const n=await Un(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function qo(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function jn(e){return Ut(e)?.metadata?.runtime?.path??null}class wt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function Jo(e){return e instanceof T&&e.code===p.Conflict}function pt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}function Bn(e,t,n){if(t instanceof Ne)return t.message;if(n==="local")return Vn(e,t);if(t instanceof T)switch(t.code){case p.Conflict:return e("siteEditor.save.conflict");case p.ReadOnly:return e("siteEditor.save.readOnly");case p.InvalidBlock:case p.InvalidParams:return e("siteEditor.save.invalid");case p.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Qn(e,t){if(t==="local"||e instanceof Ne)return null;if(e instanceof T){const n=e.code===p.InvalidBlock||e.code===p.InvalidParams?pt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Vn(e,t){if(t instanceof wt)return e("decoServe.save.serverGone");if(t instanceof T)switch(t.code){case p.Conflict:return e("decoServe.save.conflict");case p.ReadOnly:return e("decoServe.save.readOnly");case p.InvalidBlock:case p.InvalidParams:return e("decoServe.save.invalid",{detail:pt(t)});case p.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Hn(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Gn(e,t){const[n,o]=U.useState(e),r=U.useRef(null);return e&&!n&&o(!0),U.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Hn(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const yt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},Kn=15e3,Z=new Map;function H(e,t){return`${e}/${t}`}function j(e){let t=Z.get(e);return t||(t={state:yt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},Z.set(e,t)),t}function B(e,t){const n=j(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function re(e){e.timer&&clearTimeout(e.timer),e.timer=null}function xe(e){return Z.get(e)?.state??yt}function qn(e,t){const n=j(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Yo(e){const t=j(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(re(t),B(e,{phase:"idle"}))}}function Wo(e){const t=Z.get(e);!t||t.state.phase!=="reloading"||(re(t),B(e,{phase:"idle"}))}function St(e){const t=j(e);re(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function me(e,t){const n=j(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Et(e,t.navigates,o)}function Et(e,t,n=0){const o=j(e);re(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},Kn),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Jn(e){return e?.kind==="protocol"&&e.source==="github"}async function ve(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:m.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?m.protocolDraftRead(o,r,s):null,d=l?JSON.stringify(n.getQueryData(l)??null):null,u=c?[c]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:m.decofile(a)})),a&&u.push(n.invalidateQueries({queryKey:m.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Qt(o,r,s)})),Jn(i)&&l&&u.push(n.invalidateQueries({queryKey:l})),await Promise.all(u),t.kind!=="edit"){const g=H(o,r);B(g,{epoch:xe(g).epoch+1})}const h=l?JSON.stringify(n.getQueryData(l)??null):null,b=d!==h;return b&&await new Promise(g=>Pt.schedule(g)),{navigates:b}}async function Yn(e,t){return St(H(e.orgSlug,e.virtualMcpId)),kt(e,t)}async function kt(e,t){const n=H(e.orgSlug,e.virtualMcpId);let o;try{o=await t.write()}catch(s){throw me(n,{ok:!1,navigates:!1}),t.refreshOnError&&ve(e,{kind:t.kind,reread:!0}).catch(()=>{}),s}let r=!1;try{({navigates:r}=await ve(e,t))}catch{}finally{me(n,{ok:!0,navigates:r})}return o}function zo(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=H(o,r),a=new Set(t.blockKeys);for(const d of[...j(i).discardListeners])d(a);St(i);let c=!1;const l=()=>(c=!0,kt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:oe(o,r,s),scope:Sn(o,r,s),mutationFn:l}).execute(void 0).catch(d=>{throw c||me(i,{ok:!1,navigates:!1}),d}):l()}function Xo(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=H(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const c=j(s).discardListeners;return c.add(n),()=>{c.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],U.useEffect(i,a)}function Wn(e){const t=H(e.orgSlug,e.virtualMcpId);xe(t).inFlight>0||ve(e,{kind:"external"}).then(({navigates:n})=>{const o=j(t);o.previews>0&&o.state.inFlight===0&&Et(t,n)}).catch(()=>{})}function zn(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=H(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>qn(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>xe(r),n[5]=r,n[6]=a):a=n[6];const c=a;return U.useSyncExternalStore(i,c,c)}const Xn=500;function Zo(e,t){const{phase:n}=zn(e,t);return Gn(n!=="idle",Xn)}function Zn(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function eo(e,t){return m.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function er(e,t,n){const o=e.getQueryData(m.contentVersions(t));if(!o)return;if(Object.hasOwn(o,n))return o[n];const r=e.getQueryData(m.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function Ct(e,t,n){e.setQueryData(m.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function to(e,t){const n=e.getMutationCache().findAll({mutationKey:oe(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>on(o.state.variables)))}function be(e,t){e.resetQueries({queryKey:m.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function ee(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof T);throw t.source==="local"&&s?(be(e,n),new wt(r)):(t.source==="local"&&Se(r)&&be(e,n),r)}}const ae=new Map;function no(e,t,n,o){const r=ae.get(o);if(r)return r;const s=It(e,t,n,o,!0);return ae.set(o,s),s.finally(()=>ae.delete(o))}async function It(e,t,n,o,r){const s=m.decofile(o),i=eo(n,t),a=m.contentRevision(o),c=e.getQueryData(s),l=e.getQueryData(i),d=e.getQueryData(a)??void 0,u=t.source==="github"&&!l?ct(e,n.orgSlug,n.virtualMcpId):void 0,h=u?.isV8&&u.schema&&u.version?u:void 0,b=l??h?.schema,g=h?{...d,schemaVersion:h.version}:d,k=r&&c?g?.revision:void 0,C=r&&b?g?.schemaVersion:void 0,x=m.contentChanges(o),N=e.getQueryData(x),[_,I,O]=await ee(e,t,n,()=>t.client.batch([{method:"blocks.list",params:k?{ifNoneMatch:k}:{}},{method:"schema.get",params:C?{ifNoneMatch:C}:{}},{method:"changes.list",params:N?{ifNoneMatch:N.revision}:{}}]));if(O?.ok){const R=he(N,O.result);R&&e.setQueryData(x,R)}else O&&t.source==="local"&&Se(O.error)&&be(e,n);if(!_?.ok)throw _?.error??new Error("no blocks.list");if(!I)throw new Error("no schema.get");const w=_.result,y=ut(I),S=I.ok&&!y?I.result:null;if(w.notModified&&!c||S?.notModified&&!b)return It(e,t,n,o,!1);const v=w.notModified?new Set:to(e,n),$=w.notModified?c:nn(w.blocks,c,v),A=y?rn():S?S.notModified?b:S.schema:I.error,E=e.getQueryData(a)?.revision,D=E!==void 0&&E!==g?.revision;if(e.setQueryData(a,{revision:D?E:w.notModified?g?.revision:w.revision,schemaVersion:S?S.notModified?g?.schemaVersion:S.version??void 0:void 0}),e.setQueryData(s,$),!w.notModified){const R=m.contentVersions(o),M=e.getQueryData(R),J={...w.versions};for(const Q of v){const L=M?.[Q];L!==void 0?J[Q]=L:delete J[Q]}e.setQueryData(R,J)}return A instanceof T||e.setQueryData(i,A),!D&&!w.notModified&&c&&g?.revision&&w.revision!==g.revision&&Wn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:$,meta:A}}async function tr(e,t,n,o,r,s){return Yn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",write:async()=>{const i=await ee(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));e.setQueryData(m.contentRevision(o),c=>({...c,revision:i.revision}));const a=i.versions??{};return Ct(e,o,a),{revision:i.revision,versions:a}}})}async function nr(e,t,n,o,r){await e.invalidateQueries({queryKey:m.decofile(o)});let s;try{const a=(await ee(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(a&&a.after===null&&a.version!==null)return;s={value:a?.after??null,version:a?.version??null}}catch{const i=await ee(e,t,n,()=>t.client.blocksList({}));if(i.notModified)return;s={value:i.blocks[r]??null,version:i.versions[r]??null}}e.setQueryData(m.decofile(o),i=>{const a={...i};return s.value===null?delete a[r]:a[r]=s.value,a}),Ct(e,o,{[r]:s.version})}function or(e){const t=P.c(11),n=q();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=m.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const c=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:ne("v8")});if(await Ce(c))throw Ie(n,e.orgSlug,e.virtualMcpId),new ke;if(!c.ok)throw new Error(`draft pointer read failed: ${c.status}`);return await c.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a}=F(i);return!e||!a?.draft||!a.version?null:`${a.draft}@${a.version}`}function rr(e){const t=P.c(4);let n;t[0]!==e?(n=m.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:oo,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function oo(){throw new Error("content revisions are set by reads and writes")}function Je(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function ro(e,t){const n=P.c(6),{url:o}=ht(e?.virtualMcpId),r=ft(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Je({...e,protocolSuffix:r.cacheKeySuffix}):Je({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function sr(e,t){const n=P.c(39),{url:o,undecided:r}=ht(e?.virtualMcpId),s=!!o,i=ft(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,c=ro(e),l=t?.fetchEnabled??!0,d=jn(e?.virtualMcpId),u=We(e?.virtualMcpId).runtime==="cms",h=q();let b;n[0]!==c?(b=m.decofile(c),n[0]=c,n[1]=b):b=n[1];const g=b;let k;n[2]!==e||n[3]!==h||n[4]!==g?(k=()=>{if(!e||h.isMutating({mutationKey:oe(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const v=h.getQueryState(g);return v?.fetchStatus==="fetching"||Date.now()-(v?.dataUpdatedAt??0)<gt/2},n[2]=e,n[3]=h,n[4]=g,n[5]=k):k=n[5];let C;n[6]!==u||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==h||n[11]!==g?(C=async()=>{if(e){if(!a&&u&&!s){const v=Cn(h,e)?.version;if(v&&!await In(e,v))return}await h.refetchQueries({queryKey:g,exact:!0},{cancelRefetch:!1})}},n[6]=u,n[7]=s,n[8]=e,n[9]=a,n[10]=h,n[11]=g,n[12]=C):C=n[12];let x;n[13]!==k||n[14]!==C?(x={skip:k,read:C},n[13]=k,n[14]=C,n[15]=x):x=n[15],Rn(!!t?.pollWhile&&!!e,x);let N;n[16]!==i.kind||n[17]!==u||n[18]!==l||n[19]!==c||n[20]!==s||n[21]!==o||n[22]!==d||n[23]!==e||n[24]!==a||n[25]!==h?(N=async()=>{if(a)return(await no(h,a,e,c)).blocks;if(i.kind==="unavailable")throw Zn("decofile");if(s){const E=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(ao),D=E?.ok?Ge(await E.text()):null;if(D)return D;const R=new Error("decofile unavailable (local tunnel unreachable)");throw R.status=502,R}if(u)return Tn(h,e);const v=()=>Mn(e,yn(d,".deco/blocks.gen.json"));if(l){const E=await fetch(Ln(e),{cache:"no-store"}).catch(io);if(E?.ok){const M=Ge(await E.text());if(M)return M}const D=await v();if(D.kind==="data")return D.data;const R=new Error(`Failed to fetch decofile: ${E?.status??"network error"}`);throw R.status=qe({liveOk:!!E?.ok,liveStatus:E?.status,committedAbsent:D.kind==="absent"}),R}const $=await v();if($.kind==="data")return $.data;const A=new Error("decofile unavailable (preview down, no committed snapshot)");throw A.status=qe({liveOk:!1,committedAbsent:$.kind==="absent"}),A},n[16]=i.kind,n[17]=u,n[18]=l,n[19]=c,n[20]=s,n[21]=o,n[22]=d,n[23]=e,n[24]=a,n[25]=h,n[26]=N):N=n[26];const _=!!e&&i.kind!=="pending"&&!r,I=a?0:3e4,O=a?.describe.pollIntervalMs,w=a?"always":void 0;let y;n[27]!==u||n[28]!==s||n[29]!==a?(y=(v,$)=>{if(a||u||s)return v<3;const A=$.status;return A!==502&&A!==404&&v<2},n[27]=u,n[28]=s,n[29]=a,n[30]=y):y=n[30];let S;return n[31]!==g||n[32]!==N||n[33]!==_||n[34]!==I||n[35]!==O||n[36]!==w||n[37]!==y?(S={queryKey:g,queryFn:N,enabled:_,staleTime:I,refetchInterval:O,refetchIntervalInBackground:!1,refetchOnWindowFocus:w,retry:y,retryDelay:so},n[31]=g,n[32]=N,n[33]=_,n[34]=I,n[35]=O,n[36]=w,n[37]=y,n[38]=S):S=n[38],F(S)}function so(e){return Vt(5e3,1e3,e,2,0)}function io(){return null}function ao(){return null}const co="site-editor-save",we="site-editor-publish";function lo(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=V.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=V.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=V.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Ot(e,t){return t?V.jsx(lo,{label:e("siteEditor.details"),detail:t}):void 0}function ir(e,t,n){z.error(Bn(e,t,n),{id:co,description:Ot(e,Qn(t,n))})}const Tt={action:void 0,duration:void 0};function ar(e,t){z.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Tt,id:we,description:void 0})}function cr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Ot(e,o??null);z[i](t,{id:we,description:n&&a?V.jsxs(V.Fragment,{children:[V.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),z.loading(s??e("thread.publishPopover.publishing"),{...Tt,id:we,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function lr(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Ho as $,Yt as A,zt as B,nt as C,Wt as D,lo as E,Te as F,ye as G,Go as H,Pn as I,sr as J,Ao as K,jo as L,jn as M,yn as N,at as O,Uo as P,Fo as Q,H as R,Ro as S,it as T,Yo as U,Wo as V,rr as W,Sn as X,oe as Y,Un as Z,En as _,$o as a,kn as a0,tr as a1,eo as a2,no as a3,Zn as a4,qo as a5,Mn as a6,Ne as a7,Jo as a8,nr as a9,ir as aa,Xo as ab,Lo as ac,Bo as ad,je as ae,Be as af,Qo as ag,Po as ah,An as ai,Mo as aj,Vo as ak,or as al,ne as am,we as an,Tt as ao,cr as ap,Ko as aq,er as ar,Xt as b,ht as c,Ot as d,xo as e,lr as f,ko as g,Eo as h,Gt as i,Yn as j,Ie as k,zo as l,Co as m,Io as n,Se as o,No as p,To as q,Do as r,_o as s,ar as t,ft as u,qt as v,ro as w,zn as x,Oo as y,Zo as z};
1
+ import{c as P,o as q,m as F,K as m,aV as Ye,aF as Nt,aG as _t,r as U,a as Dt,aw as ce,a2 as xt,au as Rt,b8 as Pt,t as z,j as V}from"./index-DwUSgMrk.js";import{a as We}from"./input-BcdjLg5X.js";import{k as $t,M as At,l as le,s as Re}from"./thread-intent-DYNUY6FR.js";import{u as pe,c as Lt}from"./use-main-schema-v8-Cys0il1A.js";import{b as te}from"./sandbox-url-D3mC8qhT.js";import{s as Ft}from"./utils-BtlQk18r.js";import{a as Ut}from"./repository-binding-Ctv5jACU.js";import{u as Mt}from"./chat-context-DHXBy843.js";import{i as jt,u as Bt}from"./index-DlxFtSYK.js";import{v as Qt}from"./sandbox-git-api-CRxdlhrN.js";import{e as Vt}from"./backoff-CrEUbyZT.js";const p={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class T extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new T(t.code,t.message,t.data)}}const K="deco-content",ue={major:1},ze=1;async function Ht(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const de={major:ue.major,minor:ze},Xe=`the endpoint speaks an older ${K} than this client needs (${de.major}.${de.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function W(e,t,n){const o={reason:t,required:{...de}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new T(p.Unsupported,e,o)}function Ze(e){const t=e??{},{protocol:n,version:o}=t;if(n!==K)throw W(`the endpoint speaks ${JSON.stringify(n)}, not ${K}`,"protocol",t);if(o?.major!==ue.major)throw W(`the endpoint speaks ${K} ${String(o?.major)}.x; this client speaks ${ue.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ze)throw W(Xe,"outdated",t);return e}function Pe(e,t){return t.code===p.MethodNotFound&&e.startsWith("changes.")?W(Xe,"outdated"):T.from(t)}function ye(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let c;try{c=await Ht(a)}catch{throw new T(p.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?T.from(l):new T(p.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw Pe(s,c.error);return c.result};return{call:r,describe:async()=>Ze(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((l,d)=>({jsonrpc:"2.0",id:i[d],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,d)=>{const u=c.get(l);return u?u.error?{ok:!1,error:Pe(s[d].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new T(p.InternalError,"no response for this call")}})}}}const fe=".json";[...Array.from({length:9},(e,t)=>`COM${t+1}`),...Array.from({length:9},(e,t)=>`LPT${t+1}`)];new TextEncoder;function Gt(e){return`${encodeURIComponent(e)}${fe}`}function et(e){return e.endsWith(fe)?e.slice(0,-fe.length):e}function Eo(e){const t=et(e);try{return decodeURIComponent(t)}catch{return t}}function Kt(e){let t=et(e),n=0;for(;t.includes("%");){let o;try{o=decodeURIComponent(t)}catch{break}if(o===t)break;t=o,n++}return{name:t,passes:n}}function ko(e){return Kt(Gt(e)).name}const $e=20,Ae=5,Le=500;function Se(e){return e instanceof T?e.code===p.MethodNotFound?!0:e.code===p.Unsupported&&e.data?.reason==="outdated":!1}function he(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function qt(e,t,n){const o=m.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(r?{ifNoneMatch:r.revision}:{}),i=he(r,s);if(i)return i;const a=await t.changesList({});return he(void 0,a)}async function Jt(e,t){const n=[];for(let s=0;s<t.length;s+=$e)n.push(t.slice(s,s+$e));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=Ae){const i=await e.batch(n.slice(s,s+Ae).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function Co(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=Le){const r=t.slice(o,o+Le),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Io(e){return e instanceof T&&e.code===p.Conflict}function tt(e){return e?.kind==="protocol"?e:null}function Oo(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=q();let a;o[2]!==e?(a=tt(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let d;o[4]!==t?(d=m.contentChanges(t??""),o[4]=t,o[5]=d):d=o[5];let u;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(u=l?()=>qt(i,c.client,t):Ye,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=u):u=o[10];let h;return o[11]!==d||o[12]!==u?(h={queryKey:d,queryFn:u,staleTime:0},o[11]=d,o[12]=u,o[13]=h):h=o[13],F(h)}function To(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=tt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=m.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let d;o[7]!==c||o[8]!==a||o[9]!==s?(d=c?()=>Jt(s.client,a):Ye,o[7]=c,o[8]=a,o[9]=s,o[10]=d):d=o[10];let u;return o[11]!==l||o[12]!==d?(u={queryKey:l,queryFn:d,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=d,o[13]=u):u=o[13],F(u)}function nt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function X(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const ot=Nt({endpoint:_t().max(2048).refine(e=>nt(e)&&new URL(e).pathname==="/rpc").transform(X)});function No(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=ot.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function rt(e){const t=ot.safeParse(e);return t.success?t.data:null}const st="studio:deco-serve-last";function _o(e){try{localStorage.setItem(st,JSON.stringify(e))}catch{}}function Do(){try{const e=localStorage.getItem(st);return e?rt(JSON.parse(e)):null}catch{return null}}function xo(e){try{return new URL(X(e)).host}catch{return e}}function Yt(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Wt="http://localhost:4545/rpc",Ro="npx @decocms/blocks serve",Po="npx @decocms/blocks schema";class Ee extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function zt(e){if(e instanceof Ee)return{reason:"not-deco-serve"};if(!(e instanceof T))return{reason:"not-answering"};switch(e.code){case p.Unauthorized:case p.MethodNotFound:return{reason:"outdated"};case p.Unsupported:return Se(e)?{reason:"outdated"}:{reason:"version-mismatch"};case p.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function $o(e,t){if(e)return[X(e.endpoint)];const n=[t?.endpoint,Wt].filter(o=>!!o).map(X);return[...new Set(n)]}const it=U.createContext(null);function Xt(e){const t=P.c(27),n=U.useContext(it),o=pe(n?null:e),{data:r}=Dt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?ce.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=Ue(a);let d;t[4]!==i||t[5]!==s||t[6]!==e?(d=i?ce.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=d):d=t[7];const[u,h]=Ue(d);if(n)return n;let b;t[8]!==c||t[9]!==i?(b=i?rt(c):null,t[8]=c,t[9]=i,t[10]=b):b=t[10];const g=b,k=!!g;let C;t[11]!==o||t[12]!==k?(C=Zt(o,k),t[11]=o,t[12]=k,t[13]=C):C=t[13];const{applies:x,undecided:N}=C,_=x?g:null,I=i&&o==="v8"&&typeof u=="string"?u:null;let O;t[14]!==h||t[15]!==l||t[16]!==i?(O=S=>{i&&(l(S),h(S.endpoint))},t[14]=h,t[15]=l,t[16]=i,t[17]=O):O=t[17];let w;t[18]!==l||t[19]!==i?(w=()=>{i&&l(null)},t[18]=l,t[19]=i,t[20]=w):w=t[20];let y;return t[21]!==_||t[22]!==I||t[23]!==O||t[24]!==w||t[25]!==N?(y={connection:_,undecided:N,lastEndpoint:I,set:O,clear:w},t[21]=_,t[22]=I,t[23]=O,t[24]=w,t[25]=N,t[26]=y):y=t[26],y}function Zt(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Fe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ue(e){const t=P.c(17),n=q(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Fe(e):null,a=()=>e?Fe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:d}=F(l);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=k=>{if(e){try{k===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(k))}catch{}n.setQueryData(s,k)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const h=u,b=e?d??null:null;let g;return t[14]!==h||t[15]!==b?(g=[b,h],t[14]=h,t[15]=b,t[16]=g):g=t[16],g}function Ao(e){return e.kind==="protocol"||e.kind==="unavailable"}function Lo(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function Fo(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function Uo(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&nt(t)?t:null}function Mo(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function at(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function en(e){if(!e.hasProject)return"legacy";const t=at(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function tn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function Me(e){return e.isError||e.errorUpdateCount>0}function nn(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function on(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}function ne(e){return{[$t]:e}}class ke extends Error{status=409;constructor(){super("main's schema changed")}}async function Ce(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code===At}function Ie(e,t,n){e.resetQueries({predicate:o=>{const r=o.queryKey;return r[1]!==t||r[2]!==n?!1:r[0]===m.mainSchemaV8(t,n)[0]||r[0]===m.contentBackend()[0]&&r[4]==="github"}})}function ct(e,t,n){return e.getQueryData(m.mainSchemaV8(t,n))}const lt="__noSchema";function rn(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[lt]:!0}}function jo(e){return!!e&&e[lt]===!0}function ut(e){if(!e.ok)return e.error.code===p.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function sn(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const an=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Bo(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:sn(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(an)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:je(n.resolveType).localeCompare(je(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function je(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function Be(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=Be(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?Be(s[a],r,n):s[a];return i}return e}function Qo(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class Qe extends Error{}class Ve extends Error{}const dt="site-not-owned";async function cn(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function ln(e,t=r=>fetch(r),n,o){const r=ye({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[c,l]of Object.entries(ne("v8")))i.headers.set(c,l);const a=await t(i);if(await cn(a))throw new Ve;if(await Ce(a))throw n?.(),new ke;return a}});try{const s=await Te(r,le(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof Ve)return dt;throw s}}const Oe=5e3;function un(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function dn(e){return new URL(te(e,"rpc"),window.location.origin).href}async function Te(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==K)throw new Ee;const s=Ze(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:le(t.schema)};if(!o)throw new Error("no schema.get");if(ut(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:le(i?.schema)}}throw o.error}async function fn(e,t=n=>fetch(n)){const n=ye({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new Qe;return r}});try{const o=await Te(n);return o.v8Schema?o:null}catch(o){if(o instanceof Qe)return null;throw o}}function ft(e,t){const n=P.c(53),{org:o}=xt(),{connection:r,undecided:s}=Xt(e),{runtime:i}=We(e),a=U.useContext(it),c=pe(a?null:e),l=Lt(e),d=at({hasServeConnection:!!r,runtime:i}),u=Mt()?.taskId??null,h=jt(Bt().lifecycle.phase),b=q(),g=tn({mode:d,mainSchema:c,workingTreeReady:h}),k=g.github&&!!o.slug&&!!e&&!!t;let C;n[0]!==t||n[1]!==o.slug||n[2]!==b||n[3]!==e?(C=()=>ln(un({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ie(b,o.slug,e),ct(b,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=b,n[3]=e,n[4]=C):C=n[4];const x=F({queryKey:m.contentBackend(o.slug,e??"",t??"","github"),queryFn:C,enabled:k,staleTime:Number.POSITIVE_INFINITY,...He}),N=g.sandbox&&!!o.slug&&!!e&&!!t;let _;n[5]!==t||n[6]!==o.slug||n[7]!==u||n[8]!==e?(_=async()=>fn(dn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:u})),n[5]=t,n[6]=o.slug,n[7]=u,n[8]=e,n[9]=_):_=n[9];const I=F({queryKey:m.contentBackend(o.slug,e??"",t??"","sandbox",u??""),queryFn:_,enabled:N,staleTime:Number.POSITIVE_INFINITY,...He}),O=!!r;let w;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(w=m.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=w):w=n[13];let y;n[14]!==r?(y=()=>Te(ye({endpoint:r.endpoint})),n[14]=r,n[15]=y):y=n[15];let S;n[16]!==O||n[17]!==w||n[18]!==y?(S={queryKey:w,queryFn:y,enabled:O,staleTime:Number.POSITIVE_INFINITY,retry:mn,retryDelay:gn,refetchInterval:hn},n[16]=O,n[17]=w,n[18]=y,n[19]=S):S=n[19];const v=F(S);let $;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?($=m.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=$):$=n[23];const A=$;let E;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(E=m.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=E):E=n[27];let D;n[28]!==v.data||n[29]!==A||n[30]!==b?(D=async()=>{try{return await v.data.client.describe()}catch(f){const G=f;throw b.invalidateQueries({queryKey:A,exact:!0},{cancelRefetch:!1}),G}},n[28]=v.data,n[29]=A,n[30]=b,n[31]=D):D=n[31];const R=!!v.data&&!a;let M;n[32]!==E||n[33]!==D||n[34]!==R?(M={queryKey:E,queryFn:D,enabled:R,refetchInterval:Oe,retry:!1},n[32]=E,n[33]=D,n[34]=R,n[35]=M):M=n[35];const Q=F(M).data??v.data?.describe,L=en({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:c,githubSite:x.data===dt?"not-owned":x.data?"v8":x.data===null?"v7":Me(x)?"error":"loading",sandboxSite:vn({data:I.data,isError:Me(I),workingTreeReady:h}),markedV8:l});if(L==="pending"){let f;return n[36]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending"},n[36]=f):f=n[36],f}if(L==="retrying-github"){let f;return n[37]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending",retrying:"github"},n[37]=f):f=n[37],f}if(L==="retrying-sandbox"){let f;return n[38]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending",retrying:"sandbox"},n[38]=f):f=n[38],f}if(L==="legacy"){let f;return n[39]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"legacy"},n[39]=f):f=n[39],f}if(L==="protocol-github"){const f=x.data;let G;return n[40]!==f?(G=ge("github",f,""),n[40]=f,n[41]=G):G=n[41],G}if(L==="site-not-owned-github"){let f;return n[42]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=f):f=n[42],f}if(L==="protocol-sandbox"){let f;return n[43]!==I.data?(f=ge("sandbox",I.data,":sandbox"),n[43]=I.data,n[44]=f):f=n[44],f}if(L==="unavailable-github"){let f;return n[45]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"unavailable",source:"github"},n[45]=f):f=n[45],f}const se=v.error??v.failureReason,ie=r?.endpoint??"";let Y;return n[46]!==Q||n[47]!==v.data||n[48]!==v.failureCount||n[49]!==v.isError||n[50]!==se||n[51]!==ie?(Y=wn({probed:v.data,isError:v.isError,failureCount:v.failureCount,failure:se,describe:Q,endpoint:ie}),n[46]=Q,n[47]=v.data,n[48]=v.failureCount,n[49]=v.isError,n[50]=se,n[51]=ie,n[52]=Y):Y=n[52],Y}function hn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Oe:!1}function gn(e){return Yt(e+1)}function mn(e,t){return!(t instanceof T)&&!(t instanceof Ee)}function vn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const bn=3;function wn(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ge("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<bn?t:{kind:"unavailable",source:"local",problem:zt(e.failure)}:t??{kind:"pending"}}const He={retry:2,refetchInterval:e=>e.state.status==="error"?Oe:!1};function ge(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function ht(e){const t=P.c(13);let n;t[0]!==e?(n=ce.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=Rt(o,null),i=pe(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const h=e?Re(r):null;a=pn({saved:h,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const c=a;let l,d;t[6]!==s?(l=h=>s(Re(h)),d=()=>s(null),t[6]=s,t[7]=l,t[8]=d):(l=t[7],d=t[8]);let u;return t[9]!==c||t[10]!==l||t[11]!==d?(u={...c,setUrl:l,clear:d},t[9]=c,t[10]=l,t[11]=d,t[12]=u):u=t[12],u}function pn(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function yn(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function Ge(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class Ne extends Error{constructor(t,n,o=[]){super(n),this.blocks=t,this.fields=o,this.name="BlockConflictError"}blocks;fields}function _e(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function oe(e,t,n){return["decofile-write",e,t,n]}function Sn(e,t,n){return{id:oe(e,t,n).join(":")}}function De(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function En(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function kn(e,t,n){e.setQueryData(m.decofileDraft(_e(t)),n)}function Cn(e,t){return e.getQueryData(m.decofileDraft(_e(t)))??null}async function In(e,t){const n=await fetch(De(e),{cache:"no-store",headers:{...ne("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function Vo(e){const t=P.c(4);let n;t[0]!==e?(n=m.decofileDraft(e?_e(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:On,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function On(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Tn(e,t){const n=await fetch(De(t),{cache:"no-store",headers:ne("v7")});if(await Ce(n))throw Ie(e,t.orgSlug,t.virtualMcpId),new ke;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&kn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function Ho(e,t){const n=await fetch(De(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new Ne(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return En(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const gt=3e3,Nn=15e3,_n=2*6e4,mt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Dn(e){return e<_n?gt:Nn}function xn(e,t=mt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Dn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let d;try{d=c()}catch{d=void 0}Promise.resolve(d).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const Ke=()=>0;function Rn(e,t,n=mt){const o=U.useRef(t);o.current=t;const[r]=U.useState(()=>({polling:()=>xn(()=>o.current,n),idle:()=>()=>{}}));U.useSyncExternalStore(e?r.polling:r.idle,Ke,Ke)}function vt(e,t){return te(e,t)}function Pn(e,t){return te(e,"preview-fetch",{path:t})}function Go(e){return vt(e,"preview-invoke")}function Ko(e){return vt(e,"catalog-invoke")}function bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function $n(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&bt(n))return n}return null}function An(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??$n();return n&&bt(n)?new URL(t,n).toString():Pn(e,t)}function Ln(e){return An(e,"/.decofile")}function Fn(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function qe(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function Un(e,t){const n=te(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=Fn(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Ft(s.content)}}async function Mn(e,t){const n=await Un(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function qo(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function jn(e){return Ut(e)?.metadata?.runtime?.path??null}class wt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function Jo(e){return e instanceof T&&e.code===p.Conflict}function pt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}function Bn(e,t,n){if(t instanceof Ne)return t.message;if(n==="local")return Vn(e,t);if(t instanceof T)switch(t.code){case p.Conflict:return e("siteEditor.save.conflict");case p.ReadOnly:return e("siteEditor.save.readOnly");case p.InvalidBlock:case p.InvalidParams:return e("siteEditor.save.invalid");case p.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Qn(e,t){if(t==="local"||e instanceof Ne)return null;if(e instanceof T){const n=e.code===p.InvalidBlock||e.code===p.InvalidParams?pt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Vn(e,t){if(t instanceof wt)return e("decoServe.save.serverGone");if(t instanceof T)switch(t.code){case p.Conflict:return e("decoServe.save.conflict");case p.ReadOnly:return e("decoServe.save.readOnly");case p.InvalidBlock:case p.InvalidParams:return e("decoServe.save.invalid",{detail:pt(t)});case p.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Hn(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Gn(e,t){const[n,o]=U.useState(e),r=U.useRef(null);return e&&!n&&o(!0),U.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Hn(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const yt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},Kn=15e3,Z=new Map;function H(e,t){return`${e}/${t}`}function j(e){let t=Z.get(e);return t||(t={state:yt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},Z.set(e,t)),t}function B(e,t){const n=j(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function re(e){e.timer&&clearTimeout(e.timer),e.timer=null}function xe(e){return Z.get(e)?.state??yt}function qn(e,t){const n=j(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Yo(e){const t=j(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(re(t),B(e,{phase:"idle"}))}}function Wo(e){const t=Z.get(e);!t||t.state.phase!=="reloading"||(re(t),B(e,{phase:"idle"}))}function St(e){const t=j(e);re(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function me(e,t){const n=j(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Et(e,t.navigates,o)}function Et(e,t,n=0){const o=j(e);re(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},Kn),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Jn(e){return e?.kind==="protocol"&&e.source==="github"}async function ve(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:m.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?m.protocolDraftRead(o,r,s):null,d=l?JSON.stringify(n.getQueryData(l)??null):null,u=c?[c]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:m.decofile(a)})),a&&u.push(n.invalidateQueries({queryKey:m.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Qt(o,r,s)})),Jn(i)&&l&&u.push(n.invalidateQueries({queryKey:l})),await Promise.all(u),t.kind!=="edit"){const g=H(o,r);B(g,{epoch:xe(g).epoch+1})}const h=l?JSON.stringify(n.getQueryData(l)??null):null,b=d!==h;return b&&await new Promise(g=>Pt.schedule(g)),{navigates:b}}async function Yn(e,t){return St(H(e.orgSlug,e.virtualMcpId)),kt(e,t)}async function kt(e,t){const n=H(e.orgSlug,e.virtualMcpId);let o;try{o=await t.write()}catch(s){throw me(n,{ok:!1,navigates:!1}),t.refreshOnError&&ve(e,{kind:t.kind,reread:!0}).catch(()=>{}),s}let r=!1;try{({navigates:r}=await ve(e,t))}catch{}finally{me(n,{ok:!0,navigates:r})}return o}function zo(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=H(o,r),a=new Set(t.blockKeys);for(const d of[...j(i).discardListeners])d(a);St(i);let c=!1;const l=()=>(c=!0,kt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:oe(o,r,s),scope:Sn(o,r,s),mutationFn:l}).execute(void 0).catch(d=>{throw c||me(i,{ok:!1,navigates:!1}),d}):l()}function Xo(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=H(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const c=j(s).discardListeners;return c.add(n),()=>{c.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],U.useEffect(i,a)}function Wn(e){const t=H(e.orgSlug,e.virtualMcpId);xe(t).inFlight>0||ve(e,{kind:"external"}).then(({navigates:n})=>{const o=j(t);o.previews>0&&o.state.inFlight===0&&Et(t,n)}).catch(()=>{})}function zn(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=H(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>qn(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>xe(r),n[5]=r,n[6]=a):a=n[6];const c=a;return U.useSyncExternalStore(i,c,c)}const Xn=500;function Zo(e,t){const{phase:n}=zn(e,t);return Gn(n!=="idle",Xn)}function Zn(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function eo(e,t){return m.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function er(e,t,n){const o=e.getQueryData(m.contentVersions(t));if(!o)return;if(Object.hasOwn(o,n))return o[n];const r=e.getQueryData(m.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function Ct(e,t,n){e.setQueryData(m.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function to(e,t){const n=e.getMutationCache().findAll({mutationKey:oe(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>on(o.state.variables)))}function be(e,t){e.resetQueries({queryKey:m.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function ee(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof T);throw t.source==="local"&&s?(be(e,n),new wt(r)):(t.source==="local"&&Se(r)&&be(e,n),r)}}const ae=new Map;function no(e,t,n,o){const r=ae.get(o);if(r)return r;const s=It(e,t,n,o,!0);return ae.set(o,s),s.finally(()=>ae.delete(o))}async function It(e,t,n,o,r){const s=m.decofile(o),i=eo(n,t),a=m.contentRevision(o),c=e.getQueryData(s),l=e.getQueryData(i),d=e.getQueryData(a)??void 0,u=t.source==="github"&&!l?ct(e,n.orgSlug,n.virtualMcpId):void 0,h=u?.isV8&&u.schema&&u.version?u:void 0,b=l??h?.schema,g=h?{...d,schemaVersion:h.version}:d,k=r&&c?g?.revision:void 0,C=r&&b?g?.schemaVersion:void 0,x=m.contentChanges(o),N=e.getQueryData(x),[_,I,O]=await ee(e,t,n,()=>t.client.batch([{method:"blocks.list",params:k?{ifNoneMatch:k}:{}},{method:"schema.get",params:C?{ifNoneMatch:C}:{}},{method:"changes.list",params:N?{ifNoneMatch:N.revision}:{}}]));if(O?.ok){const R=he(N,O.result);R&&e.setQueryData(x,R)}else O&&t.source==="local"&&Se(O.error)&&be(e,n);if(!_?.ok)throw _?.error??new Error("no blocks.list");if(!I)throw new Error("no schema.get");const w=_.result,y=ut(I),S=I.ok&&!y?I.result:null;if(w.notModified&&!c||S?.notModified&&!b)return It(e,t,n,o,!1);const v=w.notModified?new Set:to(e,n),$=w.notModified?c:nn(w.blocks,c,v),A=y?rn():S?S.notModified?b:S.schema:I.error,E=e.getQueryData(a)?.revision,D=E!==void 0&&E!==g?.revision;if(e.setQueryData(a,{revision:D?E:w.notModified?g?.revision:w.revision,schemaVersion:S?S.notModified?g?.schemaVersion:S.version??void 0:void 0}),e.setQueryData(s,$),!w.notModified){const R=m.contentVersions(o),M=e.getQueryData(R),J={...w.versions};for(const Q of v){const L=M?.[Q];L!==void 0?J[Q]=L:delete J[Q]}e.setQueryData(R,J)}return A instanceof T||e.setQueryData(i,A),!D&&!w.notModified&&c&&g?.revision&&w.revision!==g.revision&&Wn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:$,meta:A}}async function tr(e,t,n,o,r,s){return Yn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",write:async()=>{const i=await ee(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));e.setQueryData(m.contentRevision(o),c=>({...c,revision:i.revision}));const a=i.versions??{};return Ct(e,o,a),{revision:i.revision,versions:a}}})}async function nr(e,t,n,o,r){await e.invalidateQueries({queryKey:m.decofile(o)});let s;try{const a=(await ee(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(a&&a.after===null&&a.version!==null)return;s={value:a?.after??null,version:a?.version??null}}catch{const i=await ee(e,t,n,()=>t.client.blocksList({}));if(i.notModified)return;s={value:i.blocks[r]??null,version:i.versions[r]??null}}e.setQueryData(m.decofile(o),i=>{const a={...i};return s.value===null?delete a[r]:a[r]=s.value,a}),Ct(e,o,{[r]:s.version})}function or(e){const t=P.c(11),n=q();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=m.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const c=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:ne("v8")});if(await Ce(c))throw Ie(n,e.orgSlug,e.virtualMcpId),new ke;if(!c.ok)throw new Error(`draft pointer read failed: ${c.status}`);return await c.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a}=F(i);return!e||!a?.draft||!a.version?null:`${a.draft}@${a.version}`}function rr(e){const t=P.c(4);let n;t[0]!==e?(n=m.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:oo,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function oo(){throw new Error("content revisions are set by reads and writes")}function Je(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function ro(e,t){const n=P.c(6),{url:o}=ht(e?.virtualMcpId),r=ft(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Je({...e,protocolSuffix:r.cacheKeySuffix}):Je({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function sr(e,t){const n=P.c(39),{url:o,undecided:r}=ht(e?.virtualMcpId),s=!!o,i=ft(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,c=ro(e),l=t?.fetchEnabled??!0,d=jn(e?.virtualMcpId),u=We(e?.virtualMcpId).runtime==="cms",h=q();let b;n[0]!==c?(b=m.decofile(c),n[0]=c,n[1]=b):b=n[1];const g=b;let k;n[2]!==e||n[3]!==h||n[4]!==g?(k=()=>{if(!e||h.isMutating({mutationKey:oe(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const v=h.getQueryState(g);return v?.fetchStatus==="fetching"||Date.now()-(v?.dataUpdatedAt??0)<gt/2},n[2]=e,n[3]=h,n[4]=g,n[5]=k):k=n[5];let C;n[6]!==u||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==h||n[11]!==g?(C=async()=>{if(e){if(!a&&u&&!s){const v=Cn(h,e)?.version;if(v&&!await In(e,v))return}await h.refetchQueries({queryKey:g,exact:!0},{cancelRefetch:!1})}},n[6]=u,n[7]=s,n[8]=e,n[9]=a,n[10]=h,n[11]=g,n[12]=C):C=n[12];let x;n[13]!==k||n[14]!==C?(x={skip:k,read:C},n[13]=k,n[14]=C,n[15]=x):x=n[15],Rn(!!t?.pollWhile&&!!e,x);let N;n[16]!==i.kind||n[17]!==u||n[18]!==l||n[19]!==c||n[20]!==s||n[21]!==o||n[22]!==d||n[23]!==e||n[24]!==a||n[25]!==h?(N=async()=>{if(a)return(await no(h,a,e,c)).blocks;if(i.kind==="unavailable")throw Zn("decofile");if(s){const E=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(ao),D=E?.ok?Ge(await E.text()):null;if(D)return D;const R=new Error("decofile unavailable (local tunnel unreachable)");throw R.status=502,R}if(u)return Tn(h,e);const v=()=>Mn(e,yn(d,".deco/blocks.gen.json"));if(l){const E=await fetch(Ln(e),{cache:"no-store"}).catch(io);if(E?.ok){const M=Ge(await E.text());if(M)return M}const D=await v();if(D.kind==="data")return D.data;const R=new Error(`Failed to fetch decofile: ${E?.status??"network error"}`);throw R.status=qe({liveOk:!!E?.ok,liveStatus:E?.status,committedAbsent:D.kind==="absent"}),R}const $=await v();if($.kind==="data")return $.data;const A=new Error("decofile unavailable (preview down, no committed snapshot)");throw A.status=qe({liveOk:!1,committedAbsent:$.kind==="absent"}),A},n[16]=i.kind,n[17]=u,n[18]=l,n[19]=c,n[20]=s,n[21]=o,n[22]=d,n[23]=e,n[24]=a,n[25]=h,n[26]=N):N=n[26];const _=!!e&&i.kind!=="pending"&&!r,I=a?0:3e4,O=a?.describe.pollIntervalMs,w=a?"always":void 0;let y;n[27]!==u||n[28]!==s||n[29]!==a?(y=(v,$)=>{if(a||u||s)return v<3;const A=$.status;return A!==502&&A!==404&&v<2},n[27]=u,n[28]=s,n[29]=a,n[30]=y):y=n[30];let S;return n[31]!==g||n[32]!==N||n[33]!==_||n[34]!==I||n[35]!==O||n[36]!==w||n[37]!==y?(S={queryKey:g,queryFn:N,enabled:_,staleTime:I,refetchInterval:O,refetchIntervalInBackground:!1,refetchOnWindowFocus:w,retry:y,retryDelay:so},n[31]=g,n[32]=N,n[33]=_,n[34]=I,n[35]=O,n[36]=w,n[37]=y,n[38]=S):S=n[38],F(S)}function so(e){return Vt(5e3,1e3,e,2,0)}function io(){return null}function ao(){return null}const co="site-editor-save",we="site-editor-publish";function lo(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=V.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=V.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=V.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Ot(e,t){return t?V.jsx(lo,{label:e("siteEditor.details"),detail:t}):void 0}function ir(e,t,n){z.error(Bn(e,t,n),{id:co,description:Ot(e,Qn(t,n))})}const Tt={action:void 0,duration:void 0};function ar(e,t){z.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Tt,id:we,description:void 0})}function cr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Ot(e,o??null);z[i](t,{id:we,description:n&&a?V.jsxs(V.Fragment,{children:[V.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),z.loading(s??e("thread.publishPopover.publishing"),{...Tt,id:we,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function lr(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Ho as $,Yt as A,zt as B,nt as C,Wt as D,lo as E,Te as F,ye as G,Go as H,Pn as I,sr as J,Ao as K,jo as L,jn as M,yn as N,at as O,Uo as P,Fo as Q,H as R,Ro as S,it as T,Yo as U,Wo as V,rr as W,Sn as X,oe as Y,Un as Z,En as _,$o as a,kn as a0,tr as a1,eo as a2,no as a3,Zn as a4,qo as a5,Mn as a6,Ne as a7,Jo as a8,nr as a9,ir as aa,Xo as ab,Lo as ac,Bo as ad,je as ae,Be as af,Qo as ag,Po as ah,An as ai,Mo as aj,Vo as ak,or as al,ne as am,we as an,Tt as ao,cr as ap,Ko as aq,er as ar,Xt as b,ht as c,Ot as d,xo as e,lr as f,ko as g,Eo as h,Gt as i,Yn as j,Ie as k,zo as l,Co as m,Io as n,Se as o,No as p,To as q,Do as r,_o as s,ar as t,ft as u,qt as v,ro as w,zn as x,Oo as y,Zo as z};
@@ -0,0 +1 @@
1
+ import{b as te,a2 as se,o as ae,r as T,aa as ce,j as t,B as U,n as $,b2 as de,a3 as me,t as D,az as ue,c as ie,l as pe,X as ge,T as fe,V as he,U as xe,K as Q,eZ as je}from"./index-DwUSgMrk.js";import{i as ke}from"./DotsVertical-BaN_NJ8K.js";import{i as le,a as ve}from"./ZoomOut-Bi4ExiY7.js";import{s as ye}from"./Trash01--FklAmhG.js";import{i as Se}from"./Upload01-BeT7SqGm.js";import{S as be}from"./search-input-6roNTbiB.js";import{S as we}from"./search-toggle-6uVgZqDd.js";import{f as Ce,e as De,b as Ne,A as Pe,a as Ae,d as Ee,c as Te,g as Me}from"./alert-dialog-XdiY2J_y.js";import{E as Y}from"./empty-state-CLeOp2iF.js";import{C as Oe}from"./collection-tabs-CvrE77Fy.js";import{p as Ie,S as ze,F as Fe}from"./folder-icon-yKBQ26US.js";import{h as Re,i as $e,r as _e}from"./use-org-fs-CnHNkGa0.js";import{S as Le,H as Z,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-D_t1juud.js";import"./icon-button-DfIZISrS.js";import"./tooltip-7xQKXZXx.js";import"./index-B50XV3gp.js";import"./badge-0pHsypn4.js";import"./markdown-DQgkOB--.js";import"./use-copy-D9a2GtFe.js";import"./Copy01-CsZzLh_E.js";import"./use-mobile-D6Ou0NEP.js";import"./use-panel-navigate-CwRBX20z.js";import"./thread-route-Cr8HKNDQ.js";import"./use-project-scope-CwXHOags.js";import"./repository-binding-Ctv5jACU.js";import"./use-mcp-client-CvE7itXw.js";import"./auth-CR47t1GM.js";import"./file-preview-sewMgnQS.js";import"./utils-BtlQk18r.js";import"./Image01-Ffg_Ow_R.js";import"./editor-D4klHvzy.js";import"./file-type-icon-L81OHsVz.js";import"./useInfiniteQuery-DLjfiCcz.js";import"./infiniteQueryObserver-fD19WDlu.js";const J=200,Ke=new Set(["node_modules","__pycache__"]);function q(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function He(s){return q(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function Qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ue(s,e){const l=new Map;for(const r of s){const c=q(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function qe(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ge(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:Z,path:r,sandboxPath:`${Le}/${Z}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ue:ve}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:M,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const F=I,z=r?"opacity-60":"hover:bg-accent";let u;e[5]!==z?(u=pe("relative transition-colors group overflow-hidden flex flex-col h-full",z),e[5]=z,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=F?"default":"system",N=!F;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(Fe,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ge,{children:[t.jsx(fe,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",children:t.jsx(ke,{size:16})})}),t.jsx(he,{align:"end",children:t.jsxs(xe,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(ye,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==M||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):M,e[34]=M,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(je,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function Et(){const s=te(),{org:e}=se(),l=Re(),{remove:r,upload:c}=$e("home"),a=ae(),o=T.useRef(null),[m,S]=T.useState(""),M=ce(),[O,I]=T.useState(L),[F,z]=T.useState(!1),[u,f]=T.useState(null),[b,N]=T.useState(null),[w,h]=T.useState(null),x=()=>{a.invalidateQueries({queryKey:Q.slashSkills(e.id)}),a.invalidateQueries({queryKey:Q.orgFsSkills(e.id)})},j=i=>a.setQueryData(Q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const H=A.split("/")[0]??"",_=n.filter(He),X=_.find(E=>q(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const R=Qe(H),W=`skills/${R}`;let V=!1;z(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:R}));return}V=!0;const E=Ge(R,await X.text());j(oe=>[E,...oe]),h(E.id),await qe(Ue(_,R),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:R}))}catch(E){V&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),z(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(H=>H.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},G=t.jsxs(U,{size:"sm",disabled:F,onClick:()=>o.current?.click(),children:[t.jsx(Se,{size:14}),s(F?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs($,{children:[t.jsx($.Content,{children:t.jsx($.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[M?t.jsx($.Actions,{secondary:t.jsx(we,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:G}):t.jsx($.Title,{actions:G,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!M&&t.jsx(be,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(U,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(ze,{skillPath:u,onClose:()=>f(null)},u),t.jsx(Ce,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(De,{children:[t.jsxs(Ne,{children:[t.jsx(Pe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(Ae,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(Ee,{children:[t.jsx(Te,{children:s("settings.skills.cancel")}),t.jsx(Me,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Et as default};
@@ -0,0 +1 @@
1
+ import{c as A,l as _,j as y}from"./index-DwUSgMrk.js";import{T as N,R,a as T,b as k}from"./index-DlkvGq_Y.js";function E(p){const e=A.c(34);let o,t,r,l,n,m,h,a;e[0]!==p?({className:o,defaultValue:t,value:a,min:m,max:h,onPointerDown:l,onKeyDown:r,...n}=p,e[0]=p,e[1]=o,e[2]=t,e[3]=r,e[4]=l,e[5]=n,e[6]=m,e[7]=h,e[8]=a):(o=e[1],t=e[2],r=e[3],l=e[4],n=e[5],m=e[6],h=e[7],a=e[8]);const i=m===void 0?0:m,s=h===void 0?100:h;let g;e[9]!==t||e[10]!==s||e[11]!==i||e[12]!==a?(g=Array.isArray(a)?a:Array.isArray(t)?t:[i,s],e[9]=t,e[10]=s,e[11]=i,e[12]=a,e[13]=g):g=e[13];const j=g;let c;e[14]!==o?(c=_("relative flex w-full touch-none items-center py-2 select-none data-[disabled]:opacity-50 data-[orientation=vertical]:px-2 data-[orientation=vertical]:py-0 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",o),e[14]=o,e[15]=c):c=e[15];let d;e[16]!==l?(d=v=>{v.currentTarget.dataset.pointer="",l?.(v)},e[16]=l,e[17]=d):d=e[17];let u;e[18]!==r?(u=v=>{delete v.currentTarget.dataset.pointer,r?.(v)},e[18]=r,e[19]=u):u=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=_("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1"),e[20]=b):b=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=y.jsx(N,{"data-slot":"slider-track",className:b,children:y.jsx(R,{"data-slot":"slider-range",className:_("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),e[21]=w):w=e[21];let f;e[22]!==j.length?(f=Array.from({length:j.length},z),e[22]=j.length,e[23]=f):f=e[23];let x;return e[24]!==t||e[25]!==s||e[26]!==i||e[27]!==n||e[28]!==c||e[29]!==d||e[30]!==u||e[31]!==f||e[32]!==a?(x=y.jsxs(T,{"data-slot":"slider",defaultValue:t,value:a,min:i,max:s,className:c,...n,onPointerDown:d,onKeyDown:u,children:[w,f]}),e[24]=t,e[25]=s,e[26]=i,e[27]=n,e[28]=c,e[29]=d,e[30]=u,e[31]=f,e[32]=a,e[33]=x):x=e[33],x}function z(p,e){return y.jsx(k,{"data-slot":"slider-thumb",className:"relative block size-4 shrink-0 cursor-grab rounded-full bg-white shadow-edge transition-transform duration-150 after:absolute after:-inset-3 after:rounded-full after:content-[''] hover:scale-110 focus-ring in-data-pointer:outline-none! active:scale-110 active:cursor-grabbing disabled:pointer-events-none motion-reduce:transition-none"},e)}export{E as S};
@@ -1 +1 @@
1
- import{r as v,d$ as K}from"./index-Dfl75K1t.js";import{d as de,e as fe,f as U,g as ge,h as pe,i as be,j as ve,C as Y,k as he,l as y,m as me,n as xe,o as Ie,s as ye}from"./core.esm-CRtLiDZz.js";function q(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Re(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function O(e){return e!==null&&e>=0}function Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function we(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const B=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=q(t,r,n),o=t[s],c=a[s];return!c||!o?null:{x:c.left-o.left,y:c.top-o.top,scaleX:c.width/o.width,scaleY:c.height/o.height}},L={scaleX:1,scaleY:1},Xe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(s===n){const u=a[o];return u?{x:0,y:n<o?u.top+u.height-(c.top+c.height):u.top-c.top,...L}:null}const f=De(a,s,n);return s>n&&s<=o?{x:0,y:-c.height-f,...L}:s<n&&s>=o?{x:0,y:c.height+f,...L}:{x:0,y:0,...L}};function De(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",V=K.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function _e(e){let{children:t,id:n,items:r,strategy:s=B,disabled:a=!1}=e;const{active:o,dragOverlay:c,droppableRects:f,over:u,measureDroppableContainers:i}=de(),l=fe(H,n),d=c.rect!==null,g=v.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),R=o!=null,C=o?g.indexOf(o.id):-1,h=u?g.indexOf(u.id):-1,w=v.useRef(g),x=!Ce(g,w.current),m=h!==-1&&C===-1||x,b=we(a);U(()=>{x&&R&&i(g)},[x,g,R,i]),v.useEffect(()=>{w.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:l,disabled:b,disableTransforms:m,items:g,overIndex:h,useDragOverlay:d,sortedRects:Re(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return K.createElement(V.Provider,{value:D},t)}const Se=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return q(n,r,s).indexOf(t)},Ae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:o,previousItems:c,previousContainerId:f,transition:u}=e;return!u||!r||c!==a&&s===o?!1:n?!0:o!==s&&t===f},Te={duration:200,easing:"ease"},J="transform",Ee=Y.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,o]=v.useState(null),c=v.useRef(n);return U(()=>{if(!t&&n!==c.current&&r.current){const f=s.current;if(f){const u=he(r.current,{ignoreTransform:!0}),i={x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height};(i.x||i.y)&&o(i)}}n!==c.current&&(c.current=n)},[t,n,r,s]),v.useEffect(()=>{a&&o(null)},[a]),a}function je(e){let{animateLayoutChanges:t=Ae,attributes:n,disabled:r,data:s,getNewIndex:a=Se,id:o,strategy:c,resizeObserverConfig:f,transition:u=Te}=e;const{items:i,containerId:l,activeIndex:d,disabled:g,disableTransforms:R,sortedRects:C,overIndex:h,useDragOverlay:w,strategy:x}=v.useContext(V),m=Le(r,g),b=i.indexOf(o),D=v.useMemo(()=>({sortable:{containerId:l,index:b,items:i},...s}),[l,s,b,i]),I=v.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:N,node:z,isOver:W,setNodeRef:P}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:X,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(P,X),S=!!T,_=S&&!R&&O(d)&&O(h),j=!w&&M,F=j&&_?oe:null,ie=_?F??(c??x)({rects:C,activeNodeRect:ee,activeIndex:d,overIndex:h,index:b}):null,E=O(d)&&O(h)?a({id:o,items:i,activeIndex:d,overIndex:h}):b,A=T?.id,p=v.useRef({activeId:A,items:i,newIndex:E,containerId:l}),ce=i!==p.current.items,G=t({active:T,containerId:l,isDragging:M,isSorting:S,id:o,index:b,items:i,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:u,wasDragging:p.current.activeId!=null}),$=Oe({disabled:!G,index:b,node:z,rect:N});return v.useEffect(()=>{S&&p.current.newIndex!==E&&(p.current.newIndex=E),l!==p.current.containerId&&(p.current.containerId=l),i!==p.current.items&&(p.current.items=i)},[S,E,l,i]),v.useEffect(()=>{if(A===p.current.activeId)return;if(A!=null&&p.current.activeId==null){p.current.activeId=A;return}const ue=setTimeout(()=>{p.current.activeId=A},50);return()=>clearTimeout(ue)},[A]),{active:T,activeIndex:d,attributes:te,data:D,rect:N,index:b,newIndex:E,items:i,isOver:W,isSorting:S,isDragging:M,listeners:re,node:z,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(j&&!ve(Z)||!u)&&(S||G))return Y.Transition.toString({...u,property:J})}}function Le(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function k(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ke=[y.Down,y.Right,y.Up,y.Left],Fe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:a,over:o,scrollableAncestors:c}}=t;if(ke.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const d=s.get(l.id);if(d)switch(e.code){case y.Down:r.top<d.top&&f.push(l);break;case y.Up:r.top>d.top&&f.push(l);break;case y.Left:r.left>d.left&&f.push(l);break;case y.Right:r.left<d.left&&f.push(l);break}});const u=me({collisionRect:r,droppableRects:s,droppableContainers:f});let i=xe(u,"id");if(i===o?.id&&u.length>1&&(i=u[1].id),i!=null){const l=a.get(n.id),d=a.get(i),g=d?s.get(d.id):null,R=d?.node.current;if(R&&g&&l&&d){const h=Ie(R).some((I,N)=>c[N]!==I),w=Q(l,d),x=Me(l,d),m=h||!w?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},b={x:g.left,y:g.top};return m.x&&m.y?b:ye(b,m)}}}};function Q(e,t){return!k(e)||!k(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Me(e,t){return!k(e)||!k(t)||!Q(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{_e as S,q as a,B as r,Fe as s,je as u,Xe as v};
1
+ import{r as v,e2 as K}from"./index-DwUSgMrk.js";import{d as de,e as fe,f as U,g as ge,h as pe,i as be,j as ve,C as Y,k as he,l as y,m as me,n as xe,o as Ie,s as ye}from"./core.esm-3Ntqpx6o.js";function q(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Re(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function O(e){return e!==null&&e>=0}function Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function we(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const B=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=q(t,r,n),o=t[s],c=a[s];return!c||!o?null:{x:c.left-o.left,y:c.top-o.top,scaleX:c.width/o.width,scaleY:c.height/o.height}},L={scaleX:1,scaleY:1},Xe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(s===n){const u=a[o];return u?{x:0,y:n<o?u.top+u.height-(c.top+c.height):u.top-c.top,...L}:null}const f=De(a,s,n);return s>n&&s<=o?{x:0,y:-c.height-f,...L}:s<n&&s>=o?{x:0,y:c.height+f,...L}:{x:0,y:0,...L}};function De(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",V=K.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function _e(e){let{children:t,id:n,items:r,strategy:s=B,disabled:a=!1}=e;const{active:o,dragOverlay:c,droppableRects:f,over:u,measureDroppableContainers:i}=de(),l=fe(H,n),d=c.rect!==null,g=v.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),R=o!=null,C=o?g.indexOf(o.id):-1,h=u?g.indexOf(u.id):-1,w=v.useRef(g),x=!Ce(g,w.current),m=h!==-1&&C===-1||x,b=we(a);U(()=>{x&&R&&i(g)},[x,g,R,i]),v.useEffect(()=>{w.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:l,disabled:b,disableTransforms:m,items:g,overIndex:h,useDragOverlay:d,sortedRects:Re(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return K.createElement(V.Provider,{value:D},t)}const Se=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return q(n,r,s).indexOf(t)},Ae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:o,previousItems:c,previousContainerId:f,transition:u}=e;return!u||!r||c!==a&&s===o?!1:n?!0:o!==s&&t===f},Te={duration:200,easing:"ease"},J="transform",Ee=Y.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,o]=v.useState(null),c=v.useRef(n);return U(()=>{if(!t&&n!==c.current&&r.current){const f=s.current;if(f){const u=he(r.current,{ignoreTransform:!0}),i={x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height};(i.x||i.y)&&o(i)}}n!==c.current&&(c.current=n)},[t,n,r,s]),v.useEffect(()=>{a&&o(null)},[a]),a}function je(e){let{animateLayoutChanges:t=Ae,attributes:n,disabled:r,data:s,getNewIndex:a=Se,id:o,strategy:c,resizeObserverConfig:f,transition:u=Te}=e;const{items:i,containerId:l,activeIndex:d,disabled:g,disableTransforms:R,sortedRects:C,overIndex:h,useDragOverlay:w,strategy:x}=v.useContext(V),m=Le(r,g),b=i.indexOf(o),D=v.useMemo(()=>({sortable:{containerId:l,index:b,items:i},...s}),[l,s,b,i]),I=v.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:N,node:z,isOver:W,setNodeRef:P}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:X,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(P,X),S=!!T,_=S&&!R&&O(d)&&O(h),j=!w&&M,F=j&&_?oe:null,ie=_?F??(c??x)({rects:C,activeNodeRect:ee,activeIndex:d,overIndex:h,index:b}):null,E=O(d)&&O(h)?a({id:o,items:i,activeIndex:d,overIndex:h}):b,A=T?.id,p=v.useRef({activeId:A,items:i,newIndex:E,containerId:l}),ce=i!==p.current.items,G=t({active:T,containerId:l,isDragging:M,isSorting:S,id:o,index:b,items:i,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:u,wasDragging:p.current.activeId!=null}),$=Oe({disabled:!G,index:b,node:z,rect:N});return v.useEffect(()=>{S&&p.current.newIndex!==E&&(p.current.newIndex=E),l!==p.current.containerId&&(p.current.containerId=l),i!==p.current.items&&(p.current.items=i)},[S,E,l,i]),v.useEffect(()=>{if(A===p.current.activeId)return;if(A!=null&&p.current.activeId==null){p.current.activeId=A;return}const ue=setTimeout(()=>{p.current.activeId=A},50);return()=>clearTimeout(ue)},[A]),{active:T,activeIndex:d,attributes:te,data:D,rect:N,index:b,newIndex:E,items:i,isOver:W,isSorting:S,isDragging:M,listeners:re,node:z,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(j&&!ve(Z)||!u)&&(S||G))return Y.Transition.toString({...u,property:J})}}function Le(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function k(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ke=[y.Down,y.Right,y.Up,y.Left],Fe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:a,over:o,scrollableAncestors:c}}=t;if(ke.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const d=s.get(l.id);if(d)switch(e.code){case y.Down:r.top<d.top&&f.push(l);break;case y.Up:r.top>d.top&&f.push(l);break;case y.Left:r.left>d.left&&f.push(l);break;case y.Right:r.left<d.left&&f.push(l);break}});const u=me({collisionRect:r,droppableRects:s,droppableContainers:f});let i=xe(u,"id");if(i===o?.id&&u.length>1&&(i=u[1].id),i!=null){const l=a.get(n.id),d=a.get(i),g=d?s.get(d.id):null,R=d?.node.current;if(R&&g&&l&&d){const h=Ie(R).some((I,N)=>c[N]!==I),w=Q(l,d),x=Me(l,d),m=h||!w?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},b={x:g.left,y:g.top};return m.x&&m.y?b:ye(b,m)}}}};function Q(e,t){return!k(e)||!k(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Me(e,t){return!k(e)||!k(t)||!Q(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{_e as S,q as a,B as r,Fe as s,je as u,Xe as v};