import{r as e,j as i}from"./vendor-react-wBh_31cN.js";import{u as o,j as f}from"./vendor-redux-CJZrIb6x.js";import{B as A}from"./back-button-zYdlGpWP.js";import{d as g,e as x,b as h,a as j}from"./scope.selectors-C6FB6Cbj.js";import{r as m,aq as y}from"./index-BKr2rJhV.js";import{u as L}from"./useTitle-DQo_L6Ox.js";import{t as b}from"./titles-CzjGGAB3.js";import{A as E}from"./ApiForm-BH7Yr1dz.js";import{c as S,u as k}from"./vendor-router-D1GqFWiT.js";import"./vendor-icons-BUUmD6ht.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-radix-BRyWS4bQ.js";import"./vendor-grid-CeFlDWv4.js";import"./callout-Dd8FkTQe.js";import"./checkbox-group-pCQMTuNu.js";import"./checkbox-DbZXziG0.js";import"./label-Dnebucx5.js";import"./confirmation-dialog-DFt7ZgUQ.js";import"./input-H6_qmzms.js";import"./useCopyToClipboard-3DFwhniW.js";import"./useNotifier-BCEAoFCf.js";import"./notifications-x-pTFTQl.js";import"./toast-3g7Fh-a0.js";import"./date-picker-DuYl6sUN.js";import"./popover-DNRIgB96.js";import"./editable-select-Co_-YcCr.js";import"./index.esm-CAGtek53.js";import"./yup-XkUC3UEH.js";import"./card-DISTA6Ay.js";import"./card-link-CAhlzNs_.js";import"./getHopsDoc-BWSxyuXn.js";import"./addDays-DjM7nKyN.js";const at=()=>{const{name:p}=S(),c=o(g),n=o(x),u=o(h),t=f(),s=k(),l=o(j);L(b.editAPI);const r=l.find(({name:a})=>a===p);e.useEffect(()=>(t.api.fetch(),t.scope.fetch(),()=>{t.api.clear()}),[t]);const d=e.useCallback(async a=>{await t.api.edit({data:a}),s(m.account.api.list)},[t,s]);return c||u||!r?i.jsx(y,{}):i.jsxs(i.Fragment,{children:[i.jsx(A,{className:"mb-3 self-start",onClick:()=>s(m.account.api.list),children:"All API keys"}),i.jsx(E,{isEdit:!0,initialData:r,isLoading:n,onSubmit:d})]})};export{at as default};
