import{j as e}from"./@radix-D8tIKeo-.js";import{e as o,B as n,r as m,c8 as x}from"./index-B44sgOyQ.js";import{a as i}from"./@monaco-editor-CuNQBT0l.js";import{S as h}from"./StackList-BF4Xtnm5.js";import{p as c,c as j}from"./persist-BcBdmc5n.js";import{p as l,c as k}from"./persist-D4sh18hk.js";import{I as p}from"./Infobox-CIL_nbOc.js";import{s as u}from"./index-Ddinc6X-.js";import{b as f}from"./@tanstack-nMqraTcu.js";import{L as d}from"./@react-router-D1ODL_Ub.js";import"./@elkjs-CmhuJAjY.js";import"./@reactflow-DgowYF6H.js";import"./@zod-2qqdh1cM.js";import"./plus-BjxzjZ9E.js";import"./refresh-DNxZUtB4.js";import"./Pagination-Bpjzny1d.js";import"./chevron-right-double-DLhLU36B.js";import"./SearchField-BOlpKJtF.js";import"./CodeSnippet-WWMTzt1F.js";import"./CollapsibleCard-B9jxOFAU.js";import"./chevron-down-C9YWkVDM.js";import"./resizable-sheet-CvLdhybR.js";import"./react-resizable-panels.browser-0v9wo-oN.js";import"./components-Br2ezRib.js";import"./NumberBox-DM0c4u2Y.js";import"./ComponentBadge-DaTkhzZ4.js";import"./ComponentIcon-Btqtj6Xx.js";import"./bar-chart-square-check-BAWR96En.js";import"./layout-BBB8hotd.js";import"./transform-DsIiQtL0.js";import"./action-cell-BgyPfYXo.js";import"./trash-Dp8wQrEE.js";import"./DeleteAlertDialog-DbZA_NGz.js";import"./sharedSchema-TBL5mbwI.js";import"./index.es-C5KVyOUc.js";import"./alert-triangle-DTrw87FZ.js";import"./stack-detail-query-DvU8xhXI.js";function w({setHasResumeableStack:a}){const{success:r,data:t}=c(),s=f({...u.stackDeploymentStack({provider:t?.provider||"aws",stack_name:t?.stackName||"",date_start:t?.timestamp}),enabled:r,throwOnError:!0});return i.useEffect(()=>{s.data&&(j(),a(!1))},[s.data]),!r||s.isError?null:s.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:m.stacks.create.newInfra,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function v({setHasResumeableTerraform:a}){const{success:r,data:t}=l(),s=f({...u.stackDeploymentStack({provider:t?.provider||"aws",stack_name:t?.stackName||"",date_start:t?.timestamp}),enabled:r,throwOnError:!0});return i.useEffect(()=>{s.data&&(k(),a(!1))},[s.data]),!r||s.isError?null:s.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:m.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function N(){const[a,r]=i.useState(c().success),[t,s]=i.useState(l().success);return!a&&!t?null:e.jsxs("div",{className:"space-y-5",children:[a&&e.jsx(w,{setHasResumeableStack:r}),t&&e.jsx(v,{setHasResumeableTerraform:s})]})}function ie(){const{setTourState:a,tourState:{tourActive:r}}=x();return i.useEffect(()=>{r&&a(t=>({...t,run:!0,stepIndex:t.stepIndex}))},[r]),e.jsxs("div",{className:"space-y-5 py-5",children:[e.jsx(N,{}),e.jsx(h,{})]})}export{ie as default};
