import{r as i,j as e}from"./@radix-C_LirfyT.js";import{d as o,B as n,r as c,bv as x}from"./index-BacoJBEQ.js";import{S as h}from"./StackList-Dt0FrIkM.js";import{p as m,c as j}from"./persist-DxiyfAax.js";import{p as l,c as k}from"./persist-BKKcL1Kp.js";import{I as p}from"./Infobox-DFCWPbMb.js";import{s as u}from"./index-dCcVgFNl.js";import{b as f}from"./@tanstack-C0SeHZng.js";import{L as d}from"./@react-router-BSsrkPOd.js";import"./@reactflow-D9hglKLF.js";import"./plus-cI8zD2xh.js";import"./refresh-3EF2R7ja.js";import"./Pagination-CcDD5yHh.js";import"./chevron-right-double-CbRQKN4Q.js";import"./SearchField-D_0-uAPj.js";import"./index-BRhKF2z-.js";import"./DisplayDate-v3KW7oez.js";import"./CodeSnippet-D8iBqOVv.js";import"./CollapsibleCard-D0-pQi1n.js";import"./chevron-down-Z3nUe-0U.js";import"./check-circle-mnEgPhPF.js";import"./SheetHeader-7vwlsY_i.js";import"./components-Br2ezRib.js";import"./NumberBox-CoQjQYDJ.js";import"./ComponentBadge-mw2Ja_ON.js";import"./ComponentIcon-BXgpt-jw.js";import"./bar-chart-square-check-9siI9icm.js";import"./layout-C5dgIReC.js";import"./transform-DFpKTKgF.js";import"./trash-HKxXWbSG.js";import"./DialogItem-DeME0oSt.js";import"./AlertDialogDropdownItem-druRNuO2.js";import"./sharedSchema-DyUO09BR.js";import"./index.es-DcVFDpJU.js";import"./info-CyMih3vQ.js";import"./stack-detail-query-Bc4QKlWg.js";function v({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(d,{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(d,{to:c.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function b(){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(v,{setHasResumeableStack:t}),s&&e.jsx(w,{setHasResumeableTerraform:r})]})}function ae(){const{setTourState:a,tourState:{tourActive:t}}=x();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(b,{}),e.jsx(h,{})]})}export{ae as default};
