import{r as n,j as e}from"./vendor-react-wBh_31cN.js";import{R as d,G as l}from"./index-dNe6i2rS.js";import{L as u}from"./label-gPWmc6ow.js";import{T as m}from"./textarea-BJVuSob1.js";import{E as v}from"./EnvVarsService-4OFfVS_Z.js";import{u as f}from"./useProjectId-DeuaOE3U.js";const j=()=>{const t=f(),[i,r]=n.useState([]),[c,s]=n.useState(!0);return n.useEffect(()=>{let a=!1;return s(!0),v.getInjectedPreviewLines(t).then(o=>{a||r((o==null?void 0:o.data)??[])}).catch(()=>{a||r([])}).finally(()=>{a||s(!1)}),()=>{a=!0}},[t]),{envVarPreviewLines:i,isLoading:c}},L=()=>{const[t,i]=n.useState(!1),{envVarPreviewLines:r,isLoading:c}=j();return c||!r.length?null:e.jsxs("div",{className:"mt-3 w-full rounded-md border border-dashed border-muted-foreground/30 bg-muted/20 p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(u,{children:"Injected environment variables"}),e.jsx(d,{gray:!0,children:"account + project"})]}),e.jsxs(d,{gray:!0,className:"text-xs",children:["Click to reveal the runtime values injected from your account and project. Secret-backed env vars are shown as"," ",e.jsx("code",{children:"<from secret secretName>"}),"."]})]}),e.jsx(l,{type:"button",variant:"outline",size:"sm",onClick:()=>i(s=>!s),children:t?"Hide injected env vars":"Show injected env vars"})]}),t&&e.jsx(m,{readOnly:!0,value:r.join(`
`),className:"mt-3 min-h-24 font-mono text-sm"})]})};export{L as I};
