import{r as i,j as e}from"./@radix-AvWw-1nd.js";import{S as o,f as n,r as c,aS as d}from"./index-DWoLoYDY.js";import{S as h}from"./StackList-C8KNd00o.js";import{p as m,c as j}from"./persist-CMkLV2Cs.js";import{p as l,c as k}from"./persist-BglceT_t.js";import{I as p}from"./Infobox-DYKoAVhW.js";import{s as u}from"./index-CaRx22lH.js";import{a as f}from"./@tanstack-CcI3lvwB.js";import{L as x}from"./@react-router-BUo5vhN4.js";import"./@reactflow-DMaYqp8l.js";import"./plus-CoKtHiA9.js";import"./refresh-CupyU1Vs.js";import"./SearchField-DfNxVtjV.js";import"./chevron-right-double-zKz7rAaU.js";import"./index-BVVKxTWC.js";import"./DisplayDate-C5Aw-Yca.js";import"./InlineAvatar-Bk4QLPTU.js";import"./CodeSnippet-D8ptwPjg.js";import"./CollapsibleCard-Djtd_ocf.js";import"./chevron-down-A3PXOshS.js";import"./components-Br2ezRib.js";import"./NumberBox-BvBJYxCu.js";import"./ComponentBadge-CVN2FsiW.js";import"./ComponentIcon-gpMJ2Y2e.js";import"./layout-3_rgDUxf.js";import"./rocket-k68ONPDS.js";import"./transform-DKsRLKTv.js";import"./trash-B_JgTgqd.js";import"./DialogItem-ST291Hsl.js";import"./AlertDialogDropdownItem-XL2NfFgP.js";import"./sharedSchema-BOmQa793.js";import"./stack-detail-query-CI_YMUx6.js";function S({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 w({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 e.jsxs("div",{className:"space-y-5",children:[a&&e.jsx(S,{setHasResumeableStack:t}),s&&e.jsx(w,{setHasResumeableTerraform:r})]})}function ee(){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",children:[e.jsx(v,{}),e.jsx(h,{})]})}export{ee as default};
