nextclaw 0.52.1 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (520) hide show
  1. package/dist/cli/app/index.js +1 -1
  2. package/dist/{nextclaw-cli-app-npOWL5Nm.js → nextclaw-cli-app-Cco4m9A0.js} +113 -89
  3. package/dist/nextclaw-cli-app-Cco4m9A0.js.map +1 -0
  4. package/package.json +13 -13
  5. package/resources/USAGE.md +7 -6
  6. package/ui-dist/.vite/manifest.json +1146 -1390
  7. package/ui-dist/.vite/manifest.json.gz +0 -0
  8. package/ui-dist/assets/{abnfDiagram-VRR7QNED-DX_u5BBX.js → abnfDiagram-VRR7QNED-Bjrmb5-o.js} +1 -1
  9. package/ui-dist/assets/abnfDiagram-VRR7QNED-Bjrmb5-o.js.gz +0 -0
  10. package/ui-dist/assets/account-panel-C1S3xtUB.js +1 -0
  11. package/ui-dist/assets/account-panel-C1S3xtUB.js.gz +0 -0
  12. package/ui-dist/assets/{aiden0z-pptx-renderer.es-C-E9e5yB.js → aiden0z-pptx-renderer.es-DO4DCX3e.js} +1 -1
  13. package/ui-dist/assets/{aiden0z-pptx-renderer.es-C-E9e5yB.js.gz → aiden0z-pptx-renderer.es-DO4DCX3e.js.gz} +0 -0
  14. package/ui-dist/assets/api-D9e9cHtW.js +20 -0
  15. package/ui-dist/assets/api-D9e9cHtW.js.gz +0 -0
  16. package/ui-dist/assets/app-presenter-provider-J9IgTbc9.js +124 -0
  17. package/ui-dist/assets/app-presenter-provider-J9IgTbc9.js.gz +0 -0
  18. package/ui-dist/assets/appearance-settings-page-BljTr6nB.js +1 -0
  19. package/ui-dist/assets/appearance-settings-page-BljTr6nB.js.gz +0 -0
  20. package/ui-dist/assets/{arc-Cxwa624o.js → arc-g4XaP3S4.js} +1 -1
  21. package/ui-dist/assets/arc-g4XaP3S4.js.gz +0 -0
  22. package/ui-dist/assets/architecture-TIHT7OUA-BWywYH_m.js +1 -0
  23. package/ui-dist/assets/{architectureDiagram-ZJ3FMSHR-D8mCj0H1.js → architectureDiagram-ZJ3FMSHR-CAP7YDux.js} +1 -1
  24. package/ui-dist/assets/architectureDiagram-ZJ3FMSHR-CAP7YDux.js.gz +0 -0
  25. package/ui-dist/assets/{blockDiagram-677ZJIJ3-CbGC1IHl.js → blockDiagram-677ZJIJ3-DhaP0zUG.js} +1 -1
  26. package/ui-dist/assets/blockDiagram-677ZJIJ3-DhaP0zUG.js.gz +0 -0
  27. package/ui-dist/assets/{book-open-xqEj1OLE.js → book-open-vxpV2eSM.js} +1 -1
  28. package/ui-dist/assets/{c4Diagram-LMCZKHZV-BQhGC1Vc.js → c4Diagram-LMCZKHZV-DHCQJJkD.js} +1 -1
  29. package/ui-dist/assets/c4Diagram-LMCZKHZV-DHCQJJkD.js.gz +0 -0
  30. package/ui-dist/assets/card-D9NYhSdf.js +1 -0
  31. package/ui-dist/assets/card-D9NYhSdf.js.gz +0 -0
  32. package/ui-dist/assets/channel-1nKIAEXr.js +1 -0
  33. package/ui-dist/assets/channels-list-page-BiHA1zZd.js +8 -0
  34. package/ui-dist/assets/channels-list-page-BiHA1zZd.js.gz +0 -0
  35. package/ui-dist/assets/chunk-2Q5K7J3B-CAwv72v4.js +1 -0
  36. package/ui-dist/assets/{chunk-32BRIVSS-B74ZZwYG.js → chunk-32BRIVSS-BcQlxl4v.js} +1 -1
  37. package/ui-dist/assets/chunk-32BRIVSS-BcQlxl4v.js.gz +0 -0
  38. package/ui-dist/assets/{chunk-52WLFC77-BvmxW_f_.js → chunk-52WLFC77-ClPpG-2S.js} +1 -1
  39. package/ui-dist/assets/chunk-52WLFC77-ClPpG-2S.js.gz +0 -0
  40. package/ui-dist/assets/{chunk-5FCAYU7R-DQvBRnwL.js → chunk-5FCAYU7R-B_qmYOdX.js} +1 -1
  41. package/ui-dist/assets/{chunk-5HE753X5-CDIH0_y3.js → chunk-5HE753X5-DTO-V56q.js} +1 -1
  42. package/ui-dist/assets/{chunk-5JV3BV7I-CcevlKd-.js → chunk-5JV3BV7I-CU1SOaaG.js} +1 -1
  43. package/ui-dist/assets/chunk-5JV3BV7I-CU1SOaaG.js.gz +0 -0
  44. package/ui-dist/assets/{chunk-5TONJI2A-_3dxVdnY.js → chunk-5TONJI2A-CzSDkWNa.js} +1 -1
  45. package/ui-dist/assets/chunk-5TONJI2A-CzSDkWNa.js.gz +0 -0
  46. package/ui-dist/assets/{chunk-5VM5RSS4-pGO5vvo-.js → chunk-5VM5RSS4-ChkfqIRE.js} +1 -1
  47. package/ui-dist/assets/{chunk-7BUUIJ7U-DEKF5uAN.js → chunk-7BUUIJ7U-Du3Ozi62.js} +1 -1
  48. package/ui-dist/assets/chunk-7BUUIJ7U-Du3Ozi62.js.gz +0 -0
  49. package/ui-dist/assets/{chunk-BIQX33UG-CjBFgq2r.js → chunk-BIQX33UG-C-HVafHB.js} +1 -1
  50. package/ui-dist/assets/{chunk-C7G6YPKG-e_K9OGTz.js → chunk-C7G6YPKG-BSjZ86D0.js} +1 -1
  51. package/ui-dist/assets/chunk-C7G6YPKG-BSjZ86D0.js.gz +0 -0
  52. package/ui-dist/assets/{chunk-CQNSW5MT-C2IiHyHz.js → chunk-CQNSW5MT-1D1W2lF6.js} +1 -1
  53. package/ui-dist/assets/{chunk-CYSBUYHQ-DCC6KmGp.js → chunk-CYSBUYHQ-ISpyj_lK.js} +1 -1
  54. package/ui-dist/assets/{chunk-EMLP6XTP-BYGgekQ0.js → chunk-EMLP6XTP-Cp8iUBt2.js} +1 -1
  55. package/ui-dist/assets/{chunk-EX3LRPZG-FGcwuVsA.js → chunk-EX3LRPZG-BN5RzF5j.js} +1 -1
  56. package/ui-dist/assets/chunk-EX3LRPZG-BN5RzF5j.js.gz +0 -0
  57. package/ui-dist/assets/{chunk-FWX5IMBZ-CV3Ih_Os.js → chunk-FWX5IMBZ-DecJDW4r.js} +2 -2
  58. package/ui-dist/assets/chunk-FWX5IMBZ-DecJDW4r.js.gz +0 -0
  59. package/ui-dist/assets/{chunk-HOUHSVGY-CXpq_hfV.js → chunk-HOUHSVGY-BE_XNgGk.js} +1 -1
  60. package/ui-dist/assets/chunk-HOUHSVGY-BE_XNgGk.js.gz +0 -0
  61. package/ui-dist/assets/{chunk-ICXQ74PX-CZIpjupq.js → chunk-ICXQ74PX-BFOKMkWV.js} +1 -1
  62. package/ui-dist/assets/chunk-ICXQ74PX-BFOKMkWV.js.gz +0 -0
  63. package/ui-dist/assets/{chunk-JG7HCLWE-CdgwBpW7.js → chunk-JG7HCLWE-DL-pl8VB.js} +1 -1
  64. package/ui-dist/assets/chunk-JG7HCLWE-DL-pl8VB.js.gz +0 -0
  65. package/ui-dist/assets/{chunk-JWPE2WC7-BPjAZpOQ.js → chunk-JWPE2WC7-B-bcwfmh.js} +1 -1
  66. package/ui-dist/assets/{chunk-MOJQB5TN-DbJDm8to.js → chunk-MOJQB5TN-BC0taFro.js} +1 -1
  67. package/ui-dist/assets/chunk-MOJQB5TN-BC0taFro.js.gz +0 -0
  68. package/ui-dist/assets/{chunk-MOZMSUNE-BUa1fqKn.js → chunk-MOZMSUNE-RrhfU6MO.js} +1 -1
  69. package/ui-dist/assets/{chunk-OGEWGWER-CtnzLgRu.js → chunk-OGEWGWER-TuI7SR7i.js} +1 -1
  70. package/ui-dist/assets/{chunk-OSBZ3O6U-fUgdpTUM.js → chunk-OSBZ3O6U-C5jMBKlU.js} +1 -1
  71. package/ui-dist/assets/{chunk-PUDLZKDR-CtDWZT9-.js → chunk-PUDLZKDR-C5lMBn0K.js} +1 -1
  72. package/ui-dist/assets/chunk-PUDLZKDR-C5lMBn0K.js.gz +0 -0
  73. package/ui-dist/assets/{chunk-Q4XR5HBZ-BxnK2qxr.js → chunk-Q4XR5HBZ-B-kzUbwT.js} +1 -1
  74. package/ui-dist/assets/chunk-Q4XR5HBZ-B-kzUbwT.js.gz +0 -0
  75. package/ui-dist/assets/{chunk-QBLGF6JB-CH4UKoCF.js → chunk-QBLGF6JB-CRb_WAEj.js} +1 -1
  76. package/ui-dist/assets/{chunk-R7FJI6CG-BxwFoF1v.js → chunk-R7FJI6CG-De6Y7ozO.js} +1 -1
  77. package/ui-dist/assets/chunk-R7FJI6CG-De6Y7ozO.js.gz +0 -0
  78. package/ui-dist/assets/{chunk-RYQCIY6F-DpHAmq7O.js → chunk-RYQCIY6F-Igv92q8k.js} +1 -1
  79. package/ui-dist/assets/chunk-RYQCIY6F-Igv92q8k.js.gz +0 -0
  80. package/ui-dist/assets/{chunk-U6XO7XAA-BjH2VUHU.js → chunk-U6XO7XAA-bCjRshkT.js} +1 -1
  81. package/ui-dist/assets/chunk-U6XO7XAA-bCjRshkT.js.gz +0 -0
  82. package/ui-dist/assets/{chunk-V7JOEXUC-DKJZ3HGj.js → chunk-V7JOEXUC-0J1s_Kgq.js} +1 -1
  83. package/ui-dist/assets/chunk-V7JOEXUC-0J1s_Kgq.js.gz +0 -0
  84. package/ui-dist/assets/chunk-VAUOI2AC-DnaryNw2.js +1 -0
  85. package/ui-dist/assets/{chunk-VR4S4FIN-Cf-o2GtI.js → chunk-VR4S4FIN-DX6lXnNx.js} +1 -1
  86. package/ui-dist/assets/{chunk-WYO6CB5R-zeNXGm20.js → chunk-WYO6CB5R-DLqMXfFC.js} +3 -3
  87. package/ui-dist/assets/chunk-WYO6CB5R-DLqMXfFC.js.gz +0 -0
  88. package/ui-dist/assets/chunk-XXDRQBXY-BToo1uqb.js +1 -0
  89. package/ui-dist/assets/{chunk-YOTPTUD7-Ck87Kqxe.js → chunk-YOTPTUD7-CY4obsV0.js} +1 -1
  90. package/ui-dist/assets/{chunk-ZGVPDNZ5-BbfK6Bfd.js → chunk-ZGVPDNZ5-BleImZKe.js} +1 -1
  91. package/ui-dist/assets/chunk-ZGVPDNZ5-BleImZKe.js.gz +0 -0
  92. package/ui-dist/assets/{chunk-ZIRB5QZD-BDpzh4Yl.js → chunk-ZIRB5QZD-C1TfdjpX.js} +1 -1
  93. package/ui-dist/assets/chunk-ZIRB5QZD-C1TfdjpX.js.gz +0 -0
  94. package/ui-dist/assets/{circle-dashed-CU3yApvP.js → circle-dashed-CEEssYIw.js} +1 -1
  95. package/ui-dist/assets/classDiagram-OUVF2IWQ-D_TusZGx.js +1 -0
  96. package/ui-dist/assets/classDiagram-v2-EOCWNBFH-B1NFZTmS.js +1 -0
  97. package/ui-dist/assets/client-C6YQx7A-.js +1 -0
  98. package/ui-dist/assets/config-split-page-DKPelvjR.js +1 -0
  99. package/ui-dist/assets/config-split-page-DKPelvjR.js.gz +0 -0
  100. package/ui-dist/assets/confirm-dialog-BCGeh61X.js +1 -0
  101. package/ui-dist/assets/confirm-dialog-BCGeh61X.js.gz +0 -0
  102. package/ui-dist/assets/{cose-bilkent-JH36ORCC-CQfMxKCT.js → cose-bilkent-JH36ORCC-CVgUHXkj.js} +1 -1
  103. package/ui-dist/assets/cose-bilkent-JH36ORCC-CVgUHXkj.js.gz +0 -0
  104. package/ui-dist/assets/createLucideIcon-CF8U9dh7.js +1 -0
  105. package/ui-dist/assets/cynefin-VYW2F7L2-CJZSs5s_.js +1 -0
  106. package/ui-dist/assets/{cynefinDiagram-TSTJHNR4-CxFTiC-p.js → cynefinDiagram-TSTJHNR4-cdfImbfI.js} +1 -1
  107. package/ui-dist/assets/cynefinDiagram-TSTJHNR4-cdfImbfI.js.gz +0 -0
  108. package/ui-dist/assets/{dagre-CaBNMcB1.js → dagre-CHNN9L9I.js} +1 -1
  109. package/ui-dist/assets/dagre-CHNN9L9I.js.gz +0 -0
  110. package/ui-dist/assets/{dagre-VKFMJZFB-S_7Hc7bI.js → dagre-VKFMJZFB-PscaENwr.js} +1 -1
  111. package/ui-dist/assets/dagre-VKFMJZFB-PscaENwr.js.gz +0 -0
  112. package/ui-dist/assets/desktop-capabilities-page-BENHdKfk.js +1 -0
  113. package/ui-dist/assets/desktop-capabilities-page-BENHdKfk.js.gz +0 -0
  114. package/ui-dist/assets/desktop-update-config-BJMTQMRS.js +1 -0
  115. package/ui-dist/assets/desktop-update-config-BJMTQMRS.js.gz +0 -0
  116. package/ui-dist/assets/{diagram-FQU43EPY-C7zENvFb.js → diagram-FQU43EPY-CH_wye41.js} +1 -1
  117. package/ui-dist/assets/diagram-FQU43EPY-CH_wye41.js.gz +0 -0
  118. package/ui-dist/assets/{diagram-G47NLZAW-DqYTCqZA.js → diagram-G47NLZAW-Dtjpmi6D.js} +1 -1
  119. package/ui-dist/assets/diagram-G47NLZAW-Dtjpmi6D.js.gz +0 -0
  120. package/ui-dist/assets/{diagram-NH7WQ7WH-BfSJtXRc.js → diagram-NH7WQ7WH-UdjLHyaz.js} +1 -1
  121. package/ui-dist/assets/diagram-NH7WQ7WH-UdjLHyaz.js.gz +0 -0
  122. package/ui-dist/assets/{diagram-OA4YK3LP-CFO-j67H.js → diagram-OA4YK3LP-DYsToEaL.js} +1 -1
  123. package/ui-dist/assets/diagram-OA4YK3LP-DYsToEaL.js.gz +0 -0
  124. package/ui-dist/assets/{diagram-WEI45ONY-DBQDbTaJ.js → diagram-WEI45ONY-CA7kuIer.js} +1 -1
  125. package/ui-dist/assets/diagram-WEI45ONY-CA7kuIer.js.gz +0 -0
  126. package/ui-dist/assets/dialog-DQXou6pg.js +5 -0
  127. package/ui-dist/assets/dialog-DQXou6pg.js.gz +0 -0
  128. package/ui-dist/assets/dist-CiC9Fd9J.js +1 -0
  129. package/ui-dist/assets/dist-CiC9Fd9J.js.gz +0 -0
  130. package/ui-dist/assets/doc-browser-CCYS_csH.js +1 -0
  131. package/ui-dist/assets/doc-browser-context-CPLWVFLd.js +1 -0
  132. package/ui-dist/assets/doc-browser-context-CPLWVFLd.js.gz +0 -0
  133. package/ui-dist/assets/{docx-preview-B4-aDfvO.js → docx-preview-D--EsUWi.js} +1 -1
  134. package/ui-dist/assets/docx-preview-D--EsUWi.js.gz +0 -0
  135. package/ui-dist/assets/{ebnfDiagram-CCIWWBDH-CfDNIXFN.js → ebnfDiagram-CCIWWBDH-BrjaoOuq.js} +1 -1
  136. package/ui-dist/assets/ebnfDiagram-CCIWWBDH-BrjaoOuq.js.gz +0 -0
  137. package/ui-dist/assets/{erDiagram-Q63AITRT-D95rFXMM.js → erDiagram-Q63AITRT-nZQa2kCM.js} +1 -1
  138. package/ui-dist/assets/erDiagram-Q63AITRT-nZQa2kCM.js.gz +0 -0
  139. package/ui-dist/assets/es2015-DHRpDU-q.js +41 -0
  140. package/ui-dist/assets/es2015-DHRpDU-q.js.gz +0 -0
  141. package/ui-dist/assets/eventmodeling-45OFAUF4-rc7kUq4V.js +1 -0
  142. package/ui-dist/assets/extensions-CsWT7x3v.js +1 -0
  143. package/ui-dist/assets/extensions-CsWT7x3v.js.gz +0 -0
  144. package/ui-dist/assets/{eye-C84inPcV.js → eye-DJtw5KJ5.js} +1 -1
  145. package/ui-dist/assets/flowDiagram-23GEKE2U-DAjaeGO8.js +1 -0
  146. package/ui-dist/assets/form-actions-DDQk0END.js +1 -0
  147. package/ui-dist/assets/{ganttDiagram-NO4QXBWP-Bawg0P0r.js → ganttDiagram-NO4QXBWP-CyFZHIHN.js} +1 -1
  148. package/ui-dist/assets/ganttDiagram-NO4QXBWP-CyFZHIHN.js.gz +0 -0
  149. package/ui-dist/assets/gitGraph-TEB2WS4Q-Ce0gf6ps.js +1 -0
  150. package/ui-dist/assets/{gitGraphDiagram-IHSO6WYX-BbKh9nbL.js → gitGraphDiagram-IHSO6WYX-Dfpq3z2M.js} +1 -1
  151. package/ui-dist/assets/gitGraphDiagram-IHSO6WYX-Dfpq3z2M.js.gz +0 -0
  152. package/ui-dist/assets/{i18n-20rSH40D.js → i18n-BjPkAKMQ.js} +2 -2
  153. package/ui-dist/assets/i18n-BjPkAKMQ.js.gz +0 -0
  154. package/ui-dist/assets/info-DKCQHKI2-Cp-Tr78m.js +1 -0
  155. package/ui-dist/assets/{infoDiagram-FWYZ7A6U-DPffZXYh.js → infoDiagram-FWYZ7A6U-Diiz0k1E.js} +1 -1
  156. package/ui-dist/assets/{ishikawaDiagram-FXEZZL3T-CBMsLwZ2.js → ishikawaDiagram-FXEZZL3T-B3R3SN4M.js} +1 -1
  157. package/ui-dist/assets/ishikawaDiagram-FXEZZL3T-B3R3SN4M.js.gz +0 -0
  158. package/ui-dist/assets/{journeyDiagram-5HDEW3XC-Mz5U4OzU.js → journeyDiagram-5HDEW3XC-DFOLKiNv.js} +1 -1
  159. package/ui-dist/assets/journeyDiagram-5HDEW3XC-DFOLKiNv.js.gz +0 -0
  160. package/ui-dist/assets/{kanban-definition-HUTT4EX6-FXZq2k19.js → kanban-definition-HUTT4EX6-BMXpDp3g.js} +1 -1
  161. package/ui-dist/assets/kanban-definition-HUTT4EX6-BMXpDp3g.js.gz +0 -0
  162. package/ui-dist/assets/katex-B4FQSo9k.js +1 -0
  163. package/ui-dist/assets/keyboard-shortcuts-settings-page-hqTP7akj.js +1 -0
  164. package/ui-dist/assets/{line-BZwCgT9K.js → line-64_FhCoJ.js} +1 -1
  165. package/ui-dist/assets/{linear-CTe9mKUw.js → linear-aF1fg7bK.js} +1 -1
  166. package/ui-dist/assets/linear-aF1fg7bK.js.gz +0 -0
  167. package/ui-dist/assets/loader-circle-B-4WwzBj.js +1 -0
  168. package/ui-dist/assets/login-page-BUwshAq4.js +1 -0
  169. package/ui-dist/assets/login-page-BUwshAq4.js.gz +0 -0
  170. package/ui-dist/assets/login-page-CdlI6B8e.js +1 -0
  171. package/ui-dist/assets/main-BVYdyT60.css +1 -0
  172. package/ui-dist/assets/main-BVYdyT60.css.gz +0 -0
  173. package/ui-dist/assets/main-DYEALeoQ.js +2 -0
  174. package/ui-dist/assets/main-DYEALeoQ.js.gz +0 -0
  175. package/ui-dist/assets/main-i18n-catalog.config-1o2hjZ0m.js +1 -0
  176. package/ui-dist/assets/main-i18n-catalog.config-1o2hjZ0m.js.gz +0 -0
  177. package/ui-dist/assets/{map-Ci48ZwAp.js → map-BC3Amra3.js} +1 -1
  178. package/ui-dist/assets/map-BC3Amra3.js.gz +0 -0
  179. package/ui-dist/assets/mcp-marketplace-page-CRRQT6SP.js +1 -0
  180. package/ui-dist/assets/{mermaid-parser.core-CzPD3U_z.js → mermaid-parser.core-DdMcZwnE.js} +2 -2
  181. package/ui-dist/assets/mermaid-parser.core-DdMcZwnE.js.gz +0 -0
  182. package/ui-dist/assets/{mermaid.core-geIMNPbV.js → mermaid.core-BHdiEBbI.js} +3 -3
  183. package/ui-dist/assets/mermaid.core-BHdiEBbI.js.gz +0 -0
  184. package/ui-dist/assets/{mindmap-definition-LN4V7U3C-xqlKxsr_.js → mindmap-definition-LN4V7U3C-CtHVaZyV.js} +1 -1
  185. package/ui-dist/assets/mindmap-definition-LN4V7U3C-CtHVaZyV.js.gz +0 -0
  186. package/ui-dist/assets/model-config-page-BSsHOhV7.js +1 -0
  187. package/ui-dist/assets/model-config-page-BSsHOhV7.js.gz +0 -0
  188. package/ui-dist/assets/navigation-history-CyawyVz0.js +1 -0
  189. package/ui-dist/assets/navigation-history-CyawyVz0.js.gz +0 -0
  190. package/ui-dist/assets/navigation-link-D-fxdv0i.js +3 -0
  191. package/ui-dist/assets/navigation-link-D-fxdv0i.js.gz +0 -0
  192. package/ui-dist/assets/{ordinal-MxnX8yhv.js → ordinal-6b3jw4cz.js} +1 -1
  193. package/ui-dist/assets/ordinal-6b3jw4cz.js.gz +0 -0
  194. package/ui-dist/assets/packet-7NZHBO7P-BOJuCraS.js +1 -0
  195. package/ui-dist/assets/panel-app-i18n-catalog.config-kQO7QAwH.js +1 -0
  196. package/ui-dist/assets/panelStandalone-BeI0Ndsx.js +2 -0
  197. package/ui-dist/assets/panelStandalone-BeI0Ndsx.js.gz +0 -0
  198. package/ui-dist/assets/{pegDiagram-2B236MQR-D50MFTN1.js → pegDiagram-2B236MQR-BtbG3Bgu.js} +1 -1
  199. package/ui-dist/assets/pegDiagram-2B236MQR-BtbG3Bgu.js.gz +0 -0
  200. package/ui-dist/assets/pie-RZYD4A2V-D-FEO81x.js +1 -0
  201. package/ui-dist/assets/{pieDiagram-ENE6RG2P-CpA13oiC.js → pieDiagram-ENE6RG2P-FmLl2hzN.js} +1 -1
  202. package/ui-dist/assets/pieDiagram-ENE6RG2P-FmLl2hzN.js.gz +0 -0
  203. package/ui-dist/assets/privacy-settings-page-pW_1naDz.js +1 -0
  204. package/ui-dist/assets/privacy-settings-page-pW_1naDz.js.gz +0 -0
  205. package/ui-dist/assets/projects-k6SLda_A.js +1 -0
  206. package/ui-dist/assets/projects-k6SLda_A.js.gz +0 -0
  207. package/ui-dist/assets/provider-models-mVzuEQBS.js +1 -0
  208. package/ui-dist/assets/provider-models-mVzuEQBS.js.gz +0 -0
  209. package/ui-dist/assets/provider-scoped-model-input-CVbtT8L9.js +1 -0
  210. package/ui-dist/assets/provider-scoped-model-input-CVbtT8L9.js.gz +0 -0
  211. package/ui-dist/assets/providers-config-page-rBlVrHkb.js +1 -0
  212. package/ui-dist/assets/providers-config-page-rBlVrHkb.js.gz +0 -0
  213. package/ui-dist/assets/{puzzle-D6gulz7u.js → puzzle-kKiVft9-.js} +1 -1
  214. package/ui-dist/assets/pwa-BgGM4kkY.js +1 -0
  215. package/ui-dist/assets/pwa-BgGM4kkY.js.gz +0 -0
  216. package/ui-dist/assets/{quadrantDiagram-ABIIQ3AL-CYCgaj4l.js → quadrantDiagram-ABIIQ3AL-7-OzMNpF.js} +1 -1
  217. package/ui-dist/assets/quadrantDiagram-ABIIQ3AL-7-OzMNpF.js.gz +0 -0
  218. package/ui-dist/assets/radar-I7S5WNFK-Bq3eK1vK.js +1 -0
  219. package/ui-dist/assets/railroad-3IZDKUUU-C3uZ1esg.js +1 -0
  220. package/ui-dist/assets/railroad-abnf-AHOZXSZD-D3iZd1KT.js +1 -0
  221. package/ui-dist/assets/railroad-ebnf-EBAXGLYW-Dl0FWqZu.js +1 -0
  222. package/ui-dist/assets/railroad-peg-LSFZ7HO6-B51SbzGp.js +1 -0
  223. package/ui-dist/assets/{railroadDiagram-RFXS5EU6-4LKDGlXN.js → railroadDiagram-RFXS5EU6-B_UVtLJO.js} +1 -1
  224. package/ui-dist/assets/railroadDiagram-RFXS5EU6-B_UVtLJO.js.gz +0 -0
  225. package/ui-dist/assets/{refresh-cw-h9Xq3LY3.js → refresh-cw-BeG0y6yZ.js} +1 -1
  226. package/ui-dist/assets/remote-wYWqir2w.js +1 -0
  227. package/ui-dist/assets/{requirementDiagram-TGXJPOKE-CxNOU0JH.js → requirementDiagram-TGXJPOKE-D8TO2YeZ.js} +1 -1
  228. package/ui-dist/assets/requirementDiagram-TGXJPOKE-D8TO2YeZ.js.gz +0 -0
  229. package/ui-dist/assets/{rotate-cw-B6xm41Wn.js → rotate-cw-Ci2dcTO5.js} +1 -1
  230. package/ui-dist/assets/runtime-config-page-DCXN0nkS.js +1 -0
  231. package/ui-dist/assets/runtime-config-page-DCXN0nkS.js.gz +0 -0
  232. package/ui-dist/assets/{sankeyDiagram-HTMAVEWB-DbCBDe2S.js → sankeyDiagram-HTMAVEWB-CUzIcq0B.js} +1 -1
  233. package/ui-dist/assets/sankeyDiagram-HTMAVEWB-CUzIcq0B.js.gz +0 -0
  234. package/ui-dist/assets/{save-fff_WpY2.js → save-Cr895abt.js} +1 -1
  235. package/ui-dist/assets/search-config-page-CNQd481d.js +1 -0
  236. package/ui-dist/assets/search-config-page-CNQd481d.js.gz +0 -0
  237. package/ui-dist/assets/secrets-config-page--q7M58L8.js +3 -0
  238. package/ui-dist/assets/secrets-config-page--q7M58L8.js.gz +0 -0
  239. package/ui-dist/assets/security-config-CJb2pK2O.js +1 -0
  240. package/ui-dist/assets/select-Bq-UmfCK.js +1 -0
  241. package/ui-dist/assets/select-Bq-UmfCK.js.gz +0 -0
  242. package/ui-dist/assets/{sequenceDiagram-DBY2YBRQ-DA6W2BS_.js → sequenceDiagram-DBY2YBRQ-kqJzXbwu.js} +1 -1
  243. package/ui-dist/assets/sequenceDiagram-DBY2YBRQ-kqJzXbwu.js.gz +0 -0
  244. package/ui-dist/assets/service-apps-panel-iLLEByRF.js +1 -0
  245. package/ui-dist/assets/service-apps-panel-iLLEByRF.js.gz +0 -0
  246. package/ui-dist/assets/{settings-2-CE3ELQyk.js → settings-2-IodCcaXd.js} +1 -1
  247. package/ui-dist/assets/{sizeCapture-X5ZJPWSS-T_q_d_VW.js → sizeCapture-X5ZJPWSS-D9ISogq1.js} +1 -1
  248. package/ui-dist/assets/{src-CYpUlx-4.js → src-Bc0PoUJ1.js} +1 -1
  249. package/ui-dist/assets/src-Bc0PoUJ1.js.gz +0 -0
  250. package/ui-dist/assets/{stateDiagram-2N3HPSRC-mi8z2G0a.js → stateDiagram-2N3HPSRC-CqH5xc9W.js} +1 -1
  251. package/ui-dist/assets/stateDiagram-2N3HPSRC-CqH5xc9W.js.gz +0 -0
  252. package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-CcOGfDdx.js +1 -0
  253. package/ui-dist/assets/status-dot-DUYSKRCU.js +1 -0
  254. package/ui-dist/assets/status-dot-DUYSKRCU.js.gz +0 -0
  255. package/ui-dist/assets/{swimlanes-5IMT3BWC-DkBEhWE4.js → swimlanes-5IMT3BWC-mwejV-rW.js} +2 -2
  256. package/ui-dist/assets/swimlanes-5IMT3BWC-mwejV-rW.js.gz +0 -0
  257. package/ui-dist/assets/swimlanesDiagram-G3AALYLV-BMI2k8RZ.js +8 -0
  258. package/ui-dist/assets/tag-chip-CQU51ST3.js +1 -0
  259. package/ui-dist/assets/tag-chip-CQU51ST3.js.gz +0 -0
  260. package/ui-dist/assets/theme-provider-D-zZkXxS.js +1 -0
  261. package/ui-dist/assets/theme-provider-D-zZkXxS.js.gz +0 -0
  262. package/ui-dist/assets/{timeline-definition-FHXFAJF6-BoFmqBw1.js → timeline-definition-FHXFAJF6-CuikIDlX.js} +1 -1
  263. package/ui-dist/assets/timeline-definition-FHXFAJF6-CuikIDlX.js.gz +0 -0
  264. package/ui-dist/assets/trash-2-BDdqDh6E.js +1 -0
  265. package/ui-dist/assets/treeView-QDETBFTQ-C0_07QI1.js +1 -0
  266. package/ui-dist/assets/treemap-6X3UGDF4-Djpx6ccG.js +1 -0
  267. package/ui-dist/assets/use-config-Bxx7DdaL.js +1 -0
  268. package/ui-dist/assets/use-config-Bxx7DdaL.js.gz +0 -0
  269. package/ui-dist/assets/{use-desktop-capabilities-BkuRd2cY.js → use-desktop-capabilities-BTgdFgJy.js} +1 -1
  270. package/ui-dist/assets/use-desktop-capabilities-BTgdFgJy.js.gz +0 -0
  271. package/ui-dist/assets/use-viewport-layout-CDcca0YL.js +1 -0
  272. package/ui-dist/assets/use-viewport-layout-CDcca0YL.js.gz +0 -0
  273. package/ui-dist/assets/{vennDiagram-L72KCM5P-BlZ3Or5U.js → vennDiagram-L72KCM5P-BD0P0qHh.js} +1 -1
  274. package/ui-dist/assets/vennDiagram-L72KCM5P-BD0P0qHh.js.gz +0 -0
  275. package/ui-dist/assets/wardley-OPB4EBWU-DZVFxu81.js +1 -0
  276. package/ui-dist/assets/{wardleyDiagram-EHGQE667-yDfr33i3.js → wardleyDiagram-EHGQE667-C6ma3t5D.js} +1 -1
  277. package/ui-dist/assets/wardleyDiagram-EHGQE667-C6ma3t5D.js.gz +0 -0
  278. package/ui-dist/assets/x-LUUwl8rK.js +1 -0
  279. package/ui-dist/assets/{xychartDiagram-FW5EYKEG-mIXwIGAQ.js → xychartDiagram-FW5EYKEG-D7E40NBk.js} +1 -1
  280. package/ui-dist/assets/xychartDiagram-FW5EYKEG-D7E40NBk.js.gz +0 -0
  281. package/ui-dist/index.html +37 -54
  282. package/ui-dist/index.html.gz +0 -0
  283. package/ui-dist/panel-standalone.html +11 -15
  284. package/ui-dist/panel-standalone.html.gz +0 -0
  285. package/dist/nextclaw-cli-app-npOWL5Nm.js.map +0 -1
  286. package/ui-dist/assets/abnfDiagram-VRR7QNED-DX_u5BBX.js.gz +0 -0
  287. package/ui-dist/assets/account-panel-BW4GbzQd.js +0 -1
  288. package/ui-dist/assets/account-panel-BW4GbzQd.js.gz +0 -0
  289. package/ui-dist/assets/api-DqzQ-_3w.js +0 -13
  290. package/ui-dist/assets/api-DqzQ-_3w.js.gz +0 -0
  291. package/ui-dist/assets/app-data-C54N2p8b.js +0 -1
  292. package/ui-dist/assets/app-data-C54N2p8b.js.gz +0 -0
  293. package/ui-dist/assets/app-presenter-provider-CBZ_-ewx.js +0 -115
  294. package/ui-dist/assets/app-presenter-provider-CBZ_-ewx.js.gz +0 -0
  295. package/ui-dist/assets/appearance-settings-page-C-uZ2Wkf.js +0 -1
  296. package/ui-dist/assets/appearance-settings-page-C-uZ2Wkf.js.gz +0 -0
  297. package/ui-dist/assets/arc-Cxwa624o.js.gz +0 -0
  298. package/ui-dist/assets/architecture-TIHT7OUA-DEt0Abz9.js +0 -1
  299. package/ui-dist/assets/architectureDiagram-ZJ3FMSHR-D8mCj0H1.js.gz +0 -0
  300. package/ui-dist/assets/blockDiagram-677ZJIJ3-CbGC1IHl.js.gz +0 -0
  301. package/ui-dist/assets/boxes-D6uPnkGo.js +0 -1
  302. package/ui-dist/assets/c4Diagram-LMCZKHZV-BQhGC1Vc.js.gz +0 -0
  303. package/ui-dist/assets/card-BhfAZv5L.js +0 -1
  304. package/ui-dist/assets/card-BhfAZv5L.js.gz +0 -0
  305. package/ui-dist/assets/channel-CxQkbwRD.js +0 -1
  306. package/ui-dist/assets/channels-list-page-Bv7CVSqV.js +0 -8
  307. package/ui-dist/assets/channels-list-page-Bv7CVSqV.js.gz +0 -0
  308. package/ui-dist/assets/chevron-down-BL-yMYcX.js +0 -1
  309. package/ui-dist/assets/chunk-2Q5K7J3B-ClVhziok.js +0 -1
  310. package/ui-dist/assets/chunk-32BRIVSS-B74ZZwYG.js.gz +0 -0
  311. package/ui-dist/assets/chunk-52WLFC77-BvmxW_f_.js.gz +0 -0
  312. package/ui-dist/assets/chunk-5JV3BV7I-CcevlKd-.js.gz +0 -0
  313. package/ui-dist/assets/chunk-5TONJI2A-_3dxVdnY.js.gz +0 -0
  314. package/ui-dist/assets/chunk-7BUUIJ7U-DEKF5uAN.js.gz +0 -0
  315. package/ui-dist/assets/chunk-C7G6YPKG-e_K9OGTz.js.gz +0 -0
  316. package/ui-dist/assets/chunk-EX3LRPZG-FGcwuVsA.js.gz +0 -0
  317. package/ui-dist/assets/chunk-FWX5IMBZ-CV3Ih_Os.js.gz +0 -0
  318. package/ui-dist/assets/chunk-HOUHSVGY-CXpq_hfV.js.gz +0 -0
  319. package/ui-dist/assets/chunk-ICXQ74PX-CZIpjupq.js.gz +0 -0
  320. package/ui-dist/assets/chunk-JG7HCLWE-CdgwBpW7.js.gz +0 -0
  321. package/ui-dist/assets/chunk-MOJQB5TN-DbJDm8to.js.gz +0 -0
  322. package/ui-dist/assets/chunk-PUDLZKDR-CtDWZT9-.js.gz +0 -0
  323. package/ui-dist/assets/chunk-Q4XR5HBZ-BxnK2qxr.js.gz +0 -0
  324. package/ui-dist/assets/chunk-R7FJI6CG-BxwFoF1v.js.gz +0 -0
  325. package/ui-dist/assets/chunk-RYQCIY6F-DpHAmq7O.js.gz +0 -0
  326. package/ui-dist/assets/chunk-U6XO7XAA-BjH2VUHU.js.gz +0 -0
  327. package/ui-dist/assets/chunk-V7JOEXUC-DKJZ3HGj.js.gz +0 -0
  328. package/ui-dist/assets/chunk-VAUOI2AC-DZQxkIsv.js +0 -1
  329. package/ui-dist/assets/chunk-WYO6CB5R-zeNXGm20.js.gz +0 -0
  330. package/ui-dist/assets/chunk-XXDRQBXY-BkExtw5C.js +0 -1
  331. package/ui-dist/assets/chunk-ZGVPDNZ5-BbfK6Bfd.js.gz +0 -0
  332. package/ui-dist/assets/chunk-ZIRB5QZD-BDpzh4Yl.js.gz +0 -0
  333. package/ui-dist/assets/circle-alert-lSa3LRvS.js +0 -1
  334. package/ui-dist/assets/classDiagram-OUVF2IWQ-Bd6apBb-.js +0 -1
  335. package/ui-dist/assets/classDiagram-v2-EOCWNBFH-CYxUZGCI.js +0 -1
  336. package/ui-dist/assets/client-BtGBwLTs.js +0 -1
  337. package/ui-dist/assets/config-split-page-DqAXKLmG.js +0 -1
  338. package/ui-dist/assets/config-split-page-DqAXKLmG.js.gz +0 -0
  339. package/ui-dist/assets/confirm-dialog-BTKCWMn6.js +0 -1
  340. package/ui-dist/assets/confirm-dialog-BTKCWMn6.js.gz +0 -0
  341. package/ui-dist/assets/cose-bilkent-JH36ORCC-CQfMxKCT.js.gz +0 -0
  342. package/ui-dist/assets/createLucideIcon-BNKf0_kc.js +0 -1
  343. package/ui-dist/assets/cynefin-VYW2F7L2-CV0bFLH9.js +0 -1
  344. package/ui-dist/assets/cynefinDiagram-TSTJHNR4-CxFTiC-p.js.gz +0 -0
  345. package/ui-dist/assets/dagre-CaBNMcB1.js.gz +0 -0
  346. package/ui-dist/assets/dagre-VKFMJZFB-S_7Hc7bI.js.gz +0 -0
  347. package/ui-dist/assets/desktop-capabilities-page-zLzCSB7A.js +0 -1
  348. package/ui-dist/assets/desktop-capabilities-page-zLzCSB7A.js.gz +0 -0
  349. package/ui-dist/assets/desktop-update-config-PmofcFf6.js +0 -1
  350. package/ui-dist/assets/desktop-update-config-PmofcFf6.js.gz +0 -0
  351. package/ui-dist/assets/diagram-FQU43EPY-C7zENvFb.js.gz +0 -0
  352. package/ui-dist/assets/diagram-G47NLZAW-DqYTCqZA.js.gz +0 -0
  353. package/ui-dist/assets/diagram-NH7WQ7WH-BfSJtXRc.js.gz +0 -0
  354. package/ui-dist/assets/diagram-OA4YK3LP-CFO-j67H.js.gz +0 -0
  355. package/ui-dist/assets/diagram-WEI45ONY-DBQDbTaJ.js.gz +0 -0
  356. package/ui-dist/assets/dialog-Xe73hpQz.js +0 -5
  357. package/ui-dist/assets/dialog-Xe73hpQz.js.gz +0 -0
  358. package/ui-dist/assets/dist-BiIcnf9j.js +0 -1
  359. package/ui-dist/assets/dist-BiIcnf9j.js.gz +0 -0
  360. package/ui-dist/assets/dist-C5I0v8Qn.js +0 -1
  361. package/ui-dist/assets/dist-C5I0v8Qn.js.gz +0 -0
  362. package/ui-dist/assets/dist-czPa8xFO.js +0 -1
  363. package/ui-dist/assets/dist-czPa8xFO.js.gz +0 -0
  364. package/ui-dist/assets/doc-browser-BJrre2S_.js +0 -1
  365. package/ui-dist/assets/doc-browser-BJrre2S_.js.gz +0 -0
  366. package/ui-dist/assets/doc-browser-BPqA-zQx.js +0 -1
  367. package/ui-dist/assets/doc-browser-context-TILuCY5c.js +0 -1
  368. package/ui-dist/assets/doc-browser-context-TILuCY5c.js.gz +0 -0
  369. package/ui-dist/assets/docx-preview-B4-aDfvO.js.gz +0 -0
  370. package/ui-dist/assets/ebnfDiagram-CCIWWBDH-CfDNIXFN.js.gz +0 -0
  371. package/ui-dist/assets/ellipsis-C5YXdOUx.js +0 -1
  372. package/ui-dist/assets/erDiagram-Q63AITRT-D95rFXMM.js.gz +0 -0
  373. package/ui-dist/assets/es2015-cuwbYI-l.js +0 -41
  374. package/ui-dist/assets/es2015-cuwbYI-l.js.gz +0 -0
  375. package/ui-dist/assets/eventmodeling-45OFAUF4-BzkLWWdP.js +0 -1
  376. package/ui-dist/assets/extensions-CVUFK6Jj.js +0 -1
  377. package/ui-dist/assets/extensions-CVUFK6Jj.js.gz +0 -0
  378. package/ui-dist/assets/flowDiagram-23GEKE2U-ukkCsB0j.js +0 -1
  379. package/ui-dist/assets/form-actions-BRESe-m_.js +0 -1
  380. package/ui-dist/assets/ganttDiagram-NO4QXBWP-Bawg0P0r.js.gz +0 -0
  381. package/ui-dist/assets/gitGraph-TEB2WS4Q-BYFhT0Q5.js +0 -1
  382. package/ui-dist/assets/gitGraphDiagram-IHSO6WYX-BbKh9nbL.js.gz +0 -0
  383. package/ui-dist/assets/i18n-20rSH40D.js.gz +0 -0
  384. package/ui-dist/assets/i18n-provider-BPRq6S7O.js +0 -1
  385. package/ui-dist/assets/info-DKCQHKI2-CTmlJdcH.js +0 -1
  386. package/ui-dist/assets/ishikawaDiagram-FXEZZL3T-CBMsLwZ2.js.gz +0 -0
  387. package/ui-dist/assets/journeyDiagram-5HDEW3XC-Mz5U4OzU.js.gz +0 -0
  388. package/ui-dist/assets/kanban-definition-HUTT4EX6-FXZq2k19.js.gz +0 -0
  389. package/ui-dist/assets/katex-DbZC06Q5.js +0 -1
  390. package/ui-dist/assets/keyboard-shortcuts-settings-page-CScSXYS4.js +0 -1
  391. package/ui-dist/assets/linear-CTe9mKUw.js.gz +0 -0
  392. package/ui-dist/assets/loader-circle-K1BDdHR5.js +0 -1
  393. package/ui-dist/assets/login-page-Dlyvp-81.js +0 -1
  394. package/ui-dist/assets/login-page-f8qQ4xKY.js +0 -1
  395. package/ui-dist/assets/login-page-f8qQ4xKY.js.gz +0 -0
  396. package/ui-dist/assets/logo-badge-C-5-zim6.js +0 -1
  397. package/ui-dist/assets/logo-badge-C-5-zim6.js.gz +0 -0
  398. package/ui-dist/assets/main-D2dWy8fM.css +0 -1
  399. package/ui-dist/assets/main-D2dWy8fM.css.gz +0 -0
  400. package/ui-dist/assets/main-DMNmwcJE.js +0 -2
  401. package/ui-dist/assets/main-DMNmwcJE.js.gz +0 -0
  402. package/ui-dist/assets/main-i18n-catalog.config-DZ-5ollN.js +0 -1
  403. package/ui-dist/assets/main-i18n-catalog.config-DZ-5ollN.js.gz +0 -0
  404. package/ui-dist/assets/map-Ci48ZwAp.js.gz +0 -0
  405. package/ui-dist/assets/mcp-marketplace-page-FfIfEo6w.js +0 -10
  406. package/ui-dist/assets/mcp-marketplace-page-FfIfEo6w.js.gz +0 -0
  407. package/ui-dist/assets/mcp-marketplace-page-sH7VptN_.js +0 -1
  408. package/ui-dist/assets/mermaid-parser.core-CzPD3U_z.js.gz +0 -0
  409. package/ui-dist/assets/mermaid.core-geIMNPbV.js.gz +0 -0
  410. package/ui-dist/assets/mindmap-definition-LN4V7U3C-xqlKxsr_.js.gz +0 -0
  411. package/ui-dist/assets/model-config-page-Bcm6-pCX.js +0 -1
  412. package/ui-dist/assets/model-config-page-Bcm6-pCX.js.gz +0 -0
  413. package/ui-dist/assets/navigation-link-BAQjgx2F.js +0 -3
  414. package/ui-dist/assets/navigation-link-BAQjgx2F.js.gz +0 -0
  415. package/ui-dist/assets/ordinal-MxnX8yhv.js.gz +0 -0
  416. package/ui-dist/assets/packet-7NZHBO7P-BbrI0ZlN.js +0 -1
  417. package/ui-dist/assets/panel-app-i18n-catalog.config-p3qAY_Eq.js +0 -1
  418. package/ui-dist/assets/panelStandalone-By-6dDXS.js +0 -2
  419. package/ui-dist/assets/panelStandalone-By-6dDXS.js.gz +0 -0
  420. package/ui-dist/assets/pegDiagram-2B236MQR-D50MFTN1.js.gz +0 -0
  421. package/ui-dist/assets/pie-RZYD4A2V-B7zE1ZIr.js +0 -1
  422. package/ui-dist/assets/pieDiagram-ENE6RG2P-CpA13oiC.js.gz +0 -0
  423. package/ui-dist/assets/plus-LA8-jpxP.js +0 -1
  424. package/ui-dist/assets/popover-NkrFlWHp.js +0 -1
  425. package/ui-dist/assets/popover-NkrFlWHp.js.gz +0 -0
  426. package/ui-dist/assets/privacy-settings-page-B1sHLAc1.js +0 -1
  427. package/ui-dist/assets/privacy-settings-page-B1sHLAc1.js.gz +0 -0
  428. package/ui-dist/assets/projects-Voql-cvx.js +0 -1
  429. package/ui-dist/assets/projects-Voql-cvx.js.gz +0 -0
  430. package/ui-dist/assets/provider-models-hrHMcHqg.js +0 -1
  431. package/ui-dist/assets/provider-models-hrHMcHqg.js.gz +0 -0
  432. package/ui-dist/assets/provider-scoped-model-input-BQsugx1v.js +0 -1
  433. package/ui-dist/assets/provider-scoped-model-input-BQsugx1v.js.gz +0 -0
  434. package/ui-dist/assets/providers-config-page-BDEdHJbw.js +0 -1
  435. package/ui-dist/assets/providers-config-page-BDEdHJbw.js.gz +0 -0
  436. package/ui-dist/assets/pwa-CzqfYjFx.js +0 -1
  437. package/ui-dist/assets/pwa-CzqfYjFx.js.gz +0 -0
  438. package/ui-dist/assets/quadrantDiagram-ABIIQ3AL-CYCgaj4l.js.gz +0 -0
  439. package/ui-dist/assets/radar-I7S5WNFK-1X_q11Ed.js +0 -1
  440. package/ui-dist/assets/railroad-3IZDKUUU-CIXnuFyE.js +0 -1
  441. package/ui-dist/assets/railroad-abnf-AHOZXSZD-D6ImKl2r.js +0 -1
  442. package/ui-dist/assets/railroad-ebnf-EBAXGLYW-2j9d3twU.js +0 -1
  443. package/ui-dist/assets/railroad-peg-LSFZ7HO6-DMVaJGbm.js +0 -1
  444. package/ui-dist/assets/railroadDiagram-RFXS5EU6-4LKDGlXN.js.gz +0 -0
  445. package/ui-dist/assets/remote-BekqL5nA.js +0 -1
  446. package/ui-dist/assets/requirementDiagram-TGXJPOKE-CxNOU0JH.js.gz +0 -0
  447. package/ui-dist/assets/runtime-config-page-BH9uF4u_.js +0 -1
  448. package/ui-dist/assets/runtime-config-page-BH9uF4u_.js.gz +0 -0
  449. package/ui-dist/assets/sankeyDiagram-HTMAVEWB-DbCBDe2S.js.gz +0 -0
  450. package/ui-dist/assets/search-CUe41wjm.js +0 -1
  451. package/ui-dist/assets/search-config-page-DWKlMHgH.js +0 -1
  452. package/ui-dist/assets/search-config-page-DWKlMHgH.js.gz +0 -0
  453. package/ui-dist/assets/secrets-config-page-DiQL088Y.js +0 -3
  454. package/ui-dist/assets/secrets-config-page-DiQL088Y.js.gz +0 -0
  455. package/ui-dist/assets/security-config-DmTDKKY4.js +0 -1
  456. package/ui-dist/assets/select-CG5YWnwe.js +0 -1
  457. package/ui-dist/assets/select-CG5YWnwe.js.gz +0 -0
  458. package/ui-dist/assets/sequenceDiagram-DBY2YBRQ-DA6W2BS_.js.gz +0 -0
  459. package/ui-dist/assets/service-apps-panel-CEnyYsQp.js +0 -1
  460. package/ui-dist/assets/service-apps-panel-CEnyYsQp.js.gz +0 -0
  461. package/ui-dist/assets/skeleton-Drvn83YW.js +0 -1
  462. package/ui-dist/assets/src-CYpUlx-4.js.gz +0 -0
  463. package/ui-dist/assets/stateDiagram-2N3HPSRC-mi8z2G0a.js.gz +0 -0
  464. package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-OlIMT57r.js +0 -1
  465. package/ui-dist/assets/swimlanes-5IMT3BWC-DkBEhWE4.js.gz +0 -0
  466. package/ui-dist/assets/swimlanesDiagram-G3AALYLV-sLThrh07.js +0 -8
  467. package/ui-dist/assets/tabs-BuE0qKMh.js +0 -1
  468. package/ui-dist/assets/tabs-BuE0qKMh.js.gz +0 -0
  469. package/ui-dist/assets/tag-chip-B1AYPOKL.js +0 -1
  470. package/ui-dist/assets/theme-provider-DzvAi3pe.js +0 -1
  471. package/ui-dist/assets/theme-provider-DzvAi3pe.js.gz +0 -0
  472. package/ui-dist/assets/timeline-definition-FHXFAJF6-BoFmqBw1.js.gz +0 -0
  473. package/ui-dist/assets/tooltip-DYcuWhuP.js +0 -1
  474. package/ui-dist/assets/tooltip-DYcuWhuP.js.gz +0 -0
  475. package/ui-dist/assets/trash-2-BPPYt2NV.js +0 -1
  476. package/ui-dist/assets/treeView-QDETBFTQ-CCFyazDE.js +0 -1
  477. package/ui-dist/assets/treemap-6X3UGDF4-D6wvq1Hz.js +0 -1
  478. package/ui-dist/assets/use-config-BEdbtpD4.js +0 -1
  479. package/ui-dist/assets/use-config-BEdbtpD4.js.gz +0 -0
  480. package/ui-dist/assets/use-desktop-capabilities-BkuRd2cY.js.gz +0 -0
  481. package/ui-dist/assets/use-panel-app-scroll-restoration-ZnicIfo3.js +0 -1
  482. package/ui-dist/assets/use-panel-app-scroll-restoration-ZnicIfo3.js.gz +0 -0
  483. package/ui-dist/assets/use-viewport-layout-BS18drMT.js +0 -1
  484. package/ui-dist/assets/use-viewport-layout-BS18drMT.js.gz +0 -0
  485. package/ui-dist/assets/utils-CBZPzC_b.js +0 -8
  486. package/ui-dist/assets/utils-CBZPzC_b.js.gz +0 -0
  487. package/ui-dist/assets/vennDiagram-L72KCM5P-BlZ3Or5U.js.gz +0 -0
  488. package/ui-dist/assets/wardley-OPB4EBWU-BRzaRyFf.js +0 -1
  489. package/ui-dist/assets/wardleyDiagram-EHGQE667-yDfr33i3.js.gz +0 -0
  490. package/ui-dist/assets/x-DdXOqLnX.js +0 -1
  491. package/ui-dist/assets/xychartDiagram-FW5EYKEG-mIXwIGAQ.js.gz +0 -0
  492. /package/ui-dist/assets/{array-D0DyKZdT.js → array-B0sEvCP9.js} +0 -0
  493. /package/ui-dist/assets/{chunk-KEIR6QF5-CuZFOa6q.js → chunk-KEIR6QF5-BeO7fxDQ.js} +0 -0
  494. /package/ui-dist/assets/{chunk-KEIR6QF5-CuZFOa6q.js.gz → chunk-KEIR6QF5-BeO7fxDQ.js.gz} +0 -0
  495. /package/ui-dist/assets/{chunk-Y2CYZVJY-Frut-1TF.js → chunk-Y2CYZVJY-JQfgEV36.js} +0 -0
  496. /package/ui-dist/assets/{config-hints-B_C9DAp5.js → config-hints-D3OuwoEY.js} +0 -0
  497. /package/ui-dist/assets/{cytoscape.esm-BibuhnZD.js → cytoscape.esm-CzJ9uXgi.js} +0 -0
  498. /package/ui-dist/assets/{cytoscape.esm-BibuhnZD.js.gz → cytoscape.esm-CzJ9uXgi.js.gz} +0 -0
  499. /package/ui-dist/assets/{defaultLocale-q7sRUXPc.js → defaultLocale-USmzX3VG.js} +0 -0
  500. /package/ui-dist/assets/{defaultLocale-q7sRUXPc.js.gz → defaultLocale-USmzX3VG.js.gz} +0 -0
  501. /package/ui-dist/assets/{dist-DhMddrrH.js → dist-BYF6XVna.js} +0 -0
  502. /package/ui-dist/assets/{dist-DhMddrrH.js.gz → dist-BYF6XVna.js.gz} +0 -0
  503. /package/ui-dist/assets/{graphlib-BM63WsW3.js → graphlib-DEFMkHdW.js} +0 -0
  504. /package/ui-dist/assets/{graphlib-BM63WsW3.js.gz → graphlib-DEFMkHdW.js.gz} +0 -0
  505. /package/ui-dist/assets/{host-capabilities-B107nwS3.js → host-capabilities-C0MmWd3M.js} +0 -0
  506. /package/ui-dist/assets/{init-CRMkf9sL.js → init-04ErALoz.js} +0 -0
  507. /package/ui-dist/assets/{jszip.min-6thm2J_a.js → jszip.min-BnQ5NRy2.js} +0 -0
  508. /package/ui-dist/assets/{jszip.min-6thm2J_a.js.gz → jszip.min-BnQ5NRy2.js.gz} +0 -0
  509. /package/ui-dist/assets/{katex-B26hhTOT.js → katex-CsAM73R9.js} +0 -0
  510. /package/ui-dist/assets/{katex-B26hhTOT.js.gz → katex-CsAM73R9.js.gz} +0 -0
  511. /package/ui-dist/assets/{middleware-0o3JF3tS.js → middleware-CAXxl-af.js} +0 -0
  512. /package/ui-dist/assets/{middleware-0o3JF3tS.js.gz → middleware-CAXxl-af.js.gz} +0 -0
  513. /package/ui-dist/assets/{panel-app-B39rJPj8.js → panel-app-2EACRB8p.js} +0 -0
  514. /package/ui-dist/assets/{panel-app-B39rJPj8.js.gz → panel-app-2EACRB8p.js.gz} +0 -0
  515. /package/ui-dist/assets/{path-BFMmafCM.js → path-CzxQ9n2G.js} +0 -0
  516. /package/ui-dist/assets/{path-BFMmafCM.js.gz → path-CzxQ9n2G.js.gz} +0 -0
  517. /package/ui-dist/assets/{rough.esm-5Tjchx1D.js → rough.esm-pT9fdsW3.js} +0 -0
  518. /package/ui-dist/assets/{rough.esm-5Tjchx1D.js.gz → rough.esm-pT9fdsW3.js.gz} +0 -0
  519. /package/ui-dist/assets/{xlsx-BC8ibjXK.js → xlsx-BRpCSiE4.js} +0 -0
  520. /package/ui-dist/assets/{xlsx-BC8ibjXK.js.gz → xlsx-BRpCSiE4.js.gz} +0 -0
