import{r as i,j as e}from"./@radix-B1sy0Lhr.js";import{d as o,B as n,r as c,bx as d}from"./index-CO6UN3UX.js";import{S as h}from"./StackList-DSAjbVb5.js";import{p as m,c as j}from"./persist-Dkbp9MFP.js";import{p as l,c as k}from"./persist-B3Hb8HDW.js";import{I as p}from"./Infobox-DnduZjNU.js";import{s as u}from"./index-BYHxFvoG.js";import{b as f}from"./@tanstack-Dwlisomv.js";import{L as x}from"./@react-router-CHjLNlgw.js";import"./@reactflow-gbyyU3kq.js";import"./plus-DOrkJCmy.js";import"./refresh-C8BXS3Fb.js";import"./Pagination-C1sE5Nzn.js";import"./chevron-right-double-CbMG1dOM.js";import"./SearchField-Byv1PtST.js";import"./index-g7wOyc86.js";import"./DisplayDate-57lUNS79.js";import"./CodeSnippet-B7Wd4R8u.js";import"./CollapsibleCard-DSZzbjx5.js";import"./chevron-down-Bl7WwQAL.js";import"./check-circle-CG6XAdk-.js";import"./SheetHeader-Bb3v9rha.js";import"./components-Br2ezRib.js";import"./NumberBox-C2Pju4PR.js";import"./ComponentBadge-MVT08kBV.js";import"./ComponentIcon-C9AY8usJ.js";import"./bar-chart-square-check-_m-oYysN.js";import"./layout-GIiNvS10.js";import"./transform-S7omcvTm.js";import"./trash-D9LA4VFD.js";import"./DialogItem-DD_7v3UY.js";import"./AlertDialogDropdownItem-BpLj419i.js";import"./sharedSchema-Br1JPr8d.js";import"./index.es-CZMSrR6z.js";import"./info-CI2szPUG.js";import"./stack-detail-query-DnyMCdVE.js";function w({setHasResumeableStack:a}){const{success:t,data:s}=m(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(j(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.newInfra,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function b({setHasResumeableTerraform:a}){const{success:t,data:s}=l(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(k(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Terraform Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function v(){const[a,t]=i.useState(m().success),[s,r]=i.useState(l().success);return!a&&!s?null:e.jsxs("div",{className:"space-y-5",children:[a&&e.jsx(w,{setHasResumeableStack:t}),s&&e.jsx(b,{setHasResumeableTerraform:r})]})}function ae(){const{setTourState:a,tourState:{tourActive:t}}=d();return i.useEffect(()=>{t&&a(s=>({...s,run:!0,stepIndex:s.stepIndex}))},[t]),e.jsxs("div",{className:"space-y-5 py-5",children:[e.jsx(v,{}),e.jsx(h,{})]})}export{ae as default};
