decocms 2.162.0 → 2.162.2
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.
- package/dist/client/assets/{AlertCircle-DYlknn87.js → AlertCircle-CLSQ0NLi.js} +1 -1
- package/dist/client/assets/{AlignLeft-DIhdEisK.js → AlignLeft-DGT5YesK.js} +1 -1
- package/dist/client/assets/{ArrowDown-DJ9bUSaF.js → ArrowDown-BeNMpJ4E.js} +1 -1
- package/dist/client/assets/{ArrowLeft-C26rniWK.js → ArrowLeft-ZgtBxTyN.js} +1 -1
- package/dist/client/assets/{ArrowUp-C6uoaW7g.js → ArrowUp-WkRPF3Cl.js} +1 -1
- package/dist/client/assets/{Check-BdWYqlDo.js → Check-D30Nw_2C.js} +1 -1
- package/dist/client/assets/{CheckCircle-BgJPFNGO.js → CheckCircle-4PmUxEXj.js} +1 -1
- package/dist/client/assets/{CheckDone01-UItWway5.js → CheckDone01-BYS-dKbQ.js} +1 -1
- package/dist/client/assets/{CheckVerified02-BZT8NFTV.js → CheckVerified02-C_5D8neO.js} +1 -1
- package/dist/client/assets/{ChevronDown-8cy6XkOd.js → ChevronDown-C7zTxlHE.js} +1 -1
- package/dist/client/assets/{ChevronLeft-g90Lk9ZP.js → ChevronLeft-Ov3NE9c_.js} +1 -1
- package/dist/client/assets/{ChevronRight-8tDNJAG7.js → ChevronRight-BJe7e-X2.js} +1 -1
- package/dist/client/assets/{Clock-BQoQDnoA.js → Clock--mEiDXe5.js} +1 -1
- package/dist/client/assets/{Code01-C_VEEcp2.js → Code01-BOUu51ck.js} +1 -1
- package/dist/client/assets/{Container-igCCXvhO.js → Container-BXYdiT-J.js} +1 -1
- package/dist/client/assets/{Copy01-Pa-P0L7C.js → Copy01-xLxETA4z.js} +1 -1
- package/dist/client/assets/{Dataflow03-VlfFjdvo.js → Dataflow03-FtQ0Yhj_.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-BILH5uwx.js → DotsHorizontal-Dprv0d9t.js} +1 -1
- package/dist/client/assets/{DotsVertical-B-wv0K8u.js → DotsVertical-C9TpfjSq.js} +1 -1
- package/dist/client/assets/{Download01-LtY2abFq.js → Download01-TaBKKGTy.js} +1 -1
- package/dist/client/assets/{Edit01-B96HyQXV.js → Edit01-BE5Wu5ID.js} +1 -1
- package/dist/client/assets/{Edit05-Nkz-QL3z.js → Edit05-CHAqfRrN.js} +1 -1
- package/dist/client/assets/{Eye-CqyYyTKI.js → Eye-CmzbjCht.js} +1 -1
- package/dist/client/assets/{File02-D-IbMoKJ.js → File02-DDGW2KdF.js} +1 -1
- package/dist/client/assets/{File06-BFTMvhui.js → File06-u0e892jj.js} +1 -1
- package/dist/client/assets/{FilterLines-BKuy0pMT.js → FilterLines-peoUm3Kp.js} +1 -1
- package/dist/client/assets/{Globe01-Y_gRY_HA.js → Globe01-CttWHoLh.js} +1 -1
- package/dist/client/assets/{Globe02-BmK2JLQA.js → Globe02-BaK8gLi7.js} +1 -1
- package/dist/client/assets/{Grid01-nC8Fdd9w.js → Grid01-MfVmgqVA.js} +1 -1
- package/dist/client/assets/{Hash02-OX-r0wXI.js → Hash02-BBdDXKgB.js} +1 -1
- package/dist/client/assets/{Home02-DkZxOvak.js → Home02-CD_MJrmZ.js} +1 -1
- package/dist/client/assets/{Image01-CCZkEaZM.js → Image01-NW_uhHHO.js} +1 -1
- package/dist/client/assets/{Inbox01-DSFtkgAO.js → Inbox01-DUegC4zX.js} +1 -1
- package/dist/client/assets/{InfoCircle-DA7iCnE9.js → InfoCircle-BdKgGvOW.js} +1 -1
- package/dist/client/assets/{Key01-CYEZvG6e.js → Key01-VhvVpwde.js} +1 -1
- package/dist/client/assets/{LayersTwo01-CtcJIiUZ.js → LayersTwo01-DY3gWhYo.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BWa3Wfm2.js → LayoutLeft-CTT2u70-.js} +1 -1
- package/dist/client/assets/{Link01-Qvv7xuyC.js → Link01-Bm8fkbw8.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DQ8eK-pR.js → LinkExternal01-D38J8WFf.js} +1 -1
- package/dist/client/assets/{List-C0IbtEtM.js → List-DBox7Fud.js} +1 -1
- package/dist/client/assets/{Loading01-BvQbUC-D.js → Loading01-DoI38kJv.js} +1 -1
- package/dist/client/assets/{Lock01-C5jlMhAD.js → Lock01-BpzLUKPy.js} +1 -1
- package/dist/client/assets/{Play-U0CUpoWA.js → Play-Cff6s-Do.js} +1 -1
- package/dist/client/assets/{Plus-Cahpiu8K.js → Plus-vjPXrbll.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CohvUS5J.js → RefreshCcw01-C1dtrtd7.js} +1 -1
- package/dist/client/assets/{Save01-BFSXvRKL.js → Save01-DrnHDSfN.js} +1 -1
- package/dist/client/assets/{SearchMd-B1el60PN.js → SearchMd-BpeHWO8y.js} +1 -1
- package/dist/client/assets/{Settings01-DTh7d1TA.js → Settings01-C_OWZaLW.js} +1 -1
- package/dist/client/assets/{Shield01-Dbls-R7l.js → Shield01-Blnh5_zF.js} +1 -1
- package/dist/client/assets/{Terminal-Dtw7-P-T.js → Terminal-CUOLHPPn.js} +1 -1
- package/dist/client/assets/{Trash01-CYVl4fPi.js → Trash01-Bfnjcg6w.js} +1 -1
- package/dist/client/assets/{Upload01-ChP3rU7N.js → Upload01-DA4ZJJnb.js} +1 -1
- package/dist/client/assets/{Users03-ErbkKtzn.js → Users03-CiI7Y2pI.js} +1 -1
- package/dist/client/assets/{X-BS3d1dQI.js → X-LrH2dki2.js} +1 -1
- package/dist/client/assets/{XCircle-SfgqsQJc.js → XCircle-KlbMEvQq.js} +1 -1
- package/dist/client/assets/{XClose-CHwnFCHF.js → XClose-T4dQr9IP.js} +1 -1
- package/dist/client/assets/{Zap-DcDIQrwF.js → Zap-Cx7CJpzQ.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-Brt5SwVS.js → agent-connections-preview-99IZ2JVi.js} +1 -1
- package/dist/client/assets/{agent-detail-IEUKQyJn.js → agent-detail-CQafIKIf.js} +1 -1
- package/dist/client/assets/{agents-CI7MrMpS.js → agents-BBhRTRP7.js} +1 -1
- package/dist/client/assets/{alert-dialog-Bl8Z5ME9.js → alert-dialog-ZI_d17Kf.js} +1 -1
- package/dist/client/assets/{auth-catchall-D2lg6Ga4.js → auth-catchall-B_kUtzsk.js} +1 -1
- package/dist/client/assets/{avatar-BizgkBxr.js → avatar-DMHAVN2G.js} +1 -1
- package/dist/client/assets/{badge-CqSX9-VD.js → badge-ChDtoe7k.js} +1 -1
- package/dist/client/assets/{binder-B0ooV_U0.js → binder-BSp18fmP.js} +1 -1
- package/dist/client/assets/{breadcrumb-BQwLjakU.js → breadcrumb-DBcowLTl.js} +1 -1
- package/dist/client/assets/{card-DzKiXrtG.js → card-ChLHZaFH.js} +1 -1
- package/dist/client/assets/{chart-DPQvJkgI.js → chart-DOQ1KDh7.js} +1 -1
- package/dist/client/assets/{checkbox-BfLxbLOs.js → checkbox-D_aK0Mdh.js} +1 -1
- package/dist/client/assets/{circle-alert-CzFLBGX3.js → circle-alert-BHkFRl9i.js} +1 -1
- package/dist/client/assets/{collapsible-BwblCQp-.js → collapsible-CtdNMvGE.js} +1 -1
- package/dist/client/assets/{collection-detail-C8D5flxf.js → collection-detail-CmmN6I8A.js} +1 -1
- package/dist/client/assets/{collection-display-button-Dpdj3_Kd.js → collection-display-button-Bv7DhR9w.js} +1 -1
- package/dist/client/assets/{collection-search-DjyDFcJX.js → collection-search-DnArRJMW.js} +1 -1
- package/dist/client/assets/{collection-tab-b2ar6f-s.js → collection-tab-CC0q_OnK.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Bk9rNXSl.js → collection-table-wrapper-CEwU2e2W.js} +1 -1
- package/dist/client/assets/{collection-tabs-DINx_Dem.js → collection-tabs-CZLvOfkH.js} +1 -1
- package/dist/client/assets/{command-CnJrfz-F.js → command-DLB128Pb.js} +1 -1
- package/dist/client/assets/{connect-842NIgiv.js → connect-CI9IzyBL.js} +1 -1
- package/dist/client/assets/{connection-card-BP1lyOj1.js → connection-card-ByscPAIj.js} +1 -1
- package/dist/client/assets/{connection-detail-DlhanTol.js → connection-detail-uL7h2miw.js} +1 -1
- package/dist/client/assets/{connection-status-Dw1_Aq5d.js → connection-status-BLpLQzSg.js} +1 -1
- package/dist/client/assets/{connections-DGyKBF5l.js → connections-DMFM3gUy.js} +1 -1
- package/dist/client/assets/constants-CUyJcaN8.js +1 -0
- package/dist/client/assets/{constants-CiKZrpx7.js → constants-OpiJAgZI.js} +1 -1
- package/dist/client/assets/{context-D32WEMEl.js → context-7Kd5bp6X.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-a_u2HCZJ.js → create-organization-dialog-BneQWVKs.js} +1 -1
- package/dist/client/assets/{create-project-dialog-CEyTOfaU.js → create-project-dialog-DcUDVcZj.js} +1 -1
- package/dist/client/assets/{danger-BontCBau.js → danger-DbvicEY-.js} +1 -1
- package/dist/client/assets/{danger-zone-BDGMYylu.js → danger-zone-CsqhCbO1.js} +1 -1
- package/dist/client/assets/{decopilot-events-riwKn0Cy.js → decopilot-events-BAhRgxLp.js} +1 -1
- package/dist/client/assets/{dependencies-Dx5KgKxi.js → dependencies-Ds_GH7yM.js} +1 -1
- package/dist/client/assets/{dialog-vZm4ZHy_.js → dialog-DXMtLbOt.js} +1 -1
- package/dist/client/assets/{dropdown-menu-uOw33kfx.js → dropdown-menu-Bv41z45k.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BiHBJvyd.js → dynamic-plugin-layout-CA3PBJG1.js} +1 -1
- package/dist/client/assets/{editable-task-title-DG2qXmIe.js → editable-task-title-BUHTazHh.js} +1 -1
- package/dist/client/assets/{empty-state-D-KbEoeX.js → empty-state-D2gP2QeK.js} +1 -1
- package/dist/client/assets/{env-vars-editor-Dsl2nBdu.js → env-vars-editor-DXU1-vnq.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DADo4b3P.js → extract-connection-data-CYsp_UMA.js} +1 -1
- package/dist/client/assets/{file-browser-BY2M-aGv.js → file-browser-DkGVcDoL.js} +2 -2
- package/dist/client/assets/{form-DRRR2oBO.js → form-Ndm9rRCe.js} +1 -1
- package/dist/client/assets/{general-BgMt0Xtr.js → general-opBI2uJ9.js} +1 -1
- package/dist/client/assets/{grid-view-PFuVfxv4.js → grid-view-CSu6RixN.js} +1 -1
- package/dist/client/assets/{home-6lTOXpGe.js → home-B8vvircu.js} +1 -1
- package/dist/client/assets/{icon-picker-De-0zDIV.js → icon-picker-8kNIyP1o.js} +1 -1
- package/dist/client/assets/{index-iJuK7s2o.js → index-BUZqKnhc.js} +1 -1
- package/dist/client/assets/{index-CiwF5gec.js → index-C_qyq-0C.js} +1 -1
- package/dist/client/assets/{index-ByBehQq8.js → index-CzhqcVNy.js} +3 -3
- package/dist/client/assets/{index-H-p5_nlX.js → index-D0IWyB7F.js} +1 -1
- package/dist/client/assets/{index-DzwDfqSP.js → index-Dq7847Un.js} +1 -1
- package/dist/client/assets/{index-BuE1jlad.js → index-DvM0KkHv.js} +1 -1
- package/dist/client/assets/{index-BmVy71Qs.js → index-NVV58uyB.js} +1 -1
- package/dist/client/assets/{index-zDtV40hA.js → index-reo4wb4o.js} +1 -1
- package/dist/client/assets/{index-D0IcASE6.js → index-u3QgiiTa.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DMHwDrGb.js → infiniteQueryObserver-B0sfe0Pc.js} +1 -1
- package/dist/client/assets/{input-DJFookpn.js → input-CaHgq6JC.js} +1 -1
- package/dist/client/assets/{integration-icon-BZi-YVqN.js → integration-icon-C_O5yvdg.js} +1 -1
- package/dist/client/assets/{label-8pbvl6D7.js → label-ZRpbI7Sm.js} +1 -1
- package/dist/client/assets/{layout-B650-MdM.js → layout-Di7S7mGF.js} +1 -1
- package/dist/client/assets/{layout-ClqmwuBv.js → layout-_gy6ZrEk.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BYBTeqOO.js → localstorage-keys-CL6qU9e5.js} +1 -1
- package/dist/client/assets/{login-KXkDnXxt.js → login-DzHv8Qa0.js} +1 -1
- package/dist/client/assets/{markdown-Cl_4hSqg.js → markdown-CjmEcbPS.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BZo2fAGK.js → mcp-app-renderer-DjshzOV0.js} +1 -1
- package/dist/client/assets/{mcp-server-card-DRY1awIa.js → mcp-server-card-CbhtCiCR.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-BcBcyub9.js → mcp-server-detail-Dm6C4rJd.js} +2 -2
- package/dist/client/assets/{members-DdpC28_r.js → members-D0WpzrAD.js} +1 -1
- package/dist/client/assets/{monaco-editor-BkS5oVKh.js → monaco-editor-860lh9IG.js} +1 -1
- package/dist/client/assets/{monitoring-e_os3mC_.js → monitoring-B8ASHaBh.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-B-oy8nop.js → monitoring-dashboard-edit-CKffDTQw.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-DNKWClCv.js → monitoring-dashboard-view-C1XkuilW.js} +1 -1
- package/dist/client/assets/{oauth-callback-6sLRQ2EH.js → oauth-callback-CsPyZ3bv.js} +1 -1
- package/dist/client/assets/{page-kVJskZtx.js → page-BGclLydc.js} +1 -1
- package/dist/client/assets/{page-DIsisfQ_.js → page-BWVa1qSI.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CH0FG8vy.js → plugin-empty-state-BXMB-ve6.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Dff8RUjZ.js → plugin-empty-state-aV5T7nJZ.js} +1 -1
- package/dist/client/assets/{plugin-header-DGgQtkY-.js → plugin-header-CMg87EDN.js} +1 -1
- package/dist/client/assets/{plugin-header-Bxz81p4D.js → plugin-header-DorQWEZ4.js} +1 -1
- package/dist/client/assets/plugins-BYjlWQ4G.js +1 -0
- package/dist/client/assets/{popover-BHu5hFwi.js → popover-DMD8_Cbp.js} +1 -1
- package/dist/client/assets/{project-app-view-DzhwxCH3.js → project-app-view-BucEC3T-.js} +1 -1
- package/dist/client/assets/{project-layout-Cy3p3LGy.js → project-layout-DdxzQdxw.js} +1 -1
- package/dist/client/assets/{project-plugins-DVu2Z03c.js → project-plugins-FyEUKPb1.js} +1 -1
- package/dist/client/assets/{projects-list-CkOFXITq.js → projects-list-lWISZLY6.js} +1 -1
- package/dist/client/assets/{readme-viewer-BbXC8ge-.js → readme-viewer-BRyijqWE.js} +1 -1
- package/dist/client/assets/{registry-layout-VyAh4LU5.js → registry-layout-A5khdaYw.js} +1 -1
- package/dist/client/assets/{registry-utils-ClM_jy-D.js → registry-utils-sGbNqghw.js} +1 -1
- package/dist/client/assets/{reports-layout-BjIiUAJK.js → reports-layout-Ds-X2DgZ.js} +1 -1
- package/dist/client/assets/{reset-password-CUHPiD3J.js → reset-password-DUyo7dJf.js} +1 -1
- package/dist/client/assets/{resizable-CireiDFZ.js → resizable-DLaWW8z1.js} +1 -1
- package/dist/client/assets/{save-actions-Cstr6q7j.js → save-actions-KKLUna-U.js} +1 -1
- package/dist/client/assets/{scroll-area-CXyrNFH2.js → scroll-area-uvPGOSmX.js} +1 -1
- package/dist/client/assets/{select-SDo2KuVb.js → select-DhCocnGM.js} +1 -1
- package/dist/client/assets/{shell-layout-BAqdf7Bw.js → shell-layout-CUgayftW.js} +2 -2
- package/dist/client/assets/{sidebar-settings-xmMWBStR.js → sidebar-settings-DWw0y5k_.js} +1 -1
- package/dist/client/assets/{skeleton-YfsUNsWq.js → skeleton-LSt15V1C.js} +1 -1
- package/dist/client/assets/{spinner-Bcq9G-AR.js → spinner-CI9QBd79.js} +1 -1
- package/dist/client/assets/{store-invite-DIXnmdwY.js → store-invite-CFRAOscU.js} +1 -1
- package/dist/client/assets/{switch-jH6D-EYF.js → switch-CsOlnIJv.js} +1 -1
- package/dist/client/assets/{table-BoIBKfoi.js → table-xcvICYfC.js} +1 -1
- package/dist/client/assets/{tabs-Bn_7Q62G.js → tabs-d2vBhIp6.js} +1 -1
- package/dist/client/assets/tasks-CoQZ2sIy.js +1 -0
- package/dist/client/assets/{tasks-panel-D7c53J_C.js → tasks-panel-bZwhdQBY.js} +1 -1
- package/dist/client/assets/{textarea-s3LThTmQ.js → textarea-CqsgYI_z.js} +1 -1
- package/dist/client/assets/{time-range-picker-ns_uo6B4.js → time-range-picker-CnM7cuGo.js} +1 -1
- package/dist/client/assets/{toggle-group-D8Q8j5ug.js → toggle-group-BrCJ8OSl.js} +1 -1
- package/dist/client/assets/{tools-list-DZCpJBtl.js → tools-list-BJgQvAAh.js} +1 -1
- package/dist/client/assets/{tooltip-DJVjrs0B.js → tooltip-B-2Ty_iR.js} +1 -1
- package/dist/client/assets/{topbar-portal-RyxiHBcJ.js → topbar-portal-CVzUAi-D.js} +1 -1
- package/dist/client/assets/{types-CttSg_yl.js → types-DiJR_Oxi.js} +1 -1
- package/dist/client/assets/{use-binding-DNTCQM-0.js → use-binding-CHcWA4CU.js} +1 -1
- package/dist/client/assets/{use-collections-CkDBe2b5.js → use-collections-C8v6HwyA.js} +1 -1
- package/dist/client/assets/{use-connection-BZKW6cNa.js → use-connection-CkLGBugg.js} +1 -1
- package/dist/client/assets/{use-copy-CX8ldx7x.js → use-copy-BNKFNH2y.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-7IQNp7XP.js → use-create-virtual-mcp-BvTxfE8g.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-DGxjfR6s.js → use-install-from-registry-rEwcMxvA.js} +1 -1
- package/dist/client/assets/{use-list-state-D4xDKJVR.js → use-list-state-Dt9uCsOl.js} +1 -1
- package/dist/client/assets/{use-llm-mYdxCcaw.js → use-llm-CfPWCeJ7.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CK-1hYME.js → use-mcp-prompts-DJolbe2G.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Bv1CjV0B.js → use-mcp-tools-_SrEx2Yc.js} +1 -1
- package/dist/client/assets/{use-members-D3CehEJT.js → use-members-Bg7suFno.js} +1 -1
- package/dist/client/assets/{use-mobile-BEamr_L6.js → use-mobile-Ccj9Yl8E.js} +1 -1
- package/dist/client/assets/{use-preferences-GEV73xZ1.js → use-preferences-CBTWTfUK.js} +1 -1
- package/dist/client/assets/{use-project--hs_mPl9.js → use-project-O2tBNyfQ.js} +1 -1
- package/dist/client/assets/{use-settings-modal-BqZsMg2S.js → use-settings-modal-Cb5fjZOk.js} +1 -1
- package/dist/client/assets/{use-view-mode-DPPsF32d.js → use-view-mode-DltmabmA.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-EvnuRGOB.js → use-virtual-mcp-CelTUOdD.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-7fuF9QDV.js +1 -0
- package/dist/client/assets/{useMutation-Dp5LP-l4.js → useMutation-BLMqKfMt.js} +1 -1
- package/dist/client/assets/useQuery-BtUsJRrm.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BB0K0DXv.js +1 -0
- package/dist/client/assets/{user-Cr2B680R.js → user-BIDniHYV.js} +1 -1
- package/dist/client/assets/{workflow-BgYYtYhC.js → workflow-BPBBOx7S.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/migrate.js +1 -1
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/constants-wHvojaTv.js +0 -1
- package/dist/client/assets/plugins-Cva78D6I.js +0 -1
- package/dist/client/assets/tasks-DBpnkDPZ.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DzZdlt4R.js +0 -1
- package/dist/client/assets/useQuery-DHmqN3W7.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DdErlQq9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,j as s,r as S,ar as y}from"./index-
|
|
1
|
+
import{c as w,j as s,r as S,ar as y}from"./index-CzhqcVNy.js";import{i as _}from"./Check-D30Nw_2C.js";import{t as k}from"./ChevronDown-C7zTxlHE.js";function E(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(k,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as r,j as i}from"./index-CzhqcVNy.js";import{P as m}from"./project-plugins-FyEUKPb1.js";import"./useQuery-BtUsJRrm.js";import"./useMutation-BLMqKfMt.js";import"./constants-OpiJAgZI.js";import"./switch-CsOlnIJv.js";import"./label-ZRpbI7Sm.js";import"./Container-BXYdiT-J.js";import"./use-connection-CkLGBugg.js";import"./use-collections-C8v6HwyA.js";import"./use-binding-CHcWA4CU.js";import"./binder-BSp18fmP.js";import"./use-install-from-registry-rEwcMxvA.js";import"./extract-connection-data-CYsp_UMA.js";import"./constants-CUyJcaN8.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-sGbNqghw.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-DoI38kJv.js";import"./Plus-vjPXrbll.js";import"./select-DhCocnGM.js";import"./index-Dq7847Un.js";import"./Check-D30Nw_2C.js";import"./ChevronDown-C7zTxlHE.js";function v(){const o=r.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(m,{}),o[0]=t):t=o[0],t}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,R as $,j as c,a_ as z,av as L,W as A,U as b,Y as g,aY as _,$ as j,aZ as G,a$ as w,b4 as H,b5 as K,a0 as U,b6 as W,b7 as Y,b8 as Z,b0 as V,b1 as q,b3 as B,c as R,z as J}from"./index-
|
|
1
|
+
import{r as i,R as $,j as c,a_ as z,av as L,W as A,U as b,Y as g,aY as _,$ as j,aZ as G,a$ as w,b4 as H,b5 as K,a0 as U,b6 as W,b7 as Y,b8 as Z,b0 as V,b1 as q,b3 as B,c as R,z as J}from"./index-CzhqcVNy.js";var C="Popover",[E]=U(C,[w]),P=w(),[Q,d]=E(C),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:C});return c.jsx(z,{...p,children:c.jsx(Q,{scope:e,contentId:L(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(m=>!m),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=C;var F="PopoverAnchor",X=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(_,{...s,...r,ref:e})});X.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),s=P(o),a=A(e,n.triggerRef),p=c.jsx(b.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(_,{asChild:!0,...s,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=E(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||s.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=d(v,t.__scopePopover);return c.jsx(j,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=W("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return H(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(T,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),T=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),m=P(o);return Y(),c.jsx(Z,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(V,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(q,{"data-state":I(f.open),role:"dialog",id:f.contentId,...m,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(k,o);return c.jsx(b.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=k;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(B,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=y,le=D,ue=M;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{ge as P,fe as a,ve as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as P,g as A,j as l,E as y,r as R,u as T}from"./index-
|
|
1
|
+
import{c as P,g as A,j as l,E as y,r as R,u as T}from"./index-CzhqcVNy.js";import{u as v}from"./use-connection-CkLGBugg.js";import{u as S}from"./constants-OpiJAgZI.js";import{u as U}from"./use-mcp-tools-_SrEx2Yc.js";import{c as E,M as H}from"./mcp-app-renderer-DjshzOV0.js";import{g as O,M as $}from"./types-DiJR_Oxi.js";import{u as w}from"./context-7Kd5bp6X.js";import{P as _,u as D}from"./index-DvM0KkHv.js";import"./use-collections-C8v6HwyA.js";import"./useMutation-BLMqKfMt.js";import"./useQuery-BtUsJRrm.js";import"./decopilot-events-BAhRgxLp.js";import"./use-virtual-mcp-CelTUOdD.js";import"./use-llm-CfPWCeJ7.js";import"./use-binding-CHcWA4CU.js";import"./binder-BSp18fmP.js";import"./localstorage-keys-CL6qU9e5.js";import"./use-preferences-CBTWTfUK.js";import"./checkbox-D_aK0Mdh.js";import"./Check-D30Nw_2C.js";import"./input-CaHgq6JC.js";import"./dialog-DXMtLbOt.js";import"./X-LrH2dki2.js";import"./select-DhCocnGM.js";import"./index-Dq7847Un.js";import"./ChevronDown-C7zTxlHE.js";import"./skeleton-LSt15V1C.js";import"./AlignLeft-DGT5YesK.js";import"./ArrowLeft-ZgtBxTyN.js";import"./Image01-NW_uhHHO.js";import"./RefreshCcw01-C1dtrtd7.js";import"./SearchMd-BpeHWO8y.js";import"./Settings01-C_OWZaLW.js";import"./useSuspenseInfiniteQuery-BB0K0DXv.js";import"./infiniteQueryObserver-B0sfe0Pc.js";import"./tooltip-B-2Ty_iR.js";const b={};function k(t){const e=P.c(22),{client:o,resourceURI:a,tool:c,connectionId:p}=t,{sendMessage:m,setAppContext:i,clearAppContext:n}=w(),[,f]=D(),r=`${p}:${c.name}`;let d;e[0]!==o||e[1]!==c.name?(d={client:o,toolName:c.name,toolArguments:b},e[0]=o,e[1]=c.name,e[2]=d):d=e[2];const{data:u}=U(d);let s;e[3]!==m||e[4]!==f?(s=I=>{const M=E(I.content);M.content.length>0&&(f(!0),m(M))},e[3]=m,e[4]=f,e[5]=s):s=e[5];const g=s,N=c;let x;e[6]!==N?(x={tool:N},e[6]=N,e[7]=x):x=e[7];let h;e[8]!==i||e[9]!==r?(h=I=>i(r,I),e[8]=i,e[9]=r,e[10]=h):h=e[10];let j;e[11]!==n||e[12]!==r?(j=()=>n(r),e[11]=n,e[12]=r,e[13]=j):j=e[13];let C;return e[14]!==o||e[15]!==g||e[16]!==a||e[17]!==x||e[18]!==h||e[19]!==j||e[20]!==u?(C=l.jsx(H,{resourceURI:a,toolInfo:x,toolInput:b,toolResult:u,displayMode:"fullscreen",minHeight:$.fullscreen.minHeight,maxHeight:$.fullscreen.maxHeight,client:o,onMessage:g,onUpdateModelContext:h,onTeardown:j,className:"h-full"}),e[14]=o,e[15]=g,e[16]=a,e[17]=x,e[18]=h,e[19]=j,e[20]=u,e[21]=C):C=e[21],C}function L(t){const e=P.c(17),{connectionId:o,toolName:a}=t,{org:c}=T();let p;e[0]!==o||e[1]!==c.id?(p={connectionId:o,orgId:c.id},e[0]=o,e[1]=c.id,e[2]=p):p=e[2];const m=S(p),i=v(o),n=decodeURIComponent(a);let f,r;if(e[3]!==i?.tools||e[4]!==n){let s;e[7]!==n?(s=g=>g.name===n,e[7]=n,e[8]=s):s=e[8],r=(i?.tools??[]).find(s),f=r?._meta?O(r._meta):void 0,e[3]=i?.tools,e[4]=n,e[5]=f,e[6]=r}else f=e[5],r=e[6];const d=f;if(!i){let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found"})}),e[9]=s):s=e[9],s}if(!r||!d){let s;return e[10]!==n?(s=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',n,'" not found or has no UI']})}),e[10]=n,e[11]=s):s=e[11],s}let u;return e[12]!==m||e[13]!==o||e[14]!==d||e[15]!==r?(u=l.jsx(k,{client:m,resourceURI:d,tool:r,connectionId:o}),e[12]=m,e[13]=o,e[14]=d,e[15]=r,e[16]=u):u=e[16],u}function Pe(){const t=P.c(9);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/apps/$connectionId/$toolName"},t[0]=e):e=t[0];const{connectionId:o,toolName:a}=A(e);let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(_.Header,{}),t[1]=c):c=t[1];const p=`${o}:${a}`;let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),l.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),t[2]=m):m=t[2];let i;t[3]!==o||t[4]!==a?(i=l.jsx(R.Suspense,{fallback:m,children:l.jsx(L,{connectionId:o,toolName:a})}),t[3]=o,t[4]=a,t[5]=i):i=t[5];let n;return t[6]!==p||t[7]!==i?(n=l.jsxs(_,{children:[c,l.jsx(_.Content,{className:"overflow-hidden",children:l.jsx(y,{fallback:void 0,children:i},p)})]}),t[6]=p,t[7]=i,t[8]=n):n=t[8],n}export{Pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,c as E,f as st,j as s,z as ue,x as Pe,o as us,n as Be,e as at,u as me,w as _t,t as ms,q as fs,K as mt,B as ce,c7 as Pt,O as Ee,P as It,S as Je,g as xs,au as ps}from"./index-ByBehQq8.js";import{u as Et}from"./use-project--hs_mPl9.js";import{c as hs,d as gs,b as vs,a as Ot,D as Dt}from"./dialog-vZm4ZHy_.js";import{i as Lt}from"./X-BS3d1dQI.js";import{S as ne}from"./skeleton-YfsUNsWq.js";import{t as ys,i as rt,u as bs}from"./use-settings-modal-BqZsMg2S.js";import{A as Tt}from"./avatar-BizgkBxr.js";import{t as js}from"./Settings01-DTh7d1TA.js";import{i as Ns}from"./Zap-DcDIQrwF.js";import{a as Ss,b as ws,c as Cs,T as ks}from"./tooltip-DJVjrs0B.js";import{i as As}from"./Check-BdWYqlDo.js";import{a as _s}from"./Copy01-Pa-P0L7C.js";import{S as Ze}from"./switch-jH6D-EYF.js";import{S as Ps,a as Is,d as Ge,c as Es}from"./select-SDo2KuVb.js";import{i as Os}from"./Code01-C_VEEcp2.js";import{i as Ds}from"./Shield01-Dbls-R7l.js";import{u as Ls}from"./use-preferences-GEV73xZ1.js";import{u as Ts}from"./useMutation-Dp5LP-l4.js";import{a as zs,F as Re,b as We,c as Fe,d as Ue,f as Ke,e as $s}from"./form-DRRR2oBO.js";import{I as Ie}from"./input-DJFookpn.js";import{i as Ms}from"./Upload01-ChP3rU7N.js";import{P as Bs}from"./project-plugins-DVu2Z03c.js";import{u as Gs,a as Rs,b as Ws,i as ie,r as lt,D as zt,c as $e,d as fe,s as ft,e as xt,Z as $t,g as Mt,f as Bt,h as Gt,j as Ae,k as nt,l as Me,m as it,n as Fs,o as Us,p as Rt,q as ot,t as ct,v as Wt,w as Ks,x as Ft,y as pt,z as Vs,A as Ys,B as Hs,R as qs,S as Qs,C as Xs,E as Js,F as Ut,G as Zs,H as ea,I as ta,J as sa,K as aa,L as ra,M as la,N as na,O as De,P as ia,Q as ht,T as gt,U as vt,V as oa,W as Kt,X as ca,Y as Ne,_ as da,$ as ua,a0 as ma,a1 as fa,a2 as xa,a3 as Ve,a4 as pa,a5 as Le,a6 as ha,a7 as J,a8 as Vt,a9 as ga,aa as va,ab as ya,ac as ba,ad as ja,ae as Na,af as Sa,ag as wa,ah as Ca,ai as ka,aj as Aa,ak as _a,al as Pa,am as Ia,an as Ea,ao as Oa,ap as Da,aq as La}from"./chart-DPQvJkgI.js";import{L as _e}from"./label-8pbvl6D7.js";import{B as Ta}from"./badge-CqSX9-VD.js";import{a as za,T as Ye,b as He,c as $a}from"./tabs-Bn_7Q62G.js";import{i as Ma}from"./AlertCircle-DYlknn87.js";import{s as Yt}from"./Plus-Cahpiu8K.js";import{s as Ba}from"./RefreshCcw01-CohvUS5J.js";import{u as ke,a as dt,K as Ga}from"./constants-CiKZrpx7.js";import{b as Ra}from"./use-connection-BZKW6cNa.js";import{b as oe,a as Ht}from"./use-mcp-tools-Bv1CjV0B.js";import{u as Wa}from"./use-members-D3CehEJT.js";import{c as Fa,A as Ua}from"./use-binding-DNTCQM-0.js";import"./useQuery-DHmqN3W7.js";import"./index-DzwDfqSP.js";import"./ChevronDown-8cy6XkOd.js";import"./localstorage-keys-BYBTeqOO.js";import"./Container-igCCXvhO.js";import"./use-install-from-registry-DGxjfR6s.js";import"./extract-connection-data-DADo4b3P.js";import"./constants-wHvojaTv.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-ClM_jy-D.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-BvQbUC-D.js";import"./index-iJuK7s2o.js";import"./use-collections-CkDBe2b5.js";import"./binder-B0ooV_U0.js";const qt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));qt.displayName="Bell01";function Ka(t){const e=E.c(25),{activeSection:r,onNavigate:a}=t,{data:l}=st.useSession(),n=l?.user,i=n?.image,o=n?.name??"Profile",d=n?.name??"U";let m;e[0]!==d||e[1]!==i?(m=s.jsx(Tt,{url:i,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=i,e[2]=m):m=e[2];let c;e[3]!==o||e[4]!==m?(c={key:"account.profile",label:o,icon:m},e[3]=o,e[4]=m,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={key:"account.preferences",label:"Preferences",icon:s.jsx(js,{size:14})},e[6]=u):u=e[6];let f;e[7]!==c?(f=[c,u],e[7]=c,e[8]=f):f=e[8];const x=f;let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.general",label:"General",icon:s.jsx(ys,{size:14})},e[9]=p):p=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h={key:"org.plugins",label:"Features",icon:s.jsx(Ns,{size:14})},e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=[p,h,{key:"org.billing",label:"Billing",icon:s.jsx(rt,{size:14})}],e[11]=g):g=e[11];const y=g;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[12]=S):S=e[12];let j;e[13]!==x||e[14]!==r||e[15]!==a?(j=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[S,x.map(C=>s.jsxs("button",{type:"button",onClick:()=>a(C.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===C.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:C.icon}),s.jsx("span",{className:"truncate",children:C.label})]},C.key))]}),e[13]=x,e[14]=r,e[15]=a,e[16]=j):j=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[17]=b):b=e[17];let N;e[18]!==r||e[19]!==a?(N=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[b,y.map(C=>s.jsxs("button",{type:"button",onClick:()=>a(C.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===C.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:C.icon}),s.jsx("span",{className:"truncate",children:C.label})]},C.key))]}),e[18]=r,e[19]=a,e[20]=N):N=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.162.0"]})}),e[21]=w):w=e[21];let k;return e[22]!==j||e[23]!==N?(k=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[j,N,w]}),e[22]=j,e[23]=N,e[24]=k):k=e[24],k}function Va(){const t=E.c(32),{data:e}=st.useSession(),[r,a]=v.useState(!1),l=e?.user,n=l?.image;let i;t[0]!==l?(i=()=>{l?.id&&navigator.clipboard.writeText(l.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=l,t[1]=i):i=t[1];const o=i;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const m=l?.name??"U";let c;t[3]!==m||t[4]!==n?(c=s.jsx(Tt,{url:n,fallback:m,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=m,t[4]=n,t[5]=c):c=t[5];const u=l?.name??"User";let f;t[6]!==u?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:u}),t[6]=u,t[7]=f):f=t[7];const x=l?.email;let p;t[8]!==x?(p=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),t[8]=x,t[9]=p):p=t[9];let h;t[10]!==f||t[11]!==p?(h=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,p]}),t[10]=f,t[11]=p,t[12]=h):h=t[12];let g;t[13]!==c||t[14]!==h?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,h]}),t[13]=c,t[14]=h,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=S):S=t[17];const j=l?.id;let b;t[18]!==j?(b=s.jsx("span",{className:"font-mono text-sm",children:j}),t[18]=j,t[19]=b):b=t[19];let N;t[20]!==r?(N=r?s.jsx(As,{size:14,className:"text-green-600 shrink-0"}):s.jsx(_s,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=N):N=t[21];let w;t[22]!==o||t[23]!==b||t[24]!==N?(w=s.jsx(Ss,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,N]})}),t[22]=o,t[23]=b,t[24]=N,t[25]=w):w=t[25];let k;t[26]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ws,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=k):k=t[26];let C;t[27]!==w?(C=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[S,s.jsx(Cs,{children:s.jsxs(ks,{children:[w,k]})})]})]}),t[27]=w,t[28]=C):C=t[28];let A;return t[29]!==C||t[30]!==g?(A=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,C]}),t[29]=C,t[30]=g,t[31]=A):A=t[31],A}function qe(t){const e=E.c(27),{icon:r,label:a,description:l,control:n,onClick:i,disabled:o}=t,d=o?void 0:i,m=i?"button":void 0,c=i&&!o?0:void 0;let u;e[0]!==o||e[1]!==i?(u=i&&!o?N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),i())}:void 0,e[0]=o,e[1]=i,e[2]=u):u=e[2];const f=i&&!o?"pointer":void 0;let x;e[3]!==f?(x={cursor:f},e[3]=f,e[4]=x):x=e[4];let p;e[5]!==r?(p=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=p):p=e[6];let h;e[7]!==a?(h=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=h):h=e[8];let g;e[9]!==l?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[9]=l,e[10]=g):g=e[10];let y;e[11]!==h||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[h,g]}),e[11]=h,e[12]=g,e[13]=y):y=e[13];let S;e[14]!==y||e[15]!==p?(S=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[p,y]}),e[14]=y,e[15]=p,e[16]=S):S=e[16];let j;e[17]!==n?(j=s.jsx("div",{onClick:Ya,className:"shrink-0",children:n}),e[17]=n,e[18]=j):j=e[18];let b;return e[19]!==d||e[20]!==S||e[21]!==j||e[22]!==m||e[23]!==c||e[24]!==u||e[25]!==x?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:m,tabIndex:c,onKeyDown:u,style:x,children:[S,j]}),e[19]=d,e[20]=S,e[21]=j,e[22]=m,e[23]=c,e[24]=u,e[25]=x,e[26]=b):b=e[26],b}function Ya(t){return t.stopPropagation()}function yt(){const t=E.c(35),[e,r]=Ls();let a;t[0]!==r?(a=async k=>{if(k&&await Notification.requestPermission()!=="granted"){Pe.error("Notifications denied. Please enable them in your browser settings."),r(qa);return}r(C=>({...C,enableNotifications:k}))},t[0]=r,t[1]=a):a=t[1];const l=a;let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=n):n=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Os,{size:16}),t[3]=i):i=t[3];let o;t[4]!==r?(o=()=>r(Ha),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=k=>r(C=>({...C,devMode:k})),t[6]=r,t[7]=d):d=t[7];let m;t[8]!==e.devMode||t[9]!==d?(m=s.jsx(Ze,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=m):m=t[10];let c;t[11]!==o||t[12]!==m?(c=s.jsx(qe,{icon:i,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:m}),t[11]=o,t[12]=m,t[13]=c):c=t[13];let u;t[14]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(qt,{size:16}),t[14]=u):u=t[14];let f;t[15]!==l||t[16]!==e.enableNotifications?(f=s.jsx(qe,{icon:u,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>l(!e.enableNotifications),control:s.jsx(Ze,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:l})}),t[15]=l,t[16]=e.enableNotifications,t[17]=f):f=t[17];let x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ds,{size:16}),t[18]=x):x=t[18];let p;t[19]!==r?(p=k=>r(C=>({...C,toolApprovalLevel:k})),t[19]=r,t[20]=p):p=t[20];let h;t[21]===Symbol.for("react.memo_cache_sentinel")?(h={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[21]=h):h=t[21];const g=h[e.toolApprovalLevel];let y;t[22]!==g?(y=s.jsx(Is,{className:"w-36",children:s.jsx("span",{children:g})}),t[22]=g,t[23]=y):y=t[23];let S;t[24]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ge,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=S):S=t[24];let j;t[25]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ge,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=j):j=t[25];let b;t[26]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs(Es,{children:[S,j,s.jsx(Ge,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=b):b=t[26];let N;t[27]!==e.toolApprovalLevel||t[28]!==p||t[29]!==y?(N=s.jsx(qe,{icon:x,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Ps,{value:e.toolApprovalLevel,onValueChange:p,children:[y,b]})}),t[27]=e.toolApprovalLevel,t[28]=p,t[29]=y,t[30]=N):N=t[30];let w;return t[31]!==N||t[32]!==c||t[33]!==f?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[n,s.jsxs("div",{className:"flex flex-col",children:[c,f,N]})]}),t[31]=N,t[32]=c,t[33]=f,t[34]=w):w=t[34],w}function Ha(t){return{...t,devMode:!t.devMode}}function qa(t){return{...t,enableNotifications:!1}}const Qa=us({name:Be().min(1,"Name is required").max(255,"Name is too long"),slug:Be().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Be().optional()});function Xa(t){const e=E.c(24),{value:r,onChange:a,name:l}=t,n=v.useRef(null);let i;e[0]!==a?(i=b=>{const N=b.target.files?.[0];if(N){if(N.size>2097152){Pe.error("Image must be smaller than 2MB");return}const w=new FileReader;w.onerror=()=>{const k=w.error;console.error("FileReader error:",k),Pe.error(k?.message||"Failed to read image file. Please try again."),n.current&&(n.current.value="")},w.onloadend=()=>{if(w.readyState===FileReader.DONE&&w.result){const k=w.result;a(k)}},w.readAsDataURL(N)}},e[0]=a,e[1]=i):i=e[1];const o=i;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{n.current?.click()},e[2]=d):d=e[2];const m=d;let c;e[3]!==a?(c=b=>{b.stopPropagation(),a("")},e[3]=a,e[4]=c):c=e[4];const u=c;let f;e[5]!==o?(f=s.jsx("input",{type:"file",ref:n,className:"hidden",accept:"image/*",onChange:o}),e[5]=o,e[6]=f):f=e[6];let x;e[7]!==u||e[8]!==l||e[9]!==r?(x=r?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:r,alt:l||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:u,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Lt,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:m,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(Ms,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=u,e[8]=l,e[9]=r,e[10]=x):x=e[10];const p=r?"Change Logo":"Upload Logo";let h;e[11]!==p?(h=s.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:m,className:"mb-2",children:p}),e[11]=p,e[12]=h):h=e[12];let g;e[13]!==u||e[14]!==r?(g=r&&s.jsx(ce,{type:"button",variant:"ghost",size:"sm",onClick:u,className:"ml-2",children:"Remove"}),e[13]=u,e[14]=r,e[15]=g):g=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=y):y=e[16];let S;e[17]!==h||e[18]!==g?(S=s.jsxs("div",{className:"flex-1",children:[h,g,y]}),e[17]=h,e[18]=g,e[19]=S):S=e[19];let j;return e[20]!==S||e[21]!==f||e[22]!==x?(j=s.jsxs("div",{className:"flex items-start gap-4",children:[f,x,S]}),e[20]=S,e[21]=f,e[22]=x,e[23]=j):j=e[23],j}function Ja(){const t=at(),{org:e,project:r}=me(),a=_t(),[l,n]=v.useState(!1),i=ms({resolver:fs(Qa),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Ts({mutationFn:async c=>{const u={name:c.name,slug:c.slug};c.logo&&(u.logo=c.logo);const f=await st.organization.update({organizationId:e.id,data:u});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:mt.organizations()}),a.invalidateQueries({queryKey:mt.activeOrganization(e.slug)}),Pe.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Pe.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{n(!1)}}),d=c=>{n(!0),o.mutate(c)},m=i.formState.isDirty;return s.jsx(zs,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(d),className:"space-y-6",children:[s.jsx(Re,{control:i.control,name:"name",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Organization Name"}),s.jsx(Ue,{children:s.jsx(Ie,{placeholder:"My Organization",...c,disabled:l})}),s.jsx(Ke,{})]})}),s.jsx(Re,{control:i.control,name:"slug",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Organization Slug"}),s.jsx(Ue,{children:s.jsx(Ie,{placeholder:"my-organization",...c,disabled:l,onChange:u=>{const f=u.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx($s,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(Ke,{})]})}),s.jsx(Re,{control:i.control,name:"logo",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Logo"}),s.jsx(Ue,{children:s.jsx(Xa,{value:c.value,onChange:c.onChange,name:i.watch("name")})}),s.jsx(Ke,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(ce,{type:"submit",disabled:!m||l,className:"min-w-24",children:l?"Saving...":"Save Changes"}),m&&s.jsx(ce,{type:"button",variant:"outline",onClick:()=>i.reset(),disabled:l,children:"Cancel"})]})]})})}function Za(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(Ja,{})]}),t[0]=e):e=t[0],e}var bt=function(e,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),n=2;n<a;n++)l[n-2]=arguments[n];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;console.warn(r.replace(/%s/g,()=>l[i++]))}},er=["x1","y1","x2","y2","key"],tr=["offset"],sr=["xAxisId","yAxisId"],ar=["xAxisId","yAxisId"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(a){rr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function rr(t,e,r){return(e=lr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lr(t){var e=nr(t,"string");return typeof e=="symbol"?e:e+""}function nr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function Te(t,e){if(t==null)return{};var r,a,l=ir(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function ir(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var or=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:l,width:n,height:i,ry:o}=t;return v.createElement("rect",{x:a,y:l,ry:o,width:n,height:i,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Qt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var l,{x1:n,y1:i,x2:o,y2:d,key:m}=r,c=Te(r,er),u=(l=nt(c))!==null&&l!==void 0?l:{},{offset:f}=u,x=Te(u,tr);a=v.createElement("line",xe({},x,{x1:n,y1:i,x2:o,y2:d,fill:"none",key:m}))}return a}function cr(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:n,yAxisId:i}=t,o=Te(t,sr),d=l.map((m,c)=>{var u=Z(Z({},o),{},{x1:e,y1:m,x2:e+r,y2:m,key:"line-".concat(c),index:c});return v.createElement(Qt,{key:"line-".concat(c),option:a,lineItemProps:u})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function dr(t){var{y:e,height:r,vertical:a=!0,verticalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:n,yAxisId:i}=t,o=Te(t,ar),d=l.map((m,c)=>{var u=Z(Z({},o),{},{x1:m,y1:e,x2:m,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Qt,{option:a,lineItemProps:u,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function ur(t){var{horizontalFill:e,fillOpacity:r,x:a,y:l,width:n,height:i,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var m=o.map(u=>Math.round(u+l-l)).sort((u,f)=>u-f);l!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var x=m[f+1],p=x==null,h=p?l+i-u:x-u;if(h<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:u,x:a,height:h,width:n,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function mr(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:l,y:n,width:i,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var m=d.map(u=>Math.round(u+l-l)).sort((u,f)=>u-f);l!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var x=m[f+1],p=x==null,h=p?l+i-u:x-u;if(h<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:u,y:n,width:h,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var fr=(t,e)=>{var{xAxis:r,width:a,height:l,offset:n}=t;return Mt(Bt(Z(Z(Z({},Ae),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.left,n.left+n.width,e)},xr=(t,e)=>{var{yAxis:r,width:a,height:l,offset:n}=t;return Mt(Bt(Z(Z(Z({},Ae),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.top,n.top+n.height,e)},pr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:zt.grid};function Xt(t){var e=Gs(),r=Rs(),a=Ws(),l=Z(Z({},lt(t,pr)),{},{x:ie(t.x)?t.x:a.left,y:ie(t.y)?t.y:a.top,width:ie(t.width)?t.width:a.width,height:ie(t.height)?t.height:a.height}),{xAxisId:n,yAxisId:i,x:o,y:d,width:m,height:c,syncWithTicks:u,horizontalValues:f,verticalValues:x}=l,p=$e(),h=fe(A=>ft(A,"xAxis",n,p)),g=fe(A=>ft(A,"yAxis",i,p));if(!xt(m)||!xt(c)||!ie(o)||!ie(d))return null;var y=l.verticalCoordinatesGenerator||fr,S=l.horizontalCoordinatesGenerator||xr,{horizontalPoints:j,verticalPoints:b}=l;if((!j||!j.length)&&typeof S=="function"){var N=f&&f.length,w=S({yAxis:g?Z(Z({},g),{},{ticks:N?f:g.ticks}):void 0,width:e??m,height:r??c,offset:a},N?!0:u);bt(Array.isArray(w),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof w,"]")),Array.isArray(w)&&(j=w)}if((!b||!b.length)&&typeof y=="function"){var k=x&&x.length,C=y({xAxis:h?Z(Z({},h),{},{ticks:k?x:h.ticks}):void 0,width:e??m,height:r??c,offset:a},k?!0:u);bt(Array.isArray(C),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof C,"]")),Array.isArray(C)&&(b=C)}return v.createElement($t,{zIndex:l.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(or,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),v.createElement(ur,xe({},l,{horizontalPoints:j})),v.createElement(mr,xe({},l,{verticalPoints:b})),v.createElement(cr,xe({},l,{offset:a,horizontalPoints:j,xAxis:h,yAxis:g})),v.createElement(dr,xe({},l,{offset:a,verticalPoints:b,xAxis:h,yAxis:g}))))}Xt.displayName="CartesianGrid";var Jt=(t,e,r)=>Rt(t,"xAxis",ot(t,e),r),Zt=(t,e,r)=>Wt(t,"xAxis",ot(t,e),r),es=(t,e,r)=>Rt(t,"yAxis",ct(t,e),r),ts=(t,e,r)=>Wt(t,"yAxis",ct(t,e),r),hr=Me([it,Jt,es,Zt,ts],(t,e,r,a,l)=>Ft(t,"xAxis")?pt(e,a,!1):pt(r,l,!1)),gr=(t,e)=>e,ss=Me([Vs,gr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),as=t=>{var e=it(t),r=Ft(e,"xAxis");return r?"yAxis":"xAxis"},vr=(t,e)=>{var r=as(t);return r==="yAxis"?ct(t,e):ot(t,e)},yr=(t,e,r)=>Ys(t,as(t),vr(t,e),r),br=Me([ss,yr],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,l=Ks(t);if(!(a==null||l==null)){var n=(r=e[a])===null||r===void 0?void 0:r.stackedData,i=n?.find(o=>o.key===l);if(i!=null)return i.map(o=>[o[0],o[1]])}}}),jr=Me([it,Jt,es,Zt,ts,br,Fs,hr,ss,Us],(t,e,r,a,l,n,i,o,d,m)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:f}=i;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||l==null||a.length===0||l.length===0||o==null)){var{data:x}=d,p;if(x&&x.length>0?p=x:p=c?.slice(u,f+1),p!=null)return Rr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:l,dataStartIndex:u,areaSettings:d,stackedData:n,displayedData:p,chartBaseValue:m,bandSize:o})}}),Nr=["id"],Sr=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function rs(t,e){if(t==null)return{};var r,a,l=wr(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function wr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){Cr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Cr(t,e,r){return(e=kr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kr(t){var e=Ar(t,"string");return typeof e=="symbol"?e:e+""}function Ar(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ze(t,e){return t&&t!=="none"?t:e}var _r=t=>{var{dataKey:e,name:r,stroke:a,fill:l,legendType:n,hide:i}=t;return[{inactive:i,dataKey:e,type:n,color:ze(a,l),value:Ut(r,e),payload:t}]},Pr=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:l,fill:n,name:i,hide:o,unit:d,tooltipType:m,id:c}=t,u={dataDefinedOnItem:r,getPosition:ea,settings:{stroke:a,strokeWidth:l,fill:n,dataKey:e,nameKey:void 0,name:Ut(i,e),hide:o,type:m,color:ze(a,n),unit:d,graphicalItemId:c}};return v.createElement(Zs,{tooltipEntrySettings:u})});function Ir(t){var{clipPathId:e,points:r,props:a}=t,{needClip:l,dot:n,dataKey:i}=a,o=nt(a);return v.createElement(pa,{points:r,dot:n,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:i,baseProps:o,needClip:l,clipPathId:e})}function Er(t){var{showLabels:e,children:r,points:a}=t,l=a.map(n=>{var i,o,d={x:(i=n.x)!==null&&i!==void 0?i:0,y:(o=n.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:n.value,payload:n.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(fa,{value:e?l:void 0},r)}function St(t){var{points:e,baseLine:r,needClip:a,clipPathId:l,props:n}=t,{layout:i,type:o,stroke:d,connectNulls:m,isRange:c}=n,{id:u}=n,f=rs(n,Nr),x=nt(f),p=xa(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(De,{clipPath:a?"url(#clipPath-".concat(l,")"):void 0},v.createElement(Ve,pe({},p,{id:u,points:e,connectNulls:m,type:o,baseLine:r,layout:i,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Ve,pe({},x,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:e})),d!=="none"&&c&&Array.isArray(r)&&v.createElement(Ve,pe({},x,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:r}))),v.createElement(Ir,{points:e,props:f,clipPathId:l}))}function Or(t){var e,r,{alpha:a,baseLine:l,points:n,strokeWidth:i}=t,o=(e=n[0])===null||e===void 0?void 0:e.y,d=(r=n[n.length-1])===null||r===void 0?void 0:r.y;if(!Le(o)||!Le(d))return null;var m=a*Math.abs(o-d),c=Math.max(...n.map(u=>u.x||0));return ie(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(u=>u.x||0),c)),ie(c)?v.createElement("rect",{x:0,y:o<d?o:o-m,width:c+(i?parseInt("".concat(i),10):1),height:Math.floor(m)}):null}function Dr(t){var e,r,{alpha:a,baseLine:l,points:n,strokeWidth:i}=t,o=(e=n[0])===null||e===void 0?void 0:e.x,d=(r=n[n.length-1])===null||r===void 0?void 0:r.x;if(!Le(o)||!Le(d))return null;var m=a*Math.abs(o-d),c=Math.max(...n.map(u=>u.y||0));return ie(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(u=>u.y||0),c)),ie(c)?v.createElement("rect",{x:o<d?o:o-m,y:0,width:m,height:Math.floor(c+(i?parseInt("".concat(i),10):1))}):null}function Lr(t){var{alpha:e,layout:r,points:a,baseLine:l,strokeWidth:n}=t;return r==="vertical"?v.createElement(Or,{alpha:e,points:a,baseLine:l,strokeWidth:n}):v.createElement(Dr,{alpha:e,points:a,baseLine:l,strokeWidth:n})}function Tr(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n}=t,{points:i,baseLine:o,isAnimationActive:d,animationBegin:m,animationDuration:c,animationEasing:u,onAnimationStart:f,onAnimationEnd:x}=a,p=v.useMemo(()=>({points:i,baseLine:o}),[i,o]),h=oa(p,"recharts-area-"),g=Kt(),[y,S]=v.useState(!1),j=!y,b=v.useCallback(()=>{typeof x=="function"&&x(),S(!1)},[x]),N=v.useCallback(()=>{typeof f=="function"&&f(),S(!0)},[f]);if(g==null)return null;var w=l.current,k=n.current;return v.createElement(Er,{showLabels:j,points:i},a.children,v.createElement(ca,{animationId:h,begin:m,duration:c,isActive:d,easing:u,onAnimationEnd:b,onAnimationStart:N,key:h},C=>{if(w){var A=w.length/i.length,I=C===1?i:i.map((_,O)=>{var L=Math.floor(O*A);if(w[L]){var D=w[L];return Se(Se({},_),{},{x:Ne(D.x,_.x,C),y:Ne(D.y,_.y,C)})}return _}),z;return ie(o)?z=Ne(k,o,C):da(o)||ua(o)?z=Ne(k,0,C):z=o.map((_,O)=>{var L=Math.floor(O*A);if(Array.isArray(k)&&k[L]){var D=k[L];return Se(Se({},_),{},{x:Ne(D.x,_.x,C),y:Ne(D.y,_.y,C)})}return _}),C>0&&(l.current=I,n.current=z),v.createElement(St,{points:I,baseLine:z,needClip:e,clipPathId:r,props:a})}return C>0&&(l.current=i,n.current=o),v.createElement(De,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(Lr,{alpha:C,points:i,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(De,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(St,{points:i,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(ma,{label:a.label}))}function zr(t){var{needClip:e,clipPathId:r,props:a}=t,l=v.useRef(null),n=v.useRef();return v.createElement(Tr,{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n})}class $r extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:l,top:n,left:i,needClip:o,xAxisId:d,yAxisId:m,width:c,height:u,id:f,baseLine:x,zIndex:p}=this.props;if(e)return null;var h=Pt("recharts-area",l),g=f,{r:y,strokeWidth:S}=la(r),j=na(r),b=y*2+S,N=o?"url(#clipPath-".concat(j?"":"dots-").concat(g,")"):void 0;return v.createElement($t,{zIndex:p},v.createElement(De,{className:h},o&&v.createElement("defs",null,v.createElement(ia,{clipPathId:g,xAxisId:d,yAxisId:m}),!j&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:i-b/2,y:n-b/2,width:c+b,height:u+b}))),v.createElement(zr,{needClip:o,clipPathId:g,props:this.props})),v.createElement(ht,{points:a,mainColor:ze(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:N}),this.props.isRange&&Array.isArray(x)&&v.createElement(ht,{points:x,mainColor:ze(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:N}))}}var Mr={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:zt.area};function Br(t){var e,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,connectNulls:i,dot:o,fill:d,fillOpacity:m,hide:c,isAnimationActive:u,legendType:f,stroke:x,xAxisId:p,yAxisId:h}=t,g=rs(t,Sr),y=ta(),S=sa(),{needClip:j}=aa(p,h),b=$e(),{points:N,isRange:w,baseLine:k}=(e=fe(O=>jr(O,t.id,b)))!==null&&e!==void 0?e:{},C=ra();if(y!=="horizontal"&&y!=="vertical"||C==null||S!=="AreaChart"&&S!=="ComposedChart")return null;var{height:A,width:I,x:z,y:_}=C;return!N||!N.length?null:v.createElement($r,pe({},g,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,baseLine:k,connectNulls:i,dot:o,fill:d,fillOpacity:m,height:A,hide:c,layout:y,isAnimationActive:u,isRange:w,legendType:f,needClip:j,points:N,stroke:x,width:I,left:z,top:_,xAxisId:p,yAxisId:h}))}var Gr=(t,e,r,a,l)=>{var n=r??e;if(ie(n))return n;var i=t==="horizontal"?l:a,o=i.scale.domain();if(i.type==="number"){var d=Math.max(o[0],o[1]),m=Math.min(o[0],o[1]);return n==="dataMin"?m:n==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return n==="dataMin"?o[0]:n==="dataMax"?o[1]:o[0]};function Rr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:l,layout:n,chartBaseValue:i,xAxis:o,yAxis:d,displayedData:m,dataStartIndex:c,xAxisTicks:u,yAxisTicks:f,bandSize:x}=t,p=l&&l.length,h=Gr(n,i,r,o,d),g=n==="horizontal",y=!1,S=m.map((b,N)=>{var w,k,C,A;if(p)A=l[c+N];else{var I=gt(b,a);Array.isArray(I)?(A=I,y=!0):A=[h,I]}var z=(w=(k=A)===null||k===void 0?void 0:k[1])!==null&&w!==void 0?w:null,_=z==null||p&&!e&>(b,a)==null;if(g){var O;return{x:vt({axis:o,ticks:u,bandSize:x,entry:b,index:N}),y:_?null:(O=d.scale.map(z))!==null&&O!==void 0?O:null,value:A,payload:b}}return{x:_?null:(C=o.scale.map(z))!==null&&C!==void 0?C:null,y:vt({axis:d,ticks:f,bandSize:x,entry:b,index:N}),value:A,payload:b}}),j;return p||y?j=S.map(b=>{var N,w=Array.isArray(b.value)?b.value[0]:null;if(g){var k;return{x:b.x,y:w!=null&&b.y!=null&&(k=d.scale.map(w))!==null&&k!==void 0?k:null,payload:b.payload}}return{x:w!=null&&(N=o.scale.map(w))!==null&&N!==void 0?N:null,y:b.y,payload:b.payload}}):j=g?d.scale.map(h):o.scale.map(h),{points:S,baseLine:j??0,isRange:y}}function Wr(t){var e=lt(t,Mr),r=$e();return v.createElement(qs,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(Qs,{legendPayload:_r(e)}),v.createElement(Pr,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(Xs,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:Js(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Br,pe({},e,{id:a}))))}var ls=v.memo(Wr,Hs);ls.displayName="Area";var Fr=["type"],Ur=["dangerouslySetInnerHTML","ticks","scale"],Kr=["id","scale"];function et(){return et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},et.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(a){Vr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Vr(t,e,r){return(e=Yr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yr(t){var e=Hr(t,"string");return typeof e=="symbol"?e:e+""}function Hr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tt(t,e){if(t==null)return{};var r,a,l=qr(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function qr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Qr(t){var e=Vt(),r=v.useRef(null),a=Kt(),{type:l}=t,n=tt(t,Fr),i=_a(a,"yAxis",l),o=v.useMemo(()=>{if(i!=null)return Ct(Ct({},n),{},{type:i})},[i,n]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(ga(o)):r.current!==o&&e(va({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ya(r.current)),r.current=null)},[e]),null}function Xr(t){var{yAxisId:e,className:r,width:a,label:l}=t,n=v.useRef(null),i=v.useRef(null),o=fe(ba),d=$e(),m=Vt(),c="yAxis",u=fe(w=>ja(w,e)),f=fe(w=>Na(w,e)),x=fe(w=>Sa(w,c,e,d)),p=fe(w=>wa(w,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!u||Ca(l)||v.isValidElement(l)||p==null)){var w=n.current;if(w){var k=w.getCalculatedWidth();Math.round(u.width)!==Math.round(k)&&m(ka({id:e,width:k}))}}},[x,u,m,l,e,a,p]),u==null||f==null||p==null)return null;var{dangerouslySetInnerHTML:h,ticks:g,scale:y}=t,S=tt(t,Ur),{id:j,scale:b}=p,N=tt(p,Kr);return v.createElement(Aa,et({},S,N,{ref:n,labelRef:i,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:u.width,height:u.height,className:Pt("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:x,axisType:c,axisId:e}))}var Jr={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:Ae.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:Ae.tickLine,tickSize:Ae.tickSize,type:J.type,niceTicks:J.niceTicks,width:J.width,yAxisId:0},Zr=t=>{var e=lt(t,Jr);return v.createElement(v.Fragment,null,v.createElement(Qr,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter,niceTicks:e.niceTicks}),v.createElement(Xr,e))},ns=v.memo(Zr,ha);ns.displayName="YAxis";var el=["axis"],tl=v.forwardRef((t,e)=>v.createElement(Pa,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:el,tooltipPayloadSearcher:Ia,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function ut(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const l=new Date(r),n=t==="7d"?7:t==="30d"?30:90;return l.setDate(l.getDate()-n),{startDate:l.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function K(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const is="gateway-chip-period";function sl(){try{const t=localStorage.getItem(is);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function al(t){try{localStorage.setItem(is,t)}catch{}}const rl={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},ll={daily:"daily",weekly:"weekly",monthly:"monthly"},nl=[5,10,25,50,100],il=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function ol(t){const e=E.c(51),{open:r,onOpenChange:a,connectionId:l,currentLimitUsd:n,billingMode:i,currentLimitPeriod:o}=t,{org:d}=me(),[m,c]=v.useState(null),[u,f]=v.useState(""),[x,p]=v.useState(null),[h,g]=v.useState(null),[y,S]=v.useState(o??"none");let j;e[0]!==l||e[1]!==d.id?(j={connectionId:l,orgId:d.id},e[0]=l,e[1]=d.id,e[2]=j):j=e[2];const b=ke(j);let N;e[3]!==b?(N={client:b},e[3]=b,e[4]=N):N=e[4];const{mutate:w,isPending:k}=Ht(N),C=_t(),A=i==="postpaid";let I;e[5]!==u?(I=u?Number.parseFloat(u):null,e[5]=u,e[6]=I):I=e[6];const _=m??I,O=y==="none"?null:y,L=A&&_!=null&&_===n&&O===o;let D;e[7]!==b?(D=Ga.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=D):D=e[8];const G=D;let V;e[9]!==G||e[10]!==C?(V=async()=>{await C.invalidateQueries({queryKey:G,exact:!0}),await C.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=C,e[11]=V):V=e[11];const F=V;let T,$;e[12]!==i||e[13]!==o||e[14]!==n||e[15]!==_||e[16]!==A||e[17]!==y||e[18]!==w||e[19]!==a||e[20]!==F?($=()=>{if(!_||_<=0)return;const B=A?_:n+_;g(null);const ae={limit_usd:B,billing_mode:i,return_url:window.location.href};A&&(ae.limit_period=y),w({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await F(),te?.checkout_url?p(te.checkout_url):T()},onError:re=>{g(re.message??"Failed to update limit.")}})},T=()=>{c(null),f(""),p(null),g(null),S(o??"none"),a(!1)},e[12]=i,e[13]=o,e[14]=n,e[15]=_,e[16]=A,e[17]=y,e[18]=w,e[19]=a,e[20]=F,e[21]=T,e[22]=$):(T=e[21],$=e[22]);const Y=A?"Configure Spending Limit":"Add Credit",H=A?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=A?"New limit":"Select amount",U=A?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(hs,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(gs,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let R;e[27]!==q||e[28]!==ee?(R=s.jsxs(vs,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=R):R=e[29];let W;e[30]!==M||e[31]!==x||e[32]!==U||e[33]!==n||e[34]!==u||e[35]!==_||e[36]!==h||e[37]!==$||e[38]!==k||e[39]!==A||e[40]!==L||e[41]!==y||e[42]!==m?(W=x?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(ce,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:x,children:[s.jsx(rt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:nl.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:ue("rounded-md border px-3 py-2 text-sm font-medium transition-colors",m===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:A?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Ie,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:u,onChange:B=>{f(B.target.value),c(null)}})]})]}),A&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:il.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>S(ae),className:ue("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),h&&s.jsx("p",{className:"text-xs text-destructive",children:h}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:A?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:n>0?K(n):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:K(n)})]})}),s.jsx(ce,{onClick:$,disabled:k||!_||_<=0||L,className:"gap-2",children:k?"Updating...":U})]})]}),e[30]=M,e[31]=x,e[32]=U,e[33]=n,e[34]=u,e[35]=_,e[36]=h,e[37]=$,e[38]=k,e[39]=A,e[40]=L,e[41]=y,e[42]=m,e[43]=W):W=e[43];let Q;e[44]!==R||e[45]!==W?(Q=s.jsxs(Ot,{className:"sm:max-w-md",children:[R,W]}),e[44]=R,e[45]=W,e[46]=Q):Q=e[46];let se;return e[47]!==T||e[48]!==r||e[49]!==Q?(se=s.jsx(Dt,{open:r,onOpenChange:T,children:Q}),e[47]=T,e[48]=r,e[49]=Q,e[50]=se):se=e[50],se}function cl(t){const e=E.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:l,avgDailySpend:n}=r;if(a==null)return null;let i;e[0]!==l?(i=l?new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=l,e[1]=i):i=e[1];const o=i,d=a!==1?"s":"";let m;e[2]!==a||e[3]!==d?(m=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=m):m=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=u):u=e[7];let f;e[8]!==n?(f=K(n),e[8]=n,e[9]=f):f=e[9];let x;e[10]!==f?(x=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=x):x=e[11];let p;e[12]!==r.resetsBeforeDepletion?(p=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=p):p=e[13];const h=rl[r.confidence];let g;e[14]!==h?(g=s.jsx(Ta,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:h}),e[14]=h,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==m||e[18]!==c||e[19]!==x||e[20]!==p?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[m,c,u,x,p,g]}),e[16]=g,e[17]=m,e[18]=c,e[19]=x,e[20]=p,e[21]=y):y=e[21],y}function dl(t){const e=E.c(37),{usage:r,limit:a,limitPeriod:l,onConfigureLimit:n,connectionId:i,alert:o}=t,d=a.total!=null&&a.total>0;let m;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(m=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=m):m=e[3];const c=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=u):u=e[4];let f;e[5]!==r.total?(f=K(r.total),e[5]=r.total,e[6]=f):f=e[6];let x;e[7]!==f?(x=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=x):x=e[8];let p;e[9]!==d||e[10]!==a.total||e[11]!==l?(p=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a.total)," limit",l&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(Ba,{size:10}),ll[l]]})]}),e[9]=d,e[10]=a.total,e[11]=l,e[12]=p):p=e[12];let h;e[13]!==d?(h=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=h):h=e[14];let g;e[15]!==x||e[16]!==p||e[17]!==h?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,x,p,h]}),e[15]=x,e[16]=p,e[17]=h,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Yt,{size:16}),e[19]=y):y=e[19];const S=d?"Configure Limit":"Set Limit";let j;e[20]!==n||e[21]!==S?(j=s.jsxs(ce,{onClick:n,variant:"outline",className:"gap-2",children:[y,S]}),e[20]=n,e[21]=S,e[22]=j):j=e[22];let b;e[23]!==j||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,j]}),e[23]=j,e[24]=g,e[25]=b):b=e[25];let N;e[26]!==d||e[27]!==a.reset||e[28]!==c?(N=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:ue("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=N):N=e[29];let w;e[30]!==o||e[31]!==i?(w=s.jsx(os,{connectionId:i,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=i,e[32]=w):w=e[32];let k;return e[33]!==b||e[34]!==N||e[35]!==w?(k=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,N,w]}),e[33]=b,e[34]=N,e[35]=w,e[36]=k):k=e[36],k}function ul(t){const e=E.c(30),{available:r,total:a,estimation:l,onAddCredit:n,connectionId:i,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=m):m=e[0];let c;e[1]!==r?(c=K(r),e[1]=r,e[2]=c):c=e[2];let u;e[3]!==c?(u=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=u):u=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let x;e[7]!==u||e[8]!==f?(x=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,u,f]}),e[7]=u,e[8]=f,e[9]=x):x=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Yt,{size:16}),e[10]=p):p=e[10];let h;e[11]!==n?(h=s.jsxs(ce,{onClick:n,className:"gap-2 px-5",children:[p,"Add Credit"]}),e[11]=n,e[12]=h):h=e[12];let g;e[13]!==x||e[14]!==h?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[x,h]}),e[13]=x,e[14]=h,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[K(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let S;e[20]!==l?(S=s.jsx(cl,{estimation:l}),e[20]=l,e[21]=S):S=e[21];let j;e[22]!==o||e[23]!==i?(j=s.jsx(os,{connectionId:i,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=i,e[24]=j):j=e[24];let b;return e[25]!==S||e[26]!==j||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,S,j]}),e[25]=S,e[26]=j,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function os(t){const e=E.c(78),{connectionId:r,alert:a,billingMode:l}=t,{org:n}=me(),[i,o]=v.useState(!1),[d,m]=v.useState(a.enabled),[c,u]=v.useState(String(a.threshold_usd)),[f,x]=v.useState(a.email??""),[p,h]=v.useState(!1),[g,y]=v.useState(null);let S;e[0]!==r||e[1]!==n.id?(S={connectionId:r,orgId:n.id},e[0]=r,e[1]=n.id,e[2]=S):S=e[2];const j=ke(S);let b;e[3]!==j?(b={client:j},e[3]=j,e[4]=b):b=e[4];const{mutate:N,isPending:w}=Ht(b),k=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let C;e[5]!==f||e[6]!==d||e[7]!==N||e[8]!==c?(C=()=>{y(null),h(!1);const X=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(X)||X<=0){y("Threshold must be a positive number.");return}N({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:X,...f?{email:f}:{}}},{onSuccess:()=>{h(!0),setTimeout(()=>h(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=N,e[8]=c,e[9]=C):C=e[9];const A=C,I=l==="postpaid"?"Usage Alert":"Low-Balance Alert",z=l==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!i){let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>o(!0),e[10]=X):X=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx(Ma,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==I?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:I}),e[12]=I,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==l?(ve=a.enabled?l==="postpaid"?`Enabled · Alert at ${K(a.threshold_usd)}`:`Enabled · Alert below ${K(a.threshold_usd)}`:l==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=l,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Oe;return e[25]!==je||e[26]!==be?(Oe=s.jsxs("button",{type:"button",onClick:X,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Oe):Oe=e[27],Oe}let _;e[28]!==I?(_=s.jsx("p",{className:"text-xs font-medium text-foreground",children:I}),e[28]=I,e[29]=_):_=e[29];let O;e[30]!==z?(O=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:z}),e[30]=z,e[31]=O):O=e[31];let L;e[32]!==_||e[33]!==O?(L=s.jsxs("div",{children:[_,O]}),e[32]=_,e[33]=O,e[34]=L):L=e[34];let D;e[35]!==d?(D=s.jsx(Ze,{checked:d,onCheckedChange:m}),e[35]=d,e[36]=D):D=e[36];let G;e[37]!==L||e[38]!==D?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[L,D]}),e[37]=L,e[38]=D,e[39]=G):G=e[39];const V=!d&&"opacity-50 pointer-events-none";let F;e[40]!==V?(F=ue("flex flex-col gap-3 transition-opacity",V),e[40]=V,e[41]=F):F=e[41];const T=l==="postpaid"?"Notify at":"Notify below";let $;e[42]!==T?($=s.jsx(_e,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:T}),e[42]=T,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=X=>u(X.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Ie,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(_e,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=X=>x(X.target.value),e[52]=ee):ee=e[52];let R;e[53]!==f?(R=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Ie,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=R):R=e[54];let W;e[55]!==U||e[56]!==R?(W=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,R]}),e[55]=U,e[56]=R,e[57]=W):W=e[57];let Q;e[58]!==g?(Q=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=Q):Q=e[59];let se;e[60]!==F||e[61]!==W||e[62]!==Q?(se=s.jsxs("div",{className:F,children:[W,Q]}),e[60]=F,e[61]=W,e[62]=Q,e[63]=se):se=e[63];let B;e[64]!==p?(B=p&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=p,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(ce,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=w||!k,te=w?"Saving...":"Save Alert";let le;e[67]!==A||e[68]!==re||e[69]!==te?(le=s.jsx(ce,{size:"sm",className:"h-7 text-xs",onClick:A,disabled:re,children:te}),e[67]=A,e[68]=re,e[69]=te,e[70]=le):le=e[70];let de;e[71]!==B||e[72]!==le?(de=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=de):de=e[73];let P;return e[74]!==se||e[75]!==de||e[76]!==G?(P=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,de]}),e[74]=se,e[75]=de,e[76]=G,e[77]=P):P=e[77],P}const ml={cost:{label:"Cost",color:"var(--chart-1)"}};function fl(){const t=E.c(54),{org:e}=me(),[r,a]=v.useState("7d");let l;t[0]!==r?(l=ut(r),t[0]=r,t[1]=l):l=t[1];const n=l;let i;t[2]!==e.id?(i={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=i):i=t[3];const o=ke(i);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let m;t[5]!==n?(m={widget:d,timeRange:n,skipCount:!0},t[5]=n,t[6]=m):m=t[6];let c;t[7]!==o||t[8]!==m?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:m,staleTime:6e4,select:Ce},t[7]=o,t[8]=m,t[9]=c):c=t[9];const{data:u}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let x;t[11]!==n?(x={widget:f,timeRange:n,skipCount:!0},t[11]=n,t[12]=x):x=t[12];let p;t[13]!==o||t[14]!==x?(p={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:x,staleTime:6e4,select:Ce},t[13]=o,t[14]=x,t[15]=p):p=t[15];const{data:h}=oe(p);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title",limit:10}},t[16]=g):g=t[16];let y;t[17]!==n?(y={widget:g,timeRange:n,skipCount:!0},t[17]=n,t[18]=y):y=t[18];let S;t[19]!==o||t[20]!==y?(S={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=S):S=t[21];const{data:j}=oe(S);let b;t[22]!==u?.timeseries?(b=u?.timeseries??[],t[22]=u?.timeseries,t[23]=b):b=t[23];let N;t[24]!==b?(N=b.map(yl),t[24]=b,t[25]=N):N=t[25];const w=N;let k;if(t[26]!==h?.value||t[27]!==w||t[28]!==j?.groups||t[29]!==u?.timeseries||t[30]!==r){const C=(u?.timeseries??[]).reduce(vl,0),A=h?.value??0,I=(j?.groups??[]).filter(gl).sort(hl).slice(0,5),z=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let _;t[32]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=_):_=t[32];const O=K(C);let L;t[33]!==O?(L=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:O}),t[33]=O,t[34]=L):L=t[34];let D;t[35]!==z?(D=s.jsx("p",{className:"text-xs text-muted-foreground",children:z}),t[35]=z,t[36]=D):D=t[36];let G;t[37]!==L||t[38]!==D?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[L,D]}),t[37]=L,t[38]=D,t[39]=G):G=t[39];let V;t[40]!==A?(V=A.toLocaleString(),t[40]=A,t[41]=V):V=t[41];let F;t[42]!==V?(F=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[V," tool calls"]}),t[42]=V,t[43]=F):F=t[43];let T;t[44]!==G||t[45]!==F?(T=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[_,G,F]}),t[44]=G,t[45]=F,t[46]=T):T=t[46];let $;t[47]!==r?($=s.jsx(cs,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==T||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[T,$]}),t[49]=T,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==w?(H=w.length>0?s.jsx(Ea,{config:ml,className:"h-[200px] w-full",children:s.jsxs(tl,{data:w,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(Xt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(Oa,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(ns,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:pl}),s.jsx(Da,{content:s.jsx(La,{formatter:xl})}),s.jsx(ls,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=w,t[53]=H):H=t[53],k=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,I.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:I.map((M,U)=>{const q=C>0?Math.min(M.value/C*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:K(M.value)})]},M.key)})})]})]}),t[26]=h?.value,t[27]=w,t[28]=j?.groups,t[29]=u?.timeseries,t[30]=r,t[31]=k}else k=t[31];return k}function xl(t){return K(t)}function pl(t){return`$${t}`}function hl(t,e){return e.value-t.value}function gl(t){return t.value>0}function vl(t,e){return t+e.value}function yl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function bl(){const t=E.c(6),[e,r]=v.useState(sl);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=m=>{r(m),al(m)},t[0]=a):a=t[0];const l=a;let n,i;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),i=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=n,t[2]=i):(n=t[1],i=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[n,i,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(m=>s.jsx("button",{type:"button",onClick:()=>l(m),className:ue("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===m?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:m},m))})]}),t[4]=e,t[5]=d):d=t[5],d}function Qe(t){const e=E.c(20),{label:r,value:a,subValue:l,maxValue:n,color:i}=t,o=i===void 0?"bg-chart-1":i;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const m=d,c=n>0?Math.min(m/n*100,100):0;let u;e[2]!==r?(u=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=u):u=e[3];let f;e[4]!==o?(f=ue("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const x=`${c}%`;let p;e[6]!==x?(p={width:x},e[6]=x,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:p})}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==l?(y=l&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:l}),e[13]=l,e[14]=y):y=e[14];let S;return e[15]!==u||e[16]!==h||e[17]!==g||e[18]!==y?(S=s.jsxs("div",{className:"flex items-center gap-2",children:[u,h,g,y]}),e[15]=u,e[16]=h,e[17]=g,e[18]=y,e[19]=S):S=e[19],S}function Xe(t){const e=E.c(8),{title:r,children:a,empty:l}=t;let n;e[0]!==r?(n=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=n):n=e[1];let i;e[2]!==a||e[3]!==l?(i=l?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=l,e[4]=i):i=e[4];let o;return e[5]!==n||e[6]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[n,i]}),e[5]=n,e[6]=i,e[7]=o):o=e[7],o}const kt={"7d":"7 days","30d":"30 days","90d":"90 days"};function cs(t){const e=E.c(4),{period:r,onPeriodChange:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.keys(kt),e[0]=l):l=e[0];let n;return e[1]!==a||e[2]!==r?(n=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:l.map(i=>s.jsx("button",{type:"button",onClick:()=>a(i),className:ue("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===i?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:kt[i]},i))}),e[1]=a,e[2]=r,e[3]=n):n=e[3],n}function At(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,l)=>l.cost-a.cost)}function jl(){const t=E.c(27),{org:e}=me(),[r,a]=v.useState("7d"),l=ut(r),{data:n}=Wa(),i=n?.data?.members??[],o=new Map(i.map(Al));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const m=ke(d),c=P=>({client:m,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:P.fn,...P.groupByColumn&&{groupByColumn:P.groupByColumn},...P.limit&&{limit:P.limit}}},timeRange:l,skipCount:!0},staleTime:6e4,select:Ce}),{data:u,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title",limit:20})),{data:x,isLoading:p}=oe(c({fn:"count_all",groupByColumn:"connection_title",limit:20})),{data:h,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id",limit:20})),{data:y,isLoading:S}=oe(c({fn:"count_all",groupByColumn:"user_id",limit:20})),{data:j,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name",limit:20}));let N;t[2]===Symbol.for("react.memo_cache_sentinel")?(N={fn:"count_all",groupByColumn:"tool_name",limit:20},t[2]=N):N=t[2];const{data:w,isLoading:k}=oe(c(N));if(f||p||g||S||b||k){let P;t[3]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ne,{className:"h-8 w-48"}),t[3]=P):P=t[3];let X;return t[4]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs("div",{className:"flex flex-col gap-4",children:[P,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(kl)})]}),t[4]=X):X=t[4],X}const A=At(u?.groups??[],x?.groups??[]),I=At(h?.groups??[],y?.groups??[]).map(P=>({...P,key:o.get(P.key)??P.key})),z=w?.groups??[],_=new Map((j?.groups??[]).map(Cl)),O=z.map(P=>({name:P.key,calls:P.value,cost:_.get(P.key)??0})).sort(wl).slice(0,20),L=A.reduce(Sl,0),D=A.reduce(Nl,0),G=A[0]?.cost??1,V=I[0]?.cost??1,F=O[0]?.calls??1;let T;t[5]!==r?(T=s.jsx(cs,{period:r,onPeriodChange:a}),t[5]=r,t[6]=T):T=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=A.length===0,H=A.slice(0,8).map(P=>s.jsx(Qe,{label:P.key,value:K(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},P.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Xe,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=I.length===0,ee=I.slice(0,8).map(P=>s.jsx(Qe,{label:P.key,value:K(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:V,color:"bg-chart-4"},P.key));let R;t[12]!==ee?(R=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=R):R=t[13];let W;t[14]!==R||t[15]!==q?(W=s.jsx(Xe,{title:"Cost by User",empty:q,children:R}),t[14]=R,t[15]=q,t[16]=W):W=t[16];const Q=Xe,se="Top Tools",B=O.length===0,ae="space-y-2.5",re=O.slice(0,8).map(P=>s.jsx(Qe,{label:P.name,value:P.calls.toLocaleString(),subValue:P.cost>0?K(P.cost):void 0,maxValue:F,color:"bg-chart-3"},P.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==Q||t[20]!==B||t[21]!==te?(le=s.jsx(Q,{title:se,empty:B,children:te}),t[19]=Q,t[20]=B,t[21]=te,t[22]=le):le=t[22];let de;return t[23]!==W||t[24]!==le||t[25]!==U?(de=s.jsxs("div",{className:$,children:[U,W,le]}),t[23]=W,t[24]=le,t[25]=U,t[26]=de):de=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:K(L)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:D.toLocaleString()})]})]}),T]}),de]})}function Nl(t,e){return t+e.calls}function Sl(t,e){return t+e.cost}function wl(t,e){return e.calls-t.calls}function Cl(t){return[t.key,t.value]}function kl(t,e){return s.jsx(ne,{className:"h-40 rounded-xl"},e)}function Al(t){return[t.userId,t.user.name??t.user.email]}function _l(t,e){const r=new Map;for(const a of t){const n=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(n)??{cost:0,calls:0};r.set(n,{cost:i.cost+a.value,calls:i.calls})}for(const a of e){const n=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(n)??{cost:0,calls:0};r.set(n,{cost:i.cost,calls:i.calls+a.value})}return Array.from(r.entries()).map(([a,l])=>({month:a,...l})).reverse()}function Pl(){const t=E.c(27),{org:e}=me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=ut("90d"),t[0]=r):r=t[0];const a=r;let l;t[1]!==e.id?(l={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=l):l=t[2];const n=ke(l);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a,skipCount:!0},t[3]=i):i=t[3];let o;t[4]!==n?(o={client:n,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:i,staleTime:6e4,select:Ce},t[4]=n,t[5]=o):o=t[5];const{data:d,isLoading:m}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a,skipCount:!0},t[6]=c):c=t[6];let u;t[7]!==n?(u={client:n,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=n,t[8]=u):u=t[8];const{data:f,isLoading:x}=oe(u);if(m||x){let N;return t[9]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ne,{className:"h-8 w-48"}),s.jsx(ne,{className:"h-48 rounded-xl"})]}),t[9]=N):N=t[9],N}let p,h,g,y,S;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const N=_l(d?.timeseries??[],f?.timeseries??[]);S="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=p):p=t[17],h="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=N.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:N.map(Il)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=p,t[13]=h,t[14]=g,t[15]=y,t[16]=S}else p=t[12],h=t[13],g=t[14],y=t[15],S=t[16];let j;t[19]!==h||t[20]!==g||t[21]!==y?(j=s.jsxs("div",{className:h,children:[g,y]}),t[19]=h,t[20]=g,t[21]=y,t[22]=j):j=t[22];let b;return t[23]!==p||t[24]!==j||t[25]!==S?(b=s.jsxs("div",{className:S,children:[p,j]}),t[23]=p,t[24]=j,t[25]=S,t[26]=b):b=t[26],b}function Il(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:K(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function El(t){const e=E.c(31),{connectionId:r}=t,{org:a}=me(),[l,n]=v.useState(!1);let i;e[0]!==r||e[1]!==a.id?(i={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=i):i=e[2];const o=ke(i);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let m;e[4]!==o?(m={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:Ol},e[4]=o,e[5]=m):m=e[5];const{data:c,isLoading:u}=oe(m);if(u){let I;return e[6]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ne,{className:"h-36 rounded-xl"}),e[6]=I):I=e[6],I}if(!c)return null;const f=c.limit.remaining??0,x=c.limit.total??0,p=c.usage,h=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let S;e[7]!==c.alert?(S=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=S):S=e[8];const j=S,b=c.limit,N=h==="postpaid"&&(x==null||x===0);let w;e[9]!==j||e[10]!==f||e[11]!==h||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==x||e[17]!==p?(w=h==="postpaid"?s.jsx(dl,{usage:p,limit:b,limitPeriod:g,onConfigureLimit:()=>n(!0),connectionId:r,alert:j}):s.jsx(ul,{available:f,total:x,estimation:y,onAddCredit:()=>n(!0),connectionId:r,alert:j}),e[9]=j,e[10]=f,e[11]=h,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=x,e[17]=p,e[18]=w):w=e[18];let k;e[19]!==N?(k=N&&s.jsx(bl,{}),e[19]=N,e[20]=k):k=e[20];let C;e[21]!==h||e[22]!==r||e[23]!==l||e[24]!==g||e[25]!==x?(C=s.jsx(ol,{open:l,onOpenChange:n,connectionId:r,currentLimitUsd:x,billingMode:h,currentLimitPeriod:g}),e[21]=h,e[22]=r,e[23]=l,e[24]=g,e[25]=x,e[26]=C):C=e[26];let A;return e[27]!==w||e[28]!==k||e[29]!==C?(A=s.jsxs(s.Fragment,{children:[w,k,C]}),e[27]=w,e[28]=k,e[29]=C,e[30]=A):A=e[30],A}function Ol(t){return t.structuredContent}function Dl(t){const e=E.c(20),{gatewayConnectionId:r}=t,[a,l]=v.useState("summary");let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(za,{variant:"underline",children:[s.jsx(Ye,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(Ye,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(Ye,{value:"history",variant:"underline",children:"History"})]}),e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&s.jsx(El,{connectionId:r}),e[2]=r,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(fl,{}),e[4]=d):d=e[4];let m;e[5]!==o?(m=s.jsxs(He,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[o,d]}),e[5]=o,e[6]=m):m=e[6];let c;e[7]!==a?(c=a==="breakdown"&&s.jsx(jl,{}),e[7]=a,e[8]=c):c=e[8];let u;e[9]!==c?(u=s.jsx(He,{value:"breakdown",className:"pt-2",children:c}),e[9]=c,e[10]=u):u=e[10];let f;e[11]!==a?(f=a==="history"&&s.jsx(Pl,{}),e[11]=a,e[12]=f):f=e[12];let x;e[13]!==f?(x=s.jsx(He,{value:"history",className:"pt-2",children:f}),e[13]=f,e[14]=x):x=e[14];let p;return e[15]!==a||e[16]!==m||e[17]!==u||e[18]!==x?(p=s.jsxs(s.Fragment,{children:[n,s.jsxs($a,{value:a,onValueChange:l,variant:"underline",children:[i,m,u,x]})]}),e[15]=a,e[16]=m,e[17]=u,e[18]=x,e[19]=p):p=e[19],p}function Ll(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ne,{className:"h-5 w-32"}),s.jsx(ne,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ne,{className:"h-28 rounded-xl"}),s.jsx(ne,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Tl(){const t=E.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class zl extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx(Tl,{}):this.props.children}}function $l(){const t=E.c(4),e=Ra();let r;t[0]!==e?(r=e.find(Ml),t[0]=e,t[1]=r):r=t[1];const l=r?.id??null;let n;return t[2]!==l?(n=s.jsx(Dl,{gatewayConnectionId:l}),t[2]=l,t[3]=n):n=t[3],n}function Ml(t){return Fa(t,Ua)}function Bl(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx(zl,{children:s.jsx(v.Suspense,{fallback:s.jsx(Ll,{}),children:s.jsx($l,{})})})}),t[0]=e):e=t[0],e}function ds(){const t=E.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ne,{className:"h-6 w-48"}),r=s.jsx(ne,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ne,{className:"h-12 w-full"}),s.jsx(ne,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Gl(t){const e=E.c(14),{projectSlug:r,children:a}=t,{org:l}=me(),{data:n,isLoading:i}=Et(l.id,r);if(i||!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ds,{}),e[0]=u):u=e[0],u}const o=r===Ee;let d;e[1]!==n.description||e[2]!==n.enabledPlugins||e[3]!==n.id||e[4]!==n.name||e[5]!==n.organizationId||e[6]!==n.slug||e[7]!==n.ui||e[8]!==o?(d={id:n.id,organizationId:n.organizationId,slug:n.slug,name:n.name,description:n.description,enabledPlugins:n.enabledPlugins,ui:n.ui,isOrgAdmin:o},e[1]=n.description,e[2]=n.enabledPlugins,e[3]=n.id,e[4]=n.name,e[5]=n.organizationId,e[6]=n.slug,e[7]=n.ui,e[8]=o,e[9]=d):d=e[9];const m=d;let c;return e[10]!==a||e[11]!==m||e[12]!==l?(c=s.jsx(It,{org:l,project:m,children:a}),e[10]=a,e[11]=m,e[12]=l,e[13]=c):c=e[13],c}function Rl(t){const e=E.c(6),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Va,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"org.general":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Za,{}),e[2]=a):a=e[2],a}case"org.plugins":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Gl,{projectSlug:Ee,children:s.jsx(Bs,{})}),e[3]=a):a=e[3],a}case"org.billing":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Bl,{}),e[4]=a):a=e[4],a}default:{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[5]=a):a=e[5],a}}}function Wl(){const t=E.c(23),{isOpen:e,activeSection:r,open:a,close:l}=bs();let n;t[0]!==l?(n=g=>!g&&l(),t[0]=l,t[1]=n):n=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[2]=i):i=t[2];let o;t[3]!==r||t[4]!==a?(o=s.jsx(v.Suspense,{fallback:i,children:s.jsx(Ka,{activeSection:r,onNavigate:a})}),t[3]=r,t[4]=a,t[5]=o):o=t[5];let d,m;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Lt,{size:16}),m=s.jsx("span",{className:"sr-only",children:"Close"}),t[6]=d,t[7]=m):(d=t[6],m=t[7]);let c;t[8]!==l?(c=s.jsxs("button",{type:"button",onClick:l,className:"sticky top-4 float-right mr-4 mt-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[d,m]}),t[8]=l,t[9]=c):c=t[9];let u;t[10]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ds,{}),t[10]=u):u=t[10];let f;t[11]!==r?(f=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:u,children:s.jsx(Rl,{section:r})})}),t[11]=r,t[12]=f):f=t[12];let x;t[13]!==c||t[14]!==f?(x=s.jsxs("div",{className:"flex-1 overflow-y-auto min-w-0 relative",children:[c,f]}),t[13]=c,t[14]=f,t[15]=x):x=t[15];let p;t[16]!==o||t[17]!==x?(p=s.jsx(Ot,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o,x]})}),t[16]=o,t[17]=x,t[18]=p):p=t[18];let h;return t[19]!==e||t[20]!==n||t[21]!==p?(h=s.jsx(Dt,{open:e,onOpenChange:n,children:p}),t[19]=e,t[20]=n,t[21]=p,t[22]=h):h=t[22],h}function Fl(t){const e=E.c(12),{projectSlug:r,orgSlug:a,error:l}=t,n=at();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=i):i=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==l.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:l.message}),e[3]=l.message,e[4]=d):d=e[4];let m;e[5]!==n||e[6]!==a?(m=s.jsx(ce,{variant:"link",onClick:()=>n({to:"/$org/$project",params:{org:a,project:Ee}}),children:"Go to organization home"}),e[5]=n,e[6]=a,e[7]=m):m=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==m?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,o,d,m]}),e[8]=o,e[9]=d,e[10]=m,e[11]=c):c=e[11],c}function Ul(t){const e=E.c(9),{projectSlug:r,orgSlug:a}=t,l=at();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=n):n=e[0];let i;e[1]!==r?(i=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==l||e[4]!==a?(o=s.jsx(ce,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ee}}),children:"Go to organization home"}),e[3]=l,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[n,i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function Kl(){const t=E.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=xs(e),{org:a}=me(),l=r.org,n=r.project,{data:i,isLoading:o,error:d}=Et(a.id,n);if(o){let h;return t[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Je,{}),t[1]=h):h=t[1],h}if(d){let h;return t[2]!==d||t[3]!==l||t[4]!==n?(h=s.jsx(Fl,{projectSlug:n,orgSlug:l,error:d}),t[2]=d,t[3]=l,t[4]=n,t[5]=h):h=t[5],h}if(!i){let h;return t[6]!==l||t[7]!==n?(h=s.jsx(Ul,{projectSlug:n,orgSlug:l}),t[6]=l,t[7]=n,t[8]=h):h=t[8],h}const m=i.slug===Ee;let c;t[9]!==i.description||t[10]!==i.enabledPlugins||t[11]!==i.id||t[12]!==i.name||t[13]!==i.organizationId||t[14]!==i.slug||t[15]!==i.ui||t[16]!==m?(c={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:m},t[9]=i.description,t[10]=i.enabledPlugins,t[11]=i.id,t[12]=i.name,t[13]=i.organizationId,t[14]=i.slug,t[15]=i.ui,t[16]=m,t[17]=c):c=t[17];const u=c;let f,x;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(Je,{}),children:s.jsx(ps,{})}),x=s.jsx(Wl,{}),t[18]=f,t[19]=x):(f=t[18],x=t[19]);let p;return t[20]!==u||t[21]!==a?(p=s.jsxs(It,{org:a,project:u,children:[f,x]}),t[20]=u,t[21]=a,t[22]=p):p=t[22],p}function Wn(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(Je,{}),children:s.jsx(Kl,{})}),t[0]=e):e=t[0],e}export{Wn as default};
|
|
1
|
+
import{r as v,c as E,f as st,j as s,z as ue,x as Pe,o as us,n as Be,e as at,u as me,w as _t,t as ms,q as fs,K as mt,B as ce,c7 as Pt,O as Ee,P as It,S as Je,g as xs,au as ps}from"./index-CzhqcVNy.js";import{u as Et}from"./use-project-O2tBNyfQ.js";import{c as hs,d as gs,b as vs,a as Ot,D as Dt}from"./dialog-DXMtLbOt.js";import{i as Lt}from"./X-LrH2dki2.js";import{S as ne}from"./skeleton-LSt15V1C.js";import{t as ys,i as rt,u as bs}from"./use-settings-modal-Cb5fjZOk.js";import{A as Tt}from"./avatar-DMHAVN2G.js";import{t as js}from"./Settings01-C_OWZaLW.js";import{i as Ns}from"./Zap-Cx7CJpzQ.js";import{a as Ss,b as ws,c as Cs,T as ks}from"./tooltip-B-2Ty_iR.js";import{i as As}from"./Check-D30Nw_2C.js";import{a as _s}from"./Copy01-xLxETA4z.js";import{S as Ze}from"./switch-CsOlnIJv.js";import{S as Ps,a as Is,d as Ge,c as Es}from"./select-DhCocnGM.js";import{i as Os}from"./Code01-BOUu51ck.js";import{i as Ds}from"./Shield01-Blnh5_zF.js";import{u as Ls}from"./use-preferences-CBTWTfUK.js";import{u as Ts}from"./useMutation-BLMqKfMt.js";import{a as zs,F as Re,b as We,c as Fe,d as Ue,f as Ke,e as $s}from"./form-Ndm9rRCe.js";import{I as Ie}from"./input-CaHgq6JC.js";import{i as Ms}from"./Upload01-DA4ZJJnb.js";import{P as Bs}from"./project-plugins-FyEUKPb1.js";import{u as Gs,a as Rs,b as Ws,i as ie,r as lt,D as zt,c as $e,d as fe,s as ft,e as xt,Z as $t,g as Mt,f as Bt,h as Gt,j as Ae,k as nt,l as Me,m as it,n as Fs,o as Us,p as Rt,q as ot,t as ct,v as Wt,w as Ks,x as Ft,y as pt,z as Vs,A as Ys,B as Hs,R as qs,S as Qs,C as Xs,E as Js,F as Ut,G as Zs,H as ea,I as ta,J as sa,K as aa,L as ra,M as la,N as na,O as De,P as ia,Q as ht,T as gt,U as vt,V as oa,W as Kt,X as ca,Y as Ne,_ as da,$ as ua,a0 as ma,a1 as fa,a2 as xa,a3 as Ve,a4 as pa,a5 as Le,a6 as ha,a7 as J,a8 as Vt,a9 as ga,aa as va,ab as ya,ac as ba,ad as ja,ae as Na,af as Sa,ag as wa,ah as Ca,ai as ka,aj as Aa,ak as _a,al as Pa,am as Ia,an as Ea,ao as Oa,ap as Da,aq as La}from"./chart-DOQ1KDh7.js";import{L as _e}from"./label-ZRpbI7Sm.js";import{B as Ta}from"./badge-ChDtoe7k.js";import{a as za,T as Ye,b as He,c as $a}from"./tabs-d2vBhIp6.js";import{i as Ma}from"./AlertCircle-CLSQ0NLi.js";import{s as Yt}from"./Plus-vjPXrbll.js";import{s as Ba}from"./RefreshCcw01-C1dtrtd7.js";import{u as ke,a as dt,K as Ga}from"./constants-OpiJAgZI.js";import{b as Ra}from"./use-connection-CkLGBugg.js";import{b as oe,a as Ht}from"./use-mcp-tools-_SrEx2Yc.js";import{u as Wa}from"./use-members-Bg7suFno.js";import{c as Fa,A as Ua}from"./use-binding-CHcWA4CU.js";import"./useQuery-BtUsJRrm.js";import"./index-Dq7847Un.js";import"./ChevronDown-C7zTxlHE.js";import"./localstorage-keys-CL6qU9e5.js";import"./Container-BXYdiT-J.js";import"./use-install-from-registry-rEwcMxvA.js";import"./extract-connection-data-CYsp_UMA.js";import"./constants-CUyJcaN8.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-sGbNqghw.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-DoI38kJv.js";import"./index-BUZqKnhc.js";import"./use-collections-C8v6HwyA.js";import"./binder-BSp18fmP.js";const qt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));qt.displayName="Bell01";function Ka(t){const e=E.c(25),{activeSection:r,onNavigate:a}=t,{data:l}=st.useSession(),n=l?.user,i=n?.image,o=n?.name??"Profile",d=n?.name??"U";let m;e[0]!==d||e[1]!==i?(m=s.jsx(Tt,{url:i,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=i,e[2]=m):m=e[2];let c;e[3]!==o||e[4]!==m?(c={key:"account.profile",label:o,icon:m},e[3]=o,e[4]=m,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={key:"account.preferences",label:"Preferences",icon:s.jsx(js,{size:14})},e[6]=u):u=e[6];let f;e[7]!==c?(f=[c,u],e[7]=c,e[8]=f):f=e[8];const x=f;let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.general",label:"General",icon:s.jsx(ys,{size:14})},e[9]=p):p=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h={key:"org.plugins",label:"Features",icon:s.jsx(Ns,{size:14})},e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=[p,h,{key:"org.billing",label:"Billing",icon:s.jsx(rt,{size:14})}],e[11]=g):g=e[11];const y=g;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[12]=S):S=e[12];let j;e[13]!==x||e[14]!==r||e[15]!==a?(j=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[S,x.map(C=>s.jsxs("button",{type:"button",onClick:()=>a(C.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===C.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:C.icon}),s.jsx("span",{className:"truncate",children:C.label})]},C.key))]}),e[13]=x,e[14]=r,e[15]=a,e[16]=j):j=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[17]=b):b=e[17];let N;e[18]!==r||e[19]!==a?(N=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[b,y.map(C=>s.jsxs("button",{type:"button",onClick:()=>a(C.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===C.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:C.icon}),s.jsx("span",{className:"truncate",children:C.label})]},C.key))]}),e[18]=r,e[19]=a,e[20]=N):N=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.162.2"]})}),e[21]=w):w=e[21];let k;return e[22]!==j||e[23]!==N?(k=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[j,N,w]}),e[22]=j,e[23]=N,e[24]=k):k=e[24],k}function Va(){const t=E.c(32),{data:e}=st.useSession(),[r,a]=v.useState(!1),l=e?.user,n=l?.image;let i;t[0]!==l?(i=()=>{l?.id&&navigator.clipboard.writeText(l.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=l,t[1]=i):i=t[1];const o=i;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const m=l?.name??"U";let c;t[3]!==m||t[4]!==n?(c=s.jsx(Tt,{url:n,fallback:m,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=m,t[4]=n,t[5]=c):c=t[5];const u=l?.name??"User";let f;t[6]!==u?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:u}),t[6]=u,t[7]=f):f=t[7];const x=l?.email;let p;t[8]!==x?(p=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),t[8]=x,t[9]=p):p=t[9];let h;t[10]!==f||t[11]!==p?(h=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,p]}),t[10]=f,t[11]=p,t[12]=h):h=t[12];let g;t[13]!==c||t[14]!==h?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,h]}),t[13]=c,t[14]=h,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=S):S=t[17];const j=l?.id;let b;t[18]!==j?(b=s.jsx("span",{className:"font-mono text-sm",children:j}),t[18]=j,t[19]=b):b=t[19];let N;t[20]!==r?(N=r?s.jsx(As,{size:14,className:"text-green-600 shrink-0"}):s.jsx(_s,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=N):N=t[21];let w;t[22]!==o||t[23]!==b||t[24]!==N?(w=s.jsx(Ss,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,N]})}),t[22]=o,t[23]=b,t[24]=N,t[25]=w):w=t[25];let k;t[26]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ws,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=k):k=t[26];let C;t[27]!==w?(C=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[S,s.jsx(Cs,{children:s.jsxs(ks,{children:[w,k]})})]})]}),t[27]=w,t[28]=C):C=t[28];let A;return t[29]!==C||t[30]!==g?(A=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,C]}),t[29]=C,t[30]=g,t[31]=A):A=t[31],A}function qe(t){const e=E.c(27),{icon:r,label:a,description:l,control:n,onClick:i,disabled:o}=t,d=o?void 0:i,m=i?"button":void 0,c=i&&!o?0:void 0;let u;e[0]!==o||e[1]!==i?(u=i&&!o?N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),i())}:void 0,e[0]=o,e[1]=i,e[2]=u):u=e[2];const f=i&&!o?"pointer":void 0;let x;e[3]!==f?(x={cursor:f},e[3]=f,e[4]=x):x=e[4];let p;e[5]!==r?(p=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=p):p=e[6];let h;e[7]!==a?(h=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=h):h=e[8];let g;e[9]!==l?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[9]=l,e[10]=g):g=e[10];let y;e[11]!==h||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[h,g]}),e[11]=h,e[12]=g,e[13]=y):y=e[13];let S;e[14]!==y||e[15]!==p?(S=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[p,y]}),e[14]=y,e[15]=p,e[16]=S):S=e[16];let j;e[17]!==n?(j=s.jsx("div",{onClick:Ya,className:"shrink-0",children:n}),e[17]=n,e[18]=j):j=e[18];let b;return e[19]!==d||e[20]!==S||e[21]!==j||e[22]!==m||e[23]!==c||e[24]!==u||e[25]!==x?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:m,tabIndex:c,onKeyDown:u,style:x,children:[S,j]}),e[19]=d,e[20]=S,e[21]=j,e[22]=m,e[23]=c,e[24]=u,e[25]=x,e[26]=b):b=e[26],b}function Ya(t){return t.stopPropagation()}function yt(){const t=E.c(35),[e,r]=Ls();let a;t[0]!==r?(a=async k=>{if(k&&await Notification.requestPermission()!=="granted"){Pe.error("Notifications denied. Please enable them in your browser settings."),r(qa);return}r(C=>({...C,enableNotifications:k}))},t[0]=r,t[1]=a):a=t[1];const l=a;let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=n):n=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Os,{size:16}),t[3]=i):i=t[3];let o;t[4]!==r?(o=()=>r(Ha),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=k=>r(C=>({...C,devMode:k})),t[6]=r,t[7]=d):d=t[7];let m;t[8]!==e.devMode||t[9]!==d?(m=s.jsx(Ze,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=m):m=t[10];let c;t[11]!==o||t[12]!==m?(c=s.jsx(qe,{icon:i,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:m}),t[11]=o,t[12]=m,t[13]=c):c=t[13];let u;t[14]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(qt,{size:16}),t[14]=u):u=t[14];let f;t[15]!==l||t[16]!==e.enableNotifications?(f=s.jsx(qe,{icon:u,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>l(!e.enableNotifications),control:s.jsx(Ze,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:l})}),t[15]=l,t[16]=e.enableNotifications,t[17]=f):f=t[17];let x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ds,{size:16}),t[18]=x):x=t[18];let p;t[19]!==r?(p=k=>r(C=>({...C,toolApprovalLevel:k})),t[19]=r,t[20]=p):p=t[20];let h;t[21]===Symbol.for("react.memo_cache_sentinel")?(h={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[21]=h):h=t[21];const g=h[e.toolApprovalLevel];let y;t[22]!==g?(y=s.jsx(Is,{className:"w-36",children:s.jsx("span",{children:g})}),t[22]=g,t[23]=y):y=t[23];let S;t[24]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ge,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=S):S=t[24];let j;t[25]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ge,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=j):j=t[25];let b;t[26]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs(Es,{children:[S,j,s.jsx(Ge,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=b):b=t[26];let N;t[27]!==e.toolApprovalLevel||t[28]!==p||t[29]!==y?(N=s.jsx(qe,{icon:x,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Ps,{value:e.toolApprovalLevel,onValueChange:p,children:[y,b]})}),t[27]=e.toolApprovalLevel,t[28]=p,t[29]=y,t[30]=N):N=t[30];let w;return t[31]!==N||t[32]!==c||t[33]!==f?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[n,s.jsxs("div",{className:"flex flex-col",children:[c,f,N]})]}),t[31]=N,t[32]=c,t[33]=f,t[34]=w):w=t[34],w}function Ha(t){return{...t,devMode:!t.devMode}}function qa(t){return{...t,enableNotifications:!1}}const Qa=us({name:Be().min(1,"Name is required").max(255,"Name is too long"),slug:Be().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Be().optional()});function Xa(t){const e=E.c(24),{value:r,onChange:a,name:l}=t,n=v.useRef(null);let i;e[0]!==a?(i=b=>{const N=b.target.files?.[0];if(N){if(N.size>2097152){Pe.error("Image must be smaller than 2MB");return}const w=new FileReader;w.onerror=()=>{const k=w.error;console.error("FileReader error:",k),Pe.error(k?.message||"Failed to read image file. Please try again."),n.current&&(n.current.value="")},w.onloadend=()=>{if(w.readyState===FileReader.DONE&&w.result){const k=w.result;a(k)}},w.readAsDataURL(N)}},e[0]=a,e[1]=i):i=e[1];const o=i;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{n.current?.click()},e[2]=d):d=e[2];const m=d;let c;e[3]!==a?(c=b=>{b.stopPropagation(),a("")},e[3]=a,e[4]=c):c=e[4];const u=c;let f;e[5]!==o?(f=s.jsx("input",{type:"file",ref:n,className:"hidden",accept:"image/*",onChange:o}),e[5]=o,e[6]=f):f=e[6];let x;e[7]!==u||e[8]!==l||e[9]!==r?(x=r?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:r,alt:l||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:u,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Lt,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:m,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(Ms,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=u,e[8]=l,e[9]=r,e[10]=x):x=e[10];const p=r?"Change Logo":"Upload Logo";let h;e[11]!==p?(h=s.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:m,className:"mb-2",children:p}),e[11]=p,e[12]=h):h=e[12];let g;e[13]!==u||e[14]!==r?(g=r&&s.jsx(ce,{type:"button",variant:"ghost",size:"sm",onClick:u,className:"ml-2",children:"Remove"}),e[13]=u,e[14]=r,e[15]=g):g=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=y):y=e[16];let S;e[17]!==h||e[18]!==g?(S=s.jsxs("div",{className:"flex-1",children:[h,g,y]}),e[17]=h,e[18]=g,e[19]=S):S=e[19];let j;return e[20]!==S||e[21]!==f||e[22]!==x?(j=s.jsxs("div",{className:"flex items-start gap-4",children:[f,x,S]}),e[20]=S,e[21]=f,e[22]=x,e[23]=j):j=e[23],j}function Ja(){const t=at(),{org:e,project:r}=me(),a=_t(),[l,n]=v.useState(!1),i=ms({resolver:fs(Qa),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Ts({mutationFn:async c=>{const u={name:c.name,slug:c.slug};c.logo&&(u.logo=c.logo);const f=await st.organization.update({organizationId:e.id,data:u});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:mt.organizations()}),a.invalidateQueries({queryKey:mt.activeOrganization(e.slug)}),Pe.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Pe.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{n(!1)}}),d=c=>{n(!0),o.mutate(c)},m=i.formState.isDirty;return s.jsx(zs,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(d),className:"space-y-6",children:[s.jsx(Re,{control:i.control,name:"name",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Organization Name"}),s.jsx(Ue,{children:s.jsx(Ie,{placeholder:"My Organization",...c,disabled:l})}),s.jsx(Ke,{})]})}),s.jsx(Re,{control:i.control,name:"slug",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Organization Slug"}),s.jsx(Ue,{children:s.jsx(Ie,{placeholder:"my-organization",...c,disabled:l,onChange:u=>{const f=u.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx($s,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(Ke,{})]})}),s.jsx(Re,{control:i.control,name:"logo",render:({field:c})=>s.jsxs(We,{children:[s.jsx(Fe,{children:"Logo"}),s.jsx(Ue,{children:s.jsx(Xa,{value:c.value,onChange:c.onChange,name:i.watch("name")})}),s.jsx(Ke,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(ce,{type:"submit",disabled:!m||l,className:"min-w-24",children:l?"Saving...":"Save Changes"}),m&&s.jsx(ce,{type:"button",variant:"outline",onClick:()=>i.reset(),disabled:l,children:"Cancel"})]})]})})}function Za(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(Ja,{})]}),t[0]=e):e=t[0],e}var bt=function(e,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),n=2;n<a;n++)l[n-2]=arguments[n];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;console.warn(r.replace(/%s/g,()=>l[i++]))}},er=["x1","y1","x2","y2","key"],tr=["offset"],sr=["xAxisId","yAxisId"],ar=["xAxisId","yAxisId"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(a){rr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function rr(t,e,r){return(e=lr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lr(t){var e=nr(t,"string");return typeof e=="symbol"?e:e+""}function nr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function Te(t,e){if(t==null)return{};var r,a,l=ir(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function ir(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var or=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:l,width:n,height:i,ry:o}=t;return v.createElement("rect",{x:a,y:l,ry:o,width:n,height:i,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Qt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var l,{x1:n,y1:i,x2:o,y2:d,key:m}=r,c=Te(r,er),u=(l=nt(c))!==null&&l!==void 0?l:{},{offset:f}=u,x=Te(u,tr);a=v.createElement("line",xe({},x,{x1:n,y1:i,x2:o,y2:d,fill:"none",key:m}))}return a}function cr(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:n,yAxisId:i}=t,o=Te(t,sr),d=l.map((m,c)=>{var u=Z(Z({},o),{},{x1:e,y1:m,x2:e+r,y2:m,key:"line-".concat(c),index:c});return v.createElement(Qt,{key:"line-".concat(c),option:a,lineItemProps:u})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function dr(t){var{y:e,height:r,vertical:a=!0,verticalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:n,yAxisId:i}=t,o=Te(t,ar),d=l.map((m,c)=>{var u=Z(Z({},o),{},{x1:m,y1:e,x2:m,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Qt,{option:a,lineItemProps:u,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function ur(t){var{horizontalFill:e,fillOpacity:r,x:a,y:l,width:n,height:i,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var m=o.map(u=>Math.round(u+l-l)).sort((u,f)=>u-f);l!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var x=m[f+1],p=x==null,h=p?l+i-u:x-u;if(h<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:u,x:a,height:h,width:n,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function mr(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:l,y:n,width:i,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var m=d.map(u=>Math.round(u+l-l)).sort((u,f)=>u-f);l!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var x=m[f+1],p=x==null,h=p?l+i-u:x-u;if(h<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:u,y:n,width:h,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var fr=(t,e)=>{var{xAxis:r,width:a,height:l,offset:n}=t;return Mt(Bt(Z(Z(Z({},Ae),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.left,n.left+n.width,e)},xr=(t,e)=>{var{yAxis:r,width:a,height:l,offset:n}=t;return Mt(Bt(Z(Z(Z({},Ae),r),{},{ticks:Gt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.top,n.top+n.height,e)},pr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:zt.grid};function Xt(t){var e=Gs(),r=Rs(),a=Ws(),l=Z(Z({},lt(t,pr)),{},{x:ie(t.x)?t.x:a.left,y:ie(t.y)?t.y:a.top,width:ie(t.width)?t.width:a.width,height:ie(t.height)?t.height:a.height}),{xAxisId:n,yAxisId:i,x:o,y:d,width:m,height:c,syncWithTicks:u,horizontalValues:f,verticalValues:x}=l,p=$e(),h=fe(A=>ft(A,"xAxis",n,p)),g=fe(A=>ft(A,"yAxis",i,p));if(!xt(m)||!xt(c)||!ie(o)||!ie(d))return null;var y=l.verticalCoordinatesGenerator||fr,S=l.horizontalCoordinatesGenerator||xr,{horizontalPoints:j,verticalPoints:b}=l;if((!j||!j.length)&&typeof S=="function"){var N=f&&f.length,w=S({yAxis:g?Z(Z({},g),{},{ticks:N?f:g.ticks}):void 0,width:e??m,height:r??c,offset:a},N?!0:u);bt(Array.isArray(w),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof w,"]")),Array.isArray(w)&&(j=w)}if((!b||!b.length)&&typeof y=="function"){var k=x&&x.length,C=y({xAxis:h?Z(Z({},h),{},{ticks:k?x:h.ticks}):void 0,width:e??m,height:r??c,offset:a},k?!0:u);bt(Array.isArray(C),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof C,"]")),Array.isArray(C)&&(b=C)}return v.createElement($t,{zIndex:l.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(or,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),v.createElement(ur,xe({},l,{horizontalPoints:j})),v.createElement(mr,xe({},l,{verticalPoints:b})),v.createElement(cr,xe({},l,{offset:a,horizontalPoints:j,xAxis:h,yAxis:g})),v.createElement(dr,xe({},l,{offset:a,verticalPoints:b,xAxis:h,yAxis:g}))))}Xt.displayName="CartesianGrid";var Jt=(t,e,r)=>Rt(t,"xAxis",ot(t,e),r),Zt=(t,e,r)=>Wt(t,"xAxis",ot(t,e),r),es=(t,e,r)=>Rt(t,"yAxis",ct(t,e),r),ts=(t,e,r)=>Wt(t,"yAxis",ct(t,e),r),hr=Me([it,Jt,es,Zt,ts],(t,e,r,a,l)=>Ft(t,"xAxis")?pt(e,a,!1):pt(r,l,!1)),gr=(t,e)=>e,ss=Me([Vs,gr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),as=t=>{var e=it(t),r=Ft(e,"xAxis");return r?"yAxis":"xAxis"},vr=(t,e)=>{var r=as(t);return r==="yAxis"?ct(t,e):ot(t,e)},yr=(t,e,r)=>Ys(t,as(t),vr(t,e),r),br=Me([ss,yr],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,l=Ks(t);if(!(a==null||l==null)){var n=(r=e[a])===null||r===void 0?void 0:r.stackedData,i=n?.find(o=>o.key===l);if(i!=null)return i.map(o=>[o[0],o[1]])}}}),jr=Me([it,Jt,es,Zt,ts,br,Fs,hr,ss,Us],(t,e,r,a,l,n,i,o,d,m)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:f}=i;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||l==null||a.length===0||l.length===0||o==null)){var{data:x}=d,p;if(x&&x.length>0?p=x:p=c?.slice(u,f+1),p!=null)return Rr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:l,dataStartIndex:u,areaSettings:d,stackedData:n,displayedData:p,chartBaseValue:m,bandSize:o})}}),Nr=["id"],Sr=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function rs(t,e){if(t==null)return{};var r,a,l=wr(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function wr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){Cr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Cr(t,e,r){return(e=kr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kr(t){var e=Ar(t,"string");return typeof e=="symbol"?e:e+""}function Ar(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ze(t,e){return t&&t!=="none"?t:e}var _r=t=>{var{dataKey:e,name:r,stroke:a,fill:l,legendType:n,hide:i}=t;return[{inactive:i,dataKey:e,type:n,color:ze(a,l),value:Ut(r,e),payload:t}]},Pr=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:l,fill:n,name:i,hide:o,unit:d,tooltipType:m,id:c}=t,u={dataDefinedOnItem:r,getPosition:ea,settings:{stroke:a,strokeWidth:l,fill:n,dataKey:e,nameKey:void 0,name:Ut(i,e),hide:o,type:m,color:ze(a,n),unit:d,graphicalItemId:c}};return v.createElement(Zs,{tooltipEntrySettings:u})});function Ir(t){var{clipPathId:e,points:r,props:a}=t,{needClip:l,dot:n,dataKey:i}=a,o=nt(a);return v.createElement(pa,{points:r,dot:n,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:i,baseProps:o,needClip:l,clipPathId:e})}function Er(t){var{showLabels:e,children:r,points:a}=t,l=a.map(n=>{var i,o,d={x:(i=n.x)!==null&&i!==void 0?i:0,y:(o=n.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:n.value,payload:n.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(fa,{value:e?l:void 0},r)}function St(t){var{points:e,baseLine:r,needClip:a,clipPathId:l,props:n}=t,{layout:i,type:o,stroke:d,connectNulls:m,isRange:c}=n,{id:u}=n,f=rs(n,Nr),x=nt(f),p=xa(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(De,{clipPath:a?"url(#clipPath-".concat(l,")"):void 0},v.createElement(Ve,pe({},p,{id:u,points:e,connectNulls:m,type:o,baseLine:r,layout:i,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Ve,pe({},x,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:e})),d!=="none"&&c&&Array.isArray(r)&&v.createElement(Ve,pe({},x,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:r}))),v.createElement(Ir,{points:e,props:f,clipPathId:l}))}function Or(t){var e,r,{alpha:a,baseLine:l,points:n,strokeWidth:i}=t,o=(e=n[0])===null||e===void 0?void 0:e.y,d=(r=n[n.length-1])===null||r===void 0?void 0:r.y;if(!Le(o)||!Le(d))return null;var m=a*Math.abs(o-d),c=Math.max(...n.map(u=>u.x||0));return ie(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(u=>u.x||0),c)),ie(c)?v.createElement("rect",{x:0,y:o<d?o:o-m,width:c+(i?parseInt("".concat(i),10):1),height:Math.floor(m)}):null}function Dr(t){var e,r,{alpha:a,baseLine:l,points:n,strokeWidth:i}=t,o=(e=n[0])===null||e===void 0?void 0:e.x,d=(r=n[n.length-1])===null||r===void 0?void 0:r.x;if(!Le(o)||!Le(d))return null;var m=a*Math.abs(o-d),c=Math.max(...n.map(u=>u.y||0));return ie(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(u=>u.y||0),c)),ie(c)?v.createElement("rect",{x:o<d?o:o-m,y:0,width:m,height:Math.floor(c+(i?parseInt("".concat(i),10):1))}):null}function Lr(t){var{alpha:e,layout:r,points:a,baseLine:l,strokeWidth:n}=t;return r==="vertical"?v.createElement(Or,{alpha:e,points:a,baseLine:l,strokeWidth:n}):v.createElement(Dr,{alpha:e,points:a,baseLine:l,strokeWidth:n})}function Tr(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n}=t,{points:i,baseLine:o,isAnimationActive:d,animationBegin:m,animationDuration:c,animationEasing:u,onAnimationStart:f,onAnimationEnd:x}=a,p=v.useMemo(()=>({points:i,baseLine:o}),[i,o]),h=oa(p,"recharts-area-"),g=Kt(),[y,S]=v.useState(!1),j=!y,b=v.useCallback(()=>{typeof x=="function"&&x(),S(!1)},[x]),N=v.useCallback(()=>{typeof f=="function"&&f(),S(!0)},[f]);if(g==null)return null;var w=l.current,k=n.current;return v.createElement(Er,{showLabels:j,points:i},a.children,v.createElement(ca,{animationId:h,begin:m,duration:c,isActive:d,easing:u,onAnimationEnd:b,onAnimationStart:N,key:h},C=>{if(w){var A=w.length/i.length,I=C===1?i:i.map((_,O)=>{var L=Math.floor(O*A);if(w[L]){var D=w[L];return Se(Se({},_),{},{x:Ne(D.x,_.x,C),y:Ne(D.y,_.y,C)})}return _}),z;return ie(o)?z=Ne(k,o,C):da(o)||ua(o)?z=Ne(k,0,C):z=o.map((_,O)=>{var L=Math.floor(O*A);if(Array.isArray(k)&&k[L]){var D=k[L];return Se(Se({},_),{},{x:Ne(D.x,_.x,C),y:Ne(D.y,_.y,C)})}return _}),C>0&&(l.current=I,n.current=z),v.createElement(St,{points:I,baseLine:z,needClip:e,clipPathId:r,props:a})}return C>0&&(l.current=i,n.current=o),v.createElement(De,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(Lr,{alpha:C,points:i,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(De,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(St,{points:i,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(ma,{label:a.label}))}function zr(t){var{needClip:e,clipPathId:r,props:a}=t,l=v.useRef(null),n=v.useRef();return v.createElement(Tr,{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n})}class $r extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:l,top:n,left:i,needClip:o,xAxisId:d,yAxisId:m,width:c,height:u,id:f,baseLine:x,zIndex:p}=this.props;if(e)return null;var h=Pt("recharts-area",l),g=f,{r:y,strokeWidth:S}=la(r),j=na(r),b=y*2+S,N=o?"url(#clipPath-".concat(j?"":"dots-").concat(g,")"):void 0;return v.createElement($t,{zIndex:p},v.createElement(De,{className:h},o&&v.createElement("defs",null,v.createElement(ia,{clipPathId:g,xAxisId:d,yAxisId:m}),!j&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:i-b/2,y:n-b/2,width:c+b,height:u+b}))),v.createElement(zr,{needClip:o,clipPathId:g,props:this.props})),v.createElement(ht,{points:a,mainColor:ze(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:N}),this.props.isRange&&Array.isArray(x)&&v.createElement(ht,{points:x,mainColor:ze(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:N}))}}var Mr={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:zt.area};function Br(t){var e,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,connectNulls:i,dot:o,fill:d,fillOpacity:m,hide:c,isAnimationActive:u,legendType:f,stroke:x,xAxisId:p,yAxisId:h}=t,g=rs(t,Sr),y=ta(),S=sa(),{needClip:j}=aa(p,h),b=$e(),{points:N,isRange:w,baseLine:k}=(e=fe(O=>jr(O,t.id,b)))!==null&&e!==void 0?e:{},C=ra();if(y!=="horizontal"&&y!=="vertical"||C==null||S!=="AreaChart"&&S!=="ComposedChart")return null;var{height:A,width:I,x:z,y:_}=C;return!N||!N.length?null:v.createElement($r,pe({},g,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,baseLine:k,connectNulls:i,dot:o,fill:d,fillOpacity:m,height:A,hide:c,layout:y,isAnimationActive:u,isRange:w,legendType:f,needClip:j,points:N,stroke:x,width:I,left:z,top:_,xAxisId:p,yAxisId:h}))}var Gr=(t,e,r,a,l)=>{var n=r??e;if(ie(n))return n;var i=t==="horizontal"?l:a,o=i.scale.domain();if(i.type==="number"){var d=Math.max(o[0],o[1]),m=Math.min(o[0],o[1]);return n==="dataMin"?m:n==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return n==="dataMin"?o[0]:n==="dataMax"?o[1]:o[0]};function Rr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:l,layout:n,chartBaseValue:i,xAxis:o,yAxis:d,displayedData:m,dataStartIndex:c,xAxisTicks:u,yAxisTicks:f,bandSize:x}=t,p=l&&l.length,h=Gr(n,i,r,o,d),g=n==="horizontal",y=!1,S=m.map((b,N)=>{var w,k,C,A;if(p)A=l[c+N];else{var I=gt(b,a);Array.isArray(I)?(A=I,y=!0):A=[h,I]}var z=(w=(k=A)===null||k===void 0?void 0:k[1])!==null&&w!==void 0?w:null,_=z==null||p&&!e&>(b,a)==null;if(g){var O;return{x:vt({axis:o,ticks:u,bandSize:x,entry:b,index:N}),y:_?null:(O=d.scale.map(z))!==null&&O!==void 0?O:null,value:A,payload:b}}return{x:_?null:(C=o.scale.map(z))!==null&&C!==void 0?C:null,y:vt({axis:d,ticks:f,bandSize:x,entry:b,index:N}),value:A,payload:b}}),j;return p||y?j=S.map(b=>{var N,w=Array.isArray(b.value)?b.value[0]:null;if(g){var k;return{x:b.x,y:w!=null&&b.y!=null&&(k=d.scale.map(w))!==null&&k!==void 0?k:null,payload:b.payload}}return{x:w!=null&&(N=o.scale.map(w))!==null&&N!==void 0?N:null,y:b.y,payload:b.payload}}):j=g?d.scale.map(h):o.scale.map(h),{points:S,baseLine:j??0,isRange:y}}function Wr(t){var e=lt(t,Mr),r=$e();return v.createElement(qs,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(Qs,{legendPayload:_r(e)}),v.createElement(Pr,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(Xs,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:Js(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Br,pe({},e,{id:a}))))}var ls=v.memo(Wr,Hs);ls.displayName="Area";var Fr=["type"],Ur=["dangerouslySetInnerHTML","ticks","scale"],Kr=["id","scale"];function et(){return et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},et.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(a){Vr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Vr(t,e,r){return(e=Yr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yr(t){var e=Hr(t,"string");return typeof e=="symbol"?e:e+""}function Hr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tt(t,e){if(t==null)return{};var r,a,l=qr(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function qr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Qr(t){var e=Vt(),r=v.useRef(null),a=Kt(),{type:l}=t,n=tt(t,Fr),i=_a(a,"yAxis",l),o=v.useMemo(()=>{if(i!=null)return Ct(Ct({},n),{},{type:i})},[i,n]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(ga(o)):r.current!==o&&e(va({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ya(r.current)),r.current=null)},[e]),null}function Xr(t){var{yAxisId:e,className:r,width:a,label:l}=t,n=v.useRef(null),i=v.useRef(null),o=fe(ba),d=$e(),m=Vt(),c="yAxis",u=fe(w=>ja(w,e)),f=fe(w=>Na(w,e)),x=fe(w=>Sa(w,c,e,d)),p=fe(w=>wa(w,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!u||Ca(l)||v.isValidElement(l)||p==null)){var w=n.current;if(w){var k=w.getCalculatedWidth();Math.round(u.width)!==Math.round(k)&&m(ka({id:e,width:k}))}}},[x,u,m,l,e,a,p]),u==null||f==null||p==null)return null;var{dangerouslySetInnerHTML:h,ticks:g,scale:y}=t,S=tt(t,Ur),{id:j,scale:b}=p,N=tt(p,Kr);return v.createElement(Aa,et({},S,N,{ref:n,labelRef:i,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:u.width,height:u.height,className:Pt("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:x,axisType:c,axisId:e}))}var Jr={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:Ae.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:Ae.tickLine,tickSize:Ae.tickSize,type:J.type,niceTicks:J.niceTicks,width:J.width,yAxisId:0},Zr=t=>{var e=lt(t,Jr);return v.createElement(v.Fragment,null,v.createElement(Qr,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter,niceTicks:e.niceTicks}),v.createElement(Xr,e))},ns=v.memo(Zr,ha);ns.displayName="YAxis";var el=["axis"],tl=v.forwardRef((t,e)=>v.createElement(Pa,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:el,tooltipPayloadSearcher:Ia,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function ut(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const l=new Date(r),n=t==="7d"?7:t==="30d"?30:90;return l.setDate(l.getDate()-n),{startDate:l.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function K(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const is="gateway-chip-period";function sl(){try{const t=localStorage.getItem(is);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function al(t){try{localStorage.setItem(is,t)}catch{}}const rl={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},ll={daily:"daily",weekly:"weekly",monthly:"monthly"},nl=[5,10,25,50,100],il=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function ol(t){const e=E.c(51),{open:r,onOpenChange:a,connectionId:l,currentLimitUsd:n,billingMode:i,currentLimitPeriod:o}=t,{org:d}=me(),[m,c]=v.useState(null),[u,f]=v.useState(""),[x,p]=v.useState(null),[h,g]=v.useState(null),[y,S]=v.useState(o??"none");let j;e[0]!==l||e[1]!==d.id?(j={connectionId:l,orgId:d.id},e[0]=l,e[1]=d.id,e[2]=j):j=e[2];const b=ke(j);let N;e[3]!==b?(N={client:b},e[3]=b,e[4]=N):N=e[4];const{mutate:w,isPending:k}=Ht(N),C=_t(),A=i==="postpaid";let I;e[5]!==u?(I=u?Number.parseFloat(u):null,e[5]=u,e[6]=I):I=e[6];const _=m??I,O=y==="none"?null:y,L=A&&_!=null&&_===n&&O===o;let D;e[7]!==b?(D=Ga.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=D):D=e[8];const G=D;let V;e[9]!==G||e[10]!==C?(V=async()=>{await C.invalidateQueries({queryKey:G,exact:!0}),await C.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=C,e[11]=V):V=e[11];const F=V;let T,$;e[12]!==i||e[13]!==o||e[14]!==n||e[15]!==_||e[16]!==A||e[17]!==y||e[18]!==w||e[19]!==a||e[20]!==F?($=()=>{if(!_||_<=0)return;const B=A?_:n+_;g(null);const ae={limit_usd:B,billing_mode:i,return_url:window.location.href};A&&(ae.limit_period=y),w({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await F(),te?.checkout_url?p(te.checkout_url):T()},onError:re=>{g(re.message??"Failed to update limit.")}})},T=()=>{c(null),f(""),p(null),g(null),S(o??"none"),a(!1)},e[12]=i,e[13]=o,e[14]=n,e[15]=_,e[16]=A,e[17]=y,e[18]=w,e[19]=a,e[20]=F,e[21]=T,e[22]=$):(T=e[21],$=e[22]);const Y=A?"Configure Spending Limit":"Add Credit",H=A?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=A?"New limit":"Select amount",U=A?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(hs,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(gs,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let R;e[27]!==q||e[28]!==ee?(R=s.jsxs(vs,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=R):R=e[29];let W;e[30]!==M||e[31]!==x||e[32]!==U||e[33]!==n||e[34]!==u||e[35]!==_||e[36]!==h||e[37]!==$||e[38]!==k||e[39]!==A||e[40]!==L||e[41]!==y||e[42]!==m?(W=x?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(ce,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:x,children:[s.jsx(rt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:nl.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:ue("rounded-md border px-3 py-2 text-sm font-medium transition-colors",m===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:A?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Ie,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:u,onChange:B=>{f(B.target.value),c(null)}})]})]}),A&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:il.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>S(ae),className:ue("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),h&&s.jsx("p",{className:"text-xs text-destructive",children:h}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:A?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:n>0?K(n):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:K(n)})]})}),s.jsx(ce,{onClick:$,disabled:k||!_||_<=0||L,className:"gap-2",children:k?"Updating...":U})]})]}),e[30]=M,e[31]=x,e[32]=U,e[33]=n,e[34]=u,e[35]=_,e[36]=h,e[37]=$,e[38]=k,e[39]=A,e[40]=L,e[41]=y,e[42]=m,e[43]=W):W=e[43];let Q;e[44]!==R||e[45]!==W?(Q=s.jsxs(Ot,{className:"sm:max-w-md",children:[R,W]}),e[44]=R,e[45]=W,e[46]=Q):Q=e[46];let se;return e[47]!==T||e[48]!==r||e[49]!==Q?(se=s.jsx(Dt,{open:r,onOpenChange:T,children:Q}),e[47]=T,e[48]=r,e[49]=Q,e[50]=se):se=e[50],se}function cl(t){const e=E.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:l,avgDailySpend:n}=r;if(a==null)return null;let i;e[0]!==l?(i=l?new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=l,e[1]=i):i=e[1];const o=i,d=a!==1?"s":"";let m;e[2]!==a||e[3]!==d?(m=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=m):m=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=u):u=e[7];let f;e[8]!==n?(f=K(n),e[8]=n,e[9]=f):f=e[9];let x;e[10]!==f?(x=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=x):x=e[11];let p;e[12]!==r.resetsBeforeDepletion?(p=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=p):p=e[13];const h=rl[r.confidence];let g;e[14]!==h?(g=s.jsx(Ta,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:h}),e[14]=h,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==m||e[18]!==c||e[19]!==x||e[20]!==p?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[m,c,u,x,p,g]}),e[16]=g,e[17]=m,e[18]=c,e[19]=x,e[20]=p,e[21]=y):y=e[21],y}function dl(t){const e=E.c(37),{usage:r,limit:a,limitPeriod:l,onConfigureLimit:n,connectionId:i,alert:o}=t,d=a.total!=null&&a.total>0;let m;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(m=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=m):m=e[3];const c=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=u):u=e[4];let f;e[5]!==r.total?(f=K(r.total),e[5]=r.total,e[6]=f):f=e[6];let x;e[7]!==f?(x=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=x):x=e[8];let p;e[9]!==d||e[10]!==a.total||e[11]!==l?(p=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a.total)," limit",l&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(Ba,{size:10}),ll[l]]})]}),e[9]=d,e[10]=a.total,e[11]=l,e[12]=p):p=e[12];let h;e[13]!==d?(h=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=h):h=e[14];let g;e[15]!==x||e[16]!==p||e[17]!==h?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,x,p,h]}),e[15]=x,e[16]=p,e[17]=h,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Yt,{size:16}),e[19]=y):y=e[19];const S=d?"Configure Limit":"Set Limit";let j;e[20]!==n||e[21]!==S?(j=s.jsxs(ce,{onClick:n,variant:"outline",className:"gap-2",children:[y,S]}),e[20]=n,e[21]=S,e[22]=j):j=e[22];let b;e[23]!==j||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,j]}),e[23]=j,e[24]=g,e[25]=b):b=e[25];let N;e[26]!==d||e[27]!==a.reset||e[28]!==c?(N=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:ue("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=N):N=e[29];let w;e[30]!==o||e[31]!==i?(w=s.jsx(os,{connectionId:i,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=i,e[32]=w):w=e[32];let k;return e[33]!==b||e[34]!==N||e[35]!==w?(k=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,N,w]}),e[33]=b,e[34]=N,e[35]=w,e[36]=k):k=e[36],k}function ul(t){const e=E.c(30),{available:r,total:a,estimation:l,onAddCredit:n,connectionId:i,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=m):m=e[0];let c;e[1]!==r?(c=K(r),e[1]=r,e[2]=c):c=e[2];let u;e[3]!==c?(u=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=u):u=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let x;e[7]!==u||e[8]!==f?(x=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,u,f]}),e[7]=u,e[8]=f,e[9]=x):x=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Yt,{size:16}),e[10]=p):p=e[10];let h;e[11]!==n?(h=s.jsxs(ce,{onClick:n,className:"gap-2 px-5",children:[p,"Add Credit"]}),e[11]=n,e[12]=h):h=e[12];let g;e[13]!==x||e[14]!==h?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[x,h]}),e[13]=x,e[14]=h,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[K(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let S;e[20]!==l?(S=s.jsx(cl,{estimation:l}),e[20]=l,e[21]=S):S=e[21];let j;e[22]!==o||e[23]!==i?(j=s.jsx(os,{connectionId:i,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=i,e[24]=j):j=e[24];let b;return e[25]!==S||e[26]!==j||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,S,j]}),e[25]=S,e[26]=j,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function os(t){const e=E.c(78),{connectionId:r,alert:a,billingMode:l}=t,{org:n}=me(),[i,o]=v.useState(!1),[d,m]=v.useState(a.enabled),[c,u]=v.useState(String(a.threshold_usd)),[f,x]=v.useState(a.email??""),[p,h]=v.useState(!1),[g,y]=v.useState(null);let S;e[0]!==r||e[1]!==n.id?(S={connectionId:r,orgId:n.id},e[0]=r,e[1]=n.id,e[2]=S):S=e[2];const j=ke(S);let b;e[3]!==j?(b={client:j},e[3]=j,e[4]=b):b=e[4];const{mutate:N,isPending:w}=Ht(b),k=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let C;e[5]!==f||e[6]!==d||e[7]!==N||e[8]!==c?(C=()=>{y(null),h(!1);const X=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(X)||X<=0){y("Threshold must be a positive number.");return}N({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:X,...f?{email:f}:{}}},{onSuccess:()=>{h(!0),setTimeout(()=>h(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=N,e[8]=c,e[9]=C):C=e[9];const A=C,I=l==="postpaid"?"Usage Alert":"Low-Balance Alert",z=l==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!i){let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>o(!0),e[10]=X):X=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx(Ma,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==I?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:I}),e[12]=I,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==l?(ve=a.enabled?l==="postpaid"?`Enabled · Alert at ${K(a.threshold_usd)}`:`Enabled · Alert below ${K(a.threshold_usd)}`:l==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=l,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Oe;return e[25]!==je||e[26]!==be?(Oe=s.jsxs("button",{type:"button",onClick:X,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Oe):Oe=e[27],Oe}let _;e[28]!==I?(_=s.jsx("p",{className:"text-xs font-medium text-foreground",children:I}),e[28]=I,e[29]=_):_=e[29];let O;e[30]!==z?(O=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:z}),e[30]=z,e[31]=O):O=e[31];let L;e[32]!==_||e[33]!==O?(L=s.jsxs("div",{children:[_,O]}),e[32]=_,e[33]=O,e[34]=L):L=e[34];let D;e[35]!==d?(D=s.jsx(Ze,{checked:d,onCheckedChange:m}),e[35]=d,e[36]=D):D=e[36];let G;e[37]!==L||e[38]!==D?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[L,D]}),e[37]=L,e[38]=D,e[39]=G):G=e[39];const V=!d&&"opacity-50 pointer-events-none";let F;e[40]!==V?(F=ue("flex flex-col gap-3 transition-opacity",V),e[40]=V,e[41]=F):F=e[41];const T=l==="postpaid"?"Notify at":"Notify below";let $;e[42]!==T?($=s.jsx(_e,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:T}),e[42]=T,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=X=>u(X.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Ie,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(_e,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=X=>x(X.target.value),e[52]=ee):ee=e[52];let R;e[53]!==f?(R=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Ie,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=R):R=e[54];let W;e[55]!==U||e[56]!==R?(W=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,R]}),e[55]=U,e[56]=R,e[57]=W):W=e[57];let Q;e[58]!==g?(Q=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=Q):Q=e[59];let se;e[60]!==F||e[61]!==W||e[62]!==Q?(se=s.jsxs("div",{className:F,children:[W,Q]}),e[60]=F,e[61]=W,e[62]=Q,e[63]=se):se=e[63];let B;e[64]!==p?(B=p&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=p,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(ce,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=w||!k,te=w?"Saving...":"Save Alert";let le;e[67]!==A||e[68]!==re||e[69]!==te?(le=s.jsx(ce,{size:"sm",className:"h-7 text-xs",onClick:A,disabled:re,children:te}),e[67]=A,e[68]=re,e[69]=te,e[70]=le):le=e[70];let de;e[71]!==B||e[72]!==le?(de=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=de):de=e[73];let P;return e[74]!==se||e[75]!==de||e[76]!==G?(P=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,de]}),e[74]=se,e[75]=de,e[76]=G,e[77]=P):P=e[77],P}const ml={cost:{label:"Cost",color:"var(--chart-1)"}};function fl(){const t=E.c(54),{org:e}=me(),[r,a]=v.useState("7d");let l;t[0]!==r?(l=ut(r),t[0]=r,t[1]=l):l=t[1];const n=l;let i;t[2]!==e.id?(i={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=i):i=t[3];const o=ke(i);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let m;t[5]!==n?(m={widget:d,timeRange:n,skipCount:!0},t[5]=n,t[6]=m):m=t[6];let c;t[7]!==o||t[8]!==m?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:m,staleTime:6e4,select:Ce},t[7]=o,t[8]=m,t[9]=c):c=t[9];const{data:u}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let x;t[11]!==n?(x={widget:f,timeRange:n,skipCount:!0},t[11]=n,t[12]=x):x=t[12];let p;t[13]!==o||t[14]!==x?(p={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:x,staleTime:6e4,select:Ce},t[13]=o,t[14]=x,t[15]=p):p=t[15];const{data:h}=oe(p);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title",limit:10}},t[16]=g):g=t[16];let y;t[17]!==n?(y={widget:g,timeRange:n,skipCount:!0},t[17]=n,t[18]=y):y=t[18];let S;t[19]!==o||t[20]!==y?(S={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=S):S=t[21];const{data:j}=oe(S);let b;t[22]!==u?.timeseries?(b=u?.timeseries??[],t[22]=u?.timeseries,t[23]=b):b=t[23];let N;t[24]!==b?(N=b.map(yl),t[24]=b,t[25]=N):N=t[25];const w=N;let k;if(t[26]!==h?.value||t[27]!==w||t[28]!==j?.groups||t[29]!==u?.timeseries||t[30]!==r){const C=(u?.timeseries??[]).reduce(vl,0),A=h?.value??0,I=(j?.groups??[]).filter(gl).sort(hl).slice(0,5),z=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let _;t[32]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=_):_=t[32];const O=K(C);let L;t[33]!==O?(L=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:O}),t[33]=O,t[34]=L):L=t[34];let D;t[35]!==z?(D=s.jsx("p",{className:"text-xs text-muted-foreground",children:z}),t[35]=z,t[36]=D):D=t[36];let G;t[37]!==L||t[38]!==D?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[L,D]}),t[37]=L,t[38]=D,t[39]=G):G=t[39];let V;t[40]!==A?(V=A.toLocaleString(),t[40]=A,t[41]=V):V=t[41];let F;t[42]!==V?(F=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[V," tool calls"]}),t[42]=V,t[43]=F):F=t[43];let T;t[44]!==G||t[45]!==F?(T=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[_,G,F]}),t[44]=G,t[45]=F,t[46]=T):T=t[46];let $;t[47]!==r?($=s.jsx(cs,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==T||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[T,$]}),t[49]=T,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==w?(H=w.length>0?s.jsx(Ea,{config:ml,className:"h-[200px] w-full",children:s.jsxs(tl,{data:w,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(Xt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(Oa,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(ns,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:pl}),s.jsx(Da,{content:s.jsx(La,{formatter:xl})}),s.jsx(ls,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=w,t[53]=H):H=t[53],k=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,I.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:I.map((M,U)=>{const q=C>0?Math.min(M.value/C*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:K(M.value)})]},M.key)})})]})]}),t[26]=h?.value,t[27]=w,t[28]=j?.groups,t[29]=u?.timeseries,t[30]=r,t[31]=k}else k=t[31];return k}function xl(t){return K(t)}function pl(t){return`$${t}`}function hl(t,e){return e.value-t.value}function gl(t){return t.value>0}function vl(t,e){return t+e.value}function yl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function bl(){const t=E.c(6),[e,r]=v.useState(sl);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=m=>{r(m),al(m)},t[0]=a):a=t[0];const l=a;let n,i;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),i=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=n,t[2]=i):(n=t[1],i=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[n,i,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(m=>s.jsx("button",{type:"button",onClick:()=>l(m),className:ue("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===m?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:m},m))})]}),t[4]=e,t[5]=d):d=t[5],d}function Qe(t){const e=E.c(20),{label:r,value:a,subValue:l,maxValue:n,color:i}=t,o=i===void 0?"bg-chart-1":i;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const m=d,c=n>0?Math.min(m/n*100,100):0;let u;e[2]!==r?(u=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=u):u=e[3];let f;e[4]!==o?(f=ue("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const x=`${c}%`;let p;e[6]!==x?(p={width:x},e[6]=x,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:p})}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==l?(y=l&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:l}),e[13]=l,e[14]=y):y=e[14];let S;return e[15]!==u||e[16]!==h||e[17]!==g||e[18]!==y?(S=s.jsxs("div",{className:"flex items-center gap-2",children:[u,h,g,y]}),e[15]=u,e[16]=h,e[17]=g,e[18]=y,e[19]=S):S=e[19],S}function Xe(t){const e=E.c(8),{title:r,children:a,empty:l}=t;let n;e[0]!==r?(n=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=n):n=e[1];let i;e[2]!==a||e[3]!==l?(i=l?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=l,e[4]=i):i=e[4];let o;return e[5]!==n||e[6]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[n,i]}),e[5]=n,e[6]=i,e[7]=o):o=e[7],o}const kt={"7d":"7 days","30d":"30 days","90d":"90 days"};function cs(t){const e=E.c(4),{period:r,onPeriodChange:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.keys(kt),e[0]=l):l=e[0];let n;return e[1]!==a||e[2]!==r?(n=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:l.map(i=>s.jsx("button",{type:"button",onClick:()=>a(i),className:ue("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===i?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:kt[i]},i))}),e[1]=a,e[2]=r,e[3]=n):n=e[3],n}function At(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,l)=>l.cost-a.cost)}function jl(){const t=E.c(27),{org:e}=me(),[r,a]=v.useState("7d"),l=ut(r),{data:n}=Wa(),i=n?.data?.members??[],o=new Map(i.map(Al));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const m=ke(d),c=P=>({client:m,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:P.fn,...P.groupByColumn&&{groupByColumn:P.groupByColumn},...P.limit&&{limit:P.limit}}},timeRange:l,skipCount:!0},staleTime:6e4,select:Ce}),{data:u,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title",limit:20})),{data:x,isLoading:p}=oe(c({fn:"count_all",groupByColumn:"connection_title",limit:20})),{data:h,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id",limit:20})),{data:y,isLoading:S}=oe(c({fn:"count_all",groupByColumn:"user_id",limit:20})),{data:j,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name",limit:20}));let N;t[2]===Symbol.for("react.memo_cache_sentinel")?(N={fn:"count_all",groupByColumn:"tool_name",limit:20},t[2]=N):N=t[2];const{data:w,isLoading:k}=oe(c(N));if(f||p||g||S||b||k){let P;t[3]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ne,{className:"h-8 w-48"}),t[3]=P):P=t[3];let X;return t[4]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs("div",{className:"flex flex-col gap-4",children:[P,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(kl)})]}),t[4]=X):X=t[4],X}const A=At(u?.groups??[],x?.groups??[]),I=At(h?.groups??[],y?.groups??[]).map(P=>({...P,key:o.get(P.key)??P.key})),z=w?.groups??[],_=new Map((j?.groups??[]).map(Cl)),O=z.map(P=>({name:P.key,calls:P.value,cost:_.get(P.key)??0})).sort(wl).slice(0,20),L=A.reduce(Sl,0),D=A.reduce(Nl,0),G=A[0]?.cost??1,V=I[0]?.cost??1,F=O[0]?.calls??1;let T;t[5]!==r?(T=s.jsx(cs,{period:r,onPeriodChange:a}),t[5]=r,t[6]=T):T=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=A.length===0,H=A.slice(0,8).map(P=>s.jsx(Qe,{label:P.key,value:K(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},P.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Xe,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=I.length===0,ee=I.slice(0,8).map(P=>s.jsx(Qe,{label:P.key,value:K(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:V,color:"bg-chart-4"},P.key));let R;t[12]!==ee?(R=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=R):R=t[13];let W;t[14]!==R||t[15]!==q?(W=s.jsx(Xe,{title:"Cost by User",empty:q,children:R}),t[14]=R,t[15]=q,t[16]=W):W=t[16];const Q=Xe,se="Top Tools",B=O.length===0,ae="space-y-2.5",re=O.slice(0,8).map(P=>s.jsx(Qe,{label:P.name,value:P.calls.toLocaleString(),subValue:P.cost>0?K(P.cost):void 0,maxValue:F,color:"bg-chart-3"},P.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==Q||t[20]!==B||t[21]!==te?(le=s.jsx(Q,{title:se,empty:B,children:te}),t[19]=Q,t[20]=B,t[21]=te,t[22]=le):le=t[22];let de;return t[23]!==W||t[24]!==le||t[25]!==U?(de=s.jsxs("div",{className:$,children:[U,W,le]}),t[23]=W,t[24]=le,t[25]=U,t[26]=de):de=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:K(L)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:D.toLocaleString()})]})]}),T]}),de]})}function Nl(t,e){return t+e.calls}function Sl(t,e){return t+e.cost}function wl(t,e){return e.calls-t.calls}function Cl(t){return[t.key,t.value]}function kl(t,e){return s.jsx(ne,{className:"h-40 rounded-xl"},e)}function Al(t){return[t.userId,t.user.name??t.user.email]}function _l(t,e){const r=new Map;for(const a of t){const n=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(n)??{cost:0,calls:0};r.set(n,{cost:i.cost+a.value,calls:i.calls})}for(const a of e){const n=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(n)??{cost:0,calls:0};r.set(n,{cost:i.cost,calls:i.calls+a.value})}return Array.from(r.entries()).map(([a,l])=>({month:a,...l})).reverse()}function Pl(){const t=E.c(27),{org:e}=me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=ut("90d"),t[0]=r):r=t[0];const a=r;let l;t[1]!==e.id?(l={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=l):l=t[2];const n=ke(l);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a,skipCount:!0},t[3]=i):i=t[3];let o;t[4]!==n?(o={client:n,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:i,staleTime:6e4,select:Ce},t[4]=n,t[5]=o):o=t[5];const{data:d,isLoading:m}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a,skipCount:!0},t[6]=c):c=t[6];let u;t[7]!==n?(u={client:n,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=n,t[8]=u):u=t[8];const{data:f,isLoading:x}=oe(u);if(m||x){let N;return t[9]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ne,{className:"h-8 w-48"}),s.jsx(ne,{className:"h-48 rounded-xl"})]}),t[9]=N):N=t[9],N}let p,h,g,y,S;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const N=_l(d?.timeseries??[],f?.timeseries??[]);S="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=p):p=t[17],h="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=N.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:N.map(Il)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=p,t[13]=h,t[14]=g,t[15]=y,t[16]=S}else p=t[12],h=t[13],g=t[14],y=t[15],S=t[16];let j;t[19]!==h||t[20]!==g||t[21]!==y?(j=s.jsxs("div",{className:h,children:[g,y]}),t[19]=h,t[20]=g,t[21]=y,t[22]=j):j=t[22];let b;return t[23]!==p||t[24]!==j||t[25]!==S?(b=s.jsxs("div",{className:S,children:[p,j]}),t[23]=p,t[24]=j,t[25]=S,t[26]=b):b=t[26],b}function Il(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:K(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function El(t){const e=E.c(31),{connectionId:r}=t,{org:a}=me(),[l,n]=v.useState(!1);let i;e[0]!==r||e[1]!==a.id?(i={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=i):i=e[2];const o=ke(i);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let m;e[4]!==o?(m={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:Ol},e[4]=o,e[5]=m):m=e[5];const{data:c,isLoading:u}=oe(m);if(u){let I;return e[6]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ne,{className:"h-36 rounded-xl"}),e[6]=I):I=e[6],I}if(!c)return null;const f=c.limit.remaining??0,x=c.limit.total??0,p=c.usage,h=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let S;e[7]!==c.alert?(S=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=S):S=e[8];const j=S,b=c.limit,N=h==="postpaid"&&(x==null||x===0);let w;e[9]!==j||e[10]!==f||e[11]!==h||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==x||e[17]!==p?(w=h==="postpaid"?s.jsx(dl,{usage:p,limit:b,limitPeriod:g,onConfigureLimit:()=>n(!0),connectionId:r,alert:j}):s.jsx(ul,{available:f,total:x,estimation:y,onAddCredit:()=>n(!0),connectionId:r,alert:j}),e[9]=j,e[10]=f,e[11]=h,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=x,e[17]=p,e[18]=w):w=e[18];let k;e[19]!==N?(k=N&&s.jsx(bl,{}),e[19]=N,e[20]=k):k=e[20];let C;e[21]!==h||e[22]!==r||e[23]!==l||e[24]!==g||e[25]!==x?(C=s.jsx(ol,{open:l,onOpenChange:n,connectionId:r,currentLimitUsd:x,billingMode:h,currentLimitPeriod:g}),e[21]=h,e[22]=r,e[23]=l,e[24]=g,e[25]=x,e[26]=C):C=e[26];let A;return e[27]!==w||e[28]!==k||e[29]!==C?(A=s.jsxs(s.Fragment,{children:[w,k,C]}),e[27]=w,e[28]=k,e[29]=C,e[30]=A):A=e[30],A}function Ol(t){return t.structuredContent}function Dl(t){const e=E.c(20),{gatewayConnectionId:r}=t,[a,l]=v.useState("summary");let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(za,{variant:"underline",children:[s.jsx(Ye,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(Ye,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(Ye,{value:"history",variant:"underline",children:"History"})]}),e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&s.jsx(El,{connectionId:r}),e[2]=r,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(fl,{}),e[4]=d):d=e[4];let m;e[5]!==o?(m=s.jsxs(He,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[o,d]}),e[5]=o,e[6]=m):m=e[6];let c;e[7]!==a?(c=a==="breakdown"&&s.jsx(jl,{}),e[7]=a,e[8]=c):c=e[8];let u;e[9]!==c?(u=s.jsx(He,{value:"breakdown",className:"pt-2",children:c}),e[9]=c,e[10]=u):u=e[10];let f;e[11]!==a?(f=a==="history"&&s.jsx(Pl,{}),e[11]=a,e[12]=f):f=e[12];let x;e[13]!==f?(x=s.jsx(He,{value:"history",className:"pt-2",children:f}),e[13]=f,e[14]=x):x=e[14];let p;return e[15]!==a||e[16]!==m||e[17]!==u||e[18]!==x?(p=s.jsxs(s.Fragment,{children:[n,s.jsxs($a,{value:a,onValueChange:l,variant:"underline",children:[i,m,u,x]})]}),e[15]=a,e[16]=m,e[17]=u,e[18]=x,e[19]=p):p=e[19],p}function Ll(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ne,{className:"h-5 w-32"}),s.jsx(ne,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ne,{className:"h-28 rounded-xl"}),s.jsx(ne,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Tl(){const t=E.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class zl extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx(Tl,{}):this.props.children}}function $l(){const t=E.c(4),e=Ra();let r;t[0]!==e?(r=e.find(Ml),t[0]=e,t[1]=r):r=t[1];const l=r?.id??null;let n;return t[2]!==l?(n=s.jsx(Dl,{gatewayConnectionId:l}),t[2]=l,t[3]=n):n=t[3],n}function Ml(t){return Fa(t,Ua)}function Bl(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx(zl,{children:s.jsx(v.Suspense,{fallback:s.jsx(Ll,{}),children:s.jsx($l,{})})})}),t[0]=e):e=t[0],e}function ds(){const t=E.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ne,{className:"h-6 w-48"}),r=s.jsx(ne,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ne,{className:"h-12 w-full"}),s.jsx(ne,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Gl(t){const e=E.c(14),{projectSlug:r,children:a}=t,{org:l}=me(),{data:n,isLoading:i}=Et(l.id,r);if(i||!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ds,{}),e[0]=u):u=e[0],u}const o=r===Ee;let d;e[1]!==n.description||e[2]!==n.enabledPlugins||e[3]!==n.id||e[4]!==n.name||e[5]!==n.organizationId||e[6]!==n.slug||e[7]!==n.ui||e[8]!==o?(d={id:n.id,organizationId:n.organizationId,slug:n.slug,name:n.name,description:n.description,enabledPlugins:n.enabledPlugins,ui:n.ui,isOrgAdmin:o},e[1]=n.description,e[2]=n.enabledPlugins,e[3]=n.id,e[4]=n.name,e[5]=n.organizationId,e[6]=n.slug,e[7]=n.ui,e[8]=o,e[9]=d):d=e[9];const m=d;let c;return e[10]!==a||e[11]!==m||e[12]!==l?(c=s.jsx(It,{org:l,project:m,children:a}),e[10]=a,e[11]=m,e[12]=l,e[13]=c):c=e[13],c}function Rl(t){const e=E.c(6),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Va,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"org.general":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Za,{}),e[2]=a):a=e[2],a}case"org.plugins":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Gl,{projectSlug:Ee,children:s.jsx(Bs,{})}),e[3]=a):a=e[3],a}case"org.billing":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Bl,{}),e[4]=a):a=e[4],a}default:{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[5]=a):a=e[5],a}}}function Wl(){const t=E.c(23),{isOpen:e,activeSection:r,open:a,close:l}=bs();let n;t[0]!==l?(n=g=>!g&&l(),t[0]=l,t[1]=n):n=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[2]=i):i=t[2];let o;t[3]!==r||t[4]!==a?(o=s.jsx(v.Suspense,{fallback:i,children:s.jsx(Ka,{activeSection:r,onNavigate:a})}),t[3]=r,t[4]=a,t[5]=o):o=t[5];let d,m;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Lt,{size:16}),m=s.jsx("span",{className:"sr-only",children:"Close"}),t[6]=d,t[7]=m):(d=t[6],m=t[7]);let c;t[8]!==l?(c=s.jsxs("button",{type:"button",onClick:l,className:"sticky top-4 float-right mr-4 mt-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[d,m]}),t[8]=l,t[9]=c):c=t[9];let u;t[10]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ds,{}),t[10]=u):u=t[10];let f;t[11]!==r?(f=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:u,children:s.jsx(Rl,{section:r})})}),t[11]=r,t[12]=f):f=t[12];let x;t[13]!==c||t[14]!==f?(x=s.jsxs("div",{className:"flex-1 overflow-y-auto min-w-0 relative",children:[c,f]}),t[13]=c,t[14]=f,t[15]=x):x=t[15];let p;t[16]!==o||t[17]!==x?(p=s.jsx(Ot,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o,x]})}),t[16]=o,t[17]=x,t[18]=p):p=t[18];let h;return t[19]!==e||t[20]!==n||t[21]!==p?(h=s.jsx(Dt,{open:e,onOpenChange:n,children:p}),t[19]=e,t[20]=n,t[21]=p,t[22]=h):h=t[22],h}function Fl(t){const e=E.c(12),{projectSlug:r,orgSlug:a,error:l}=t,n=at();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=i):i=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==l.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:l.message}),e[3]=l.message,e[4]=d):d=e[4];let m;e[5]!==n||e[6]!==a?(m=s.jsx(ce,{variant:"link",onClick:()=>n({to:"/$org/$project",params:{org:a,project:Ee}}),children:"Go to organization home"}),e[5]=n,e[6]=a,e[7]=m):m=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==m?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,o,d,m]}),e[8]=o,e[9]=d,e[10]=m,e[11]=c):c=e[11],c}function Ul(t){const e=E.c(9),{projectSlug:r,orgSlug:a}=t,l=at();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=n):n=e[0];let i;e[1]!==r?(i=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==l||e[4]!==a?(o=s.jsx(ce,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ee}}),children:"Go to organization home"}),e[3]=l,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[n,i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function Kl(){const t=E.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=xs(e),{org:a}=me(),l=r.org,n=r.project,{data:i,isLoading:o,error:d}=Et(a.id,n);if(o){let h;return t[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Je,{}),t[1]=h):h=t[1],h}if(d){let h;return t[2]!==d||t[3]!==l||t[4]!==n?(h=s.jsx(Fl,{projectSlug:n,orgSlug:l,error:d}),t[2]=d,t[3]=l,t[4]=n,t[5]=h):h=t[5],h}if(!i){let h;return t[6]!==l||t[7]!==n?(h=s.jsx(Ul,{projectSlug:n,orgSlug:l}),t[6]=l,t[7]=n,t[8]=h):h=t[8],h}const m=i.slug===Ee;let c;t[9]!==i.description||t[10]!==i.enabledPlugins||t[11]!==i.id||t[12]!==i.name||t[13]!==i.organizationId||t[14]!==i.slug||t[15]!==i.ui||t[16]!==m?(c={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:m},t[9]=i.description,t[10]=i.enabledPlugins,t[11]=i.id,t[12]=i.name,t[13]=i.organizationId,t[14]=i.slug,t[15]=i.ui,t[16]=m,t[17]=c):c=t[17];const u=c;let f,x;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(Je,{}),children:s.jsx(ps,{})}),x=s.jsx(Wl,{}),t[18]=f,t[19]=x):(f=t[18],x=t[19]);let p;return t[20]!==u||t[21]!==a?(p=s.jsxs(It,{org:a,project:u,children:[f,x]}),t[20]=u,t[21]=a,t[22]=p):p=t[22],p}function Wn(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(Je,{}),children:s.jsx(Kl,{})}),t[0]=e):e=t[0],e}export{Wn as default};
|