@@ -1,10 +0,0 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,i as r,t as i}from"./utils-CBZPzC_b.js";import{$ as a,Fn as o,G as s,Gt as c,J as l,K as u,Mn as d,Nn as f,Pn as p,Qt as m,U as h,Ut as g,W as ee,X as _,Y as v,Yt as y,Zt as b,bn as x,jn as S,q as C,vn as w,xn as T,yn as E}from"./api-DqzQ-_3w.js";import{s as D}from"./i18n-20rSH40D.js";import{t as O}from"./createLucideIcon-BNKf0_kc.js";import"./doc-browser-BJrre2S_.js";import{a as k,i as A,n as j,r as M,t as N}from"./select-CG5YWnwe.js";import{t as P}from"./circle-alert-lSa3LRvS.js";import{t as F}from"./loader-circle-K1BDdHR5.js";import{n as te,t as I}from"./confirm-dialog-BTKCWMn6.js";import{t as L}from"./x-DdXOqLnX.js";import{a as R,c as z,d as ne,f as re,i as B,l as V,n as ie,o as ae,p as oe,r as se,s as ce,t as le,u as ue}from"./dialog-Xe73hpQz.js";import{t as H}from"./skeleton-Drvn83YW.js";import{n as de}from"./i18n-provider-BPRq6S7O.js";import{g as fe,n as pe}from"./doc-browser-context-TILuCY5c.js";import{t as me}from"./tag-chip-B1AYPOKL.js";var he=class extends o{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:p()})}getOptimisticResult(e){return e.behavior=p(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,p=o&&c===`backward`,m=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:d(t,n.data),hasPreviousPage:f(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:s&&!l&&!p,isRefetching:a&&!u&&!m}}};function ge(e,t){return T(e,he,t)}var U=e(n(),1),W=t(),_e=b(`rounded-2xl border px-4 py-3`,{variants:{tone:{neutral:`border-gray-200 bg-gray-50 text-gray-900`,success:`border-emerald-200 bg-emerald-50 text-emerald-900`,warning:`border-amber-200 bg-amber-50 text-amber-900`,danger:`border-rose-200 bg-rose-50 text-rose-700`,info:`border-primary/20 bg-primary/10 text-primary`},borderStyle:{solid:``,dashed:`border-dashed`}},defaultVariants:{tone:`neutral`,borderStyle:`solid`}}),ve={neutral:`text-gray-900`,success:`text-emerald-800`,warning:`text-amber-900`,danger:`text-rose-700`,info:`text-primary`},ye={neutral:`text-gray-600`,success:`text-emerald-700`,warning:`text-amber-800`,danger:`text-rose-700`,info:`text-primary/90`},G=U.forwardRef(({className:e,tone:t=`neutral`,borderStyle:n=`solid`,title:r,description:a,icon:o,actions:s,children:c,...l},u)=>{let d=t??`neutral`,f=!!r||!!a||!!o||!!s;return(0,W.jsxs)(`div`,{ref:u,className:i(_e({tone:d,borderStyle:n}),e),...l,children:[f?(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[o?(0,W.jsx)(`div`,{className:`mt-0.5 shrink-0`,children:o}):null,(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[r?(0,W.jsx)(`p`,{className:i(`text-sm font-medium`,ve[d]),children:r}):null,a?(0,W.jsx)(`p`,{className:i(r?`mt-1`:``,`text-sm leading-6`,ye[d]),children:a}):null]})]})}),s?(0,W.jsx)(`div`,{className:`shrink-0`,children:s}):null]}):null,c?(0,W.jsx)(`div`,{className:i(f?`mt-3`:``),children:c}):null]})});G.displayName=`NoticeCard`;var be=O(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),xe=O(`PackageCheck`,[[`path`,{d:`m16 16 2 2 4-4`,key:`gfu2re`}],[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}]]),Se=O(`PackageSearch`,[[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}],[`circle`,{cx:`18.5`,cy:`15.5`,r:`2.5`,key:`b5zd12`}],[`path`,{d:`M20.27 17.27 22 19`,key:`1l4muz`}]]),Ce={open:!1,title:``,description:``,confirmLabel:D(`confirm`),cancelLabel:D(`cancel`),variant:`default`,resolve:null};function we(){let[e,t]=(0,U.useState)(Ce),n=(0,U.useCallback)(e=>new Promise(n=>{t({open:!0,title:e.title,description:e.description??``,confirmLabel:e.confirmLabel??D(`confirm`),cancelLabel:e.cancelLabel??D(`cancel`),variant:e.variant??`default`,resolve:e=>{n(e),t(e=>({...e,open:!1,resolve:null}))}})}),[]),r=(0,U.useCallback)(e=>{t(t=>(!e&&t.resolve&&t.resolve(!1),{...t,open:e,resolve:e?t.resolve:null}))},[]);return{confirm:n,ConfirmDialog:(0,U.useCallback)(()=>(0,W.jsx)(I,{open:e.open,onOpenChange:r,title:e.title,description:e.description||void 0,confirmLabel:e.confirmLabel,cancelLabel:e.cancelLabel,variant:e.variant,onConfirm:()=>e.resolve?.(!0),onCancel:()=>e.resolve?.(!1)}),[e,r])}}function Te(e){if(!e||e.pages.length===0)return;let t=e.pages.flatMap(e=>e.items);return{...e.pages[e.pages.length-1],items:t,pages:e.pages,loadedItems:t.length,loadedPages:e.pages.length}}function Ee({scope:e,isRefreshing:t,searchText:n,searchPlaceholder:r,sort:i,onSearchTextChange:a,onSortChange:o}){return(0,W.jsx)(`div`,{className:`mb-4`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,W.jsx)(Se,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,W.jsx)(`input`,{value:n,onChange:e=>a(e.target.value),placeholder:r,className:`h-9 w-full rounded-xl border border-border/75 bg-card pl-9 pr-9 text-sm transition-colors focus:outline-none focus:ring-0`}),t&&(0,W.jsx)(F,{className:`absolute right-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 animate-spin text-primary`,"aria-label":D(`marketplaceRefreshingResults`)})]}),e===`all`&&(0,W.jsxs)(N,{value:i,onValueChange:e=>o(e),children:[(0,W.jsx)(A,{className:`h-9 w-[150px] shrink-0 rounded-lg`,children:(0,W.jsx)(k,{})}),(0,W.jsxs)(j,{children:[(0,W.jsx)(M,{value:`relevance`,children:D(`marketplaceSortRelevance`)}),(0,W.jsx)(M,{value:`updated`,children:D(`marketplaceSortUpdated`)})]})]})]})})}function De({count:e}){return(0,W.jsx)(W.Fragment,{children:Array.from({length:e},(e,t)=>(0,W.jsx)(`article`,{className:`h-full rounded-xl border border-gray-200/60 bg-white p-3.5 shadow-sm`,children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-2.5`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 gap-2.5`,children:[(0,W.jsx)(H,{className:`h-9 w-9 shrink-0 rounded-lg`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,W.jsx)(H,{className:`h-4 w-32 max-w-[70%]`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(H,{className:`h-3 w-12`}),(0,W.jsx)(H,{className:`h-3 w-24`})]}),(0,W.jsx)(H,{className:`h-3 w-full`}),(0,W.jsxs)(`div`,{className:`flex gap-1.5 pt-0.5`,children:[(0,W.jsx)(H,{className:`h-5 w-14 rounded-md`}),(0,W.jsx)(H,{className:`h-5 w-16 rounded-md`}),(0,W.jsx)(H,{className:`h-5 w-12 rounded-md`})]})]})]}),(0,W.jsx)(H,{className:`h-7 w-16 shrink-0 rounded-md`})]})},`marketplace-skeleton-${t}`))})}function Oe({hasMore:e,loading:t,sentinelRef:n}){return!e&&!t?null:(0,W.jsxs)(`div`,{className:`py-4`,children:[e&&(0,W.jsx)(`div`,{ref:n,className:`h-1 w-full`,"aria-hidden":`true`}),t&&(0,W.jsx)(`div`,{"data-testid":`marketplace-loading-more`,className:`pt-3 text-center text-xs text-gray-500`,children:D(`loading`)})]})}function ke(e){let t=e.trim().toLowerCase().replace(/_/g,`-`),n=[t,t.split(`-`)[0],`en`];return Array.from(new Set(n.filter(Boolean)))}function K(e){return e.trim().toLowerCase().replace(/_/g,`-`)}function Ae(e,t,n){if(e){let t=Object.entries(e).map(([e,t])=>({locale:K(e),text:typeof t==`string`?t.trim():``})).filter(e=>e.text.length>0);if(t.length>0){let e=new Map(t.map(e=>[e.locale,e.text]));for(let t of n){let n=K(t),r=e.get(n);if(r)return r}for(let e of n){let n=K(e).split(`-`)[0];if(!n)continue;let r=t.find(e=>e.locale===n||e.locale.startsWith(`${n}-`));if(r)return r.text}return t[0]?.text??``}}return t?.trim()??``}function je(e,t){if(!e)return``;for(let n of t)if(K(n).split(`-`)[0]===`zh`&&e.descriptionZh?.trim())return e.descriptionZh.trim();return e.description?.trim()?e.description.trim():e.descriptionZh?.trim()?e.descriptionZh.trim():``}function Me(){let e=pe();(0,U.useEffect)(()=>{let t=t=>{let n=t.target.closest(`a[href]`);if(!n)return;let r=n.getAttribute(`href`)||``;fe(r)&&(n.hasAttribute(`data-doc-external`)||t.ctrlKey||t.metaKey||t.shiftKey||(t.preventDefault(),t.stopPropagation(),e.open(r)))};return document.addEventListener(`click`,t,!0),()=>document.removeEventListener(`click`,t,!0)},[e])}var q=r(e=>({entries:{},setEntry:t=>e(e=>({entries:{...e.entries,[t.id]:t}}))}));function J(e){q.getState().setEntry(e)}function Ne(e){let t=e.indexOf(`:`);return t<=0||t>=e.length-1?null:{scope:e.slice(0,t),key:e.slice(t+1)}}function Pe(e){return e===`skill`||e===`skill-preview`}function Fe(e){let t=q(t=>e?t.entries[e]:void 0);return(0,U.useEffect)(()=>{if(!e||q.getState().entries[e])return;let t=Ne(e);if(!t||!Pe(t.scope))return;let n=!1,r=t.key,i=D(`marketplaceTypeSkill`);return a(t.key).then(a=>{n||J({id:e,title:r,typeLabel:i,spec:t.key,status:`ready`,summary:D(`marketplaceInstalledLocalSummary`),metadataRaw:a.metadataRaw,contentRaw:a.bodyRaw||a.raw,sourceUrl:a.sourceUrl,sourceLabel:a.source?`Source (${a.source})`:void 0})}).catch(()=>{n||J({id:e,title:r,typeLabel:i,spec:t.key,status:`error`,summary:D(`marketplaceInstalledLocalSummary`),metadataRaw:JSON.stringify({skill:t.key},null,2),contentRaw:D(`marketplaceDetailUnavailableDescription`)})}),()=>{n=!0}},[e]),t}var Ie=`marketplace-detail`,Le=`nextclaw://marketplace-detail`;function Re(e,t){return`${e}:${t}`}function ze(e){return`${Le}/${encodeURIComponent(e)}`}function Be(e){try{let t=new URL(e);if(t.protocol!==`nextclaw:`||t.hostname!==`marketplace-detail`)return null;let n=t.pathname.replace(/^\//,``);return n?decodeURIComponent(n):null}catch{return null}}function Ve(e){let t=ze(e.id);return{dedupeKey:`marketplace-detail:${e.id}`,historyPolicy:`managed`,kind:Ie,resourceUri:t,title:e.title,url:t}}function Y(e,t,n){J(t),e.openTarget(Ve(t),{activate:n?.activate,dedupeKey:`marketplace-detail:${t.id}`,title:t.title})}function He(e){let t=e.replace(/\r\n/g,`
2
- `).split(`
3
- `);if(t[0]?.trim()!==`---`)return e;let n=t.findIndex((e,t)=>t>0&&e.trim()===`---`);return n>0?t.slice(n+1).join(`
4
- `).trim():e}function X(e){let t=[],n=/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\(https?:\/\/[^)\s]+\))/g,r=0,i=0;for(let a of e.matchAll(n)){if(a.index===void 0)continue;a.index>r&&t.push(e.slice(r,a.index));let n=a[0],o=`${i}-${a.index}`;if(n.startsWith("`"))t.push((0,W.jsx)(`code`,{className:`rounded border border-border bg-muted px-1 py-0.5 font-mono text-[0.88em] text-foreground`,children:n.slice(1,-1)},o));else if(n.startsWith(`**`))t.push((0,W.jsx)(`strong`,{children:n.slice(2,-2)},o));else{let e=n.match(/^\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)$/);t.push(e?(0,W.jsx)(`a`,{href:e[2],target:`_blank`,rel:`noopener noreferrer`,children:e[1]},o):n)}r=a.index+n.length,i+=1}return r<e.length&&t.push(e.slice(r)),t}function Ue(e){return/^(#{1,4})\s+/.test(e)||/^([-*])\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)}function We(e,t,n){let r=[],i=t+1;for(;i<e.length&&!e[i]?.trim().startsWith("```");)r.push(e[i]??``),i+=1;let a=n[1]??``;return{node:(0,W.jsxs)(`div`,{className:`relative my-3 overflow-hidden rounded-lg border border-border bg-muted/70`,children:[a?(0,W.jsx)(`span`,{className:`absolute right-3 top-2 font-mono text-[10px] text-muted-foreground`,children:a}):null,(0,W.jsx)(`pre`,{className:`m-0 overflow-x-auto p-3 text-xs leading-6 text-foreground`,children:(0,W.jsx)(`code`,{children:r.join(`
5
- `)})})]},t),nextIndex:i+1}}function Ge(e,t,n){let r=[],a=t,o=n?/^\d+\.\s+/:/^[-*]\s+/;for(;a<e.length&&o.test(e[a]?.trim()??``);)r.push((e[a]??``).trim().replace(o,``)),a+=1;return{node:(0,W.jsx)(n?`ol`:`ul`,{className:i(`my-2 pl-5`,n?`list-decimal`:`list-disc`),children:r.map((e,n)=>(0,W.jsx)(`li`,{className:`my-1`,children:X(e)},`${t}-${n}`))},t),nextIndex:a}}function Ke(e,t,n){let r=`mb-2 mt-5 font-semibold leading-tight text-foreground`;return e===1?(0,W.jsx)(`h1`,{className:r,children:n},t):e===2?(0,W.jsx)(`h2`,{className:r,children:n},t):e===3?(0,W.jsx)(`h3`,{className:r,children:n},t):(0,W.jsx)(`h4`,{className:r,children:n},t)}function qe(e,t){let n=e[t]?.trim()??``,r=n.match(/^```(\S*)/);if(r)return We(e,t,r);let i=n.match(/^(#{1,4})\s+(.+)$/);if(i)return{node:Ke(Math.min(4,i[1]?.length??2),t,X(i[2]??``)),nextIndex:t+1};if(/^[-*]\s+/.test(n))return Ge(e,t,!1);if(/^\d+\.\s+/.test(n))return Ge(e,t,!0);if(/^>\s?/.test(n)){let n=[],r=t;for(;r<e.length&&/^>\s?/.test(e[r]?.trim()??``);)n.push((e[r]??``).trim().replace(/^>\s?/,``)),r+=1;return{node:(0,W.jsx)(`blockquote`,{className:`my-3 rounded-lg border-l-4 border-primary/50 bg-muted/60 px-3 py-2 text-muted-foreground`,children:X(n.join(` `))},t),nextIndex:r}}let a=[],o=t;for(;o<e.length;){let t=e[o]?.trim()??``;if(!t||Ue(t))break;a.push(t),o+=1}return{node:(0,W.jsx)(`p`,{children:X(a.join(` `))},t),nextIndex:o}}function Je(e){let t=He(e).replace(/\r\n/g,`
6
- `).split(`
7
- `),n=[],r=0;for(;r<t.length;){if(!(t[r]??``).trim()){r+=1;continue}let e=qe(t,r);n.push(e.node),r=e.nextIndex}return n}function Ye(e){return Array.isArray(e)?e.map(e=>Ye(e)).filter(e=>e.trim().length>0).join(`, `):e&&typeof e==`object`?``:String(e??``)}function Xe(e){try{let t=JSON.parse(e);return!t||typeof t!=`object`||Array.isArray(t)?[]:Object.entries(t).map(([e,t])=>({key:e,value:Ye(t)})).filter(e=>e.value.trim().length>0)}catch{return[]}}function Ze(e){return e.replace(/\r\n/g,`
8
- `).split(`
9
- `).map(e=>e.match(/^([A-Za-z0-9_.-]+):\s*(.+)$/)).filter(e=>!!e).map(e=>({key:e[1]??``,value:e[2]?.replace(/^["']|["']$/g,``)??``})).filter(e=>e.key&&e.value.trim().length>0)}function Qe(e){let t=Xe(e);return t.length>0?t:Ze(e)}function $e(){return(0,W.jsxs)(`div`,{className:`space-y-4 p-5`,children:[(0,W.jsxs)(`section`,{className:`rounded-xl border border-border bg-card p-5`,children:[(0,W.jsx)(H,{className:`h-7 w-1/2`}),(0,W.jsx)(H,{className:`mt-3 h-4 w-3/4`}),(0,W.jsx)(H,{className:`mt-4 h-4 w-full`}),(0,W.jsx)(H,{className:`mt-3 h-4 w-2/3`})]}),(0,W.jsxs)(`section`,{className:`grid gap-4 lg:grid-cols-[minmax(220px,0.42fr)_minmax(0,1fr)]`,children:[(0,W.jsx)(H,{className:`h-56 rounded-xl`}),(0,W.jsx)(H,{className:`h-56 rounded-xl`})]})]})}function et({raw:e}){let t=Qe(e);return t.length===0?(0,W.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words font-mono text-xs leading-6`,children:e}):(0,W.jsx)(`dl`,{className:`m-0`,children:t.map(e=>(0,W.jsxs)(`div`,{className:`grid grid-cols-[minmax(104px,0.34fr)_minmax(0,1fr)] gap-3 border-b border-border/70 py-2 last:border-b-0`,children:[(0,W.jsx)(`dt`,{className:`break-words font-semibold text-primary`,children:e.key}),(0,W.jsx)(`dd`,{className:`m-0 break-words text-card-foreground`,children:e.value})]},e.key))})}function tt({title:e,children:t}){return(0,W.jsxs)(`article`,{className:`overflow-hidden rounded-xl border border-border bg-card shadow-sm`,children:[(0,W.jsx)(`h2`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-sm font-semibold text-card-foreground`,children:e}),(0,W.jsx)(`div`,{className:`p-4 text-sm leading-7 text-card-foreground`,children:t})]})}function nt(){return(0,W.jsx)(`div`,{className:`flex h-full items-center justify-center bg-background p-6 text-center text-muted-foreground`,children:(0,W.jsxs)(`div`,{className:`max-w-sm`,children:[(0,W.jsx)(P,{className:`mx-auto mb-3 h-7 w-7 text-muted-foreground`}),(0,W.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:D(`marketplaceDetailUnavailableTitle`)}),(0,W.jsx)(`p`,{className:`mt-2 text-sm leading-6`,children:D(`marketplaceDetailUnavailableDescription`)})]})})}function rt({entry:e}){let t=e.metadataRaw?.trim()||`-`,n=e.contentRaw?.trim()||`-`,r=e.summary?.trim(),i=e.description?.trim(),a=!!i&&i!==r;return(0,W.jsx)(`main`,{className:`h-full overflow-auto bg-background text-foreground custom-scrollbar`,children:(0,W.jsxs)(`div`,{className:`mx-auto max-w-[940px] space-y-4 p-5 pb-9`,children:[(0,W.jsxs)(`section`,{className:`rounded-xl border border-border bg-card p-5 shadow-sm`,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,W.jsx)(`div`,{className:`mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-border bg-muted text-primary`,children:(0,W.jsx)(be,{className:`h-4 w-4`})}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`h1`,{className:`break-words text-2xl font-semibold leading-tight text-foreground`,children:e.title}),(0,W.jsxs)(`p`,{className:`mt-2 break-words text-xs text-muted-foreground`,children:[e.typeLabel,` · `,e.spec,e.author?` · ${e.author}`:``]})]})]}),r?(0,W.jsx)(`p`,{className:`mt-4 text-sm leading-7 text-card-foreground`,children:r}):null,a?(0,W.jsx)(`p`,{className:`mt-3 text-sm leading-7 text-card-foreground`,children:i}):null,e.tags&&e.tags.length>0?(0,W.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:e.tags.map(e=>(0,W.jsx)(`span`,{className:`rounded-full border border-border bg-muted px-3 py-1 text-xs text-muted-foreground`,children:e},e))}):null,e.sourceUrl?(0,W.jsxs)(`p`,{className:`mt-4 break-all text-xs text-muted-foreground`,children:[e.sourceLabel??D(`marketplaceDetailSource`),`: `,` `,(0,W.jsx)(`a`,{href:e.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-primary hover:underline`,children:e.sourceUrl})]}):null]}),(0,W.jsxs)(`section`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(300px,100%),1fr))] gap-4`,children:[(0,W.jsx)(tt,{title:D(`marketplaceDetailMetadata`),children:(0,W.jsx)(et,{raw:t})}),(0,W.jsx)(tt,{title:D(`marketplaceDetailContent`),children:(0,W.jsx)(`div`,{className:`marketplace-detail-markdown space-y-3 text-sm leading-7 text-card-foreground [&_a]:font-medium [&_a]:text-primary [&_a:hover]:underline`,children:Je(n)})})]})]})})}function it({currentUrl:e}){let t=Be(e),n=Fe(t);return t?!n||n.status===`loading`?(0,W.jsx)($e,{}):n.status===`error`&&!n.contentRaw?(0,W.jsx)(nt,{}):(0,W.jsx)(rt,{entry:n}):(0,W.jsx)(nt,{})}var at={[Ie]:{getTitle:e=>e.title,renderContent:({currentUrl:e})=>(0,W.jsx)(it,{currentUrl:e}),renderIcon:()=>(0,W.jsx)(be,{className:`h-4 w-4 text-primary`})}},ot=160;function st({disabled:e,onLoadMore:t,thresholdPx:n=ot,watchValue:r}){let i=(0,U.useRef)(null),a=(0,U.useRef)(null),o=(0,U.useRef)(t),s=(0,U.useRef)(!1);return(0,U.useEffect)(()=>{o.current=t},[t]),(0,U.useEffect)(()=>{e&&(s.current=!1)},[e]),(0,U.useEffect)(()=>{let t=i.current,r=a.current;if(e||!t||!r)return;let c=()=>{s.current||e||(s.current=!0,Promise.resolve(o.current()).finally(()=>{s.current=!1}))},l=()=>{r.getBoundingClientRect().top-t.getBoundingClientRect().bottom<=n&&c()};if(typeof IntersectionObserver==`function`){let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&c()},{root:t,rootMargin:`0px 0px ${n}px 0px`});return e.observe(r),l(),()=>{e.disconnect()}}return t.addEventListener(`scroll`,l,{passive:!0}),l(),()=>{t.removeEventListener(`scroll`,l)}},[e,n,r]),{containerRef:i,sentinelRef:a}}function ct(e){return(e??``).trim().toLowerCase()}function lt(e){let t=new Map;for(let n of e){let e=[n.catalogSlug,n.spec,n.id,n.label];for(let r of e){let e=ct(r);!e||t.has(e)||t.set(e,n)}}return t}function ut(e,t){let n=[e.slug,e.install.spec,e.id,e.name];for(let e of n){let n=ct(e);if(!n)continue;let r=t.get(n);if(r)return r}}function dt(e,t,n){return Ae(t?.summaryI18n,t?.summary,e)||je(n,e)||D(`marketplaceInstalledLocalSummary`)}function ft(e,t){return t?.transport?t.transport.toUpperCase():(e?.install?.transportTypes??[]).map(e=>e.toUpperCase()).join(` / `)||`MCP`}function pt(e){let{item:t,record:n,localeFallbacks:r,onOpen:i,onInstall:a,onToggle:o,onDoctor:s,onRemove:c}=e,l=n,u=t?.name??n?.label??n?.id??`MCP`,d=dt(r,t,n),f=ft(t,n),p=l?l.enabled===!1?D(`marketplaceDisable`):D(`statusReady`):null;return(0,W.jsx)(`article`,{onClick:i,className:`cursor-pointer rounded-2xl border border-gray-200/70 bg-white p-4 shadow-sm transition hover:border-blue-300 hover:shadow-md`,children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:u}),(0,W.jsx)(`div`,{className:`mt-1 text-xs text-gray-500`,children:f}),(0,W.jsx)(`div`,{className:`mt-2 line-clamp-2 text-sm text-gray-600`,children:d}),(0,W.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(t?.tags??[]).map(e=>(0,W.jsx)(me,{children:e},e)),p?(0,W.jsx)(me,{tone:`success`,children:p}):null]})]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2`,children:[!l&&t&&a?(0,W.jsx)(y,{type:`button`,size:`sm`,variant:`primary`,className:`rounded-xl`,onClick:e=>{e.stopPropagation(),a()},children:D(`marketplaceInstall`)}):null,l?(0,W.jsxs)(W.Fragment,{children:[o?(0,W.jsx)(y,{type:`button`,size:`sm`,variant:`outline`,className:`rounded-xl border-gray-200 text-gray-700`,onClick:e=>{e.stopPropagation(),o()},children:l.enabled===!1?D(`marketplaceEnable`):D(`marketplaceDisable`)}):null,s?(0,W.jsx)(y,{type:`button`,size:`sm`,variant:`outline`,className:`rounded-xl border-blue-200 text-blue-700 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-700`,onClick:e=>{e.stopPropagation(),s()},children:D(`marketplaceMcpDoctor`)}):null,c?(0,W.jsx)(y,{type:`button`,size:`sm`,variant:`outline`,className:`rounded-xl border-rose-200 text-rose-600 hover:border-rose-300 hover:bg-rose-50 hover:text-rose-600`,onClick:e=>{e.stopPropagation(),c()},children:D(`marketplaceMcpRemove`)}):null]}):null]})]})})}var mt=re,ht=ne,gt=U.forwardRef(({className:e,...t},n)=>(0,W.jsx)(ue,{ref:n,"data-theme-overlay":`modal-backdrop`,className:i(`fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/35 backdrop-blur-[1px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));gt.displayName=ue.displayName;var _t=b(`fixed z-[var(--z-modal,10050)] bg-background shadow-2xl transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),Z=U.forwardRef(({children:e,className:t,closeLabel:n=`Close`,side:r,...a},o)=>(0,W.jsxs)(ht,{children:[(0,W.jsx)(gt,{}),(0,W.jsxs)(z,{ref:o,"data-theme-overlay":`sheet`,className:i(_t({side:r}),t),...a,children:[e,(0,W.jsxs)(ce,{className:`absolute right-4 top-4 rounded-lg p-1.5 text-muted-foreground opacity-75 transition-colors hover:bg-muted hover:text-foreground hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:pointer-events-none`,children:[(0,W.jsx)(L,{className:`h-4 w-4`}),(0,W.jsx)(`span`,{className:`sr-only`,children:n})]})]})]}));Z.displayName=z.displayName;function vt({className:e,...t}){return(0,W.jsx)(`div`,{className:i(`flex flex-col space-y-2 text-left`,e),...t})}vt.displayName=`SheetHeader`;function yt({className:e,...t}){return(0,W.jsx)(`div`,{className:i(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}yt.displayName=`SheetFooter`;var bt=U.forwardRef(({className:e,...t},n)=>(0,W.jsx)(oe,{ref:n,className:i(`text-lg font-semibold tracking-tight text-foreground`,e),...t}));bt.displayName=oe.displayName;var xt=U.forwardRef(({className:e,...t},n)=>(0,W.jsx)(V,{ref:n,className:i(`text-sm leading-relaxed text-muted-foreground`,e),...t}));xt.displayName=V.displayName;var Q=U.forwardRef(({className:e,...t},n)=>(0,W.jsx)(`textarea`,{className:i(`flex min-h-28 w-full rounded-xl border border-border/75 bg-card px-3.5 py-2.5 text-sm text-foreground placeholder:text-muted-foreground/55 placeholder:font-normal transition-colors focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));Q.displayName=`Textarea`;function St({open:e,testing:t,saving:n,onOpenChange:r,onTest:i,onSave:a}){let[o,s]=(0,U.useState)(`stdio`),[l,u]=(0,U.useState)(``),[d,f]=(0,U.useState)(``),[p,m]=(0,U.useState)(``),[h,ee]=(0,U.useState)(``),[_,v]=(0,U.useState)(``),[b,x]=(0,U.useState)(``),[S,C]=(0,U.useState)(``),[w,T]=(0,U.useState)(`15000`),[E,O]=(0,U.useState)(!0),[k,A]=(0,U.useState)(null),[j,M]=(0,U.useState)(null),N=(0,U.useMemo)(()=>Ct({transport:o,name:l,command:d,args:p,cwd:h,env:_,url:b,headers:S,timeout:w,verifyTls:E}),[p,d,h,_,S,l,w,o,b,E]),P=()=>{A(null),M(null)},F=async()=>{if(N instanceof Error)return M(N.message);P();try{let e=await i(N);A(e),e.accessible||M(e.error??D(`mcpConnectionTestFailed`))}catch(e){M(e instanceof Error?e.message:String(e))}},te=async()=>{if(!(N instanceof Error||!k?.accessible))try{await a(N),r(!1),P()}catch(e){M(e instanceof Error?e.message:String(e))}};return(0,W.jsx)(mt,{open:e,onOpenChange:r,children:(0,W.jsxs)(Z,{side:`right`,closeLabel:D(`cancel`),className:`flex h-full w-full flex-col overflow-hidden p-0 sm:max-w-[560px]`,children:[(0,W.jsxs)(vt,{className:`shrink-0 border-b border-border/60 px-5 pb-5 pt-6 pr-14 sm:px-7 sm:pt-7`,children:[(0,W.jsx)(bt,{children:D(`mcpConnectionTitle`)}),(0,W.jsx)(xt,{children:D(`mcpConnectionDescription`)})]}),(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-6 sm:px-7`,children:[(0,W.jsx)($,{label:D(`mcpConnectionTransport`),children:(0,W.jsxs)(`select`,{className:`flex h-10 w-full rounded-xl border border-border/75 bg-card px-3 text-sm`,value:o,onChange:e=>{s(e.target.value),P()},children:[(0,W.jsx)(`option`,{value:`stdio`,children:D(`mcpConnectionStdio`)}),(0,W.jsx)(`option`,{value:`http`,children:`HTTP`}),(0,W.jsx)(`option`,{value:`sse`,children:`SSE`})]})}),(0,W.jsx)($,{label:D(`mcpConnectionName`),children:(0,W.jsx)(c,{value:l,onChange:e=>{u(e.target.value),P()},placeholder:`my-mcp`})}),o===`stdio`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)($,{label:D(`mcpConnectionCommand`),children:(0,W.jsx)(c,{value:d,onChange:e=>{f(e.target.value),P()},placeholder:`npx`})}),(0,W.jsx)($,{label:D(`mcpConnectionArgs`),hint:D(`mcpConnectionArgsHint`),children:(0,W.jsx)(c,{value:p,onChange:e=>{m(e.target.value),P()},placeholder:`-y @example/mcp-server`})}),(0,W.jsx)($,{label:D(`mcpConnectionCwd`),children:(0,W.jsx)(c,{value:h,onChange:e=>{ee(e.target.value),P()}})}),(0,W.jsx)($,{label:D(`mcpConnectionEnv`),hint:D(`mcpConnectionPairsHint`),children:(0,W.jsx)(Q,{className:`min-h-20 font-mono`,value:_,onChange:e=>{v(e.target.value),P()},placeholder:`API_KEY=...`})}),(0,W.jsx)(`p`,{className:`rounded-xl bg-amber-500/10 px-3 py-2 text-sm text-amber-900 dark:text-amber-100`,children:D(`mcpConnectionLocalWarning`)})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)($,{label:D(`mcpConnectionUrl`),children:(0,W.jsx)(c,{type:`url`,value:b,onChange:e=>{x(e.target.value),P()},placeholder:`https://example.com/mcp`})}),(0,W.jsx)($,{label:D(`mcpConnectionHeaders`),hint:D(`mcpConnectionPairsHint`),children:(0,W.jsx)(Q,{className:`min-h-20 font-mono`,value:S,onChange:e=>{C(e.target.value),P()},placeholder:`Authorization=Bearer ...`})}),(0,W.jsx)($,{label:D(`mcpConnectionTimeout`),children:(0,W.jsx)(c,{type:`number`,min:`1`,value:w,onChange:e=>{T(e.target.value),P()}})}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-muted/60 px-3 py-3`,children:[(0,W.jsx)(`span`,{className:`text-sm`,children:D(`mcpConnectionVerifyTls`)}),(0,W.jsx)(g,{checked:E,onCheckedChange:e=>{O(e),P()}})]}),(0,W.jsx)(`p`,{className:`rounded-xl bg-muted px-3 py-2 text-sm text-muted-foreground`,children:D(`mcpConnectionRemoteWarning`)})]}),k?.accessible?(0,W.jsx)(`p`,{className:`rounded-xl bg-emerald-500/10 px-3 py-2 text-sm text-emerald-800 dark:text-emerald-100`,children:D(`mcpConnectionTestSuccess`).replace(`{count}`,String(k.toolCount))}):null,j?(0,W.jsx)(`p`,{role:`alert`,className:`rounded-xl bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:j}):null]}),(0,W.jsxs)(yt,{className:`shrink-0 border-t border-border/60 bg-background px-5 py-4 sm:px-7`,children:[(0,W.jsx)(y,{type:`button`,variant:`outline`,onClick:()=>r(!1),disabled:t||n,children:D(`cancel`)}),(0,W.jsx)(y,{type:`button`,variant:`outline`,onClick:()=>void F(),disabled:t||n,children:D(t?`mcpConnectionTesting`:`mcpConnectionTest`)}),(0,W.jsx)(y,{type:`button`,onClick:()=>void te(),disabled:!k?.accessible||t||n,children:D(n?`saving`:`mcpConnectionSave`)})]})]})})}function $({label:e,hint:t,children:n}){return(0,W.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:e}),t?(0,W.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:t}):null,n]})}function Ct(e){try{let t=e.name.trim();if(!t)throw Error(D(`mcpConnectionNameRequired`));if(e.transport===`stdio`){let n=e.command.trim();if(!n)throw Error(D(`mcpConnectionCommandRequired`));return{name:t,definition:{enabled:!0,transport:{type:`stdio`,command:n,args:e.args.trim()?e.args.trim().split(/\s+/):[],cwd:e.cwd.trim(),env:wt(e.env),stderr:`pipe`},scope:{allAgents:!0,agents:[]},policy:{trust:`explicit`,start:`eager`}}}}let n=e.url.trim();if(!n)throw Error(D(`mcpConnectionUrlRequired`));let r=Number(e.timeout);if(!Number.isFinite(r)||r<=0)throw Error(D(`mcpConnectionTimeoutInvalid`));let i={url:n,headers:wt(e.headers),timeoutMs:Math.trunc(r),verifyTls:e.verifyTls};return{name:t,definition:{enabled:!0,transport:e.transport===`http`?{type:`http`,...i}:{type:`sse`,...i,reconnect:{enabled:!0,initialDelayMs:1e3,maxDelayMs:3e4}},scope:{allAgents:!0,agents:[]},policy:{trust:`explicit`,start:`eager`}}}}catch(e){return e instanceof Error?e:Error(String(e))}}function wt(e){return Object.fromEntries(e.split(`
10
- `).filter(Boolean).map(e=>{let t=e.indexOf(`=`);if(t<=0)throw Error(D(`mcpConnectionPairsInvalid`));return[e.slice(0,t).trim(),e.slice(t+1)]}))}function Tt(e){let{item:t,open:n,pending:r,onOpenChange:i,onSubmit:a}=e;return(0,W.jsx)(le,{open:n,onOpenChange:i,children:t?(0,W.jsx)(Et,{item:t,pending:r,onOpenChange:i,onSubmit:a},`${t.slug}:${n?`open`:`closed`}`):null})}function Et(e){let{item:t,pending:n,onOpenChange:r,onSubmit:i}=e,a=t.install,[o,s]=(0,U.useState)(a?.defaultName??``),[l,u]=(0,U.useState)(!0),[d,f]=(0,U.useState)(Object.fromEntries((a?.inputs??[]).map(e=>[e.id,e.defaultValue??``])));return(0,W.jsxs)(ie,{children:[(0,W.jsxs)(R,{children:[(0,W.jsx)(ae,{children:D(`marketplaceMcpInstallDialogTitle`)}),(0,W.jsx)(se,{children:t.name})]}),(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-gray-800`,children:D(`marketplaceMcpServerName`)}),(0,W.jsx)(c,{value:o,onChange:e=>s(e.target.value),placeholder:a?.defaultName??`mcp-server`})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl border border-gray-200 px-3 py-3`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:D(`marketplaceMcpAllAgents`)}),(0,W.jsx)(`div`,{className:`text-xs text-gray-500`,children:D(`marketplaceMcpAllAgentsDescription`)})]}),(0,W.jsx)(g,{checked:l,onCheckedChange:u})]}),(a?.inputs??[]).map(e=>(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-gray-800`,children:e.label}),e.description?(0,W.jsx)(`div`,{className:`text-xs text-gray-500`,children:e.description}):null,(0,W.jsx)(c,{type:e.secret?`password`:`text`,value:d[e.id]??``,onChange:t=>f(n=>({...n,[e.id]:t.target.value})),placeholder:e.defaultValue??``})]},e.id))]}),(0,W.jsxs)(B,{children:[(0,W.jsx)(y,{variant:`outline`,onClick:()=>r(!1),disabled:n,children:D(`cancel`)}),(0,W.jsx)(y,{onClick:()=>void i({name:o,allAgents:l,inputs:d}),disabled:n||!o.trim(),children:D(n?`marketplaceInstalling`:`marketplaceInstall`)})]})]})}function Dt(e){let{result:t,targetName:n,open:r,pending:i,onOpenChange:a}=e;return(0,W.jsx)(le,{open:r,onOpenChange:a,children:(0,W.jsxs)(ie,{children:[(0,W.jsxs)(R,{children:[(0,W.jsx)(ae,{children:D(`marketplaceMcpDoctorTitle`)}),(0,W.jsx)(se,{children:n??`-`})]}),i?(0,W.jsx)(`div`,{className:`text-sm text-gray-500`,children:D(`loading`)}):null,!i&&t?(0,W.jsxs)(`div`,{className:`space-y-3 text-sm text-gray-700`,children:[(0,W.jsxs)(`div`,{children:[D(`marketplaceMcpDoctorAccessible`),`:`,` `,t.accessible?D(`statusReady`):D(`marketplaceOperationFailed`)]}),(0,W.jsxs)(`div`,{children:[D(`marketplaceMcpDoctorTransport`),`:`,` `,t.transport.toUpperCase()]}),(0,W.jsxs)(`div`,{children:[D(`marketplaceMcpDoctorTools`),`: `,t.toolCount]}),t.error?(0,W.jsx)(G,{tone:`danger`,description:t.error,className:`rounded-lg`}):null]}):null]})})}function Ot(e){let t=ge({queryKey:[`marketplace-mcp-items`,e],initialPageParam:1,queryFn:({pageParam:t})=>l({...e,page:t}),getNextPageParam:e=>e.page<e.totalPages?e.page+1:void 0,staleTime:15e3}),n=(0,U.useMemo)(()=>Te(t.data),[t.data]);return{...t,data:n}}function kt(){return x({queryKey:[`marketplace-mcp-installed`],queryFn:()=>C(),staleTime:1e4})}function At(){let e=S();return E({mutationFn:v,onSuccess:t=>{e.invalidateQueries({queryKey:[`marketplace-mcp-installed`]}),e.invalidateQueries({queryKey:[`marketplace-mcp-items`]}),e.invalidateQueries({queryKey:[`marketplace-mcp-doctor`]}),w.success(t.message||D(`marketplaceInstallSuccessMcp`))},onError:e=>{w.error(e.message||D(`marketplaceInstallFailed`))}})}function jt(){let e=S();return E({mutationFn:_,onSuccess:t=>{e.invalidateQueries({queryKey:[`marketplace-mcp-installed`]}),e.invalidateQueries({queryKey:[`marketplace-mcp-items`]}),e.invalidateQueries({queryKey:[`marketplace-mcp-doctor`]}),w.success(t.message||D(`marketplaceMcpManageSuccess`))},onError:e=>{w.error(e.message||D(`marketplaceOperationFailed`))}})}var Mt=12;function Nt(){let[e,t]=(0,U.useState)(`catalog`),[n,r]=(0,U.useState)(``),[a,o]=(0,U.useState)(``),[c,l]=(0,U.useState)(`relevance`),[d,f]=(0,U.useState)(null),[p,g]=(0,U.useState)(null),[_,v]=(0,U.useState)(null),[b,x]=(0,U.useState)(!1),{language:S}=de(),C=pe(),{confirm:w,ConfirmDialog:T}=we(),O=(0,U.useMemo)(()=>ke(S),[S]);(0,U.useEffect)(()=>{let e=window.setTimeout(()=>{o(n.trim())},250);return()=>window.clearTimeout(e)},[n]);let k=Ot({q:a||void 0,sort:c,pageSize:Mt}),A=kt(),{containerRef:j,sentinelRef:M}=st({disabled:e!==`catalog`||k.isError||!k.hasNextPage||k.isFetchingNextPage,onLoadMore:()=>k.fetchNextPage(),watchValue:`${e}:${a}:${c}:${k.data?.loadedItems??0}:${k.data?.loadedPages??0}`});(0,U.useEffect)(()=>{let e=j.current;e&&typeof e.scrollTo==`function`&&e.scrollTo({top:0})},[j,a,e,c]);let N=At(),P=jt(),F=E({mutationFn:s,onSuccess:(e,t)=>{g(t),v(e)}}),I=E({mutationFn:ee}),L=E({mutationFn:h}),R=(0,U.useMemo)(()=>lt(A.data?.records??[]),[A.data?.records]),z=(0,U.useMemo)(()=>(A.data?.records??[]).filter(e=>{let t=[e.id??``,e.label??``,e.catalogSlug??``,e.description??``,e.descriptionZh??``].join(` `).toLowerCase();return a?t.includes(a.toLowerCase()):!0}),[A.data?.records,a]),ne=async(e,t)=>{let n=e?.name??t?.label??t?.id??`MCP`,r=Re(e?`mcp`:`mcp-local`,e?.slug??t?.id??t?.spec??n),i=dt(O,e,t);if(!e){Y(C,{id:r,title:n,typeLabel:D(`marketplaceTypeMcp`),spec:t?.spec??`-`,status:`ready`,summary:i,metadataRaw:JSON.stringify(t??{},null,2),contentRaw:D(`marketplaceInstalledLocalSummary`),sourceUrl:t?.docsUrl,sourceLabel:D(`marketplaceDetailSource`)});return}Y(C,{id:r,title:n,typeLabel:D(`marketplaceTypeMcp`),spec:e.install.spec,status:`loading`,summary:i,tags:e.tags,author:e.author});try{let t=await u(e.slug);Y(C,{id:r,title:n,typeLabel:D(`marketplaceTypeMcp`),spec:e.install.spec,status:`ready`,summary:i,metadataRaw:t.metadataRaw||JSON.stringify(e,null,2),contentRaw:t.bodyRaw||t.raw,sourceUrl:t.sourceUrl,sourceLabel:D(`marketplaceDetailSource`),tags:e.tags,author:e.author},{activate:!1})}catch(t){Y(C,{id:r,title:n,typeLabel:D(`marketplaceTypeMcp`),spec:e.install.spec,status:`error`,summary:i,metadataRaw:JSON.stringify({error:t instanceof Error?t.message:String(t)},null,2),contentRaw:i},{activate:!1})}},re=async e=>{d&&(await N.mutateAsync({spec:d.slug,name:e.name.trim(),allAgents:e.allAgents,inputs:e.inputs}),f(null))},B=async(e,t)=>{let n=t.id||t.spec;n&&(e===`remove`&&!await w({title:`${D(`marketplaceMcpRemoveTitle`)} ${n}?`,description:D(`marketplaceMcpRemoveDescription`),confirmLabel:D(`marketplaceMcpRemove`),variant:`destructive`})||await P.mutateAsync({action:e,id:n,spec:t.spec}))},V=[{id:`catalog`,label:D(`marketplaceMcpTabCatalog`),icon:te},{id:`installed`,label:D(`marketplaceMcpTabInstalled`),icon:xe,count:A.data?.total??0}];return(0,W.jsxs)(m,{title:D(`marketplaceMcpPageTitle`),description:D(`marketplaceMcpPageDescription`),layout:`split`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`div`,{className:`flex w-fit max-w-full items-center gap-1 rounded-xl bg-muted/60 p-1`,children:V.map(n=>{let r=e===n.id,a=n.icon;return(0,W.jsxs)(`button`,{onClick:()=>t(n.id),className:i(`relative flex min-w-0 items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,r?`bg-card text-foreground shadow-sm`:`text-muted-foreground hover:bg-card/60 hover:text-foreground`),children:[(0,W.jsx)(a,{className:`h-4 w-4 shrink-0`}),n.label,n.id===`installed`&&typeof n.count==`number`&&(0,W.jsx)(`span`,{className:i(`flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-[11px] font-semibold`,r?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`),children:n.count})]},n.id)})}),(0,W.jsx)(`div`,{className:`w-full max-w-xl`,children:(0,W.jsx)(Ee,{scope:e===`catalog`?`all`:`installed`,searchText:n,isRefreshing:!1,searchPlaceholder:D(`marketplaceMcpSearchPlaceholder`),sort:c,onSearchTextChange:r,onSortChange:l})})]}),(0,W.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center justify-between px-1`,children:[(0,W.jsxs)(`h3`,{className:`flex items-center gap-2 text-base font-semibold text-foreground`,children:[D(e===`catalog`?`marketplaceMcpSectionCatalog`:`marketplaceMcpSectionInstalled`),(0,W.jsx)(`span`,{className:`flex h-6 items-center justify-center rounded-lg bg-muted px-2 text-xs font-medium text-muted-foreground`,children:e===`catalog`?k.data?.total??0:A.data?.total??0})]}),(0,W.jsx)(y,{type:`button`,size:`sm`,onClick:()=>x(!0),children:D(`mcpConnectionOpen`)})]}),(0,W.jsxs)(`div`,{ref:j,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto pb-8`,"aria-busy":k.isLoading||k.isFetchingNextPage,children:[(0,W.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,280px),1fr))] items-stretch gap-4`,children:[e===`catalog`&&k.isLoading&&(0,W.jsx)(De,{count:Mt}),e===`catalog`&&!k.isLoading&&(k.data?.items??[]).map(e=>{let t=ut(e,R);return(0,W.jsx)(pt,{item:e,record:t,localeFallbacks:O,onOpen:()=>void ne(e,t),onInstall:()=>f(e),onToggle:t?()=>void B(t.enabled===!1?`enable`:`disable`,t):void 0,onDoctor:t?()=>{g(t.id??null),v(null),F.mutateAsync(t.id??``)}:void 0,onRemove:t?()=>void B(`remove`,t):void 0},e.id)}),e===`installed`&&z.map(e=>(0,W.jsx)(pt,{record:e,localeFallbacks:O,onOpen:()=>void ne(void 0,e),onToggle:()=>void B(e.enabled===!1?`enable`:`disable`,e),onDoctor:()=>{g(e.id??null),v(null),F.mutateAsync(e.id??``)},onRemove:()=>void B(`remove`,e)},e.id??e.spec))]}),e===`catalog`&&k.isError&&(0,W.jsx)(G,{tone:`danger`,title:D(`marketplaceMcpSectionCatalog`),description:k.error.message}),e===`installed`&&A.isError&&(0,W.jsx)(G,{tone:`danger`,title:D(`marketplaceMcpSectionInstalled`),description:A.error.message}),e===`catalog`&&!k.isLoading&&!k.isError&&(k.data?.items?.length??0)===0&&(0,W.jsx)(`div`,{className:`mt-4 flex flex-col items-center justify-center rounded-2xl bg-muted/35 py-16`,children:(0,W.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:D(`marketplaceNoMcp`)})}),e===`installed`&&!A.isError&&z.length===0&&(0,W.jsx)(`div`,{className:`mt-4 flex flex-col items-center justify-center rounded-2xl bg-muted/35 py-16`,children:(0,W.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:D(`marketplaceNoInstalledMcp`)})}),e===`catalog`&&!k.isError&&(0,W.jsx)(Oe,{hasMore:!!k.hasNextPage,loading:k.isFetchingNextPage,sentinelRef:M})]})]}),(0,W.jsx)(Tt,{item:d,open:!!d,pending:N.isPending,onOpenChange:e=>!e&&f(null),onSubmit:re}),(0,W.jsx)(St,{open:b,testing:I.isPending,saving:L.isPending,onOpenChange:x,onTest:e=>I.mutateAsync(e),onSave:async e=>{await L.mutateAsync(e)}}),(0,W.jsx)(Dt,{open:!!p,targetName:p,result:_,pending:F.isPending,onOpenChange:e=>!e&&g(null)}),(0,W.jsx)(T,{})]})}export{ge as C,G as S,Oe as _,xt as a,we as b,bt as c,Re as d,Y as f,Ee as g,Ae as h,Z as i,st as l,ke as m,Q as n,yt as o,Me as p,mt as r,vt as s,Nt as t,at as u,De as v,be as x,Te as y};
@@ -1 +0,0 @@
1
- import{t as e}from"./mcp-marketplace-page-FfIfEo6w.js";export{e as McpMarketplacePage};
@@ -1 +0,0 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n}from"./utils-CBZPzC_b.js";import{t as r}from"./navigation-link-BAQjgx2F.js";import{Gt as i,Jt as a,Kt as o,Qt as s,Wt as c,Yt as l,qt as u}from"./api-DqzQ-_3w.js";import{s as d}from"./i18n-20rSH40D.js";import{t as f}from"./book-open-xqEj1OLE.js";import{t as p}from"./provider-scoped-model-input-BQsugx1v.js";import{t as m}from"./loader-circle-K1BDdHR5.js";import{t as h}from"./skeleton-Drvn83YW.js";import{m as g}from"./doc-browser-context-TILuCY5c.js";import{n as _}from"./provider-models-hrHMcHqg.js";import{_ as v,f as y,p as b,r as x,t as S}from"./use-config-BEdbtpD4.js";import{t as C}from"./form-actions-BRESe-m_.js";import{t as w}from"./config-hints-B_C9DAp5.js";var T=e(n(),1),E=t(),D=`provider/model`;function O(e){let{initialModel:t,initialWorkspace:n,isPending:s,modelHelpText:h,modelPlaceholder:_,onSubmit:v,providerCatalog:y,workspacePlaceholder:b}=e,[x,S]=(0,T.useState)(t),[w,D]=(0,T.useState)(n);return(0,E.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),v({model:x,workspace:w})},className:`space-y-5`,children:[(0,E.jsx)(a,{children:(0,E.jsxs)(u,{children:[(0,E.jsx)(o,{title:d(`defaultModel`),description:h,layout:`stacked`,children:(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsx)(c,{htmlFor:`model`,className:`sr-only`,children:d(`defaultModel`)}),(0,E.jsx)(p,{id:`model`,value:x,onChange:S,providerCatalog:y,modelPlaceholder:_}),(0,E.jsx)(r,{href:g(`/guide/model-selection`),external:!0,icon:f,size:`xs`,children:d(`channelsGuideTitle`)})]})}),(0,E.jsx)(o,{title:d(`workspace`),layout:`stacked`,children:(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsx)(c,{htmlFor:`workspace`,className:`sr-only`,children:d(`workspace`)}),(0,E.jsx)(i,{id:`workspace`,value:w,onChange:e=>D(e.target.value),placeholder:b,className:`rounded-xl`})]})})]})}),(0,E.jsx)(C,{children:(0,E.jsx)(l,{type:`submit`,disabled:s,size:`sm`,children:s?(0,E.jsx)(m,{className:`h-3.5 w-3.5 animate-spin`}):d(`saveChanges`)})})]})}function k(){let{data:e,isLoading:t}=S(),{data:n}=b(),{data:r}=y(),{data:i}=x(),a=v(),o=i?.uiHints,c=w(`agents.defaults.model`,o),l=w(`agents.defaults.workspace`,o),u=(0,T.useMemo)(()=>_({providersView:n,templatesView:r,config:e,onlyConfigured:!0}),[e,n,r]),f=d(`modelIdentifierHelp`)||c?.help||``,p=(e?.agents?.defaults?.model||``).trim(),m=e?.agents?.defaults?.workspace||``;return t?(0,E.jsx)(s,{title:d(`modelPageTitle`),description:d(`modelPageDescription`),children:(0,E.jsxs)(`div`,{className:`divide-y divide-border/55 overflow-hidden rounded-2xl bg-muted/45`,children:[(0,E.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,E.jsx)(h,{className:`h-5 w-24`}),(0,E.jsx)(h,{className:`h-10 w-full rounded-xl`})]}),(0,E.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,E.jsx)(h,{className:`h-5 w-24`}),(0,E.jsx)(h,{className:`h-10 w-full rounded-xl`})]})]})}):(0,E.jsx)(s,{title:d(`modelPageTitle`),description:d(`modelPageDescription`),children:(0,E.jsx)(O,{initialModel:p,initialWorkspace:m,isPending:a.isPending,modelHelpText:f,modelPlaceholder:c?.placeholder??D,onSubmit:({model:e,workspace:t})=>a.mutate({model:e,workspace:t}),providerCatalog:u,workspacePlaceholder:l?.placeholder??`/path/to/workspace`},`${p}::${m}`)})}export{k as ModelConfigPage};
@@ -1,3 +0,0 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,t as r}from"./utils-CBZPzC_b.js";import{t as i}from"./preload-helper-ca-nBW7U.js";import{t as a}from"./createLucideIcon-BNKf0_kc.js";import{t as o}from"./host-capabilities-B107nwS3.js";var s=e(n(),1),c=`popstate`;function l(e={}){let{initialEntries:t=[`/`],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((e,t)=>u(e,typeof e==`string`?null:e.state,t===0?`default`:void 0));let a=c(n??i.length-1),o=`POP`,s=null;function c(e){return Math.min(Math.max(e,0),i.length-1)}function l(){return i[a]}function u(e,t=null,n){let r=h(i?l().pathname:`/`,e,t,n);return f(r.pathname.charAt(0)===`/`,`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),r}function d(e){return typeof e==`string`?e:g(e)}return{get index(){return a},get action(){return o},get location(){return l()},createHref:d,createURL(e){return new URL(d(e),`http://localhost`)},encodeLocation(e){let t=typeof e==`string`?_(e):e;return{pathname:t.pathname||``,search:t.search||``,hash:t.hash||``}},push(e,t){o=`PUSH`;let n=u(e,t);a+=1,i.splice(a,i.length,n),r&&s&&s({action:o,location:n,delta:1})},replace(e,t){o=`REPLACE`;let n=u(e,t);i[a]=n,r&&s&&s({action:o,location:n,delta:0})},go(e){o=`POP`;let t=c(a+e),n=i[t];a=t,s&&s({action:o,location:n,delta:e})},listen(e){return s=e,()=>{s=null}}}}function u(e={}){function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return h(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:g(t)}return v(t,n,null,e)}function d(e,t){if(e===!1||e==null)throw Error(t)}function f(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function p(){return Math.random().toString(36).substring(2,10)}function m(e,t){return{usr:e.state,key:e.key,idx:t}}function h(e,t,n=null,r){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?_(t):t,state:n,key:t&&t.key||r||p()}}function g({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function _(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function v(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,l=null,u=d();u??(u=0,o.replaceState({...o.state,idx:u},``));function d(){return(o.state||{idx:null}).idx}function f(){s=`POP`;let e=d(),t=e==null?null:e-u;u=e,l&&l({action:s,location:v.location,delta:t})}function p(e,t){s=`PUSH`;let r=h(v.location,e,t);n&&n(r,e),u=d()+1;let c=m(r,u),f=v.createHref(r);try{o.pushState(c,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&l&&l({action:s,location:v.location,delta:1})}function g(e,t){s=`REPLACE`;let r=h(v.location,e,t);n&&n(r,e),u=d();let i=m(r,u),c=v.createHref(r);o.replaceState(i,``,c),a&&l&&l({action:s,location:v.location,delta:0})}function _(e){return y(e)}let v={get action(){return s},get location(){return e(i,o)},listen(e){if(l)throw Error(`A history only accepts one active listener`);return i.addEventListener(c,f),l=e,()=>{i.removeEventListener(c,f),l=null}},createHref(e){return t(i,e)},createURL:_,encodeLocation(e){let t=_(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:p,replace:g,go(e){return o.go(e)}};return v}function y(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),d(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:g(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function b(e,t,n=`/`){return x(e,t,n,!1)}function x(e,t,n,r){let i=D((typeof t==`string`?_(t):t).pathname||`/`,n);if(i==null)return null;let a=C(e);T(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=de(i);o=le(a[e],t,r)}return o}function S(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function C(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;d(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=k([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(d(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),C(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:se(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of w(e.path))a(e,t,!0,n)}),t}function w(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=w(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function T(e){e.sort((e,t)=>e.score===t.score?ce(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ee=/^:[\w-]+$/,te=3,ne=2,re=1,ie=10,ae=-2,oe=e=>e===`*`;function se(e,t){let n=e.split(`/`),r=n.length;return n.some(oe)&&(r+=ae),t&&(r+=ne),n.filter(e=>!oe(e)).reduce((e,t)=>e+(ee.test(t)?te:t===``?re:ie),r)}function ce(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function le(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=E({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=E({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:k([a,u.pathname]),pathnameBase:ve(k([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=k([a,u.pathnameBase]))}return o}function E(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ue(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ue(e,t=!1,n=!0){f(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`)).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function de(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return f(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function D(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var fe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function pe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?_(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?me(n.substring(1),`/`):me(n,t)):a=t,{pathname:a,search:ye(r),hash:be(i)}}function me(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function he(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ge(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function O(e){let t=ge(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function _e(e,t,n,r=!1){let i;typeof e==`string`?i=_(e):(i={...e},d(!i.pathname||!i.pathname.includes(`?`),he(`?`,`pathname`,`search`,i)),d(!i.pathname||!i.pathname.includes(`#`),he(`#`,`pathname`,`hash`,i)),d(!i.search||!i.search.includes(`#`),he(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=pe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var k=e=>e.join(`/`).replace(/\/\/+/g,`/`),ve=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),ye=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,be=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,xe=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Se(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ce(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var we=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Te(e,t){let n=e;if(typeof n!=`string`||!fe.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(we)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=D(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{f(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ee=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ee);var De=[`GET`,...Ee];new Set(De);var A=s.createContext(null);A.displayName=`DataRouter`;var j=s.createContext(null);j.displayName=`DataRouterState`;var Oe=s.createContext(!1),ke=s.createContext({isTransitioning:!1});ke.displayName=`ViewTransition`;var Ae=s.createContext(new Map);Ae.displayName=`Fetchers`;var je=s.createContext(null);je.displayName=`Await`;var M=s.createContext(null);M.displayName=`Navigation`;var N=s.createContext(null);N.displayName=`Location`;var P=s.createContext({outlet:null,matches:[],isDataRoute:!1});P.displayName=`Route`;var Me=s.createContext(null);Me.displayName=`RouteError`;var Ne=`REACT_ROUTER_ERROR`,Pe=`REDIRECT`,Fe=`ROUTE_ERROR_RESPONSE`;function Ie(e){if(e.startsWith(`${Ne}:${Pe}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Le(e){if(e.startsWith(`${Ne}:${Fe}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new xe(t.status,t.statusText,t.data)}catch{}}function Re(e,{relative:t}={}){d(F(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=s.useContext(M),{hash:i,pathname:a,search:o}=R(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:k([n,a])),r.createHref({pathname:c,search:o,hash:i})}function F(){return s.useContext(N)!=null}function I(){return d(F(),`useLocation() may be used only in the context of a <Router> component.`),s.useContext(N).location}var ze=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Be(e){s.useContext(M).static||s.useLayoutEffect(e)}function L(){let{isDataRoute:e}=s.useContext(P);return e?rt():Ve()}function Ve(){d(F(),`useNavigate() may be used only in the context of a <Router> component.`);let e=s.useContext(A),{basename:t,navigator:n}=s.useContext(M),{matches:r}=s.useContext(P),{pathname:i}=I(),a=JSON.stringify(O(r)),o=s.useRef(!1);return Be(()=>{o.current=!0}),s.useCallback((r,s={})=>{if(f(o.current,ze),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=_e(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:k([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}s.createContext(null);function He(){let{matches:e}=s.useContext(P),t=e[e.length-1];return t?t.params:{}}function R(e,{relative:t}={}){let{matches:n}=s.useContext(P),{pathname:r}=I(),i=JSON.stringify(O(n));return s.useMemo(()=>_e(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Ue(e,t){return We(e,t)}function We(e,t,n,r,i){d(F(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:a}=s.useContext(M),{matches:o}=s.useContext(P),c=o[o.length-1],l=c?c.params:{},u=c?c.pathname:`/`,p=c?c.pathnameBase:`/`,m=c&&c.route;{let e=m&&m.path||``;at(u,!m||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
-
3
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let h=I(),g;if(t){let e=typeof t==`string`?_(t):t;d(p===`/`||e.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${e.pathname}" was given in the \`location\` prop.`),g=e}else g=h;let v=g.pathname||`/`,y=v;if(p!==`/`){let e=p.replace(/^\//,``).split(`/`);y=`/`+v.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let x=b(e,{pathname:y});f(m||x!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),f(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=Xe(x&&x.map(e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:k([p,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?p:k([p,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),o,n,r,i);return t&&S?s.createElement(N.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,...g},navigationType:`POP`}},S):S}function Ge(){let e=nt(),t=Se(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=s.createElement(s.Fragment,null,s.createElement(`p`,null,`💿 Hey developer 👋`),s.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,s.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,s.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),s.createElement(s.Fragment,null,s.createElement(`h2`,null,`Unexpected Application Error!`),s.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?s.createElement(`pre`,{style:i},n):null,o)}var Ke=s.createElement(Ge,null),qe=class extends s.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Le(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:s.createElement(P.Provider,{value:this.props.routeContext},s.createElement(Me.Provider,{value:e,children:this.props.component}));return this.context?s.createElement(Je,{error:e},t):t}};qe.contextType=Oe;var z=new WeakMap;function Je({children:e,error:t}){let{basename:n}=s.useContext(M);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ie(t.digest);if(e){let r=z.get(t);if(r)throw r;let i=Te(e.location,n);if(we&&!z.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw z.set(t,n),n}return s.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Ye({routeContext:e,match:t,children:n}){let r=s.useContext(A);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),s.createElement(P.Provider,{value:e},n)}function Xe(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);d(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let c=!1,l=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){c=!0,a=l>=0?a.slice(0,l+1):[a[0]];break}}}let u=n&&r?(e,t)=>{r(e,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:Ce(n.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,i)=>{let d,f=!1,p=null,m=null;n&&(d=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||Ke,c&&(l<0&&i===0?(at(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):l===i&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,i+1)),g=()=>{let t;return t=d?p:f?m:r.route.Component?s.createElement(r.route.Component,null):r.route.element?r.route.element:e,s.createElement(Ye,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?s.createElement(qe,{location:n.location,revalidation:n.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function B(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ze(e){let t=s.useContext(A);return d(t,B(e)),t}function V(e){let t=s.useContext(j);return d(t,B(e)),t}function Qe(e){let t=s.useContext(P);return d(t,B(e)),t}function H(e){let t=Qe(e),n=t.matches[t.matches.length-1];return d(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function $e(){return H(`useRouteId`)}function et(){return V(`useNavigation`).navigation}function tt(){let{matches:e,loaderData:t}=V(`useMatches`);return s.useMemo(()=>e.map(e=>S(e,t)),[e,t])}function nt(){let e=s.useContext(Me),t=V(`useRouteError`),n=H(`useRouteError`);return e===void 0?t.errors?.[n]:e}function rt(){let{router:e}=Ze(`useNavigate`),t=H(`useNavigate`),n=s.useRef(!1);return Be(()=>{n.current=!0}),s.useCallback(async(r,i={})=>{f(n.current,ze),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var it={};function at(e,t,n){!t&&!it[e]&&(it[e]=!0,f(!1,n))}s.useOptimistic,s.memo(ot);function ot({routes:e,future:t,state:n,onError:r}){return We(e,void 0,n,r,t)}function st({basename:e,children:t,initialEntries:n,initialIndex:r,unstable_useTransitions:i}){let a=s.useRef();a.current??=l({initialEntries:n,initialIndex:r,v5Compat:!0});let o=a.current,[c,u]=s.useState({action:o.action,location:o.location}),d=s.useCallback(e=>{i===!1?u(e):s.startTransition(()=>u(e))},[i]);return s.useLayoutEffect(()=>o.listen(d),[o,d]),s.createElement(U,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:i})}function ct({to:e,replace:t,state:n,relative:r}){d(F(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=s.useContext(M);f(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=s.useContext(P),{pathname:o}=I(),c=L(),l=_e(e,O(a),o,r===`path`),u=JSON.stringify(l);return s.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function lt(e){d(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function U({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){d(!F(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=s.useMemo(()=>({basename:c,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[c,i,a,o]);typeof n==`string`&&(n=_(n));let{pathname:u=`/`,search:p=``,hash:m=``,state:h=null,key:g=`default`}=n,v=s.useMemo(()=>{let e=D(u,c);return e==null?null:{location:{pathname:e,search:p,hash:m,state:h,key:g},navigationType:r}},[c,u,p,m,h,g,r]);return f(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:s.createElement(M.Provider,{value:l},s.createElement(N.Provider,{children:t,value:v}))}function ut({children:e,location:t}){return Ue(W(e),t)}s.Component;function W(e,t=[]){let n=[];return s.Children.forEach(e,(e,r)=>{if(!s.isValidElement(e))return;let i=[...t,r];if(e.type===s.Fragment){n.push.apply(n,W(e.props.children,i));return}d(e.type===lt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),d(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=W(e.props.children,i)),n.push(a)}),n}var G=`get`,K=`application/x-www-form-urlencoded`;function q(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function dt(e){return q(e)&&e.tagName.toLowerCase()===`button`}function ft(e){return q(e)&&e.tagName.toLowerCase()===`form`}function pt(e){return q(e)&&e.tagName.toLowerCase()===`input`}function mt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ht(e,t){return e.button===0&&(!t||t===`_self`)&&!mt(e)}var J=null;function gt(){if(J===null)try{new FormData(document.createElement(`form`),0),J=!1}catch{J=!0}return J}var _t=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function vt(e){return e!=null&&!_t.has(e)?(f(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${K}"`),null):e}function yt(e,t){let n,r,i,a,o;if(ft(e)){let o=e.getAttribute(`action`);r=o?D(o,t):null,n=e.getAttribute(`method`)||G,i=vt(e.getAttribute(`enctype`))||K,a=new FormData(e)}else if(dt(e)||pt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?D(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||G,i=vt(e.getAttribute(`formenctype`))||vt(o.getAttribute(`enctype`))||K,a=new FormData(o,e),!gt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(q(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=G,r=null,i=K,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var bt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},xt=/[&><\u2028\u2029]/g;function St(e){return e.replace(xt,e=>bt[e])}function Ct(e,t){if(e===!1||e==null)throw Error(t)}function wt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&D(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function Tt(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Et(e){return e!=null&&typeof e.page==`string`}function Dt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ot(e,t,n){return Nt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Tt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Dt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function kt(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function At(e,t,{includeHydrateFallback:n}={}){return jt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function jt(e){return[...new Set(e)]}function Mt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Nt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Et(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Mt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Pt(){let e=s.useContext(A);return Ct(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Ft(){let e=s.useContext(j);return Ct(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Y=s.createContext(void 0);Y.displayName=`FrameworkContext`;function It(){let e=s.useContext(Y);return Ct(e,`You must render this element inside a <HydratedRouter> element`),e}function Lt(e,t){let n=s.useContext(Y),[r,i]=s.useState(!1),[a,o]=s.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=s.useRef(null);s.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),s.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:X(c,m),onBlur:X(l,h),onMouseEnter:X(u,m),onMouseLeave:X(d,h),onTouchStart:X(f,m)}]:[a,p,{}]:[!1,p,{}]}function X(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Rt({page:e,...t}){let{router:n}=Pt(),r=s.useMemo(()=>b(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?s.createElement(Bt,{page:e,matches:r,...t}):null}function zt(e){let{manifest:t,routeModules:n}=It(),[r,i]=s.useState([]);return s.useEffect(()=>{let r=!1;return Ot(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Bt({page:e,matches:t,...n}){let r=I(),{future:i,manifest:a,routeModules:o}=It(),{basename:c}=Pt(),{loaderData:l,matches:u}=Ft(),d=s.useMemo(()=>kt(e,t,u,a,r,`data`),[e,t,u,a,r]),f=s.useMemo(()=>kt(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let u=wt(e,c,i.unstable_trailingSlashAwareDataRequests,`data`);return s&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,i.unstable_trailingSlashAwareDataRequests,l,r,a,d,t,e,o]),m=s.useMemo(()=>At(f,a),[f,a]),h=zt(f);return s.createElement(s.Fragment,null,p.map(e=>s.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>s.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>s.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Vt(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}s.Component;var Ht=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Ht&&(window.__reactRouterVersion=`7.13.0`)}catch{}function Ut({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=s.useRef();i.current??=u({window:r,v5Compat:!0});let a=i.current,[o,c]=s.useState({action:a.action,location:a.location}),l=s.useCallback(e=>{n===!1?c(e):s.startTransition(()=>c(e))},[n]);return s.useLayoutEffect(()=>a.listen(l),[a,l]),s.createElement(U,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function Wt({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=s.useState({action:n.action,location:n.location}),o=s.useCallback(e=>{r===!1?a(e):s.startTransition(()=>a(e))},[r]);return s.useLayoutEffect(()=>n.listen(o),[n,o]),s.createElement(U,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Wt.displayName=`unstable_HistoryRouter`;var Gt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Z=s.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,state:o,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,unstable_useTransitions:g}=s.useContext(M),_=typeof l==`string`&&Gt.test(l),v=Te(l,h);l=v.to;let y=Re(l,{relative:r}),[b,x,S]=Lt(n,p),C=Qt(l,{replace:a,state:o,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:g});function w(t){e&&e(t),t.defaultPrevented||C(t)}let T=s.createElement(`a`,{...p,...S,href:v.absoluteURL||y,onClick:v.isExternal||i?e:w,ref:Vt(m,x),target:c,"data-discover":!_&&t===`render`?`true`:void 0});return b&&!_?s.createElement(s.Fragment,null,T,s.createElement(Rt,{page:y})):T});Z.displayName=`Link`;var Kt=s.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:c,...l},u){let d=R(a,{relative:l.relative}),f=I(),p=s.useContext(j),{navigator:m,basename:h}=s.useContext(M),g=p!=null&&cn(d)&&o===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=D(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof i==`function`?i(C):i;return s.createElement(Z,{...l,"aria-current":w,className:T,ref:u,style:ee,to:a,viewTransition:o},typeof c==`function`?c(C):c)});Kt.displayName=`NavLink`;var qt=s.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=G,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h)=>{let{unstable_useTransitions:g}=s.useContext(M),_=tn(),v=nn(c,{relative:u}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&Gt.test(c);return s.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,c=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:i,state:a,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p});g&&n!==!1?s.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});qt.displayName=`Form`;function Jt({getKey:e,storageKey:t,...n}){let r=s.useContext(Y),{basename:i}=s.useContext(M),a=I(),o=tt();on({getKey:e,storageKey:t});let c=s.useMemo(()=>{if(!r||!e)return null;let t=an(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return s.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${St(JSON.stringify(t||rn))}, ${St(JSON.stringify(c))})`}})}Jt.displayName=`ScrollRestoration`;function Yt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Xt(e){let t=s.useContext(A);return d(t,Yt(e)),t}function Zt(e){let t=s.useContext(j);return d(t,Yt(e)),t}function Qt(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=L(),d=I(),f=R(e,{relative:a});return s.useCallback(p=>{if(ht(p,t)){p.preventDefault();let t=n===void 0?g(d)===g(f):n,m=()=>u(e,{replace:t,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:c});l?s.startTransition(()=>m()):m()}},[d,u,f,n,r,t,e,i,a,o,c,l])}var $t=0,en=()=>`__${String(++$t)}__`;function tn(){let{router:e}=Xt(`useSubmit`),{basename:t}=s.useContext(M),n=$e(),r=e.fetch,i=e.navigate;return s.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=yt(e,t);a.navigate===!1?await r(a.fetcherKey||en(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function nn(e,{relative:t}={}){let{basename:n}=s.useContext(M),r=s.useContext(P);d(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...R(e||`.`,{relative:t})},o=I();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:k([n,a.pathname])),g(a)}var rn=`react-router-scroll-positions`,Q={};function an(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:D(e.pathname,n)||e.pathname},t)),i??=e.key,i}function on({getKey:e,storageKey:t}={}){let{router:n}=Xt(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Zt(`useScrollRestoration`),{basename:a}=s.useContext(M),o=I(),c=tt(),l=et();s.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),sn(s.useCallback(()=>{if(l.state===`idle`){let t=an(o,c,a,e);Q[t]=window.scrollY}try{sessionStorage.setItem(t||rn,JSON.stringify(Q))}catch(e){f(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,o,c,t])),typeof document<`u`&&(s.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||rn);e&&(Q=JSON.parse(e))}catch{}},[t]),s.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Q,()=>window.scrollY,e?(t,n)=>an(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),s.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{f(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function sn(e,t){let{capture:n}=t||{};s.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function cn(e,{relative:t}={}){let n=s.useContext(ke);d(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Xt(`useViewTransitionState`),i=R(e,{relative:t});if(!n.isTransitioning)return!1;let a=D(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=D(n.nextLocation.pathname,r)||n.nextLocation.pathname;return E(i.pathname,o)!=null||E(i.pathname,a)!=null}var ln=a(`ExternalLink`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),$=t(),un={xs:`gap-1.5 text-xs`,sm:`gap-1.5 text-sm`},dn={xs:`h-3.5 w-3.5`,sm:`h-4 w-4`};function fn(e){return e.button===0&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey}function pn(e){return Array.from(new Set(`${e??``} noopener noreferrer`.trim().split(/\s+/))).join(` `)}function mn(e){try{let t=new URL(e,window.location.href);return t.protocol===`http:`||t.protocol===`https:`?t.toString():null}catch{return null}}var hn=(0,s.forwardRef)(function({children:e,className:t,external:n=!1,href:i,icon:a,iconPosition:s=`leading`,onClick:c,rel:l,size:u=`sm`,target:d,...f},p){let m=a===void 0&&n?ln:a,h=r(`inline-flex items-center rounded-sm font-medium text-primary underline-offset-4 transition-colors hover:text-primary-hover hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25`,un[u],t),g=m?(0,$.jsx)(m,{"aria-hidden":`true`,className:r(`shrink-0`,dn[u])}):null,_=(0,$.jsxs)($.Fragment,{children:[s===`leading`?g:null,e,s===`trailing`?g:null]});return n?(0,$.jsx)(`a`,{ref:p,...f,href:i,target:d??`_blank`,rel:pn(l),className:h,onClick:e=>{c?.(e);let t=mn(i);t&&!e.defaultPrevented&&fn(e)&&(e.preventDefault(),o.openExternalUrl(t))},children:_}):(0,$.jsx)(Z,{ref:p,...f,to:i,target:d,rel:l,className:h,onClick:c,children:_})});export{st as a,lt as c,L as d,He as f,Z as i,ut as l,ln as n,Kt as o,Ut as r,ct as s,hn as t,I as u};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-CuZFOa6q.js";import{n as e}from"./chunk-EMLP6XTP-BYGgekQ0.js";export{e as createPacketServices};
@@ -1 +0,0 @@
1
- import{o as e}from"./i18n-20rSH40D.js";import{i as t,n,r,t as i}from"./panel-app-B39rJPj8.js";function a(){e({zh:{...t,...r},en:{...n,...i}})}export{a as installPanelAppI18nCatalog};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-page-Dlyvp-81.js","assets/login-page-f8qQ4xKY.js","assets/chunk-DF37yw5_.js","assets/api-DqzQ-_3w.js","assets/utils-CBZPzC_b.js","assets/i18n-20rSH40D.js","assets/preload-helper-ca-nBW7U.js","assets/card-BhfAZv5L.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./chunk-DF37yw5_.js";import{t}from"./client-BtGBwLTs.js";import{A as n,M as r}from"./utils-CBZPzC_b.js";import{t as i}from"./preload-helper-ca-nBW7U.js";import{An as a,Ht as o,Vt as s,_n as c,gn as l}from"./api-DqzQ-_3w.js";import{a as u,s as d}from"./i18n-20rSH40D.js";import{c as f,p,s as m,t as h}from"./theme-provider-DzvAi3pe.js";import{t as g}from"./i18n-provider-BPRq6S7O.js";var _=e(r(),1),v=t(),y=n(),b=(0,_.lazy)(async()=>({default:(await i(async()=>{let{LoginPage:e}=await import(`./login-page-Dlyvp-81.js`);return{LoginPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7]))).LoginPage})),x=/^\/apps\/panel\/([^/]+)\/standalone\/?$/;function S(e){let t=x.exec(e);if(!t)return null;try{return decodeURIComponent(t[1])}catch{return null}}function C({appId:e}){let t=o(),n=t.isError&&s(t.error);return t.isLoading&&!t.isError||n||t.isError?(0,y.jsx)(f,{appId:e}):t.data?.enabled&&!t.data.authenticated?(0,y.jsx)(_.Suspense,{fallback:(0,y.jsx)(w,{message:d(`loading`)}),children:(0,y.jsx)(b,{username:t.data.username})}):(0,y.jsx)(f,{appId:e})}function w({message:e}){return(0,y.jsx)(`main`,{className:`flex h-dvh items-center justify-center bg-background px-6 text-sm text-muted-foreground`,children:e})}function T({pathname:e=window.location.pathname}){let t=S(e);return t?(0,y.jsx)(a,{client:l,children:(0,y.jsxs)(p,{children:[(0,y.jsx)(C,{appId:t}),(0,y.jsx)(m,{}),(0,y.jsx)(c,{position:`top-right`,richColors:!0,offset:16})]})}):(0,y.jsx)(w,{message:d(`panelAppsMainUnavailable`)})}await u();var E=document.getElementById(`root`);E&&(0,v.createRoot)(E).render((0,y.jsx)(_.StrictMode,{children:(0,y.jsx)(h,{children:(0,y.jsx)(g,{children:(0,y.jsx)(T,{})})})}));
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-CuZFOa6q.js";import{n as e}from"./chunk-YOTPTUD7-Ck87Kqxe.js";export{e as createPieServices};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-BNKf0_kc.js";var t=e(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
@@ -1 +0,0 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,t as r}from"./utils-CBZPzC_b.js";import{a as i,c as a,d as o,f as s,n as c,p as l,r as u,s as d,t as f}from"./dist-BiIcnf9j.js";import{a as p,i as m,o as h,r as g,s as _}from"./dist-C5I0v8Qn.js";import{t as v}from"./dist-czPa8xFO.js";import{i as y,n as b,r as x,t as ee}from"./es2015-cuwbYI-l.js";var S=e(n(),1),C=t(),w=`Popover`,[T,te]=o(w,[_]),E=_(),[D,O]=T(w),k=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=E(t),c=S.useRef(null),[l,d]=S.useState(!1),[p,m]=f({prop:r,defaultProp:i??!1,onChange:a,caller:w});return(0,C.jsx)(h,{...s,children:(0,C.jsx)(D,{scope:t,contentId:u(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:l,onCustomAnchorAdd:S.useCallback(()=>d(!0),[]),onCustomAnchorRemove:S.useCallback(()=>d(!1),[]),modal:o,children:n})})};k.displayName=w;var A=`PopoverAnchor`,j=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(A,n),a=E(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return S.useEffect(()=>(o(),()=>s()),[o,s]),(0,C.jsx)(g,{...a,...r,ref:t})});j.displayName=A;var M=`PopoverTrigger`,N=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(M,n),a=E(n),o=s(t,i.triggerRef),c=(0,C.jsx)(d.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":K(i.open),...r,ref:o,onClick:l(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:(0,C.jsx)(g,{asChild:!0,...a,children:c})});N.displayName=M;var P=`PopoverPortal`,[F,I]=T(P,{forceMount:void 0}),L=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=O(P,t);return(0,C.jsx)(F,{scope:t,forceMount:n,children:(0,C.jsx)(v,{present:n||a.open,children:(0,C.jsx)(c,{asChild:!0,container:i,children:r})})})};L.displayName=P;var R=`PopoverContent`,z=S.forwardRef((e,t)=>{let n=I(R,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=O(R,e.__scopePopover);return(0,C.jsx)(v,{present:r||a.open,children:a.modal?(0,C.jsx)(re,{...i,ref:t}):(0,C.jsx)(B,{...i,ref:t})})});z.displayName=R;var ne=a(`PopoverContent.RemoveScroll`),re=S.forwardRef((e,t)=>{let n=O(R,e.__scopePopover),r=S.useRef(null),i=s(t,r),a=S.useRef(!1);return S.useEffect(()=>{let e=r.current;if(e)return ee(e)},[]),(0,C.jsx)(b,{as:ne,allowPinchZoom:!0,children:(0,C.jsx)(V,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:l(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),B=S.forwardRef((e,t)=>{let n=O(R,e.__scopePopover),r=S.useRef(!1),i=S.useRef(!1);return(0,C.jsx)(V,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),V=S.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,m=O(R,n),h=E(n);return x(),(0,C.jsx)(y,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,C.jsx)(i,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:(0,C.jsx)(p,{"data-state":K(m.open),role:`dialog`,id:m.contentId,...h,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),H=`PopoverClose`,U=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(H,n);return(0,C.jsx)(d.button,{type:`button`,...r,ref:t,onClick:l(e.onClick,()=>i.onOpenChange(!1))})});U.displayName=H;var W=`PopoverArrow`,G=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=E(n);return(0,C.jsx)(m,{...i,...r,ref:t})});G.displayName=W;function K(e){return e?`open`:`closed`}var q=k,J=j,Y=N,X=L,Z=z,ie=`2rem`;function Q(e){return`min(${e}, max(0px, calc(var(--radix-popover-content-available-height, 100vh) - ${ie})))`}var ae=Q(`24rem`),oe=q,se=Y,ce=J,$=S.forwardRef(({className:e,sideOffset:t=8,align:n=`start`,collisionPadding:i=12,style:a,...o},s)=>(0,C.jsx)(X,{children:(0,C.jsx)(Z,{ref:s,"data-theme-overlay":`popover`,sideOffset:t,align:n,collisionPadding:i,className:r(`z-[var(--z-popover,10100)] w-72 overflow-x-hidden overflow-y-auto rounded-2xl border border-border bg-popover p-4 text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),style:{maxHeight:ae,...a},...o})}));$.displayName=Z.displayName;export{Q as a,X as c,se as i,q as l,ce as n,J as o,$ as r,Z as s,oe as t,Y as u};
@@ -1 +0,0 @@
1
- import{A as e}from"./utils-CBZPzC_b.js";import{Jt as t,Kt as n,Qt as r,Ut as i,qt as a}from"./api-DqzQ-_3w.js";import{s as o}from"./i18n-20rSH40D.js";import{a as s,i as c,n as l,r as u,t as d}from"./select-CG5YWnwe.js";import{t as f,u as p,v as m}from"./use-config-BEdbtpD4.js";var h=e();function g(){let e=f(),g=p(),v=m(),y=e.data?.productAnalytics.enabled??!0,b=e.data?.productAnalytics.audience??`external`,x=e=>{v.mutate({data:{enabled:e}})},S=e=>{let t=e;v.mutate({data:{audience:t}})};return(0,h.jsxs)(r,{title:o(`privacyPageTitle`),description:o(`privacyPageDescription`),children:[(0,h.jsx)(t,{title:o(`productAnalyticsSectionTitle`),description:o(`productAnalyticsSectionDescription`),children:(0,h.jsxs)(a,{children:[(0,h.jsx)(n,{title:o(`productAnalyticsEnabledTitle`),description:o(`productAnalyticsEnabledDescription`),control:(0,h.jsx)(i,{"aria-label":o(`productAnalyticsEnabledTitle`),checked:y,disabled:e.isLoading||v.isPending,onCheckedChange:x})}),(0,h.jsx)(n,{title:o(`productAnalyticsAudienceTitle`),description:o(`productAnalyticsAudienceDescription`),control:(0,h.jsxs)(d,{value:b,onValueChange:S,disabled:e.isLoading||v.isPending,children:[(0,h.jsx)(c,{"aria-label":o(`productAnalyticsAudienceTitle`),className:`w-40 sm:w-48`,children:(0,h.jsx)(s,{})}),(0,h.jsxs)(l,{children:[(0,h.jsx)(u,{value:`external`,children:o(`productAnalyticsAudienceExternal`)}),(0,h.jsx)(u,{value:`internal`,children:o(`productAnalyticsAudienceInternal`)}),(0,h.jsx)(u,{value:`qa`,children:o(`productAnalyticsAudienceQa`)})]})]})})]})}),(0,h.jsx)(t,{title:o(`productAnalyticsDataTitle`),children:(0,h.jsxs)(a,{children:[(0,h.jsx)(n,{layout:`stacked`,title:o(`productAnalyticsCollectedTitle`),description:o(`productAnalyticsCollectedDescription`)}),(0,h.jsx)(n,{layout:`stacked`,title:o(`productAnalyticsExcludedTitle`),description:o(`productAnalyticsExcludedDescription`)}),(0,h.jsx)(n,{layout:`stacked`,title:o(`productAnalyticsAnonymousTitle`),description:o(`productAnalyticsAnonymousDescription`)})]})}),(0,h.jsx)(t,{title:o(`productAnalyticsStatusSectionTitle`),children:(0,h.jsxs)(a,{children:[(0,h.jsx)(n,{layout:`stacked`,title:o(`productAnalyticsStatusTitle`),description:_(g.data,g.isLoading)}),g.data?.lastError?(0,h.jsx)(n,{layout:`stacked`,title:o(`productAnalyticsLastErrorTitle`),description:g.data.lastError}):null]})})]})}function _(e,t){if(t)return o(`productAnalyticsStatusLoading`);if(!e?.lastAttemptAt)return o(`productAnalyticsStatusNever`);let n=new Date(e.lastAttemptAt).toLocaleString();if(!e.lastSuccessAt)return`${o(`productAnalyticsLastAttemptLabel`)} ${n} · ${e.pendingReceiptCount} ${o(`productAnalyticsPendingLabel`)}`;let r=new Date(e.lastSuccessAt).toLocaleString();return`${o(`productAnalyticsLastSuccessLabel`)} ${r} · ${e.pendingReceiptCount} ${o(`productAnalyticsPendingLabel`)}`}export{g as PrivacySettingsPage};
@@ -1 +0,0 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,O as r}from"./utils-CBZPzC_b.js";import{d as i,f as a,n as o}from"./navigation-link-BAQjgx2F.js";import{Gt as s,Lt as c,Yt as l,bn as u,jn as d,vn as f,yn as p}from"./api-DqzQ-_3w.js";import{C as m,a as h,c as g,i as _,n as v,o as y,r as b,s as ee}from"./mcp-marketplace-page-FfIfEo6w.js";import{C as te,P as x,U as S,ct as ne,lt as C}from"./app-presenter-provider-CBZ_-ewx.js";import{n as w,r as T,s as E,t as D}from"./i18n-20rSH40D.js";import{t as O}from"./createLucideIcon-BNKf0_kc.js";import{h as re}from"./app-data-C54N2p8b.js";import{t as k}from"./chevron-down-BL-yMYcX.js";import{n as ie}from"./ellipsis-C5YXdOUx.js";import{S as ae,a as A,i as j,n as M,r as N,t as P}from"./select-CG5YWnwe.js";import{t as oe}from"./circle-dashed-CU3yApvP.js";import{i as se,n as F,r as ce,t as le}from"./tabs-BuE0qKMh.js";import{t as ue}from"./use-viewport-layout-BS18drMT.js";import{t as de}from"./plus-LA8-jpxP.js";import{t as fe}from"./settings-2-CE3ELQyk.js";import{t as pe}from"./confirm-dialog-BTKCWMn6.js";import{t as I}from"./trash-2-BPPYt2NV.js";import{a as L,i as me,n as R,o as he,r as ge,t as _e}from"./dialog-Xe73hpQz.js";import{a as ve,i as ye,n as be,t as xe}from"./card-BhfAZv5L.js";var Se=O(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ce=O(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),we=O(`List`,[[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 18h.01`,key:`1tta3j`}],[`path`,{d:`M3 6h.01`,key:`1rqtza`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 18h13`,key:`1lx6n3`}],[`path`,{d:`M8 6h13`,key:`ik3vkj`}]]),Te=O(`Unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),z=e(n(),1),B=t();function V({title:e,children:t,className:n=``}){return(0,B.jsxs)(xe,{hover:!1,surface:`flat`,className:n,children:[(0,B.jsx)(ye,{className:`p-4 pb-3`,children:(0,B.jsx)(ve,{children:e})}),(0,B.jsx)(be,{className:`p-4 pt-0`,children:t})]})}function H({children:e}){return(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:e})}function U({available:e,children:t,className:n,label:r,onOpen:i,path:a}){return e?(0,B.jsx)(`button`,{type:`button`,className:n,title:a,onClick:()=>i(a,r),children:t}):(0,B.jsx)(`div`,{className:n,children:t})}function Ee({agreement:e,isLoading:t,isError:n,onOpenFile:r}){return(0,B.jsxs)(V,{title:E(`projectsAgreementFile`),children:[(0,B.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:E(`projectsAgreementDescription`)}),t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):e?.available?(0,B.jsxs)(U,{available:!0,path:e.path,label:e.path,onOpen:r,className:`block w-full rounded-xl bg-muted/45 p-3 text-left transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:e.path}),(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:E(`projectsAgreementOpen`)})]}):(0,B.jsx)(H,{children:E(`projectsNoAgreement`)})]})}var W=e=>[`project-work`,e],G=e=>[`project-work-summary`,e],K=e=>[`project-work-states`,e],q=e=>[`project-work-artifacts`,e],J=(e,t)=>[`project-work-item`,e,t],Y=(e,t)=>[`project-work-activity`,e,t];function De(e,t={}){return m({queryKey:[...W(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await c.projects.listWork(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function Oe(e){return u({queryKey:G(e??``),enabled:!!e,queryFn:async()=>await c.projects.getWorkSummary(e)})}function ke(e){return u({queryKey:K(e??``),enabled:!!e,queryFn:async()=>await c.projects.listWorkStates(e)})}function Ae(e,t={}){return m({queryKey:[...q(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await c.projects.listRecentWorkArtifacts(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function je(e,t){return u({queryKey:J(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await c.projects.getWorkItem(e,t)})}function Me(e,t){return u({queryKey:Y(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await c.projects.listWorkItemActivities(e,t,{limit:100})})}function X(e){let t=d(),n=async n=>{await Promise.all([t.invalidateQueries({queryKey:W(e)}),t.invalidateQueries({queryKey:G(e)}),t.invalidateQueries({queryKey:K(e)}),t.invalidateQueries({queryKey:q(e)}),...n?[t.invalidateQueries({queryKey:J(e,n)}),t.invalidateQueries({queryKey:Y(e,n)})]:[]])};return{createItem:p({mutationFn:async t=>await c.projects.createWorkItem(e,t),onSuccess:async e=>await n(e.id)}),updateItem:p({mutationFn:async t=>await c.projects.updateWorkItem(e,t.workItemId,t.patch),onSuccess:async e=>await n(e.id)}),deleteItem:p({mutationFn:async t=>await c.projects.deleteWorkItem(e,t),onSuccess:async e=>await n(e.id)}),restoreItem:p({mutationFn:async t=>await c.projects.restoreWorkItem(e,t),onSuccess:async e=>await n(e.id)}),linkArtifact:p({mutationFn:async t=>await c.projects.linkWorkItemArtifact(e,t.workItemId,{path:t.path,...t.label?{label:t.label}:{}}),onSuccess:async(e,t)=>await n(t.workItemId)}),unlinkArtifact:p({mutationFn:async t=>await c.projects.unlinkWorkItemArtifact(e,t.workItemId,t.artifactLinkId),onSuccess:async(e,t)=>await n(t.workItemId)}),createState:p({mutationFn:async t=>await c.projects.createWorkState(e,t),onSuccess:async()=>await n()}),updateState:p({mutationFn:async t=>await c.projects.updateWorkState(e,t.stateId,t.patch),onSuccess:async()=>await n()}),deleteState:p({mutationFn:async t=>await c.projects.deleteWorkState(e,t.stateId,t.migrateToStateId),onSuccess:async()=>await n()})}}function Z(e){let t=d();(0,z.useEffect)(()=>{if(e)return c.eventBus.on(r.projectWorkChanged,n=>{n.projectId===e&&(t.invalidateQueries({queryKey:W(e)}),t.invalidateQueries({queryKey:G(e)}),t.invalidateQueries({queryKey:K(e)}),t.invalidateQueries({queryKey:q(e)}),n.workItemId&&(t.invalidateQueries({queryKey:J(e,n.workItemId)}),t.invalidateQueries({queryKey:Y(e,n.workItemId)})))})},[e,t])}function Ne(e){return[...e].sort((e,t)=>e.position-t.position||e.name.localeCompare(t.name))}var Pe={started:0,unstarted:1,backlog:2,completed:3,canceled:4};function Fe(e){return[...e].sort((e,t)=>{let n=Pe[e.category]-Pe[t.category];return n===0?e.category===`completed`||e.category===`canceled`?e.position-t.position||e.name.localeCompare(t.name):t.position-e.position||e.name.localeCompare(t.name):n})}function Q(e,t){return`${e}${e.endsWith(`/`)||e.endsWith(`\\`)?``:`/`}${t}`}function Ie(e,t=new Date){if(!e)return`-`;let n=new Date(e),r=t.getTime()-n.getTime();if(Number.isNaN(n.getTime()))return e;if(r<6e4)return E(`projectsTimeJustNow`);let i=Math.floor(r/6e4);if(i<60)return E(`projectsTimeMinutesAgo`).replace(`{count}`,String(i));let a=Math.floor(i/60);if(a<24)return E(`projectsTimeHoursAgo`).replace(`{count}`,String(a));let o=Math.floor(a/24);return o===1?E(`projectsTimeYesterday`):o<7?E(`projectsTimeDaysAgo`).replace(`{count}`,String(o)):D(e)}var Le=20;function Re({projectId:e,onOpenFile:t}){let[n,r]=(0,z.useState)(``),i=Ae(e,{limit:Le,...n.trim()?{query:n.trim()}:{}}),a=i.data?.pages??[],o=a.flatMap(e=>e.artifacts),s=a[0]?.total??0;return i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":E(`projectsArtifacts`),children:[(0,B.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[T(s),` `,E(`projectsArtifactsCountSuffix`)]}),(0,B.jsx)(`input`,{type:`search`,value:n,className:`h-8 w-full min-w-0 rounded-lg border border-border/60 bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground sm:w-60`,placeholder:E(`projectsArtifactsSearchPlaceholder`),onChange:e=>r(e.target.value)})]}),o.length?(0,B.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/60`,children:[(0,B.jsx)(`div`,{className:`divide-y divide-border/60`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`flex w-full min-w-0 items-center gap-3 px-3 py-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.path,` · `,e.workItemTitle]})]}),(0,B.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground`,dateTime:e.createdAt,title:w(e.createdAt),children:Ie(e.createdAt)}),e.exists?null:(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-destructive`,children:E(`projectsUnavailable`)})]},e.id))}),i.hasNextPage?(0,B.jsx)(`button`,{type:`button`,className:`w-full border-t border-border/60 px-3 py-2.5 text-left text-sm text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,disabled:i.isFetchingNextPage,onClick:()=>void i.fetchNextPage(),children:i.isFetchingNextPage?E(`projectsLoading`):E(`projectsArtifactsShowMore`)}):null]}):(0,B.jsx)(H,{children:n.trim()?E(`projectsArtifactsNoMatches`):E(`projectsNoArtifacts`)})]})}var ze={Backlog:`projectsWorkState_backlog`,Planned:`projectsWorkState_planned`,"In Progress":`projectsWorkState_inProgress`,"In Review":`projectsWorkState_inReview`,"Awaiting Acceptance":`projectsWorkState_awaitingAcceptance`,Completed:`projectsWorkState_completed`,Canceled:`projectsWorkState_canceled`};function $(e,t){let n=ze[e];return n?t?E(n,t):E(n):e}function Be({projectId:e,onOpenArtifact:t,onOpenWorkItem:n}){Z(e);let r=Oe(e),i=De(e,{limit:5}),a=Ae(e,{limit:5}),o=a.data?.pages[0]?.artifacts??[],s=i.data?.pages.flatMap(e=>e.items).slice(0,5)??[];return(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,"aria-label":E(`projectsWorkSummary`),children:r.data?[[`projectsWorkTotal`,r.data.total],[`projectsWorkActive`,r.data.active],[`projectsWorkNeedsAttention`,r.data.attention],[`projectsWorkCompleted`,r.data.completed]].map(([e,t])=>(0,B.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card p-4`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-semibold`,children:t}),(0,B.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:E(e)})]},e)):(0,B.jsx)(`div`,{className:`col-span-full rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:r.isError?E(`projectsLoadFailed`):E(`projectsLoading`)})}),(0,B.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-2`,children:[(0,B.jsx)(V,{title:E(`projectsWorkRecentlyUpdated`),children:i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):s.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:s.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 rounded-xl bg-muted/45 px-3 py-3 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>n(e.id),children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:e.title}),(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:$(e.state.name)})]},e.id))}):(0,B.jsx)(H,{children:E(`projectsWorkEmpty`)})}),(0,B.jsx)(V,{title:E(`projectsRecentArtifacts`),children:a.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):a.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):o.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`block w-full rounded-xl bg-muted/45 p-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.workItemTitle,(0,B.jsx)(`time`,{dateTime:e.createdAt,title:w(e.createdAt),children:` · ${Ie(e.createdAt)}`}),e.exists?``:` · ${E(`projectsUnavailable`)}`]})]},e.id))}):(0,B.jsx)(H,{children:E(`projectsNoRecentArtifacts`)})})]})]})}function Ve({skills:e,isLoading:t,isError:n,onOpen:r}){return t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":E(`projectsSkills`),children:[(0,B.jsxs)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:[T(e.length),` `,E(`projectsSkillsCountSuffix`)]}),e.length?(0,B.jsx)(`div`,{className:`grid min-w-0 gap-3 md:grid-cols-2`,children:e.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`min-w-0 rounded-xl border border-border/60 p-3 text-left transition-colors hover:border-border hover:bg-muted/30 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>r(e),children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 truncate text-xs text-muted-foreground`,title:e.path,children:e.path}),(0,B.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs text-muted-foreground`,title:e.description??e.ref,children:e.description??e.ref})]},e.ref))}):(0,B.jsx)(H,{children:E(`projectsNoSkills`)})]})}function He({onOpenArtifact:e,onOpenChange:t,projectId:n,projectRoot:r,workItemId:i}){let a=je(n,i),o=Me(n,i);Z(n);let s=ke(n);return(0,B.jsx)(b,{open:!!i,onOpenChange:t,children:(0,B.jsxs)(_,{side:`right`,closeLabel:E(`projectsCloseDetails`),className:`flex h-full w-full flex-col overflow-hidden p-0 sm:max-w-[680px]`,children:[a.isLoading?(0,B.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:E(`projectsLoading`)}):null,a.isError?(0,B.jsx)(`div`,{className:`p-6 text-sm text-destructive`,children:E(`projectsWorkItemLoadFailed`)}):null,a.data?(0,B.jsx)(Ue,{item:a.data,states:s.data??[],activities:o.data?.activities??[],onOpenArtifact:(t,n)=>e(Q(r,t),n),onClose:()=>t(!1)},`${a.data.id}:${a.data.version}`):null]})})}function Ue({activities:e,item:t,onClose:n,onOpenArtifact:r,states:i}){let a=X(t.projectId),[c,u]=(0,z.useState)(t.title),[d,p]=(0,z.useState)(t.description),[m,_]=(0,z.useState)(t.stateId),[b,te]=(0,z.useState)(t.attention),[x,S]=(0,z.useState)(``),[C,w]=(0,z.useState)(``),[T,D]=(0,z.useState)(!1),O=async(e,t)=>{try{await e(),t?.()}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkActionFailed`))}},re=async()=>{try{await a.updateItem.mutateAsync({workItemId:t.id,patch:{title:c,description:d,stateId:m,attention:b,expectedVersion:t.version}}),f.success(E(`projectsWorkItemSaved`))}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkItemSaveFailed`))}},k=async()=>{if(x.trim())try{await a.linkArtifact.mutateAsync({workItemId:t.id,path:x.trim(),...C.trim()?{label:C.trim()}:{}}),S(``),w(``)}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkArtifactLinkFailed`))}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(ee,{className:`shrink-0 border-b border-border/60 px-5 pb-5 pt-6 pr-14 sm:px-7 sm:pt-7`,children:[(0,B.jsx)(g,{children:E(`projectsWorkDetails`)}),(0,B.jsxs)(h,{children:[t.id,` · `,E(`projectsWorkVersion`),` `,t.version]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto px-5 py-6 sm:px-7`,children:[(0,B.jsxs)(`section`,{className:`space-y-3`,children:[(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:E(`projectsWorkTitle`)}),(0,B.jsx)(s,{value:c,onChange:e=>u(e.target.value)}),(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:E(`projectsWorkDescription`)}),(0,B.jsx)(v,{className:`min-h-28`,value:d,onChange:e=>p(e.target.value)}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:E(`projectsStatus`)}),(0,B.jsxs)(P,{value:m,onValueChange:_,children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{})}),(0,B.jsx)(M,{children:i.map(e=>(0,B.jsx)(N,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:E(`projectsWorkAttention`)}),(0,B.jsxs)(P,{value:b,onValueChange:e=>te(e),children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{})}),(0,B.jsxs)(M,{children:[(0,B.jsx)(N,{value:`none`,children:E(`projectsWorkAttention_none`)}),(0,B.jsx)(N,{value:`blocked`,children:E(`projectsWorkAttention_blocked`)}),(0,B.jsx)(N,{value:`awaiting-user`,children:E(`projectsWorkAttention_awaiting-user`)})]})]})]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:E(`projectsWorkArtifacts`)}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[t.artifacts.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-border/60 p-2`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 rounded-lg px-2 py-1 text-left hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>r(e.path,e.label??e.path),children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 truncate text-sm font-medium`,children:[(0,B.jsx)(o,{className:`h-3.5 w-3.5 shrink-0`}),e.label??e.path]}),(0,B.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.path})]}),(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsWorkUnlinkArtifact`),onClick:()=>void O(()=>a.unlinkArtifact.mutateAsync({workItemId:t.id,artifactLinkId:e.id})),children:(0,B.jsx)(Te,{className:`h-4 w-4`})})]},e.id)),t.artifacts.length?null:(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:E(`projectsWorkNoArtifacts`)})]}),(0,B.jsxs)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-[1fr_12rem_auto]`,children:[(0,B.jsx)(s,{value:x,onChange:e=>S(e.target.value),placeholder:E(`projectsWorkArtifactPath`)}),(0,B.jsx)(s,{value:C,onChange:e=>w(e.target.value),placeholder:E(`projectsWorkArtifactLabel`)}),(0,B.jsxs)(l,{variant:`outline`,onClick:()=>void k(),disabled:!x.trim()||a.linkArtifact.isPending,children:[(0,B.jsx)(ne,{className:`mr-2 h-4 w-4`}),E(`projectsWorkLinkArtifact`)]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:E(`projectsActivity`)}),(0,B.jsx)(`ol`,{className:`space-y-2`,children:e.map(e=>(0,B.jsxs)(`li`,{className:`rounded-xl bg-muted/35 px-3 py-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:E(`projectsWorkActivity_${e.type}`)}),(0,B.jsxs)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:[e.actor.kind,` ·`,` `,new Date(e.createdAt).toLocaleString()]})]},e.id))})]})]}),(0,B.jsxs)(y,{className:`shrink-0 border-t border-border/60 bg-background px-5 py-4 sm:px-7`,children:[t.deletedAt?(0,B.jsx)(l,{variant:`outline`,onClick:()=>void O(()=>a.restoreItem.mutateAsync(t.id)),children:E(`projectsRestore`)}):(0,B.jsxs)(l,{variant:`destructive`,onClick:()=>D(!0),children:[(0,B.jsx)(I,{className:`mr-2 h-4 w-4`}),E(`projectsDelete`)]}),(0,B.jsx)(l,{onClick:()=>void re(),disabled:!c.trim()||a.updateItem.isPending,children:E(`save`)})]}),(0,B.jsx)(pe,{open:T,onOpenChange:D,title:E(`projectsDeleteWorkItem`),description:E(`projectsDeleteWorkItemDescription`),confirmLabel:E(`projectsDelete`),variant:`destructive`,onCancel:()=>D(!1),onConfirm:()=>void O(()=>a.deleteItem.mutateAsync(t.id),n)})]})}var We=[`backlog`,`unstarted`,`started`,`completed`,`canceled`];function Ge({open:e,onOpenChange:t,projectId:n,states:r}){let i=X(n),a=Ne(r),[o,c]=(0,z.useState)(``),[u,d]=(0,z.useState)(`unstarted`),[p,m]=(0,z.useState)(null),[h,g]=(0,z.useState)(``),_=async e=>{try{await e()}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkActionFailed`))}},v=async()=>{o.trim()&&await _(async()=>{await i.createState.mutateAsync({name:o.trim(),category:u}),c(``)})},y=async(e,t)=>{let n=a[e],r=a[e+t];!n||!r||await _(async()=>{await i.updateState.mutateAsync({stateId:n.id,patch:{position:r.position}}),await i.updateState.mutateAsync({stateId:r.id,patch:{position:n.position}})})};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(_e,{open:e,onOpenChange:t,children:(0,B.jsxs)(R,{className:`max-h-[85vh] overflow-y-auto sm:max-w-2xl`,children:[(0,B.jsxs)(L,{children:[(0,B.jsx)(he,{children:E(`projectsWorkStateSettings`)}),(0,B.jsx)(ge,{children:E(`projectsWorkStateSettingsDescription`)})]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:a.map((e,t)=>(0,B.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/60 p-3 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(s,{"aria-label":E(`projectsWorkStateName`),defaultValue:$(e.name),onBlur:t=>{let n=t.currentTarget.value.trim();n&&n!==$(e.name)&&_(()=>i.updateState.mutateAsync({stateId:e.id,patch:{name:n}}))}}),(0,B.jsxs)(P,{value:e.category,onValueChange:t=>void _(()=>i.updateState.mutateAsync({stateId:e.id,patch:{category:t}})),children:[(0,B.jsx)(j,{"aria-label":E(`projectsWorkStateCategory`),children:(0,B.jsx)(A,{})}),(0,B.jsx)(M,{children:We.map(e=>(0,B.jsx)(N,{value:e,children:E(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsMoveUp`),disabled:t===0,onClick:()=>void y(t,-1),children:(0,B.jsx)(ae,{className:`h-4 w-4`})}),(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsMoveDown`),disabled:t===a.length-1,onClick:()=>void y(t,1),children:(0,B.jsx)(k,{className:`h-4 w-4`})}),(0,B.jsx)(l,{size:`icon`,variant:`ghost`,"aria-label":E(`projectsDeleteState`),disabled:a.length<=1,onClick:()=>{m(e),g(``)},children:(0,B.jsx)(I,{className:`h-4 w-4`})})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground sm:col-span-3`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`default-state`,checked:e.isDefault,onChange:()=>void _(()=>i.updateState.mutateAsync({stateId:e.id,patch:{isDefault:!0}}))}),E(`projectsWorkDefaultState`)]})]},e.id))}),(0,B.jsxs)(`div`,{className:`grid gap-2 border-t border-border/60 pt-4 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(s,{value:o,onChange:e=>c(e.target.value),placeholder:E(`projectsWorkNewState`)}),(0,B.jsxs)(P,{value:u,onValueChange:e=>d(e),children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{})}),(0,B.jsx)(M,{children:We.map(e=>(0,B.jsx)(N,{value:e,children:E(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(l,{onClick:()=>void v(),disabled:!o.trim()||i.createState.isPending,children:[(0,B.jsx)(de,{className:`mr-2 h-4 w-4`}),E(`projectsAdd`)]})]})]})}),(0,B.jsx)(_e,{open:!!p,onOpenChange:e=>{e||m(null)},children:(0,B.jsxs)(R,{children:[(0,B.jsxs)(L,{children:[(0,B.jsx)(he,{children:E(`projectsDeleteState`)}),(0,B.jsx)(ge,{children:E(`projectsDeleteStateDescription`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:E(`projectsWorkStateMigration`)}),(0,B.jsxs)(P,{value:h,onValueChange:g,children:[(0,B.jsx)(j,{children:(0,B.jsx)(A,{placeholder:E(`projectsWorkStateMigrationOptional`)})}),(0,B.jsx)(M,{children:a.filter(e=>e.id!==p?.id).map(e=>(0,B.jsx)(N,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(me,{children:[(0,B.jsx)(l,{variant:`outline`,onClick:()=>m(null),children:E(`cancel`)}),(0,B.jsx)(l,{variant:`destructive`,onClick:()=>{p&&_(async()=>{await i.deleteState.mutateAsync({stateId:p.id,migrateToStateId:h||null}),m(null)})},children:E(`projectsDelete`)})]})]})})]})}function Ke({startedProgress:e,state:t}){if(t.category===`backlog`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`backlog`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(oe,{className:`h-4 w-4`})});if(t.category===`unstarted`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`unstarted`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,B.jsx)(Ce,{className:`h-4 w-4`,strokeWidth:2})});if(t.category===`completed`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`completed`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-emerald-600 dark:text-emerald-400`,children:(0,B.jsx)(re,{className:`h-4 w-4`,strokeWidth:2.25})});if(t.category===`canceled`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`canceled`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(Se,{className:`h-4 w-4`})});let n=Math.round((e??.5)*100),r=n>=67?`text-emerald-600 dark:text-emerald-400`:n>=40?`text-orange-500 dark:text-orange-400`:`text-amber-500 dark:text-amber-400`;return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`started`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${r}`,children:(0,B.jsxs)(`svg`,{className:`h-4 w-4`,viewBox:`0 0 16 16`,fill:`none`,children:[(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,stroke:`currentColor`,strokeWidth:`1.75`,opacity:`0.22`}),(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,pathLength:`100`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`${n} ${100-n}`,transform:`rotate(-90 8 8)`})]})})}function qe({item:e,onOpen:t}){return(0,B.jsxs)(`button`,{type:`button`,className:`w-full rounded-xl border border-border/50 bg-card p-3 text-left text-sm shadow-sm transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:t,children:[(0,B.jsx)(`span`,{className:`block font-medium`,children:e.title}),(0,B.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:$(e.state.name)}),e.attention===`none`?null:(0,B.jsx)(`span`,{className:`rounded-full bg-amber-500/15 px-2 py-0.5 text-amber-700 dark:text-amber-300`,children:E(`projectsWorkAttention_${e.attention}`)}),e.deletedAt?(0,B.jsx)(`span`,{children:E(`projectsDeleted`)}):null]})]})}function Je({hasNextPage:e,isError:t,isFetchingNextPage:n,isLoading:r,items:i,onLoadMore:a,onOpenWorkItem:o}){return r?(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:E(`projectsLoading`)}):t?(0,B.jsx)(`p`,{className:`py-3 text-xs text-destructive`,children:E(`projectsLoadFailed`)}):(0,B.jsxs)(B.Fragment,{children:[i.length?i.map(e=>(0,B.jsx)(qe,{item:e,onOpen:()=>o(e.id)},e.id)):(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:E(`projectsNoData`)}),e?(0,B.jsx)(l,{type:`button`,variant:`ghost`,size:`sm`,className:`w-full`,disabled:n,onClick:a,children:E(n?`projectsLoading`:`projectsWorkLoadMore`)}):null]})}function Ye({includeDeleted:e,onOpenWorkItem:t,state:n,startedProgress:r,view:i}){let[a,o]=(0,z.useState)(!1),s=De(n.projectId,{stateId:n.id,includeDeleted:e,limit:20}),c=s.data?.pages.flatMap(e=>e.items)??[],l=s.data?.pages[0]?.total;return(0,B.jsxs)(`section`,{className:i===`board`?`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`:`min-w-0`,"aria-label":$(n.name),children:[(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full shrink-0 items-center gap-2 rounded-lg px-1 py-2 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-expanded":!a,onClick:()=>o(e=>!e),children:[a?(0,B.jsx)(ie,{className:`h-4 w-4 shrink-0`}):(0,B.jsx)(k,{className:`h-4 w-4 shrink-0`}),(0,B.jsx)(Ke,{state:n,startedProgress:r}),(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold`,children:$(n.name)}),(0,B.jsx)(`span`,{className:`ml-0.5 shrink-0 text-xs font-medium tabular-nums text-muted-foreground`,children:l??`…`})]}),a?null:(0,B.jsx)(`div`,{className:i===`board`?`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain px-1 pb-3`:`space-y-2 px-1 pb-3`,children:(0,B.jsx)(Je,{hasNextPage:s.hasNextPage,isError:s.isError,isFetchingNextPage:s.isFetchingNextPage,isLoading:s.isLoading,items:c,onLoadMore:()=>void s.fetchNextPage(),onOpenWorkItem:t})})]})}function Xe({onOpenWorkItem:e,projectId:t}){let[n,r]=(0,z.useState)(`list`),[i,a]=(0,z.useState)(!1),[o,c]=(0,z.useState)(``),[u,d]=(0,z.useState)(!1);Z(t);let p=ke(t),m=X(t),h=async()=>{if(o.trim())try{let t=await m.createItem.mutateAsync({title:o.trim()});c(``),e(t.id)}catch(e){f.error(e instanceof Error?e.message:E(`projectsWorkItemCreateFailed`))}};if(p.isLoading)return(0,B.jsx)(`div`,{className:`rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:E(`projectsLoading`)});if(p.isError)return(0,B.jsx)(`div`,{className:`rounded-xl border border-destructive/40 p-5 text-sm text-destructive`,children:E(`projectsLoadFailed`)});let g=Ne(p.data??[]),_=Fe(p.data??[]),v=g.filter(e=>e.category===`started`),y=new Map(v.map((e,t)=>[e.id,(t+1)/(v.length+1)]));return(0,B.jsxs)(`section`,{"aria-label":E(`projectsWork`),className:`min-w-0 space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-[16rem] flex-1 gap-2`,children:[(0,B.jsx)(s,{value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h()},placeholder:E(`projectsWorkNewItem`)}),(0,B.jsxs)(l,{onClick:()=>void h(),disabled:!o.trim()||m.createItem.isPending,children:[(0,B.jsx)(de,{className:`mr-2 h-4 w-4`}),E(`projectsCreate`)]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 rounded-xl bg-muted/40 p-1`,role:`group`,"aria-label":E(`projectsWorkViews`),children:[(0,B.jsxs)(l,{size:`sm`,variant:n===`list`?`secondary`:`ghost`,"aria-pressed":n===`list`,onClick:()=>r(`list`),children:[(0,B.jsx)(we,{className:`mr-2 h-4 w-4`}),E(`projectsWorkList`)]}),(0,B.jsxs)(l,{size:`sm`,variant:n===`board`?`secondary`:`ghost`,"aria-pressed":n===`board`,onClick:()=>r(`board`),children:[(0,B.jsx)(C,{className:`mr-2 h-4 w-4`}),E(`projectsWorkBoard`)]})]}),(0,B.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>d(!0),children:[(0,B.jsx)(fe,{className:`mr-2 h-4 w-4`}),E(`projectsWorkStateSettings`)]})]}),(0,B.jsxs)(`label`,{className:`flex w-fit items-center gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),E(`projectsWorkShowDeleted`)]}),n===`list`?(0,B.jsx)(`div`,{className:`space-y-3`,children:_.map(t=>(0,B.jsx)(Ye,{state:t,startedProgress:y.get(t.id)??null,view:n,includeDeleted:i,onOpenWorkItem:e},t.id))}):null,n===`board`?(0,B.jsx)(`div`,{className:`grid h-[calc(100dvh-17rem)] min-h-[28rem] max-h-[52rem] min-w-0 auto-cols-[minmax(18rem,1fr)] grid-flow-col items-stretch gap-3 overflow-x-auto overflow-y-hidden pb-2`,children:g.map(t=>(0,B.jsx)(Ye,{state:t,startedProgress:y.get(t.id)??null,view:n,includeDeleted:i,onOpenWorkItem:e},t.id))}):null,(0,B.jsx)(Ge,{open:u,onOpenChange:d,projectId:t,states:g})]})}var Ze=e=>[`project-agreement`,e],Qe=e=>[`project-skills`,e];function $e(e){return u({queryKey:Ze(e??``),enabled:!!e,queryFn:async()=>await c.projects.getAgreement(e)})}function et(e){return u({queryKey:Qe(e??``),enabled:!!e,queryFn:async()=>await c.projects.listProjectSkills(e)})}function tt(e){return e===`overview`||e===`work`||e===`artifacts`||e===`skills`||e===`agreement`}var nt=[`overview`,`work`,`artifacts`,`skills`,`agreement`];function rt(){let{projectId:e,tab:t}=a(),n=i(),r=S(),{isMobile:o}=ue(),s=x(),[c,l]=(0,z.useState)(null),u=s.data?.projects??[],d=u.find(t=>t.id===e)??null,f=tt(t)?t:null,p=$e(f===`agreement`?d?.id??null:null),m=et(f===`skills`?d?.id??null:null);if(s.isLoading)return(0,B.jsx)(`main`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:E(`projectsLoading`)});if(s.isError)return(0,B.jsxs)(`main`,{className:`p-6 text-sm text-destructive`,children:[E(`projectsLoadFailed`),`: `,s.error.message]});if(!u.length)return(0,B.jsx)(`main`,{className:`p-6 text-sm text-muted-foreground`,children:E(`projectsEmpty`)});if(!d||!f)return(0,B.jsx)(`main`,{className:`p-6 text-sm text-muted-foreground`,children:E(`projectsChoose`)});let h=(e,t)=>r.chatThreadManager.openFilePreview({path:e,label:t,viewMode:`preview`,previewViewer:`rendered`});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`main`,{className:`h-full min-w-0 flex-1 overflow-y-auto p-3 sm:p-4 md:p-6`,children:(0,B.jsxs)(`div`,{className:`mx-auto max-w-6xl space-y-4`,children:[(0,B.jsxs)(`header`,{className:`rounded-2xl border border-border/60 bg-card p-3 sm:p-4`,children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:d.name}),(0,B.jsx)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:d.rootPath})]}),(0,B.jsxs)(le,{value:f,onValueChange:e=>n(`/projects/${encodeURIComponent(d.id)}/${e}`),children:[(0,B.jsx)(`div`,{className:`min-w-0 overflow-x-auto pb-1`,children:(0,B.jsx)(ce,{className:`w-max`,children:nt.map(e=>(0,B.jsx)(se,{value:e,children:E(`projects${e[0].toUpperCase()}${e.slice(1)}`)},e))})}),(0,B.jsx)(F,{value:`overview`,className:`mt-4`,children:(0,B.jsx)(Be,{projectId:d.id,onOpenArtifact:(e,t)=>h(Q(d.rootPath,e),t),onOpenWorkItem:l})}),(0,B.jsx)(F,{value:`work`,className:`mt-4`,children:(0,B.jsx)(Xe,{projectId:d.id,onOpenWorkItem:l})}),(0,B.jsx)(F,{value:`artifacts`,className:`mt-4`,children:(0,B.jsx)(Re,{projectId:d.id,onOpenFile:(e,t)=>h(Q(d.rootPath,e),t)})}),(0,B.jsx)(F,{value:`skills`,className:`mt-4`,children:(0,B.jsx)(Ve,{skills:m.data??[],isLoading:m.isLoading,isError:m.isError,onOpen:e=>h(Q(d.rootPath,e.path),e.name)})}),(0,B.jsx)(F,{value:`agreement`,className:`mt-4`,children:(0,B.jsx)(Ee,{agreement:p.data,isLoading:p.isLoading,isError:p.isError,onOpenFile:(e,t)=>h(Q(d.rootPath,e),t)})})]})]})}),(0,B.jsx)(He,{projectId:d.id,projectRoot:d.rootPath,workItemId:c,onOpenChange:e=>{e||l(null)},onOpenArtifact:h}),(0,B.jsx)(te,{layoutMode:o?`mobile`:`desktop`,sessionKey:null,projectRoot:d.rootPath})]})}export{rt as ProjectsPage};
@@ -1 +0,0 @@
1
- var e=[`off`,`minimal`,`low`,`medium`,`high`,`adaptive`,`xhigh`],t=new Set(e);function n(e){if(!e||e.length===0)return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function r(e,t){let n=e.trim(),r=t.trim();if(!n||!r)return n;let i=`${r}/`;return n.startsWith(i)?n.slice(i.length):n}function i(e,t){let n=e.trim();if(!n)return``;for(let e of t)n=r(n,e);return n.trim()}function a(e,t){let n=t.trim(),r=e.trim();return n?r?`${r}/${n}`:n:``}function o(e){if(typeof e!=`string`)return null;let n=e.trim().toLowerCase();return n&&t.has(n)?n:null}function s(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=o(n);!e||t.includes(e)||t.push(e)}return t}function c(e){return e.includes(`off`)?[...e]:[`off`,...e]}function l(e,t){if(!e)return{};let n={};for(let[r,a]of Object.entries(e)){let e=i(r,t);if(!e)continue;let c={},l=s(a?.thinking?.supported);if(l.length>0){let e=o(a?.thinking?.default);c.thinking=e&&l.includes(e)?{supported:l,default:e}:{supported:l}}a?.vision===!0&&(c.vision=!0),(c.thinking||c.vision===!0)&&(n[e]=c)}return n}function u(e){return Object.fromEntries(Object.entries(e).filter(e=>!!e[1].thinking).map(([e,t])=>[e,t.thinking]))}function d(e,t,n){let r=i(t,n);return r?e[r]??null:null}function f(e,t){let r=e.trim();if(!r)return null;let a=null;for(let e of t)for(let t of e.aliases){let n=t.trim();n&&(r===n||r.startsWith(`${n}/`))&&(!a||n.length>a.score)&&(a={name:e.name,score:n.length})}if(a)return a.name;for(let e of t){let t=i(r,e.aliases);if(t&&n(e.models??[]).some(e=>e===t))return e.name}return null}function p(e){return e?e.enabled!==!1&&(e.apiKeyRequired===!1||e.apiKeySet===!0):!1}function m(e){let{providersView:t,templatesView:r,config:a,onlyConfigured:o=!1}=e,s=new Map((r?.providerTemplates??[]).map(e=>[e.providerType,e])),c=Object.values(t?.providers??a?.providers??{}).map(e=>{let{providerId:t}=e,r=e.providerType?s.get(e.providerType):void 0,a=t.trim(),o=n([t,r?.modelPrefix||``,r?.providerType||``]),c=n((e?.models??[]).map(e=>i(e,o))),d={...l(r?.modelConfig,o),...l(e?.modelConfig,o)},f=u(d),m=e?.displayName?.trim(),h=p(e);return{name:t,displayName:m||r?.displayName||t,prefix:a,aliases:o,models:c,modelConfig:d,modelThinking:f,configured:h}});return o?c.filter(e=>e.configured&&e.models.length>0):c}export{p as a,s as c,c as d,i as f,f as i,o as l,m as n,l as o,a as r,n as s,e as t,d as u};
@@ -1 +0,0 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,t as r}from"./utils-CBZPzC_b.js";import{Gt as i}from"./api-DqzQ-_3w.js";import{s as a}from"./i18n-20rSH40D.js";import{t as o}from"./createLucideIcon-BNKf0_kc.js";import{n as s}from"./chevron-down-BL-yMYcX.js";import{a as c,i as l,n as u,r as d,t as f}from"./select-CG5YWnwe.js";import{a as p,n as m,r as h,t as g}from"./popover-NkrFlWHp.js";import{f as _,i as v,r as y}from"./provider-models-hrHMcHqg.js";var b=o(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),x=e(n(),1),S=t(),C=p(`15rem`);function w(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function T({id:e,value:t,onChange:n,options:a,disabled:o=!1,placeholder:c,className:l,inputClassName:u,emptyText:d,createText:f,toggleLabel:p,maxItems:_=1/0,onEnter:v}){let[y,T]=(0,x.useState)(!1),E=(0,x.useRef)(null);(0,x.useEffect)(()=>{o&&y&&T(!1)},[o,y]);let D=(0,x.useMemo)(()=>w(a),[a]),O=t.trim().toLowerCase(),k=(0,x.useMemo)(()=>{let e=D.map((e,t)=>({option:e,index:t}));O.length>0&&e.sort((e,t)=>{let n=e.option.toLowerCase(),r=t.option.toLowerCase(),i=n===O?0:n.startsWith(O)?1:n.includes(O)?2:3,a=r===O?0:r.startsWith(O)?1:r.includes(O)?2:3;return i===a?e.index-t.index:i-a});let t=e.map(e=>e.option);return Number.isFinite(_)?t.slice(0,Math.max(1,_)):t},[D,O,_]),A=t.trim().length>0&&D.some(e=>e===t.trim()),j=()=>T(!1);return(0,S.jsxs)(g,{open:y&&!o,onOpenChange:e=>T(!o&&e),children:[(0,S.jsx)(m,{asChild:!0,children:(0,S.jsxs)(`div`,{ref:E,className:r(`relative`,l),children:[(0,S.jsx)(i,{id:e,value:t,disabled:o,onFocus:()=>{o||T(!0)},onChange:e=>{n(e.target.value),!y&&!o&&T(!0)},onKeyDown:e=>{e.key===`Enter`&&(v&&(e.preventDefault(),v()),j())},placeholder:c,className:r(`pr-10`,u)}),(0,S.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>T(e=>!e),disabled:o,className:r(`absolute inset-y-0 right-0 inline-flex w-10 items-center justify-center`,o?`cursor-not-allowed text-gray-300`:`text-gray-400 hover:text-gray-600`),"aria-label":p,children:(0,S.jsx)(b,{className:`h-4 w-4`})})]})}),(0,S.jsx)(h,{align:`start`,className:`flex w-[var(--radix-popover-trigger-width)] min-w-[12rem] flex-col overflow-hidden rounded-xl border border-gray-200 p-0 shadow-lg`,onInteractOutside:e=>{e.target instanceof Node&&E.current?.contains(e.target)&&e.preventDefault()},onOpenAutoFocus:e=>e.preventDefault(),style:{maxHeight:C},children:(0,S.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto py-1`,children:[!A&&t.trim().length>0&&(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(t.trim()),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,S.jsx)(s,{className:`h-4 w-4 text-transparent`}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:f.replace(`{value}`,t.trim())})]}),k.map(e=>(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(e),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,S.jsx)(s,{className:r(`h-4 w-4`,e===t.trim()?`text-primary`:`text-transparent`)}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:e})]},e)),k.length===0&&t.trim().length===0&&(0,S.jsx)(`div`,{className:`px-3 py-2 text-sm text-gray-500`,children:d})]})})]})}var E=`provider/model`;function D(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function O({id:e,value:t,onChange:n,providerCatalog:r,disabled:o=!1,providerPlaceholder:s,modelPlaceholder:p,className:m}){let[h,g]=(0,x.useState)(``),[b,C]=(0,x.useState)(``),w=r.length>0,O=p??E,k=(0,x.useMemo)(()=>new Map(r.map(e=>[e.name,e])),[r]),A=k.get(h),j=(0,x.useMemo)(()=>A?.aliases??[],[A]),M=(0,x.useMemo)(()=>D(A?.models??[]),[A]);return(0,x.useEffect)(()=>{let e=t.trim();if(!w){g(``),C(e);return}if(!e){C(``),g(e=>k.has(e)?e:``);return}let n=v(e,r)??``,i=k.get(n)?.aliases??[];g(n),C(n?_(e,i):e)},[w,r,k,t]),w?(0,S.jsxs)(`div`,{className:m,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,S.jsx)(`div`,{className:`sm:w-[38%] sm:min-w-[170px]`,children:(0,S.jsxs)(f,{value:h,onValueChange:e=>{let t=D(k.get(e)?.models??[])[0]??``;if(g(e),C(t),!t){n(``);return}n(y(k.get(e)?.prefix??e,t))},disabled:o,children:[(0,S.jsx)(l,{className:`h-10 w-full rounded-xl`,children:(0,S.jsx)(c,{placeholder:s??a(`providersSelectPlaceholder`)})}),(0,S.jsx)(u,{children:r.map(e=>(0,S.jsx)(d,{value:e.name,children:e.displayName},e.name))})]})}),(0,S.jsx)(`span`,{className:`hidden h-10 items-center justify-center leading-none text-lg font-semibold text-gray-300 sm:inline-flex`,children:`/`}),(0,S.jsx)(T,{id:e,value:b,onChange:e=>{if(!A){let t=e.trim();C(t),n(t);return}let t=_(e,j);C(t),n(t?y(A.prefix,t):``)},options:M,disabled:o||!h,placeholder:O,className:`sm:flex-1`,inputClassName:`h-10 rounded-xl`,emptyText:a(`modelPickerNoOptions`),createText:a(`modelPickerUseCustom`),toggleLabel:a(`modelPickerToggleOptions`)},h)]}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:a(`modelInputCustomHint`)})]}):(0,S.jsxs)(`div`,{className:m,children:[(0,S.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 px-4 py-3`,children:[(0,S.jsx)(`p`,{className:`text-sm font-semibold text-amber-950`,children:a(`providersEmptyTitle`)}),(0,S.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-900`,children:a(`providersEmptyDescription`)})]}),(0,S.jsx)(i,{id:e,value:t,disabled:o,onChange:e=>n(e.target.value),placeholder:O,className:`mt-3 h-10 rounded-xl`}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:a(`modelInputCustomHint`)})]})}export{O as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n,t as r}from"./utils-CBZPzC_b.js";import{Gt as i,Qt as a,Ut as o,Wt as s,Yt as c,hn as l,jn as u,vn as d}from"./api-DqzQ-_3w.js";import{l as f,s as p}from"./i18n-20rSH40D.js";import{n as m,t as h}from"./logo-badge-C-5-zim6.js";import{t as g}from"./createLucideIcon-BNKf0_kc.js";import{t as _}from"./search-CUe41wjm.js";import{t as v}from"./chevron-down-BL-yMYcX.js";import{n as y,t as b}from"./ellipsis-C5YXdOUx.js";import{a as x,i as S,n as C,r as w,t as T}from"./select-CG5YWnwe.js";import{t as E}from"./circle-alert-lSa3LRvS.js";import{t as D}from"./eye-C84inPcV.js";import{i as O,t as k}from"./use-viewport-layout-BS18drMT.js";import{t as A}from"./loader-circle-K1BDdHR5.js";import{t as j}from"./plus-LA8-jpxP.js";import{t as M}from"./refresh-cw-h9Xq3LY3.js";import{t as N}from"./settings-2-CE3ELQyk.js";import{n as P,t as F}from"./confirm-dialog-BTKCWMn6.js";import{t as I}from"./trash-2-BPPYt2NV.js";import{t as L}from"./x-DdXOqLnX.js";import{t as R}from"./host-capabilities-B107nwS3.js";import{i as z,r as B,t as V}from"./popover-NkrFlWHp.js";import{a as H,c as ee,l as U,o as W,t as te}from"./provider-models-hrHMcHqg.js";import{a as G,c as K,d as q,f as ne,h as re,i as ie,l as ae,m as oe,o as se,p as ce,r as le,y as ue}from"./use-config-BEdbtpD4.js";import{t as de}from"./form-actions-BRESe-m_.js";import{t as J}from"./config-hints-B_C9DAp5.js";import{a as fe,c as pe,i as me,l as he,n as ge,o as _e,r as ve,s as ye}from"./config-split-page-DqAXKLmG.js";var be=g(`CircleDotDashed`,[[`path`,{d:`M10.1 2.18a9.93 9.93 0 0 1 3.8 0`,key:`1qdqn0`}],[`path`,{d:`M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7`,key:`1bq7p6`}],[`path`,{d:`M21.82 10.1a9.93 9.93 0 0 1 0 3.8`,key:`1rlaqf`}],[`path`,{d:`M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69`,key:`1xk03u`}],[`path`,{d:`M13.9 21.82a9.94 9.94 0 0 1-3.8 0`,key:`l7re25`}],[`path`,{d:`M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7`,key:`1v18p6`}],[`path`,{d:`M2.18 13.9a9.93 9.93 0 0 1 0-3.8`,key:`xdo6bj`}],[`path`,{d:`M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69`,key:`1jjmaz`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),xe=g(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Y=e(n(),1),Se={providerId:``,providerType:null,isBuiltInType:!1,isCustom:!0,enabled:!0,displayName:``,apiKeySet:!1,apiKeyMasked:void 0,apiBase:null,extraHeaders:null,wireApi:null,models:[],modelConfig:{}};function X(e){if(!e)return null;let t=Object.entries(e).map(([e,t])=>[e.trim(),t]).filter(([e])=>e.length>0);return t.length===0?null:Object.fromEntries(t)}function Ce(e,t){let n=X(e),r=X(t);if(n===null&&r===null)return!0;if(!n||!r)return!1;let i=Object.entries(n).sort(([e],[t])=>e.localeCompare(t)),a=Object.entries(r).sort(([e],[t])=>e.localeCompare(t));return i.length===a.length?i.every(([e,t],n)=>e===a[n][0]&&t===a[n][1]):!1}function Z(e){if(!e||e.length===0)return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function we(e,t){let n=e.trim();if(!n||!t.trim())return n;let r=`${t.trim()}/`;return n.startsWith(r)?n.slice(r.length):n}function Q(e,t){let n=e.trim();if(!n)return``;for(let e of t){let t=e.trim();t&&(n=we(n,t))}return n.trim()}function Te(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function Ee(e,t){return Z(t)}function De(e,t){return Z(e).map(e=>{let n=e.trim();return!n||n.startsWith(`${t}/`)?n:`${t}/${n}`})}function Oe(e,t){let n=new Set(t.map(e=>e.trim()).filter(Boolean)),r={};for(let[t,i]of Object.entries(e)){if(!n.has(t))continue;let e={},a=ee(i.thinking?.supported);if(a.length>0){let t=U(i.thinking?.default);e.thinking=t&&a.includes(t)?{supported:a,default:t}:{supported:a}}i.vision===!0&&(e.vision=!0),(e.thinking||e.vision===!0)&&(r[t]=e)}return r}function ke(e,t,n){return{...W(e,n),...W(t,n)}}function Ae(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1){let a=n[i];if(a!==r[i])return!1;let o=e[a],s=t[a];if(!o||!s||!Te([...o.thinking?.supported??[]].sort(),[...s.thinking?.supported??[]].sort())||(o.thinking?.default??null)!==(s.thinking?.default??null)||(o.vision??!1)!==(s.vision??!1))return!1}return!0}function je(e){return e.providerName?e.apiKey.trim().length>0||e.apiBase.trim()!==e.currentApiBase.trim()||!Ce(e.extraHeaders,e.currentHeaders)||e.supportsWireApi&&e.wireApi!==e.currentWireApi||!Te(e.models,e.currentEditableModels)||!Ae(e.modelConfig,e.currentModelConfig)||e.providerDisplayName.trim()!==e.effectiveDisplayName:!1}function Me(e){let t={},n=e.apiKey.trim(),r=e.apiBase.trim(),i=X(e.extraHeaders),a=e.providerDisplayName.trim();return a!==e.effectiveDisplayName&&(t.displayName=a.length>0?a:null),n.length>0&&(t.apiKey=n),r!==e.currentApiBase.trim()&&(t.apiBase=r.length>0&&r!==e.defaultApiBase?r:null),Ce(i,e.currentHeaders)||(t.extraHeaders=i),e.supportsWireApi&&e.wireApi!==e.currentWireApi&&(t.wireApi=e.wireApi),Te(e.models,e.currentEditableModels)||(t.models=De(e.models,e.providerName??``)),Ae(e.modelConfig,e.currentModelConfig)||(t.modelConfig=Oe(e.modelConfig,e.models)),t}function Ne(e){let t=Q(e.models.find(e=>e.trim().length>0)??``,e.providerModelAliases),n={...Pe(e),model:t||null};return e.supportsWireApi&&(n.wireApi=e.wireApi),n}function Pe(e){let t={apiBase:e.apiBase.trim(),extraHeaders:X(e.extraHeaders)};return e.apiKey.trim().length>0&&(t.apiKey=e.apiKey.trim()),t}function Fe(e){return p(e===`off`?`chatThinkingLevelOff`:e===`minimal`?`chatThinkingLevelMinimal`:e===`low`?`chatThinkingLevelLow`:e===`medium`?`chatThinkingLevelMedium`:e===`high`?`chatThinkingLevelHigh`:e===`adaptive`?`chatThinkingLevelAdaptive`:`chatThinkingLevelXhigh`)}function Ie(e){let{providerName:t,methods:n,defaultMethodId:r,language:i}=e;if(n.length===0)return``;let a=new Map;for(let e of n){let t=e.id.trim();t&&a.set(t.toLowerCase(),t)}let o=(...e)=>{for(let t of e){let e=a.get(t.toLowerCase());if(e)return e}},s=r?.trim();if(t===`minimax-portal`){if(i===`zh`)return o(`cn`,`china-mainland`)??o(s??``)??n[0]?.id??``;if(i===`en`)return o(`global`,`intl`,`international`)??o(s??``)??n[0]?.id??``}if(s){let e=o(s);if(e)return e}return i===`zh`?o(`cn`)??n[0]?.id??``:i===`en`?o(`global`)??n[0]?.id??``:n[0]?.id??``}function Le(e){let{required:t,hasDefault:n,optionCount:r}=e;return t&&n&&r>1&&r<=3}function Re(e,t,n){let r=Q(t,n);return r?e.includes(r)?{models:e,draft:``}:{models:[...e,r],draft:``}:{models:e,draft:t}}function ze(e,t,n){let r=[...e],i=new Set(e);for(let e of t){let t=Q(e,n);t&&!i.has(t)&&(i.add(t),r.push(t))}return{models:r,addedCount:r.length-e.length}}function Be(e,t,n){return ze(e,t,n).models.slice(e.length)}function Ve(e,t,n){let r={...t};return delete r[n],{models:e.filter(e=>e!==n),modelConfig:r}}function He(e,t,n){let r=e[t],i=r?.thinking?.supported??[],a=i.includes(n)?i.filter(e=>e!==n):te.filter(e=>e===n||i.includes(e)),o=r?.thinking?.default&&a.includes(r.thinking.default)?r.thinking.default:void 0,s={...r,thinking:a.length>0?o?{supported:a,default:o}:{supported:a}:void 0},c={...e};return s.thinking||s.vision===!0?c[t]=s:delete c[t],c}function Ue(e,t,n){let r=e[t],i=r?.thinking;return!i||i.supported.length===0||n&&!i.supported.includes(n)?e:{...e,[t]:{...r,thinking:n?{supported:i.supported,default:n}:{supported:i.supported}}}}function We(e,t,n){let r={...e[t],vision:n?!0:void 0},i={...e};return r.thinking||r.vision===!0?i[t]=r:delete i[t],i}function Ge(e){let{providerName:t,providerSpec:n,language:r}=e,i=n?.auth,a=i?.methods??[];return{providerAuth:i,providerAuthMethodOptions:a.map(e=>({value:e.id,label:e.label?.[r]||e.label?.en||e.id})),providerAuthMethods:a,preferredAuthMethodId:Ie({providerName:n?.providerType??t,methods:a,defaultMethodId:i?.defaultMethodId,language:r}),shouldUseAuthMethodPills:Le({required:i?.kind===`device_code`,hasDefault:!!i?.defaultMethodId?.trim(),optionCount:a.length})}}function Ke(e,t){let n=!!e?.supportsWireApi||t,r=(e?.wireApiOptions||[`auto`,`chat`,`responses`]).map(e=>({value:e,label:p(e===`chat`?`wireApiChat`:e===`responses`?`wireApiResponses`:`wireApiAuto`)}));return{shouldUseWireApiPills:Le({required:n,hasDefault:typeof e?.defaultWireApi==`string`&&e.defaultWireApi.length>0,optionCount:r.length}),supportsWireApi:n,wireApiSelectOptions:r}}function qe(e){let{providerName:t,providersView:n,templatesView:r,schema:i,language:a}=e,o=t?n?.providers[t]:null,s=r?.providerTemplates.find(e=>e.providerType===o?.providerType),c=o??Se,l=i?.uiHints,u=!!o?.isCustom,d=t?J(`providers.${t}.apiKey`,l):void 0,f=t?J(`providers.${t}.apiBase`,l):void 0,m=t?J(`providers.${t}.extraHeaders`,l):void 0,h=t?J(`providers.${t}.wireApi`,l):void 0,g=s?.displayName||o?.displayName||t||``,_=(c.displayName||``).trim()||g,v=c.enabled!==!1,y=u||s?.supportsModelDiscovery===!0,b=Z([s?.modelPrefix||s?.providerType||``,t||``]),x=s?.defaultApiBase||``,S=c.apiBase||x,C=X(c.extraHeaders||null),w=c.wireApi||s?.defaultWireApi||`auto`,T=Ee(Z((s?.defaultModels??[]).map(e=>Q(e,b))),Z((c.models??[]).map(e=>Q(e,b)))),E=Oe(ke(s?.modelConfig,c.modelConfig,b),T),D=s?.apiBaseHelp?.[a]||s?.apiBaseHelp?.en||f?.help||p(`providerApiBaseHelp`),O=Ge({providerName:t,providerSpec:s,language:a}),k=Ke(s,u);return{apiBaseHelpText:D,apiBaseHint:f,apiKeyHint:d,currentApiBase:S,currentEditableModels:T,currentEnabled:v,currentHeaders:C,currentModelConfig:E,currentWireApi:w,defaultApiBase:x,defaultDisplayName:g,effectiveDisplayName:_,extraHeadersHint:m,...O,providerConfig:o,providerModelAliases:b,resolvedProviderConfig:c,supportsModelDiscovery:y,wireApiHint:h,...k}}function Je(e){let{providerName:t,providerAuth:n,resolvedAuthMethodId:r}=e,i=u(),a=oe(),o=ae(),s=K(),[c,l]=(0,Y.useState)(``),[f,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(``),_=(0,Y.useRef)(null),v=(0,Y.useCallback)(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),y=(0,Y.useCallback)((e,n)=>{v(),_.current=window.setTimeout(()=>{(async()=>{if(t)try{let r=await o.mutateAsync({provider:t,data:{sessionId:e}});if(r.status===`pending`){g(p(`providerAuthWaitingBrowser`)),y(e,r.nextPollMs??n);return}if(r.status===`authorized`){m(null),v(),g(p(`providerAuthCompleted`)),d.success(p(`providerAuthCompleted`)),i.invalidateQueries({queryKey:[`config`]}),i.invalidateQueries({queryKey:[`providers`]});return}m(null),v(),g(r.message||`Authorization ${r.status}.`),d.error(r.message||`Authorization ${r.status}.`)}catch(e){m(null),v();let t=e instanceof Error?e.message:String(e);g(t),d.error(`Authorization failed: ${t}`)}})()},Math.max(1e3,n))},[v,o,t,i]),b=(0,Y.useCallback)(async()=>{if(!(!t||n?.kind!==`device_code`))try{l(t),g(``);let e=await a.mutateAsync({provider:t,data:r?{methodId:r}:{}});if(!e.sessionId||!e.verificationUri)throw Error(p(`providerAuthStartFailed`));m(e.sessionId),g(`${p(`providerAuthOpenPrompt`)}${e.userCode}${p(`providerAuthOpenPromptSuffix`)}`),await R.openExternalUrl(e.verificationUri),y(e.sessionId,e.intervalMs)}catch(e){let t=e instanceof Error?e.message:String(e);m(null),v(),g(t),d.error(`${p(`providerAuthStartFailed`)}: ${t}`)}},[v,n?.kind,t,r,y,a]),x=(0,Y.useCallback)(async()=>{if(!(!t||n?.kind!==`device_code`))try{l(t),v(),m(null);let e=await s.mutateAsync({provider:t});g(`${p(`providerAuthImportStatusPrefix`)}${e.expiresAt?` (expires: ${e.expiresAt})`:``}`),d.success(p(`providerAuthImportSuccess`)),i.invalidateQueries({queryKey:[`config`]}),i.invalidateQueries({queryKey:[`providers`]})}catch(e){let t=e instanceof Error?e.message:String(e);g(t),d.error(`${p(`providerAuthImportFailed`)}: ${t}`)}},[v,s,n?.kind,t,i]);return(0,Y.useEffect)(()=>{v()},[v,t]),(0,Y.useEffect)(()=>()=>v(),[v]),{authSessionId:c===t?f:null,authStatusMessage:c===t?h:``,importAuthFromCli:x,importPending:s.isPending,startAuth:b,startPending:a.isPending}}function Ye(e){let{providerName:t,apiKey:n,apiKeyRequired:r,apiKeySet:i,apiBase:a,extraHeaders:o,supportsWireApi:s,wireApi:c,models:u,providerModelAliases:f}=e,m=re(),h=se(),g=(0,Y.useMemo)(()=>JSON.stringify({providerName:t,apiKey:n,apiBase:a,extraHeaders:o}),[a,n,o,t]),[_,v]=(0,Y.useState)(null),y=(0,Y.useCallback)(async()=>{if(t)try{let e=await m.mutateAsync({provider:t,data:Ne({apiKey:n,apiBase:a,extraHeaders:o,supportsWireApi:s,wireApi:c,models:u,providerModelAliases:f})});if(e.success){d.success(`${p(`providerTestConnectionSuccess`)} (${e.latencyMs}ms)`);return}let r=[`provider=${e.provider}`,`latency=${e.latencyMs}ms`];e.model&&r.push(`model=${e.model}`),d.error(`${p(`providerTestConnectionFailed`)}: ${e.message} | ${r.join(` | `)}`)}catch(e){let t=e instanceof Error?e.message:String(e);d.error(`${p(`providerTestConnectionFailed`)}: ${t}`)}},[a,n,o,u,f,t,s,m,c]);return{discoverModels:(0,Y.useCallback)(async()=>{if(!t)return null;if(r&&!n.trim()&&!i)return d.error(p(`providerModelsApiKeyRequired`)),null;try{let e=await h.mutateAsync({provider:t,data:Pe({apiKey:n,apiBase:a,extraHeaders:o})});return v({key:g,models:e.models}),d.success(p(`providerModelsFetchSuccess`)),e.models}catch(e){if(e instanceof l&&(e.details?.upstreamStatus===401||e.details?.upstreamStatus===403))return d.error(p(`providerModelsAuthorizationFailed`)),null;let t=e instanceof Error?e.message:String(e);return d.error(`${p(`providerModelsFetchFailed`)}: ${t}`),null}},[a,n,r,i,h,g,o,t]),fetchedModels:_?.key===g?_.models:[],isDiscoveringModels:h.isPending,isTestPending:m.isPending,testConnection:y}}var $=t();function Xe({value:e,onChange:t,className:n}){let a=e?Object.entries(e):[],o=(e,n,r)=>{let i=[...a];i[e]=[n,r],t(Object.fromEntries(i))},s=()=>{t({...e,"":``})},l=e=>{let n=a.filter((t,n)=>n!==e);t(Object.fromEntries(n))};return(0,$.jsxs)(`div`,{className:r(`space-y-2`,n),children:[a.map(([e,t],n)=>(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(i,{type:`text`,value:e,onChange:e=>o(n,e.target.value,t),placeholder:p(`headerName`),className:`flex-1`}),(0,$.jsx)(i,{type:`text`,value:t,onChange:t=>o(n,e,t.target.value),placeholder:p(`headerValue`),className:`flex-1`}),(0,$.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>l(n),children:(0,$.jsx)(I,{className:`h-4 w-4 text-red-500`})})]},n)),(0,$.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:s,children:[(0,$.jsx)(j,{className:`h-4 w-4 mr-2`}),p(`add`)]})]})}function Ze(e){let{value:t,onChange:n,options:r}=e;return(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let r=e.value===t;return(0,$.jsx)(`button`,{type:`button`,onClick:()=>n(e.value),"aria-pressed":r,className:`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors ${r?`border-foreground/15 bg-foreground text-background`:`border-border/55 bg-muted/50 text-muted-foreground hover:border-border hover:bg-muted hover:text-foreground`}`,children:e.label},e.value)})})}function Qe(e){let{showAdvanced:t,onShowAdvancedChange:n,supportsWireApi:r,wireApiLabel:i,wireApi:a,onWireApiChange:o,shouldUseWireApiPills:c,wireApiSelectOptions:l,extraHeadersLabel:u,extraHeaders:d,onExtraHeadersChange:f}=e;return(0,$.jsxs)(`div`,{className:`border-t border-border/70 pt-4`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center justify-between text-sm text-muted-foreground transition-colors hover:text-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(N,{className:`h-3.5 w-3.5`}),p(`providerAdvancedSettings`)]}),(0,$.jsx)(v,{className:`h-4 w-4 transition-transform ${t?`rotate-180`:``}`})]}),t?(0,$.jsxs)(`div`,{className:`mt-4 space-y-5`,children:[r?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`wireApi`,className:`text-sm font-medium text-foreground`,children:i}),c?(0,$.jsx)(Ze,{value:a,onChange:e=>o(e),options:l}):(0,$.jsxs)(T,{value:a,onValueChange:e=>o(e),children:[(0,$.jsx)(S,{className:`rounded-xl`,children:(0,$.jsx)(x,{})}),(0,$.jsx)(C,{children:l.map(e=>(0,$.jsx)(w,{value:e.value,children:e.label},e.value))})]})]}):null,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{className:`text-sm font-medium text-foreground`,children:u}),(0,$.jsx)(Xe,{value:d,onChange:f}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerExtraHeadersHelpShort`)})]})]}):null]})}function $e({isSet:e,className:t,value:n,onChange:a,placeholder:o,...s}){let[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1),p=typeof n==`string`&&n.length>0;return(0,$.jsxs)(`div`,{className:`relative`,children:[e&&!p&&!d?(0,$.jsx)(`div`,{onClick:()=>f(!0),className:r(`flex h-9 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2 text-sm text-gray-500 cursor-text items-center pr-12`,t),children:`••••••••••••`}):(0,$.jsx)(i,{type:l?`text`:`password`,className:r(`pr-12`,t),value:n,onChange:a,onBlur:()=>{p||f(!1)},placeholder:o,autoFocus:d,...s}),(0,$.jsx)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2 flex gap-1`,children:(e||p)&&(0,$.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:()=>u(!l),children:l?(0,$.jsx)(xe,{className:`h-4 w-4`}):(0,$.jsx)(D,{className:`h-4 w-4`})})})]})}function et(e){let{apiKey:t,apiKeyRequired:n,apiKeySet:r,apiKeyPlaceholder:i,providerAuth:a,providerAuthNote:o,providerAuthMethodOptions:l,providerAuthMethodsCount:u,selectedAuthMethodHint:d,shouldUseAuthMethodPills:f,resolvedAuthMethodId:m,onAuthMethodChange:h,onStartProviderAuth:g,onImportProviderAuthFromCli:_,startPending:v,importPending:y,authSessionId:b,authStatusMessage:E,onApiKeyChange:D}=e,O=n?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`apiKey`,className:`text-sm font-medium text-foreground`,children:p(`apiKey`)}),(0,$.jsx)($e,{id:`apiKey`,value:t,isSet:r,onChange:e=>D(e.target.value),placeholder:i,className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`leaveBlankToKeepUnchanged`)})]}):null;return a?.kind===`device_code`?(0,$.jsxs)($.Fragment,{children:[O,(0,$.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-muted/45 p-3`,children:[(0,$.jsx)(s,{className:`text-sm font-medium text-foreground`,children:a.displayName||p(`providerAuthSectionTitle`)}),o?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o}):null,u>1?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{className:`text-xs font-medium text-foreground`,children:p(`providerAuthMethodLabel`)}),f?(0,$.jsx)(Ze,{value:m,onChange:h,options:l}):(0,$.jsxs)(T,{value:m,onValueChange:h,children:[(0,$.jsx)(S,{className:`h-8 rounded-lg`,children:(0,$.jsx)(x,{placeholder:p(`providerAuthMethodPlaceholder`)})}),(0,$.jsx)(C,{children:l.map(e=>(0,$.jsx)(w,{value:e.value,children:e.label},e.value))})]}),d?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d}):null]}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:g,disabled:v||!!b,children:p(v?`providerAuthStarting`:b?`providerAuthAuthorizing`:`providerAuthAuthorizeInBrowser`)}),a.supportsCliImport?(0,$.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:_,disabled:y,children:p(y?`providerAuthImporting`:`providerAuthImportFromCli`)}):null,b?(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[p(`providerAuthSessionLabel`),`: `,b.slice(0,8),`…`]}):null]}),E?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:E}):null]})]}):O}function tt(e){let{providerName:t,models:n,aliases:r,fetchedModels:i=[],onModelsChange:a}=e,o=q({pollWhileRefreshing:!0,refreshOnMount:!0}),s=t?o.data?.providers[t]:void 0,c=i.length>0?`fetched`:`background`,l=(0,Y.useMemo)(()=>Be(n,c===`fetched`?i:s?.models??[],r),[r,s?.models,i,n,c]);return{addSuggestedModels:(0,Y.useCallback)(e=>{let t=ze(n,e,r);t.addedCount>0&&a(t.models)},[r,n,a]),hasSuggestionError:!!(s?.lastError&&!s.fetchedAt),isCheckingSuggestions:!!(t&&(o.isLoading||o.data?.refreshing&&!s)),suggestedModels:l,suggestionSource:c}}function nt(e){let{models:t,modelConfig:n,onModelsChange:r,onRemoveModel:i,onToggleModelThinkingLevel:a,onSetModelThinkingDefault:c,onSetModelVision:l,thinkingLevels:u,formatThinkingLevelLabel:d}=e,[f,m]=(0,Y.useState)(!1),[h,g]=(0,Y.useState)(()=>new Set),_=(0,Y.useMemo)(()=>t.filter(e=>h.has(e)),[t,h]),v=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},y=()=>{m(!1),g(new Set)};return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`div`,{className:`flex min-h-7 flex-wrap items-center justify-end gap-2`,children:f?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:p(`providerModelsSuggestionsSelected`).replace(`{count}`,String(_.length))}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-primary hover:text-primary/80`,onClick:()=>g(_.length===t.length?new Set:new Set(t)),children:p(_.length===t.length?`providerModelsClearSelection`:`providerModelsSelectAll`)}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-muted-foreground hover:text-foreground`,onClick:y,children:p(`cancel`)}),(0,$.jsxs)(`button`,{type:`button`,disabled:_.length===0,className:`inline-flex items-center gap-1 rounded-md bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/15 disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>{_.length!==0&&(r(t.filter(e=>!h.has(e))),y())},children:[(0,$.jsx)(I,{className:`h-3 w-3`}),p(`providerModelsRemoveSelected`)]})]}):(0,$.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground`,onClick:()=>m(!0),children:[(0,$.jsx)(I,{className:`h-3 w-3`}),p(`providerModelsBulkRemove`)]})}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>{if(f)return(0,$.jsxs)(`label`,{className:`inline-flex max-w-full cursor-pointer items-center gap-2 rounded-full border border-border/55 bg-muted/45 px-3 py-1.5 hover:bg-muted/70`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:h.has(e),onChange:()=>v(e),"aria-label":p(`providerModelsSuggestionSelect`).replace(`{model}`,e),className:`h-3.5 w-3.5 shrink-0 accent-primary`}),(0,$.jsx)(`span`,{className:`max-w-[140px] truncate text-sm text-foreground sm:max-w-[220px]`,children:e})]},e);let t=n[e],r=t?.thinking,m=r?.supported??[],g=r?.default??null,_=t?.vision===!0;return(0,$.jsxs)(`div`,{className:`group inline-flex max-w-full items-center gap-1 rounded-full border border-border/55 bg-muted/45 px-3 py-1.5`,children:[(0,$.jsx)(`span`,{className:`max-w-[140px] truncate text-sm text-foreground sm:max-w-[220px]`,children:e}),(0,$.jsxs)(V,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 opacity-100 transition-opacity hover:bg-muted hover:text-foreground md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,"aria-label":p(`providerModelThinkingTitle`),title:p(`providerModelThinkingTitle`),children:(0,$.jsx)(N,{className:`h-3 w-3`})})}),(0,$.jsxs)(B,{className:`w-80 space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:p(`providerModelVisionTitle`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelVisionHint`)})]}),(0,$.jsx)(o,{checked:_,onCheckedChange:t=>l(e,t)})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:p(`providerModelThinkingTitle`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelThinkingHint`)})]}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u.map(t=>(0,$.jsx)(`button`,{type:`button`,onClick:()=>a(e,t),className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${m.includes(t)?`border-foreground/15 bg-foreground text-background`:`border-border/55 bg-muted/50 text-muted-foreground hover:border-border hover:bg-muted hover:text-foreground`}`,children:d(t)},t))}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(s,{className:`text-xs font-medium text-foreground`,children:p(`providerModelThinkingDefault`)}),(0,$.jsxs)(T,{value:g??`__none__`,onValueChange:t=>c(e,t===`__none__`?null:t),disabled:m.length===0,children:[(0,$.jsx)(S,{className:`h-8 rounded-lg text-xs`,children:(0,$.jsx)(x,{})}),(0,$.jsxs)(C,{children:[(0,$.jsx)(w,{value:`__none__`,children:p(`providerModelThinkingDefaultNone`)}),m.map(e=>(0,$.jsx)(w,{value:e,children:d(e)},e))]})]}),m.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelThinkingNoSupported`)}):null]})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 opacity-100 transition-opacity hover:bg-muted hover:text-foreground md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,"aria-label":p(`remove`),children:(0,$.jsx)(L,{className:`h-3 w-3`})})]},e)})}),f?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerModelsRemoveSaveHint`)}):null]})}var rt=20,it=50,at=50;function ot(e){let{expanded:t,fetchedTotal:n,models:r,source:a,onExpandedChange:o,onAddModels:s}=e,[c,l]=(0,Y.useState)(``),[u,d]=(0,Y.useState)(()=>new Set),f=(0,Y.useMemo)(()=>{let e=c.trim().toLowerCase();return e?r.filter(t=>t.toLowerCase().includes(e)):r},[r,c]),m=f.slice(0,at),h=(0,Y.useMemo)(()=>r.filter(e=>u.has(e)),[r,u]),g=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},v=e=>{e.length!==0&&(s(e),l(``),d(new Set))},b=a===`fetched`?`providerModelsFetchedSuggestionsSummary`:`providerModelsSuggestionsSummary`;return a===`fetched`&&r.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/35 px-3 py-2 text-xs text-muted-foreground`,role:`status`,children:[(0,$.jsx)(P,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,$.jsx)(`span`,{children:p(`providerModelsFetchedAllConfigured`).replace(`{count}`,String(n))})]}):(0,$.jsxs)(`div`,{className:`rounded-xl bg-muted/35 p-2`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":t,className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground`,onClick:()=>o(!t),children:[(0,$.jsx)(P,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:p(b).replace(`{count}`,String(r.length))}),(0,$.jsx)(y,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${t?`rotate-90`:``}`})]}),r.length<=it?(0,$.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-lg px-2 py-1.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10`,onClick:()=>v(r),children:p(`providerModelsSuggestionsAddAll`)}):null]}),t?(0,$.jsxs)(`div`,{className:`px-1 pb-1`,children:[r.length>rt?(0,$.jsxs)(`div`,{className:`relative px-2 pb-1 pt-1.5`,children:[(0,$.jsx)(_,{className:`pointer-events-none absolute left-4 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,$.jsx)(i,{value:c,onChange:e=>l(e.target.value),placeholder:p(`providerModelsSuggestionsSearchPlaceholder`),className:`h-8 rounded-lg pl-8 text-xs`})]}):null,(0,$.jsxs)(`div`,{className:`custom-scrollbar max-h-44 overflow-y-auto overscroll-contain`,children:[m.map(e=>(0,$.jsxs)(`label`,{className:`grid min-w-0 cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-muted/70`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:u.has(e),onChange:()=>g(e),"aria-label":p(`providerModelsSuggestionSelect`).replace(`{model}`,e),className:`h-3.5 w-3.5 shrink-0 accent-primary`}),(0,$.jsx)(`span`,{className:`block min-w-0 truncate text-xs text-foreground`,title:e,children:e})]},e)),f.length===0?(0,$.jsx)(`p`,{className:`px-2 py-4 text-center text-xs text-muted-foreground`,children:p(`providerModelsSuggestionsSearchEmpty`)}):null]}),f.length>m.length?(0,$.jsx)(`p`,{className:`px-2 pt-1 text-[11px] text-muted-foreground`,children:p(`providerModelsSuggestionsShowing`).replace(`{visible}`,String(m.length)).replace(`{count}`,String(f.length))}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pt-1.5`,children:[(0,$.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:p(`providerModelsSuggestionsSelected`).replace(`{count}`,String(h.length))}),(0,$.jsx)(`button`,{type:`button`,disabled:h.length===0,className:`shrink-0 rounded-md bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary transition-colors hover:bg-primary/15 disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>v(h),children:p(`providerModelsSuggestionsAddSelected`)})]}),(0,$.jsx)(`p`,{className:`px-2 pb-1 pt-1 text-[11px] text-muted-foreground`,children:p(`providerModelsSuggestionsSaveHint`)})]}):null]})}function st({hasFetchedCatalog:e,hasSuggestionError:t,supportsModelDiscovery:n}){return!n||!t||e?null:(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-xl bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[(0,$.jsx)(E,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),p(`providerModelsSuggestionsFailed`)]})}function ct(e){let{providerName:t,providerModelAliases:n,models:r,modelConfig:a,modelDraft:o,showModelInput:l,onModelDraftChange:u,onShowModelInputChange:d,onAddModel:f,onModelsChange:m,supportsModelDiscovery:h,onDiscoverModels:g,isDiscoveringModels:_,fetchedModels:v,onRemoveModel:y,onToggleModelThinkingLevel:b,onSetModelThinkingDefault:x,onSetModelVision:S,thinkingLevels:C,formatThinkingLevelLabel:w}=e,[T,E]=(0,Y.useState)(!1),D=(0,Y.useRef)(null),{addSuggestedModels:O,hasSuggestionError:k,isCheckingSuggestions:N,suggestedModels:P,suggestionSource:F}=tt({providerName:t,models:r,aliases:n,fetchedModels:v,onModelsChange:m}),I=async()=>{await g()&&(E(!0),window.requestAnimationFrame(()=>{let e=D.current;e?.scrollIntoView?.({behavior:`smooth`,block:`center`}),e?.focus({preventScroll:!0})}))},R=v.length>0;return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(s,{className:`text-sm font-medium text-foreground`,children:p(`providerModelsTitle`)}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[h?(0,$.jsxs)(`button`,{type:`button`,onClick:I,disabled:_,className:`flex items-center gap-1 text-xs font-medium text-primary transition-colors hover:text-primary/80 disabled:cursor-wait disabled:opacity-60`,children:[(0,$.jsx)(M,{className:`h-3 w-3 ${_?`animate-spin`:``}`}),p(_?`providerModelsFetching`:`providerModelsFetch`)]}):null,l?null:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>d(!0),className:`flex items-center gap-1 text-xs font-medium text-primary hover:text-primary/80`,children:[(0,$.jsx)(j,{className:`h-3 w-3`}),p(`providerAddModel`)]})]})]}),l?(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(i,{value:o,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f()),e.key===`Escape`&&(d(!1),u(``))},placeholder:p(`providerModelInputPlaceholder`),className:`flex-1 rounded-xl`,autoFocus:!0}),(0,$.jsx)(c,{type:`button`,size:`sm`,onClick:f,disabled:o.trim().length===0,children:p(`add`)}),(0,$.jsx)(c,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{d(!1),u(``)},children:(0,$.jsx)(L,{className:`h-4 w-4`})})]}):null,(0,$.jsx)(st,{hasFetchedCatalog:R,hasSuggestionError:k,supportsModelDiscovery:h}),h&&N&&!R?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/35 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(A,{className:`h-3.5 w-3.5 animate-spin`}),p(`providerModelsSuggestionsChecking`)]}):h&&(P.length>0||R)?(0,$.jsx)(`div`,{ref:D,tabIndex:-1,"aria-live":`polite`,className:`scroll-m-4 outline-none`,children:(0,$.jsx)(ot,{expanded:T,fetchedTotal:v.length,models:P,source:F,onExpandedChange:E,onAddModels:O})}):null,r.length===0?(0,$.jsxs)(`div`,{className:`rounded-xl bg-muted/35 px-4 py-6 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:p(`providerModelsEmptyShort`)}),l?null:(0,$.jsx)(`button`,{type:`button`,onClick:()=>d(!0),className:`mt-2 text-sm font-medium text-primary hover:text-primary/80`,children:p(`providerAddFirstModel`)})]}):(0,$.jsx)(nt,{models:r,modelConfig:a,onModelsChange:m,onRemoveModel:y,onToggleModelThinkingLevel:b,onSetModelThinkingDefault:x,onSetModelVision:S,thinkingLevels:C,formatThinkingLevelLabel:w})]})}function lt({apiKeyRequired:e=!0,apiKeySet:t,className:n,enabled:r}){if(!r)return(0,$.jsx)(m,{status:`inactive`,label:p(`disabled`),className:n});let i=!e||t;return(0,$.jsx)(m,{status:i?`ready`:`setup`,label:p(i?`statusReady`:`statusSetup`),className:n})}function ut(e){let{context:t,language:n,providerTitle:r,providerDisplayName:a,apiKey:o,apiBase:l,extraHeaders:u,wireApi:d,models:f,modelConfig:m,modelDraft:h,showAdvanced:g,showModelInput:_,resolvedAuthMethodId:v,authSessionId:y,authStatusMessage:b,hasChanges:x,isDeletePending:S,isUpdatePending:C,connectivity:w,startPending:T,importPending:E,onProviderDisplayNameChange:D,onApiKeyChange:O,onApiBaseChange:k,onAuthMethodChange:A,onStartProviderAuth:j,onImportProviderAuthFromCli:M,onModelDraftChange:N,onShowModelInputChange:P,onAddModel:F,onModelsChange:L,onRemoveModel:R,onToggleModelThinkingLevel:z,onSetModelThinkingDefault:B,onSetModelVision:V,onShowAdvancedChange:H,onWireApiChange:ee,onExtraHeadersChange:U,onDeleteProvider:W,onSubmit:G,onTestConnection:K}=e,q=t.providerAuthMethods.find(e=>e.id===v);return(0,$.jsxs)(ge,{children:[(0,$.jsx)(pe,{className:`px-5 py-4`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`truncate text-lg font-semibold text-foreground`,children:r}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:W,disabled:S,className:`text-muted-foreground/70 transition-colors hover:text-red-500`,title:p(`providerDelete`),children:(0,$.jsx)(I,{className:`h-4 w-4`})}),(0,$.jsx)(lt,{enabled:t.currentEnabled,apiKeyRequired:t.resolvedProviderConfig.apiKeyRequired,apiKeySet:t.resolvedProviderConfig.apiKeySet})]})]})}),(0,$.jsxs)(`form`,{onSubmit:G,className:`flex min-h-0 flex-1 flex-col`,children:[(0,$.jsxs)(_e,{className:`space-y-4 px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`providerDisplayName`,className:`text-sm font-medium text-foreground`,children:p(`providerDisplayName`)}),(0,$.jsx)(i,{id:`providerDisplayName`,type:`text`,value:a,onChange:e=>D(e.target.value),placeholder:t.defaultDisplayName||p(`providerDisplayNamePlaceholder`),className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`providerDisplayNameHelpShort`)})]}),(0,$.jsx)(et,{apiKey:o,apiKeyRequired:t.resolvedProviderConfig.apiKeyRequired!==!1,apiKeySet:t.resolvedProviderConfig.apiKeySet,apiKeyPlaceholder:t.apiKeyHint?.placeholder??p(`enterApiKey`),providerAuth:t.providerAuth,providerAuthNote:t.providerAuth?.note?.[n]||t.providerAuth?.note?.en||t.providerAuth?.displayName||``,providerAuthMethodOptions:t.providerAuthMethodOptions,providerAuthMethodsCount:t.providerAuthMethods.length,selectedAuthMethodHint:q?.hint?.[n]||q?.hint?.en||``,shouldUseAuthMethodPills:t.shouldUseAuthMethodPills,resolvedAuthMethodId:v,onAuthMethodChange:A,onStartProviderAuth:j,onImportProviderAuthFromCli:M,startPending:T,importPending:E,authSessionId:y,authStatusMessage:b,onApiKeyChange:O}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(s,{htmlFor:`apiBase`,className:`text-sm font-medium text-foreground`,children:p(`apiBase`)}),(0,$.jsx)(i,{id:`apiBase`,type:`text`,value:l,onChange:e=>k(e.target.value),placeholder:t.defaultApiBase||t.apiBaseHint?.placeholder||`https://api.example.com`,className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.apiBaseHelpText})]}),(0,$.jsx)(ct,{providerName:t.providerConfig?.providerId??``,providerModelAliases:t.providerModelAliases,models:f,modelConfig:m,modelDraft:h,showModelInput:_,onModelDraftChange:N,onShowModelInputChange:P,onAddModel:F,onModelsChange:L,supportsModelDiscovery:t.supportsModelDiscovery,onDiscoverModels:w.discoverModels,isDiscoveringModels:w.isDiscoveringModels,fetchedModels:w.fetchedModels,onRemoveModel:R,onToggleModelThinkingLevel:z,onSetModelThinkingDefault:B,onSetModelVision:V,thinkingLevels:te,formatThinkingLevelLabel:Fe},t.providerConfig?.providerId),(0,$.jsx)(Qe,{showAdvanced:g,onShowAdvancedChange:H,supportsWireApi:t.supportsWireApi,wireApiLabel:p(`wireApi`),wireApi:d,onWireApiChange:ee,shouldUseWireApiPills:t.shouldUseWireApiPills,wireApiSelectOptions:t.wireApiSelectOptions,extraHeadersLabel:p(`extraHeaders`),extraHeaders:u,onExtraHeadersChange:U})]}),(0,$.jsx)(ye,{children:(0,$.jsxs)(de,{align:`between`,children:[(0,$.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:K,disabled:w.isTestPending,children:[(0,$.jsx)(be,{className:`mr-1.5 h-3.5 w-3.5`}),w.isTestPending?p(`providerTestingConnection`):p(`providerTestConnection`)]}),(0,$.jsx)(c,{type:`submit`,size:`sm`,disabled:C||!x,children:p(C?`saving`:x?`save`:`unchanged`)})]})})]})]})}function dt({providerName:e,onProviderDeleted:t}){let{data:n}=ce(),{data:r}=ne(),{data:i}=le(),a=f(),o=(0,Y.useMemo)(()=>qe({providerName:e,providersView:n,templatesView:r,schema:i,language:a}),[a,e,n,i,r]);if(!e||!o.providerConfig)return(0,$.jsx)(ve,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:p(`providersSelectTitle`)}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:p(`providersSelectDescription`)})]})});let s=JSON.stringify({providerConfig:o.providerConfig,currentApiBase:o.currentApiBase,currentEditableModels:o.currentEditableModels,currentModelConfig:o.currentModelConfig,currentWireApi:o.currentWireApi,effectiveDisplayName:o.effectiveDisplayName,preferredAuthMethodId:o.preferredAuthMethodId});return(0,$.jsx)(ft,{providerName:e,onProviderDeleted:t,context:o,language:a},s)}function ft({providerName:e,onProviderDeleted:t,context:n,language:r}){let i=ue(),a=G(),{currentApiBase:o,currentEditableModels:s,currentHeaders:c,currentModelConfig:l,currentWireApi:u,defaultApiBase:d,effectiveDisplayName:f,providerAuth:m,providerAuthMethods:h,providerModelAliases:g,resolvedProviderConfig:_,preferredAuthMethodId:v,supportsWireApi:y}=n,[b,x]=(0,Y.useState)(``),[S,C]=(0,Y.useState)(o),[w,T]=(0,Y.useState)(_.extraHeaders||null),[E,D]=(0,Y.useState)(u),[O,k]=(0,Y.useState)(s),[A,j]=(0,Y.useState)(l),[M,N]=(0,Y.useState)(``),[P,F]=(0,Y.useState)(f),[I,L]=(0,Y.useState)(!1),[R,z]=(0,Y.useState)(!1),[B,V]=(0,Y.useState)(v),H=Ye({providerName:e,apiKey:b,apiKeyRequired:_.apiKeyRequired!==!1,apiKeySet:_.apiKeySet,apiBase:S,extraHeaders:w,supportsWireApi:y,wireApi:E,models:O,providerModelAliases:g}),ee=P.trim()||f||e||p(`providersSelectPlaceholder`),U=(0,Y.useMemo)(()=>{if(!h.length)return``;let e=B.trim();return e&&h.some(t=>t.id===e)?e:v||h[0]?.id||``},[B,v,h]),{authSessionId:W,authStatusMessage:te,importAuthFromCli:K,importPending:q,startAuth:ne,startPending:re}=Je({providerName:e,providerAuth:m,resolvedAuthMethodId:U}),ie=(0,Y.useMemo)(()=>je({providerName:e,apiKey:b,apiBase:S,currentApiBase:o,extraHeaders:w,currentHeaders:c,supportsWireApi:y,wireApi:E,currentWireApi:u,models:O,currentEditableModels:s,modelConfig:A,currentModelConfig:l,providerDisplayName:P,effectiveDisplayName:f}),[e,b,S,o,w,c,y,E,u,O,s,A,l,P,f]),ae=e=>{k(e),j(t=>Oe(t,e))};return(0,$.jsx)(ut,{context:n,language:r,providerTitle:ee,providerDisplayName:P,apiKey:b,apiBase:S,extraHeaders:w,wireApi:E,models:O,modelConfig:A,modelDraft:M,showAdvanced:I,showModelInput:R,resolvedAuthMethodId:U,authSessionId:W,authStatusMessage:te,hasChanges:ie,isDeletePending:a.isPending,isUpdatePending:i.isPending,connectivity:H,startPending:re,importPending:q,onProviderDisplayNameChange:F,onApiKeyChange:x,onApiBaseChange:C,onAuthMethodChange:V,onStartProviderAuth:ne,onImportProviderAuthFromCli:K,onModelDraftChange:N,onShowModelInputChange:z,onAddModel:()=>{let e=Re(O,M,g);ae(e.models),N(e.draft)},onModelsChange:ae,onRemoveModel:e=>{let t=Ve(O,A,e);k(t.models),j(t.modelConfig)},onToggleModelThinkingLevel:(e,t)=>{j(n=>He(n,e,t))},onSetModelThinkingDefault:(e,t)=>{j(n=>Ue(n,e,t))},onSetModelVision:(e,t)=>{j(n=>We(n,e,t))},onShowAdvancedChange:L,onWireApiChange:D,onExtraHeadersChange:T,onDeleteProvider:async()=>{if(e&&window.confirm(p(`providerDeleteConfirm`)))try{await a.mutateAsync({provider:e}),t?.(e)}catch{}},onSubmit:t=>{t.preventDefault(),e&&i.mutate({provider:e,data:Me({providerName:e,apiKey:b,apiBase:S,currentApiBase:o,defaultApiBase:d,extraHeaders:w,currentHeaders:c,supportsWireApi:y,wireApi:E,currentWireApi:u,models:O,currentEditableModels:s,modelConfig:A,currentModelConfig:l,providerDisplayName:P,effectiveDisplayName:f})})},onTestConnection:H.testConnection})}function pt(e){if(!e)return null;try{let t=new URL(e);return`${t.host}${t.pathname&&t.pathname!==`/`?t.pathname:``}`}catch{return e.replace(/^https?:\/\//,``)}}function mt(e,t=[]){let n=new Map(t.map((e,t)=>[e,t]));return e.map((e,t)=>({provider:e,index:t})).sort((e,t)=>{let r=n.get(e.provider.providerId),i=n.get(t.provider.providerId);if(r!==void 0||i!==void 0)return(r??2**53-1)-(i??2**53-1);let a=e.provider.providerType===`nextclaw`?1:0,o=t.provider.providerType===`nextclaw`?1:0;return a===o?e.index-t.index:a-o}).map(({provider:e})=>e)}function ht(e){let t=e.findIndex(e=>e.providerType===`zhipu`),n=e.findIndex(e=>e.providerType===`dashscope-coding-plan`);return e.map((e,t)=>({template:e,index:t})).sort((e,r)=>{let i=({template:e,index:r})=>e.providerType===`nextclaw`?2**53-1:e.providerType===`deepseek`&&n>=0?n-.5:e.providerType===`mimo`&&t>=0?t+.5:r;return i(e)-i(r)}).map(({template:e})=>e)}function gt(){let{isMobile:e}=k(),{data:t}=ce(),{data:n}=ne(),s=ie(),l=G(),u=ue(),[d,f]=(0,Y.useState)(null),[g,v]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)([]),[w,T]=(0,Y.useState)(``),E=(0,Y.useMemo)(()=>mt(Object.values(t?.providers??{}),S),[t?.providers,S]),D=(0,Y.useMemo)(()=>n?.providerTemplates??[],[n?.providerTemplates]),A=(0,Y.useMemo)(()=>ht(D),[D]),M=(0,Y.useMemo)(()=>new Map(D.map(e=>[e.providerType,e])),[D]),N=(0,Y.useMemo)(()=>{let e=w.trim().toLowerCase();return E.filter(t=>{if(!e)return!0;let n=t.providerType?M.get(t.providerType):null;return(t.displayName?.trim()||n?.displayName||t.providerId).toLowerCase().includes(e)||t.providerId.toLowerCase().includes(e)})},[E,w,M]),P=(0,Y.useMemo)(()=>d&&N.some(e=>e.providerId===d)?d:e?null:N[0]?.providerId??null,[N,e,d]);return!t||!n?(0,$.jsx)(a,{title:p(`providersPageTitle`),description:p(`providersPageDescription`),layout:`split`,children:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:p(`providersLoading`)})}):(0,$.jsxs)(a,{title:p(`providersPageTitle`),description:p(`providersPageDescription`),layout:`split`,children:[(0,$.jsxs)(fe,{className:`md:min-h-0`,compactView:d?`detail`:`list`,onMobileBack:()=>f(null),mobileListLabel:p(`providersPageTitle`),children:[(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{className:`space-y-3 px-4 pb-3 pt-4`,children:(0,$.jsxs)(V,{open:y,onOpenChange:x,children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsxs)(c,{type:`button`,variant:`outline`,className:`w-full justify-center`,disabled:s.isPending,children:[(0,$.jsx)(j,{className:`mr-2 h-4 w-4`}),s.isPending?p(`saving`):p(`providerAdd`)]})}),(0,$.jsxs)(B,{className:`w-[42rem] max-w-[calc(100vw-2rem)] p-3`,align:`start`,children:[(0,$.jsx)(`div`,{className:`mb-2 px-1 text-xs font-semibold text-muted-foreground`,children:p(`providerTemplatePickerTitle`)}),(0,$.jsxs)(`div`,{className:`grid max-h-[24rem] grid-cols-2 gap-2 overflow-y-auto sm:grid-cols-3`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full flex-col items-start gap-2 rounded-lg border border-dashed border-border/70 bg-muted/20 px-3 py-2 text-left transition-colors hover:border-border hover:bg-muted/45`,onClick:async()=>{try{let e=await s.mutateAsync({data:{providerType:null}});T(``),f(e.providerId),C(t=>[e.providerId,...t.filter(t=>t!==e.providerId)]),x(!1)}catch{}},children:[(0,$.jsx)(h,{name:`custom`,className:`h-8 w-8 rounded-lg border border-border/60 bg-muted/50`}),(0,$.jsx)(`span`,{className:`line-clamp-2 min-w-0 text-xs font-semibold leading-4 text-foreground`,children:p(`providerAddCustom`)})]}),A.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full flex-col items-start gap-2 rounded-lg border border-border/55 bg-muted/15 px-3 py-2 text-left transition-colors hover:border-border/80 hover:bg-muted/40`,onClick:async()=>{try{let t=await s.mutateAsync({data:{providerType:e.providerType}});T(``),f(t.providerId),C(e=>[t.providerId,...e.filter(e=>e!==t.providerId)]),x(!1)}catch{}},children:[(0,$.jsx)(h,{name:e.providerType,src:e.logo?`/logos/${e.logo}`:null,className:`h-8 w-8 rounded-lg border border-border/55 bg-background`,imgClassName:`h-4 w-4 object-contain`}),(0,$.jsx)(`span`,{className:`line-clamp-2 min-w-0 text-xs font-semibold leading-4 text-foreground`,children:e.displayName||e.providerType})]},e.providerType))]})]})]})}),(0,$.jsx)(`div`,{className:`border-b border-border/70 px-4 py-3`,children:(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(_,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/70`}),(0,$.jsx)(i,{value:w,onChange:e=>T(e.target.value),placeholder:p(`providersFilterPlaceholder`),className:`h-10 rounded-xl pl-9`})]})}),(0,$.jsxs)(_e,{className:`space-y-2 p-3`,children:[N.map(e=>{let t=e.providerType?M.get(e.providerType):null,n=e.enabled!==!1,i=H(e),a=e.displayName?.trim()||t?.displayName||e.providerId,s=pt(e.apiBase||t?.defaultApiBase||``)||p(`providersDefaultDescription`);return(0,$.jsx)(`div`,{onClick:()=>f(e.providerId),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),f(e.providerId))},role:`button`,tabIndex:0,className:r(`group w-full rounded-xl p-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,P===e.providerId?`bg-background/95 text-foreground shadow-sm`:`bg-transparent text-muted-foreground hover:bg-background/65 hover:text-foreground`),children:(0,$.jsxs)(`div`,{className:`relative min-h-10`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 pr-20`,children:[(0,$.jsx)(h,{name:e.providerType??e.providerId,src:t?.logo?`/logos/${t.logo}`:null,className:`h-10 w-10 rounded-lg bg-background/80`,imgClassName:`h-5 w-5 object-contain`,fallback:(0,$.jsx)(`span`,{className:`text-sm font-semibold uppercase text-muted-foreground`,children:e.providerId[0]})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:a}),(0,$.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground/65`,children:e.providerId}),(0,$.jsxs)(`p`,{className:`line-clamp-1 text-[11px] text-muted-foreground`,children:[s,` · `,e.models?.length??0]})]})]}),(0,$.jsxs)(`div`,{className:`absolute right-0 top-0 flex items-center gap-1.5 opacity-70 transition-opacity group-hover:opacity-100`,children:[(0,$.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:(0,$.jsx)(o,{checked:n,disabled:u.isPending,title:p(n?`disabled`:`enabled`),className:`h-[18px] w-8`,thumbClassName:`h-4 w-4 data-[state=checked]:translate-x-4`,onCheckedChange:t=>{u.mutateAsync({provider:e.providerId,data:{enabled:t},silentSuccess:!0})}})}),(0,$.jsxs)(V,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground/70 hover:bg-muted hover:text-foreground`,onClick:e=>e.stopPropagation(),title:p(`more`),children:(0,$.jsx)(b,{className:`h-4 w-4`})})}),(0,$.jsx)(B,{className:`w-40 p-1`,align:`end`,onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm text-red-600 hover:bg-red-50`,onClick:()=>v(e.providerId),children:[(0,$.jsx)(I,{className:`h-4 w-4`}),p(`providerDelete`)]})})]})]}),(0,$.jsx)(m,{status:n?i?`ready`:`setup`:`inactive`,label:p(n?i?`statusReady`:`statusSetup`:`disabled`),className:`absolute bottom-0 right-0 justify-end`})]})},e.providerId)}),N.length===0?(0,$.jsx)(me,{icon:O,title:p(`providersNoMatch`)}):null]})]}),(0,$.jsx)(dt,{providerName:P??void 0,onProviderDeleted:e=>{C(t=>t.filter(t=>t!==e)),e===P&&f(null)}})]}),(0,$.jsx)(F,{open:!!g,onOpenChange:e=>{e||v(null)},title:p(`providerDelete`),description:g??void 0,confirmLabel:p(`delete`),variant:`destructive`,onCancel:()=>v(null),onConfirm:()=>{g&&l.mutateAsync({provider:g}).then(()=>{C(e=>e.filter(e=>e!==g)),g===P&&f(null),v(null)})}})]})}export{gt as ProvidersConfigPage};
@@ -1 +0,0 @@
1
- import{A as e,i as t,t as n}from"./utils-CBZPzC_b.js";import{Jt as r,Yt as i,qt as a,vn as o}from"./api-DqzQ-_3w.js";import{dt as s}from"./app-presenter-provider-CBZ_-ewx.js";import{s as c}from"./i18n-20rSH40D.js";import{t as l}from"./createLucideIcon-BNKf0_kc.js";import{a as u,o as d}from"./theme-provider-DzvAi3pe.js";import{t as f}from"./x-DdXOqLnX.js";var p=l(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),m=`nextclaw-pwa-install-banner-dismissed`,h=`nextclaw-pwa-install-banner-dismissed-until`;function g(){let e=y();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:b(e):!1}function _(){let e=y();e?.setItem(m,`1`),e?.removeItem(h)}function v(){let e=y();e?.removeItem(m),e?.removeItem(h)}function y(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function b(e){let t=e.getItem(h);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(h),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(m,`1`),!0)}function x(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:g()}}var S=t(()=>x()),C=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),S.setState(x())},this.refreshState=()=>{let e=this.resolveInstallability();S.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:g()}))},this.dismissInstallPrompt=()=>{_(),S.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let e=this.resolveInstallability();if(e.installability!==`available`)return`unavailable`;if(e.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let t=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,t.outcome===`accepted`?(v(),this.refreshState(),o.success(c(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,v(),S.setState({dismissedInstallPrompt:!0}),o.success(c(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}},w=e();function T(){let e=S(e=>e.installability);return(0,w.jsx)(`span`,{className:n(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:E(e)})}function E(e){return c(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function D(e,t,n){return c(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function O(){let e=S(e=>e.installability),t=S(e=>e.installMethod),n=S(e=>e.blockedReason);return(0,w.jsx)(r,{title:c(`pwaInstallTitle`),description:c(`pwaInstallDescription`),actions:(0,w.jsx)(T,{}),children:(0,w.jsx)(a,{children:(0,w.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:D(e,t,n)}),e===`available`&&t===`prompt`?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,w.jsxs)(i,{type:`button`,className:`gap-2`,onClick:()=>void C.promptInstall(),children:[(0,w.jsx)(s,{className:`h-4 w-4`}),c(`pwaInstallAction`)]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c(`pwaInstallPromptHint`)})]}):null,e===`available`&&t===`manual`?(0,w.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-background/65 p-4`,children:[(0,w.jsx)(p,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:c(`pwaInstallManualHint`)})]}):null]})})})}function k(){let e=S(e=>e.installability),t=S(e=>e.installMethod),n=S(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||n?null:(0,w.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,w.jsxs)(`div`,{className:`space-y-1`,children:[(0,w.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:c(`pwaInstallBannerTitle`)}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:c(`pwaInstallBannerDescription`)})]}),(0,w.jsx)(`button`,{type:`button`,"aria-label":c(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{C.dismissInstallPrompt()},children:(0,w.jsx)(f,{className:`h-4 w-4`})})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,w.jsxs)(i,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{C.promptInstall()},children:[(0,w.jsx)(s,{className:`h-4 w-4`}),c(`pwaInstallAction`)]}),(0,w.jsx)(i,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{C.dismissInstallPrompt()},children:c(`pwaInstallDismiss`)})]})]})}var A=new class{constructor(){this.started=!1,this.registration=null,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{this.registration=await navigator.serviceWorker.register(`/sw.js`)}catch{return}}},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(this.started=!1,this.registration=null)},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));await Promise.all(e.map(async e=>await e.unregister())),e.length>0&&await this.clearNextClawCaches()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))}}},j=!1;function M(){j||typeof window>`u`||(j=!0,C.start(),A.start())}var N={natural:`#FAF9F7`,work:`#FFFFFF`,minimal:`#FFFFFF`,warm:`#FAF8F4`,cool:`#F8FAFC`,dawn:`#FAF7F4`,graphite:`#F8F8F7`,night:`#101318`,charcoal:`#1C1C1C`,island:`#FBF8ED`,probe:`#FEFCF6`},P=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=N[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=u(e)},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`);this.syncTheme(d(e)??`work`)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}};export{O as i,M as n,k as r,P as t};
Binary file