@decocms/mesh 2.15.1 → 2.16.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 (177) hide show
  1. package/dist/client/assets/{AlertCircle-DlBo4Xw9.js → AlertCircle-B2oZTglS.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-CCqPW2JN.js → ArrowLeft-DNHIvCfQ.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-KvHCnFh3.js → ArrowUp-B6oTANSV.js} +1 -1
  4. package/dist/client/assets/{Check-D4dBNJmC.js → Check-BzuFSftX.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CJaS1NVA.js → ChevronDown-BczYL0OZ.js} +1 -1
  6. package/dist/client/assets/{Code01-CMazpegY.js → Code01-DNXaHLqw.js} +1 -1
  7. package/dist/client/assets/{Copy01-Rf_P7R5F.js → Copy01-Biw66bGV.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-Nj82ZW12.js → DotsHorizontal-ZLYpFz0w.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-f9rnazjX.js → DotsVertical-cBsSXBlU.js} +1 -1
  10. package/dist/client/assets/{Download01-Cnas0PSW.js → Download01-Cq2AKtAL.js} +1 -1
  11. package/dist/client/assets/{Edit01-MWKLkbpZ.js → Edit01-BjOfQM8B.js} +1 -1
  12. package/dist/client/assets/{File06-Dir7h2_j.js → File06-BNhcqwLq.js} +1 -1
  13. package/dist/client/assets/{FilterLines-BgxUhbig.js → FilterLines-CoWRaycl.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-B1KVh_65.js → FlipBackward-CuLGV5oo.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-CA4KhZZx.js → GitBranch01-DkToEQj6.js} +1 -1
  16. package/dist/client/assets/{Grid01-BgBQwtBY.js → Grid01-uV0oBuV3.js} +1 -1
  17. package/dist/client/assets/{Home02-CR-W2ctm.js → Home02-B5sox49B.js} +1 -1
  18. package/dist/client/assets/{Image01-B8cj-qoF.js → Image01-DMLU_ak3.js} +1 -1
  19. package/dist/client/assets/{Inbox01-Bh5pMKE1.js → Inbox01-BfxyUVOc.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-CVdyaBb8.js → InfoCircle-D6SOLGfY.js} +1 -1
  21. package/dist/client/assets/{Key01-BcxLAym0.js → Key01-DY1coeHQ.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-D41WE0Cl.js → LinkExternal01-DMezlNGG.js} +1 -1
  23. package/dist/client/assets/{List-hTdqyLGB.js → List-CVC8X3kY.js} +1 -1
  24. package/dist/client/assets/{Loading01-Bq_7Os6T.js → Loading01-CvuvLhSA.js} +1 -1
  25. package/dist/client/assets/{Lock01-DOJDUqUZ.js → Lock01-ByXncGT3.js} +1 -1
  26. package/dist/client/assets/MessageChatSquare-Dd7UGbcR.js +1 -0
  27. package/dist/client/assets/{Play-CoxjBx7-.js → Play-D53Ipg7b.js} +1 -1
  28. package/dist/client/assets/{Plus-C4F6mby2.js → Plus-emJv0cyE.js} +1 -1
  29. package/dist/client/assets/{SearchMd-B_A85eif.js → SearchMd-4bGqWhO7.js} +1 -1
  30. package/dist/client/assets/{Terminal-BWurH474.js → Terminal-Dwvrrbxm.js} +1 -1
  31. package/dist/client/assets/{Trash01-GrzirNvV.js → Trash01-C9fgHihQ.js} +1 -1
  32. package/dist/client/assets/{Upload01-Ba_zCXbQ.js → Upload01-CRvHyAuf.js} +1 -1
  33. package/dist/client/assets/{X-D09jV0HO.js → X-DwZFSRlE.js} +1 -1
  34. package/dist/client/assets/{XClose-D9UXYoHK.js → XClose-bVRJhtCU.js} +1 -1
  35. package/dist/client/assets/{alert-dialog-Df8ZsItX.js → alert-dialog-NsN0mz0A.js} +1 -1
  36. package/dist/client/assets/{auth-catchall-Bu_AmzqF.js → auth-catchall-CZQOowpQ.js} +1 -1
  37. package/dist/client/assets/{avatar-CrVRRbJ7.js → avatar-Bim2Jxhy.js} +1 -1
  38. package/dist/client/assets/{badge-BPKvq16e.js → badge-DbLa101x.js} +1 -1
  39. package/dist/client/assets/{binder-BtPpbY4I.js → binder-52kHlP5R.js} +1 -1
  40. package/dist/client/assets/button-CTJokKKi.js +1 -0
  41. package/dist/client/assets/{card-Rz2C5-Lx.js → card-D3-N0Ziq.js} +1 -1
  42. package/dist/client/assets/{checkbox-DGIT6WZ3.js → checkbox-Bio0mokg.js} +1 -1
  43. package/dist/client/assets/{collection-detail-CIorpvYQ.js → collection-detail-kd5gJHzz.js} +2 -2
  44. package/dist/client/assets/{collection-display-button-C_GfVLwh.js → collection-display-button-D4xA64Pp.js} +1 -1
  45. package/dist/client/assets/{collection-header-Dl8Ii13M.js → collection-header-CDIKZA15.js} +1 -1
  46. package/dist/client/assets/{collection-page-C75JriCh.js → collection-page-DkTZhP29.js} +1 -1
  47. package/dist/client/assets/{collection-search-D67e9ppe.js → collection-search-NLGzx5Aj.js} +1 -1
  48. package/dist/client/assets/{collection-tab-DVmiR956.js → collection-tab-CHEJ77P0.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-DDHrDWif.js → collection-table-wrapper-Cmwf3-Zd.js} +1 -1
  50. package/dist/client/assets/{connection-CmMMEDBY.js → connection-CVA8jPCa.js} +1 -1
  51. package/dist/client/assets/{connection-card-BuCHeT4K.js → connection-card-DSQeBo5D.js} +1 -1
  52. package/dist/client/assets/connection-detail-BRtmbxOA.js +1 -0
  53. package/dist/client/assets/connections-BQG75-F0.js +1 -0
  54. package/dist/client/assets/constants-DDPe3rq3.js +1 -0
  55. package/dist/client/assets/{create-organization-dialog-DQ5uy2r0.js → create-organization-dialog-Bax-UsKr.js} +1 -1
  56. package/dist/client/assets/{dialog-bW33A1d_.js → dialog-Bn93qdaz.js} +1 -1
  57. package/dist/client/assets/{dropdown-menu-dsr_wyw0.js → dropdown-menu-BoZzHM67.js} +1 -1
  58. package/dist/client/assets/dynamic-plugin-layout-CQi3lnCP.js +1 -0
  59. package/dist/client/assets/{empty-state-By_kA__m.js → empty-state-Bcd1wXFS.js} +1 -1
  60. package/dist/client/assets/{empty-state-B1DU5702.js → empty-state-Dm-ohURa.js} +1 -1
  61. package/dist/client/assets/{env-vars-editor-BjH5KdVc.js → env-vars-editor-ckaYIpuZ.js} +1 -1
  62. package/dist/client/assets/{error-boundary-BOBkDZ1Y.js → error-boundary-BoSqgCtj.js} +1 -1
  63. package/dist/client/assets/{extract-connection-data-CNcw3HV2.js → extract-connection-data-CxTJQ988.js} +1 -1
  64. package/dist/client/assets/{file-browser-BDyBPrc6.js → file-browser-Dn-I1IiE.js} +2 -2
  65. package/dist/client/assets/{form-ChO7tWCF.js → form-CG-hsJ5c.js} +1 -1
  66. package/dist/client/assets/gateway-detail-BQDBMjd9.js +1 -0
  67. package/dist/client/assets/{gateways-ckyn_Uas.js → gateways-DSACPdOv.js} +1 -1
  68. package/dist/client/assets/{grid-view-CTAOtRDs.js → grid-view-hvwfrwye.js} +1 -1
  69. package/dist/client/assets/{home-CpIhQ8D8.js → home-CeFBBPsp.js} +1 -1
  70. package/dist/client/assets/index-2KSfo6Ol.css +1 -0
  71. package/dist/client/assets/{index-CH2G6_zW.js → index-CRZ1ToW0.js} +1 -1
  72. package/dist/client/assets/index-CmErlMVO.js +1 -0
  73. package/dist/client/assets/{index-ZiFjEqyT.js → index-CrProqmQ.js} +2 -2
  74. package/dist/client/assets/{index-ChF3uWl9.js → index-EGRg6aHg.js} +1 -1
  75. package/dist/client/assets/index-j6TJSjaV.js +107 -0
  76. package/dist/client/assets/{infiniteQueryObserver-DEh2zauU.js → infiniteQueryObserver-lRzj3Gw2.js} +1 -1
  77. package/dist/client/assets/{input-DEsmZ6es.js → input-DfBpU_ty.js} +1 -1
  78. package/dist/client/assets/layout-AUAvH2H1.js +1 -0
  79. package/dist/client/assets/{lazy-highlighter-B2TKQCpQ.js → lazy-highlighter-VlHU8Y-l.js} +1 -1
  80. package/dist/client/assets/{localstorage-keys-DhdYpXZj.js → localstorage-keys-CRSC1wcG.js} +1 -1
  81. package/dist/client/assets/{login-DtC787Hg.js → login-DuLQYRHx.js} +1 -1
  82. package/dist/client/assets/{mcp-oauth-D8a9d38x.js → mcp-oauth-BuyvGrP4.js} +1 -1
  83. package/dist/client/assets/{mcp-server-card-DSQZ-b3I.js → mcp-server-card-CXVHhw09.js} +1 -1
  84. package/dist/client/assets/{mcp-server-detail-rW4PqaOO.js → mcp-server-detail-DRgWtEnz.js} +1 -1
  85. package/dist/client/assets/{members-C4HTAJHG.js → members-D2GPpEvZ.js} +2 -2
  86. package/dist/client/assets/{monaco-editor-BYgR7J38.js → monaco-editor-Ch4QGmXS.js} +4 -4
  87. package/dist/client/assets/{monitoring-BGY0w02b.js → monitoring-DvqA7AuH.js} +6 -6
  88. package/dist/client/assets/{oauth-callback-BSZdPTYI.js → oauth-callback-B2iJ-cIh.js} +1 -1
  89. package/dist/client/assets/page-CTarFbC4.js +35 -0
  90. package/dist/client/assets/page-CekK7zPt.js +1 -0
  91. package/dist/client/assets/{pin-to-sidebar-button-BahvsjHH.js → pin-to-sidebar-button-BsMAQ8Vt.js} +1 -1
  92. package/dist/client/assets/{plugin-empty-state-CIiB0IAw.js → plugin-empty-state-Dy73LUEA.js} +1 -1
  93. package/dist/client/assets/{plugin-header-CvDO4WmD.js → plugin-header-B_tffoXS.js} +1 -1
  94. package/dist/client/assets/plugins-CR5Q-iDa.js +1 -0
  95. package/dist/client/assets/{popover-DW05feED.js → popover-BZ-FzZWz.js} +1 -1
  96. package/dist/client/assets/{project-context-provider-BPo-49FO.js → project-context-provider-DaHOfM4z.js} +1 -1
  97. package/dist/client/assets/{registry-utils-DzI73csj.js → registry-utils-D0mO6LZ4.js} +1 -1
  98. package/dist/client/assets/{resizable-BAPLF4RD.js → resizable-BPD0-alN.js} +1 -1
  99. package/dist/client/assets/{resource-tabs-CC5dHHUl.js → resource-tabs-JnmKNHPF.js} +1 -1
  100. package/dist/client/assets/select-IfWnHVgm.js +1 -0
  101. package/dist/client/assets/settings-DjC9FBse.js +1 -0
  102. package/dist/client/assets/shell-layout-Bd8yx5uJ.js +17 -0
  103. package/dist/client/assets/{spinner-DqooIng7.js → spinner-C88Uk3Mq.js} +1 -1
  104. package/dist/client/assets/{switch-dZML6kqo.js → switch-DoEPJ6LK.js} +1 -1
  105. package/dist/client/assets/{textarea-DFRypKCQ.js → textarea-BqnrlDDE.js} +1 -1
  106. package/dist/client/assets/{tool-set-selector-DRx4AOzy.js → tool-set-selector-DRO7hzfM.js} +1 -1
  107. package/dist/client/assets/{tools-list-C8nSsOKD.js → tools-list-CLVUgs1o.js} +1 -1
  108. package/dist/client/assets/{tooltip-BJO9sFhZ.js → tooltip-NmHBw1SB.js} +1 -1
  109. package/dist/client/assets/use-binding-BeRgkTto.js +23 -0
  110. package/dist/client/assets/{use-collections-g067BPxP.js → use-collections-KXXQm2MI.js} +1 -1
  111. package/dist/client/assets/{use-connection-BskZam-G.js → use-connection-BpwLfga7.js} +1 -1
  112. package/dist/client/assets/{use-connection-resources-YXIBGXnm.js → use-connection-resources-LbJAvV0-.js} +1 -1
  113. package/dist/client/assets/{use-create-gateway-CCmt4GT8.js → use-create-gateway-CCdAKPuZ.js} +1 -1
  114. package/dist/client/assets/{use-gateway-v7etejE8.js → use-gateway-CvXTgd1x.js} +1 -1
  115. package/dist/client/assets/{use-gateway-system-prompt-DoCpWoeh.js → use-gateway-system-prompt-DppzttmJ.js} +1 -1
  116. package/dist/client/assets/{use-list-state-C5pgFF_z.js → use-list-state-lFbY6EbW.js} +1 -1
  117. package/dist/client/assets/{use-mcp-ZNQ-iMEF.js → use-mcp-Dd1lbCPb.js} +1 -1
  118. package/dist/client/assets/{use-members-dVasH0ez.js → use-members-BPs6PrLQ.js} +1 -1
  119. package/dist/client/assets/{use-mobile-Co7MtEW-.js → use-mobile-C5bi3iKH.js} +1 -1
  120. package/dist/client/assets/{use-organization-settings-K7SU43aD.js → use-organization-settings-D1QvFxpy.js} +1 -1
  121. package/dist/client/assets/{use-tool-call-BbfSyOCz.js → use-tool-call-VFE826W3.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-DwjnurDK.js +1 -0
  123. package/dist/client/assets/{useMutation-4fnzP4bc.js → useMutation-BTJq9RED.js} +1 -1
  124. package/dist/client/assets/useQuery-5B4EpEmL.js +1 -0
  125. package/dist/client/assets/{value-zEqR5KPg.js → value-_xkD4VBb.js} +1 -1
  126. package/dist/client/assets/{view-mode-toggle-tlrhMsiy.js → view-mode-toggle-DcZ2e_Ag.js} +1 -1
  127. package/dist/client/assets/{well-known-mcp-D13f-8h2.js → well-known-mcp-DOEdYmKO.js} +1 -1
  128. package/dist/client/assets/{workflow-B8_jtBci.js → workflow-B-4ovCZr.js} +1 -1
  129. package/dist/client/index.html +2 -2
  130. package/dist/server/cli.js +208 -208
  131. package/dist/server/migrate.js +186 -186
  132. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/LICENSE +47 -0
  133. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/README.md +82 -0
  134. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.d.ts +11 -0
  135. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +43 -0
  136. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cjs +45 -0
  137. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs +46 -0
  138. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts +11 -0
  139. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.d.ts +11 -0
  140. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +46 -0
  141. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm +0 -0
  142. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.mts +83 -0
  143. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.ts +83 -0
  144. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +2 -0
  145. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js.map +1 -0
  146. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +2 -0
  147. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs.map +1 -0
  148. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.mts +20 -0
  149. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.ts +20 -0
  150. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +2 -0
  151. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js.map +1 -0
  152. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +2 -0
  153. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs.map +1 -0
  154. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +61 -0
  155. package/dist/server/server.js +202 -202
  156. package/package.json +1 -1
  157. package/dist/client/assets/Clock-ljBuaWDA.js +0 -1
  158. package/dist/client/assets/button-Co_HOc3E.js +0 -1
  159. package/dist/client/assets/connection-detail-BsC5t8hY.js +0 -1
  160. package/dist/client/assets/connections-B3RW87mz.js +0 -1
  161. package/dist/client/assets/constants-B5NZDm4s.js +0 -1
  162. package/dist/client/assets/dynamic-plugin-layout-IH0Gl52A.js +0 -1
  163. package/dist/client/assets/gateway-detail-CzuSbsFr.js +0 -1
  164. package/dist/client/assets/index-BUdiVz6f.js +0 -1
  165. package/dist/client/assets/index-Bc30BcYv.js +0 -88
  166. package/dist/client/assets/index-JAPwCHXJ.css +0 -1
  167. package/dist/client/assets/layout-tF7tb_Qc.js +0 -1
  168. package/dist/client/assets/page-DcQoSvJk.js +0 -35
  169. package/dist/client/assets/page-DxMYdFSw.js +0 -1
  170. package/dist/client/assets/plugins-CyUBsABC.js +0 -1
  171. package/dist/client/assets/select-CVEPeRAQ.js +0 -1
  172. package/dist/client/assets/settings-BfbdOKrl.js +0 -1
  173. package/dist/client/assets/shell-layout-DJjajsTY.js +0 -3
  174. package/dist/client/assets/use-binding-C8KxuIY6.js +0 -23
  175. package/dist/client/assets/use-model-state-B8hL-q1r.js +0 -20
  176. package/dist/client/assets/useInfiniteQuery-Dbq7IS1q.js +0 -1
  177. package/dist/client/assets/useQuery-Bn2Wcch_.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-browser-BDyBPrc6.js","assets/useInfiniteQuery-Dbq7IS1q.js","assets/infiniteQueryObserver-DEh2zauU.js","assets/button-Co_HOc3E.js","assets/checkbox-DGIT6WZ3.js","assets/Check-D4dBNJmC.js","assets/AlertCircle-DlBo4Xw9.js","assets/Grid01-BgBQwtBY.js","assets/Download01-Cnas0PSW.js","assets/Home02-CR-W2ctm.js","assets/List-hTdqyLGB.js","assets/Loading01-Bq_7Os6T.js","assets/Trash01-GrzirNvV.js","assets/Upload01-Ba_zCXbQ.js","assets/useMutation-4fnzP4bc.js","assets/plugin-header-CvDO4WmD.js","assets/ChevronDown-CJaS1NVA.js","assets/login-DtC787Hg.js","assets/input-DEsmZ6es.js","assets/shell-layout-DJjajsTY.js","assets/error-boundary-BOBkDZ1Y.js","assets/popover-DW05feED.js","assets/badge-BPKvq16e.js","assets/Inbox01-Bh5pMKE1.js","assets/XClose-D9UXYoHK.js","assets/File06-Dir7h2_j.js","assets/X-D09jV0HO.js","assets/use-mobile-Co7MtEW-.js","assets/tooltip-BJO9sFhZ.js","assets/index-Bc30BcYv.js","assets/empty-state-B1DU5702.js","assets/use-gateway-v7etejE8.js","assets/connection-CmMMEDBY.js","assets/project-context-provider-BPo-49FO.js","assets/use-collections-g067BPxP.js","assets/SearchMd-B_A85eif.js","assets/use-create-gateway-CCmt4GT8.js","assets/ArrowUp-KvHCnFh3.js","assets/textarea-DFRypKCQ.js","assets/localstorage-keys-DhdYpXZj.js","assets/useQuery-Bn2Wcch_.js","assets/Copy01-Rf_P7R5F.js","assets/Terminal-BWurH474.js","assets/monaco-editor-BYgR7J38.js","assets/spinner-DqooIng7.js","assets/alert-dialog-Df8ZsItX.js","assets/select-CVEPeRAQ.js","assets/Image01-B8cj-qoF.js","assets/use-connection-BskZam-G.js","assets/use-binding-C8KxuIY6.js","assets/binder-BtPpbY4I.js","assets/use-organization-settings-K7SU43aD.js","assets/create-organization-dialog-DQ5uy2r0.js","assets/form-ChO7tWCF.js","assets/avatar-CrVRRbJ7.js","assets/dropdown-menu-dsr_wyw0.js","assets/LinkExternal01-D41WE0Cl.js","assets/dialog-bW33A1d_.js","assets/switch-dZML6kqo.js","assets/Code01-CMazpegY.js","assets/use-model-state-B8hL-q1r.js","assets/use-gateway-system-prompt-DoCpWoeh.js","assets/Edit01-MWKLkbpZ.js","assets/well-known-mcp-D13f-8h2.js","assets/generate-id-Dyweu44Y.js","assets/Clock-ljBuaWDA.js","assets/resizable-BAPLF4RD.js","assets/Plus-C4F6mby2.js","assets/home-CpIhQ8D8.js","assets/card-Rz2C5-Lx.js","assets/page-DcQoSvJk.js","assets/view-mode-toggle-tlrhMsiy.js","assets/GitBranch01-CA4KhZZx.js","assets/use-tool-call-BbfSyOCz.js","assets/value-zEqR5KPg.js","assets/page-BZV40eAE.css","assets/members-C4HTAJHG.js","assets/collection-header-Dl8Ii13M.js","assets/collection-display-button-C_GfVLwh.js","assets/collection-page-C75JriCh.js","assets/collection-search-D67e9ppe.js","assets/collection-table-wrapper-DDHrDWif.js","assets/tool-set-selector-DRx4AOzy.js","assets/ArrowLeft-CCqPW2JN.js","assets/use-members-dVasH0ez.js","assets/DotsHorizontal-Nj82ZW12.js","assets/Lock01-DOJDUqUZ.js","assets/DotsVertical-f9rnazjX.js","assets/Key01-BcxLAym0.js","assets/connections-B3RW87mz.js","assets/connection-card-BuCHeT4K.js","assets/use-list-state-C5pgFF_z.js","assets/registry-utils-DzI73csj.js","assets/env-vars-editor-BjH5KdVc.js","assets/settings-BfbdOKrl.js","assets/plugins-CyUBsABC.js","assets/monitoring-BGY0w02b.js","assets/FilterLines-BgxUhbig.js","assets/Play-CoxjBx7-.js","assets/index-BUdiVz6f.js","assets/resource-tabs-CC5dHHUl.js","assets/page-DxMYdFSw.js","assets/slugify-CEUa2lfQ.js","assets/mcp-server-card-DSQZ-b3I.js","assets/github-icon-Dp3wHhYE.js","assets/mcp-server-detail-rW4PqaOO.js","assets/extract-connection-data-CNcw3HV2.js","assets/constants-B5NZDm4s.js","assets/tools-list-C8nSsOKD.js","assets/layout-tF7tb_Qc.js","assets/tools-list-CSRUKxnt.css","assets/use-mcp-ZNQ-iMEF.js","assets/InfoCircle-CVdyaBb8.js","assets/connection-detail-BsC5t8hY.js","assets/index-ChF3uWl9.js","assets/mcp-oauth-D8a9d38x.js","assets/pin-to-sidebar-button-BahvsjHH.js","assets/index-CH2G6_zW.js","assets/use-connection-resources-YXIBGXnm.js","assets/collection-tab-DVmiR956.js","assets/empty-state-By_kA__m.js","assets/collection-detail-CIorpvYQ.js","assets/FlipBackward-B1KVh_65.js","assets/gateways-ckyn_Uas.js","assets/gateway-detail-CzuSbsFr.js","assets/workflow-B8_jtBci.js","assets/dynamic-plugin-layout-IH0Gl52A.js","assets/oauth-callback-BSZdPTYI.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-browser-Dn-I1IiE.js","assets/useInfiniteQuery-DwjnurDK.js","assets/infiniteQueryObserver-lRzj3Gw2.js","assets/button-CTJokKKi.js","assets/checkbox-Bio0mokg.js","assets/Check-BzuFSftX.js","assets/AlertCircle-B2oZTglS.js","assets/Grid01-uV0oBuV3.js","assets/Download01-Cq2AKtAL.js","assets/Home02-B5sox49B.js","assets/List-CVC8X3kY.js","assets/Loading01-CvuvLhSA.js","assets/Trash01-C9fgHihQ.js","assets/Upload01-CRvHyAuf.js","assets/useMutation-BTJq9RED.js","assets/plugin-header-B_tffoXS.js","assets/ChevronDown-BczYL0OZ.js","assets/login-DuLQYRHx.js","assets/input-DfBpU_ty.js","assets/shell-layout-Bd8yx5uJ.js","assets/popover-BZ-FzZWz.js","assets/badge-DbLa101x.js","assets/Inbox01-BfxyUVOc.js","assets/XClose-bVRJhtCU.js","assets/error-boundary-BoSqgCtj.js","assets/File06-BNhcqwLq.js","assets/X-DwZFSRlE.js","assets/use-mobile-C5bi3iKH.js","assets/tooltip-NmHBw1SB.js","assets/index-j6TJSjaV.js","assets/empty-state-Dm-ohURa.js","assets/project-context-provider-DaHOfM4z.js","assets/textarea-BqnrlDDE.js","assets/ArrowUp-B6oTANSV.js","assets/use-gateway-CvXTgd1x.js","assets/connection-CVA8jPCa.js","assets/use-collections-KXXQm2MI.js","assets/Edit01-BjOfQM8B.js","assets/use-connection-BpwLfga7.js","assets/use-binding-BeRgkTto.js","assets/binder-52kHlP5R.js","assets/use-gateway-system-prompt-DppzttmJ.js","assets/localstorage-keys-CRSC1wcG.js","assets/useQuery-5B4EpEmL.js","assets/SearchMd-4bGqWhO7.js","assets/use-create-gateway-CCdAKPuZ.js","assets/select-IfWnHVgm.js","assets/Image01-DMLU_ak3.js","assets/Copy01-Biw66bGV.js","assets/Terminal-Dwvrrbxm.js","assets/monaco-editor-Ch4QGmXS.js","assets/spinner-C88Uk3Mq.js","assets/alert-dialog-NsN0mz0A.js","assets/well-known-mcp-DOEdYmKO.js","assets/generate-id-Dyweu44Y.js","assets/use-organization-settings-D1QvFxpy.js","assets/create-organization-dialog-Bax-UsKr.js","assets/form-CG-hsJ5c.js","assets/avatar-Bim2Jxhy.js","assets/dropdown-menu-BoZzHM67.js","assets/LinkExternal01-DMezlNGG.js","assets/dialog-Bn93qdaz.js","assets/switch-DoEPJ6LK.js","assets/Code01-DNXaHLqw.js","assets/MessageChatSquare-Dd7UGbcR.js","assets/resizable-BPD0-alN.js","assets/Plus-emJv0cyE.js","assets/home-CeFBBPsp.js","assets/card-D3-N0Ziq.js","assets/page-CTarFbC4.js","assets/view-mode-toggle-DcZ2e_Ag.js","assets/GitBranch01-DkToEQj6.js","assets/use-tool-call-VFE826W3.js","assets/value-_xkD4VBb.js","assets/page-BZV40eAE.css","assets/members-D2GPpEvZ.js","assets/collection-header-CDIKZA15.js","assets/collection-display-button-D4xA64Pp.js","assets/collection-page-DkTZhP29.js","assets/collection-search-NLGzx5Aj.js","assets/collection-table-wrapper-Cmwf3-Zd.js","assets/tool-set-selector-DRO7hzfM.js","assets/ArrowLeft-DNHIvCfQ.js","assets/use-members-BPs6PrLQ.js","assets/DotsHorizontal-ZLYpFz0w.js","assets/Lock01-ByXncGT3.js","assets/DotsVertical-cBsSXBlU.js","assets/Key01-DY1coeHQ.js","assets/connections-BQG75-F0.js","assets/connection-card-DSQeBo5D.js","assets/use-list-state-lFbY6EbW.js","assets/registry-utils-D0mO6LZ4.js","assets/env-vars-editor-ckaYIpuZ.js","assets/settings-DjC9FBse.js","assets/plugins-CR5Q-iDa.js","assets/monitoring-DvqA7AuH.js","assets/FilterLines-CoWRaycl.js","assets/Play-D53Ipg7b.js","assets/index-CmErlMVO.js","assets/resource-tabs-JnmKNHPF.js","assets/page-CekK7zPt.js","assets/slugify-CEUa2lfQ.js","assets/mcp-server-card-CXVHhw09.js","assets/github-icon-Dp3wHhYE.js","assets/mcp-server-detail-DRgWtEnz.js","assets/extract-connection-data-CxTJQ988.js","assets/constants-DDPe3rq3.js","assets/tools-list-CLVUgs1o.js","assets/layout-AUAvH2H1.js","assets/tools-list-CSRUKxnt.css","assets/use-mcp-Dd1lbCPb.js","assets/InfoCircle-D6SOLGfY.js","assets/connection-detail-BRtmbxOA.js","assets/index-EGRg6aHg.js","assets/mcp-oauth-BuyvGrP4.js","assets/pin-to-sidebar-button-BsMAQ8Vt.js","assets/index-CRZ1ToW0.js","assets/use-connection-resources-LbJAvV0-.js","assets/collection-tab-CHEJ77P0.js","assets/empty-state-Bcd1wXFS.js","assets/collection-detail-kd5gJHzz.js","assets/FlipBackward-CuLGV5oo.js","assets/gateways-DSACPdOv.js","assets/gateway-detail-BQDBMjd9.js","assets/workflow-B-4ovCZr.js","assets/dynamic-plugin-layout-CQi3lnCP.js","assets/oauth-callback-B2iJ-cIh.js"])))=>i.map(i=>d[i]);
2
2
  function xD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();const TD="modulepreload",OD=function(e){return"/"+e},zR={},mn=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");a=l(n.map(f=>{if(f=OD(f),f in zR)return;zR[f]=!0;const m=f.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":TD,m||(g.as="script"),g.crossOrigin="",g.href=f,d&&g.setAttribute("nonce",d),document.head.appendChild(g),m)return new Promise((y,b)=>{g.addEventListener("load",y),g.addEventListener("error",()=>b(Error(`Unable to preload CSS for ${f}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return a.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};var gre=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ha(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var py={exports:{}},du={};var FR;function CD(){if(FR)return du;FR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return du.Fragment=t,du.jsx=n,du.jsxs=n,du}var VR;function AD(){return VR||(VR=1,py.exports=CD()),py.exports}var x=AD(),my={exports:{}},fu={},gy={exports:{}},vy={};var BR;function ID(){return BR||(BR=1,(function(e){function t(B,Y){var W=B.length;B.push(Y);e:for(;0<W;){var he=W-1>>>1,ae=B[he];if(0<a(ae,Y))B[he]=Y,B[W]=ae,W=he;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var Y=B[0],W=B.pop();if(W!==Y){B[0]=W;e:for(var he=0,ae=B.length,M=ae>>>1;he<M;){var q=2*(he+1)-1,V=B[q],D=q+1,z=B[D];if(0>a(V,W))D<ae&&0>a(z,V)?(B[he]=z,B[D]=W,he=D):(B[he]=V,B[q]=W,he=q);else if(D<ae&&0>a(z,W))B[he]=z,B[D]=W,he=D;else break e}}return Y}function a(B,Y){var W=B.sortIndex-Y.sortIndex;return W!==0?W:B.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],m=1,p=null,g=3,y=!1,b=!1,S=!1,w=!1,R=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function O(B){for(var Y=n(f);Y!==null;){if(Y.callback===null)r(f);else if(Y.startTime<=B)r(f),Y.sortIndex=Y.expirationTime,t(d,Y);else break;Y=n(f)}}function C(B){if(S=!1,O(B),!b)if(n(d)!==null)b=!0,I||(I=!0,G());else{var Y=n(f);Y!==null&&le(C,Y.startTime-B)}}var I=!1,N=-1,P=5,$=-1;function K(){return w?!0:!(e.unstable_now()-$<P)}function F(){if(w=!1,I){var B=e.unstable_now();$=B;var Y=!0;try{e:{b=!1,S&&(S=!1,E(N),N=-1),y=!0;var W=g;try{t:{for(O(B),p=n(d);p!==null&&!(p.expirationTime>B&&K());){var he=p.callback;if(typeof he=="function"){p.callback=null,g=p.priorityLevel;var ae=he(p.expirationTime<=B);if(B=e.unstable_now(),typeof ae=="function"){p.callback=ae,O(B),Y=!0;break t}p===n(d)&&r(d),O(B)}else r(d);p=n(d)}if(p!==null)Y=!0;else{var M=n(f);M!==null&&le(C,M.startTime-B),Y=!1}}break e}finally{p=null,g=W,y=!1}Y=void 0}}finally{Y?G():I=!1}}}var G;if(typeof T=="function")G=function(){T(F)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,J=U.port2;U.port1.onmessage=F,G=function(){J.postMessage(null)}}else G=function(){R(F,0)};function le(B,Y){N=R(function(){B(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var Y=3;break;default:Y=g}var W=g;g=Y;try{return B()}finally{g=W}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(B,Y){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var W=g;g=B;try{return Y()}finally{g=W}},e.unstable_scheduleCallback=function(B,Y,W){var he=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?he+W:he):W=he,B){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=W+ae,B={id:m++,callback:Y,priorityLevel:B,startTime:W,expirationTime:ae,sortIndex:-1},W>he?(B.sortIndex=W,t(f,B),n(d)===null&&B===n(f)&&(S?(E(N),N=-1):S=!0,le(C,W-he))):(B.sortIndex=ae,t(d,B),b||y||(b=!0,I||(I=!0,G()))),B},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(B){var Y=g;return function(){var W=g;g=Y;try{return B.apply(this,arguments)}finally{g=W}}}})(vy)),vy}var qR;function ND(){return qR||(qR=1,gy.exports=ID()),gy.exports}var yy={exports:{}},et={};var HR;function kD(){if(HR)return et;HR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function y(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function R(M,q,V){this.props=M,this.context=q,this.refs=w,this.updater=V||b}R.prototype.isReactComponent={},R.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,q,"setState")},R.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=R.prototype;function T(M,q,V){this.props=M,this.context=q,this.refs=w,this.updater=V||b}var O=T.prototype=new E;O.constructor=T,S(O,R.prototype),O.isPureReactComponent=!0;var C=Array.isArray;function I(){}var N={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function $(M,q,V){var D=V.ref;return{$$typeof:e,type:M,key:q,ref:D!==void 0?D:null,props:V}}function K(M,q){return $(M.type,q,M.props)}function F(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function G(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(V){return q[V]})}var U=/\/+/g;function J(M,q){return typeof M=="object"&&M!==null&&M.key!=null?G(""+M.key):q.toString(36)}function le(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(I,I):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function B(M,q,V,D,z){var X=typeof M;(X==="undefined"||X==="boolean")&&(M=null);var ue=!1;if(M===null)ue=!0;else switch(X){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(M.$$typeof){case e:case t:ue=!0;break;case m:return ue=M._init,B(ue(M._payload),q,V,D,z)}}if(ue)return z=z(M),ue=D===""?"."+J(M,0):D,C(z)?(V="",ue!=null&&(V=ue.replace(U,"$&/")+"/"),B(z,q,V,"",function(Ae){return Ae})):z!=null&&(F(z)&&(z=K(z,V+(z.key==null||M&&M.key===z.key?"":(""+z.key).replace(U,"$&/")+"/")+ue)),q.push(z)),1;ue=0;var ve=D===""?".":D+":";if(C(M))for(var Ie=0;Ie<M.length;Ie++)D=M[Ie],X=ve+J(D,Ie),ue+=B(D,q,V,X,z);else if(Ie=y(M),typeof Ie=="function")for(M=Ie.call(M),Ie=0;!(D=M.next()).done;)D=D.value,X=ve+J(D,Ie++),ue+=B(D,q,V,X,z);else if(X==="object"){if(typeof M.then=="function")return B(le(M),q,V,D,z);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ue}function Y(M,q,V){if(M==null)return M;var D=[],z=0;return B(M,D,"","",function(X){return q.call(V,X,z++)}),D}function W(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(V){(M._status===0||M._status===-1)&&(M._status=1,M._result=V)},function(V){(M._status===0||M._status===-1)&&(M._status=2,M._result=V)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var he=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},ae={map:Y,forEach:function(M,q,V){Y(M,function(){q.apply(this,arguments)},V)},count:function(M){var q=0;return Y(M,function(){q++}),q},toArray:function(M){return Y(M,function(q){return q})||[]},only:function(M){if(!F(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return et.Activity=p,et.Children=ae,et.Component=R,et.Fragment=n,et.Profiler=a,et.PureComponent=T,et.StrictMode=r,et.Suspense=d,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,et.__COMPILER_RUNTIME={__proto__:null,c:function(M){return N.H.useMemoCache(M)}},et.cache=function(M){return function(){return M.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(M,q,V){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var D=S({},M.props),z=M.key;if(q!=null)for(X in q.key!==void 0&&(z=""+q.key),q)!P.call(q,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&q.ref===void 0||(D[X]=q[X]);var X=arguments.length-2;if(X===1)D.children=V;else if(1<X){for(var ue=Array(X),ve=0;ve<X;ve++)ue[ve]=arguments[ve+2];D.children=ue}return $(M.type,z,D)},et.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:i,_context:M},M},et.createElement=function(M,q,V){var D,z={},X=null;if(q!=null)for(D in q.key!==void 0&&(X=""+q.key),q)P.call(q,D)&&D!=="key"&&D!=="__self"&&D!=="__source"&&(z[D]=q[D]);var ue=arguments.length-2;if(ue===1)z.children=V;else if(1<ue){for(var ve=Array(ue),Ie=0;Ie<ue;Ie++)ve[Ie]=arguments[Ie+2];z.children=ve}if(M&&M.defaultProps)for(D in ue=M.defaultProps,ue)z[D]===void 0&&(z[D]=ue[D]);return $(M,X,z)},et.createRef=function(){return{current:null}},et.forwardRef=function(M){return{$$typeof:u,render:M}},et.isValidElement=F,et.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:W}},et.memo=function(M,q){return{$$typeof:f,type:M,compare:q===void 0?null:q}},et.startTransition=function(M){var q=N.T,V={};N.T=V;try{var D=M(),z=N.S;z!==null&&z(V,D),typeof D=="object"&&D!==null&&typeof D.then=="function"&&D.then(I,he)}catch(X){he(X)}finally{q!==null&&V.types!==null&&(q.types=V.types),N.T=q}},et.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},et.use=function(M){return N.H.use(M)},et.useActionState=function(M,q,V){return N.H.useActionState(M,q,V)},et.useCallback=function(M,q){return N.H.useCallback(M,q)},et.useContext=function(M){return N.H.useContext(M)},et.useDebugValue=function(){},et.useDeferredValue=function(M,q){return N.H.useDeferredValue(M,q)},et.useEffect=function(M,q){return N.H.useEffect(M,q)},et.useEffectEvent=function(M){return N.H.useEffectEvent(M)},et.useId=function(){return N.H.useId()},et.useImperativeHandle=function(M,q,V){return N.H.useImperativeHandle(M,q,V)},et.useInsertionEffect=function(M,q){return N.H.useInsertionEffect(M,q)},et.useLayoutEffect=function(M,q){return N.H.useLayoutEffect(M,q)},et.useMemo=function(M,q){return N.H.useMemo(M,q)},et.useOptimistic=function(M,q){return N.H.useOptimistic(M,q)},et.useReducer=function(M,q,V){return N.H.useReducer(M,q,V)},et.useRef=function(M){return N.H.useRef(M)},et.useState=function(M){return N.H.useState(M)},et.useSyncExternalStore=function(M,q,V){return N.H.useSyncExternalStore(M,q,V)},et.useTransition=function(){return N.H.useTransition()},et.version="19.2.3",et}var GR;function Gs(){return GR||(GR=1,yy.exports=kD()),yy.exports}var _y={exports:{}},fr={};var ZR;function MD(){if(ZR)return fr;ZR=1;var e=Gs();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(d,f,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:d,containerInfo:f,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return fr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,fr.createPortal=function(d,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return i(d,f,null,m)},fr.flushSync=function(d){var f=l.T,m=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=m,r.d.f()}},fr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},fr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},fr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var m=f.as,p=u(m,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:y}):m==="script"&&r.d.X(d,{crossOrigin:p,integrity:g,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},fr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=u(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},fr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,p=u(m,f.crossOrigin);r.d.L(d,m,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},fr.preloadModule=function(d,f){if(typeof d=="string")if(f){var m=u(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},fr.requestFormReset=function(d){r.d.r(d)},fr.unstable_batchedUpdates=function(d,f){return d(f)},fr.useFormState=function(d,f,m){return l.H.useFormState(d,f,m)},fr.useFormStatus=function(){return l.H.useHostTransitionStatus()},fr.version="19.2.3",fr}var KR;function DC(){if(KR)return _y.exports;KR=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),_y.exports=MD(),_y.exports}var YR;function PD(){if(YR)return fu;YR=1;var e=ND(),t=Gs(),n=DC();function r(o){var s="https://react.dev/errors/"+o;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+o+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var s=o,c=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,(s.flags&4098)!==0&&(c=s.return),o=s.return;while(o)}return s.tag===3?c:null}function l(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function u(o){if(o.tag===31){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function d(o){if(i(o)!==o)throw Error(r(188))}function f(o){var s=o.alternate;if(!s){if(s=i(o),s===null)throw Error(r(188));return s!==o?null:o}for(var c=o,h=s;;){var v=c.return;if(v===null)break;var _=v.alternate;if(_===null){if(h=v.return,h!==null){c=h;continue}break}if(v.child===_.child){for(_=v.child;_;){if(_===c)return d(v),o;if(_===h)return d(v),s;_=_.sibling}throw Error(r(188))}if(c.return!==h.return)c=v,h=_;else{for(var k=!1,j=v.child;j;){if(j===c){k=!0,c=v,h=_;break}if(j===h){k=!0,h=v,c=_;break}j=j.sibling}if(!k){for(j=_.child;j;){if(j===c){k=!0,c=_,h=v;break}if(j===h){k=!0,h=_,c=v;break}j=j.sibling}if(!k)throw Error(r(189))}}if(c.alternate!==h)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?o:s}function m(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=m(o),s!==null)return s;o=o.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),T=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function G(o){return o===null||typeof o!="object"?null:(o=F&&o[F]||o["@@iterator"],typeof o=="function"?o:null)}var U=Symbol.for("react.client.reference");function J(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===U?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case R:return"Profiler";case w:return"StrictMode";case C:return"Suspense";case I:return"SuspenseList";case $:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case T:return o.displayName||"Context";case E:return(o._context.displayName||"Context")+".Consumer";case O:var s=o.render;return o=o.displayName,o||(o=s.displayName||s.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case N:return s=o.displayName||null,s!==null?s:J(o.type)||"Memo";case P:s=o._payload,o=o._init;try{return J(o(s))}catch{}}return null}var le=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},he=[],ae=-1;function M(o){return{current:o}}function q(o){0>ae||(o.current=he[ae],he[ae]=null,ae--)}function V(o,s){ae++,he[ae]=o.current,o.current=s}var D=M(null),z=M(null),X=M(null),ue=M(null);function ve(o,s){switch(V(X,s),V(z,o),V(D,null),s.nodeType){case 9:case 11:o=(o=s.documentElement)&&(o=o.namespaceURI)?cR(o):0;break;default:if(o=s.tagName,s=s.namespaceURI)s=cR(s),o=uR(s,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}q(D),V(D,o)}function Ie(){q(D),q(z),q(X)}function Ae(o){o.memoizedState!==null&&V(ue,o);var s=D.current,c=uR(s,o.type);s!==c&&(V(z,o),V(D,c))}function H(o){z.current===o&&(q(D),q(z)),ue.current===o&&(q(ue),iu._currentValue=W)}var ne,_e;function se(o){if(ne===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);ne=s&&s[1]||"",_e=-1<c.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+ne+o+_e}var ce=!1;function Te(o,s){if(!o||ce)return"";ce=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(ge){var me=ge}Reflect.construct(o,[],xe)}else{try{xe.call()}catch(ge){me=ge}o.call(xe.prototype)}}else{try{throw Error()}catch(ge){me=ge}(xe=o())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(ge){if(ge&&me&&typeof ge.stack=="string")return[ge.stack,me.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=h.DetermineComponentFrameRoot(),k=_[0],j=_[1];if(k&&j){var Q=k.split(`
@@ -171,4 +171,4 @@ ${r}
171
171
  `;break;case"id":u=w.includes("\0")?void 0:w;break;case"retry":/^\d+$/.test(w)?r(parseInt(w,10)):n(new fC(`Invalid \`retry\` value: "${w}"`,{type:"invalid-retry",value:w,line:R}));break;default:n(new fC(`Unknown field "${S.length>20?`${S.slice(0,20)}…`:S}"`,{type:"unknown-field",field:S,value:w,line:R}));break}}function y(){d.length>0&&t({id:u,event:f||void 0,data:d.endsWith(`
172
172
  `)?d.slice(0,-1):d}),u=void 0,d="",f=""}function b(S={}){i&&S.consume&&p(i),l=!0,u=void 0,d="",f="",i=""}return{feed:m,reset:b}}function Mee(e){const t=[];let n="",r=0;for(;r<e.length;){const a=e.indexOf("\r",r),i=e.indexOf(`
173
173
  `,r);let l=-1;if(a!==-1&&i!==-1?l=Math.min(a,i):a!==-1?a===e.length-1?l=-1:l=a:i!==-1&&(l=i),l===-1){n=e.slice(r);break}else{const u=e.slice(r,l);t.push(u),r=l+1,e[r-1]==="\r"&&e[r]===`
174
- `&&r++}}return[t,n]}class hC extends Event{constructor(t,n){var r,a;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(a=n?.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(pC(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(pC(this),n)}}function Pee(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function L_(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(L_).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${L_(e.cause)}`:e.message:`${e}`}function pC(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var e3=e=>{throw TypeError(e)},q1=(e,t,n)=>t.has(e)||e3("Cannot "+n),yt=(e,t,n)=>(q1(e,t,"read from private field"),n?n.call(e):t.get(e)),zn=(e,t,n)=>t.has(e)?e3("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),on=(e,t,n,r)=>(q1(e,t,"write to private field"),t.set(e,n),n),Ua=(e,t,n)=>(q1(e,t,"access private method"),n),$r,Ei,Fl,Sp,cm,Hu,Kl,Gu,Ns,Vl,tc,Bl,Mu,Lo,j_,$_,U_,mC,z_,F_,Pu,V_,B_;class Ep extends EventTarget{constructor(t,n){var r,a;super(),zn(this,Lo),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,zn(this,$r),zn(this,Ei),zn(this,Fl),zn(this,Sp),zn(this,cm),zn(this,Hu),zn(this,Kl),zn(this,Gu,null),zn(this,Ns),zn(this,Vl),zn(this,tc,null),zn(this,Bl,null),zn(this,Mu,null),zn(this,$_,async i=>{var l;yt(this,Vl).reset();const{body:u,redirected:d,status:f,headers:m}=i;if(f===204){Ua(this,Lo,Pu).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(d?on(this,Fl,new URL(i.url)):on(this,Fl,void 0),f!==200){Ua(this,Lo,Pu).call(this,`Non-200 status code (${f})`,f);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){Ua(this,Lo,Pu).call(this,'Invalid content type, expected "text/event-stream"',f);return}if(yt(this,$r)===this.CLOSED)return;on(this,$r,this.OPEN);const p=new Event("open");if((l=yt(this,Mu))==null||l.call(this,p),this.dispatchEvent(p),typeof u!="object"||!u||!("getReader"in u)){Ua(this,Lo,Pu).call(this,"Invalid response body, expected a web ReadableStream",f),this.close();return}const g=new TextDecoder,y=u.getReader();let b=!0;do{const{done:S,value:w}=await y.read();w&&yt(this,Vl).feed(g.decode(w,{stream:!S})),S&&(b=!1,yt(this,Vl).reset(),Ua(this,Lo,V_).call(this))}while(b)}),zn(this,U_,i=>{on(this,Ns,void 0),!(i.name==="AbortError"||i.type==="aborted")&&Ua(this,Lo,V_).call(this,L_(i))}),zn(this,z_,i=>{typeof i.id=="string"&&on(this,Gu,i.id);const l=new MessageEvent(i.event||"message",{data:i.data,origin:yt(this,Fl)?yt(this,Fl).origin:yt(this,Ei).origin,lastEventId:i.id||""});yt(this,Bl)&&(!i.event||i.event==="message")&&yt(this,Bl).call(this,l),this.dispatchEvent(l)}),zn(this,F_,i=>{on(this,Hu,i)}),zn(this,B_,()=>{on(this,Kl,void 0),yt(this,$r)===this.CONNECTING&&Ua(this,Lo,j_).call(this)});try{if(t instanceof URL)on(this,Ei,t);else if(typeof t=="string")on(this,Ei,new URL(t,Dee()));else throw new Error("Invalid URL")}catch{throw Pee("An invalid or illegal string was specified")}on(this,Vl,JM({onEvent:yt(this,z_),onRetry:yt(this,F_)})),on(this,$r,this.CONNECTING),on(this,Hu,3e3),on(this,cm,(r=n?.fetch)!=null?r:globalThis.fetch),on(this,Sp,(a=n?.withCredentials)!=null?a:!1),Ua(this,Lo,j_).call(this)}get readyState(){return yt(this,$r)}get url(){return yt(this,Ei).href}get withCredentials(){return yt(this,Sp)}get onerror(){return yt(this,tc)}set onerror(t){on(this,tc,t)}get onmessage(){return yt(this,Bl)}set onmessage(t){on(this,Bl,t)}get onopen(){return yt(this,Mu)}set onopen(t){on(this,Mu,t)}addEventListener(t,n,r){const a=n;super.addEventListener(t,a,r)}removeEventListener(t,n,r){const a=n;super.removeEventListener(t,a,r)}close(){yt(this,Kl)&&clearTimeout(yt(this,Kl)),yt(this,$r)!==this.CLOSED&&(yt(this,Ns)&&yt(this,Ns).abort(),on(this,$r,this.CLOSED),on(this,Ns,void 0))}}$r=new WeakMap,Ei=new WeakMap,Fl=new WeakMap,Sp=new WeakMap,cm=new WeakMap,Hu=new WeakMap,Kl=new WeakMap,Gu=new WeakMap,Ns=new WeakMap,Vl=new WeakMap,tc=new WeakMap,Bl=new WeakMap,Mu=new WeakMap,Lo=new WeakSet,j_=function(){on(this,$r,this.CONNECTING),on(this,Ns,new AbortController),yt(this,cm)(yt(this,Ei),Ua(this,Lo,mC).call(this)).then(yt(this,$_)).catch(yt(this,U_))},$_=new WeakMap,U_=new WeakMap,mC=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...yt(this,Gu)?{"Last-Event-ID":yt(this,Gu)}:void 0},cache:"no-store",signal:(e=yt(this,Ns))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},z_=new WeakMap,F_=new WeakMap,Pu=function(e,t){var n;yt(this,$r)!==this.CLOSED&&on(this,$r,this.CLOSED);const r=new hC("error",{code:t,message:e});(n=yt(this,tc))==null||n.call(this,r),this.dispatchEvent(r)},V_=function(e,t){var n;if(yt(this,$r)===this.CLOSED)return;on(this,$r,this.CONNECTING);const r=new hC("error",{code:t,message:e});(n=yt(this,tc))==null||n.call(this,r),this.dispatchEvent(r),on(this,Kl,setTimeout(yt(this,B_),yt(this,Hu)))},B_=new WeakMap,Ep.CONNECTING=0,Ep.OPEN=1,Ep.CLOSED=2;function Dee(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}function um(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function t3(e=fetch,t){return t?async(n,r)=>{const a={...t,...r,headers:r?.headers?{...um(t.headers),...um(r.headers)}:t.headers};return e(n,a)}:e}let H1;H1=globalThis.crypto;async function Lee(e){return(await H1).getRandomValues(new Uint8Array(e))}async function jee(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%t.length;let r="";for(;r.length<e;){const a=await Lee(e-r.length);for(const i of a)i<n&&(r+=t[i%t.length])}return r}async function $ee(e){return await jee(e)}async function Uee(e){const t=await(await H1).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function zee(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await $ee(e),n=await Uee(t);return{code_verifier:t,code_challenge:n}}const rr=dU().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:tz.custom,message:"URL must be parseable",fatal:!0}),p$}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Fee=ar({resource:L().url(),authorization_servers:Oe(rr).optional(),jwks_uri:L().url().optional(),scopes_supported:Oe(L()).optional(),bearer_methods_supported:Oe(L()).optional(),resource_signing_alg_values_supported:Oe(L()).optional(),resource_name:L().optional(),resource_documentation:L().optional(),resource_policy_uri:L().url().optional(),resource_tos_uri:L().url().optional(),tls_client_certificate_bound_access_tokens:ut().optional(),authorization_details_types_supported:Oe(L()).optional(),dpop_signing_alg_values_supported:Oe(L()).optional(),dpop_bound_access_tokens_required:ut().optional()}),n3=ar({issuer:L(),authorization_endpoint:rr,token_endpoint:rr,registration_endpoint:rr.optional(),scopes_supported:Oe(L()).optional(),response_types_supported:Oe(L()),response_modes_supported:Oe(L()).optional(),grant_types_supported:Oe(L()).optional(),token_endpoint_auth_methods_supported:Oe(L()).optional(),token_endpoint_auth_signing_alg_values_supported:Oe(L()).optional(),service_documentation:rr.optional(),revocation_endpoint:rr.optional(),revocation_endpoint_auth_methods_supported:Oe(L()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Oe(L()).optional(),introspection_endpoint:L().optional(),introspection_endpoint_auth_methods_supported:Oe(L()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Oe(L()).optional(),code_challenge_methods_supported:Oe(L()).optional(),client_id_metadata_document_supported:ut().optional()}),Vee=ar({issuer:L(),authorization_endpoint:rr,token_endpoint:rr,userinfo_endpoint:rr.optional(),jwks_uri:rr,registration_endpoint:rr.optional(),scopes_supported:Oe(L()).optional(),response_types_supported:Oe(L()),response_modes_supported:Oe(L()).optional(),grant_types_supported:Oe(L()).optional(),acr_values_supported:Oe(L()).optional(),subject_types_supported:Oe(L()),id_token_signing_alg_values_supported:Oe(L()),id_token_encryption_alg_values_supported:Oe(L()).optional(),id_token_encryption_enc_values_supported:Oe(L()).optional(),userinfo_signing_alg_values_supported:Oe(L()).optional(),userinfo_encryption_alg_values_supported:Oe(L()).optional(),userinfo_encryption_enc_values_supported:Oe(L()).optional(),request_object_signing_alg_values_supported:Oe(L()).optional(),request_object_encryption_alg_values_supported:Oe(L()).optional(),request_object_encryption_enc_values_supported:Oe(L()).optional(),token_endpoint_auth_methods_supported:Oe(L()).optional(),token_endpoint_auth_signing_alg_values_supported:Oe(L()).optional(),display_values_supported:Oe(L()).optional(),claim_types_supported:Oe(L()).optional(),claims_supported:Oe(L()).optional(),service_documentation:L().optional(),claims_locales_supported:Oe(L()).optional(),ui_locales_supported:Oe(L()).optional(),claims_parameter_supported:ut().optional(),request_parameter_supported:ut().optional(),request_uri_parameter_supported:ut().optional(),require_request_uri_registration:ut().optional(),op_policy_uri:rr.optional(),op_tos_uri:rr.optional(),client_id_metadata_document_supported:ut().optional()}),Bee=pe({...Vee.shape,...n3.pick({code_challenge_methods_supported:!0}).shape}),qee=pe({access_token:L(),id_token:L().optional(),token_type:L(),expires_in:WI().optional(),scope:L().optional(),refresh_token:L().optional()}).strip(),Hee=pe({error:L(),error_description:L().optional(),error_uri:L().optional()}),gC=rr.optional().or(je("").transform(()=>{})),Gee=pe({redirect_uris:Oe(rr),token_endpoint_auth_method:L().optional(),grant_types:Oe(L()).optional(),response_types:Oe(L()).optional(),client_name:L().optional(),client_uri:rr.optional(),logo_uri:gC,scope:L().optional(),contacts:Oe(L()).optional(),tos_uri:gC,policy_uri:L().optional(),jwks_uri:rr.optional(),jwks:eo().optional(),software_id:L().optional(),software_version:L().optional(),software_statement:L().optional()}).strip(),Zee=pe({client_id:L(),client_secret:L().optional(),client_id_issued_at:Ze().optional(),client_secret_expires_at:Ze().optional()}).strip(),Kee=Gee.merge(Zee);pe({error:L(),error_description:L().optional()}).strip();pe({token:L(),token_type_hint:L().optional()}).strip();function Yee(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function Wee({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class Yn extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class q_ extends Yn{}q_.errorCode="invalid_request";class dm extends Yn{}dm.errorCode="invalid_client";class fm extends Yn{}fm.errorCode="invalid_grant";class hm extends Yn{}hm.errorCode="unauthorized_client";class H_ extends Yn{}H_.errorCode="unsupported_grant_type";class G_ extends Yn{}G_.errorCode="invalid_scope";class Z_ extends Yn{}Z_.errorCode="access_denied";class cc extends Yn{}cc.errorCode="server_error";class K_ extends Yn{}K_.errorCode="temporarily_unavailable";class Y_ extends Yn{}Y_.errorCode="unsupported_response_type";class W_ extends Yn{}W_.errorCode="unsupported_token_type";class Q_ extends Yn{}Q_.errorCode="invalid_token";class X_ extends Yn{}X_.errorCode="method_not_allowed";class J_ extends Yn{}J_.errorCode="too_many_requests";class pm extends Yn{}pm.errorCode="invalid_client_metadata";class eb extends Yn{}eb.errorCode="insufficient_scope";class tb extends Yn{}tb.errorCode="invalid_target";const Qee={[q_.errorCode]:q_,[dm.errorCode]:dm,[fm.errorCode]:fm,[hm.errorCode]:hm,[H_.errorCode]:H_,[G_.errorCode]:G_,[Z_.errorCode]:Z_,[cc.errorCode]:cc,[K_.errorCode]:K_,[Y_.errorCode]:Y_,[W_.errorCode]:W_,[Q_.errorCode]:Q_,[X_.errorCode]:X_,[J_.errorCode]:J_,[pm.errorCode]:pm,[eb.errorCode]:eb,[tb.errorCode]:tb};class $o extends Error{constructor(t){super(t??"Unauthorized")}}function Xee(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const $0="code",U0="S256";function Jee(e,t){const n=e.client_secret!==void 0;return t.length===0?n?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Xee(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function ete(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":tte(a,i,n);return;case"client_secret_post":nte(a,i,r);return;case"none":rte(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function tte(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function nte(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function rte(e,t){t.set("client_id",e)}async function r3(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=Hee.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:l}=r,u=Qee[a]||cc;return new u(i||"",l)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new cc(a)}}async function Oi(e,t){try{return await z0(e,t)}catch(n){if(n instanceof dm||n instanceof hm)return await e.invalidateCredentials?.("all"),await z0(e,t);if(n instanceof fm)return await e.invalidateCredentials?.("tokens"),await z0(e,t);throw n}}async function z0(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){let l,u;try{l=await ste(t,{resourceMetadataUrl:a},i),l.authorization_servers&&l.authorization_servers.length>0&&(u=l.authorization_servers[0])}catch{}u||(u=new URL("/",t));const d=await ate(t,e,l),f=await dte(u,{fetchFn:i});let m=await Promise.resolve(e.clientInformation());if(!m){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const w=f?.client_id_metadata_document_supported===!0,R=e.clientMetadataUrl;if(R&&!ote(R))throw new pm(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${R}`);if(w&&R)m={client_id:R},await e.saveClientInformation?.(m);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const T=await mte(u,{metadata:f,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(T),m=T}}const p=!e.redirectUrl;if(n!==void 0||p){const w=await pte(e,u,{metadata:f,resource:d,authorizationCode:n,fetchFn:i});return await e.saveTokens(w),"AUTHORIZED"}const g=await e.tokens();if(g?.refresh_token)try{const w=await hte(u,{metadata:f,clientInformation:m,refreshToken:g.refresh_token,resource:d,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(w),"AUTHORIZED"}catch(w){if(!(!(w instanceof Yn)||w instanceof cc))throw w}const y=e.state?await e.state():void 0,{authorizationUrl:b,codeVerifier:S}=await fte(u,{metadata:f,clientInformation:m,state:y,redirectUrl:e.redirectUrl,scope:r||l?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:d});return await e.saveCodeVerifier(S),await e.redirectToAuthorization(b),"REDIRECT"}function ote(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function ate(e,t,n){const r=Yee(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!Wee({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function mm(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=F0(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const l=F0(e,"scope")||void 0,u=F0(e,"error")||void 0;return{resourceMetadataUrl:i,scope:l,error:u}}function F0(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function ste(e,t,n=fetch){const r=await cte(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Fee.parse(await r.json())}async function G1(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?G1(e,void 0,n):void 0;throw r}}function ite(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function vC(e,t,n=fetch){return await G1(e,{"MCP-Protocol-Version":t},n)}function lte(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function cte(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??Wm;let l;if(r?.metadataUrl)l=new URL(r.metadataUrl);else{const d=ite(t,a.pathname);l=new URL(d,r?.metadataServerUrl??a),l.search=a.search}let u=await vC(l,i,n);if(!r?.metadataUrl&&lte(u,a.pathname)){const d=new URL(`/.well-known/${t}`,a);u=await vC(d,i,n)}return u}function ute(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function dte(e,{fetchFn:t=fetch,protocolVersion:n=Wm}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=ute(e);for(const{url:i,type:l}of a){const u=await G1(i,r,t);if(u){if(!u.ok){if(await u.body?.cancel(),u.status>=400&&u.status<500)continue;throw new Error(`HTTP ${u.status} trying to load ${l==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return l==="oauth"?n3.parse(await u.json()):Bee.parse(await u.json())}}}async function fte(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:l}){let u;if(t){if(u=new URL(t.authorization_endpoint),!t.response_types_supported.includes($0))throw new Error(`Incompatible auth server: does not support response type ${$0}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(U0))throw new Error(`Incompatible auth server: does not support code challenge method ${U0}`)}else u=new URL("/authorize",e);const d=await zee(),f=d.code_verifier,m=d.code_challenge;return u.searchParams.set("response_type",$0),u.searchParams.set("client_id",n.client_id),u.searchParams.set("code_challenge",m),u.searchParams.set("code_challenge_method",U0),u.searchParams.set("redirect_uri",String(r)),i&&u.searchParams.set("state",i),a&&u.searchParams.set("scope",a),a?.includes("offline_access")&&u.searchParams.append("prompt","consent"),l&&u.searchParams.set("resource",l.href),{authorizationUrl:u,codeVerifier:f}}function o3(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function Z1(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:l}){const u=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),d=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(d,n,u,t);else if(r){const m=t?.token_endpoint_auth_methods_supported??[],p=Jee(r,m);ete(p,r,d,n)}const f=await(l??fetch)(u,{method:"POST",headers:d,body:n});if(!f.ok)throw await r3(f);return qee.parse(await f.json())}async function Fre(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:l,addClientAuthentication:u,fetchFn:d}){const f=o3(r,a,i);return Z1(e,{metadata:t,tokenRequestParams:f,clientInformation:n,addClientAuthentication:u,resource:l,fetchFn:d})}async function hte(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:l}){const u=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),d=await Z1(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:l});return{refresh_token:r,...d}}async function pte(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const l=e.clientMetadata.scope;let u;if(e.prepareTokenRequest&&(u=await e.prepareTokenRequest(l)),!u){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const f=await e.codeVerifier();u=o3(a,f,e.redirectUrl)}const d=await e.clientInformation();return Z1(t,{metadata:n,tokenRequestParams:u,clientInformation:d??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function mte(e,{metadata:t,clientMetadata:n,fetchFn:r}){let a;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");a=new URL(t.registration_endpoint)}else a=new URL("/register",e);const i=await(r??fetch)(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw await r3(i);return Kee.parse(await i.json())}class gte extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class vte{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=t3(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new $o("No auth provider");let t;try{t=await Oi(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new $o;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=um(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new Ep(this._url.href,{...this._eventSourceInit,fetch:async(a,i)=>{const l=await this._commonHeaders();l.set("Accept","text/event-stream");const u=await t(a,{...i,headers:l});if(u.status===401&&u.headers.has("www-authenticate")){const{resourceMetadataUrl:d,scope:f}=mm(u);this._resourceMetadataUrl=d,this._scope=f}return u}}),this._abortController=new AbortController,this._eventSource.onerror=a=>{if(a.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const i=new gte(a.code,a.message,a);r(i),this.onerror?.(i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",a=>{const i=a;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(l){r(l),this.onerror?.(l),this.close();return}n()}),this._eventSource.onmessage=a=>{const i=a;let l;try{l=qu.parse(JSON.parse(i.data))}catch(u){this.onerror?.(u);return}this.onmessage?.(l)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new $o("No auth provider");if(await Oi(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._endpoint,r);if(!a.ok){const i=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){const{resourceMetadataUrl:l,scope:u}=mm(a);if(this._resourceMetadataUrl=l,this._scope=u,await Oi(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${a.status}): ${i}`)}await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const yte="mcp";class _te{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,yte),this._socket.onerror=r=>{const a="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(a),this.onerror?.(a)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let a;try{a=qu.parse(JSON.parse(r.data))}catch(i){this.onerror?.(i);return}this.onmessage?.(a)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class bte extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let a;super({start(i){a=JM({onEvent:l=>{i.enqueue(l)},onError(l){t==="terminate"?i.error(l):typeof t=="function"&&t(l)},onRetry:n,onComment:r})},transform(i){a.feed(i)}})}}const wte={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $l extends Error{constructor(t,n){super(`Streamable HTTP error: ${n}`),this.code=t}}class Ste{constructor(t,n){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=t3(n?.fetch,n?.requestInit),this._sessionId=n?.sessionId,this._reconnectionOptions=n?.reconnectionOptions??wte}async _authThenStart(){if(!this._authProvider)throw new $o("No auth provider");let t;try{t=await Oi(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new $o;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=um(this._requestInit?.headers);return new Headers({...t,...n})}async _startOrAuthSse(t){const{resumptionToken:n}=t;try{const r=await this._commonHeaders();r.set("Accept","text/event-stream"),n&&r.set("last-event-id",n);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:r,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new $l(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,t,!0)}catch(r){throw this.onerror?.(r),r}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const n=this._reconnectionOptions.initialReconnectionDelay,r=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(n*Math.pow(r,t),a)}_scheduleReconnection(t,n=0){const r=this._reconnectionOptions.maxRetries;if(n>=r){this.onerror?.(new Error(`Maximum reconnection attempts (${r}) exceeded.`));return}const a=this._getNextReconnectionDelay(n);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,n+1)})},a)}_handleSseStream(t,n,r){if(!t)return;const{onresumptiontoken:a,replayMessageId:i}=n;let l,u=!1,d=!1;(async()=>{try{const m=t.pipeThrough(new TextDecoderStream).pipeThrough(new bte({onRetry:y=>{this._serverRetryMs=y}})).getReader();for(;;){const{value:y,done:b}=await m.read();if(b)break;if(y.id&&(l=y.id,u=!0,a?.(y.id)),!!y.data&&(!y.event||y.event==="message"))try{const S=qu.parse(JSON.parse(y.data));ku(S)&&(d=!0,i!==void 0&&(S.id=i)),this.onmessage?.(S)}catch(S){this.onerror?.(S)}}(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(m){if(this.onerror?.(new Error(`SSE stream disconnected: ${m}`)),(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(y){this.onerror?.(new Error(`Failed to reconnect: ${y instanceof Error?y.message:String(y)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new $o("No auth provider");if(await Oi(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,n){try{const{resumptionToken:r,onresumptiontoken:a}=n||{};if(r){this._startOrAuthSse({resumptionToken:r,replayMessageId:D_(t)?t.id:void 0}).catch(g=>this.onerror?.(g));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const l={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},u=await(this._fetch??fetch)(this._url,l),d=u.headers.get("mcp-session-id");if(d&&(this._sessionId=d),!u.ok){const g=await u.text().catch(()=>null);if(u.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $l(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:y,scope:b}=mm(u);if(this._resourceMetadataUrl=y,this._scope=b,await Oi(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o;return this._hasCompletedAuthFlow=!0,this.send(t)}if(u.status===403&&this._authProvider){const{resourceMetadataUrl:y,scope:b,error:S}=mm(u);if(S==="insufficient_scope"){const w=u.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===w)throw new $l(403,"Server returned 403 after trying upscoping");if(b&&(this._scope=b),y&&(this._resourceMetadataUrl=y),this._lastUpscopingHeader=w??void 0,await Oi(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new $o;return this.send(t)}}throw new $l(u.status,`Error POSTing to endpoint: ${g}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,u.status===202){await u.body?.cancel(),YQ(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(g=>this.onerror?.(g));return}const m=(Array.isArray(t)?t:[t]).filter(g=>"method"in g&&"id"in g&&g.id!==void 0).length>0,p=u.headers.get("content-type");if(m)if(p?.includes("text/event-stream"))this._handleSseStream(u.body,{onresumptiontoken:a},!1);else if(p?.includes("application/json")){const g=await u.json(),y=Array.isArray(g)?g.map(b=>qu.parse(b)):[qu.parse(g)];for(const b of y)this.onmessage?.(b)}else throw await u.body?.cancel(),new $l(-1,`Unexpected content type: ${p}`);else await u.body?.cancel()}catch(r){throw this.onerror?.(r),r}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const t=await this._commonHeaders(),n={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},r=await(this._fetch??fetch)(this._url,n);if(await r.body?.cancel(),!r.ok&&r.status!==405)throw new $l(r.status,`Failed to terminate session: ${r.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,n){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:n?.onresumptiontoken})}}class Ete extends Ste{constructor(t,n){super(t,n)}send(t,n){const r=Rte(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function Rte(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class xte extends kee{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},z1,n)}}const Tte=async(e,t,n)=>{const r=Ote(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const a=new xte({name:e?.name??"MCP Client",version:"1.0.0"});return await a.connect(r),{client:a,callStreamableTool:(i,l)=>{if(e.connection.type!=="HTTP")throw new Error("HTTP connection required");const u=new Headers(n);u.has("Authorization")||u.set("Authorization",`Bearer ${e.connection.token}`);for(const[m,p]of Object.entries(e.connection.headers??{}))u.set(m,p);const d=new URL(e.connection.url),f=d.pathname.replace(/\/+$/,"")||"/";return d.pathname=`${f}/call-tool/${encodeURIComponent(i)}`,fetch(d.href,{method:"POST",redirect:"manual",body:JSON.stringify(l),headers:u})}}},Ote=(e,t,n)=>{if(e.type==="Websocket")return new _te(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const a={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const i={requestInit:{headers:a,signal:t}};return e.token&&(i.eventSourceInit={fetch:(l,u)=>fetch(l,{...u,headers:{...a,Accept:"text/event-stream"},signal:t})}),new vte(new URL(e.url),i)}return new Ete(new URL(e.url),{requestInit:{headers:a,signal:t,credentials:"include"}})},Cte=e=>{try{return JSON.parse(e)}catch{return e}},up=new Map,yC=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?pr(e.inputSchema):void 0,outputSchema:e.outputSchema?pr(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function Ate(e){const t=n=>"connection"in e?Tte({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return u;async function a(d,f=r){const m=e?.debugId?.(),p=m?{"x-trace-debug-id":m}:void 0,{client:g,callStreamableTool:y}=await t(p);if(e?.streamable?.[String(f)])return y(String(f),d);const{structuredContent:b,isError:S,content:w}=await g.callTool({name:String(f),arguments:d});if(S){const R=w?.[0]?.text,E=typeof R=="string"?Cte(R):null,T=E?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(E.code,E.message,E.traceId):null;throw T||new Error(`Tool ${String(f)} returned an error: ${JSON.stringify(b??w)}`)}return b}async function i(){const{client:d}=await t(),{tools:f}=await d.listTools();return f}async function l(){if(!("connection"in e))return i();const d=e.connection,f=JSON.stringify(d);try{return up.has(f)||up.set(f,i()),await up.get(f)}catch(m){console.error("Failed to list tools",m),up.delete(f);return}}async function u(){return(await l()??[]).map(f=>yC(f,a))}return a.asTool=async()=>{const f=(await l()??[]).find(m=>m.name===r);if(!f)throw new Error(`Tool ${r} not found`);return yC(f,a)},a}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>Ite({connection:n}):global[t]}});function Ite(e){return Ate(e)}const a3=A.createContext(null);function Vre(e){const t=pc.c(3),{value:n,children:r}=e,a=n;let i;return t[0]!==r||t[1]!==a?(i=x.jsx(a3.Provider,{value:a,children:r}),t[0]=r,t[1]=a,t[2]=i):i=t[2],i}function Bre(e){const t=A.useContext(a3);if(!t)throw new Error("usePluginContext must be used within a PluginContextProvider");if(!t.connectionId||!t.connection||!t.toolCaller)throw new Error("usePluginContext requires a valid connection. Use { partial: true } in empty state components.");return t}const Nte=pe({id:L().describe("Unique identifier for the entity"),title:L().describe("Human-readable title for the entity"),description:L().nullish().describe("Description of the entity"),created_at:L().datetime(),updated_at:L().datetime(),created_by:L().optional(),updated_by:L().optional()}),kte=pe({field:Oe(L()),operator:sn(["eq","gt","gte","lt","lte","in","like","contains"]),value:kt()}),s3=Za(()=>Lt([kte,pe({operator:sn(["and","or","not"]),conditions:Oe(s3)})])),Mte=pe({field:Oe(L()),direction:sn(["asc","desc"]),nulls:sn(["first","last"]).optional()}),Pte=pe({where:s3.optional().describe("Filter expression"),orderBy:Oe(Mte).optional().describe("Sort expressions"),limit:Ze().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:Ze().int().min(0).optional().describe("Number of items to skip")});function Dte(e){return pe({items:Oe(e).describe("Array of collection items"),totalCount:Ze().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:ut().optional().describe("Whether there are more items available")})}const Lte=pe({id:L().describe("ID of the entity to retrieve")});function jte(e){return pe({item:e.nullable().describe("The retrieved item, or null if not found")})}function $te(e){return pe({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function Ute(e){return pe({item:e.describe("The created entity with generated id")})}function zte(e){return pe({id:L().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function Fte(e){return pe({item:e.describe("The updated entity")})}const Vte=pe({id:L().describe("ID of the entity to delete")});function Bte(e){return pe({item:e.describe("The deleted entity")})}function qte(e,t,n){const r=e.toUpperCase(),a=n?.readOnly??!1,i=[{name:`COLLECTION_${r}_LIST`,inputSchema:Pte,outputSchema:Dte(t)},{name:`COLLECTION_${r}_GET`,inputSchema:Lte,outputSchema:jte(t)}];return a||i.push({name:`COLLECTION_${r}_CREATE`,inputSchema:$te(t),outputSchema:Ute(t),opt:!0},{name:`COLLECTION_${r}_UPDATE`,inputSchema:zte(t),outputSchema:Fte(t),opt:!0},{name:`COLLECTION_${r}_DELETE`,inputSchema:Vte,outputSchema:Bte(t),opt:!0}),i}const Hte=pe({id:L(),name:L(),description:L().optional(),inputSchema:Ft(L(),kt()),outputSchema:Ft(L(),kt()).optional()}),Gte=Nte.extend({_meta:pe({"io.decocms":pe({id:L(),verified:ut(),scopeName:L(),appName:L(),friendlyName:L().nullable().optional(),metadata:Ft(L(),kt()).nullable().optional(),publishedAt:L().datetime().optional(),updatedAt:L().datetime().optional(),tools:Oe(Hte).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:pe({$schema:L().optional(),_meta:Ft(L(),kt()).optional(),name:L().describe("The server name (scope/app)"),title:L().optional().describe("User-friendly title"),description:L().optional().describe("Server description"),icons:Oe(pe({src:L(),mimeType:L().optional(),sizes:Oe(L()).optional(),theme:sn(["light","dark"]).optional()})).optional(),remotes:Oe(pe({type:sn(["http","stdio","sse"]),url:L().optional(),headers:Oe(kt()).optional()})).optional(),packages:Oe(kt()).optional(),repository:pe({url:L(),source:L().optional(),subfolder:L().optional()}).optional(),version:L().optional(),websiteUrl:L().optional()})});qte("registry_app",Gte,{readOnly:!0});const Zte=pe({specversion:je("1.0").describe("CloudEvents specification version"),id:L().describe("Unique identifier for this event (UUID recommended)"),source:L().describe("Connection ID of the event publisher"),type:L().describe("Event type (e.g., 'order.created', 'user.signup')"),time:L().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:L().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:L().optional().default("application/json").describe("Content type of the data attribute"),dataschema:L().url().optional().describe("URI to the schema for the data attribute"),data:kt().optional().describe("Event payload (any JSON value)")});pe({events:Oe(Zte).min(1).describe("Batch of CloudEvents to process")});const Kte=pe({success:ut().optional().describe("Whether this event was processed successfully"),error:L().optional().describe("Error message for this event"),retryAfter:Ze().int().positive().optional().describe("Re-deliver this event after this many ms")});pe({success:ut().optional().describe("Batch success - applies to events not in results"),error:L().optional().describe("Batch error message - applies to events not in results"),processedCount:Ze().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:Ze().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:Ft(L(),Kte).optional().describe("Per-event results keyed by event ID")});pe({type:L().min(1).max(255).describe("Event type identifier"),subject:L().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:kt().optional().describe("Event payload"),deliverAt:L().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:L().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")});pe({id:L().describe("Unique event ID"),type:L().describe("Event type"),source:L().describe("Source connection ID"),time:L().describe("Event timestamp")});pe({eventType:L().min(1).max(255).describe("Event type to subscribe to"),publisher:L().optional().describe("Filter events by publisher connection ID"),filter:L().max(1e3).optional().describe("JSONPath filter expression on event data")});pe({subscription:pe({id:L().describe("Subscription ID"),connectionId:L().describe("Subscriber connection ID"),eventType:L().describe("Event type pattern"),publisher:L().nullable().describe("Publisher connection filter"),filter:L().nullable().describe("JSONPath filter expression"),enabled:ut().describe("Whether subscription is enabled"),createdAt:L().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:L().datetime().describe("Updated timestamp (ISO 8601)")})});const Yte=pe({eventType:L().min(1).max(255).describe("Event type to subscribe to"),publisher:L().optional().describe("Filter events by publisher connection ID"),filter:L().max(1e3).optional().describe("JSONPath filter expression on event data")}),Wte=pe({id:L().describe("Subscription ID"),connectionId:L().describe("Subscriber connection ID"),eventType:L().describe("Event type pattern"),publisher:L().nullable().describe("Publisher connection filter"),filter:L().nullable().describe("JSONPath filter expression"),enabled:ut().describe("Whether subscription is enabled"),createdAt:L().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:L().datetime().describe("Updated timestamp (ISO 8601)")});pe({subscriptions:Oe(Yte).describe("Desired subscriptions - system will create/update/delete to match")});pe({created:Ze().int().min(0).describe("Number of subscriptions created"),updated:Ze().int().min(0).describe("Number of subscriptions with filter updated"),deleted:Ze().int().min(0).describe("Number of subscriptions removed"),unchanged:Ze().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:Oe(Wte).describe("Current subscriptions after sync")});pe({subscriptionId:L().describe("Subscription ID to remove")});pe({success:ut().describe("Whether unsubscribe was successful"),subscriptionId:L().describe("Subscription ID that was removed")});pe({eventId:L().describe("Event ID to cancel")});pe({success:ut().describe("Whether cancellation was successful"),eventId:L().describe("Event ID that was cancelled")});pe({eventId:L().describe("Event ID to acknowledge")});pe({success:ut().describe("Whether ACK was successful"),eventId:L().describe("Event ID that was acknowledged")});const Qte=pe({prefix:L().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:Ze().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:L().optional().describe("Token for pagination from previous response"),delimiter:L().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")}),Xte=pe({objects:Oe(pe({key:L().describe("Object key/path"),size:Ze().describe("Object size in bytes"),lastModified:L().describe("Last modified timestamp"),etag:L().describe("Entity tag for the object")})),nextContinuationToken:L().optional().describe("Token for fetching next page of results"),isTruncated:ut().describe("Whether there are more results available"),commonPrefixes:Oe(L()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")}),Jte=pe({key:L().describe("Object key/path to get metadata for")}),ene=pe({contentType:L().optional().describe("MIME type of the object"),contentLength:Ze().describe("Size of the object in bytes"),lastModified:L().describe("Last modified timestamp"),etag:L().describe("Entity tag for the object"),metadata:Ft(L(),L()).optional().describe("Custom metadata key-value pairs")}),tne=pe({key:L().describe("Object key/path to generate URL for"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)")}),nne=pe({url:L().describe("Presigned URL for downloading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),rne=pe({key:L().describe("Object key/path for the upload"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:L().optional().describe("MIME type for the object being uploaded")}),one=pe({url:L().describe("Presigned URL for uploading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),ane=pe({key:L().describe("Object key/path to delete")}),sne=pe({success:ut().describe("Whether the deletion was successful"),key:L().describe("The key that was deleted")}),ine=pe({keys:Oe(L()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")}),lne=pe({deleted:Oe(L()).describe("Array of successfully deleted keys"),errors:Oe(pe({key:L(),message:L()})).describe("Array of errors for failed deletions")}),cne=[{name:"LIST_OBJECTS",inputSchema:Qte,outputSchema:Xte},{name:"GET_OBJECT_METADATA",inputSchema:Jte,outputSchema:ene},{name:"GET_PRESIGNED_URL",inputSchema:tne,outputSchema:nne},{name:"PUT_PRESIGNED_URL",inputSchema:rne,outputSchema:one},{name:"DELETE_OBJECT",inputSchema:ane,outputSchema:sne},{name:"DELETE_OBJECTS",inputSchema:ine,outputSchema:lne}],i3=({size:e=24,color:t="currentColor",...n})=>A.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},A.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Z"}));i3.displayName="Folder";function _C(e,t,n){return e?e.startsWith("/")?`/${t}/${n}${e}`:e:`/${t}/${n}`}function une(e){return{createRoutes:e,useParams:t=>Yl({strict:!1}),useSearch:t=>xm({strict:!1}),useNavigate:()=>{const t=mc(),{org:n,pluginId:r}=Yl({strict:!1});return a=>{const i=_C(a.to,n,r);return t({...a,to:i,params:{org:n,pluginId:r,...a.params}})}},useLocation:()=>oL(),Link:function(n){const{org:r,pluginId:a}=Yl({strict:!1}),i=_C(n.to,r,a);return x.jsx(Om,{...n,to:i,params:{org:r,pluginId:a,...n.params}})},_types:{routes:void 0,routeIds:void 0}}}var Nt;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const l of a)i[l]=l;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),l={};for(const u of i)l[u]=a[u];return e.objectValues(l)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&i.push(l);return i},e.find=(a,i)=>{for(const l of a)if(i(l))return l},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Nt||(Nt={}));var bC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(bC||(bC={}));const Fe=Nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),As=e=>{switch(typeof e){case"undefined":return Fe.undefined;case"string":return Fe.string;case"number":return Number.isNaN(e)?Fe.nan:Fe.number;case"boolean":return Fe.boolean;case"function":return Fe.function;case"bigint":return Fe.bigint;case"symbol":return Fe.symbol;case"object":return Array.isArray(e)?Fe.array:e===null?Fe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Fe.promise:typeof Map<"u"&&e instanceof Map?Fe.map:typeof Set<"u"&&e instanceof Set?Fe.set:typeof Date<"u"&&e instanceof Date?Fe.date:Fe.object;default:return Fe.unknown}},Ne=Nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class qa extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let u=r,d=0;for(;d<l.path.length;){const f=l.path[d];d===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(l))):u[f]=u[f]||{_errors:[]},u=u[f],d++}}};return a(this),r}static assert(t){if(!(t instanceof qa))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Nt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}qa.create=e=>new qa(e);const nb=(e,t)=>{let n;switch(e.code){case Ne.invalid_type:e.received===Fe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Nt.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${Nt.joinValues(e.keys,", ")}`;break;case Ne.invalid_union:n="Invalid input";break;case Ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Nt.joinValues(e.options)}`;break;case Ne.invalid_enum_value:n=`Invalid enum value. Expected ${Nt.joinValues(e.options)}, received '${e.received}'`;break;case Ne.invalid_arguments:n="Invalid function arguments";break;case Ne.invalid_return_type:n="Invalid function return type";break;case Ne.invalid_date:n="Invalid date";break;case Ne.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Nt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ne.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ne.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ne.custom:n="Invalid input";break;case Ne.invalid_intersection_types:n="Intersection results could not be merged";break;case Ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,Nt.assertNever(e)}return{message:n}};let dne=nb;function fne(){return dne}const hne=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],l={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let u="";const d=r.filter(f=>!!f).slice().reverse();for(const f of d)u=f(l,{data:t,defaultError:u}).message;return{...a,path:i,message:u}};function De(e,t){const n=fne(),r=hne({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===nb?void 0:nb].filter(a=>!!a)});e.common.issues.push(r)}class ro{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return tt;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,l=await a.value;r.push({key:i,value:l})}return ro.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:l}=a;if(i.status==="aborted"||l.status==="aborted")return tt;i.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(r[i.value]=l.value)}return{status:t.value,value:r}}}const tt=Object.freeze({status:"aborted"}),Du=e=>({status:"dirty",value:e}),Oo=e=>({status:"valid",value:e}),wC=e=>e.status==="aborted",SC=e=>e.status==="dirty",uc=e=>e.status==="valid",gm=e=>typeof Promise<"u"&&e instanceof Promise;var Ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ge||(Ge={}));class qs{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const EC=(e,t)=>{if(uc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new qa(e.common.issues);return this._error=n,this._error}}};function mt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(l,u)=>{const{message:d}=e;return l.code==="invalid_enum_value"?{message:d??u.defaultError}:typeof u.data>"u"?{message:d??r??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:d??n??u.defaultError}},description:a}}class xt{get description(){return this._def.description}_getType(t){return As(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:As(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ro,ctx:{common:t.parent.common,data:t.data,parsedType:As(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(gm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:As(t)},a=this._parseSync({data:t,path:r.path,parent:r});return EC(r,a)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:As(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return uc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>uc(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:As(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(gm(a)?a:Promise.resolve(a));return EC(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const l=t(a),u=()=>i.addIssue({code:Ne.custom,...r(a)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new fc({schema:this,typeName:nt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Us.create(this,this._def)}nullable(){return hc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ia.create(this)}promise(){return bm.create(this,this._def)}or(t){return ym.create([this,t],this._def)}and(t){return _m.create(this,t,this._def)}transform(t){return new fc({...mt(this._def),schema:this,typeName:nt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ab({...mt(this._def),innerType:this,defaultValue:n,typeName:nt.ZodDefault})}brand(){return new Lne({typeName:nt.ZodBranded,type:this,...mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new sb({...mt(this._def),innerType:this,catchValue:n,typeName:nt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return K1.create(this,t)}readonly(){return ib.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pne=/^c[^\s-]{8,}$/i,mne=/^[0-9a-z]+$/,gne=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vne=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,yne=/^[a-z0-9_-]{21}$/i,_ne=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,bne=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wne=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Sne="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let V0;const Ene=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rne=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,xne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Tne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,One=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cne=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,l3="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ane=new RegExp(`^${l3}$`);function c3(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ine(e){return new RegExp(`^${c3(e)}$`)}function Nne(e){let t=`${l3}T${c3(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function kne(e,t){return!!((t==="v4"||!t)&&Ene.test(e)||(t==="v6"||!t)&&xne.test(e))}function Mne(e,t){if(!_ne.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function Pne(e,t){return!!((t==="v4"||!t)&&Rne.test(e)||(t==="v6"||!t)&&Tne.test(e))}class Ms extends xt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Fe.string){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Fe.string,received:i.parsedType}),tt}const r=new ro;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const l=t.data.length>i.value,u=t.data.length<i.value;(l||u)&&(a=this._getOrReturnCtx(t,a),l?De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")wne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"email",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")V0||(V0=new RegExp(Sne,"u")),V0.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"emoji",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")vne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"uuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")yne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"nanoid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")pne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")mne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid2",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")gne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ulid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),De(a,{validation:"url",code:Ne.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"regex",code:Ne.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Nne(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Ane.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Ine(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?bne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"duration",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?kne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ip",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Mne(t.data,i.alg)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"jwt",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Pne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cidr",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?One.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Cne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64url",code:Ne.invalid_string,message:i.message}),r.dirty()):Nt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:Ne.invalid_string,...Ge.errToObj(r)})}_addCheck(t){return new Ms({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ge.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ge.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ge.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ge.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ge.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ge.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ge.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ge.errToObj(n)})}nonempty(t){return this.min(1,Ge.errToObj(t))}trim(){return new Ms({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ms({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ms({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ms.create=e=>new Ms({checks:[],typeName:nt.ZodString,coerce:e?.coerce??!1,...mt(e)});function Dne(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(e.toFixed(a).replace(".","")),l=Number.parseInt(t.toFixed(a).replace(".",""));return i%l/10**a}class ud extends xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Fe.number){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Fe.number,received:i.parsedType}),tt}let r;const a=new ro;for(const i of this._def.checks)i.kind==="int"?Nt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?Dne(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_finite,message:i.message}),a.dirty()):Nt.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new ud({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new ud({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Nt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}ud.create=e=>new ud({checks:[],typeName:nt.ZodNumber,coerce:e?.coerce||!1,...mt(e)});class dd extends xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Fe.bigint)return this._getInvalidInput(t);let r;const a=new ro;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Nt.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Fe.bigint,received:n.parsedType}),tt}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new dd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new dd({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}dd.create=e=>new dd({checks:[],typeName:nt.ZodBigInt,coerce:e?.coerce??!1,...mt(e)});class rb extends xt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Fe.boolean){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.boolean,received:r.parsedType}),tt}return Oo(t.data)}}rb.create=e=>new rb({typeName:nt.ZodBoolean,coerce:e?.coerce||!1,...mt(e)});class vm extends xt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Fe.date){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Fe.date,received:i.parsedType}),tt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_date}),tt}const r=new ro;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Nt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new vm({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ge.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ge.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}vm.create=e=>new vm({checks:[],coerce:e?.coerce||!1,typeName:nt.ZodDate,...mt(e)});class RC extends xt{_parse(t){if(this._getType(t)!==Fe.symbol){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.symbol,received:r.parsedType}),tt}return Oo(t.data)}}RC.create=e=>new RC({typeName:nt.ZodSymbol,...mt(e)});class xC extends xt{_parse(t){if(this._getType(t)!==Fe.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.undefined,received:r.parsedType}),tt}return Oo(t.data)}}xC.create=e=>new xC({typeName:nt.ZodUndefined,...mt(e)});class TC extends xt{_parse(t){if(this._getType(t)!==Fe.null){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.null,received:r.parsedType}),tt}return Oo(t.data)}}TC.create=e=>new TC({typeName:nt.ZodNull,...mt(e)});class OC extends xt{constructor(){super(...arguments),this._any=!0}_parse(t){return Oo(t.data)}}OC.create=e=>new OC({typeName:nt.ZodAny,...mt(e)});class CC extends xt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Oo(t.data)}}CC.create=e=>new CC({typeName:nt.ZodUnknown,...mt(e)});class Hs extends xt{_parse(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Fe.never,received:n.parsedType}),tt}}Hs.create=e=>new Hs({typeName:nt.ZodNever,...mt(e)});class AC extends xt{_parse(t){if(this._getType(t)!==Fe.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.void,received:r.parsedType}),tt}return Oo(t.data)}}AC.create=e=>new AC({typeName:nt.ZodVoid,...mt(e)});class ia extends xt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Fe.array)return De(n,{code:Ne.invalid_type,expected:Fe.array,received:n.parsedType}),tt;if(a.exactLength!==null){const l=n.data.length>a.exactLength.value,u=n.data.length<a.exactLength.value;(l||u)&&(De(n,{code:l?Ne.too_big:Ne.too_small,minimum:u?a.exactLength.value:void 0,maximum:l?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(De(n,{code:Ne.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(De(n,{code:Ne.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>a.type._parseAsync(new qs(n,l,n.path,u)))).then(l=>ro.mergeArray(r,l));const i=[...n.data].map((l,u)=>a.type._parseSync(new qs(n,l,n.path,u)));return ro.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new ia({...this._def,minLength:{value:t,message:Ge.toString(n)}})}max(t,n){return new ia({...this._def,maxLength:{value:t,message:Ge.toString(n)}})}length(t,n){return new ia({...this._def,exactLength:{value:t,message:Ge.toString(n)}})}nonempty(t){return this.min(1,t)}}ia.create=(e,t)=>new ia({type:e,minLength:null,maxLength:null,exactLength:null,typeName:nt.ZodArray,...mt(t)});function ql(e){if(e instanceof Mn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Us.create(ql(r))}return new Mn({...e._def,shape:()=>t})}else return e instanceof ia?new ia({...e._def,type:ql(e.element)}):e instanceof Us?Us.create(ql(e.unwrap())):e instanceof hc?hc.create(ql(e.unwrap())):e instanceof ji?ji.create(e.items.map(t=>ql(t))):e}class Mn extends xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Nt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Fe.object){const f=this._getOrReturnCtx(t);return De(f,{code:Ne.invalid_type,expected:Fe.object,received:f.parsedType}),tt}const{status:r,ctx:a}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof Hs&&this._def.unknownKeys==="strip"))for(const f in a.data)l.includes(f)||u.push(f);const d=[];for(const f of l){const m=i[f],p=a.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new qs(a,p,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof Hs){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)d.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(f==="strict")u.length>0&&(De(a,{code:Ne.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const p=a.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new qs(a,p,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of d){const p=await m.key,g=await m.value;f.push({key:p,value:g,alwaysSet:m.alwaysSet})}return f}).then(f=>ro.mergeObjectSync(r,f)):ro.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return Ge.errToObj,new Mn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const a=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Ge.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Mn({...this._def,unknownKeys:"strip"})}passthrough(){return new Mn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Mn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Mn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:nt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Mn({...this._def,catchall:t})}pick(t){const n={};for(const r of Nt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Mn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Nt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Mn({...this._def,shape:()=>n})}deepPartial(){return ql(this)}partial(t){const n={};for(const r of Nt.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new Mn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Nt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Us;)i=i._def.innerType;n[r]=i}return new Mn({...this._def,shape:()=>n})}keyof(){return u3(Nt.objectKeys(this.shape))}}Mn.create=(e,t)=>new Mn({shape:()=>e,unknownKeys:"strip",catchall:Hs.create(),typeName:nt.ZodObject,...mt(t)});Mn.strictCreate=(e,t)=>new Mn({shape:()=>e,unknownKeys:"strict",catchall:Hs.create(),typeName:nt.ZodObject,...mt(t)});Mn.lazycreate=(e,t)=>new Mn({shape:e,unknownKeys:"strip",catchall:Hs.create(),typeName:nt.ZodObject,...mt(t)});class ym extends xt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const l=i.map(u=>new qa(u.ctx.common.issues));return De(n,{code:Ne.invalid_union,unionErrors:l}),tt}if(n.common.async)return Promise.all(r.map(async i=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(a);{let i;const l=[];for(const d of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=d._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=l.map(d=>new qa(d));return De(n,{code:Ne.invalid_union,unionErrors:u}),tt}}get options(){return this._def.options}}ym.create=(e,t)=>new ym({options:e,typeName:nt.ZodUnion,...mt(t)});function ob(e,t){const n=As(e),r=As(t);if(e===t)return{valid:!0,data:e};if(n===Fe.object&&r===Fe.object){const a=Nt.objectKeys(t),i=Nt.objectKeys(e).filter(u=>a.indexOf(u)!==-1),l={...e,...t};for(const u of i){const d=ob(e[u],t[u]);if(!d.valid)return{valid:!1};l[u]=d.data}return{valid:!0,data:l}}else if(n===Fe.array&&r===Fe.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const l=e[i],u=t[i],d=ob(l,u);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return n===Fe.date&&r===Fe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class _m extends xt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,l)=>{if(wC(i)||wC(l))return tt;const u=ob(i.value,l.value);return u.valid?((SC(i)||SC(l))&&n.dirty(),{status:n.value,value:u.data}):(De(r,{code:Ne.invalid_intersection_types}),tt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,l])=>a(i,l)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_m.create=(e,t,n)=>new _m({left:e,right:t,typeName:nt.ZodIntersection,...mt(n)});class ji extends xt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Fe.array)return De(r,{code:Ne.invalid_type,expected:Fe.array,received:r.parsedType}),tt;if(r.data.length<this._def.items.length)return De(r,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tt;!this._def.rest&&r.data.length>this._def.items.length&&(De(r,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((l,u)=>{const d=this._def.items[u]||this._def.rest;return d?d._parse(new qs(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(i).then(l=>ro.mergeArray(n,l)):ro.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new ji({...this._def,rest:t})}}ji.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ji({items:e,typeName:nt.ZodTuple,rest:null,...mt(t)})};class IC extends xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Fe.map)return De(r,{code:Ne.invalid_type,expected:Fe.map,received:r.parsedType}),tt;const a=this._def.keyType,i=this._def.valueType,l=[...r.data.entries()].map(([u,d],f)=>({key:a._parse(new qs(r,u,r.path,[f,"key"])),value:i._parse(new qs(r,d,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const d of l){const f=await d.key,m=await d.value;if(f.status==="aborted"||m.status==="aborted")return tt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const d of l){const f=d.key,m=d.value;if(f.status==="aborted"||m.status==="aborted")return tt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}IC.create=(e,t,n)=>new IC({valueType:t,keyType:e,typeName:nt.ZodMap,...mt(n)});class fd extends xt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Fe.set)return De(r,{code:Ne.invalid_type,expected:Fe.set,received:r.parsedType}),tt;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(De(r,{code:Ne.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(De(r,{code:Ne.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function l(d){const f=new Set;for(const m of d){if(m.status==="aborted")return tt;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((d,f)=>i._parse(new qs(r,d,r.path,f)));return r.common.async?Promise.all(u).then(d=>l(d)):l(u)}min(t,n){return new fd({...this._def,minSize:{value:t,message:Ge.toString(n)}})}max(t,n){return new fd({...this._def,maxSize:{value:t,message:Ge.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}fd.create=(e,t)=>new fd({valueType:e,minSize:null,maxSize:null,typeName:nt.ZodSet,...mt(t)});class NC extends xt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}NC.create=(e,t)=>new NC({getter:e,typeName:nt.ZodLazy,...mt(t)});class kC extends xt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return De(n,{received:n.data,code:Ne.invalid_literal,expected:this._def.value}),tt}return{status:"valid",value:t.data}}get value(){return this._def.value}}kC.create=(e,t)=>new kC({value:e,typeName:nt.ZodLiteral,...mt(t)});function u3(e,t){return new dc({values:e,typeName:nt.ZodEnum,...mt(t)})}class dc extends xt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{expected:Nt.joinValues(r),received:n.parsedType,code:Ne.invalid_type}),tt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{received:n.data,code:Ne.invalid_enum_value,options:r}),tt}return Oo(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return dc.create(t,{...this._def,...n})}exclude(t,n=this._def){return dc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}dc.create=u3;class MC extends xt{_parse(t){const n=Nt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Fe.string&&r.parsedType!==Fe.number){const a=Nt.objectValues(n);return De(r,{expected:Nt.joinValues(a),received:r.parsedType,code:Ne.invalid_type}),tt}if(this._cache||(this._cache=new Set(Nt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=Nt.objectValues(n);return De(r,{received:r.data,code:Ne.invalid_enum_value,options:a}),tt}return Oo(t.data)}get enum(){return this._def.values}}MC.create=(e,t)=>new MC({values:e,typeName:nt.ZodNativeEnum,...mt(t)});class bm extends xt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Fe.promise&&n.common.async===!1)return De(n,{code:Ne.invalid_type,expected:Fe.promise,received:n.parsedType}),tt;const r=n.parsedType===Fe.promise?n.data:Promise.resolve(n.data);return Oo(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}bm.create=(e,t)=>new bm({type:e,typeName:nt.ZodPromise,...mt(t)});class fc extends xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===nt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:l=>{De(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const l=a.transform(r.data,i);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return tt;const d=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return d.status==="aborted"?tt:d.status==="dirty"||n.value==="dirty"?Du(d.value):d});{if(n.value==="aborted")return tt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?tt:u.status==="dirty"||n.value==="dirty"?Du(u.value):u}}if(a.type==="refinement"){const l=u=>{const d=a.refinement(u,i);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?tt:(u.status==="dirty"&&n.dirty(),l(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?tt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(a.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!uc(l))return tt;const u=a.transform(l.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>uc(l)?Promise.resolve(a.transform(l.value,i)).then(u=>({status:n.value,value:u})):tt);Nt.assertNever(a)}}fc.create=(e,t,n)=>new fc({schema:e,typeName:nt.ZodEffects,effect:t,...mt(n)});fc.createWithPreprocess=(e,t,n)=>new fc({schema:t,effect:{type:"preprocess",transform:e},typeName:nt.ZodEffects,...mt(n)});class Us extends xt{_parse(t){return this._getType(t)===Fe.undefined?Oo(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Us.create=(e,t)=>new Us({innerType:e,typeName:nt.ZodOptional,...mt(t)});class hc extends xt{_parse(t){return this._getType(t)===Fe.null?Oo(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}hc.create=(e,t)=>new hc({innerType:e,typeName:nt.ZodNullable,...mt(t)});class ab extends xt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Fe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ab.create=(e,t)=>new ab({innerType:e,typeName:nt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...mt(t)});class sb extends xt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return gm(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new qa(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new qa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}sb.create=(e,t)=>new sb({innerType:e,typeName:nt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...mt(t)});class PC extends xt{_parse(t){if(this._getType(t)!==Fe.nan){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.nan,received:r.parsedType}),tt}return{status:"valid",value:t.data}}}PC.create=e=>new PC({typeName:nt.ZodNaN,...mt(e)});class Lne extends xt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class K1 extends xt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?tt:i.status==="dirty"?(n.dirty(),Du(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?tt:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new K1({in:t,out:n,typeName:nt.ZodPipeline})}}class ib extends xt{_parse(t){const n=this._def.innerType._parse(t),r=a=>(uc(a)&&(a.value=Object.freeze(a.value)),a);return gm(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}ib.create=(e,t)=>new ib({innerType:e,typeName:nt.ZodReadonly,...mt(t)});var nt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(nt||(nt={}));const jne=Ms.create,$ne=rb.create;Hs.create;ia.create;const Une=Mn.create;ym.create;_m.create;ji.create;const zne=dc.create;bm.create;Us.create;hc.create;const Fne=Une({path:jne().optional().default(""),flat:$ne().optional().default(!1),view:zne(["table","grid"]).optional().default("grid")}),Vne=une(e=>{const{createRoute:t,lazyRouteComponent:n}=e.routing;return[t({getParentRoute:()=>e.parentRoute,path:"/",component:n(()=>mn(()=>import("./file-browser-BDyBPrc6.js").then(a=>a.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),validateSearch:Fne})]}),Bne=A.lazy(()=>mn(()=>import("./plugin-header-CvDO4WmD.js"),__vite__mapDeps([15,5,16]))),qne=A.lazy(()=>mn(()=>import("./plugin-empty-state-CIiB0IAw.js"),[])),Hne={id:"object-storage",description:"Browse and manage files in S3-compatible object storage",binding:cne,renderHeader:e=>x.jsx(Bne,{...e}),renderEmptyState:()=>x.jsx(qne,{}),setup:e=>{const{registerRootSidebarItem:t,registerPluginRoutes:n}=e;t({icon:x.jsx(i3,{size:20}),label:"Files"});const r=Vne.createRoutes(e);n(r)}},Gne=[Hne],Dd=H6({component:()=>x.jsxs(GW,{children:[x.jsx(A.Suspense,{fallback:x.jsx(vM,{}),children:x.jsx(gA,{})}),x.jsx(ZW,{})]})}),Zne=Sn({getParentRoute:()=>Dd,path:"/login",component:Ln(()=>mn(()=>import("./login-DtC787Hg.js"),__vite__mapDeps([17,14,3,18]))),validateSearch:Za(()=>pe({next:L().optional(),client_id:L().optional(),redirect_uri:L().optional(),response_type:L().optional(),state:L().optional(),scope:L().optional(),code_challenge:L().optional(),code_challenge_method:L().optional()}))}),Kne=Sn({getParentRoute:()=>Dd,path:"/auth/$pathname",component:Ln(()=>mn(()=>import("./auth-catchall-Bu_AmzqF.js"),[]))}),Rr=Sn({getParentRoute:()=>Dd,id:"shell",component:Ln(()=>mn(()=>import("./shell-layout-DJjajsTY.js"),__vite__mapDeps([19,20,3,21,22,5,23,24,25,26,27,28,29,30,18,31,32,33,34,14,35,36,6,37,38,39,40,7,41,42,43,44,45,46,16,47,48,49,50,51,9,52,53,54,55,56,57,58,59,60,61,62,63,64,65,12,66,67])))}),Yne=Sn({getParentRoute:()=>Rr,path:"/",component:Ln(()=>mn(()=>import("./home-CpIhQ8D8.js"),__vite__mapDeps([68,69,3,54,6,5,67,35,24,18,52,45,53,44,14])))}),Wne=Sn({getParentRoute:()=>Rr,path:"/$org",component:Ln(()=>mn(()=>import("./page-DcQoSvJk.js"),__vite__mapDeps([70,29,30,3,18,21,28,5,31,32,33,34,14,35,36,6,20,26,37,38,39,40,7,41,42,43,44,45,46,16,25,47,48,49,50,60,61,62,63,64,65,12,71,72,67,73,74,75])))}),Qne=Sn({getParentRoute:()=>Rr,path:"/$org/members",component:Ln(()=>mn(()=>import("./members-C4HTAJHG.js"),__vite__mapDeps([76,77,78,3,55,7,37,5,10,28,71,79,80,11,35,18,81,82,30,4,83,48,32,33,34,14,84,63,40,54,22,45,57,26,85,86,67,12,58,20,53,46,16,38,69,87,88,24])))}),Xne=Sn({getParentRoute:()=>Rr,path:"/$org/mcps",component:Ln(()=>mn(()=>import("./connections-B3RW87mz.js"),__vite__mapDeps([89,77,78,3,55,7,37,5,10,28,71,79,80,11,35,18,81,90,69,30,20,48,32,33,34,14,49,50,91,27,45,22,57,26,53,87,92,42,12,46,16,38,64,73,40,93,67]))),validateSearch:Za(()=>pe({action:sn(["create"]).optional()}))}),Jne=Sn({getParentRoute:()=>Rr,path:"/$org/settings",component:Ln(()=>mn(()=>import("./settings-BfbdOKrl.js"),__vite__mapDeps([94,77,78,3,55,7,37,5,10,28,71,79,33,53,18,14,13,26])))}),ere=Sn({getParentRoute:()=>Rr,path:"/$org/settings/plugins",component:Ln(()=>mn(()=>import("./plugins-CyUBsABC.js"),__vite__mapDeps([95,77,78,3,55,7,37,5,10,28,71,79,51,14,32,33,58,83])))}),tre=Sn({getParentRoute:()=>Rr,path:"/$org/monitoring",component:Ln(()=>mn(()=>import("./monitoring-BGY0w02b.js"),__vite__mapDeps([96,32,77,78,3,55,7,37,5,10,28,71,79,80,11,35,18,30,20,22,16,33,21,41,8,97,88,98,43,44,99,74,48,34,14,31,84,59,67,12,4,46,65,2,38,100,73,40]))),validateSearch:Za(()=>pe({tab:sn(["logs","analytics"]).default("logs"),from:L().default("now-24h"),to:L().default("now"),connectionId:Oe(L()).optional().default([]),gatewayId:Oe(L()).optional().default([]),tool:L().default(""),status:sn(["all","success","errors"]).default("all"),search:L().default(""),page:Ze().optional(),streaming:ut().default(!0),propertyFilters:L().default("")}))}),d3=Sn({getParentRoute:()=>Rr,path:"/$org/store",component:Ln(()=>mn(()=>import("./page-DxMYdFSw.js"),__vite__mapDeps([101,63,77,78,3,55,7,37,5,10,28,71,97,23,11,35,48,32,33,34,14,1,2,92,102,80,18,103,86,67,42,69,30,104,21,16,24,46,49,50,39,40])))}),nre=Sn({getParentRoute:()=>d3,path:"/$appName",component:Ln(()=>mn(()=>import("./mcp-server-detail-rW4PqaOO.js"),__vite__mapDeps([105,6,11,3,83,30,106,107,104,92,64,16,67,55,7,56,108,40,25,78,37,5,10,28,71,80,35,18,81,69,109,110,100,22,103,86,42,48,32,33,34,14,49,50,73,111,39,102,112]))),validateSearch:Za(()=>pe({registryId:L().optional(),serverName:L().optional(),itemId:L().optional()}))}),rre=Sn({getParentRoute:()=>Rr,path:"/$org/mcps/$connectionId",component:Ln(()=>mn(()=>import("./connection-detail-BsC5t8hY.js"),__vite__mapDeps([113,30,3,20,48,32,33,34,14,49,50,114,115,93,18,67,12,73,40,116,28,51,25,88,11,109,83,22,53,46,5,16,106,107,104,92,64,42,31,7,117,99,29,21,35,36,6,26,37,38,39,41,43,44,45,47,118,100,119,78,55,10,71,80,69,87,62,91,27,81,120,23,54,108,110]))),validateSearch:Za(()=>pe({tab:L().optional()}))}),ore=Sn({getParentRoute:()=>Rr,path:"/$org/mcps/$connectionId/$collectionName/$itemId",component:Ln(()=>mn(()=>import("./collection-detail-CIorpvYQ.js"),__vite__mapDeps([121,32,30,3,20,34,14,33,116,28,51,53,18,38,122,109,83,48,6,65,59,41,11,98,24,114,115,93,67,12,49,50,73,40,25,88,22,46,5,16,106,107,104,92,64,42,31,7,117,99,29,21,35,36,26,37,39,43,44,45,47,111,120,66,71,72,57,85,55]))),validateSearch:Za(()=>pe({replayId:L().optional()}))}),are=Sn({getParentRoute:()=>Rr,path:"/$org/gateways",component:Ln(()=>mn(()=>import("./gateways-ckyn_Uas.js"),__vite__mapDeps([123,77,78,3,55,7,37,5,10,28,71,79,80,11,35,18,81,90,69,30,20,31,32,33,34,14,91,27,36,45,22,87,12]))),validateSearch:Za(()=>pe({action:sn(["create"]).optional()}))}),sre=Sn({getParentRoute:()=>Rr,path:"/$org/gateways/$gatewayId",component:Ln(()=>mn(()=>import("./gateway-detail-CzuSbsFr.js"),__vite__mapDeps([124,30,3,20,4,5,83,48,32,33,34,14,80,11,35,18,67,26,116,28,51,82,31,118,117,61,39,40,102,22,57,53,100,46,16,58,38,59,41,122,112,109]))),validateSearch:Za(()=>pe({tab:L().optional()}))}),ire=Sn({getParentRoute:()=>Rr,path:"/$org/workflows",component:Ln(()=>mn(()=>import("./workflow-B8_jtBci.js"),__vite__mapDeps([125,63,119,64,32,78,3,55,7,37,5,10,28,71,80,11,35,18,69,30,41,87,62,91,27,12,81,120,23,54,40,116,51,14,33,48,34,107,45,67,109,83,77,49,50])))}),f3=Sn({getParentRoute:()=>Rr,path:"/$org/$pluginId",component:Ln(()=>mn(()=>import("./dynamic-plugin-layout-IH0Gl52A.js"),__vite__mapDeps([126,11,50,48,32,33,34,14,39,40])))}),lre=[],h3=[];Gne.forEach(e=>{const t={parentRoute:f3,routing:{createRoute:Sn,lazyRouteComponent:Ln},registerRootSidebarItem:n=>lre.push({pluginId:e.id,...n}),registerPluginRoutes:n=>{h3.push(...n)}};e.setup(t)});const cre=f3.addChildren(h3),ure=Sn({getParentRoute:()=>Dd,path:"/oauth/callback",component:Ln(()=>mn(()=>import("./oauth-callback-BSZdPTYI.js"),__vite__mapDeps([127,11,115])))}),dre=d3.addChildren([nre]),fre=Rr.addChildren([Yne,Wne,Qne,Xne,are,sre,tre,dre,Jne,ere,ire,rre,ore,cre]),hre=Dd.addChildren([fre,Zne,Kne,ure]),pre=eL({routeTree:hre}),mre=document.getElementById("root");LD.createRoot(mre).render(x.jsx(A.StrictMode,{children:x.jsx(rL,{router:pre})}));export{je as $,Lre as A,da as B,FB as C,Are as D,ua as E,wre as F,JY as G,ee as H,bte as I,tU as J,KC as K,Ere as L,Lt as M,Sre as N,zB as O,UB as P,YI as Q,jB as R,vM as S,VB as T,Za as U,md as V,Ze as W,ut as X,Ft as Y,Oe as Z,xre as _,xj as a,$B as a$,kt as a0,qI as a1,Rre as a2,sn as a3,Ha as a4,Om as a5,Gne as a6,w5 as a7,v5 as a8,gre as a9,zb as aA,cH as aB,uH as aC,MF as aD,NF as aE,js as aF,WN as aG,OF as aH,LF as aI,CJ as aJ,XM as aK,pt as aL,bee as aM,h$ as aN,_4 as aO,w4 as aP,FG as aQ,uk as aR,hZ as aS,mn as aT,xd as aU,yd as aV,MN as aW,Bb as aX,td as aY,RN as aZ,Fb as a_,AA as aa,dA as ab,Tm as ac,lb as ad,Gs as ae,Fa as af,Bn as ag,QN as ah,zi as ai,dn as aj,Ya as ak,it as al,Bo as am,_d as an,Ek as ao,SH as ap,wH as aq,vre as ar,Ur as as,gr as at,qG as au,hA as av,fk as aw,lH as ax,Vb as ay,wk as az,xm as b,hd as b0,or as b1,q0 as b2,jC as b3,e5 as b4,u5 as b5,h5 as b6,y5 as b7,p5 as b8,m5 as b9,kre as bA,Mre as bB,Pre as bC,Nre as bD,Vre as bE,ste as bF,dte as bG,Fre as bH,Oi as bI,i3 as bJ,Bre as bK,Vne as bL,ix as bM,_re as bN,yre as bO,Zu as bP,o5 as bQ,UC as bR,Lr as ba,b5 as bb,lx as bc,_5 as bd,g5 as be,zF as bf,$F as bg,UF as bh,cN as bi,QG as bj,XG as bk,WG as bl,Nte as bm,qte as bn,eo as bo,ar as bp,$I as bq,pr as br,Ore as bs,Cre as bt,Tre as bu,PG as bv,DG as bw,LG as bx,jG as by,$G as bz,pc as c,Yl as d,ht as e,mc as f,Ire as g,lV as h,yN as i,x as j,Er as k,DY as l,qo as m,Dre as n,jre as o,lre as p,$re as q,A as r,Ure as s,hT as t,bre as u,ZC as v,gA as w,l5 as x,pe as y,L as z};
174
+ `&&r++}}return[t,n]}class hC extends Event{constructor(t,n){var r,a;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(a=n?.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(pC(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(pC(this),n)}}function Pee(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function L_(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(L_).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${L_(e.cause)}`:e.message:`${e}`}function pC(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var e3=e=>{throw TypeError(e)},q1=(e,t,n)=>t.has(e)||e3("Cannot "+n),yt=(e,t,n)=>(q1(e,t,"read from private field"),n?n.call(e):t.get(e)),zn=(e,t,n)=>t.has(e)?e3("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),on=(e,t,n,r)=>(q1(e,t,"write to private field"),t.set(e,n),n),Ua=(e,t,n)=>(q1(e,t,"access private method"),n),$r,Ei,Fl,Sp,cm,Hu,Kl,Gu,Ns,Vl,tc,Bl,Mu,Lo,j_,$_,U_,mC,z_,F_,Pu,V_,B_;class Ep extends EventTarget{constructor(t,n){var r,a;super(),zn(this,Lo),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,zn(this,$r),zn(this,Ei),zn(this,Fl),zn(this,Sp),zn(this,cm),zn(this,Hu),zn(this,Kl),zn(this,Gu,null),zn(this,Ns),zn(this,Vl),zn(this,tc,null),zn(this,Bl,null),zn(this,Mu,null),zn(this,$_,async i=>{var l;yt(this,Vl).reset();const{body:u,redirected:d,status:f,headers:m}=i;if(f===204){Ua(this,Lo,Pu).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(d?on(this,Fl,new URL(i.url)):on(this,Fl,void 0),f!==200){Ua(this,Lo,Pu).call(this,`Non-200 status code (${f})`,f);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){Ua(this,Lo,Pu).call(this,'Invalid content type, expected "text/event-stream"',f);return}if(yt(this,$r)===this.CLOSED)return;on(this,$r,this.OPEN);const p=new Event("open");if((l=yt(this,Mu))==null||l.call(this,p),this.dispatchEvent(p),typeof u!="object"||!u||!("getReader"in u)){Ua(this,Lo,Pu).call(this,"Invalid response body, expected a web ReadableStream",f),this.close();return}const g=new TextDecoder,y=u.getReader();let b=!0;do{const{done:S,value:w}=await y.read();w&&yt(this,Vl).feed(g.decode(w,{stream:!S})),S&&(b=!1,yt(this,Vl).reset(),Ua(this,Lo,V_).call(this))}while(b)}),zn(this,U_,i=>{on(this,Ns,void 0),!(i.name==="AbortError"||i.type==="aborted")&&Ua(this,Lo,V_).call(this,L_(i))}),zn(this,z_,i=>{typeof i.id=="string"&&on(this,Gu,i.id);const l=new MessageEvent(i.event||"message",{data:i.data,origin:yt(this,Fl)?yt(this,Fl).origin:yt(this,Ei).origin,lastEventId:i.id||""});yt(this,Bl)&&(!i.event||i.event==="message")&&yt(this,Bl).call(this,l),this.dispatchEvent(l)}),zn(this,F_,i=>{on(this,Hu,i)}),zn(this,B_,()=>{on(this,Kl,void 0),yt(this,$r)===this.CONNECTING&&Ua(this,Lo,j_).call(this)});try{if(t instanceof URL)on(this,Ei,t);else if(typeof t=="string")on(this,Ei,new URL(t,Dee()));else throw new Error("Invalid URL")}catch{throw Pee("An invalid or illegal string was specified")}on(this,Vl,JM({onEvent:yt(this,z_),onRetry:yt(this,F_)})),on(this,$r,this.CONNECTING),on(this,Hu,3e3),on(this,cm,(r=n?.fetch)!=null?r:globalThis.fetch),on(this,Sp,(a=n?.withCredentials)!=null?a:!1),Ua(this,Lo,j_).call(this)}get readyState(){return yt(this,$r)}get url(){return yt(this,Ei).href}get withCredentials(){return yt(this,Sp)}get onerror(){return yt(this,tc)}set onerror(t){on(this,tc,t)}get onmessage(){return yt(this,Bl)}set onmessage(t){on(this,Bl,t)}get onopen(){return yt(this,Mu)}set onopen(t){on(this,Mu,t)}addEventListener(t,n,r){const a=n;super.addEventListener(t,a,r)}removeEventListener(t,n,r){const a=n;super.removeEventListener(t,a,r)}close(){yt(this,Kl)&&clearTimeout(yt(this,Kl)),yt(this,$r)!==this.CLOSED&&(yt(this,Ns)&&yt(this,Ns).abort(),on(this,$r,this.CLOSED),on(this,Ns,void 0))}}$r=new WeakMap,Ei=new WeakMap,Fl=new WeakMap,Sp=new WeakMap,cm=new WeakMap,Hu=new WeakMap,Kl=new WeakMap,Gu=new WeakMap,Ns=new WeakMap,Vl=new WeakMap,tc=new WeakMap,Bl=new WeakMap,Mu=new WeakMap,Lo=new WeakSet,j_=function(){on(this,$r,this.CONNECTING),on(this,Ns,new AbortController),yt(this,cm)(yt(this,Ei),Ua(this,Lo,mC).call(this)).then(yt(this,$_)).catch(yt(this,U_))},$_=new WeakMap,U_=new WeakMap,mC=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...yt(this,Gu)?{"Last-Event-ID":yt(this,Gu)}:void 0},cache:"no-store",signal:(e=yt(this,Ns))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},z_=new WeakMap,F_=new WeakMap,Pu=function(e,t){var n;yt(this,$r)!==this.CLOSED&&on(this,$r,this.CLOSED);const r=new hC("error",{code:t,message:e});(n=yt(this,tc))==null||n.call(this,r),this.dispatchEvent(r)},V_=function(e,t){var n;if(yt(this,$r)===this.CLOSED)return;on(this,$r,this.CONNECTING);const r=new hC("error",{code:t,message:e});(n=yt(this,tc))==null||n.call(this,r),this.dispatchEvent(r),on(this,Kl,setTimeout(yt(this,B_),yt(this,Hu)))},B_=new WeakMap,Ep.CONNECTING=0,Ep.OPEN=1,Ep.CLOSED=2;function Dee(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}function um(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function t3(e=fetch,t){return t?async(n,r)=>{const a={...t,...r,headers:r?.headers?{...um(t.headers),...um(r.headers)}:t.headers};return e(n,a)}:e}let H1;H1=globalThis.crypto;async function Lee(e){return(await H1).getRandomValues(new Uint8Array(e))}async function jee(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%t.length;let r="";for(;r.length<e;){const a=await Lee(e-r.length);for(const i of a)i<n&&(r+=t[i%t.length])}return r}async function $ee(e){return await jee(e)}async function Uee(e){const t=await(await H1).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function zee(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await $ee(e),n=await Uee(t);return{code_verifier:t,code_challenge:n}}const rr=dU().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:tz.custom,message:"URL must be parseable",fatal:!0}),p$}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Fee=ar({resource:L().url(),authorization_servers:Oe(rr).optional(),jwks_uri:L().url().optional(),scopes_supported:Oe(L()).optional(),bearer_methods_supported:Oe(L()).optional(),resource_signing_alg_values_supported:Oe(L()).optional(),resource_name:L().optional(),resource_documentation:L().optional(),resource_policy_uri:L().url().optional(),resource_tos_uri:L().url().optional(),tls_client_certificate_bound_access_tokens:ut().optional(),authorization_details_types_supported:Oe(L()).optional(),dpop_signing_alg_values_supported:Oe(L()).optional(),dpop_bound_access_tokens_required:ut().optional()}),n3=ar({issuer:L(),authorization_endpoint:rr,token_endpoint:rr,registration_endpoint:rr.optional(),scopes_supported:Oe(L()).optional(),response_types_supported:Oe(L()),response_modes_supported:Oe(L()).optional(),grant_types_supported:Oe(L()).optional(),token_endpoint_auth_methods_supported:Oe(L()).optional(),token_endpoint_auth_signing_alg_values_supported:Oe(L()).optional(),service_documentation:rr.optional(),revocation_endpoint:rr.optional(),revocation_endpoint_auth_methods_supported:Oe(L()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Oe(L()).optional(),introspection_endpoint:L().optional(),introspection_endpoint_auth_methods_supported:Oe(L()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Oe(L()).optional(),code_challenge_methods_supported:Oe(L()).optional(),client_id_metadata_document_supported:ut().optional()}),Vee=ar({issuer:L(),authorization_endpoint:rr,token_endpoint:rr,userinfo_endpoint:rr.optional(),jwks_uri:rr,registration_endpoint:rr.optional(),scopes_supported:Oe(L()).optional(),response_types_supported:Oe(L()),response_modes_supported:Oe(L()).optional(),grant_types_supported:Oe(L()).optional(),acr_values_supported:Oe(L()).optional(),subject_types_supported:Oe(L()),id_token_signing_alg_values_supported:Oe(L()),id_token_encryption_alg_values_supported:Oe(L()).optional(),id_token_encryption_enc_values_supported:Oe(L()).optional(),userinfo_signing_alg_values_supported:Oe(L()).optional(),userinfo_encryption_alg_values_supported:Oe(L()).optional(),userinfo_encryption_enc_values_supported:Oe(L()).optional(),request_object_signing_alg_values_supported:Oe(L()).optional(),request_object_encryption_alg_values_supported:Oe(L()).optional(),request_object_encryption_enc_values_supported:Oe(L()).optional(),token_endpoint_auth_methods_supported:Oe(L()).optional(),token_endpoint_auth_signing_alg_values_supported:Oe(L()).optional(),display_values_supported:Oe(L()).optional(),claim_types_supported:Oe(L()).optional(),claims_supported:Oe(L()).optional(),service_documentation:L().optional(),claims_locales_supported:Oe(L()).optional(),ui_locales_supported:Oe(L()).optional(),claims_parameter_supported:ut().optional(),request_parameter_supported:ut().optional(),request_uri_parameter_supported:ut().optional(),require_request_uri_registration:ut().optional(),op_policy_uri:rr.optional(),op_tos_uri:rr.optional(),client_id_metadata_document_supported:ut().optional()}),Bee=pe({...Vee.shape,...n3.pick({code_challenge_methods_supported:!0}).shape}),qee=pe({access_token:L(),id_token:L().optional(),token_type:L(),expires_in:WI().optional(),scope:L().optional(),refresh_token:L().optional()}).strip(),Hee=pe({error:L(),error_description:L().optional(),error_uri:L().optional()}),gC=rr.optional().or(je("").transform(()=>{})),Gee=pe({redirect_uris:Oe(rr),token_endpoint_auth_method:L().optional(),grant_types:Oe(L()).optional(),response_types:Oe(L()).optional(),client_name:L().optional(),client_uri:rr.optional(),logo_uri:gC,scope:L().optional(),contacts:Oe(L()).optional(),tos_uri:gC,policy_uri:L().optional(),jwks_uri:rr.optional(),jwks:eo().optional(),software_id:L().optional(),software_version:L().optional(),software_statement:L().optional()}).strip(),Zee=pe({client_id:L(),client_secret:L().optional(),client_id_issued_at:Ze().optional(),client_secret_expires_at:Ze().optional()}).strip(),Kee=Gee.merge(Zee);pe({error:L(),error_description:L().optional()}).strip();pe({token:L(),token_type_hint:L().optional()}).strip();function Yee(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function Wee({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class Yn extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class q_ extends Yn{}q_.errorCode="invalid_request";class dm extends Yn{}dm.errorCode="invalid_client";class fm extends Yn{}fm.errorCode="invalid_grant";class hm extends Yn{}hm.errorCode="unauthorized_client";class H_ extends Yn{}H_.errorCode="unsupported_grant_type";class G_ extends Yn{}G_.errorCode="invalid_scope";class Z_ extends Yn{}Z_.errorCode="access_denied";class cc extends Yn{}cc.errorCode="server_error";class K_ extends Yn{}K_.errorCode="temporarily_unavailable";class Y_ extends Yn{}Y_.errorCode="unsupported_response_type";class W_ extends Yn{}W_.errorCode="unsupported_token_type";class Q_ extends Yn{}Q_.errorCode="invalid_token";class X_ extends Yn{}X_.errorCode="method_not_allowed";class J_ extends Yn{}J_.errorCode="too_many_requests";class pm extends Yn{}pm.errorCode="invalid_client_metadata";class eb extends Yn{}eb.errorCode="insufficient_scope";class tb extends Yn{}tb.errorCode="invalid_target";const Qee={[q_.errorCode]:q_,[dm.errorCode]:dm,[fm.errorCode]:fm,[hm.errorCode]:hm,[H_.errorCode]:H_,[G_.errorCode]:G_,[Z_.errorCode]:Z_,[cc.errorCode]:cc,[K_.errorCode]:K_,[Y_.errorCode]:Y_,[W_.errorCode]:W_,[Q_.errorCode]:Q_,[X_.errorCode]:X_,[J_.errorCode]:J_,[pm.errorCode]:pm,[eb.errorCode]:eb,[tb.errorCode]:tb};class $o extends Error{constructor(t){super(t??"Unauthorized")}}function Xee(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const $0="code",U0="S256";function Jee(e,t){const n=e.client_secret!==void 0;return t.length===0?n?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Xee(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function ete(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":tte(a,i,n);return;case"client_secret_post":nte(a,i,r);return;case"none":rte(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function tte(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function nte(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function rte(e,t){t.set("client_id",e)}async function r3(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=Hee.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:l}=r,u=Qee[a]||cc;return new u(i||"",l)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new cc(a)}}async function Oi(e,t){try{return await z0(e,t)}catch(n){if(n instanceof dm||n instanceof hm)return await e.invalidateCredentials?.("all"),await z0(e,t);if(n instanceof fm)return await e.invalidateCredentials?.("tokens"),await z0(e,t);throw n}}async function z0(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){let l,u;try{l=await ste(t,{resourceMetadataUrl:a},i),l.authorization_servers&&l.authorization_servers.length>0&&(u=l.authorization_servers[0])}catch{}u||(u=new URL("/",t));const d=await ate(t,e,l),f=await dte(u,{fetchFn:i});let m=await Promise.resolve(e.clientInformation());if(!m){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const w=f?.client_id_metadata_document_supported===!0,R=e.clientMetadataUrl;if(R&&!ote(R))throw new pm(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${R}`);if(w&&R)m={client_id:R},await e.saveClientInformation?.(m);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const T=await mte(u,{metadata:f,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(T),m=T}}const p=!e.redirectUrl;if(n!==void 0||p){const w=await pte(e,u,{metadata:f,resource:d,authorizationCode:n,fetchFn:i});return await e.saveTokens(w),"AUTHORIZED"}const g=await e.tokens();if(g?.refresh_token)try{const w=await hte(u,{metadata:f,clientInformation:m,refreshToken:g.refresh_token,resource:d,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(w),"AUTHORIZED"}catch(w){if(!(!(w instanceof Yn)||w instanceof cc))throw w}const y=e.state?await e.state():void 0,{authorizationUrl:b,codeVerifier:S}=await fte(u,{metadata:f,clientInformation:m,state:y,redirectUrl:e.redirectUrl,scope:r||l?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:d});return await e.saveCodeVerifier(S),await e.redirectToAuthorization(b),"REDIRECT"}function ote(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function ate(e,t,n){const r=Yee(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!Wee({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function mm(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=F0(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const l=F0(e,"scope")||void 0,u=F0(e,"error")||void 0;return{resourceMetadataUrl:i,scope:l,error:u}}function F0(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function ste(e,t,n=fetch){const r=await cte(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Fee.parse(await r.json())}async function G1(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?G1(e,void 0,n):void 0;throw r}}function ite(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function vC(e,t,n=fetch){return await G1(e,{"MCP-Protocol-Version":t},n)}function lte(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function cte(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??Wm;let l;if(r?.metadataUrl)l=new URL(r.metadataUrl);else{const d=ite(t,a.pathname);l=new URL(d,r?.metadataServerUrl??a),l.search=a.search}let u=await vC(l,i,n);if(!r?.metadataUrl&&lte(u,a.pathname)){const d=new URL(`/.well-known/${t}`,a);u=await vC(d,i,n)}return u}function ute(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function dte(e,{fetchFn:t=fetch,protocolVersion:n=Wm}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=ute(e);for(const{url:i,type:l}of a){const u=await G1(i,r,t);if(u){if(!u.ok){if(await u.body?.cancel(),u.status>=400&&u.status<500)continue;throw new Error(`HTTP ${u.status} trying to load ${l==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return l==="oauth"?n3.parse(await u.json()):Bee.parse(await u.json())}}}async function fte(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:l}){let u;if(t){if(u=new URL(t.authorization_endpoint),!t.response_types_supported.includes($0))throw new Error(`Incompatible auth server: does not support response type ${$0}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(U0))throw new Error(`Incompatible auth server: does not support code challenge method ${U0}`)}else u=new URL("/authorize",e);const d=await zee(),f=d.code_verifier,m=d.code_challenge;return u.searchParams.set("response_type",$0),u.searchParams.set("client_id",n.client_id),u.searchParams.set("code_challenge",m),u.searchParams.set("code_challenge_method",U0),u.searchParams.set("redirect_uri",String(r)),i&&u.searchParams.set("state",i),a&&u.searchParams.set("scope",a),a?.includes("offline_access")&&u.searchParams.append("prompt","consent"),l&&u.searchParams.set("resource",l.href),{authorizationUrl:u,codeVerifier:f}}function o3(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function Z1(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:l}){const u=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),d=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(d,n,u,t);else if(r){const m=t?.token_endpoint_auth_methods_supported??[],p=Jee(r,m);ete(p,r,d,n)}const f=await(l??fetch)(u,{method:"POST",headers:d,body:n});if(!f.ok)throw await r3(f);return qee.parse(await f.json())}async function Fre(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:l,addClientAuthentication:u,fetchFn:d}){const f=o3(r,a,i);return Z1(e,{metadata:t,tokenRequestParams:f,clientInformation:n,addClientAuthentication:u,resource:l,fetchFn:d})}async function hte(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:l}){const u=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),d=await Z1(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:l});return{refresh_token:r,...d}}async function pte(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const l=e.clientMetadata.scope;let u;if(e.prepareTokenRequest&&(u=await e.prepareTokenRequest(l)),!u){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const f=await e.codeVerifier();u=o3(a,f,e.redirectUrl)}const d=await e.clientInformation();return Z1(t,{metadata:n,tokenRequestParams:u,clientInformation:d??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function mte(e,{metadata:t,clientMetadata:n,fetchFn:r}){let a;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");a=new URL(t.registration_endpoint)}else a=new URL("/register",e);const i=await(r??fetch)(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw await r3(i);return Kee.parse(await i.json())}class gte extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class vte{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=t3(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new $o("No auth provider");let t;try{t=await Oi(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new $o;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=um(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new Ep(this._url.href,{...this._eventSourceInit,fetch:async(a,i)=>{const l=await this._commonHeaders();l.set("Accept","text/event-stream");const u=await t(a,{...i,headers:l});if(u.status===401&&u.headers.has("www-authenticate")){const{resourceMetadataUrl:d,scope:f}=mm(u);this._resourceMetadataUrl=d,this._scope=f}return u}}),this._abortController=new AbortController,this._eventSource.onerror=a=>{if(a.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const i=new gte(a.code,a.message,a);r(i),this.onerror?.(i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",a=>{const i=a;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(l){r(l),this.onerror?.(l),this.close();return}n()}),this._eventSource.onmessage=a=>{const i=a;let l;try{l=qu.parse(JSON.parse(i.data))}catch(u){this.onerror?.(u);return}this.onmessage?.(l)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new $o("No auth provider");if(await Oi(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._endpoint,r);if(!a.ok){const i=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){const{resourceMetadataUrl:l,scope:u}=mm(a);if(this._resourceMetadataUrl=l,this._scope=u,await Oi(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${a.status}): ${i}`)}await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const yte="mcp";class _te{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,yte),this._socket.onerror=r=>{const a="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(a),this.onerror?.(a)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let a;try{a=qu.parse(JSON.parse(r.data))}catch(i){this.onerror?.(i);return}this.onmessage?.(a)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class bte extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let a;super({start(i){a=JM({onEvent:l=>{i.enqueue(l)},onError(l){t==="terminate"?i.error(l):typeof t=="function"&&t(l)},onRetry:n,onComment:r})},transform(i){a.feed(i)}})}}const wte={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $l extends Error{constructor(t,n){super(`Streamable HTTP error: ${n}`),this.code=t}}class Ste{constructor(t,n){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=t3(n?.fetch,n?.requestInit),this._sessionId=n?.sessionId,this._reconnectionOptions=n?.reconnectionOptions??wte}async _authThenStart(){if(!this._authProvider)throw new $o("No auth provider");let t;try{t=await Oi(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new $o;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=um(this._requestInit?.headers);return new Headers({...t,...n})}async _startOrAuthSse(t){const{resumptionToken:n}=t;try{const r=await this._commonHeaders();r.set("Accept","text/event-stream"),n&&r.set("last-event-id",n);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:r,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new $l(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,t,!0)}catch(r){throw this.onerror?.(r),r}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const n=this._reconnectionOptions.initialReconnectionDelay,r=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(n*Math.pow(r,t),a)}_scheduleReconnection(t,n=0){const r=this._reconnectionOptions.maxRetries;if(n>=r){this.onerror?.(new Error(`Maximum reconnection attempts (${r}) exceeded.`));return}const a=this._getNextReconnectionDelay(n);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,n+1)})},a)}_handleSseStream(t,n,r){if(!t)return;const{onresumptiontoken:a,replayMessageId:i}=n;let l,u=!1,d=!1;(async()=>{try{const m=t.pipeThrough(new TextDecoderStream).pipeThrough(new bte({onRetry:y=>{this._serverRetryMs=y}})).getReader();for(;;){const{value:y,done:b}=await m.read();if(b)break;if(y.id&&(l=y.id,u=!0,a?.(y.id)),!!y.data&&(!y.event||y.event==="message"))try{const S=qu.parse(JSON.parse(y.data));ku(S)&&(d=!0,i!==void 0&&(S.id=i)),this.onmessage?.(S)}catch(S){this.onerror?.(S)}}(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(m){if(this.onerror?.(new Error(`SSE stream disconnected: ${m}`)),(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(y){this.onerror?.(new Error(`Failed to reconnect: ${y instanceof Error?y.message:String(y)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new $o("No auth provider");if(await Oi(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,n){try{const{resumptionToken:r,onresumptiontoken:a}=n||{};if(r){this._startOrAuthSse({resumptionToken:r,replayMessageId:D_(t)?t.id:void 0}).catch(g=>this.onerror?.(g));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const l={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},u=await(this._fetch??fetch)(this._url,l),d=u.headers.get("mcp-session-id");if(d&&(this._sessionId=d),!u.ok){const g=await u.text().catch(()=>null);if(u.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $l(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:y,scope:b}=mm(u);if(this._resourceMetadataUrl=y,this._scope=b,await Oi(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o;return this._hasCompletedAuthFlow=!0,this.send(t)}if(u.status===403&&this._authProvider){const{resourceMetadataUrl:y,scope:b,error:S}=mm(u);if(S==="insufficient_scope"){const w=u.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===w)throw new $l(403,"Server returned 403 after trying upscoping");if(b&&(this._scope=b),y&&(this._resourceMetadataUrl=y),this._lastUpscopingHeader=w??void 0,await Oi(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new $o;return this.send(t)}}throw new $l(u.status,`Error POSTing to endpoint: ${g}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,u.status===202){await u.body?.cancel(),YQ(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(g=>this.onerror?.(g));return}const m=(Array.isArray(t)?t:[t]).filter(g=>"method"in g&&"id"in g&&g.id!==void 0).length>0,p=u.headers.get("content-type");if(m)if(p?.includes("text/event-stream"))this._handleSseStream(u.body,{onresumptiontoken:a},!1);else if(p?.includes("application/json")){const g=await u.json(),y=Array.isArray(g)?g.map(b=>qu.parse(b)):[qu.parse(g)];for(const b of y)this.onmessage?.(b)}else throw await u.body?.cancel(),new $l(-1,`Unexpected content type: ${p}`);else await u.body?.cancel()}catch(r){throw this.onerror?.(r),r}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const t=await this._commonHeaders(),n={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},r=await(this._fetch??fetch)(this._url,n);if(await r.body?.cancel(),!r.ok&&r.status!==405)throw new $l(r.status,`Failed to terminate session: ${r.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,n){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:n?.onresumptiontoken})}}class Ete extends Ste{constructor(t,n){super(t,n)}send(t,n){const r=Rte(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function Rte(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class xte extends kee{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},z1,n)}}const Tte=async(e,t,n)=>{const r=Ote(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const a=new xte({name:e?.name??"MCP Client",version:"1.0.0"});return await a.connect(r),{client:a,callStreamableTool:(i,l)=>{if(e.connection.type!=="HTTP")throw new Error("HTTP connection required");const u=new Headers(n);u.has("Authorization")||u.set("Authorization",`Bearer ${e.connection.token}`);for(const[m,p]of Object.entries(e.connection.headers??{}))u.set(m,p);const d=new URL(e.connection.url),f=d.pathname.replace(/\/+$/,"")||"/";return d.pathname=`${f}/call-tool/${encodeURIComponent(i)}`,fetch(d.href,{method:"POST",redirect:"manual",body:JSON.stringify(l),headers:u})}}},Ote=(e,t,n)=>{if(e.type==="Websocket")return new _te(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const a={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const i={requestInit:{headers:a,signal:t}};return e.token&&(i.eventSourceInit={fetch:(l,u)=>fetch(l,{...u,headers:{...a,Accept:"text/event-stream"},signal:t})}),new vte(new URL(e.url),i)}return new Ete(new URL(e.url),{requestInit:{headers:a,signal:t,credentials:"include"}})},Cte=e=>{try{return JSON.parse(e)}catch{return e}},up=new Map,yC=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?pr(e.inputSchema):void 0,outputSchema:e.outputSchema?pr(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function Ate(e){const t=n=>"connection"in e?Tte({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return u;async function a(d,f=r){const m=e?.debugId?.(),p=m?{"x-trace-debug-id":m}:void 0,{client:g,callStreamableTool:y}=await t(p);if(e?.streamable?.[String(f)])return y(String(f),d);const{structuredContent:b,isError:S,content:w}=await g.callTool({name:String(f),arguments:d});if(S){const R=w?.[0]?.text,E=typeof R=="string"?Cte(R):null,T=E?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(E.code,E.message,E.traceId):null;throw T||new Error(`Tool ${String(f)} returned an error: ${JSON.stringify(b??w)}`)}return b}async function i(){const{client:d}=await t(),{tools:f}=await d.listTools();return f}async function l(){if(!("connection"in e))return i();const d=e.connection,f=JSON.stringify(d);try{return up.has(f)||up.set(f,i()),await up.get(f)}catch(m){console.error("Failed to list tools",m),up.delete(f);return}}async function u(){return(await l()??[]).map(f=>yC(f,a))}return a.asTool=async()=>{const f=(await l()??[]).find(m=>m.name===r);if(!f)throw new Error(`Tool ${r} not found`);return yC(f,a)},a}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>Ite({connection:n}):global[t]}});function Ite(e){return Ate(e)}const a3=A.createContext(null);function Vre(e){const t=pc.c(3),{value:n,children:r}=e,a=n;let i;return t[0]!==r||t[1]!==a?(i=x.jsx(a3.Provider,{value:a,children:r}),t[0]=r,t[1]=a,t[2]=i):i=t[2],i}function Bre(e){const t=A.useContext(a3);if(!t)throw new Error("usePluginContext must be used within a PluginContextProvider");if(!t.connectionId||!t.connection||!t.toolCaller)throw new Error("usePluginContext requires a valid connection. Use { partial: true } in empty state components.");return t}const Nte=pe({id:L().describe("Unique identifier for the entity"),title:L().describe("Human-readable title for the entity"),description:L().nullish().describe("Description of the entity"),created_at:L().datetime(),updated_at:L().datetime(),created_by:L().optional(),updated_by:L().optional()}),kte=pe({field:Oe(L()),operator:sn(["eq","gt","gte","lt","lte","in","like","contains"]),value:kt()}),s3=Za(()=>Lt([kte,pe({operator:sn(["and","or","not"]),conditions:Oe(s3)})])),Mte=pe({field:Oe(L()),direction:sn(["asc","desc"]),nulls:sn(["first","last"]).optional()}),Pte=pe({where:s3.optional().describe("Filter expression"),orderBy:Oe(Mte).optional().describe("Sort expressions"),limit:Ze().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:Ze().int().min(0).optional().describe("Number of items to skip")});function Dte(e){return pe({items:Oe(e).describe("Array of collection items"),totalCount:Ze().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:ut().optional().describe("Whether there are more items available")})}const Lte=pe({id:L().describe("ID of the entity to retrieve")});function jte(e){return pe({item:e.nullable().describe("The retrieved item, or null if not found")})}function $te(e){return pe({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function Ute(e){return pe({item:e.describe("The created entity with generated id")})}function zte(e){return pe({id:L().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function Fte(e){return pe({item:e.describe("The updated entity")})}const Vte=pe({id:L().describe("ID of the entity to delete")});function Bte(e){return pe({item:e.describe("The deleted entity")})}function qte(e,t,n){const r=e.toUpperCase(),a=n?.readOnly??!1,i=[{name:`COLLECTION_${r}_LIST`,inputSchema:Pte,outputSchema:Dte(t)},{name:`COLLECTION_${r}_GET`,inputSchema:Lte,outputSchema:jte(t)}];return a||i.push({name:`COLLECTION_${r}_CREATE`,inputSchema:$te(t),outputSchema:Ute(t),opt:!0},{name:`COLLECTION_${r}_UPDATE`,inputSchema:zte(t),outputSchema:Fte(t),opt:!0},{name:`COLLECTION_${r}_DELETE`,inputSchema:Vte,outputSchema:Bte(t),opt:!0}),i}const Hte=pe({id:L(),name:L(),description:L().optional(),inputSchema:Ft(L(),kt()),outputSchema:Ft(L(),kt()).optional()}),Gte=Nte.extend({_meta:pe({"io.decocms":pe({id:L(),verified:ut(),scopeName:L(),appName:L(),friendlyName:L().nullable().optional(),metadata:Ft(L(),kt()).nullable().optional(),publishedAt:L().datetime().optional(),updatedAt:L().datetime().optional(),tools:Oe(Hte).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:pe({$schema:L().optional(),_meta:Ft(L(),kt()).optional(),name:L().describe("The server name (scope/app)"),title:L().optional().describe("User-friendly title"),description:L().optional().describe("Server description"),icons:Oe(pe({src:L(),mimeType:L().optional(),sizes:Oe(L()).optional(),theme:sn(["light","dark"]).optional()})).optional(),remotes:Oe(pe({type:sn(["http","stdio","sse"]),url:L().optional(),headers:Oe(kt()).optional()})).optional(),packages:Oe(kt()).optional(),repository:pe({url:L(),source:L().optional(),subfolder:L().optional()}).optional(),version:L().optional(),websiteUrl:L().optional()})});qte("registry_app",Gte,{readOnly:!0});const Zte=pe({specversion:je("1.0").describe("CloudEvents specification version"),id:L().describe("Unique identifier for this event (UUID recommended)"),source:L().describe("Connection ID of the event publisher"),type:L().describe("Event type (e.g., 'order.created', 'user.signup')"),time:L().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:L().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:L().optional().default("application/json").describe("Content type of the data attribute"),dataschema:L().url().optional().describe("URI to the schema for the data attribute"),data:kt().optional().describe("Event payload (any JSON value)")});pe({events:Oe(Zte).min(1).describe("Batch of CloudEvents to process")});const Kte=pe({success:ut().optional().describe("Whether this event was processed successfully"),error:L().optional().describe("Error message for this event"),retryAfter:Ze().int().positive().optional().describe("Re-deliver this event after this many ms")});pe({success:ut().optional().describe("Batch success - applies to events not in results"),error:L().optional().describe("Batch error message - applies to events not in results"),processedCount:Ze().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:Ze().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:Ft(L(),Kte).optional().describe("Per-event results keyed by event ID")});pe({type:L().min(1).max(255).describe("Event type identifier"),subject:L().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:kt().optional().describe("Event payload"),deliverAt:L().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:L().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")});pe({id:L().describe("Unique event ID"),type:L().describe("Event type"),source:L().describe("Source connection ID"),time:L().describe("Event timestamp")});pe({eventType:L().min(1).max(255).describe("Event type to subscribe to"),publisher:L().optional().describe("Filter events by publisher connection ID"),filter:L().max(1e3).optional().describe("JSONPath filter expression on event data")});pe({subscription:pe({id:L().describe("Subscription ID"),connectionId:L().describe("Subscriber connection ID"),eventType:L().describe("Event type pattern"),publisher:L().nullable().describe("Publisher connection filter"),filter:L().nullable().describe("JSONPath filter expression"),enabled:ut().describe("Whether subscription is enabled"),createdAt:L().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:L().datetime().describe("Updated timestamp (ISO 8601)")})});const Yte=pe({eventType:L().min(1).max(255).describe("Event type to subscribe to"),publisher:L().optional().describe("Filter events by publisher connection ID"),filter:L().max(1e3).optional().describe("JSONPath filter expression on event data")}),Wte=pe({id:L().describe("Subscription ID"),connectionId:L().describe("Subscriber connection ID"),eventType:L().describe("Event type pattern"),publisher:L().nullable().describe("Publisher connection filter"),filter:L().nullable().describe("JSONPath filter expression"),enabled:ut().describe("Whether subscription is enabled"),createdAt:L().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:L().datetime().describe("Updated timestamp (ISO 8601)")});pe({subscriptions:Oe(Yte).describe("Desired subscriptions - system will create/update/delete to match")});pe({created:Ze().int().min(0).describe("Number of subscriptions created"),updated:Ze().int().min(0).describe("Number of subscriptions with filter updated"),deleted:Ze().int().min(0).describe("Number of subscriptions removed"),unchanged:Ze().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:Oe(Wte).describe("Current subscriptions after sync")});pe({subscriptionId:L().describe("Subscription ID to remove")});pe({success:ut().describe("Whether unsubscribe was successful"),subscriptionId:L().describe("Subscription ID that was removed")});pe({eventId:L().describe("Event ID to cancel")});pe({success:ut().describe("Whether cancellation was successful"),eventId:L().describe("Event ID that was cancelled")});pe({eventId:L().describe("Event ID to acknowledge")});pe({success:ut().describe("Whether ACK was successful"),eventId:L().describe("Event ID that was acknowledged")});const Qte=pe({prefix:L().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:Ze().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:L().optional().describe("Token for pagination from previous response"),delimiter:L().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")}),Xte=pe({objects:Oe(pe({key:L().describe("Object key/path"),size:Ze().describe("Object size in bytes"),lastModified:L().describe("Last modified timestamp"),etag:L().describe("Entity tag for the object")})),nextContinuationToken:L().optional().describe("Token for fetching next page of results"),isTruncated:ut().describe("Whether there are more results available"),commonPrefixes:Oe(L()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")}),Jte=pe({key:L().describe("Object key/path to get metadata for")}),ene=pe({contentType:L().optional().describe("MIME type of the object"),contentLength:Ze().describe("Size of the object in bytes"),lastModified:L().describe("Last modified timestamp"),etag:L().describe("Entity tag for the object"),metadata:Ft(L(),L()).optional().describe("Custom metadata key-value pairs")}),tne=pe({key:L().describe("Object key/path to generate URL for"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)")}),nne=pe({url:L().describe("Presigned URL for downloading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),rne=pe({key:L().describe("Object key/path for the upload"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:L().optional().describe("MIME type for the object being uploaded")}),one=pe({url:L().describe("Presigned URL for uploading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),ane=pe({key:L().describe("Object key/path to delete")}),sne=pe({success:ut().describe("Whether the deletion was successful"),key:L().describe("The key that was deleted")}),ine=pe({keys:Oe(L()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")}),lne=pe({deleted:Oe(L()).describe("Array of successfully deleted keys"),errors:Oe(pe({key:L(),message:L()})).describe("Array of errors for failed deletions")}),cne=[{name:"LIST_OBJECTS",inputSchema:Qte,outputSchema:Xte},{name:"GET_OBJECT_METADATA",inputSchema:Jte,outputSchema:ene},{name:"GET_PRESIGNED_URL",inputSchema:tne,outputSchema:nne},{name:"PUT_PRESIGNED_URL",inputSchema:rne,outputSchema:one},{name:"DELETE_OBJECT",inputSchema:ane,outputSchema:sne},{name:"DELETE_OBJECTS",inputSchema:ine,outputSchema:lne}],i3=({size:e=24,color:t="currentColor",...n})=>A.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},A.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Z"}));i3.displayName="Folder";function _C(e,t,n){return e?e.startsWith("/")?`/${t}/${n}${e}`:e:`/${t}/${n}`}function une(e){return{createRoutes:e,useParams:t=>Yl({strict:!1}),useSearch:t=>xm({strict:!1}),useNavigate:()=>{const t=mc(),{org:n,pluginId:r}=Yl({strict:!1});return a=>{const i=_C(a.to,n,r);return t({...a,to:i,params:{org:n,pluginId:r,...a.params}})}},useLocation:()=>oL(),Link:function(n){const{org:r,pluginId:a}=Yl({strict:!1}),i=_C(n.to,r,a);return x.jsx(Om,{...n,to:i,params:{org:r,pluginId:a,...n.params}})},_types:{routes:void 0,routeIds:void 0}}}var Nt;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const l of a)i[l]=l;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),l={};for(const u of i)l[u]=a[u];return e.objectValues(l)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&i.push(l);return i},e.find=(a,i)=>{for(const l of a)if(i(l))return l},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Nt||(Nt={}));var bC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(bC||(bC={}));const Fe=Nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),As=e=>{switch(typeof e){case"undefined":return Fe.undefined;case"string":return Fe.string;case"number":return Number.isNaN(e)?Fe.nan:Fe.number;case"boolean":return Fe.boolean;case"function":return Fe.function;case"bigint":return Fe.bigint;case"symbol":return Fe.symbol;case"object":return Array.isArray(e)?Fe.array:e===null?Fe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Fe.promise:typeof Map<"u"&&e instanceof Map?Fe.map:typeof Set<"u"&&e instanceof Set?Fe.set:typeof Date<"u"&&e instanceof Date?Fe.date:Fe.object;default:return Fe.unknown}},Ne=Nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class qa extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let u=r,d=0;for(;d<l.path.length;){const f=l.path[d];d===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(l))):u[f]=u[f]||{_errors:[]},u=u[f],d++}}};return a(this),r}static assert(t){if(!(t instanceof qa))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Nt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}qa.create=e=>new qa(e);const nb=(e,t)=>{let n;switch(e.code){case Ne.invalid_type:e.received===Fe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Nt.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${Nt.joinValues(e.keys,", ")}`;break;case Ne.invalid_union:n="Invalid input";break;case Ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Nt.joinValues(e.options)}`;break;case Ne.invalid_enum_value:n=`Invalid enum value. Expected ${Nt.joinValues(e.options)}, received '${e.received}'`;break;case Ne.invalid_arguments:n="Invalid function arguments";break;case Ne.invalid_return_type:n="Invalid function return type";break;case Ne.invalid_date:n="Invalid date";break;case Ne.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Nt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ne.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ne.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ne.custom:n="Invalid input";break;case Ne.invalid_intersection_types:n="Intersection results could not be merged";break;case Ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,Nt.assertNever(e)}return{message:n}};let dne=nb;function fne(){return dne}const hne=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],l={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let u="";const d=r.filter(f=>!!f).slice().reverse();for(const f of d)u=f(l,{data:t,defaultError:u}).message;return{...a,path:i,message:u}};function De(e,t){const n=fne(),r=hne({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===nb?void 0:nb].filter(a=>!!a)});e.common.issues.push(r)}class ro{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return tt;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,l=await a.value;r.push({key:i,value:l})}return ro.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:l}=a;if(i.status==="aborted"||l.status==="aborted")return tt;i.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(r[i.value]=l.value)}return{status:t.value,value:r}}}const tt=Object.freeze({status:"aborted"}),Du=e=>({status:"dirty",value:e}),Oo=e=>({status:"valid",value:e}),wC=e=>e.status==="aborted",SC=e=>e.status==="dirty",uc=e=>e.status==="valid",gm=e=>typeof Promise<"u"&&e instanceof Promise;var Ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ge||(Ge={}));class qs{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const EC=(e,t)=>{if(uc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new qa(e.common.issues);return this._error=n,this._error}}};function mt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(l,u)=>{const{message:d}=e;return l.code==="invalid_enum_value"?{message:d??u.defaultError}:typeof u.data>"u"?{message:d??r??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:d??n??u.defaultError}},description:a}}class xt{get description(){return this._def.description}_getType(t){return As(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:As(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ro,ctx:{common:t.parent.common,data:t.data,parsedType:As(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(gm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:As(t)},a=this._parseSync({data:t,path:r.path,parent:r});return EC(r,a)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:As(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return uc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>uc(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:As(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(gm(a)?a:Promise.resolve(a));return EC(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const l=t(a),u=()=>i.addIssue({code:Ne.custom,...r(a)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new fc({schema:this,typeName:nt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Us.create(this,this._def)}nullable(){return hc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ia.create(this)}promise(){return bm.create(this,this._def)}or(t){return ym.create([this,t],this._def)}and(t){return _m.create(this,t,this._def)}transform(t){return new fc({...mt(this._def),schema:this,typeName:nt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ab({...mt(this._def),innerType:this,defaultValue:n,typeName:nt.ZodDefault})}brand(){return new Lne({typeName:nt.ZodBranded,type:this,...mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new sb({...mt(this._def),innerType:this,catchValue:n,typeName:nt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return K1.create(this,t)}readonly(){return ib.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pne=/^c[^\s-]{8,}$/i,mne=/^[0-9a-z]+$/,gne=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vne=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,yne=/^[a-z0-9_-]{21}$/i,_ne=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,bne=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wne=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Sne="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let V0;const Ene=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rne=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,xne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Tne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,One=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cne=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,l3="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ane=new RegExp(`^${l3}$`);function c3(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ine(e){return new RegExp(`^${c3(e)}$`)}function Nne(e){let t=`${l3}T${c3(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function kne(e,t){return!!((t==="v4"||!t)&&Ene.test(e)||(t==="v6"||!t)&&xne.test(e))}function Mne(e,t){if(!_ne.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function Pne(e,t){return!!((t==="v4"||!t)&&Rne.test(e)||(t==="v6"||!t)&&Tne.test(e))}class Ms extends xt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Fe.string){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Fe.string,received:i.parsedType}),tt}const r=new ro;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const l=t.data.length>i.value,u=t.data.length<i.value;(l||u)&&(a=this._getOrReturnCtx(t,a),l?De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")wne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"email",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")V0||(V0=new RegExp(Sne,"u")),V0.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"emoji",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")vne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"uuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")yne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"nanoid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")pne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")mne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid2",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")gne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ulid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),De(a,{validation:"url",code:Ne.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"regex",code:Ne.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Nne(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Ane.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Ine(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?bne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"duration",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?kne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ip",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Mne(t.data,i.alg)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"jwt",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Pne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cidr",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?One.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Cne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64url",code:Ne.invalid_string,message:i.message}),r.dirty()):Nt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:Ne.invalid_string,...Ge.errToObj(r)})}_addCheck(t){return new Ms({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ge.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ge.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ge.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ge.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ge.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ge.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ge.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ge.errToObj(n)})}nonempty(t){return this.min(1,Ge.errToObj(t))}trim(){return new Ms({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ms({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ms({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ms.create=e=>new Ms({checks:[],typeName:nt.ZodString,coerce:e?.coerce??!1,...mt(e)});function Dne(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(e.toFixed(a).replace(".","")),l=Number.parseInt(t.toFixed(a).replace(".",""));return i%l/10**a}class ud extends xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Fe.number){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Fe.number,received:i.parsedType}),tt}let r;const a=new ro;for(const i of this._def.checks)i.kind==="int"?Nt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?Dne(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_finite,message:i.message}),a.dirty()):Nt.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new ud({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new ud({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Nt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}ud.create=e=>new ud({checks:[],typeName:nt.ZodNumber,coerce:e?.coerce||!1,...mt(e)});class dd extends xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Fe.bigint)return this._getInvalidInput(t);let r;const a=new ro;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Nt.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Fe.bigint,received:n.parsedType}),tt}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new dd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new dd({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}dd.create=e=>new dd({checks:[],typeName:nt.ZodBigInt,coerce:e?.coerce??!1,...mt(e)});class rb extends xt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Fe.boolean){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.boolean,received:r.parsedType}),tt}return Oo(t.data)}}rb.create=e=>new rb({typeName:nt.ZodBoolean,coerce:e?.coerce||!1,...mt(e)});class vm extends xt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Fe.date){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Fe.date,received:i.parsedType}),tt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_date}),tt}const r=new ro;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Nt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new vm({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ge.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ge.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}vm.create=e=>new vm({checks:[],coerce:e?.coerce||!1,typeName:nt.ZodDate,...mt(e)});class RC extends xt{_parse(t){if(this._getType(t)!==Fe.symbol){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.symbol,received:r.parsedType}),tt}return Oo(t.data)}}RC.create=e=>new RC({typeName:nt.ZodSymbol,...mt(e)});class xC extends xt{_parse(t){if(this._getType(t)!==Fe.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.undefined,received:r.parsedType}),tt}return Oo(t.data)}}xC.create=e=>new xC({typeName:nt.ZodUndefined,...mt(e)});class TC extends xt{_parse(t){if(this._getType(t)!==Fe.null){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.null,received:r.parsedType}),tt}return Oo(t.data)}}TC.create=e=>new TC({typeName:nt.ZodNull,...mt(e)});class OC extends xt{constructor(){super(...arguments),this._any=!0}_parse(t){return Oo(t.data)}}OC.create=e=>new OC({typeName:nt.ZodAny,...mt(e)});class CC extends xt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Oo(t.data)}}CC.create=e=>new CC({typeName:nt.ZodUnknown,...mt(e)});class Hs extends xt{_parse(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Fe.never,received:n.parsedType}),tt}}Hs.create=e=>new Hs({typeName:nt.ZodNever,...mt(e)});class AC extends xt{_parse(t){if(this._getType(t)!==Fe.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.void,received:r.parsedType}),tt}return Oo(t.data)}}AC.create=e=>new AC({typeName:nt.ZodVoid,...mt(e)});class ia extends xt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Fe.array)return De(n,{code:Ne.invalid_type,expected:Fe.array,received:n.parsedType}),tt;if(a.exactLength!==null){const l=n.data.length>a.exactLength.value,u=n.data.length<a.exactLength.value;(l||u)&&(De(n,{code:l?Ne.too_big:Ne.too_small,minimum:u?a.exactLength.value:void 0,maximum:l?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(De(n,{code:Ne.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(De(n,{code:Ne.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>a.type._parseAsync(new qs(n,l,n.path,u)))).then(l=>ro.mergeArray(r,l));const i=[...n.data].map((l,u)=>a.type._parseSync(new qs(n,l,n.path,u)));return ro.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new ia({...this._def,minLength:{value:t,message:Ge.toString(n)}})}max(t,n){return new ia({...this._def,maxLength:{value:t,message:Ge.toString(n)}})}length(t,n){return new ia({...this._def,exactLength:{value:t,message:Ge.toString(n)}})}nonempty(t){return this.min(1,t)}}ia.create=(e,t)=>new ia({type:e,minLength:null,maxLength:null,exactLength:null,typeName:nt.ZodArray,...mt(t)});function ql(e){if(e instanceof Mn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Us.create(ql(r))}return new Mn({...e._def,shape:()=>t})}else return e instanceof ia?new ia({...e._def,type:ql(e.element)}):e instanceof Us?Us.create(ql(e.unwrap())):e instanceof hc?hc.create(ql(e.unwrap())):e instanceof ji?ji.create(e.items.map(t=>ql(t))):e}class Mn extends xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Nt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Fe.object){const f=this._getOrReturnCtx(t);return De(f,{code:Ne.invalid_type,expected:Fe.object,received:f.parsedType}),tt}const{status:r,ctx:a}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof Hs&&this._def.unknownKeys==="strip"))for(const f in a.data)l.includes(f)||u.push(f);const d=[];for(const f of l){const m=i[f],p=a.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new qs(a,p,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof Hs){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)d.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(f==="strict")u.length>0&&(De(a,{code:Ne.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const p=a.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new qs(a,p,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of d){const p=await m.key,g=await m.value;f.push({key:p,value:g,alwaysSet:m.alwaysSet})}return f}).then(f=>ro.mergeObjectSync(r,f)):ro.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return Ge.errToObj,new Mn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const a=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Ge.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Mn({...this._def,unknownKeys:"strip"})}passthrough(){return new Mn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Mn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Mn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:nt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Mn({...this._def,catchall:t})}pick(t){const n={};for(const r of Nt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Mn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Nt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Mn({...this._def,shape:()=>n})}deepPartial(){return ql(this)}partial(t){const n={};for(const r of Nt.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new Mn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Nt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Us;)i=i._def.innerType;n[r]=i}return new Mn({...this._def,shape:()=>n})}keyof(){return u3(Nt.objectKeys(this.shape))}}Mn.create=(e,t)=>new Mn({shape:()=>e,unknownKeys:"strip",catchall:Hs.create(),typeName:nt.ZodObject,...mt(t)});Mn.strictCreate=(e,t)=>new Mn({shape:()=>e,unknownKeys:"strict",catchall:Hs.create(),typeName:nt.ZodObject,...mt(t)});Mn.lazycreate=(e,t)=>new Mn({shape:e,unknownKeys:"strip",catchall:Hs.create(),typeName:nt.ZodObject,...mt(t)});class ym extends xt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const l=i.map(u=>new qa(u.ctx.common.issues));return De(n,{code:Ne.invalid_union,unionErrors:l}),tt}if(n.common.async)return Promise.all(r.map(async i=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(a);{let i;const l=[];for(const d of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=d._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=l.map(d=>new qa(d));return De(n,{code:Ne.invalid_union,unionErrors:u}),tt}}get options(){return this._def.options}}ym.create=(e,t)=>new ym({options:e,typeName:nt.ZodUnion,...mt(t)});function ob(e,t){const n=As(e),r=As(t);if(e===t)return{valid:!0,data:e};if(n===Fe.object&&r===Fe.object){const a=Nt.objectKeys(t),i=Nt.objectKeys(e).filter(u=>a.indexOf(u)!==-1),l={...e,...t};for(const u of i){const d=ob(e[u],t[u]);if(!d.valid)return{valid:!1};l[u]=d.data}return{valid:!0,data:l}}else if(n===Fe.array&&r===Fe.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const l=e[i],u=t[i],d=ob(l,u);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return n===Fe.date&&r===Fe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class _m extends xt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,l)=>{if(wC(i)||wC(l))return tt;const u=ob(i.value,l.value);return u.valid?((SC(i)||SC(l))&&n.dirty(),{status:n.value,value:u.data}):(De(r,{code:Ne.invalid_intersection_types}),tt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,l])=>a(i,l)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_m.create=(e,t,n)=>new _m({left:e,right:t,typeName:nt.ZodIntersection,...mt(n)});class ji extends xt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Fe.array)return De(r,{code:Ne.invalid_type,expected:Fe.array,received:r.parsedType}),tt;if(r.data.length<this._def.items.length)return De(r,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tt;!this._def.rest&&r.data.length>this._def.items.length&&(De(r,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((l,u)=>{const d=this._def.items[u]||this._def.rest;return d?d._parse(new qs(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(i).then(l=>ro.mergeArray(n,l)):ro.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new ji({...this._def,rest:t})}}ji.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ji({items:e,typeName:nt.ZodTuple,rest:null,...mt(t)})};class IC extends xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Fe.map)return De(r,{code:Ne.invalid_type,expected:Fe.map,received:r.parsedType}),tt;const a=this._def.keyType,i=this._def.valueType,l=[...r.data.entries()].map(([u,d],f)=>({key:a._parse(new qs(r,u,r.path,[f,"key"])),value:i._parse(new qs(r,d,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const d of l){const f=await d.key,m=await d.value;if(f.status==="aborted"||m.status==="aborted")return tt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const d of l){const f=d.key,m=d.value;if(f.status==="aborted"||m.status==="aborted")return tt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}IC.create=(e,t,n)=>new IC({valueType:t,keyType:e,typeName:nt.ZodMap,...mt(n)});class fd extends xt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Fe.set)return De(r,{code:Ne.invalid_type,expected:Fe.set,received:r.parsedType}),tt;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(De(r,{code:Ne.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(De(r,{code:Ne.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function l(d){const f=new Set;for(const m of d){if(m.status==="aborted")return tt;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((d,f)=>i._parse(new qs(r,d,r.path,f)));return r.common.async?Promise.all(u).then(d=>l(d)):l(u)}min(t,n){return new fd({...this._def,minSize:{value:t,message:Ge.toString(n)}})}max(t,n){return new fd({...this._def,maxSize:{value:t,message:Ge.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}fd.create=(e,t)=>new fd({valueType:e,minSize:null,maxSize:null,typeName:nt.ZodSet,...mt(t)});class NC extends xt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}NC.create=(e,t)=>new NC({getter:e,typeName:nt.ZodLazy,...mt(t)});class kC extends xt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return De(n,{received:n.data,code:Ne.invalid_literal,expected:this._def.value}),tt}return{status:"valid",value:t.data}}get value(){return this._def.value}}kC.create=(e,t)=>new kC({value:e,typeName:nt.ZodLiteral,...mt(t)});function u3(e,t){return new dc({values:e,typeName:nt.ZodEnum,...mt(t)})}class dc extends xt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{expected:Nt.joinValues(r),received:n.parsedType,code:Ne.invalid_type}),tt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{received:n.data,code:Ne.invalid_enum_value,options:r}),tt}return Oo(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return dc.create(t,{...this._def,...n})}exclude(t,n=this._def){return dc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}dc.create=u3;class MC extends xt{_parse(t){const n=Nt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Fe.string&&r.parsedType!==Fe.number){const a=Nt.objectValues(n);return De(r,{expected:Nt.joinValues(a),received:r.parsedType,code:Ne.invalid_type}),tt}if(this._cache||(this._cache=new Set(Nt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=Nt.objectValues(n);return De(r,{received:r.data,code:Ne.invalid_enum_value,options:a}),tt}return Oo(t.data)}get enum(){return this._def.values}}MC.create=(e,t)=>new MC({values:e,typeName:nt.ZodNativeEnum,...mt(t)});class bm extends xt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Fe.promise&&n.common.async===!1)return De(n,{code:Ne.invalid_type,expected:Fe.promise,received:n.parsedType}),tt;const r=n.parsedType===Fe.promise?n.data:Promise.resolve(n.data);return Oo(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}bm.create=(e,t)=>new bm({type:e,typeName:nt.ZodPromise,...mt(t)});class fc extends xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===nt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:l=>{De(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const l=a.transform(r.data,i);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return tt;const d=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return d.status==="aborted"?tt:d.status==="dirty"||n.value==="dirty"?Du(d.value):d});{if(n.value==="aborted")return tt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?tt:u.status==="dirty"||n.value==="dirty"?Du(u.value):u}}if(a.type==="refinement"){const l=u=>{const d=a.refinement(u,i);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?tt:(u.status==="dirty"&&n.dirty(),l(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?tt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(a.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!uc(l))return tt;const u=a.transform(l.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>uc(l)?Promise.resolve(a.transform(l.value,i)).then(u=>({status:n.value,value:u})):tt);Nt.assertNever(a)}}fc.create=(e,t,n)=>new fc({schema:e,typeName:nt.ZodEffects,effect:t,...mt(n)});fc.createWithPreprocess=(e,t,n)=>new fc({schema:t,effect:{type:"preprocess",transform:e},typeName:nt.ZodEffects,...mt(n)});class Us extends xt{_parse(t){return this._getType(t)===Fe.undefined?Oo(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Us.create=(e,t)=>new Us({innerType:e,typeName:nt.ZodOptional,...mt(t)});class hc extends xt{_parse(t){return this._getType(t)===Fe.null?Oo(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}hc.create=(e,t)=>new hc({innerType:e,typeName:nt.ZodNullable,...mt(t)});class ab extends xt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Fe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ab.create=(e,t)=>new ab({innerType:e,typeName:nt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...mt(t)});class sb extends xt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return gm(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new qa(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new qa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}sb.create=(e,t)=>new sb({innerType:e,typeName:nt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...mt(t)});class PC extends xt{_parse(t){if(this._getType(t)!==Fe.nan){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Fe.nan,received:r.parsedType}),tt}return{status:"valid",value:t.data}}}PC.create=e=>new PC({typeName:nt.ZodNaN,...mt(e)});class Lne extends xt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class K1 extends xt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?tt:i.status==="dirty"?(n.dirty(),Du(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?tt:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new K1({in:t,out:n,typeName:nt.ZodPipeline})}}class ib extends xt{_parse(t){const n=this._def.innerType._parse(t),r=a=>(uc(a)&&(a.value=Object.freeze(a.value)),a);return gm(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}ib.create=(e,t)=>new ib({innerType:e,typeName:nt.ZodReadonly,...mt(t)});var nt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(nt||(nt={}));const jne=Ms.create,$ne=rb.create;Hs.create;ia.create;const Une=Mn.create;ym.create;_m.create;ji.create;const zne=dc.create;bm.create;Us.create;hc.create;const Fne=Une({path:jne().optional().default(""),flat:$ne().optional().default(!1),view:zne(["table","grid"]).optional().default("grid")}),Vne=une(e=>{const{createRoute:t,lazyRouteComponent:n}=e.routing;return[t({getParentRoute:()=>e.parentRoute,path:"/",component:n(()=>mn(()=>import("./file-browser-Dn-I1IiE.js").then(a=>a.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),validateSearch:Fne})]}),Bne=A.lazy(()=>mn(()=>import("./plugin-header-B_tffoXS.js"),__vite__mapDeps([15,5,16]))),qne=A.lazy(()=>mn(()=>import("./plugin-empty-state-Dy73LUEA.js"),[])),Hne={id:"object-storage",description:"Browse and manage files in S3-compatible object storage",binding:cne,renderHeader:e=>x.jsx(Bne,{...e}),renderEmptyState:()=>x.jsx(qne,{}),setup:e=>{const{registerRootSidebarItem:t,registerPluginRoutes:n}=e;t({icon:x.jsx(i3,{size:20}),label:"Files"});const r=Vne.createRoutes(e);n(r)}},Gne=[Hne],Dd=H6({component:()=>x.jsxs(GW,{children:[x.jsx(A.Suspense,{fallback:x.jsx(vM,{}),children:x.jsx(gA,{})}),x.jsx(ZW,{})]})}),Zne=Sn({getParentRoute:()=>Dd,path:"/login",component:Ln(()=>mn(()=>import("./login-DuLQYRHx.js"),__vite__mapDeps([17,14,3,18]))),validateSearch:Za(()=>pe({next:L().optional(),client_id:L().optional(),redirect_uri:L().optional(),response_type:L().optional(),state:L().optional(),scope:L().optional(),code_challenge:L().optional(),code_challenge_method:L().optional()}))}),Kne=Sn({getParentRoute:()=>Dd,path:"/auth/$pathname",component:Ln(()=>mn(()=>import("./auth-catchall-CZQOowpQ.js"),[]))}),Rr=Sn({getParentRoute:()=>Dd,id:"shell",component:Ln(()=>mn(()=>import("./shell-layout-Bd8yx5uJ.js"),__vite__mapDeps([19,3,20,21,5,22,23,24,25,26,27,28,29,30,31,32,6,33,16,34,35,36,14,37,38,39,40,41,42,43,18,44,45,46,7,47,48,49,50,51,52,53,54,12,55,9,56,57,58,59,60,61,62,63,64,65,66])))}),Yne=Sn({getParentRoute:()=>Rr,path:"/",component:Ln(()=>mn(()=>import("./home-CeFBBPsp.js"),__vite__mapDeps([67,68,3,58,6,5,66,44,23,18,56,52,57,51,14])))}),Wne=Sn({getParentRoute:()=>Rr,path:"/$org",component:Ln(()=>mn(()=>import("./page-CTarFbC4.js"),__vite__mapDeps([69,29,3,26,30,31,20,32,6,24,33,16,34,35,36,14,37,38,39,40,41,42,43,18,28,5,44,45,46,25,7,47,48,49,50,51,52,53,54,12,70,71,64,66,72,73,74])))}),Qne=Sn({getParentRoute:()=>Rr,path:"/$org/members",component:Ln(()=>mn(()=>import("./members-D2GPpEvZ.js"),__vite__mapDeps([75,76,77,3,59,7,33,5,10,28,70,78,79,11,44,18,80,81,30,4,82,38,35,31,36,14,83,53,43,58,21,52,61,26,84,85,66,12,62,24,57,46,16,32,68,86,87,23])))}),Xne=Sn({getParentRoute:()=>Rr,path:"/$org/mcps",component:Ln(()=>mn(()=>import("./connections-BQG75-F0.js"),__vite__mapDeps([88,76,77,3,59,7,33,5,10,28,70,78,79,11,44,18,80,89,68,30,24,38,35,31,36,14,39,40,90,27,52,21,61,26,57,86,91,49,12,46,16,32,54,72,43,92,66]))),validateSearch:Za(()=>pe({action:sn(["create"]).optional()}))}),Jne=Sn({getParentRoute:()=>Rr,path:"/$org/settings",component:Ln(()=>mn(()=>import("./settings-DjC9FBse.js"),__vite__mapDeps([93,76,77,3,59,7,33,5,10,28,70,78,31,57,18,14,13,26])))}),ere=Sn({getParentRoute:()=>Rr,path:"/$org/settings/plugins",component:Ln(()=>mn(()=>import("./plugins-CR5Q-iDa.js"),__vite__mapDeps([94,76,77,3,59,7,33,5,10,28,70,78,55,14,35,31,62,82])))}),tre=Sn({getParentRoute:()=>Rr,path:"/$org/monitoring",component:Ln(()=>mn(()=>import("./monitoring-DvqA7AuH.js"),__vite__mapDeps([95,35,76,77,3,59,7,33,5,10,28,70,78,79,11,44,18,30,24,21,16,31,20,48,8,96,87,97,50,51,98,73,38,36,14,34,83,63,66,12,4,46,2,32,99,72,43]))),validateSearch:Za(()=>pe({tab:sn(["logs","analytics"]).default("logs"),from:L().default("now-24h"),to:L().default("now"),connectionId:Oe(L()).optional().default([]),gatewayId:Oe(L()).optional().default([]),tool:L().default(""),status:sn(["all","success","errors"]).default("all"),search:L().default(""),page:Ze().optional(),streaming:ut().default(!0),propertyFilters:L().default("")}))}),d3=Sn({getParentRoute:()=>Rr,path:"/$org/store",component:Ln(()=>mn(()=>import("./page-CekK7zPt.js"),__vite__mapDeps([100,53,76,77,3,59,7,33,5,10,28,70,96,22,11,44,38,35,31,36,14,1,2,91,101,79,18,102,85,66,49,68,30,103,20,16,23,46,39,40,42,43])))}),nre=Sn({getParentRoute:()=>d3,path:"/$appName",component:Ln(()=>mn(()=>import("./mcp-server-detail-DRgWtEnz.js"),__vite__mapDeps([104,6,11,3,82,30,105,106,103,91,54,16,66,59,7,60,107,43,25,77,33,5,10,28,70,79,44,18,80,68,108,109,99,21,102,85,49,38,35,31,36,14,39,40,72,110,42,101,111]))),validateSearch:Za(()=>pe({registryId:L().optional(),serverName:L().optional(),itemId:L().optional()}))}),rre=Sn({getParentRoute:()=>Rr,path:"/$org/mcps/$connectionId",component:Ln(()=>mn(()=>import("./connection-detail-BRtmbxOA.js"),__vite__mapDeps([112,30,3,24,38,35,31,36,14,39,40,113,114,92,18,66,12,72,43,115,28,55,25,87,11,108,82,21,57,46,5,16,105,106,103,91,54,49,34,7,116,98,29,26,20,32,6,33,37,41,42,44,45,47,48,50,51,52,53,117,99,118,77,59,10,70,79,68,86,90,27,80,119,22,58,107,109]))),validateSearch:Za(()=>pe({tab:L().optional()}))}),ore=Sn({getParentRoute:()=>Rr,path:"/$org/mcps/$connectionId/$collectionName/$itemId",component:Ln(()=>mn(()=>import("./collection-detail-kd5gJHzz.js"),__vite__mapDeps([120,35,30,3,24,36,14,31,115,28,55,57,18,32,121,108,82,38,6,50,51,63,48,11,97,23,113,114,92,66,12,39,40,72,43,25,87,21,46,5,16,105,106,103,91,54,49,34,7,116,98,29,26,20,33,37,41,42,44,45,47,52,53,110,119,65,70,71,61,84,59]))),validateSearch:Za(()=>pe({replayId:L().optional()}))}),are=Sn({getParentRoute:()=>Rr,path:"/$org/gateways",component:Ln(()=>mn(()=>import("./gateways-DSACPdOv.js"),__vite__mapDeps([122,76,77,3,59,7,33,5,10,28,70,78,79,11,44,18,80,89,68,30,24,34,35,31,36,14,90,27,45,52,21,86,12]))),validateSearch:Za(()=>pe({action:sn(["create"]).optional()}))}),sre=Sn({getParentRoute:()=>Rr,path:"/$org/gateways/$gatewayId",component:Ln(()=>mn(()=>import("./gateway-detail-BQDBMjd9.js"),__vite__mapDeps([123,30,3,24,4,5,82,38,35,31,36,14,79,11,44,18,66,26,115,28,55,81,34,117,116,41,42,43,101,21,61,57,99,46,16,62,32,63,48,121,111,108]))),validateSearch:Za(()=>pe({tab:L().optional()}))}),ire=Sn({getParentRoute:()=>Rr,path:"/$org/workflows",component:Ln(()=>mn(()=>import("./workflow-B-4ovCZr.js"),__vite__mapDeps([124,53,118,54,35,77,3,59,7,33,5,10,28,70,79,11,44,18,68,30,48,86,37,90,27,12,80,119,22,58,43,115,55,14,31,38,36,106,52,66,108,82,76,39,40])))}),f3=Sn({getParentRoute:()=>Rr,path:"/$org/$pluginId",component:Ln(()=>mn(()=>import("./dynamic-plugin-layout-CQi3lnCP.js"),__vite__mapDeps([125,11,40,38,35,31,36,14,42,43])))}),lre=[],h3=[];Gne.forEach(e=>{const t={parentRoute:f3,routing:{createRoute:Sn,lazyRouteComponent:Ln},registerRootSidebarItem:n=>lre.push({pluginId:e.id,...n}),registerPluginRoutes:n=>{h3.push(...n)}};e.setup(t)});const cre=f3.addChildren(h3),ure=Sn({getParentRoute:()=>Dd,path:"/oauth/callback",component:Ln(()=>mn(()=>import("./oauth-callback-B2iJ-cIh.js"),__vite__mapDeps([126,11,114])))}),dre=d3.addChildren([nre]),fre=Rr.addChildren([Yne,Wne,Qne,Xne,are,sre,tre,dre,Jne,ere,ire,rre,ore,cre]),hre=Dd.addChildren([fre,Zne,Kne,ure]),pre=eL({routeTree:hre}),mre=document.getElementById("root");LD.createRoot(mre).render(x.jsx(A.StrictMode,{children:x.jsx(rL,{router:pre})}));export{Tm as $,Lre as A,da as B,FB as C,Are as D,ua as E,wre as F,JY as G,ee as H,Oe as I,Ft as J,KC as K,ut as L,Om as M,Sre as N,zB as O,UB as P,Gne as Q,jB as R,vM as S,VB as T,w5 as U,v5 as V,gre as W,Ha as X,AA as Y,dA as Z,sn as _,xj as a,$B as a$,lb as a0,Gs as a1,Fa as a2,Bn as a3,QN as a4,zi as a5,dn as a6,Ya as a7,it as a8,Bo as a9,h$ as aA,_4 as aB,w4 as aC,FG as aD,uk as aE,hZ as aF,kt as aG,bte as aH,tU as aI,Ere as aJ,Lt as aK,xre as aL,YI as aM,Za as aN,md as aO,Ze as aP,je as aQ,qI as aR,Rre as aS,mn as aT,xd as aU,yd as aV,MN as aW,Bb as aX,td as aY,RN as aZ,Fb as a_,_d as aa,Ek as ab,SH as ac,wH as ad,vre as ae,Ur as af,gr as ag,qG as ah,hA as ai,fk as aj,lH as ak,Vb as al,wk as am,zb as an,cH as ao,uH as ap,MF as aq,NF as ar,js as as,WN as at,OF as au,LF as av,CJ as aw,XM as ax,pt as ay,bee as az,xm as b,hd as b0,or as b1,q0 as b2,jC as b3,e5 as b4,u5 as b5,h5 as b6,y5 as b7,p5 as b8,m5 as b9,kre as bA,Mre as bB,Pre as bC,Nre as bD,Vre as bE,ste as bF,dte as bG,Fre as bH,Oi as bI,i3 as bJ,Bre as bK,Vne as bL,ix as bM,_re as bN,yre as bO,Zu as bP,o5 as bQ,UC as bR,Lr as ba,b5 as bb,lx as bc,_5 as bd,g5 as be,zF as bf,$F as bg,UF as bh,cN as bi,QG as bj,XG as bk,WG as bl,Nte as bm,qte as bn,eo as bo,ar as bp,$I as bq,pr as br,Ore as bs,Cre as bt,Tre as bu,PG as bv,DG as bw,LG as bx,jG as by,$G as bz,pc as c,Yl as d,ht as e,mc as f,Ire as g,lV as h,yN as i,x as j,Er as k,DY as l,qo as m,Dre as n,jre as o,lre as p,$re as q,A as r,Ure as s,hT as t,bre as u,ZC as v,gA as w,l5 as x,pe as y,L as z};