import{r as l,j as t}from"./vendor-react-wBh_31cN.js";import{T as x,a as d,b as v}from"./tabs-BZDPsi5L.js";import{L as h}from"./list-page-header-Fc18Qd7m.js";import{A as j}from"./AppHeader-BH78m-3u.js";import{S as b}from"./Suspense-DXKV8a2d.js";import{G as A}from"./GlobalErrors-hXAijPO_.js";import{E as N}from"./ErrorBoundary-auKxhCvI.js";import{$ as g,r as o}from"./index-dNe6i2rS.js";import{a as C,u as k,m as n,O as w}from"./vendor-router-D1GqFWiT.js";import{b1 as p,b2 as T,b3 as u,b4 as y,b5 as E}from"./vendor-icons-BUUmD6ht.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-radix-BRyWS4bQ.js";import"./animated-progress-DY4TkPAt.js";import"./separator-CxqNNMXg.js";import"./value-7N0Keti9.js";import"./useColorMode-BoNcZP0P.js";import"./Search-BFc2vuRf.js";import"./textarea-BJVuSob1.js";import"./popover-BzVbz_d3.js";import"./useDebounce-BiuGz9t2.js";import"./tooltip-DFFgUYh6.js";import"./useProjectId-DeuaOE3U.js";import"./AnimatedLoadingIcon-mddZBUgk.js";import"./includes-ucXR_9jq.js";import"./concat-CTXo1gGM.js";import"./getHopsDoc-B_Rq_F9V.js";import"./sortBy-COer1Ia5.js";import"./card-BeQtvmcJ.js";import"./useLastProject-Du1ajmeV.js";import"./useSortedProjects-DPrT0V3d.js";import"./index-DURBtSjL.js";import"./apply-CIuXDHQi.js";import"./juxt-B5kKHsyp.js";import"./converge-D7u3m7i4.js";import"./icon-button-BZeFL7T7.js";import"./index-yk_nV5MH.js";import"./useProjectRunningActivity-4p3CqhTv.js";import"./index-DlAh4Ixf.js";import"./utils-C3tzOLw4.js";import"./index-dHd2aGu6.js";import"./time-utils-CQYZ5msB.js";import"./addDays-Cdit4yPz.js";import"./always-oSAuSdys.js";import"./init-Dq_gEBi9.js";import"./formatDistance-B6o-SXVU.js";import"./join-oazOKFfj.js";import"./add-SI0q72Q7.js";import"./lensPath-D2xKReso.js";import"./mergeRight-D1nsCm60.js";import"./avatar-DDfx1nOU.js";import"./breadcrumb-BfVDt_1z.js";import"./editable-select-DItn4ZHW.js";import"./vendor-redux-CJZrIb6x.js";import"./index-DLI8oDiK.js";import"./dropdown-menu-DCcmtBGI.js";import"./useHotkeysShortcut-CVWmK5fW.js";import"./slider-DuBLNG32.js";import"./switch-Bda1Csgx.js";import"./input-DFI7JniT.js";import"./label-gPWmc6ow.js";import"./purify.es-t2lEkcJL.js";import"./useNotifier-BGMn6HaH.js";import"./notifications-5miqOdlG.js";import"./toast-wiGcevcF.js";import"./Error-Cui9k53k.js";import"./Error404-DQ9qHPOM.js";import"./titles-CzjGGAB3.js";import"./vendor-grid-CeFlDWv4.js";const L=()=>{const a=C(),m=k(),{isServiceUser:s}=g(),i=l.useCallback(c=>()=>{m(c)},[m]),r=l.useCallback(c=>Array.isArray(c)?c.some(f=>!!n(f,a.pathname)):!!n(c,a.pathname),[a]),e="w-4 h-4";return{tabs:l.useMemo(()=>[...s?[]:[{title:"Profile",icon:t.jsx(p,{className:e}),isActive:r(o.account.profile),onClick:i(o.account.profile)},{title:"Authentication",icon:t.jsx(T,{className:e}),isActive:r(o.account.auth),onClick:i(o.account.auth)}],{title:"API",icon:t.jsx(u,{className:e}),isActive:r([o.account.api.edit,o.account.api.create,o.account.api.list]),onClick:i(o.account.api.list)},{title:"Secrets",icon:t.jsx(y,{className:e}),isActive:r([o.account.secrets.create,o.account.secrets.list]),onClick:i(o.account.secrets.list)},...s?[]:[{title:"Git Providers",icon:t.jsx(E,{className:e}),isActive:r([o.account.git]),onClick:i(o.account.git)}],...s?[]:[{title:"Environment Variables",icon:t.jsx(u,{className:e}),isActive:r([o.account.envVars]),onClick:i(o.account.envVars)}],...s?[{title:"Profile",icon:t.jsx(p,{className:e}),isActive:r(o.account.profile),onClick:i(o.account.profile)}]:[]],[r,i,s])}},Dt=()=>{var s;const{tabs:a}=L(),m=(s=a.find(i=>i.isActive))==null?void 0:s.title;return t.jsxs("div",{className:"flex w-full h-full flex-col overflow-x-hidden",children:[t.jsx(j,{sectionTitle:"Account settings"}),t.jsx(h,{portal:!1,tabs:t.jsx(x,{value:m,onValueChange:i=>{var r;return(r=a.find(e=>e.title===i))==null?void 0:r.onClick()},children:t.jsx(d,{variant:"line",children:a.map(i=>t.jsxs(v,{value:i.title,className:"flex items-center gap-1.5",children:[i.icon,i.title]},i.title))})})}),t.jsx("div",{className:"flex w-full flex-1 min-h-0 overflow-hidden",children:t.jsx("div",{className:"flex-grow flex justify-center min-w-[900px] p-5 pb-0 relative bg-muted overflow-auto",id:"content",children:t.jsx("div",{className:"flex w-full h-full max-w-[1000px] min-h-full flex-col",children:t.jsx(N,{children:t.jsx(b,{children:t.jsx(A,{children:t.jsx(w,{})})})})})})})]})};export{Dt as default};
