diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_auth.js b/spinifex/services/spinifexui/frontend/dist/assets/_auth.js index d26b090fd..d7d461abd 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_auth.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_auth.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./link.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./createLucideIcon.js";import{t as c}from"./chevron-down.js";import{t as l}from"./chevron-right.js";import{a as u,c as d,i as f,n as p,o as m,r as ee,s as h,t as te}from"./waypoints.js";import{n as ne}from"./admin-context.js";import{A as re,M as g,_,d as v,l as ie,n as y,p as ae,w as oe}from"./ec2.js";import{n as se}from"./s32.js";import{t as b}from"./page-heading.js";import{a as x,c as S,i as C,l as w,n as T,o as E,s as ce,t as D}from"./alert-dialog.js";import{t as O}from"./state-badge.js";import{r as le,t as ue}from"./admin.js";import{t as de}from"./badge.js";import{a as k,n as A,o as j,r as M,s as fe,t as N}from"./card.js";var P=s(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),F=s(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),I=s(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),L=s(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),pe=s(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),R=s(`ship`,[[`path`,{d:`M12 10.189V14`,key:`1p8cqu`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6`,key:`qpkstq`}],[`path`,{d:`M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76`,key:`7tigtc`}],[`path`,{d:`M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1924j5`}]]),z=r(),B=e(n(),1),V=t(),me=[{name:`Air-gap Support`,key:`airgap`},{name:`NVIDIA Bluefield DPU`,key:`bluefield`},{name:`NVIDIA MIG Support`,key:`mig`}];function H(e){let t=Math.floor(e/86400),n=Math.floor(e%86400/3600);if(t>0)return`${t}d ${n}h`;let r=Math.floor(e%3600/60);return n>0?`${n}h ${r}m`:`${r}m`}function U(){let e=(0,z.c)(129),{isAdmin:t,version:n,license:r}=ne(),[a,o]=(0,B.useState)(!1),s;e[0]===t?s=e[1]:(s={...ue,enabled:t},e[0]=t,e[1]=s);let{data:u}=i(s),d;e[2]===t?d=e[3]:(d={...le,enabled:t},e[2]=t,e[3]=d);let{data:f}=i(d);if(!t||!n)return null;let p;e[4]===u?.nodes?p=e[5]:(p=u?.nodes??[],e[4]=u?.nodes,e[5]=p);let m=p,h;e[6]===f?.vms?h=e[7]:(h=f?.vms??[],e[6]=f?.vms,e[7]=h);let te=h,re=u?.cluster_mode??`single-node`,g=r===`open-source`,_=m[0]?.region??null,v;e[8]===m?v=e[9]:(v=m.reduce(ve,0),e[8]=m,e[9]=v);let ie=v,y;e[10]===m?y=e[11]:(y=m.reduce(_e,0),e[10]=m,e[11]=y);let ae=y,oe,se,b,x,S,C,w,T,E,ce,D,O,k,A,P,F,I;if(e[12]!==ae||e[13]!==re||e[14]!==g||e[15]!==m||e[16]!==_||e[17]!==ie||e[18]!==n.arch||e[19]!==n.commit||e[20]!==n.os||e[21]!==n.version||e[22]!==te.length){let t=m.reduce(ge,0),r=m.reduce(he,0);k=`mb-6 space-y-4`,ce=`grid grid-cols-1 gap-4 md:grid-cols-3`;let i;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(j,{className:`pb-2`,children:(0,V.jsxs)(fe,{className:`flex items-center gap-2 text-sm`,children:[(0,V.jsx)(pe,{className:`size-3.5`}),`Spinifex Info`]})}),e[40]=i):i=e[40];let a;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Version`}),e[41]=a):a=e[41];let o;e[42]===n.version?o=e[43]:(o=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[a,(0,V.jsx)(`span`,{className:`font-mono`,children:n.version})]}),e[42]=n.version,e[43]=o);let s;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Commit`}),e[44]=s):s=e[44];let c;e[45]===n.commit?c=e[46]:(c=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[s,(0,V.jsx)(`span`,{className:`font-mono`,children:n.commit})]}),e[45]=n.commit,e[46]=c);let l;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Platform`}),e[47]=l):l=e[47];let u;e[48]!==n.arch||e[49]!==n.os?(u=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[l,(0,V.jsxs)(`span`,{children:[n.os,`/`,n.arch]})]}),e[48]=n.arch,e[49]=n.os,e[50]=u):u=e[50];let d;e[51]===_?d=e[52]:(d=_&&(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Region`}),(0,V.jsx)(`span`,{children:_})]}),e[51]=_,e[52]=d),e[53]!==o||e[54]!==c||e[55]!==u||e[56]!==d?(D=(0,V.jsxs)(N,{children:[i,(0,V.jsxs)(M,{className:`space-y-1 text-xs`,children:[o,c,u,d]})]}),e[53]=o,e[54]=c,e[55]=u,e[56]=d,e[57]=D):D=e[57];let f;e[58]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsx)(j,{className:`pb-2`,children:(0,V.jsx)(fe,{className:`text-sm`,children:`License & Support`})}),e[58]=f):f=e[58];let p;e[59]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`License`}),e[59]=p):p=e[59];let h=g?`secondary`:`default`,ne=g?`Open Source (AGPLv3)`:`Commercial`,v;e[60]!==h||e[61]!==ne?(v=(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[p,(0,V.jsx)(de,{variant:h,children:ne})]}),e[60]=h,e[61]=ne,e[62]=v):v=e[62];let y;e[63]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Support`}),e[63]=y):y=e[63];let le=g?`Community`:`Standard`,ue;e[64]===le?ue=e[65]:(ue=(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[y,(0,V.jsx)(`span`,{children:le})]}),e[64]=le,e[65]=ue);let L;e[66]===g?L=e[67]:(L=g&&(0,V.jsx)(`a`,{href:`https://mulgadc.com/purchase`,target:`_blank`,rel:`noopener noreferrer`,className:`mt-2 block text-xs font-medium text-primary hover:underline`,children:`Upgrade to Commercial →`}),e[66]=g,e[67]=L),e[68]!==v||e[69]!==ue||e[70]!==L?(O=(0,V.jsxs)(N,{children:[f,(0,V.jsxs)(M,{className:`space-y-2 text-xs`,children:[v,ue,L]})]}),e[68]=v,e[69]=ue,e[70]=L,e[71]=O):O=e[71],se=N,e[72]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,V.jsx)(j,{className:`pb-2`,children:(0,V.jsxs)(fe,{className:`flex items-center gap-2 text-sm`,children:[(0,V.jsx)(ee,{className:`size-3.5`}),`Cluster Status`]})}),e[72]=E):E=e[72],oe=M,x=`space-y-2 text-xs`,e[73]===re?S=e[74]:(S=(0,V.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,V.jsx)(de,{variant:`outline`,children:re})}),e[73]=re,e[74]=S);let R;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Nodes`}),e[75]=R):R=e[75],e[76]===m.length?C=e[77]:(C=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[R,(0,V.jsx)(`span`,{children:m.length})]}),e[76]=m.length,e[77]=C);let z;e[78]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Instances`}),e[78]=z):z=e[78],e[79]===te.length?w=e[80]:(w=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[z,(0,V.jsx)(`span`,{children:te.length})]}),e[79]=te.length,e[80]=w);let B;e[81]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`vCPU`}),e[81]=B):B=e[81],e[82]!==ae||e[83]!==ie?(T=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[B,(0,V.jsxs)(`span`,{children:[ae,` / `,ie]})]}),e[82]=ae,e[83]=ie,e[84]=T):T=e[84],I=`flex justify-between`,e[85]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Memory`}),e[85]=b):b=e[85],A=r.toFixed(1),P=` / `,F=t.toFixed(1),e[12]=ae,e[13]=re,e[14]=g,e[15]=m,e[16]=_,e[17]=ie,e[18]=n.arch,e[19]=n.commit,e[20]=n.os,e[21]=n.version,e[22]=te.length,e[23]=oe,e[24]=se,e[25]=b,e[26]=x,e[27]=S,e[28]=C,e[29]=w,e[30]=T,e[31]=E,e[32]=ce,e[33]=D,e[34]=O,e[35]=k,e[36]=A,e[37]=P,e[38]=F,e[39]=I}else oe=e[23],se=e[24],b=e[25],x=e[26],S=e[27],C=e[28],w=e[29],T=e[30],E=e[31],ce=e[32],D=e[33],O=e[34],k=e[35],A=e[36],P=e[37],F=e[38],I=e[39];let R;e[86]!==A||e[87]!==P||e[88]!==F?(R=(0,V.jsxs)(`span`,{children:[A,P,F,` GB`]}),e[86]=A,e[87]=P,e[88]=F,e[89]=R):R=e[89];let H;e[90]!==b||e[91]!==R||e[92]!==I?(H=(0,V.jsxs)(`div`,{className:I,children:[b,R]}),e[90]=b,e[91]=R,e[92]=I,e[93]=H):H=e[93];let U;e[94]!==oe||e[95]!==x||e[96]!==S||e[97]!==C||e[98]!==w||e[99]!==T||e[100]!==H?(U=(0,V.jsxs)(oe,{className:x,children:[S,C,w,T,H]}),e[94]=oe,e[95]=x,e[96]=S,e[97]=C,e[98]=w,e[99]=T,e[100]=H,e[101]=U):U=e[101];let W;e[102]!==se||e[103]!==E||e[104]!==U?(W=(0,V.jsxs)(se,{children:[E,U]}),e[102]=se,e[103]=E,e[104]=U,e[105]=W):W=e[105];let G;e[106]!==ce||e[107]!==D||e[108]!==O||e[109]!==W?(G=(0,V.jsxs)(`div`,{className:ce,children:[D,O,W]}),e[106]=ce,e[107]=D,e[108]=O,e[109]=W,e[110]=G):G=e[110];let K;e[111]!==m||e[112]!==a?(K=m.length>0&&(0,V.jsxs)(N,{children:[(0,V.jsx)(j,{className:`pb-0`,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 text-sm font-medium`,onClick:()=>o(!a),children:[a?(0,V.jsx)(c,{className:`size-3.5`}):(0,V.jsx)(l,{className:`size-3.5`}),`Nodes (`,m.length,`)`]})}),a&&(0,V.jsx)(M,{className:`pt-2`,children:(0,V.jsx)(ye,{nodes:m})})]}),e[111]=m,e[112]=a,e[113]=K):K=e[113];let be;e[114]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,V.jsx)(j,{className:`pb-2`,children:(0,V.jsx)(fe,{className:`text-sm`,children:`Commercial Add-ons`})}),e[114]=be):be=e[114];let q;e[115]===g?q=e[116]:(q=me.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,V.jsx)(`span`,{className:g?`text-muted-foreground`:void 0,children:e.name}),g?(0,V.jsx)(L,{className:`size-3 text-muted-foreground`}):(0,V.jsx)(de,{variant:`outline`,className:`text-[0.625rem]`,children:`Active`})]},e.key)),e[115]=g,e[116]=q);let J;e[117]===q?J=e[118]:(J=(0,V.jsx)(`div`,{className:`space-y-2`,children:q}),e[117]=q,e[118]=J);let xe;e[119]===g?xe=e[120]:(xe=g&&(0,V.jsx)(`a`,{href:`https://mulgadc.com/purchase`,target:`_blank`,rel:`noopener noreferrer`,className:`mt-3 block text-xs font-medium text-primary hover:underline`,children:`Learn more about commercial features →`}),e[119]=g,e[120]=xe);let Se;e[121]!==J||e[122]!==xe?(Se=(0,V.jsxs)(N,{children:[be,(0,V.jsxs)(M,{children:[J,xe]})]}),e[121]=J,e[122]=xe,e[123]=Se):Se=e[123];let Y;return e[124]!==k||e[125]!==G||e[126]!==K||e[127]!==Se?(Y=(0,V.jsxs)(`div`,{className:k,children:[G,K,Se]}),e[124]=k,e[125]=G,e[126]=K,e[127]=Se,e[128]=Y):Y=e[128],Y}function he(e,t){return e+t.alloc_mem_gb}function ge(e,t){return e+t.total_mem_gb}function _e(e,t){return e+t.alloc_vcpu}function ve(e,t){return e+t.total_vcpu}function ye(e){let t=(0,z.c)(5),{nodes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Name`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Status`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Roles`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`IP`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Region`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`AZ`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Uptime`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`EC2`}),(0,V.jsx)(`th`,{className:`pb-1 font-medium`,children:`Services`})]})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(W),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,V.jsx)(`div`,{className:`overflow-x-auto`,children:(0,V.jsxs)(`table`,{className:`w-full text-xs`,children:[r,(0,V.jsx)(`tbody`,{children:i})]})}),t[3]=i,t[4]=a),a}function W(e){return(0,V.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,V.jsx)(`td`,{className:`py-1.5 pr-4 font-mono font-medium`,children:e.node}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:(0,V.jsx)(de,{variant:e.status===`Ready`?`default`:`secondary`,className:`text-[0.625rem]`,children:e.status})}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:(0,V.jsxs)(`div`,{className:`flex gap-1`,children:[e.nats_role&&(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[`nats:`,e.nats_role]}),e.predastore_role&&(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[`ps:`,e.predastore_role]})]})}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.host}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.region}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.az}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:H(e.uptime)}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.vm_count}),(0,V.jsx)(`td`,{className:`py-1.5`,children:(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.services.length})})]},e.node)}var G=`console.spx3.com`,K=`spinifex:v1:sandbox-welcome`,be=[{to:`/ec2/run-instances`,icon:(0,V.jsx)(h,{className:`size-3.5`}),label:`Launch an instance`,hint:`Boot a VM on real hardware`},{to:`/s3/ls`,icon:(0,V.jsx)(I,{className:`size-3.5`}),label:`Create a bucket`,hint:`S3-compatible object storage`},{to:`/ec2/describe-vpcs`,icon:(0,V.jsx)(u,{className:`size-3.5`}),label:`Networking`,hint:`VPCs, subnets and security groups`},{to:`/eks/list-clusters`,icon:(0,V.jsx)(R,{className:`size-3.5`}),label:`Kubernetes`,hint:`Managed EKS-compatible clusters`},{to:`/iam/list-users`,icon:(0,V.jsx)(m,{className:`size-3.5`}),label:`Access keys`,hint:`Credentials for the AWS CLI and SDKs`}];function q(){try{return localStorage.getItem(K)!==null}catch{}return!1}function J(){try{localStorage.setItem(K,`1`)}catch{}}function xe(){let e=(0,z.c)(7),[t,n]=(0,B.useState)(Se),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=e=>{e||J(),n(e)},e[0]=r):r=e[0];let i=r,o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsxs)(ce,{children:[(0,V.jsx)(S,{children:(0,V.jsx)(F,{className:`text-primary`})}),(0,V.jsx)(w,{children:`Welcome to the Mulga sandbox`}),(0,V.jsx)(x,{children:`You have a real account on a shared evaluation cluster. The APIs are the AWS ones, so the CLI and the SDKs work against it unchanged. Resources here may be reclaimed, so please don't keep anything you need in it.`})]}),e[1]=o):o=e[1];let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(`div`,{className:`space-y-0.5`,children:be.map(e=>(0,V.jsxs)(a,{className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-xs hover:bg-muted`,onClick:()=>i(!1),to:e.to,children:[e.icon,(0,V.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.hint})]},e.to))}),e[2]=s):s=e[2];let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(`a`,{className:`text-xs text-muted-foreground underline underline-offset-3 hover:text-foreground sm:mr-auto sm:self-center`,href:`https://docs.mulgadc.com`,rel:`noreferrer`,target:`_blank`,children:`Read the docs`}),e[3]=c):c=e[3];let l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsxs)(C,{className:`max-w-lg`,children:[o,s,(0,V.jsxs)(E,{children:[c,(0,V.jsx)(T,{onClick:()=>i(!1),children:`Get started`})]})]}),e[4]=l):l=e[4];let u;return e[5]===t?u=e[6]:(u=(0,V.jsx)(D,{onOpenChange:i,open:t,children:l}),e[5]=t,e[6]=u),u}function Se(){return window.location.hostname===G&&!q()}var Y=5;function Ce(){let e=(0,z.c)(12),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(b,{title:`Dashboard`}),n=(0,V.jsx)(xe,{}),r=(0,V.jsx)(U,{}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(we,{})}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(je,{})}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(Ie,{})}),e[5]=o):o=e[5];let s;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(Re,{})}),e[6]=s):s=e[6];let c;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(Be,{})}),e[7]=c):c=e[7];let l;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(He,{})}),e[8]=l):l=e[8];let u;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(We,{})}),e[9]=u):u=e[9];let d;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(Je,{})}),e[10]=d):d=e[10];let f;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsxs)(V.Fragment,{children:[t,n,r,(0,V.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`,children:[i,a,o,s,c,l,u,d,(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(Ke,{})})]})]}),e[11]=f):f=e[11],f}function X(){let e=(0,z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(j,{children:(0,V.jsx)(`div`,{className:`h-4 w-32 animate-pulse rounded bg-muted`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsxs)(N,{children:[t,(0,V.jsx)(M,{children:(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`div`,{className:`h-3 w-48 animate-pulse rounded bg-muted`}),(0,V.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`})]})})]}),e[1]=n):n=e[1],n}function Z(e){let t=(0,z.c)(16),{title:n,icon:r,count:i,to:o,children:s}=e,c;t[0]!==r||t[1]!==n?(c=(0,V.jsxs)(fe,{className:`flex items-center gap-2`,children:[r,n]}),t[0]=r,t[1]=n,t[2]=c):c=t[2];let l;t[3]===i?l=t[4]:(l=(0,V.jsx)(A,{children:(0,V.jsx)(`span`,{className:`rounded-md bg-muted px-2 py-0.5 text-xs font-semibold tabular-nums`,children:i})}),t[3]=i,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,V.jsxs)(j,{children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]===s?d=t[9]:(d=(0,V.jsx)(M,{children:s}),t[8]=s,t[9]=d);let f;t[10]===o?f=t[11]:(f=(0,V.jsx)(k,{children:(0,V.jsx)(a,{to:o,className:`text-xs font-medium text-primary hover:underline`,children:`View all →`})}),t[10]=o,t[11]=f);let p;return t[12]!==u||t[13]!==d||t[14]!==f?(p=(0,V.jsxs)(N,{children:[u,d,f]}),t[12]=u,t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function Q(e){let t=(0,z.c)(2),{total:n}=e;if(n<=Y)return null;let r=n-Y,i;return t[0]===r?i=t[1]:(i=(0,V.jsxs)(`p`,{className:`mt-1 text-[0.625rem] text-muted-foreground`,children:[`+`,r,` more`]}),t[0]=r,t[1]=i),i}function $(e){let t=(0,z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,V.jsx)(`div`,{className:`flex items-center justify-between py-0.5 text-xs`,children:n}),t[0]=n,t[1]=r),r}function we(){let e=(0,z.c)(16),{data:t}=i(ie),n,r,a,o,s;if(e[0]!==t?.Reservations){let i=t?.Reservations?.flatMap(Ae)??[];n=i.filter(ke),a=i.filter(Oe),o=i.filter(De),r=i.filter(Ee),s=[...a,...r].slice(0,Y),e[0]=t?.Reservations,e[1]=n,e[2]=r,e[3]=a,e[4]=o,e[5]=s}else n=e[1],r=e[2],a=e[3],o=e[4],s=e[5];let c=s,l;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(h,{className:`size-3.5`}),e[6]=l):l=e[6];let u;e[7]!==n.length||e[8]!==c||e[9]!==r||e[10]!==a||e[11]!==o?(u=n.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No instances`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`mb-2 flex gap-3 text-[0.625rem] text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[a.length,` running`]}),(0,V.jsxs)(`span`,{children:[o.length,` stopped`]})]}),(0,V.jsx)(`div`,{className:`space-y-0.5`,children:c.map(Te)}),(0,V.jsx)(Q,{total:a.length+r.length})]}),e[7]=n.length,e[8]=c,e[9]=r,e[10]=a,e[11]=o,e[12]=u):u=e[12];let d;return e[13]!==n.length||e[14]!==u?(d=(0,V.jsx)(Z,{title:`Instances`,icon:l,count:n.length,to:`/ec2/describe-instances`,children:u}),e[13]=n.length,e[14]=u,e[15]=d):d=e[15],d}function Te(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.InstanceId}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.InstanceType})]},e.InstanceId)}function Ee(e){return e.State?.Name===`pending`}function De(e){return e.State?.Name===`stopped`}function Oe(e){return e.State?.Name===`running`}function ke(e){return e.State?.Name!==`terminated`}function Ae(e){return e.Instances??[]}function je(){let e=(0,z.c)(14),{data:t}=i(re),n;e[0]===t?.Volumes?n=e[1]:(n=t?.Volumes??[],e[0]=t?.Volumes,e[1]=n);let r=n,a;e[2]===r?a=e[3]:(a=r.reduce(Fe,0),e[2]=r,e[3]=a);let o=a,s;e[4]===r?s=e[5]:(s=r.filter(Pe),e[4]=r,e[5]=s);let c=s,l;e[6]===r?l=e[7]:(l=r.filter(Ne),e[6]=r,e[7]=l);let u=l,d;if(e[8]!==u||e[9]!==c||e[10]!==o||e[11]!==r){let t=r.slice(0,Y),n;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(P,{className:`size-3.5`}),e[13]=n):n=e[13],d=(0,V.jsx)(Z,{title:`Volumes`,icon:n,count:r.length,to:`/ec2/describe-volumes`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No volumes`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`mb-2 flex gap-3 text-[0.625rem] text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[o,` GiB total`]}),(0,V.jsxs)(`span`,{children:[c.length,` in-use`]}),(0,V.jsxs)(`span`,{children:[u.length,` available`]})]}),(0,V.jsx)(`div`,{className:`space-y-0.5`,children:t.map(Me)}),(0,V.jsx)(Q,{total:r.length})]})}),e[8]=u,e[9]=c,e[10]=o,e[11]=r,e[12]=d}else d=e[12];return d}function Me(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.VolumeId}),(0,V.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.Size,` GiB`]}),(0,V.jsx)(O,{state:e.State})]})]},e.VolumeId)}function Ne(e){return e.State===`available`}function Pe(e){return e.State===`in-use`}function Fe(e,t){return e+(t.Size??0)}function Ie(){let e=(0,z.c)(5),{data:t}=i(g),n;e[0]===t?.Vpcs?n=e[1]:(n=t?.Vpcs??[],e[0]=t?.Vpcs,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(u,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`VPCs`,icon:n,count:r.length,to:`/ec2/describe-vpcs`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No VPCs`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(Le),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function Le(e){let t=o(e.Tags);return(0,V.jsxs)($,{children:[(0,V.jsxs)(`span`,{className:`font-mono`,children:[e.VpcId,t&&(0,V.jsxs)(`span`,{className:`ml-1 font-sans text-muted-foreground`,children:[`(`,t,`)`]})]}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.CidrBlock})]},e.VpcId)}function Re(){let e=(0,z.c)(5),{data:t}=i(ae),n;e[0]===t?.KeyPairs?n=e[1]:(n=t?.KeyPairs??[],e[0]=t?.KeyPairs,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(m,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`Key Pairs`,icon:n,count:r.length,to:`/ec2/describe-key-pairs`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No key pairs`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(ze),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function ze(e){return(0,V.jsx)($,{children:(0,V.jsx)(`span`,{className:`font-mono`,children:e.KeyName})},e.KeyPairId)}function Be(){let e=(0,z.c)(5),{data:t}=i(se),n;e[0]===t?.Buckets?n=e[1]:(n=t?.Buckets??[],e[0]=t?.Buckets,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(I,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`S3 Buckets`,icon:n,count:r.length,to:`/s3/ls`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No buckets`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(Ve),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function Ve(e){return(0,V.jsx)($,{children:(0,V.jsx)(`span`,{className:`font-mono`,children:e.Name})},e.Name)}function He(){let e=(0,z.c)(5),{data:t}=i(oe),n;e[0]===t?.SecurityGroups?n=e[1]:(n=t?.SecurityGroups??[],e[0]=t?.SecurityGroups,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(p,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`Security Groups`,icon:n,count:r.length,to:`/ec2/describe-security-groups`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No security groups`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(Ue),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function Ue(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.GroupName}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.VpcId})]},e.GroupId)}function We(){let e=(0,z.c)(5),{data:t}=i(_),n;e[0]===t?.NatGateways?n=e[1]:(n=t?.NatGateways??[],e[0]=t?.NatGateways,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(te,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`NAT Gateways`,icon:n,count:r.length,to:`/ec2/describe-nat-gateways`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No NAT gateways`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(Ge),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function Ge(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.NatGatewayId}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.State})]},e.NatGatewayId)}function Ke(){let e=(0,z.c)(5),{data:t}=i(v),n;e[0]===t?.InternetGateways?n=e[1]:(n=t?.InternetGateways??[],e[0]=t?.InternetGateways,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(f,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`Internet Gateways`,icon:n,count:r.length,to:`/ec2/describe-internet-gateways`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No internet gateways`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(qe),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function qe(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.InternetGatewayId}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.Attachments?.[0]?.VpcId?`attached`:`detached`})]},e.InternetGatewayId)}function Je(){let e=(0,z.c)(5),{data:t}=i(y),n;e[0]===t?.Addresses?n=e[1]:(n=t?.Addresses??[],e[0]=t?.Addresses,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(d,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`Elastic IPs`,icon:n,count:r.length,to:`/ec2/describe-addresses`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No Elastic IPs`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(Ye),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function Ye(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.PublicIp}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.AssociationId?`associated`:`available`})]},e.AllocationId)}export{Ce as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./link.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./createLucideIcon.js";import{t as c}from"./chevron-down.js";import{t as l}from"./chevron-right.js";import{a as u,c as d,i as f,n as p,o as m,r as ee,s as h,t as te}from"./waypoints.js";import{n as ne}from"./admin-context.js";import{A as re,M as g,_,d as v,l as ie,n as y,p as ae,w as oe}from"./ec2.js";import{n as se}from"./s32.js";import{t as b}from"./page-heading.js";import{a as x,c as S,i as C,l as w,n as T,o as E,s as ce,t as D}from"./alert-dialog.js";import{t as O}from"./state-badge.js";import{r as le,t as ue}from"./admin.js";import{t as de}from"./badge.js";import{a as k,n as A,o as j,r as M,s as fe,t as N}from"./card.js";var P=s(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),F=s(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),I=s(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),L=s(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),pe=s(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),R=s(`ship`,[[`path`,{d:`M12 10.189V14`,key:`1p8cqu`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6`,key:`qpkstq`}],[`path`,{d:`M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76`,key:`7tigtc`}],[`path`,{d:`M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1924j5`}]]),z=r(),B=e(n(),1),V=t(),me=[{name:`Air-gap Support`,key:`airgap`},{name:`NVIDIA Bluefield DPU`,key:`bluefield`},{name:`NVIDIA MIG Support`,key:`mig`}];function H(e){let t=Math.floor(e/86400),n=Math.floor(e%86400/3600);if(t>0)return`${t}d ${n}h`;let r=Math.floor(e%3600/60);return n>0?`${n}h ${r}m`:`${r}m`}function U(){let e=(0,z.c)(129),{isAdmin:t,version:n,license:r}=ne(),[a,o]=(0,B.useState)(!1),s;e[0]===t?s=e[1]:(s={...ue,enabled:t},e[0]=t,e[1]=s);let{data:u}=i(s),d;e[2]===t?d=e[3]:(d={...le,enabled:t},e[2]=t,e[3]=d);let{data:f}=i(d);if(!t||!n)return null;let p;e[4]===u?.nodes?p=e[5]:(p=u?.nodes??[],e[4]=u?.nodes,e[5]=p);let m=p,h;e[6]===f?.vms?h=e[7]:(h=f?.vms??[],e[6]=f?.vms,e[7]=h);let te=h,re=u?.cluster_mode??`single-node`,g=r===`open-source`,_=m[0]?.region??null,v;e[8]===m?v=e[9]:(v=m.reduce(ve,0),e[8]=m,e[9]=v);let ie=v,y;e[10]===m?y=e[11]:(y=m.reduce(_e,0),e[10]=m,e[11]=y);let ae=y,oe,se,b,x,S,C,w,T,E,ce,D,O,k,A,P,F,I;if(e[12]!==ae||e[13]!==re||e[14]!==g||e[15]!==m||e[16]!==_||e[17]!==ie||e[18]!==n.arch||e[19]!==n.commit||e[20]!==n.os||e[21]!==n.version||e[22]!==te.length){let t=m.reduce(ge,0),r=m.reduce(he,0);k=`mb-6 space-y-4`,ce=`grid grid-cols-1 gap-4 md:grid-cols-3`;let i;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(j,{className:`pb-2`,children:(0,V.jsxs)(fe,{className:`flex items-center gap-2 text-sm`,children:[(0,V.jsx)(pe,{className:`size-3.5`}),`Spinifex Info`]})}),e[40]=i):i=e[40];let a;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Version`}),e[41]=a):a=e[41];let o;e[42]===n.version?o=e[43]:(o=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[a,(0,V.jsx)(`span`,{className:`font-mono`,children:n.version})]}),e[42]=n.version,e[43]=o);let s;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Commit`}),e[44]=s):s=e[44];let c;e[45]===n.commit?c=e[46]:(c=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[s,(0,V.jsx)(`span`,{className:`font-mono`,children:n.commit})]}),e[45]=n.commit,e[46]=c);let l;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Platform`}),e[47]=l):l=e[47];let u;e[48]!==n.arch||e[49]!==n.os?(u=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[l,(0,V.jsxs)(`span`,{children:[n.os,`/`,n.arch]})]}),e[48]=n.arch,e[49]=n.os,e[50]=u):u=e[50];let d;e[51]===_?d=e[52]:(d=_&&(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Region`}),(0,V.jsx)(`span`,{children:_})]}),e[51]=_,e[52]=d),e[53]!==o||e[54]!==c||e[55]!==u||e[56]!==d?(D=(0,V.jsxs)(N,{children:[i,(0,V.jsxs)(M,{className:`space-y-1 text-xs`,children:[o,c,u,d]})]}),e[53]=o,e[54]=c,e[55]=u,e[56]=d,e[57]=D):D=e[57];let f;e[58]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsx)(j,{className:`pb-2`,children:(0,V.jsx)(fe,{className:`text-sm`,children:`License & Support`})}),e[58]=f):f=e[58];let p;e[59]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`License`}),e[59]=p):p=e[59];let h=g?`secondary`:`default`,ne=g?`Open Source (AGPLv3)`:`Commercial`,v;e[60]!==h||e[61]!==ne?(v=(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[p,(0,V.jsx)(de,{variant:h,children:ne})]}),e[60]=h,e[61]=ne,e[62]=v):v=e[62];let y;e[63]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Support`}),e[63]=y):y=e[63];let le=g?`Community`:`Standard`,ue;e[64]===le?ue=e[65]:(ue=(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[y,(0,V.jsx)(`span`,{children:le})]}),e[64]=le,e[65]=ue);let L;e[66]===g?L=e[67]:(L=g&&(0,V.jsx)(`a`,{href:`https://mulgadc.com/purchase`,target:`_blank`,rel:`noopener noreferrer`,className:`mt-2 block text-xs font-medium text-primary hover:underline`,children:`Upgrade to Commercial →`}),e[66]=g,e[67]=L),e[68]!==v||e[69]!==ue||e[70]!==L?(O=(0,V.jsxs)(N,{children:[f,(0,V.jsxs)(M,{className:`space-y-2 text-xs`,children:[v,ue,L]})]}),e[68]=v,e[69]=ue,e[70]=L,e[71]=O):O=e[71],se=N,e[72]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,V.jsx)(j,{className:`pb-2`,children:(0,V.jsxs)(fe,{className:`flex items-center gap-2 text-sm`,children:[(0,V.jsx)(ee,{className:`size-3.5`}),`Cluster Status`]})}),e[72]=E):E=e[72],oe=M,x=`space-y-2 text-xs`,e[73]===re?S=e[74]:(S=(0,V.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,V.jsx)(de,{variant:`outline`,children:re})}),e[73]=re,e[74]=S);let R;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Nodes`}),e[75]=R):R=e[75],e[76]===m.length?C=e[77]:(C=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[R,(0,V.jsx)(`span`,{children:m.length})]}),e[76]=m.length,e[77]=C);let z;e[78]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Instances`}),e[78]=z):z=e[78],e[79]===te.length?w=e[80]:(w=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[z,(0,V.jsx)(`span`,{children:te.length})]}),e[79]=te.length,e[80]=w);let B;e[81]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`vCPU`}),e[81]=B):B=e[81],e[82]!==ae||e[83]!==ie?(T=(0,V.jsxs)(`div`,{className:`flex justify-between`,children:[B,(0,V.jsxs)(`span`,{children:[ae,` / `,ie]})]}),e[82]=ae,e[83]=ie,e[84]=T):T=e[84],I=`flex justify-between`,e[85]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Memory`}),e[85]=b):b=e[85],A=r.toFixed(1),P=` / `,F=t.toFixed(1),e[12]=ae,e[13]=re,e[14]=g,e[15]=m,e[16]=_,e[17]=ie,e[18]=n.arch,e[19]=n.commit,e[20]=n.os,e[21]=n.version,e[22]=te.length,e[23]=oe,e[24]=se,e[25]=b,e[26]=x,e[27]=S,e[28]=C,e[29]=w,e[30]=T,e[31]=E,e[32]=ce,e[33]=D,e[34]=O,e[35]=k,e[36]=A,e[37]=P,e[38]=F,e[39]=I}else oe=e[23],se=e[24],b=e[25],x=e[26],S=e[27],C=e[28],w=e[29],T=e[30],E=e[31],ce=e[32],D=e[33],O=e[34],k=e[35],A=e[36],P=e[37],F=e[38],I=e[39];let R;e[86]!==A||e[87]!==P||e[88]!==F?(R=(0,V.jsxs)(`span`,{children:[A,P,F,` GB`]}),e[86]=A,e[87]=P,e[88]=F,e[89]=R):R=e[89];let H;e[90]!==b||e[91]!==R||e[92]!==I?(H=(0,V.jsxs)(`div`,{className:I,children:[b,R]}),e[90]=b,e[91]=R,e[92]=I,e[93]=H):H=e[93];let U;e[94]!==oe||e[95]!==x||e[96]!==S||e[97]!==C||e[98]!==w||e[99]!==T||e[100]!==H?(U=(0,V.jsxs)(oe,{className:x,children:[S,C,w,T,H]}),e[94]=oe,e[95]=x,e[96]=S,e[97]=C,e[98]=w,e[99]=T,e[100]=H,e[101]=U):U=e[101];let W;e[102]!==se||e[103]!==E||e[104]!==U?(W=(0,V.jsxs)(se,{children:[E,U]}),e[102]=se,e[103]=E,e[104]=U,e[105]=W):W=e[105];let G;e[106]!==ce||e[107]!==D||e[108]!==O||e[109]!==W?(G=(0,V.jsxs)(`div`,{className:ce,children:[D,O,W]}),e[106]=ce,e[107]=D,e[108]=O,e[109]=W,e[110]=G):G=e[110];let K;e[111]!==m||e[112]!==a?(K=m.length>0&&(0,V.jsxs)(N,{children:[(0,V.jsx)(j,{className:`pb-0`,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 text-sm font-medium`,onClick:()=>{o(!a)},children:[a?(0,V.jsx)(c,{className:`size-3.5`}):(0,V.jsx)(l,{className:`size-3.5`}),`Nodes (`,m.length,`)`]})}),a&&(0,V.jsx)(M,{className:`pt-2`,children:(0,V.jsx)(ye,{nodes:m})})]}),e[111]=m,e[112]=a,e[113]=K):K=e[113];let be;e[114]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,V.jsx)(j,{className:`pb-2`,children:(0,V.jsx)(fe,{className:`text-sm`,children:`Commercial Add-ons`})}),e[114]=be):be=e[114];let q;e[115]===g?q=e[116]:(q=me.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,V.jsx)(`span`,{className:g?`text-muted-foreground`:void 0,children:e.name}),g?(0,V.jsx)(L,{className:`size-3 text-muted-foreground`}):(0,V.jsx)(de,{variant:`outline`,className:`text-[0.625rem]`,children:`Active`})]},e.key)),e[115]=g,e[116]=q);let J;e[117]===q?J=e[118]:(J=(0,V.jsx)(`div`,{className:`space-y-2`,children:q}),e[117]=q,e[118]=J);let xe;e[119]===g?xe=e[120]:(xe=g&&(0,V.jsx)(`a`,{href:`https://mulgadc.com/purchase`,target:`_blank`,rel:`noopener noreferrer`,className:`mt-3 block text-xs font-medium text-primary hover:underline`,children:`Learn more about commercial features →`}),e[119]=g,e[120]=xe);let Se;e[121]!==J||e[122]!==xe?(Se=(0,V.jsxs)(N,{children:[be,(0,V.jsxs)(M,{children:[J,xe]})]}),e[121]=J,e[122]=xe,e[123]=Se):Se=e[123];let Y;return e[124]!==k||e[125]!==G||e[126]!==K||e[127]!==Se?(Y=(0,V.jsxs)(`div`,{className:k,children:[G,K,Se]}),e[124]=k,e[125]=G,e[126]=K,e[127]=Se,e[128]=Y):Y=e[128],Y}function he(e,t){return e+t.alloc_mem_gb}function ge(e,t){return e+t.total_mem_gb}function _e(e,t){return e+t.alloc_vcpu}function ve(e,t){return e+t.total_vcpu}function ye(e){let t=(0,z.c)(5),{nodes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Name`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Status`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Roles`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`IP`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Region`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`AZ`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Uptime`}),(0,V.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`EC2`}),(0,V.jsx)(`th`,{className:`pb-1 font-medium`,children:`Services`})]})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(W),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,V.jsx)(`div`,{className:`overflow-x-auto`,children:(0,V.jsxs)(`table`,{className:`w-full text-xs`,children:[r,(0,V.jsx)(`tbody`,{children:i})]})}),t[3]=i,t[4]=a),a}function W(e){return(0,V.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,V.jsx)(`td`,{className:`py-1.5 pr-4 font-mono font-medium`,children:e.node}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:(0,V.jsx)(de,{variant:e.status===`Ready`?`default`:`secondary`,className:`text-[0.625rem]`,children:e.status})}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:(0,V.jsxs)(`div`,{className:`flex gap-1`,children:[e.nats_role&&(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[`nats:`,e.nats_role]}),e.predastore_role&&(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[`ps:`,e.predastore_role]})]})}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.host}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.region}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.az}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:H(e.uptime)}),(0,V.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.vm_count}),(0,V.jsx)(`td`,{className:`py-1.5`,children:(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.services.length})})]},e.node)}var G=`console.spx3.com`,K=`spinifex:v1:sandbox-welcome`,be=[{to:`/ec2/run-instances`,icon:(0,V.jsx)(h,{className:`size-3.5`}),label:`Launch an instance`,hint:`Boot a VM on real hardware`},{to:`/s3/ls`,icon:(0,V.jsx)(I,{className:`size-3.5`}),label:`Create a bucket`,hint:`S3-compatible object storage`},{to:`/ec2/describe-vpcs`,icon:(0,V.jsx)(u,{className:`size-3.5`}),label:`Networking`,hint:`VPCs, subnets and security groups`},{to:`/eks/list-clusters`,icon:(0,V.jsx)(R,{className:`size-3.5`}),label:`Kubernetes`,hint:`Managed EKS-compatible clusters`},{to:`/iam/list-users`,icon:(0,V.jsx)(m,{className:`size-3.5`}),label:`Access keys`,hint:`Credentials for the AWS CLI and SDKs`}];function q(){try{return localStorage.getItem(K)!==null}catch{}return!1}function J(){try{localStorage.setItem(K,`1`)}catch{}}function xe(){let e=(0,z.c)(7),[t,n]=(0,B.useState)(Se),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=e=>{e||J(),n(e)},e[0]=r):r=e[0];let i=r,o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsxs)(ce,{children:[(0,V.jsx)(S,{children:(0,V.jsx)(F,{className:`text-primary`})}),(0,V.jsx)(w,{children:`Welcome to the Mulga sandbox`}),(0,V.jsx)(x,{children:`You have a real account on a shared evaluation cluster. The APIs are the AWS ones, so the CLI and the SDKs work against it unchanged. Resources here may be reclaimed, so please don't keep anything you need in it.`})]}),e[1]=o):o=e[1];let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(`div`,{className:`space-y-0.5`,children:be.map(e=>(0,V.jsxs)(a,{className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-xs hover:bg-muted`,onClick:()=>{i(!1)},to:e.to,children:[e.icon,(0,V.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.hint})]},e.to))}),e[2]=s):s=e[2];let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(`a`,{className:`text-xs text-muted-foreground underline underline-offset-3 hover:text-foreground sm:mr-auto sm:self-center`,href:`https://docs.mulgadc.com`,rel:`noreferrer`,target:`_blank`,children:`Read the docs`}),e[3]=c):c=e[3];let l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsxs)(C,{className:`max-w-lg`,children:[o,s,(0,V.jsxs)(E,{children:[c,(0,V.jsx)(T,{onClick:()=>{i(!1)},children:`Get started`})]})]}),e[4]=l):l=e[4];let u;return e[5]===t?u=e[6]:(u=(0,V.jsx)(D,{onOpenChange:i,open:t,children:l}),e[5]=t,e[6]=u),u}function Se(){return window.location.hostname===G&&!q()}var Y=5;function Ce(){let e=(0,z.c)(12),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(b,{title:`Dashboard`}),n=(0,V.jsx)(xe,{}),r=(0,V.jsx)(U,{}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(we,{})}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(je,{})}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(Ie,{})}),e[5]=o):o=e[5];let s;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(Re,{})}),e[6]=s):s=e[6];let c;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(Be,{})}),e[7]=c):c=e[7];let l;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(He,{})}),e[8]=l):l=e[8];let u;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(We,{})}),e[9]=u):u=e[9];let d;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(Je,{})}),e[10]=d):d=e[10];let f;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsxs)(V.Fragment,{children:[t,n,r,(0,V.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`,children:[i,a,o,s,c,l,u,d,(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(X,{}),children:(0,V.jsx)(Ke,{})})]})]}),e[11]=f):f=e[11],f}function X(){let e=(0,z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(j,{children:(0,V.jsx)(`div`,{className:`h-4 w-32 animate-pulse rounded bg-muted`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsxs)(N,{children:[t,(0,V.jsx)(M,{children:(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`div`,{className:`h-3 w-48 animate-pulse rounded bg-muted`}),(0,V.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`})]})})]}),e[1]=n):n=e[1],n}function Z(e){let t=(0,z.c)(16),{title:n,icon:r,count:i,to:o,children:s}=e,c;t[0]!==r||t[1]!==n?(c=(0,V.jsxs)(fe,{className:`flex items-center gap-2`,children:[r,n]}),t[0]=r,t[1]=n,t[2]=c):c=t[2];let l;t[3]===i?l=t[4]:(l=(0,V.jsx)(A,{children:(0,V.jsx)(`span`,{className:`rounded-md bg-muted px-2 py-0.5 text-xs font-semibold tabular-nums`,children:i})}),t[3]=i,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,V.jsxs)(j,{children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]===s?d=t[9]:(d=(0,V.jsx)(M,{children:s}),t[8]=s,t[9]=d);let f;t[10]===o?f=t[11]:(f=(0,V.jsx)(k,{children:(0,V.jsx)(a,{to:o,className:`text-xs font-medium text-primary hover:underline`,children:`View all →`})}),t[10]=o,t[11]=f);let p;return t[12]!==u||t[13]!==d||t[14]!==f?(p=(0,V.jsxs)(N,{children:[u,d,f]}),t[12]=u,t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function Q(e){let t=(0,z.c)(2),{total:n}=e;if(n<=Y)return null;let r=n-Y,i;return t[0]===r?i=t[1]:(i=(0,V.jsxs)(`p`,{className:`mt-1 text-[0.625rem] text-muted-foreground`,children:[`+`,r,` more`]}),t[0]=r,t[1]=i),i}function $(e){let t=(0,z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,V.jsx)(`div`,{className:`flex items-center justify-between py-0.5 text-xs`,children:n}),t[0]=n,t[1]=r),r}function we(){let e=(0,z.c)(16),{data:t}=i(ie),n,r,a,o,s;if(e[0]!==t?.Reservations){let i=t?.Reservations?.flatMap(Ae)??[];n=i.filter(ke),a=i.filter(Oe),o=i.filter(De),r=i.filter(Ee),s=[...a,...r].slice(0,Y),e[0]=t?.Reservations,e[1]=n,e[2]=r,e[3]=a,e[4]=o,e[5]=s}else n=e[1],r=e[2],a=e[3],o=e[4],s=e[5];let c=s,l;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(h,{className:`size-3.5`}),e[6]=l):l=e[6];let u;e[7]!==n.length||e[8]!==c||e[9]!==r||e[10]!==a||e[11]!==o?(u=n.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No instances`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`mb-2 flex gap-3 text-[0.625rem] text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[a.length,` running`]}),(0,V.jsxs)(`span`,{children:[o.length,` stopped`]})]}),(0,V.jsx)(`div`,{className:`space-y-0.5`,children:c.map(Te)}),(0,V.jsx)(Q,{total:a.length+r.length})]}),e[7]=n.length,e[8]=c,e[9]=r,e[10]=a,e[11]=o,e[12]=u):u=e[12];let d;return e[13]!==n.length||e[14]!==u?(d=(0,V.jsx)(Z,{title:`Instances`,icon:l,count:n.length,to:`/ec2/describe-instances`,children:u}),e[13]=n.length,e[14]=u,e[15]=d):d=e[15],d}function Te(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.InstanceId}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.InstanceType})]},e.InstanceId)}function Ee(e){return e.State?.Name===`pending`}function De(e){return e.State?.Name===`stopped`}function Oe(e){return e.State?.Name===`running`}function ke(e){return e.State?.Name!==`terminated`}function Ae(e){return e.Instances??[]}function je(){let e=(0,z.c)(14),{data:t}=i(re),n;e[0]===t?.Volumes?n=e[1]:(n=t?.Volumes??[],e[0]=t?.Volumes,e[1]=n);let r=n,a;e[2]===r?a=e[3]:(a=r.reduce(Fe,0),e[2]=r,e[3]=a);let o=a,s;e[4]===r?s=e[5]:(s=r.filter(Pe),e[4]=r,e[5]=s);let c=s,l;e[6]===r?l=e[7]:(l=r.filter(Ne),e[6]=r,e[7]=l);let u=l,d;if(e[8]!==u||e[9]!==c||e[10]!==o||e[11]!==r){let t=r.slice(0,Y),n;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(P,{className:`size-3.5`}),e[13]=n):n=e[13],d=(0,V.jsx)(Z,{title:`Volumes`,icon:n,count:r.length,to:`/ec2/describe-volumes`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No volumes`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`mb-2 flex gap-3 text-[0.625rem] text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[o,` GiB total`]}),(0,V.jsxs)(`span`,{children:[c.length,` in-use`]}),(0,V.jsxs)(`span`,{children:[u.length,` available`]})]}),(0,V.jsx)(`div`,{className:`space-y-0.5`,children:t.map(Me)}),(0,V.jsx)(Q,{total:r.length})]})}),e[8]=u,e[9]=c,e[10]=o,e[11]=r,e[12]=d}else d=e[12];return d}function Me(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.VolumeId}),(0,V.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.Size,` GiB`]}),(0,V.jsx)(O,{state:e.State})]})]},e.VolumeId)}function Ne(e){return e.State===`available`}function Pe(e){return e.State===`in-use`}function Fe(e,t){return e+(t.Size??0)}function Ie(){let e=(0,z.c)(5),{data:t}=i(g),n;e[0]===t?.Vpcs?n=e[1]:(n=t?.Vpcs??[],e[0]=t?.Vpcs,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(u,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`VPCs`,icon:n,count:r.length,to:`/ec2/describe-vpcs`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No VPCs`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(Le),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function Le(e){let t=o(e.Tags);return(0,V.jsxs)($,{children:[(0,V.jsxs)(`span`,{className:`font-mono`,children:[e.VpcId,t&&(0,V.jsxs)(`span`,{className:`ml-1 font-sans text-muted-foreground`,children:[`(`,t,`)`]})]}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.CidrBlock})]},e.VpcId)}function Re(){let e=(0,z.c)(5),{data:t}=i(ae),n;e[0]===t?.KeyPairs?n=e[1]:(n=t?.KeyPairs??[],e[0]=t?.KeyPairs,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(m,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`Key Pairs`,icon:n,count:r.length,to:`/ec2/describe-key-pairs`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No key pairs`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(ze),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function ze(e){return(0,V.jsx)($,{children:(0,V.jsx)(`span`,{className:`font-mono`,children:e.KeyName})},e.KeyPairId)}function Be(){let e=(0,z.c)(5),{data:t}=i(se),n;e[0]===t?.Buckets?n=e[1]:(n=t?.Buckets??[],e[0]=t?.Buckets,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(I,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`S3 Buckets`,icon:n,count:r.length,to:`/s3/ls`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No buckets`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(Ve),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function Ve(e){return(0,V.jsx)($,{children:(0,V.jsx)(`span`,{className:`font-mono`,children:e.Name})},e.Name)}function He(){let e=(0,z.c)(5),{data:t}=i(oe),n;e[0]===t?.SecurityGroups?n=e[1]:(n=t?.SecurityGroups??[],e[0]=t?.SecurityGroups,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(p,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`Security Groups`,icon:n,count:r.length,to:`/ec2/describe-security-groups`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No security groups`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(Ue),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function Ue(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.GroupName}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.VpcId})]},e.GroupId)}function We(){let e=(0,z.c)(5),{data:t}=i(_),n;e[0]===t?.NatGateways?n=e[1]:(n=t?.NatGateways??[],e[0]=t?.NatGateways,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(te,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`NAT Gateways`,icon:n,count:r.length,to:`/ec2/describe-nat-gateways`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No NAT gateways`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(Ge),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function Ge(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.NatGatewayId}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.State})]},e.NatGatewayId)}function Ke(){let e=(0,z.c)(5),{data:t}=i(v),n;e[0]===t?.InternetGateways?n=e[1]:(n=t?.InternetGateways??[],e[0]=t?.InternetGateways,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(f,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`Internet Gateways`,icon:n,count:r.length,to:`/ec2/describe-internet-gateways`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No internet gateways`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(qe),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function qe(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.InternetGatewayId}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.Attachments?.[0]?.VpcId?`attached`:`detached`})]},e.InternetGatewayId)}function Je(){let e=(0,z.c)(5),{data:t}=i(y),n;e[0]===t?.Addresses?n=e[1]:(n=t?.Addresses??[],e[0]=t?.Addresses,e[1]=n);let r=n,a;if(e[2]!==r){let t=r.slice(0,Y),n;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(d,{className:`size-3.5`}),e[4]=n):n=e[4],a=(0,V.jsx)(Z,{title:`Elastic IPs`,icon:n,count:r.length,to:`/ec2/describe-addresses`,children:r.length===0?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No Elastic IPs`}):(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[t.map(Ye),(0,V.jsx)(Q,{total:r.length})]})}),e[2]=r,e[3]=a}else a=e[3];return a}function Ye(e){return(0,V.jsxs)($,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.PublicIp}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:e.AssociationId?`associated`:`available`})]},e.AllocationId)}export{Ce as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_clusterName3.js b/spinifex/services/spinifexui/frontend/dist/assets/_clusterName3.js index 6450e7876..3e0991417 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_clusterName3.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_clusterName3.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{t as s}from"./useNavigate.js";import{t as c}from"./back-link.js";import{t as l}from"./trash-2.js";import{t as u}from"./button.js";import{t as d}from"./input.js";import{O as f,c as p,p as m,w as h}from"./ec2.js";import{i as g,r as _,s as v,t as y}from"./ecs.js";import{i as b,l as x,o as S,r as C,u as w}from"./ecs2.js";import{t as T}from"./_clusterName2.js";import{t as ee}from"./error-banner.js";import{t as E}from"./page-heading.js";import{a as D,t as O}from"./field.js";import{a as k,i as A,l as j,n as te,o as M,r as ne,s as N,t as re}from"./alert-dialog.js";import{t as P}from"./delete-confirmation-dialog.js";import{n as ie,t as F}from"./detail-row.js";import{t as I}from"./state-badge.js";import{t as L}from"./gpu-instance-type-select.js";import{i as R,n as ae,r as z,t as oe}from"./tabs.js";var B=r(),V=e(n(),1),H=t(),U=`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`;function W(e){let t=(0,B.c)(79),{clusterName:n,open:r,onOpenChange:a}=e,o=S(),{data:s}=i(f),{data:c}=i(h),{data:l}=i(m),{data:u}=i(p),g;t[0]===s?.Subnets?g=t[1]:(g=s?.Subnets??[],t[0]=s?.Subnets,t[1]=g);let _=g,v;t[2]===c?.SecurityGroups?v=t[3]:(v=c?.SecurityGroups??[],t[2]=c?.SecurityGroups,t[3]=v);let y=v,b;t[4]===l?.KeyPairs?b=t[5]:(b=l?.KeyPairs??[],t[4]=l?.KeyPairs,t[5]=b);let x=b,C;t[6]===u?.InstanceTypes?C=t[7]:(C=u?.InstanceTypes??[],t[6]=u?.InstanceTypes,t[7]=C);let w=C,[T,E]=(0,V.useState)(`t3.small`),[P,ie]=(0,V.useState)(1),[F,I]=(0,V.useState)(``),[R,ae]=(0,V.useState)(``),[z,oe]=(0,V.useState)(``),W;t[8]!==a||t[9]!==o?(W=function(e){e||(E(`t3.small`),ie(1),I(``),ae(``),oe(``),o.reset()),a(e)},t[8]=a,t[9]=o,t[10]=W):W=t[10];let J=W,Y;t[11]!==n||t[12]!==P||t[13]!==J||t[14]!==T||t[15]!==z||t[16]!==o||t[17]!==R||t[18]!==F?(Y=async function(){try{await o.mutateAsync({Cluster:n,InstanceType:T||void 0,Count:P,SubnetID:F,SecurityGroupID:R,KeyName:z||void 0}),J(!1)}catch{}},t[11]=n,t[12]=P,t[13]=J,t[14]=T,t[15]=z,t[16]=o,t[17]=R,t[18]=F,t[19]=Y):Y=t[19];let se=Y,X=o.isPending||F===``||R===``,ce;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,H.jsx)(j,{children:`Provision EC2 capacity`}),t[20]=ce):ce=t[20];let Z;t[21]===n?Z=t[22]:(Z=(0,H.jsxs)(N,{children:[ce,(0,H.jsxs)(k,{children:[`Launch container instances into cluster “`,n,`”. They register automatically once booted.`]})]}),t[21]=n,t[22]=Z);let le;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,H.jsx)(D,{children:(0,H.jsx)(`label`,{htmlFor:`provision-instance-type`,children:`Instance type`})}),t[23]=le):le=t[23];let Q;t[24]!==T||t[25]!==w?(Q=(0,H.jsxs)(O,{children:[le,(0,H.jsx)(L,{id:`provision-instance-type`,instanceTypes:w,onValueChange:E,value:T})]}),t[24]=T,t[25]=w,t[26]=Q):Q=t[26];let ue;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,H.jsx)(D,{children:(0,H.jsx)(`label`,{htmlFor:`provision-count`,children:`Count`})}),t[27]=ue):ue=t[27];let de;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>ie(Number(e.target.value)),t[28]=de):de=t[28];let fe;t[29]===P?fe=t[30]:(fe=(0,H.jsxs)(O,{children:[ue,(0,H.jsx)(d,{id:`provision-count`,max:10,min:1,onChange:de,type:`number`,value:P})]}),t[29]=P,t[30]=fe);let pe;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,H.jsx)(D,{children:(0,H.jsx)(`label`,{htmlFor:`provision-subnet`,children:`Subnet`})}),t[31]=pe):pe=t[31];let me;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>I(e.target.value),t[32]=me):me=t[32];let he;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,H.jsx)(`option`,{value:``,children:`Select a subnet`}),t[33]=he):he=t[33];let ge;t[34]===_?ge=t[35]:(ge=_.map(q),t[34]=_,t[35]=ge);let _e;t[36]!==F||t[37]!==ge?(_e=(0,H.jsxs)(O,{children:[pe,(0,H.jsxs)(`select`,{className:U,id:`provision-subnet`,onChange:me,value:F,children:[he,ge]})]}),t[36]=F,t[37]=ge,t[38]=_e):_e=t[38];let ve;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,H.jsx)(D,{children:(0,H.jsx)(`label`,{htmlFor:`provision-sg`,children:`Security group`})}),t[39]=ve):ve=t[39];let ye;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ye=e=>ae(e.target.value),t[40]=ye):ye=t[40];let be;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,H.jsx)(`option`,{value:``,children:`Select a security group`}),t[41]=be):be=t[41];let xe;t[42]===y?xe=t[43]:(xe=y.map(K),t[42]=y,t[43]=xe);let Se;t[44]!==R||t[45]!==xe?(Se=(0,H.jsxs)(O,{children:[ve,(0,H.jsxs)(`select`,{className:U,id:`provision-sg`,onChange:ye,value:R,children:[be,xe]})]}),t[44]=R,t[45]=xe,t[46]=Se):Se=t[46];let Ce;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,H.jsx)(D,{children:(0,H.jsx)(`label`,{htmlFor:`provision-key`,children:`Key pair`})}),t[47]=Ce):Ce=t[47];let we;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>oe(e.target.value),t[48]=we):we=t[48];let Te;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,H.jsx)(`option`,{value:``,children:`None`}),t[49]=Te):Te=t[49];let Ee;t[50]===x?Ee=t[51]:(Ee=x.map(G),t[50]=x,t[51]=Ee);let $;t[52]!==z||t[53]!==Ee?($=(0,H.jsxs)(O,{children:[Ce,(0,H.jsxs)(`select`,{className:U,id:`provision-key`,onChange:we,value:z,children:[Te,Ee]})]}),t[52]=z,t[53]=Ee,t[54]=$):$=t[54];let De;t[55]!==Q||t[56]!==fe||t[57]!==_e||t[58]!==Se||t[59]!==$?(De=(0,H.jsxs)(`div`,{className:`space-y-4`,children:[Q,fe,_e,Se,$]}),t[55]=Q,t[56]=fe,t[57]=_e,t[58]=Se,t[59]=$,t[60]=De):De=t[60];let Oe;t[61]===o.error?Oe=t[62]:(Oe=o.error&&(0,H.jsx)(ee,{error:o.error instanceof Error?o.error:void 0,msg:`Failed to provision capacity.`}),t[61]=o.error,t[62]=Oe);let ke;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,H.jsx)(ne,{children:`Cancel`}),t[63]=ke):ke=t[63];let Ae;t[64]===se?Ae=t[65]:(Ae=e=>{e.preventDefault(),se()},t[64]=se,t[65]=Ae);let je=o.isPending?`Provisioning…`:`Provision`,Me;t[66]!==X||t[67]!==Ae||t[68]!==je?(Me=(0,H.jsxs)(M,{children:[ke,(0,H.jsx)(te,{disabled:X,onClick:Ae,children:je})]}),t[66]=X,t[67]=Ae,t[68]=je,t[69]=Me):Me=t[69];let Ne;t[70]!==De||t[71]!==Oe||t[72]!==Me||t[73]!==Z?(Ne=(0,H.jsxs)(A,{className:`max-h-[85vh] overflow-y-auto`,children:[Z,De,Oe,Me]}),t[70]=De,t[71]=Oe,t[72]=Me,t[73]=Z,t[74]=Ne):Ne=t[74];let Pe;return t[75]!==J||t[76]!==r||t[77]!==Ne?(Pe=(0,H.jsx)(re,{onOpenChange:J,open:r,children:Ne}),t[75]=J,t[76]=r,t[77]=Ne,t[78]=Pe):Pe=t[78],Pe}function G(e){return(0,H.jsx)(`option`,{value:e.KeyName??``,children:e.KeyName},e.KeyPairId)}function K(e){return(0,H.jsxs)(`option`,{value:e.GroupId??``,children:[e.GroupId,` (`,e.GroupName,`)`]},e.GroupId)}function q(e){return(0,H.jsxs)(`option`,{value:e.SubnetId??``,children:[e.SubnetId,` (`,e.CidrBlock,e.AvailabilityZone?`, ${e.AvailabilityZone}`:``,`)`]},e.SubnetId)}var J={drain:`Drain`,activate:`Activate`,deregister:`Deregister`},Y={drain:`Draining force-stops the service-owned tasks on this instance so it can be retired.`,activate:`This returns the instance to ACTIVE so the scheduler can place tasks on it again.`,deregister:`This force-removes the container instance record. Any tasks it still holds are stopped.`};function se(e){let t=(0,B.c)(28),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=_(n),t[0]=n,t[1]=r);let{data:i}=a(r),o=w(),s=b(),[c,l]=(0,V.useState)(null),[d,f]=(0,V.useState)(!1),p;t[2]!==n||t[3]!==s||t[4]!==c||t[5]!==o?(p=function(){if(!c)return;let e=()=>l(null);if(c.action===`deregister`){s.mutate({cluster:n,containerInstance:c.arn},{onSuccess:e});return}o.mutate({cluster:n,containerInstance:c.arn,status:c.action===`drain`?`DRAINING`:`ACTIVE`},{onSuccess:e})},t[2]=n,t[3]=s,t[4]=c,t[5]=o,t[6]=p):p=t[6];let m=p,h=o.isError||s.isError,g=o.error??s.error,v=o.isPending||s.isPending,y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,H.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,H.jsx)(u,{onClick:()=>f(!0),size:`sm`,children:`Provision EC2 capacity`})}),t[7]=y):y=t[7];let x;t[8]!==g||t[9]!==h?(x=h&&(0,H.jsx)(ee,{error:g instanceof Error?g:void 0,msg:`Container instance action failed.`}),t[8]=g,t[9]=h,t[10]=x):x=t[10];let S;t[11]===i?S=t[12]:(S=i.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No container instances found.`}):(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`EC2 Instance`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pending`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,H.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,H.jsx)(`tbody`,{children:i.map(e=>{let t=e.containerInstanceArn??``,n=e.status===`DRAINING`;return(0,H.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,H.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.ec2InstanceId}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:(0,H.jsx)(I,{state:e.status})}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.runningTasksCount??0}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.pendingTasksCount??0}),(0,H.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,H.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,H.jsx)(u,{"aria-label":n?`Activate container instance`:`Drain container instance`,onClick:()=>l({arn:t,action:n?`activate`:`drain`}),size:`sm`,variant:`outline`,children:n?`Activate`:`Drain`}),(0,H.jsx)(u,{onClick:()=>l({arn:t,action:`deregister`}),size:`sm`,variant:`destructive`,children:`Deregister`})]})})]},t)})})]})}),t[11]=i,t[12]=S);let C;t[13]!==n||t[14]!==d?(C=(0,H.jsx)(W,{clusterName:n,onOpenChange:f,open:d}),t[13]=n,t[14]=d,t[15]=C):C=t[15];let T=c?J[c.action]:`Confirm`,E=c?Y[c.action]:``,D;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>!e&&l(null),t[16]=D):D=t[16];let O=c!==null,k;t[17]!==m||t[18]!==v||t[19]!==O||t[20]!==T||t[21]!==E?(k=(0,H.jsx)(P,{confirmLabel:T,description:E,isPending:v,onConfirm:m,onOpenChange:D,open:O,title:`Container instance`}),t[17]=m,t[18]=v,t[19]=O,t[20]=T,t[21]=E,t[22]=k):k=t[22];let A;return t[23]!==k||t[24]!==x||t[25]!==S||t[26]!==C?(A=(0,H.jsxs)(H.Fragment,{children:[y,x,S,C,k]}),t[23]=k,t[24]=x,t[25]=S,t[26]=C,t[27]=A):A=t[27],A}function X(e){return e?.split(`/`).at(-1)??``}function ce(e){let t=(0,B.c)(13),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=g(n),t[0]=n,t[1]=r);let{data:i}=a(r),s;t[2]===n?s=t[3]:(s={cluster:n},t[2]=n,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,H.jsx)(u,{size:`sm`,children:`Create service`}),t[4]=c):c=t[4];let l;t[5]===s?l=t[6]:(l=(0,H.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,H.jsx)(o,{search:s,to:`/ecs/create-service`,children:c})}),t[5]=s,t[6]=l);let d;t[7]!==n||t[8]!==i?(d=i.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No services found.`}):(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Desired`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pending`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task Definition`})]})}),(0,H.jsx)(`tbody`,{children:i.map(e=>(0,H.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,H.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,H.jsx)(o,{className:`underline`,params:{clusterName:n,serviceName:e.serviceName??``},to:`/ecs/list-clusters/$clusterName/services/$serviceName`,children:e.serviceName})}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:(0,H.jsx)(I,{state:e.status})}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.desiredCount??0}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.runningCount??0}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.pendingCount??0}),(0,H.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:X(e.taskDefinition)})]},e.serviceArn??e.serviceName))})]})}),t[7]=n,t[8]=i,t[9]=d):d=t[9];let f;return t[10]!==l||t[11]!==d?(f=(0,H.jsxs)(H.Fragment,{children:[l,d]}),t[10]=l,t[11]=d,t[12]=f):f=t[12],f}function Z(e){return e?.split(`/`).at(-1)??``}function le(e){let t=(0,B.c)(27),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=v(n),t[0]=n,t[1]=r);let{data:i}=a(r),s=x(),[c,l]=(0,V.useState)(null),d;t[2]!==n||t[3]!==c||t[4]!==s?(d=function(){c&&s.mutate({cluster:n,task:c},{onSuccess:()=>l(null)})},t[2]=n,t[3]=c,t[4]=s,t[5]=d):d=t[5];let f=d,p;t[6]===n?p=t[7]:(p={cluster:n},t[6]=n,t[7]=p);let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,H.jsx)(u,{size:`sm`,children:`Run task`}),t[8]=m):m=t[8];let h;t[9]===p?h=t[10]:(h=(0,H.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,H.jsx)(o,{search:p,to:`/ecs/run-task`,children:m})}),t[9]=p,t[10]=h);let g;t[11]!==s.error||t[12]!==s.isError?(g=s.isError&&(0,H.jsx)(ee,{error:s.error instanceof Error?s.error:void 0,msg:`Failed to stop task.`}),t[11]=s.error,t[12]=s.isError,t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==i?(_=i.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No tasks found.`}):(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Last Status`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Desired Status`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Group`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,H.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,H.jsx)(`tbody`,{children:i.map(e=>{let t=Z(e.taskArn),r=e.lastStatus!==`STOPPED`;return(0,H.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,H.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:(0,H.jsx)(o,{className:`underline`,params:{clusterName:n,taskId:t},to:`/ecs/list-clusters/$clusterName/tasks/$taskId`,children:t})}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:(0,H.jsx)(I,{state:e.lastStatus})}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.desiredStatus}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.group}),(0,H.jsx)(`td`,{className:`px-4 py-2 text-right`,children:r&&(0,H.jsx)(u,{onClick:()=>l(e.taskArn??t),size:`sm`,variant:`destructive`,children:`Stop`})})]},t)})})]})}),t[14]=n,t[15]=i,t[16]=_):_=t[16];let y;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>!e&&l(null),t[17]=y):y=t[17];let b=c!==null,S;t[18]!==f||t[19]!==s.isPending||t[20]!==b?(S=(0,H.jsx)(P,{confirmLabel:`Stop task`,description:`This stops the task and releases its ENI and reserved capacity.`,isPending:s.isPending,onConfirm:f,onOpenChange:y,open:b,pendingLabel:`Stopping…`,title:`Stop task`}),t[18]=f,t[19]=s.isPending,t[20]=b,t[21]=S):S=t[21];let C;return t[22]!==S||t[23]!==h||t[24]!==g||t[25]!==_?(C=(0,H.jsxs)(H.Fragment,{children:[h,g,_,S]}),t[22]=S,t[23]=h,t[24]=g,t[25]=_,t[26]=C):C=t[26],C}function Q(e){let t=(0,B.c)(70),{clusterName:n}=e,r=s(),[i,o]=(0,V.useState)(!1),d;t[0]===n?d=t[1]:(d=y(n),t[0]=n,t[1]=d);let{data:f}=a(d),p=C(),m;t[2]!==n||t[3]!==p||t[4]!==r?(m=function(){p.mutate(n,{onSuccess:()=>{r({to:`/ecs/list-clusters`})}})},t[2]=n,t[3]=p,t[4]=r,t[5]=m):m=t[5];let h=m;if(!f){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(c,{to:`/ecs/list-clusters`,children:`Clusters`}),t[6]=e):e=t[6];let r;t[7]===n?r=t[8]:(r=(0,H.jsx)(E,{subtitle:`Cluster Details`,title:n}),t[7]=n,t[8]=r);let i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Cluster not found.`}),t[9]=i):i=t[9];let a;return t[10]===r?a=t[11]:(a=(0,H.jsxs)(H.Fragment,{children:[e,r,i]}),t[10]=r,t[11]=a),a}let g;t[12]===f.tags?g=t[13]:(g=f.tags??[],t[12]=f.tags,t[13]=g);let _=g,v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,H.jsx)(c,{to:`/ecs/list-clusters`,children:`Clusters`}),t[14]=v):v=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>o(!0),t[15]=b):b=t[15];let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,H.jsxs)(u,{onClick:b,size:`sm`,variant:`destructive`,children:[(0,H.jsx)(l,{className:`size-4`}),`Delete`]}),t[16]=x):x=t[16];let S;t[17]===f.status?S=t[18]:(S=(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x,(0,H.jsx)(I,{state:f.status})]}),t[17]=f.status,t[18]=S);let w;t[19]!==n||t[20]!==S?(w=(0,H.jsx)(E,{actions:S,subtitle:`Cluster Details`,title:n}),t[19]=n,t[20]=S,t[21]=w):w=t[21];let T;t[22]!==p.error||t[23]!==p.isError?(T=p.isError&&(0,H.jsx)(ee,{error:p.error instanceof Error?p.error:void 0,msg:`Failed to delete cluster.`}),t[22]=p.error,t[23]=p.isError,t[24]=T):T=t[24];let D;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,H.jsx)(ie.Header,{children:`Overview`}),t[25]=D):D=t[25];let O;t[26]===f.clusterArn?O=t[27]:(O=(0,H.jsx)(F,{label:`ARN`,value:f.clusterArn}),t[26]=f.clusterArn,t[27]=O);let k;t[28]===f.status?k=t[29]:(k=(0,H.jsx)(F,{label:`Status`,value:f.status}),t[28]=f.status,t[29]=k);let A=String(f.activeServicesCount??0),j;t[30]===A?j=t[31]:(j=(0,H.jsx)(F,{label:`Active services`,value:A}),t[30]=A,t[31]=j);let te=String(f.runningTasksCount??0),M;t[32]===te?M=t[33]:(M=(0,H.jsx)(F,{label:`Running tasks`,value:te}),t[32]=te,t[33]=M);let ne=String(f.pendingTasksCount??0),N;t[34]===ne?N=t[35]:(N=(0,H.jsx)(F,{label:`Pending tasks`,value:ne}),t[34]=ne,t[35]=N);let re=String(f.registeredContainerInstancesCount??0),L;t[36]===re?L=t[37]:(L=(0,H.jsx)(F,{label:`Registered instances`,value:re}),t[36]=re,t[37]=L);let U;t[38]!==O||t[39]!==k||t[40]!==j||t[41]!==M||t[42]!==N||t[43]!==L?(U=(0,H.jsxs)(ie,{children:[D,(0,H.jsxs)(ie.Content,{children:[O,k,j,M,N,L]})]}),t[38]=O,t[39]=k,t[40]=j,t[41]=M,t[42]=N,t[43]=L,t[44]=U):U=t[44];let W;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,H.jsxs)(ae,{children:[(0,H.jsx)(R,{value:`services`,children:`Services`}),(0,H.jsx)(R,{value:`tasks`,children:`Tasks`}),(0,H.jsx)(R,{value:`infrastructure`,children:`Infrastructure`}),(0,H.jsx)(R,{value:`tags`,children:`Tags`})]}),t[45]=W):W=t[45];let G;t[46]===n?G=t[47]:(G=(0,H.jsx)(z,{value:`services`,children:(0,H.jsx)(ce,{clusterName:n})}),t[46]=n,t[47]=G);let K;t[48]===n?K=t[49]:(K=(0,H.jsx)(z,{value:`tasks`,children:(0,H.jsx)(le,{clusterName:n})}),t[48]=n,t[49]=K);let q;t[50]===n?q=t[51]:(q=(0,H.jsx)(z,{value:`infrastructure`,children:(0,H.jsx)(se,{clusterName:n})}),t[50]=n,t[51]=q);let J;t[52]===_?J=t[53]:(J=(0,H.jsx)(z,{value:`tags`,children:_.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No tags.`}):(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Key`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Value`})]})}),(0,H.jsx)(`tbody`,{children:_.map(ue)})]})})}),t[52]=_,t[53]=J);let Y;t[54]!==G||t[55]!==K||t[56]!==q||t[57]!==J?(Y=(0,H.jsxs)(oe,{className:`mt-6`,defaultValue:`services`,children:[W,G,K,q,J]}),t[54]=G,t[55]=K,t[56]=q,t[57]=J,t[58]=Y):Y=t[58];let X=`This permanently deletes cluster "${n}" and force-stops every task it holds. This cannot be undone.`,Z;t[59]!==p.isPending||t[60]!==h||t[61]!==i||t[62]!==X?(Z=(0,H.jsx)(P,{description:X,isPending:p.isPending,onConfirm:h,onOpenChange:o,open:i,title:`Delete cluster`}),t[59]=p.isPending,t[60]=h,t[61]=i,t[62]=X,t[63]=Z):Z=t[63];let Q;return t[64]!==U||t[65]!==Y||t[66]!==Z||t[67]!==w||t[68]!==T?(Q=(0,H.jsxs)(H.Fragment,{children:[v,w,T,U,Y,Z]}),t[64]=U,t[65]=Y,t[66]=Z,t[67]=w,t[68]=T,t[69]=Q):Q=t[69],Q}function ue(e){return(0,H.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,H.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.key}),(0,H.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.value})]},e.key)}function de(){let e=(0,B.c)(2),{clusterName:t}=T.useParams(),n;return e[0]===t?n=e[1]:(n=(0,H.jsx)(Q,{clusterName:t}),e[0]=t,e[1]=n),n}export{de as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{t as s}from"./useNavigate.js";import{t as c}from"./back-link.js";import{t as l}from"./trash-2.js";import{t as u}from"./button.js";import{t as d}from"./input.js";import{O as f,c as p,p as m,w as h}from"./ec2.js";import{i as g,r as _,s as v,t as y}from"./ecs.js";import{i as b,l as x,o as S,r as C,u as w}from"./ecs2.js";import{t as T}from"./_clusterName2.js";import{t as ee}from"./error-banner.js";import{t as E}from"./page-heading.js";import{a as D,t as O}from"./field.js";import{a as k,i as A,l as j,n as te,o as M,r as ne,s as N,t as re}from"./alert-dialog.js";import{t as P}from"./delete-confirmation-dialog.js";import{n as ie,t as F}from"./detail-row.js";import{t as I}from"./state-badge.js";import{t as L}from"./gpu-instance-type-select.js";import{i as R,n as ae,r as z,t as oe}from"./tabs.js";var B=r(),V=e(n(),1),H=t(),U=`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`;function W(e){let t=(0,B.c)(79),{clusterName:n,open:r,onOpenChange:a}=e,o=S(),{data:s}=i(f),{data:c}=i(h),{data:l}=i(m),{data:u}=i(p),g;t[0]===s?.Subnets?g=t[1]:(g=s?.Subnets??[],t[0]=s?.Subnets,t[1]=g);let _=g,v;t[2]===c?.SecurityGroups?v=t[3]:(v=c?.SecurityGroups??[],t[2]=c?.SecurityGroups,t[3]=v);let y=v,b;t[4]===l?.KeyPairs?b=t[5]:(b=l?.KeyPairs??[],t[4]=l?.KeyPairs,t[5]=b);let x=b,C;t[6]===u?.InstanceTypes?C=t[7]:(C=u?.InstanceTypes??[],t[6]=u?.InstanceTypes,t[7]=C);let w=C,[T,E]=(0,V.useState)(`t3.small`),[P,ie]=(0,V.useState)(1),[F,I]=(0,V.useState)(``),[R,ae]=(0,V.useState)(``),[z,oe]=(0,V.useState)(``),W;t[8]!==a||t[9]!==o?(W=function(e){e||(E(`t3.small`),ie(1),I(``),ae(``),oe(``),o.reset()),a(e)},t[8]=a,t[9]=o,t[10]=W):W=t[10];let J=W,Y;t[11]!==n||t[12]!==P||t[13]!==J||t[14]!==T||t[15]!==z||t[16]!==o||t[17]!==R||t[18]!==F?(Y=async function(){try{await o.mutateAsync({Cluster:n,InstanceType:T||void 0,Count:P,SubnetID:F,SecurityGroupID:R,KeyName:z||void 0}),J(!1)}catch{}},t[11]=n,t[12]=P,t[13]=J,t[14]=T,t[15]=z,t[16]=o,t[17]=R,t[18]=F,t[19]=Y):Y=t[19];let se=Y,X=o.isPending||F===``||R===``,ce;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,H.jsx)(j,{children:`Provision EC2 capacity`}),t[20]=ce):ce=t[20];let Z;t[21]===n?Z=t[22]:(Z=(0,H.jsxs)(N,{children:[ce,(0,H.jsxs)(k,{children:[`Launch container instances into cluster “`,n,`”. They register automatically once booted.`]})]}),t[21]=n,t[22]=Z);let le;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,H.jsx)(D,{children:(0,H.jsx)(`label`,{htmlFor:`provision-instance-type`,children:`Instance type`})}),t[23]=le):le=t[23];let Q;t[24]!==T||t[25]!==w?(Q=(0,H.jsxs)(O,{children:[le,(0,H.jsx)(L,{id:`provision-instance-type`,instanceTypes:w,onValueChange:E,value:T})]}),t[24]=T,t[25]=w,t[26]=Q):Q=t[26];let ue;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,H.jsx)(D,{children:(0,H.jsx)(`label`,{htmlFor:`provision-count`,children:`Count`})}),t[27]=ue):ue=t[27];let de;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>{ie(Number(e.target.value))},t[28]=de):de=t[28];let fe;t[29]===P?fe=t[30]:(fe=(0,H.jsxs)(O,{children:[ue,(0,H.jsx)(d,{id:`provision-count`,max:10,min:1,onChange:de,type:`number`,value:P})]}),t[29]=P,t[30]=fe);let pe;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,H.jsx)(D,{children:(0,H.jsx)(`label`,{htmlFor:`provision-subnet`,children:`Subnet`})}),t[31]=pe):pe=t[31];let me;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>{I(e.target.value)},t[32]=me):me=t[32];let he;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,H.jsx)(`option`,{value:``,children:`Select a subnet`}),t[33]=he):he=t[33];let ge;t[34]===_?ge=t[35]:(ge=_.map(q),t[34]=_,t[35]=ge);let _e;t[36]!==F||t[37]!==ge?(_e=(0,H.jsxs)(O,{children:[pe,(0,H.jsxs)(`select`,{className:U,id:`provision-subnet`,onChange:me,value:F,children:[he,ge]})]}),t[36]=F,t[37]=ge,t[38]=_e):_e=t[38];let ve;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,H.jsx)(D,{children:(0,H.jsx)(`label`,{htmlFor:`provision-sg`,children:`Security group`})}),t[39]=ve):ve=t[39];let ye;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ye=e=>{ae(e.target.value)},t[40]=ye):ye=t[40];let be;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,H.jsx)(`option`,{value:``,children:`Select a security group`}),t[41]=be):be=t[41];let xe;t[42]===y?xe=t[43]:(xe=y.map(K),t[42]=y,t[43]=xe);let Se;t[44]!==R||t[45]!==xe?(Se=(0,H.jsxs)(O,{children:[ve,(0,H.jsxs)(`select`,{className:U,id:`provision-sg`,onChange:ye,value:R,children:[be,xe]})]}),t[44]=R,t[45]=xe,t[46]=Se):Se=t[46];let Ce;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,H.jsx)(D,{children:(0,H.jsx)(`label`,{htmlFor:`provision-key`,children:`Key pair`})}),t[47]=Ce):Ce=t[47];let we;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>{oe(e.target.value)},t[48]=we):we=t[48];let Te;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,H.jsx)(`option`,{value:``,children:`None`}),t[49]=Te):Te=t[49];let Ee;t[50]===x?Ee=t[51]:(Ee=x.map(G),t[50]=x,t[51]=Ee);let $;t[52]!==z||t[53]!==Ee?($=(0,H.jsxs)(O,{children:[Ce,(0,H.jsxs)(`select`,{className:U,id:`provision-key`,onChange:we,value:z,children:[Te,Ee]})]}),t[52]=z,t[53]=Ee,t[54]=$):$=t[54];let De;t[55]!==Q||t[56]!==fe||t[57]!==_e||t[58]!==Se||t[59]!==$?(De=(0,H.jsxs)(`div`,{className:`space-y-4`,children:[Q,fe,_e,Se,$]}),t[55]=Q,t[56]=fe,t[57]=_e,t[58]=Se,t[59]=$,t[60]=De):De=t[60];let Oe;t[61]===o.error?Oe=t[62]:(Oe=o.error&&(0,H.jsx)(ee,{error:o.error instanceof Error?o.error:void 0,msg:`Failed to provision capacity.`}),t[61]=o.error,t[62]=Oe);let ke;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,H.jsx)(ne,{children:`Cancel`}),t[63]=ke):ke=t[63];let Ae;t[64]===se?Ae=t[65]:(Ae=e=>{e.preventDefault(),se()},t[64]=se,t[65]=Ae);let je=o.isPending?`Provisioning…`:`Provision`,Me;t[66]!==X||t[67]!==Ae||t[68]!==je?(Me=(0,H.jsxs)(M,{children:[ke,(0,H.jsx)(te,{disabled:X,onClick:Ae,children:je})]}),t[66]=X,t[67]=Ae,t[68]=je,t[69]=Me):Me=t[69];let Ne;t[70]!==De||t[71]!==Oe||t[72]!==Me||t[73]!==Z?(Ne=(0,H.jsxs)(A,{className:`max-h-[85vh] overflow-y-auto`,children:[Z,De,Oe,Me]}),t[70]=De,t[71]=Oe,t[72]=Me,t[73]=Z,t[74]=Ne):Ne=t[74];let Pe;return t[75]!==J||t[76]!==r||t[77]!==Ne?(Pe=(0,H.jsx)(re,{onOpenChange:J,open:r,children:Ne}),t[75]=J,t[76]=r,t[77]=Ne,t[78]=Pe):Pe=t[78],Pe}function G(e){return(0,H.jsx)(`option`,{value:e.KeyName??``,children:e.KeyName},e.KeyPairId)}function K(e){return(0,H.jsxs)(`option`,{value:e.GroupId??``,children:[e.GroupId,` (`,e.GroupName,`)`]},e.GroupId)}function q(e){return(0,H.jsxs)(`option`,{value:e.SubnetId??``,children:[e.SubnetId,` (`,e.CidrBlock,e.AvailabilityZone?`, ${e.AvailabilityZone}`:``,`)`]},e.SubnetId)}var J={drain:`Drain`,activate:`Activate`,deregister:`Deregister`},Y={drain:`Draining force-stops the service-owned tasks on this instance so it can be retired.`,activate:`This returns the instance to ACTIVE so the scheduler can place tasks on it again.`,deregister:`This force-removes the container instance record. Any tasks it still holds are stopped.`};function se(e){let t=(0,B.c)(28),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=_(n),t[0]=n,t[1]=r);let{data:i}=a(r),o=w(),s=b(),[c,l]=(0,V.useState)(null),[d,f]=(0,V.useState)(!1),p;t[2]!==n||t[3]!==s||t[4]!==c||t[5]!==o?(p=function(){if(!c)return;let e=()=>{l(null)};if(c.action===`deregister`){s.mutate({cluster:n,containerInstance:c.arn},{onSuccess:e});return}o.mutate({cluster:n,containerInstance:c.arn,status:c.action===`drain`?`DRAINING`:`ACTIVE`},{onSuccess:e})},t[2]=n,t[3]=s,t[4]=c,t[5]=o,t[6]=p):p=t[6];let m=p,h=o.isError||s.isError,g=o.error??s.error,v=o.isPending||s.isPending,y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,H.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,H.jsx)(u,{onClick:()=>{f(!0)},size:`sm`,children:`Provision EC2 capacity`})}),t[7]=y):y=t[7];let x;t[8]!==g||t[9]!==h?(x=h&&(0,H.jsx)(ee,{error:g instanceof Error?g:void 0,msg:`Container instance action failed.`}),t[8]=g,t[9]=h,t[10]=x):x=t[10];let S;t[11]===i?S=t[12]:(S=i.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No container instances found.`}):(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`EC2 Instance`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pending`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,H.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,H.jsx)(`tbody`,{children:i.map(e=>{let t=e.containerInstanceArn??``,n=e.status===`DRAINING`;return(0,H.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,H.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.ec2InstanceId}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:(0,H.jsx)(I,{state:e.status})}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.runningTasksCount??0}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.pendingTasksCount??0}),(0,H.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,H.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,H.jsx)(u,{"aria-label":n?`Activate container instance`:`Drain container instance`,onClick:()=>{l({arn:t,action:n?`activate`:`drain`})},size:`sm`,variant:`outline`,children:n?`Activate`:`Drain`}),(0,H.jsx)(u,{onClick:()=>{l({arn:t,action:`deregister`})},size:`sm`,variant:`destructive`,children:`Deregister`})]})})]},t)})})]})}),t[11]=i,t[12]=S);let C;t[13]!==n||t[14]!==d?(C=(0,H.jsx)(W,{clusterName:n,onOpenChange:f,open:d}),t[13]=n,t[14]=d,t[15]=C):C=t[15];let T=c?J[c.action]:`Confirm`,E=c?Y[c.action]:``,D;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||l(null)},t[16]=D):D=t[16];let O=c!==null,k;t[17]!==m||t[18]!==v||t[19]!==O||t[20]!==T||t[21]!==E?(k=(0,H.jsx)(P,{confirmLabel:T,description:E,isPending:v,onConfirm:m,onOpenChange:D,open:O,title:`Container instance`}),t[17]=m,t[18]=v,t[19]=O,t[20]=T,t[21]=E,t[22]=k):k=t[22];let A;return t[23]!==k||t[24]!==x||t[25]!==S||t[26]!==C?(A=(0,H.jsxs)(H.Fragment,{children:[y,x,S,C,k]}),t[23]=k,t[24]=x,t[25]=S,t[26]=C,t[27]=A):A=t[27],A}function X(e){return e?.split(`/`).at(-1)??``}function ce(e){let t=(0,B.c)(13),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=g(n),t[0]=n,t[1]=r);let{data:i}=a(r),s;t[2]===n?s=t[3]:(s={cluster:n},t[2]=n,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,H.jsx)(u,{size:`sm`,children:`Create service`}),t[4]=c):c=t[4];let l;t[5]===s?l=t[6]:(l=(0,H.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,H.jsx)(o,{search:s,to:`/ecs/create-service`,children:c})}),t[5]=s,t[6]=l);let d;t[7]!==n||t[8]!==i?(d=i.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No services found.`}):(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Desired`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pending`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task Definition`})]})}),(0,H.jsx)(`tbody`,{children:i.map(e=>(0,H.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,H.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,H.jsx)(o,{className:`underline`,params:{clusterName:n,serviceName:e.serviceName??``},to:`/ecs/list-clusters/$clusterName/services/$serviceName`,children:e.serviceName})}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:(0,H.jsx)(I,{state:e.status})}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.desiredCount??0}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.runningCount??0}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.pendingCount??0}),(0,H.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:X(e.taskDefinition)})]},e.serviceArn??e.serviceName))})]})}),t[7]=n,t[8]=i,t[9]=d):d=t[9];let f;return t[10]!==l||t[11]!==d?(f=(0,H.jsxs)(H.Fragment,{children:[l,d]}),t[10]=l,t[11]=d,t[12]=f):f=t[12],f}function Z(e){return e?.split(`/`).at(-1)??``}function le(e){let t=(0,B.c)(27),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=v(n),t[0]=n,t[1]=r);let{data:i}=a(r),s=x(),[c,l]=(0,V.useState)(null),d;t[2]!==n||t[3]!==c||t[4]!==s?(d=function(){c&&s.mutate({cluster:n,task:c},{onSuccess:()=>{l(null)}})},t[2]=n,t[3]=c,t[4]=s,t[5]=d):d=t[5];let f=d,p;t[6]===n?p=t[7]:(p={cluster:n},t[6]=n,t[7]=p);let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,H.jsx)(u,{size:`sm`,children:`Run task`}),t[8]=m):m=t[8];let h;t[9]===p?h=t[10]:(h=(0,H.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,H.jsx)(o,{search:p,to:`/ecs/run-task`,children:m})}),t[9]=p,t[10]=h);let g;t[11]!==s.error||t[12]!==s.isError?(g=s.isError&&(0,H.jsx)(ee,{error:s.error instanceof Error?s.error:void 0,msg:`Failed to stop task.`}),t[11]=s.error,t[12]=s.isError,t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==i?(_=i.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No tasks found.`}):(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Last Status`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Desired Status`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Group`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,H.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,H.jsx)(`tbody`,{children:i.map(e=>{let t=Z(e.taskArn),r=e.lastStatus!==`STOPPED`;return(0,H.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,H.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:(0,H.jsx)(o,{className:`underline`,params:{clusterName:n,taskId:t},to:`/ecs/list-clusters/$clusterName/tasks/$taskId`,children:t})}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:(0,H.jsx)(I,{state:e.lastStatus})}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.desiredStatus}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.group}),(0,H.jsx)(`td`,{className:`px-4 py-2 text-right`,children:r&&(0,H.jsx)(u,{onClick:()=>{l(e.taskArn??t)},size:`sm`,variant:`destructive`,children:`Stop`})})]},t)})})]})}),t[14]=n,t[15]=i,t[16]=_):_=t[16];let y;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{e||l(null)},t[17]=y):y=t[17];let b=c!==null,S;t[18]!==f||t[19]!==s.isPending||t[20]!==b?(S=(0,H.jsx)(P,{confirmLabel:`Stop task`,description:`This stops the task and releases its ENI and reserved capacity.`,isPending:s.isPending,onConfirm:f,onOpenChange:y,open:b,pendingLabel:`Stopping…`,title:`Stop task`}),t[18]=f,t[19]=s.isPending,t[20]=b,t[21]=S):S=t[21];let C;return t[22]!==S||t[23]!==h||t[24]!==g||t[25]!==_?(C=(0,H.jsxs)(H.Fragment,{children:[h,g,_,S]}),t[22]=S,t[23]=h,t[24]=g,t[25]=_,t[26]=C):C=t[26],C}function Q(e){let t=(0,B.c)(70),{clusterName:n}=e,r=s(),[i,o]=(0,V.useState)(!1),d;t[0]===n?d=t[1]:(d=y(n),t[0]=n,t[1]=d);let{data:f}=a(d),p=C(),m;t[2]!==n||t[3]!==p||t[4]!==r?(m=function(){p.mutate(n,{onSuccess:()=>{r({to:`/ecs/list-clusters`})}})},t[2]=n,t[3]=p,t[4]=r,t[5]=m):m=t[5];let h=m;if(!f){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(c,{to:`/ecs/list-clusters`,children:`Clusters`}),t[6]=e):e=t[6];let r;t[7]===n?r=t[8]:(r=(0,H.jsx)(E,{subtitle:`Cluster Details`,title:n}),t[7]=n,t[8]=r);let i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Cluster not found.`}),t[9]=i):i=t[9];let a;return t[10]===r?a=t[11]:(a=(0,H.jsxs)(H.Fragment,{children:[e,r,i]}),t[10]=r,t[11]=a),a}let g;t[12]===f.tags?g=t[13]:(g=f.tags??[],t[12]=f.tags,t[13]=g);let _=g,v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,H.jsx)(c,{to:`/ecs/list-clusters`,children:`Clusters`}),t[14]=v):v=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>{o(!0)},t[15]=b):b=t[15];let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,H.jsxs)(u,{onClick:b,size:`sm`,variant:`destructive`,children:[(0,H.jsx)(l,{className:`size-4`}),`Delete`]}),t[16]=x):x=t[16];let S;t[17]===f.status?S=t[18]:(S=(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x,(0,H.jsx)(I,{state:f.status})]}),t[17]=f.status,t[18]=S);let w;t[19]!==n||t[20]!==S?(w=(0,H.jsx)(E,{actions:S,subtitle:`Cluster Details`,title:n}),t[19]=n,t[20]=S,t[21]=w):w=t[21];let T;t[22]!==p.error||t[23]!==p.isError?(T=p.isError&&(0,H.jsx)(ee,{error:p.error instanceof Error?p.error:void 0,msg:`Failed to delete cluster.`}),t[22]=p.error,t[23]=p.isError,t[24]=T):T=t[24];let D;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,H.jsx)(ie.Header,{children:`Overview`}),t[25]=D):D=t[25];let O;t[26]===f.clusterArn?O=t[27]:(O=(0,H.jsx)(F,{label:`ARN`,value:f.clusterArn}),t[26]=f.clusterArn,t[27]=O);let k;t[28]===f.status?k=t[29]:(k=(0,H.jsx)(F,{label:`Status`,value:f.status}),t[28]=f.status,t[29]=k);let A=String(f.activeServicesCount??0),j;t[30]===A?j=t[31]:(j=(0,H.jsx)(F,{label:`Active services`,value:A}),t[30]=A,t[31]=j);let te=String(f.runningTasksCount??0),M;t[32]===te?M=t[33]:(M=(0,H.jsx)(F,{label:`Running tasks`,value:te}),t[32]=te,t[33]=M);let ne=String(f.pendingTasksCount??0),N;t[34]===ne?N=t[35]:(N=(0,H.jsx)(F,{label:`Pending tasks`,value:ne}),t[34]=ne,t[35]=N);let re=String(f.registeredContainerInstancesCount??0),L;t[36]===re?L=t[37]:(L=(0,H.jsx)(F,{label:`Registered instances`,value:re}),t[36]=re,t[37]=L);let U;t[38]!==O||t[39]!==k||t[40]!==j||t[41]!==M||t[42]!==N||t[43]!==L?(U=(0,H.jsxs)(ie,{children:[D,(0,H.jsxs)(ie.Content,{children:[O,k,j,M,N,L]})]}),t[38]=O,t[39]=k,t[40]=j,t[41]=M,t[42]=N,t[43]=L,t[44]=U):U=t[44];let W;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,H.jsxs)(ae,{children:[(0,H.jsx)(R,{value:`services`,children:`Services`}),(0,H.jsx)(R,{value:`tasks`,children:`Tasks`}),(0,H.jsx)(R,{value:`infrastructure`,children:`Infrastructure`}),(0,H.jsx)(R,{value:`tags`,children:`Tags`})]}),t[45]=W):W=t[45];let G;t[46]===n?G=t[47]:(G=(0,H.jsx)(z,{value:`services`,children:(0,H.jsx)(ce,{clusterName:n})}),t[46]=n,t[47]=G);let K;t[48]===n?K=t[49]:(K=(0,H.jsx)(z,{value:`tasks`,children:(0,H.jsx)(le,{clusterName:n})}),t[48]=n,t[49]=K);let q;t[50]===n?q=t[51]:(q=(0,H.jsx)(z,{value:`infrastructure`,children:(0,H.jsx)(se,{clusterName:n})}),t[50]=n,t[51]=q);let J;t[52]===_?J=t[53]:(J=(0,H.jsx)(z,{value:`tags`,children:_.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No tags.`}):(0,H.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Key`}),(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Value`})]})}),(0,H.jsx)(`tbody`,{children:_.map(ue)})]})})}),t[52]=_,t[53]=J);let Y;t[54]!==G||t[55]!==K||t[56]!==q||t[57]!==J?(Y=(0,H.jsxs)(oe,{className:`mt-6`,defaultValue:`services`,children:[W,G,K,q,J]}),t[54]=G,t[55]=K,t[56]=q,t[57]=J,t[58]=Y):Y=t[58];let X=`This permanently deletes cluster "${n}" and force-stops every task it holds. This cannot be undone.`,Z;t[59]!==p.isPending||t[60]!==h||t[61]!==i||t[62]!==X?(Z=(0,H.jsx)(P,{description:X,isPending:p.isPending,onConfirm:h,onOpenChange:o,open:i,title:`Delete cluster`}),t[59]=p.isPending,t[60]=h,t[61]=i,t[62]=X,t[63]=Z):Z=t[63];let Q;return t[64]!==U||t[65]!==Y||t[66]!==Z||t[67]!==w||t[68]!==T?(Q=(0,H.jsxs)(H.Fragment,{children:[v,w,T,U,Y,Z]}),t[64]=U,t[65]=Y,t[66]=Z,t[67]=w,t[68]=T,t[69]=Q):Q=t[69],Q}function ue(e){return(0,H.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,H.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.key}),(0,H.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.value})]},e.key)}function de(){let e=(0,B.c)(2),{clusterName:t}=T.useParams(),n;return e[0]===t?n=e[1]:(n=(0,H.jsx)(Q,{clusterName:t}),e[0]=t,e[1]=n),n}export{de as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_clusterName4.js b/spinifex/services/spinifexui/frontend/dist/assets/_clusterName4.js index 13b7be0c1..3d697c283 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_clusterName4.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_clusterName4.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{t as s}from"./useNavigate.js";import{$t as c,t as l}from"./cluster-config.js";import{t as u}from"./back-link.js";import{t as d}from"./circle-arrow-up.js";import{n as f,t as p}from"./_clusterName.js";import{t as m}from"./cli-command-panel.js";import{t as h}from"./trash-2.js";import{t as g}from"./triangle-alert.js";import{t as _}from"./button.js";import{t as v}from"./input.js";import{O as y,c as b}from"./ec2.js";import{C as x,S,T as C,_ as w,b as T,c as E,f as D,h as O,i as k,l as A,m as j,n as M,p as N,r as P,s as F,u as I,v as L,w as R,x as z,y as B}from"./eks.js";import{a as V,i as H,l as U,n as W,o as ee,r as te,s as ne,t as G,u as re}from"./eks2.js";import{y as ie}from"./iam2.js";import{a as ae,i as oe,n as se,t as ce}from"./zod.js";import{t as le}from"./error-banner.js";import{t as ue}from"./page-heading.js";import{a as K,n as de,r as fe,t as q}from"./field.js";import{i as pe,l as me,n as he,o as ge,r as _e,s as ve,t as ye}from"./alert-dialog.js";import{t as be}from"./delete-confirmation-dialog.js";import{n as J,t as Y}from"./detail-row.js";import{n as xe,t as Se}from"./gpu-instance-type-select.js";import{t as Ce}from"./badge.js";import{i as we,n as Te,r as Ee,t as De}from"./tabs.js";import{t as Oe}from"./json-editor.js";var ke=r(),X=e(n(),1),Z=t();function Ae(e){return e?.split(`/`).pop()??e??``}function Q(e){let t=(0,ke.c)(55),{clusterName:n,principalArn:r,onDelete:a}=e,o;t[0]!==n||t[1]!==r?(o=W(n,r),t[0]=n,t[1]=r,t[2]=o):o=t[2];let{data:s}=i(o),c;t[3]!==n||t[4]!==r?(c=ee(n,r),t[3]=n,t[4]=r,t[5]=c):c=t[5];let{data:l}=i(c),u=N(),d=S(),[f,p]=(0,X.useState)(M[0].arn),m=s?.accessEntry,g;t[6]===l?.associatedAccessPolicies?g=t[7]:(g=l?.associatedAccessPolicies??[],t[6]=l?.associatedAccessPolicies,t[7]=g);let v=g,y;t[8]===r?y=t[9]:(y=(0,Z.jsx)(`span`,{className:`truncate font-mono text-xs`,children:r}),t[8]=r,t[9]=y);let b;t[10]!==a||t[11]!==r?(b=()=>a(r),t[10]=a,t[11]=r,t[12]=b):b=t[12];let x;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(h,{className:`size-4`}),t[13]=x):x=t[13];let C;t[14]===b?C=t[15]:(C=(0,Z.jsx)(_,{onClick:b,size:`icon`,variant:`ghost`,children:x}),t[14]=b,t[15]=C);let w;t[16]!==y||t[17]!==C?(w=(0,Z.jsx)(J.Header,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[y,C]})}),t[16]=y,t[17]=C,t[18]=w):w=t[18];let T=m?.type,E;t[19]===T?E=t[20]:(E=(0,Z.jsx)(Y,{label:`Type`,value:T}),t[19]=T,t[20]=E);let D;t[21]===m?D=t[22]:(D=m?.kubernetesGroups?.length?m.kubernetesGroups.join(`, `):`—`,t[21]=m,t[22]=D);let O;t[23]===D?O=t[24]:(O=(0,Z.jsx)(Y,{label:`Kubernetes groups`,value:D}),t[23]=D,t[24]=O);let k;t[25]!==v||t[26]!==n||t[27]!==d||t[28]!==r?(k=v.length>0?(0,Z.jsx)(`div`,{className:`space-y-1`,children:v.map(e=>(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{children:Ae(e.policyArn)}),(0,Z.jsx)(_,{onClick:()=>d.mutate({clusterName:n,principalArn:r,policyArn:e.policyArn??``}),size:`sm`,variant:`ghost`,children:`Remove`})]},e.policyArn))}):`—`,t[25]=v,t[26]=n,t[27]=d,t[28]=r,t[29]=k):k=t[29];let A;t[30]===k?A=t[31]:(A=(0,Z.jsx)(Y,{label:`Access policies`,value:k}),t[30]=k,t[31]=A);let j;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>p(e.target.value),t[32]=j):j=t[32];let P;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(P=M.map(je),t[33]=P):P=t[33];let F;t[34]===f?F=t[35]:(F=(0,Z.jsx)(`select`,{"aria-label":`Access policy`,className:`h-7 flex-1 rounded-md border border-input bg-input/20 px-2 text-sm`,onChange:j,value:f,children:P}),t[34]=f,t[35]=F);let I;t[36]!==u||t[37]!==n||t[38]!==f||t[39]!==r?(I=()=>u.mutate({clusterName:n,principalArn:r,policyArn:f,accessScopeType:`cluster`}),t[36]=u,t[37]=n,t[38]=f,t[39]=r,t[40]=I):I=t[40];let L;t[41]!==u.isPending||t[42]!==I?(L=(0,Z.jsx)(_,{disabled:u.isPending,onClick:I,size:`sm`,children:`Associate`}),t[41]=u.isPending,t[42]=I,t[43]=L):L=t[43];let R;t[44]!==F||t[45]!==L?(R=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 pt-2`,children:[F,L]}),t[44]=F,t[45]=L,t[46]=R):R=t[46];let z;t[47]!==E||t[48]!==O||t[49]!==A||t[50]!==R?(z=(0,Z.jsxs)(J.Content,{children:[E,O,A,R]}),t[47]=E,t[48]=O,t[49]=A,t[50]=R,t[51]=z):z=t[51];let B;return t[52]!==z||t[53]!==w?(B=(0,Z.jsxs)(J,{children:[w,z]}),t[52]=z,t[53]=w,t[54]=B):B=t[54],B}function je(e){return(0,Z.jsx)(`option`,{value:e.arn,children:e.name},e.arn)}function $(e){let t=(0,ke.c)(41),{clusterName:n,open:r,onOpenChange:i}=e,a=j(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={resolver:ce(A),defaultValues:{principalArn:``,kubernetesGroups:``}},t[0]=o):o=t[0];let{formState:s,handleSubmit:c,register:l,reset:u}=oe(o),{errors:d}=s,f;t[1]!==n||t[2]!==a||t[3]!==i||t[4]!==u?(f=async e=>{await a.mutateAsync({clusterName:n,principalArn:e.principalArn,kubernetesGroups:e.kubernetesGroups.split(`,`).map(Me).filter(Boolean)}),u(),i(!1)},t[1]=n,t[2]=a,t[3]=i,t[4]=u,t[5]=f):f=t[5];let p=f,m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(ve,{children:(0,Z.jsx)(me,{children:`Add access entry`})}),t[6]=m):m=t[6];let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ae-principal`,children:`IAM principal ARN`})}),t[7]=h):h=t[7];let g=!!d.principalArn,_;t[8]===l?_=t[9]:(_=l(`principalArn`),t[8]=l,t[9]=_);let y;t[10]!==g||t[11]!==_?(y=(0,Z.jsx)(v,{"aria-invalid":g,id:`ae-principal`,placeholder:`arn:aws:iam::000000000000:role/my-role`,..._}),t[10]=g,t[11]=_,t[12]=y):y=t[12];let b;t[13]===d.principalArn?b=t[14]:(b=(0,Z.jsx)(fe,{errors:[d.principalArn]}),t[13]=d.principalArn,t[14]=b);let x;t[15]!==y||t[16]!==b?(x=(0,Z.jsxs)(q,{children:[h,y,b]}),t[15]=y,t[16]=b,t[17]=x):x=t[17];let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ae-groups`,children:`Kubernetes groups`})}),t[18]=S):S=t[18];let C;t[19]===l?C=t[20]:(C=l(`kubernetesGroups`),t[19]=l,t[20]=C);let w;t[21]===C?w=t[22]:(w=(0,Z.jsxs)(q,{children:[S,(0,Z.jsx)(v,{id:`ae-groups`,placeholder:`system:masters`,...C})]}),t[21]=C,t[22]=w);let T;t[23]!==x||t[24]!==w?(T=(0,Z.jsxs)(`form`,{className:`space-y-4`,id:`add-access-entry-form`,children:[x,w]}),t[23]=x,t[24]=w,t[25]=T):T=t[25];let E;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(_e,{children:`Cancel`}),t[26]=E):E=t[26];let D;t[27]!==c||t[28]!==p?(D=e=>{e.preventDefault(),c(p)()},t[27]=c,t[28]=p,t[29]=D):D=t[29];let O=a.isPending?`Creating…`:`Create`,k;t[30]!==a.isPending||t[31]!==D||t[32]!==O?(k=(0,Z.jsxs)(ge,{children:[E,(0,Z.jsx)(he,{disabled:a.isPending,onClick:D,children:O})]}),t[30]=a.isPending,t[31]=D,t[32]=O,t[33]=k):k=t[33];let M;t[34]!==T||t[35]!==k?(M=(0,Z.jsxs)(pe,{children:[m,T,k]}),t[34]=T,t[35]=k,t[36]=M):M=t[36];let N;return t[37]!==i||t[38]!==r||t[39]!==M?(N=(0,Z.jsx)(ye,{onOpenChange:i,open:r,children:M}),t[37]=i,t[38]=r,t[39]=M,t[40]=N):N=t[40],N}function Me(e){return e.trim()}function Ne(e){let t=(0,ke.c)(25),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=G(n),t[0]=n,t[1]=r);let{data:i}=a(r),o=L(),[s,c]=(0,X.useState)(!1),[l,u]=(0,X.useState)(),d;t[2]===i.accessEntries?d=t[3]:(d=i.accessEntries??[],t[2]=i.accessEntries,t[3]=d);let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,Z.jsx)(_,{onClick:()=>c(!0),size:`sm`,children:`Add access entry`})}),t[4]=p):p=t[4];let m;t[5]!==n||t[6]!==f?(m=f.length>0?(0,Z.jsx)(`div`,{className:`space-y-4`,children:f.map(e=>(0,Z.jsx)(Q,{clusterName:n,onDelete:u,principalArn:e},e))}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`No access entries.`}),t[5]=n,t[6]=f,t[7]=m):m=t[7];let h;t[8]!==n||t[9]!==s?(h=(0,Z.jsx)($,{clusterName:n,onOpenChange:c,open:s}),t[8]=n,t[9]=s,t[10]=h):h=t[10];let g=`Delete access entry for "${l??``}"?`,v;t[11]!==n||t[12]!==o||t[13]!==l?(v=()=>{l&&o.mutate({clusterName:n,principalArn:l},{onSuccess:()=>u(void 0)})},t[11]=n,t[12]=o,t[13]=l,t[14]=v):v=t[14];let y;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>!e&&u(void 0),t[15]=y):y=t[15];let b=l!==void 0,x;t[16]!==o.isPending||t[17]!==g||t[18]!==v||t[19]!==b?(x=(0,Z.jsx)(be,{description:g,isPending:o.isPending,onConfirm:v,onOpenChange:y,open:b,title:`Delete access entry`}),t[16]=o.isPending,t[17]=g,t[18]=v,t[19]=b,t[20]=x):x=t[20];let S;return t[21]!==x||t[22]!==m||t[23]!==h?(S=(0,Z.jsxs)(Z.Fragment,{children:[p,m,h,x]}),t[21]=x,t[22]=m,t[23]=h,t[24]=S):S=t[24],S}var Pe=new Set([`CREATING`,`UPDATING`,`DELETING`]),Fe=5e3,Ie=`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`;function Le(e){let t=(0,ke.c)(97),{clusterName:n,catalog:r,installed:i,open:a,onOpenChange:o}=e,s=O(),c;t[0]===i?c=t[1]:(c=new Set(i),t[0]=i,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=e=>!l.has(e.addonName??``),t[2]=l,t[3]=u);let d=r.filter(u),f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f={resolver:ce(I),defaultValues:{addonName:``,addonVersion:``,serviceAccountRoleArn:``,configurationValues:``}},t[4]=f):f=t[4];let{control:p,formState:m,handleSubmit:h,register:g,reset:_,setValue:y}=oe(f),{errors:b}=m,x;t[5]===p?x=t[6]:(x={control:p,name:`addonName`},t[5]=p,t[6]=x);let S=ae(x),C;t[7]===p?C=t[8]:(C={control:p,name:`addonVersion`},t[7]=p,t[8]=C);let w=ae(C),T;t[9]===S?T=t[10]:(T=e=>e.addonName===S,t[9]=S,t[10]=T);let E=r.find(T)?.addonVersions??[],D;t[11]===w?D=t[12]:(D=e=>e.addonVersion===w,t[11]=w,t[12]=D);let k=E.find(D)?.requiresIamPermissions??!1,A;t[13]!==r||t[14]!==y?(A=e=>{let t=r.find(t=>t.addonName===e)?.addonVersions?.[0]?.addonVersion??``;y(`addonName`,e,{shouldValidate:!0}),y(`addonVersion`,t,{shouldValidate:!0})},t[13]=r,t[14]=y,t[15]=A):A=t[15];let j=A,M;t[16]!==n||t[17]!==s||t[18]!==o||t[19]!==_?(M=async e=>{await s.mutateAsync({clusterName:n,addonName:e.addonName,addonVersion:e.addonVersion||void 0,serviceAccountRoleArn:e.serviceAccountRoleArn.trim()||void 0,configurationValues:e.configurationValues.trim()||void 0}),_(),o(!1)},t[16]=n,t[17]=s,t[18]=o,t[19]=_,t[20]=M):M=t[20];let N=M,P=ye,F=pe,L;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(ve,{children:(0,Z.jsx)(me,{children:`Add add-on`})}),t[21]=L):L=t[21];let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`addon-name`,children:`Add-on`})}),t[22]=R):R=t[22];let z=!!b.addonName,B;t[23]===j?B=t[24]:(B=e=>j(e.target.value),t[23]=j,t[24]=B);let V;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(`option`,{value:``,children:`Select add-on`}),t[25]=V):V=t[25];let H=d.map(ze),U;t[26]!==S||t[27]!==z||t[28]!==B||t[29]!==H?(U=(0,Z.jsxs)(`select`,{"aria-invalid":z,className:Ie,id:`addon-name`,onChange:B,value:S,children:[V,H]}),t[26]=S,t[27]=z,t[28]=B,t[29]=H,t[30]=U):U=t[30];let W;t[31]===b.addonName?W=t[32]:(W=(0,Z.jsx)(fe,{errors:[b.addonName]}),t[31]=b.addonName,t[32]=W);let ee;t[33]!==U||t[34]!==W?(ee=(0,Z.jsxs)(q,{children:[R,U,W]}),t[33]=U,t[34]=W,t[35]=ee):ee=t[35];let te=q,ne;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`addon-version`,children:`Version`})}),t[36]=ne):ne=t[36];let G=!!b.addonVersion,re=Ie,ie=E.length===0,le;t[37]===y?le=t[38]:(le=e=>y(`addonVersion`,e.target.value,{shouldValidate:!0}),t[37]=y,t[38]=le);let ue=E.map(Re),de;t[39]!==w||t[40]!==G||t[41]!==re||t[42]!==ie||t[43]!==le||t[44]!==ue?(de=(0,Z.jsx)(`select`,{"aria-invalid":G,className:re,disabled:ie,id:`addon-version`,onChange:le,value:w,children:ue}),t[39]=w,t[40]=G,t[41]=re,t[42]=ie,t[43]=le,t[44]=ue,t[45]=de):de=t[45];let be;t[46]===b.addonVersion?be=t[47]:(be=(0,Z.jsx)(fe,{errors:[b.addonVersion]}),t[46]=b.addonVersion,t[47]=be);let J;t[48]!==te||t[49]!==ne||t[50]!==de||t[51]!==be?(J=(0,Z.jsxs)(te,{children:[ne,de,be]}),t[48]=te,t[49]=ne,t[50]=de,t[51]=be,t[52]=J):J=t[52];let Y;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`addon-role`,children:`Service account IAM role ARN`})}),t[53]=Y):Y=t[53];let xe;t[54]===g?xe=t[55]:(xe=g(`serviceAccountRoleArn`),t[54]=g,t[55]=xe);let Se;t[56]===xe?Se=t[57]:(Se=(0,Z.jsx)(v,{id:`addon-role`,placeholder:`arn:aws:iam::…:role/…`,...xe}),t[56]=xe,t[57]=Se);let Ce;t[58]===k?Ce=t[59]:(Ce=k&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This add-on needs IAM permissions — provide an IRSA role ARN.`}),t[58]=k,t[59]=Ce);let we;t[60]!==Se||t[61]!==Ce?(we=(0,Z.jsxs)(q,{children:[Y,Se,Ce]}),t[60]=Se,t[61]=Ce,t[62]=we):we=t[62];let Te;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`addon-config`,children:`Configuration values (JSON)`})}),t[63]=Te):Te=t[63];let Ee;t[64]===b.configurationValues?Ee=t[65]:(Ee=e=>{let{field:t}=e,{onBlur:n,onChange:r,ref:i,value:a}=t;return(0,Z.jsx)(Oe,{error:!!b.configurationValues,id:`addon-config`,onBlur:n,onChange:r,placeholder:`{"replicaCount": 2}`,ref:i,rows:4,value:a})},t[64]=b.configurationValues,t[65]=Ee);let De;t[66]!==p||t[67]!==Ee?(De=(0,Z.jsx)(se,{control:p,name:`configurationValues`,render:Ee}),t[66]=p,t[67]=Ee,t[68]=De):De=t[68];let X;t[69]===b.configurationValues?X=t[70]:(X=(0,Z.jsx)(fe,{errors:[b.configurationValues]}),t[69]=b.configurationValues,t[70]=X);let Ae;t[71]!==De||t[72]!==X?(Ae=(0,Z.jsxs)(q,{children:[Te,De,X]}),t[71]=De,t[72]=X,t[73]=Ae):Ae=t[73];let Q;t[74]!==ee||t[75]!==J||t[76]!==we||t[77]!==Ae?(Q=(0,Z.jsxs)(`form`,{className:`space-y-4`,id:`add-addon-form`,children:[ee,J,we,Ae]}),t[74]=ee,t[75]=J,t[76]=we,t[77]=Ae,t[78]=Q):Q=t[78];let je;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,Z.jsx)(_e,{children:`Cancel`}),t[79]=je):je=t[79];let $;t[80]!==h||t[81]!==N?($=e=>{e.preventDefault(),h(N)()},t[80]=h,t[81]=N,t[82]=$):$=t[82];let Me=s.isPending?`Adding…`:`Add`,Ne;t[83]!==s.isPending||t[84]!==$||t[85]!==Me?(Ne=(0,Z.jsxs)(ge,{children:[je,(0,Z.jsx)(he,{disabled:s.isPending,onClick:$,children:Me})]}),t[83]=s.isPending,t[84]=$,t[85]=Me,t[86]=Ne):Ne=t[86];let Pe;t[87]!==F||t[88]!==L||t[89]!==Q||t[90]!==Ne?(Pe=(0,Z.jsxs)(F,{className:`max-h-[85vh] overflow-y-auto`,children:[L,Q,Ne]}),t[87]=F,t[88]=L,t[89]=Q,t[90]=Ne,t[91]=Pe):Pe=t[91];let Fe;return t[92]!==P||t[93]!==o||t[94]!==a||t[95]!==Pe?(Fe=(0,Z.jsx)(P,{onOpenChange:o,open:a,children:Pe}),t[92]=P,t[93]=o,t[94]=a,t[95]=Pe,t[96]=Fe):Fe=t[96],Fe}function Re(e,t){return(0,Z.jsxs)(`option`,{value:e.addonVersion??``,children:[e.addonVersion,t===0?` (latest)`:``]},e.addonVersion)}function ze(e){return(0,Z.jsx)(`option`,{value:e.addonName??``,children:e.addonName},e.addonName)}function Be(e){let t=(0,ke.c)(48),{clusterName:n,addonName:r,current:i,versions:a,open:o,onOpenChange:s}=e,c=R(),[l,u]=(0,X.useState)(i.addonVersion??``),[d,f]=(0,X.useState)(i.serviceAccountRoleArn??``),[p,m]=(0,X.useState)(i.configurationValues??``),[h,g]=(0,X.useState)(),[_,y]=(0,X.useState)(o);o!==_&&(y(o),o&&(u(i.addonVersion??``),f(i.serviceAccountRoleArn??``),m(i.configurationValues??``),g(void 0)));let b;t[0]!==r||t[1]!==n||t[2]!==p||t[3]!==s||t[4]!==d||t[5]!==c||t[6]!==l?(b=()=>{let e=F.safeParse(p);if(!e.success){g(e.error.issues[0]?.message??`Configuration must be valid JSON`);return}g(void 0),c.mutate({clusterName:n,addonName:r,addonVersion:l||void 0,serviceAccountRoleArn:d.trim()||void 0,configurationValues:p.trim()||void 0},{onSuccess:()=>s(!1)})},t[0]=r,t[1]=n,t[2]=p,t[3]=s,t[4]=d,t[5]=c,t[6]=l,t[7]=b):b=t[7];let x=b,S;t[8]===r?S=t[9]:(S=(0,Z.jsx)(ve,{children:(0,Z.jsxs)(me,{children:[`Update `,r]})}),t[8]=r,t[9]=S);let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`update-addon-version`,children:`Version`})}),t[10]=C):C=t[10];let w=a.length===0,T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>u(e.target.value),t[11]=T):T=t[11];let E;t[12]===a?E=t[13]:(E=a.map(Ve),t[12]=a,t[13]=E);let D;t[14]!==w||t[15]!==E||t[16]!==l?(D=(0,Z.jsxs)(q,{children:[C,(0,Z.jsx)(`select`,{className:Ie,disabled:w,id:`update-addon-version`,onChange:T,value:l,children:E})]}),t[14]=w,t[15]=E,t[16]=l,t[17]=D):D=t[17];let O;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`update-addon-role`,children:`Service account IAM role ARN`})}),t[18]=O):O=t[18];let k;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>f(e.target.value),t[19]=k):k=t[19];let A;t[20]===d?A=t[21]:(A=(0,Z.jsxs)(q,{children:[O,(0,Z.jsx)(v,{id:`update-addon-role`,onChange:k,placeholder:`arn:aws:iam::…:role/…`,value:d})]}),t[20]=d,t[21]=A);let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`update-addon-config`,children:`Configuration values (JSON)`})}),t[22]=j):j=t[22];let M=!!h,N;t[23]!==p||t[24]!==M?(N=(0,Z.jsxs)(q,{children:[j,(0,Z.jsx)(Oe,{error:M,id:`update-addon-config`,onChange:m,rows:4,value:p})]}),t[23]=p,t[24]=M,t[25]=N):N=t[25];let P;t[26]!==A||t[27]!==N||t[28]!==D?(P=(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[D,A,N]}),t[26]=A,t[27]=N,t[28]=D,t[29]=P):P=t[29];let I;t[30]===h?I=t[31]:(I=h&&(0,Z.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:h}),t[30]=h,t[31]=I);let L;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(_e,{children:`Cancel`}),t[32]=L):L=t[32];let z;t[33]===x?z=t[34]:(z=e=>{e.preventDefault(),x()},t[33]=x,t[34]=z);let B=c.isPending?`Updating…`:`Update`,V;t[35]!==z||t[36]!==B||t[37]!==c.isPending?(V=(0,Z.jsxs)(ge,{children:[L,(0,Z.jsx)(he,{disabled:c.isPending,onClick:z,children:B})]}),t[35]=z,t[36]=B,t[37]=c.isPending,t[38]=V):V=t[38];let H;t[39]!==P||t[40]!==I||t[41]!==V||t[42]!==S?(H=(0,Z.jsxs)(pe,{className:`max-h-[85vh] overflow-y-auto`,children:[S,P,I,V]}),t[39]=P,t[40]=I,t[41]=V,t[42]=S,t[43]=H):H=t[43];let U;return t[44]!==s||t[45]!==o||t[46]!==H?(U=(0,Z.jsx)(ye,{onOpenChange:s,open:o,children:H}),t[44]=s,t[45]=o,t[46]=H,t[47]=U):U=t[47],U}function Ve(e){return(0,Z.jsx)(`option`,{value:e,children:e},e)}function He(e){let t=(0,ke.c)(53),{clusterName:n,addonName:r,catalog:a,onDelete:o}=e,s;t[0]!==r||t[1]!==n?(s=te(n,r),t[0]=r,t[1]=n,t[2]=s):s=t[2];let c;t[3]===s?c=t[4]:(c={...s,refetchInterval:We},t[3]=s,t[4]=c);let{data:l}=i(c),[u,f]=(0,X.useState)(!1),p=l?.addon,m=p?.health?.issues?.[0]?.message,g;t[5]!==r||t[6]!==a?(g=a.find(e=>e.addonName===r)?.addonVersions?.map(Ue).filter(Boolean)??[],t[5]=r,t[6]=a,t[7]=g):g=t[7];let v=g,y;t[8]===r?y=t[9]:(y=(0,Z.jsx)(`span`,{children:r}),t[8]=r,t[9]=y);let b=p?.status,x;t[10]===b?x=t[11]:(x=E(b),t[10]=b,t[11]=x);let S=p?.status??`UNKNOWN`,C;t[12]!==x||t[13]!==S?(C=(0,Z.jsx)(Ce,{variant:x,children:S}),t[12]=x,t[13]=S,t[14]=C):C=t[14];let w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>f(!0),t[15]=w):w=t[15];let T;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(_,{"aria-label":`Update add-on`,onClick:w,size:`icon`,variant:`ghost`,children:(0,Z.jsx)(d,{className:`size-4`})}),t[16]=T):T=t[16];let D;t[17]!==r||t[18]!==o?(D=()=>o(r),t[17]=r,t[18]=o,t[19]=D):D=t[19];let O;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(h,{className:`size-4`}),t[20]=O):O=t[20];let k;t[21]===D?k=t[22]:(k=(0,Z.jsx)(_,{"aria-label":`Remove add-on`,onClick:D,size:`icon`,variant:`ghost`,children:O}),t[21]=D,t[22]=k);let A;t[23]!==k||t[24]!==C?(A=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[C,T,k]}),t[23]=k,t[24]=C,t[25]=A):A=t[25];let j;t[26]!==A||t[27]!==y?(j=(0,Z.jsx)(J.Header,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[y,A]})}),t[26]=A,t[27]=y,t[28]=j):j=t[28];let M=p?.addonVersion,N;t[29]===M?N=t[30]:(N=(0,Z.jsx)(Y,{label:`Version`,value:M}),t[29]=M,t[30]=N);let P=p?.serviceAccountRoleArn,F;t[31]===P?F=t[32]:(F=(0,Z.jsx)(Y,{label:`IRSA role`,value:P}),t[31]=P,t[32]=F);let I;t[33]===m?I=t[34]:(I=m&&(0,Z.jsx)(Y,{label:`Issue`,value:(0,Z.jsx)(`span`,{className:`text-destructive`,children:m})}),t[33]=m,t[34]=I);let L;t[35]!==N||t[36]!==F||t[37]!==I?(L=(0,Z.jsxs)(J.Content,{children:[N,F,I]}),t[35]=N,t[36]=F,t[37]=I,t[38]=L):L=t[38];let R=p?.addonVersion,z=p?.serviceAccountRoleArn,B=p?.configurationValues,V;t[39]!==R||t[40]!==z||t[41]!==B?(V={addonVersion:R,serviceAccountRoleArn:z,configurationValues:B},t[39]=R,t[40]=z,t[41]=B,t[42]=V):V=t[42];let H;t[43]!==r||t[44]!==n||t[45]!==u||t[46]!==V||t[47]!==v?(H=(0,Z.jsx)(Be,{addonName:r,clusterName:n,current:V,onOpenChange:f,open:u,versions:v}),t[43]=r,t[44]=n,t[45]=u,t[46]=V,t[47]=v,t[48]=H):H=t[48];let U;return t[49]!==j||t[50]!==L||t[51]!==H?(U=(0,Z.jsxs)(J,{children:[j,L,H]}),t[49]=j,t[50]=L,t[51]=H,t[52]=U):U=t[52],U}function Ue(e){return e.addonVersion??``}function We(e){return Pe.has(e.state.data?.addon?.status??``)?Fe:!1}function Ge(e){let t=(0,ke.c)(31),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=V(n),t[0]=n,t[1]=r);let{data:o}=a(r),{data:s}=i(H),c=B(),[l,u]=(0,X.useState)(!1),[d,f]=(0,X.useState)(),p;t[2]===o.addons?p=t[3]:(p=o.addons??[],t[2]=o.addons,t[3]=p);let m=p,h;t[4]===s?.addons?h=t[5]:(h=s?.addons??[],t[4]=s?.addons,t[5]=h);let g=h,v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add-on manifests are staged; activation completes when the cluster reports the workload ready.`}),t[6]=v):v=t[6];let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4`,children:[v,(0,Z.jsx)(_,{onClick:()=>u(!0),size:`sm`,children:`Add add-on`})]}),t[7]=y):y=t[7];let b;t[8]!==m||t[9]!==g||t[10]!==n?(b=m.length>0?(0,Z.jsx)(`div`,{className:`space-y-4`,children:m.map(e=>(0,Z.jsx)(He,{addonName:e,catalog:g,clusterName:n,onDelete:f},e))}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`No add-ons installed.`}),t[8]=m,t[9]=g,t[10]=n,t[11]=b):b=t[11];let x;t[12]!==m||t[13]!==g||t[14]!==n||t[15]!==l?(x=(0,Z.jsx)(Le,{catalog:g,clusterName:n,installed:m,onOpenChange:u,open:l}),t[12]=m,t[13]=g,t[14]=n,t[15]=l,t[16]=x):x=t[16];let S=`Remove add-on "${d??``}" from the cluster?`,C;t[17]!==n||t[18]!==c||t[19]!==d?(C=()=>{d&&c.mutate({clusterName:n,addonName:d},{onSuccess:()=>f(void 0)})},t[17]=n,t[18]=c,t[19]=d,t[20]=C):C=t[20];let w;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>!e&&f(void 0),t[21]=w):w=t[21];let T=d!==void 0,E;t[22]!==c.isPending||t[23]!==T||t[24]!==S||t[25]!==C?(E=(0,Z.jsx)(be,{confirmLabel:`Remove`,description:S,isPending:c.isPending,onConfirm:C,onOpenChange:w,open:T,pendingLabel:`Removing…`,title:`Remove add-on`}),t[22]=c.isPending,t[23]=T,t[24]=S,t[25]=C,t[26]=E):E=t[26];let D;return t[27]!==E||t[28]!==b||t[29]!==x?(D=(0,Z.jsxs)(Z.Fragment,{children:[y,b,x,E]}),t[27]=E,t[28]=b,t[29]=x,t[30]=D):D=t[30],D}function Ke(e){let t=(0,ke.c)(6),{to:n,id:r}=e,i;t[0]===r?i=t[1]:(i={id:r},t[0]=r,t[1]=i);let a;return t[2]!==r||t[3]!==i||t[4]!==n?(a=(0,Z.jsx)(o,{className:`font-mono text-primary underline-offset-2 hover:underline`,params:i,to:n,children:r}),t[2]=r,t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function qe(e){let t=(0,ke.c)(45),{cluster:n}=e,r=n?.resourcesVpcConfig,i;t[0]===r?.subnetIds?i=t[1]:(i=r?.subnetIds??[],t[0]=r?.subnetIds,t[1]=i);let a=i,o;t[2]===r?.securityGroupIds?o=t[3]:(o=r?.securityGroupIds??[],t[2]=r?.securityGroupIds,t[3]=o);let s=o,c;t[4]===r?.publicAccessCidrs?c=t[5]:(c=r?.publicAccessCidrs??[],t[4]=r?.publicAccessCidrs,t[5]=c);let l=c,u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(J.Header,{children:`VPC`}),t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=r?.vpcId?(0,Z.jsx)(Ke,{id:r.vpcId,to:`/ec2/describe-vpcs/$id`}):void 0,t[7]=r,t[8]=d);let f;t[9]===d?f=t[10]:(f=(0,Z.jsx)(Y,{label:`VPC`,value:d}),t[9]=d,t[10]=f);let p=n?.endpoint,m;t[11]===p?m=t[12]:(m=(0,Z.jsx)(Y,{label:`API server endpoint`,value:p}),t[11]=p,t[12]=m);let h=r?.endpointPublicAccess?`Enabled`:`Disabled`,g;t[13]===h?g=t[14]:(g=(0,Z.jsx)(Y,{label:`Public access`,value:h}),t[13]=h,t[14]=g);let _=r?.endpointPrivateAccess?`Enabled`:`Disabled`,v;t[15]===_?v=t[16]:(v=(0,Z.jsx)(Y,{label:`Private access`,value:_}),t[15]=_,t[16]=v);let y;t[17]!==l||t[18]!==r?.endpointPublicAccess?(y=r?.endpointPublicAccess&&(0,Z.jsx)(Y,{label:`Public access CIDRs`,value:l.length>0?(0,Z.jsx)(`div`,{className:`space-y-1 font-mono text-xs`,children:l.map(Xe)}):`Any (0.0.0.0/0)`}),t[17]=l,t[18]=r?.endpointPublicAccess,t[19]=y):y=t[19];let b;t[20]!==g||t[21]!==v||t[22]!==y||t[23]!==f||t[24]!==m?(b=(0,Z.jsxs)(J,{children:[u,(0,Z.jsxs)(J.Content,{children:[f,m,g,v,y]})]}),t[20]=g,t[21]=v,t[22]=y,t[23]=f,t[24]=m,t[25]=b):b=t[25];let x;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(J.Header,{children:`Subnets`}),t[26]=x):x=t[26];let S;t[27]===a?S=t[28]:(S=(0,Z.jsxs)(J,{children:[x,(0,Z.jsx)(J.Content,{children:a.length>0?(0,Z.jsx)(`div`,{className:`space-y-1`,children:a.map(Ye)}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`No subnets.`})})]}),t[27]=a,t[28]=S);let C;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(J.Header,{children:`Security groups`}),t[29]=C):C=t[29];let w;t[30]===r?w=t[31]:(w=r?.clusterSecurityGroupId?(0,Z.jsx)(Ke,{id:r.clusterSecurityGroupId,to:`/ec2/describe-security-groups/$id`}):void 0,t[30]=r,t[31]=w);let T;t[32]===w?T=t[33]:(T=(0,Z.jsx)(Y,{label:`Cluster security group`,value:w}),t[32]=w,t[33]=T);let E;t[34]===s?E=t[35]:(E=s.length>0?(0,Z.jsx)(`div`,{className:`space-y-1`,children:s.map(Je)}):`—`,t[34]=s,t[35]=E);let D;t[36]===E?D=t[37]:(D=(0,Z.jsx)(Y,{label:`Additional security groups`,value:E}),t[36]=E,t[37]=D);let O;t[38]!==T||t[39]!==D?(O=(0,Z.jsxs)(J,{children:[C,(0,Z.jsxs)(J.Content,{children:[T,D]})]}),t[38]=T,t[39]=D,t[40]=O):O=t[40];let k;return t[41]!==b||t[42]!==S||t[43]!==O?(k=(0,Z.jsxs)(Z.Fragment,{children:[b,S,O]}),t[41]=b,t[42]=S,t[43]=O,t[44]=k):k=t[44],k}function Je(e){return(0,Z.jsx)(Ke,{id:e,to:`/ec2/describe-security-groups/$id`},e)}function Ye(e){return(0,Z.jsx)(Ke,{id:e,to:`/ec2/describe-subnets/$id`},e)}function Xe(e){return(0,Z.jsx)(`div`,{children:e},e)}function Ze(e){return!!e&&(e.endsWith(`_GPU`)||e.endsWith(`_NVIDIA`))}function Qe(e,t){let n=t.find(t=>t.InstanceType===e);return!!n&&xe(n)}function $e(e){let t=(0,ke.c)(44),{clusterName:n,nodegroupName:r,current:i,open:a,onOpenChange:o}=e,s=x(),[c,l]=(0,X.useState)(i.minSize??0),[u,d]=(0,X.useState)(i.desiredSize??0),[f,p]=(0,X.useState)(i.maxSize??0),[m,h]=(0,X.useState)(),[g,_]=(0,X.useState)(a);a!==g&&(_(a),a&&(l(i.minSize??0),d(i.desiredSize??0),p(i.maxSize??0),h(void 0)));let y;t[0]!==n||t[1]!==u||t[2]!==f||t[3]!==c||t[4]!==r||t[5]!==o||t[6]!==s?(y=()=>{if(!(c<=u&&u<=f)){h(`Sizes must satisfy min ≤ desired ≤ max`);return}s.mutate({clusterName:n,nodegroupName:r,minSize:c,desiredSize:u,maxSize:f},{onSuccess:()=>o(!1)})},t[0]=n,t[1]=u,t[2]=f,t[3]=c,t[4]=r,t[5]=o,t[6]=s,t[7]=y):y=t[7];let b=y,S;t[8]===r?S=t[9]:(S=(0,Z.jsx)(ve,{children:(0,Z.jsxs)(me,{children:[`Scale `,r]})}),t[8]=r,t[9]=S);let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`scale-min`,children:`Min`})}),t[10]=C):C=t[10];let w;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>l(Number(e.target.value)),t[11]=w):w=t[11];let T;t[12]===c?T=t[13]:(T=(0,Z.jsxs)(q,{children:[C,(0,Z.jsx)(v,{id:`scale-min`,onChange:w,type:`number`,value:c})]}),t[12]=c,t[13]=T);let E;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`scale-desired`,children:`Desired`})}),t[14]=E):E=t[14];let D;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>d(Number(e.target.value)),t[15]=D):D=t[15];let O;t[16]===u?O=t[17]:(O=(0,Z.jsxs)(q,{children:[E,(0,Z.jsx)(v,{id:`scale-desired`,onChange:D,type:`number`,value:u})]}),t[16]=u,t[17]=O);let k;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`scale-max`,children:`Max`})}),t[18]=k):k=t[18];let A;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>p(Number(e.target.value)),t[19]=A):A=t[19];let j;t[20]===f?j=t[21]:(j=(0,Z.jsxs)(q,{children:[k,(0,Z.jsx)(v,{id:`scale-max`,onChange:A,type:`number`,value:f})]}),t[20]=f,t[21]=j);let M;t[22]!==j||t[23]!==T||t[24]!==O?(M=(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[T,O,j]}),t[22]=j,t[23]=T,t[24]=O,t[25]=M):M=t[25];let N;t[26]===m?N=t[27]:(N=m&&(0,Z.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:m}),t[26]=m,t[27]=N);let P;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(_e,{children:`Cancel`}),t[28]=P):P=t[28];let F;t[29]===b?F=t[30]:(F=e=>{e.preventDefault(),b()},t[29]=b,t[30]=F);let I=s.isPending?`Scaling…`:`Scale`,L;t[31]!==s.isPending||t[32]!==F||t[33]!==I?(L=(0,Z.jsxs)(ge,{children:[P,(0,Z.jsx)(he,{disabled:s.isPending,onClick:F,children:I})]}),t[31]=s.isPending,t[32]=F,t[33]=I,t[34]=L):L=t[34];let R;t[35]!==M||t[36]!==N||t[37]!==L||t[38]!==S?(R=(0,Z.jsxs)(pe,{children:[S,M,N,L]}),t[35]=M,t[36]=N,t[37]=L,t[38]=S,t[39]=R):R=t[39];let z;return t[40]!==o||t[41]!==a||t[42]!==R?(z=(0,Z.jsx)(ye,{onOpenChange:o,open:a,children:R}),t[40]=o,t[41]=a,t[42]=R,t[43]=z):z=t[43],z}function et(e){let t=(0,ke.c)(71),{clusterName:n,clusterVersion:r,nodegroupName:a,onDelete:o}=e,s;t[0]!==n||t[1]!==a?(s=U(n,a),t[0]=n,t[1]=a,t[2]=s):s=t[2];let{data:c}=i(s),l=C(),u=c?.nodegroup,p=u?.scalingConfig,[m,g]=(0,X.useState)(!1),[v,y]=(0,X.useState)(!1),b=!!r&&!!u?.version&&u.version!==r,x=u?.amiType,S;t[3]===x?S=t[4]:(S=Ze(x),t[3]=x,t[4]=S);let w=S,T;t[5]===a?T=t[6]:(T=(0,Z.jsx)(`span`,{children:a}),t[5]=a,t[6]=T);let E;t[7]===w?E=t[8]:(E=w&&(0,Z.jsx)(Ce,{variant:`secondary`,children:`GPU`}),t[7]=w,t[8]=E);let D;t[9]!==T||t[10]!==E?(D=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T,E]}),t[9]=T,t[10]=E,t[11]=D):D=t[11];let O;t[12]===b?O=t[13]:(O=b&&(0,Z.jsx)(_,{"aria-label":`Update node group version`,onClick:()=>y(!0),size:`icon`,variant:`ghost`,children:(0,Z.jsx)(d,{className:`size-4`})}),t[12]=b,t[13]=O);let k;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>g(!0),t[14]=k):k=t[14];let A;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(_,{"aria-label":`Scale node group`,onClick:k,size:`icon`,variant:`ghost`,children:(0,Z.jsx)(f,{className:`size-4`})}),t[15]=A):A=t[15];let j;t[16]!==a||t[17]!==o?(j=()=>o(a),t[16]=a,t[17]=o,t[18]=j):j=t[18];let M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(h,{className:`size-4`}),t[19]=M):M=t[19];let N;t[20]===j?N=t[21]:(N=(0,Z.jsx)(_,{"aria-label":`Delete node group`,onClick:j,size:`icon`,variant:`ghost`,children:M}),t[20]=j,t[21]=N);let P;t[22]!==N||t[23]!==O?(P=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[O,A,N]}),t[22]=N,t[23]=O,t[24]=P):P=t[24];let F;t[25]!==P||t[26]!==D?(F=(0,Z.jsx)(J.Header,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[D,P]})}),t[25]=P,t[26]=D,t[27]=F):F=t[27];let I=u?.status,L;t[28]===I?L=t[29]:(L=(0,Z.jsx)(Y,{label:`Status`,value:I}),t[28]=I,t[29]=L);let R=b?`${u?.version} (cluster on ${r})`:u?.version,z;t[30]===R?z=t[31]:(z=(0,Z.jsx)(Y,{label:`Kubernetes version`,value:R}),t[30]=R,t[31]=z);let B;t[32]===u?.instanceTypes?B=t[33]:(B=u?.instanceTypes?.join(`, `),t[32]=u?.instanceTypes,t[33]=B);let V;t[34]===B?V=t[35]:(V=(0,Z.jsx)(Y,{label:`Instance types`,value:B}),t[34]=B,t[35]=V);let H=u?.amiType,W;t[36]===H?W=t[37]:(W=(0,Z.jsx)(Y,{label:`AMI type`,value:H}),t[36]=H,t[37]=W);let ee=u?.capacityType,te;t[38]===ee?te=t[39]:(te=(0,Z.jsx)(Y,{label:`Capacity type`,value:ee}),t[38]=ee,t[39]=te);let ne=p?`${p.minSize} / ${p.desiredSize} / ${p.maxSize}`:void 0,G;t[40]===ne?G=t[41]:(G=(0,Z.jsx)(Y,{label:`Scaling (min / desired / max)`,value:ne}),t[40]=ne,t[41]=G);let re;t[42]!==L||t[43]!==z||t[44]!==V||t[45]!==W||t[46]!==te||t[47]!==G?(re=(0,Z.jsxs)(J.Content,{children:[L,z,V,W,te,G]}),t[42]=L,t[43]=z,t[44]=V,t[45]=W,t[46]=te,t[47]=G,t[48]=re):re=t[48];let ie;t[49]===p?ie=t[50]:(ie=p??{},t[49]=p,t[50]=ie);let ae;t[51]!==n||t[52]!==a||t[53]!==m||t[54]!==ie?(ae=(0,Z.jsx)($e,{clusterName:n,current:ie,nodegroupName:a,onOpenChange:g,open:m}),t[51]=n,t[52]=a,t[53]=m,t[54]=ie,t[55]=ae):ae=t[55];let oe=`Update node group "${a}" from ${u?.version} to ${r}? Nodes are replaced in a rolling update.`,se;t[56]!==n||t[57]!==r||t[58]!==a||t[59]!==l?(se=()=>l.mutate({clusterName:n,nodegroupName:a,version:r},{onSuccess:()=>y(!1)}),t[56]=n,t[57]=r,t[58]=a,t[59]=l,t[60]=se):se=t[60];let ce;t[61]!==v||t[62]!==oe||t[63]!==se||t[64]!==l.isPending?(ce=(0,Z.jsx)(be,{confirmLabel:`Update`,description:oe,isPending:l.isPending,onConfirm:se,onOpenChange:y,open:v,title:`Update node group version`}),t[61]=v,t[62]=oe,t[63]=se,t[64]=l.isPending,t[65]=ce):ce=t[65];let le;return t[66]!==F||t[67]!==re||t[68]!==ae||t[69]!==ce?(le=(0,Z.jsxs)(J,{children:[F,re,ae,ce]}),t[66]=F,t[67]=re,t[68]=ae,t[69]=ce,t[70]=le):le=t[70],le}function tt(e){let t=(0,ke.c)(145),{clusterName:n,vpcId:r,open:a,onOpenChange:o}=e,{data:s}=i(ie),{data:c}=i(y),{data:l}=i(b),u=w(),d;t[0]===s?.Roles?d=t[1]:(d=s?.Roles??[],t[0]=s?.Roles,t[1]=d);let f=d,p;t[2]===c?.Subnets?p=t[3]:(p=c?.Subnets??[],t[2]=c?.Subnets,t[3]=p);let m;t[4]===r?m=t[5]:(m=e=>e.VpcId===r,t[4]=r,t[5]=m);let h=p.filter(m),g;t[6]===l?.InstanceTypes?g=t[7]:(g=l?.InstanceTypes??[],t[6]=l?.InstanceTypes,t[7]=g);let _=g,x;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=ce(D),t[8]=x):x=t[8];let S;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(S={resolver:x,defaultValues:{nodegroupName:``,nodeRole:``,subnetIds:[],instanceTypes:`t3.medium`,amiType:`AL2_x86_64`,capacityType:`ON_DEMAND`,diskSize:20,minSize:1,desiredSize:2,maxSize:3}},t[9]=S):S=t[9];let{control:C,formState:T,handleSubmit:E,register:O,reset:A,setValue:j}=oe(S),{errors:M}=T,N;t[10]===C?N=t[11]:(N={control:C,name:`subnetIds`},t[10]=C,t[11]=N);let F=ae(N),I;t[12]===F?I=t[13]:(I=new Set(F),t[12]=F,t[13]=I);let L=I,R;t[14]===C?R=t[15]:(R={control:C,name:`instanceTypes`},t[14]=C,t[15]=R);let z=ae(R),B;t[16]!==_||t[17]!==z?(B=Qe(z,_),t[16]=_,t[17]=z,t[18]=B):B=t[18];let V=B,H;t[19]!==F||t[20]!==j?(H=e=>{let t=F.includes(e)?F.filter(t=>t!==e):[...F,e];j(`subnetIds`,t,{shouldValidate:!0})},t[19]=F,t[20]=j,t[21]=H):H=t[21];let U=H,W;t[22]!==n||t[23]!==u||t[24]!==o||t[25]!==A?(W=async e=>{await u.mutateAsync({clusterName:n,nodegroupName:e.nodegroupName,nodeRole:e.nodeRole,subnetIds:e.subnetIds,instanceTypes:e.instanceTypes.split(`,`).map(at).filter(Boolean),amiType:e.amiType,capacityType:e.capacityType,diskSize:e.diskSize,minSize:e.minSize,desiredSize:e.desiredSize,maxSize:e.maxSize}),A(),o(!1)},t[22]=n,t[23]=u,t[24]=o,t[25]=A,t[26]=W):W=t[26];let ee=W,te=ye,ne=pe,G;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Z.jsx)(ve,{children:(0,Z.jsx)(me,{children:`Add node group`})}),t[27]=G):G=t[27];let re;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-name`,children:`Name`})}),t[28]=re):re=t[28];let le=!!M.nodegroupName,ue;t[29]===O?ue=t[30]:(ue=O(`nodegroupName`),t[29]=O,t[30]=ue);let be;t[31]!==le||t[32]!==ue?(be=(0,Z.jsx)(v,{"aria-invalid":le,id:`ng-name`,placeholder:`my-nodegroup`,...ue}),t[31]=le,t[32]=ue,t[33]=be):be=t[33];let J;t[34]===M.nodegroupName?J=t[35]:(J=(0,Z.jsx)(fe,{errors:[M.nodegroupName]}),t[34]=M.nodegroupName,t[35]=J);let Y;t[36]!==be||t[37]!==J?(Y=(0,Z.jsxs)(q,{children:[re,be,J]}),t[36]=be,t[37]=J,t[38]=Y):Y=t[38];let xe;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-role`,children:`Node IAM role`})}),t[39]=xe):xe=t[39];let Ce=!!M.nodeRole,we;t[40]===O?we=t[41]:(we=O(`nodeRole`),t[40]=O,t[41]=we);let Te;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(`option`,{value:``,children:`Select role`}),t[42]=Te):Te=t[42];let Ee;t[43]===f?Ee=t[44]:(Ee=f.map(it),t[43]=f,t[44]=Ee);let De;t[45]!==Ce||t[46]!==we||t[47]!==Ee?(De=(0,Z.jsxs)(`select`,{"aria-invalid":Ce,className:`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`,id:`ng-role`,...we,children:[Te,Ee]}),t[45]=Ce,t[46]=we,t[47]=Ee,t[48]=De):De=t[48];let Oe;t[49]===M.nodeRole?Oe=t[50]:(Oe=(0,Z.jsx)(fe,{errors:[M.nodeRole]}),t[49]=M.nodeRole,t[50]=Oe);let X;t[51]!==De||t[52]!==Oe?(X=(0,Z.jsxs)(q,{children:[xe,De,Oe]}),t[51]=De,t[52]=Oe,t[53]=X):X=t[53];let Ae=q,Q;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,Z.jsx)(K,{children:`Subnets`}),t[54]=Q):Q=t[54];let je=h.length===0?(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No subnets in the cluster VPC.`}):(0,Z.jsx)(`div`,{className:`space-y-1`,children:h.map(e=>(0,Z.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,Z.jsx)(`input`,{"aria-label":`Subnet ${e.SubnetId}`,checked:L.has(e.SubnetId??``),onChange:()=>U(e.SubnetId??``),type:`checkbox`}),(0,Z.jsxs)(`span`,{className:`font-mono`,children:[e.SubnetId,` · `,e.CidrBlock]})]},e.SubnetId))}),$;t[55]===M.subnetIds?$=t[56]:($=(0,Z.jsx)(fe,{errors:[M.subnetIds]}),t[55]=M.subnetIds,t[56]=$);let Me;t[57]!==Ae||t[58]!==Q||t[59]!==je||t[60]!==$?(Me=(0,Z.jsxs)(Ae,{children:[Q,je,$]}),t[57]=Ae,t[58]=Q,t[59]=je,t[60]=$,t[61]=Me):Me=t[61];let Ne;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-instance-type`,children:`Instance type`})}),t[62]=Ne):Ne=t[62];let Pe;t[63]!==M.instanceTypes||t[64]!==_?(Pe=e=>{let{field:t}=e;return(0,Z.jsx)(Se,{"aria-invalid":!!M.instanceTypes,id:`ng-instance-type`,instanceTypes:_,onValueChange:t.onChange,value:t.value})},t[63]=M.instanceTypes,t[64]=_,t[65]=Pe):Pe=t[65];let Fe;t[66]!==C||t[67]!==Pe?(Fe=(0,Z.jsx)(se,{control:C,name:`instanceTypes`,render:Pe}),t[66]=C,t[67]=Pe,t[68]=Fe):Fe=t[68];let Ie;t[69]===V?Ie=t[70]:(Ie=V&&(0,Z.jsxs)(de,{children:[`GPU node AMI is auto-selected for this instance type. This node group is tainted `,(0,Z.jsx)(`code`,{children:`nvidia.com/gpu=present:NoSchedule`}),` `,`by default, so ordinary pods won't schedule onto GPU workers.`]}),t[69]=V,t[70]=Ie);let Le;t[71]===M.instanceTypes?Le=t[72]:(Le=(0,Z.jsx)(fe,{errors:[M.instanceTypes]}),t[71]=M.instanceTypes,t[72]=Le);let Re;t[73]!==Fe||t[74]!==Ie||t[75]!==Le?(Re=(0,Z.jsxs)(q,{children:[Ne,Fe,Ie,Le]}),t[73]=Fe,t[74]=Ie,t[75]=Le,t[76]=Re):Re=t[76];let ze;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-ami`,children:`AMI type`})}),t[77]=ze):ze=t[77];let Be;t[78]===O?Be=t[79]:(Be=O(`amiType`),t[78]=O,t[79]=Be);let Ve;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=P.map(rt),t[80]=Ve):Ve=t[80];let He;t[81]===Be?He=t[82]:(He=(0,Z.jsxs)(q,{children:[ze,(0,Z.jsx)(`select`,{className:`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`,id:`ng-ami`,...Be,children:Ve})]}),t[81]=Be,t[82]=He);let Ue;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-capacity`,children:`Capacity type`})}),t[83]=Ue):Ue=t[83];let We;t[84]===O?We=t[85]:(We=O(`capacityType`),t[84]=O,t[85]=We);let Ge;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=k.map(nt),t[86]=Ge):Ge=t[86];let Ke;t[87]===We?Ke=t[88]:(Ke=(0,Z.jsxs)(q,{children:[Ue,(0,Z.jsx)(`select`,{className:`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`,id:`ng-capacity`,...We,children:Ge})]}),t[87]=We,t[88]=Ke);let qe;t[89]!==He||t[90]!==Ke?(qe=(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[He,Ke]}),t[89]=He,t[90]=Ke,t[91]=qe):qe=t[91];let Je;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-disk`,children:`Disk (GB)`})}),t[92]=Je):Je=t[92];let Ye;t[93]===O?Ye=t[94]:(Ye=O(`diskSize`,{valueAsNumber:!0}),t[93]=O,t[94]=Ye);let Xe;t[95]===Ye?Xe=t[96]:(Xe=(0,Z.jsxs)(q,{children:[Je,(0,Z.jsx)(v,{id:`ng-disk`,type:`number`,...Ye})]}),t[95]=Ye,t[96]=Xe);let Ze;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-min`,children:`Min`})}),t[97]=Ze):Ze=t[97];let $e;t[98]===O?$e=t[99]:($e=O(`minSize`,{valueAsNumber:!0}),t[98]=O,t[99]=$e);let et;t[100]===$e?et=t[101]:(et=(0,Z.jsxs)(q,{children:[Ze,(0,Z.jsx)(v,{id:`ng-min`,type:`number`,...$e})]}),t[100]=$e,t[101]=et);let tt;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-desired`,children:`Desired`})}),t[102]=tt):tt=t[102];let ot;t[103]===O?ot=t[104]:(ot=O(`desiredSize`,{valueAsNumber:!0}),t[103]=O,t[104]=ot);let st;t[105]===ot?st=t[106]:(st=(0,Z.jsxs)(q,{children:[tt,(0,Z.jsx)(v,{id:`ng-desired`,type:`number`,...ot})]}),t[105]=ot,t[106]=st);let ct;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-max`,children:`Max`})}),t[107]=ct):ct=t[107];let lt;t[108]===O?lt=t[109]:(lt=O(`maxSize`,{valueAsNumber:!0}),t[108]=O,t[109]=lt);let ut;t[110]===lt?ut=t[111]:(ut=(0,Z.jsxs)(q,{children:[ct,(0,Z.jsx)(v,{id:`ng-max`,type:`number`,...lt})]}),t[110]=lt,t[111]=ut);let dt;t[112]!==Xe||t[113]!==et||t[114]!==st||t[115]!==ut?(dt=(0,Z.jsxs)(`div`,{className:`grid grid-cols-4 gap-3`,children:[Xe,et,st,ut]}),t[112]=Xe,t[113]=et,t[114]=st,t[115]=ut,t[116]=dt):dt=t[116];let ft;t[117]===M.desiredSize?ft=t[118]:(ft=(0,Z.jsx)(fe,{errors:[M.desiredSize]}),t[117]=M.desiredSize,t[118]=ft);let pt;t[119]!==Y||t[120]!==X||t[121]!==Me||t[122]!==Re||t[123]!==qe||t[124]!==dt||t[125]!==ft?(pt=(0,Z.jsxs)(`form`,{className:`space-y-4`,id:`add-nodegroup-form`,children:[Y,X,Me,Re,qe,dt,ft]}),t[119]=Y,t[120]=X,t[121]=Me,t[122]=Re,t[123]=qe,t[124]=dt,t[125]=ft,t[126]=pt):pt=t[126];let mt;t[127]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,Z.jsx)(_e,{children:`Cancel`}),t[127]=mt):mt=t[127];let ht;t[128]!==E||t[129]!==ee?(ht=e=>{e.preventDefault(),E(ee)()},t[128]=E,t[129]=ee,t[130]=ht):ht=t[130];let gt=u.isPending?`Creating…`:`Create`,_t;t[131]!==u.isPending||t[132]!==ht||t[133]!==gt?(_t=(0,Z.jsxs)(ge,{children:[mt,(0,Z.jsx)(he,{disabled:u.isPending,onClick:ht,children:gt})]}),t[131]=u.isPending,t[132]=ht,t[133]=gt,t[134]=_t):_t=t[134];let vt;t[135]!==ne||t[136]!==G||t[137]!==pt||t[138]!==_t?(vt=(0,Z.jsxs)(ne,{className:`max-h-[85vh] overflow-y-auto`,children:[G,pt,_t]}),t[135]=ne,t[136]=G,t[137]=pt,t[138]=_t,t[139]=vt):vt=t[139];let yt;return t[140]!==te||t[141]!==o||t[142]!==a||t[143]!==vt?(yt=(0,Z.jsx)(te,{onOpenChange:o,open:a,children:vt}),t[140]=te,t[141]=o,t[142]=a,t[143]=vt,t[144]=yt):yt=t[144],yt}function nt(e){return(0,Z.jsx)(`option`,{value:e,children:e},e)}function rt(e){return(0,Z.jsx)(`option`,{value:e,children:e},e)}function it(e){return(0,Z.jsx)(`option`,{value:e.Arn??``,children:e.RoleName},e.Arn)}function at(e){return e.trim()}function ot(e){let t=(0,ke.c)(27),{clusterName:n,clusterVersion:r,vpcId:i}=e,o;t[0]===n?o=t[1]:(o=re(n),t[0]=n,t[1]=o);let{data:s}=a(o),c=z(),[l,u]=(0,X.useState)(!1),[d,f]=(0,X.useState)(),p;t[2]===s.nodegroups?p=t[3]:(p=s.nodegroups??[],t[2]=s.nodegroups,t[3]=p);let m=p,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,Z.jsx)(_,{onClick:()=>u(!0),size:`sm`,children:`Add node group`})}),t[4]=h):h=t[4];let g;t[5]!==n||t[6]!==r||t[7]!==m?(g=m.length>0?(0,Z.jsx)(`div`,{className:`space-y-4`,children:m.map(e=>(0,Z.jsx)(et,{clusterName:n,clusterVersion:r,nodegroupName:e,onDelete:f},e))}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`No node groups.`}),t[5]=n,t[6]=r,t[7]=m,t[8]=g):g=t[8];let v;t[9]!==n||t[10]!==l||t[11]!==i?(v=(0,Z.jsx)(tt,{clusterName:n,onOpenChange:u,open:l,vpcId:i}),t[9]=n,t[10]=l,t[11]=i,t[12]=v):v=t[12];let y=`Delete node group "${d??``}"? This terminates its nodes.`,b;t[13]!==n||t[14]!==c||t[15]!==d?(b=()=>{d&&c.mutate({clusterName:n,nodegroupName:d},{onSuccess:()=>f(void 0)})},t[13]=n,t[14]=c,t[15]=d,t[16]=b):b=t[16];let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>!e&&f(void 0),t[17]=x):x=t[17];let S=d!==void 0,C;t[18]!==c.isPending||t[19]!==y||t[20]!==b||t[21]!==S?(C=(0,Z.jsx)(be,{description:y,isPending:c.isPending,onConfirm:b,onOpenChange:x,open:S,title:`Delete node group`}),t[18]=c.isPending,t[19]=y,t[20]=b,t[21]=S,t[22]=C):C=t[22];let w;return t[23]!==C||t[24]!==g||t[25]!==v?(w=(0,Z.jsxs)(Z.Fragment,{children:[h,g,v,C]}),t[23]=C,t[24]=g,t[25]=v,t[26]=w):w=t[26],w}function st(e){switch(e??``){case`ACTIVE`:return`default`;case`FAILED`:return`destructive`;default:return`secondary`}}function ct(e){let t=(0,ke.c)(101),{clusterName:n}=e,r=s(),[i,o]=(0,X.useState)(!1),d;t[0]===n?d=t[1]:(d=ne(n),t[0]=n,t[1]=d);let{data:f}=a(d),p=T(),{cluster:v}=f,y;t[2]===v?.health?.issues?y=t[3]:(y=v?.health?.issues??[],t[2]=v?.health?.issues,t[3]=y);let b=y,x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x={type:`bin`,value:`aws eks update-kubeconfig`},t[4]=x):x=t[4];let S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S={type:`flag`,value:` --name `},t[5]=S):S=t[5];let C;t[6]===n?C=t[7]:(C={type:`value`,value:n},t[6]=n,t[7]=C);let w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w={type:`flag`,value:` --region `},t[8]=w):w=t[8];let E;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(E={type:`value`,value:l()},t[9]=E):E=t[9];let D;t[10]===C?D=t[11]:(D={label:`Configure kubectl`,parts:[x,S,C,w,E]},t[10]=C,t[11]=D);let O;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(O={label:`Verify access`,parts:[{type:`bin`,value:`kubectl get nodes`}]},t[12]=O):O=t[12];let k;t[13]===D?k=t[14]:(k=[D,O],t[13]=D,t[14]=k);let A=k,j;t[15]!==n||t[16]!==p||t[17]!==r?(j=function(){p.mutate(n,{onSuccess:()=>{r({to:`/eks/list-clusters`})}})},t[15]=n,t[16]=p,t[17]=r,t[18]=j):j=t[18];let M=j,N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(u,{to:`/eks/list-clusters`,children:`Clusters`}),t[19]=N):N=t[19];let P;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>o(!0),t[20]=P):P=t[20];let F;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsxs)(_,{onClick:P,size:`sm`,variant:`destructive`,children:[(0,Z.jsx)(h,{className:`size-4`}),`Delete`]}),t[21]=F):F=t[21];let I=v?.status,L;t[22]===I?L=t[23]:(L=st(I),t[22]=I,t[23]=L);let R=v?.status??`UNKNOWN`,z;t[24]!==L||t[25]!==R?(z=(0,Z.jsx)(Ce,{variant:L,children:R}),t[24]=L,t[25]=R,t[26]=z):z=t[26];let B;t[27]===b.length?B=t[28]:(B=b.length>0&&(0,Z.jsxs)(Ce,{variant:`destructive`,children:[(0,Z.jsx)(g,{className:`size-3`}),b.length===1?`1 health issue`:`${b.length} health issues`]}),t[27]=b.length,t[28]=B);let V;t[29]!==z||t[30]!==B?(V=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[F,z,B]}),t[29]=z,t[30]=B,t[31]=V):V=t[31];let H;t[32]!==n||t[33]!==V?(H=(0,Z.jsx)(ue,{actions:V,subtitle:`Cluster Details`,title:n}),t[32]=n,t[33]=V,t[34]=H):H=t[34];let U;t[35]!==p.error||t[36]!==p.isError?(U=p.isError&&(0,Z.jsx)(le,{error:p.error instanceof Error?p.error:void 0,msg:`Failed to delete cluster.`}),t[35]=p.error,t[36]=p.isError,t[37]=U):U=t[37];let W;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsxs)(Te,{children:[(0,Z.jsx)(we,{value:`overview`,children:`Overview`}),(0,Z.jsx)(we,{value:`compute`,children:`Compute`}),(0,Z.jsx)(we,{value:`addons`,children:`Add-ons`}),(0,Z.jsx)(we,{value:`access`,children:`Access`}),(0,Z.jsx)(we,{value:`networking`,children:`Networking`}),(0,Z.jsx)(we,{value:`connect`,children:`Connect`})]}),t[38]=W):W=t[38];let ee;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(J.Header,{children:`Cluster`}),t[39]=ee):ee=t[39];let te=v?.arn,G;t[40]===te?G=t[41]:(G=(0,Z.jsx)(Y,{label:`ARN`,value:te}),t[40]=te,t[41]=G);let re=v?.status,ie;t[42]===re?ie=t[43]:(ie=(0,Z.jsx)(Y,{label:`Status`,value:re}),t[42]=re,t[43]=ie);let ae;t[44]===b?ae=t[45]:(ae=b.length>0?b.map(lt).filter(Boolean).join(`; `):`OK`,t[44]=b,t[45]=ae);let oe;t[46]===ae?oe=t[47]:(oe=(0,Z.jsx)(Y,{label:`Health`,value:ae}),t[46]=ae,t[47]=oe);let se=v?.version,ce;t[48]===se?ce=t[49]:(ce=(0,Z.jsx)(Y,{label:`Kubernetes version`,value:se}),t[48]=se,t[49]=ce);let K=v?.platformVersion,de;t[50]===K?de=t[51]:(de=(0,Z.jsx)(Y,{label:`Platform version`,value:K}),t[50]=K,t[51]=de);let fe=v?.endpoint,q;t[52]===fe?q=t[53]:(q=(0,Z.jsx)(Y,{label:`Endpoint`,value:fe}),t[52]=fe,t[53]=q);let pe=v?.identity?.oidc?.issuer,me;t[54]===pe?me=t[55]:(me=(0,Z.jsx)(Y,{label:`OIDC issuer`,value:pe}),t[54]=pe,t[55]=me);let he=v?.resourcesVpcConfig?.vpcId,ge;t[56]===he?ge=t[57]:(ge=(0,Z.jsx)(Y,{label:`VPC`,value:he}),t[56]=he,t[57]=ge);let _e=v?.createdAt,ve;t[58]===_e?ve=t[59]:(ve=c(_e),t[58]=_e,t[59]=ve);let ye;t[60]===ve?ye=t[61]:(ye=(0,Z.jsx)(Y,{label:`Created at`,value:ve}),t[60]=ve,t[61]=ye);let xe;t[62]!==G||t[63]!==ie||t[64]!==oe||t[65]!==ce||t[66]!==de||t[67]!==q||t[68]!==me||t[69]!==ge||t[70]!==ye?(xe=(0,Z.jsx)(Ee,{value:`overview`,children:(0,Z.jsxs)(J,{children:[ee,(0,Z.jsxs)(J.Content,{children:[G,ie,oe,ce,de,q,me,ge,ye]})]})}),t[62]=G,t[63]=ie,t[64]=oe,t[65]=ce,t[66]=de,t[67]=q,t[68]=me,t[69]=ge,t[70]=ye,t[71]=xe):xe=t[71];let Se=v?.version,Oe=v?.resourcesVpcConfig?.vpcId,Ae;t[72]!==n||t[73]!==Se||t[74]!==Oe?(Ae=(0,Z.jsx)(Ee,{value:`compute`,children:(0,Z.jsx)(ot,{clusterName:n,clusterVersion:Se,vpcId:Oe})}),t[72]=n,t[73]=Se,t[74]=Oe,t[75]=Ae):Ae=t[75];let Q;t[76]===n?Q=t[77]:(Q=(0,Z.jsx)(Ee,{value:`addons`,children:(0,Z.jsx)(Ge,{clusterName:n})}),t[76]=n,t[77]=Q);let je;t[78]===n?je=t[79]:(je=(0,Z.jsx)(Ee,{value:`access`,children:(0,Z.jsx)(Ne,{clusterName:n})}),t[78]=n,t[79]=je);let $;t[80]===v?$=t[81]:($=(0,Z.jsx)(Ee,{value:`networking`,children:(0,Z.jsx)(qe,{cluster:v})}),t[80]=v,t[81]=$);let Me;t[82]===A?Me=t[83]:(Me=(0,Z.jsx)(Ee,{value:`connect`,children:(0,Z.jsx)(m,{commands:A})}),t[82]=A,t[83]=Me);let Pe;t[84]!==xe||t[85]!==Ae||t[86]!==Q||t[87]!==je||t[88]!==$||t[89]!==Me?(Pe=(0,Z.jsxs)(De,{defaultValue:`overview`,children:[W,xe,Ae,Q,je,$,Me]}),t[84]=xe,t[85]=Ae,t[86]=Q,t[87]=je,t[88]=$,t[89]=Me,t[90]=Pe):Pe=t[90];let Fe=`This permanently deletes cluster "${n}" and its control plane. This cannot be undone.`,Ie;t[91]!==p.isPending||t[92]!==M||t[93]!==i||t[94]!==Fe?(Ie=(0,Z.jsx)(be,{description:Fe,isPending:p.isPending,onConfirm:M,onOpenChange:o,open:i,title:`Delete cluster`}),t[91]=p.isPending,t[92]=M,t[93]=i,t[94]=Fe,t[95]=Ie):Ie=t[95];let Le;return t[96]!==H||t[97]!==U||t[98]!==Pe||t[99]!==Ie?(Le=(0,Z.jsxs)(Z.Fragment,{children:[N,H,U,Pe,Ie]}),t[96]=H,t[97]=U,t[98]=Pe,t[99]=Ie,t[100]=Le):Le=t[100],Le}function lt(e){return e.message}function ut(){let e=(0,ke.c)(2),{clusterName:t}=p.useParams(),n;return e[0]===t?n=e[1]:(n=(0,Z.jsx)(ct,{clusterName:t}),e[0]=t,e[1]=n),n}export{ut as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{t as s}from"./useNavigate.js";import{$t as c,t as l}from"./cluster-config.js";import{t as u}from"./back-link.js";import{t as d}from"./circle-arrow-up.js";import{n as f,t as p}from"./_clusterName.js";import{t as m}from"./cli-command-panel.js";import{t as h}from"./trash-2.js";import{t as g}from"./triangle-alert.js";import{t as _}from"./button.js";import{t as v}from"./input.js";import{O as y,c as b}from"./ec2.js";import{C as x,S,T as C,_ as w,b as T,c as E,f as D,h as O,i as k,l as A,m as j,n as M,p as N,r as P,s as F,u as I,v as L,w as R,x as z,y as B}from"./eks.js";import{a as V,i as H,l as U,n as W,o as ee,r as te,s as ne,t as G,u as re}from"./eks2.js";import{y as ie}from"./iam2.js";import{a as ae,i as oe,n as se,t as ce}from"./zod.js";import{t as le}from"./error-banner.js";import{t as ue}from"./page-heading.js";import{a as K,n as de,r as fe,t as q}from"./field.js";import{i as pe,l as me,n as he,o as ge,r as _e,s as ve,t as ye}from"./alert-dialog.js";import{t as be}from"./delete-confirmation-dialog.js";import{n as J,t as Y}from"./detail-row.js";import{n as xe,t as Se}from"./gpu-instance-type-select.js";import{t as Ce}from"./badge.js";import{i as we,n as Te,r as Ee,t as De}from"./tabs.js";import{t as Oe}from"./json-editor.js";var ke=r(),X=e(n(),1),Z=t();function Ae(e){return e?.split(`/`).pop()??e??``}function Q(e){let t=(0,ke.c)(55),{clusterName:n,principalArn:r,onDelete:a}=e,o;t[0]!==n||t[1]!==r?(o=W(n,r),t[0]=n,t[1]=r,t[2]=o):o=t[2];let{data:s}=i(o),c;t[3]!==n||t[4]!==r?(c=ee(n,r),t[3]=n,t[4]=r,t[5]=c):c=t[5];let{data:l}=i(c),u=N(),d=S(),[f,p]=(0,X.useState)(M[0].arn),m=s?.accessEntry,g;t[6]===l?.associatedAccessPolicies?g=t[7]:(g=l?.associatedAccessPolicies??[],t[6]=l?.associatedAccessPolicies,t[7]=g);let v=g,y;t[8]===r?y=t[9]:(y=(0,Z.jsx)(`span`,{className:`truncate font-mono text-xs`,children:r}),t[8]=r,t[9]=y);let b;t[10]!==a||t[11]!==r?(b=()=>{a(r)},t[10]=a,t[11]=r,t[12]=b):b=t[12];let x;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(h,{className:`size-4`}),t[13]=x):x=t[13];let C;t[14]===b?C=t[15]:(C=(0,Z.jsx)(_,{onClick:b,size:`icon`,variant:`ghost`,children:x}),t[14]=b,t[15]=C);let w;t[16]!==y||t[17]!==C?(w=(0,Z.jsx)(J.Header,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[y,C]})}),t[16]=y,t[17]=C,t[18]=w):w=t[18];let T=m?.type,E;t[19]===T?E=t[20]:(E=(0,Z.jsx)(Y,{label:`Type`,value:T}),t[19]=T,t[20]=E);let D;t[21]===m?D=t[22]:(D=m?.kubernetesGroups?.length?m.kubernetesGroups.join(`, `):`—`,t[21]=m,t[22]=D);let O;t[23]===D?O=t[24]:(O=(0,Z.jsx)(Y,{label:`Kubernetes groups`,value:D}),t[23]=D,t[24]=O);let k;t[25]!==v||t[26]!==n||t[27]!==d||t[28]!==r?(k=v.length>0?(0,Z.jsx)(`div`,{className:`space-y-1`,children:v.map(e=>(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{children:Ae(e.policyArn)}),(0,Z.jsx)(_,{onClick:()=>{d.mutate({clusterName:n,principalArn:r,policyArn:e.policyArn??``})},size:`sm`,variant:`ghost`,children:`Remove`})]},e.policyArn))}):`—`,t[25]=v,t[26]=n,t[27]=d,t[28]=r,t[29]=k):k=t[29];let A;t[30]===k?A=t[31]:(A=(0,Z.jsx)(Y,{label:`Access policies`,value:k}),t[30]=k,t[31]=A);let j;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{p(e.target.value)},t[32]=j):j=t[32];let P;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(P=M.map(je),t[33]=P):P=t[33];let F;t[34]===f?F=t[35]:(F=(0,Z.jsx)(`select`,{"aria-label":`Access policy`,className:`h-7 flex-1 rounded-md border border-input bg-input/20 px-2 text-sm`,onChange:j,value:f,children:P}),t[34]=f,t[35]=F);let I;t[36]!==u||t[37]!==n||t[38]!==f||t[39]!==r?(I=()=>{u.mutate({clusterName:n,principalArn:r,policyArn:f,accessScopeType:`cluster`})},t[36]=u,t[37]=n,t[38]=f,t[39]=r,t[40]=I):I=t[40];let L;t[41]!==u.isPending||t[42]!==I?(L=(0,Z.jsx)(_,{disabled:u.isPending,onClick:I,size:`sm`,children:`Associate`}),t[41]=u.isPending,t[42]=I,t[43]=L):L=t[43];let R;t[44]!==F||t[45]!==L?(R=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 pt-2`,children:[F,L]}),t[44]=F,t[45]=L,t[46]=R):R=t[46];let z;t[47]!==E||t[48]!==O||t[49]!==A||t[50]!==R?(z=(0,Z.jsxs)(J.Content,{children:[E,O,A,R]}),t[47]=E,t[48]=O,t[49]=A,t[50]=R,t[51]=z):z=t[51];let B;return t[52]!==z||t[53]!==w?(B=(0,Z.jsxs)(J,{children:[w,z]}),t[52]=z,t[53]=w,t[54]=B):B=t[54],B}function je(e){return(0,Z.jsx)(`option`,{value:e.arn,children:e.name},e.arn)}function $(e){let t=(0,ke.c)(41),{clusterName:n,open:r,onOpenChange:i}=e,a=j(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={resolver:ce(A),defaultValues:{principalArn:``,kubernetesGroups:``}},t[0]=o):o=t[0];let{formState:s,handleSubmit:c,register:l,reset:u}=oe(o),{errors:d}=s,f;t[1]!==n||t[2]!==a||t[3]!==i||t[4]!==u?(f=async e=>{await a.mutateAsync({clusterName:n,principalArn:e.principalArn,kubernetesGroups:e.kubernetesGroups.split(`,`).map(Me).filter(Boolean)}),u(),i(!1)},t[1]=n,t[2]=a,t[3]=i,t[4]=u,t[5]=f):f=t[5];let p=f,m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(ve,{children:(0,Z.jsx)(me,{children:`Add access entry`})}),t[6]=m):m=t[6];let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ae-principal`,children:`IAM principal ARN`})}),t[7]=h):h=t[7];let g=!!d.principalArn,_;t[8]===l?_=t[9]:(_=l(`principalArn`),t[8]=l,t[9]=_);let y;t[10]!==g||t[11]!==_?(y=(0,Z.jsx)(v,{"aria-invalid":g,id:`ae-principal`,placeholder:`arn:aws:iam::000000000000:role/my-role`,..._}),t[10]=g,t[11]=_,t[12]=y):y=t[12];let b;t[13]===d.principalArn?b=t[14]:(b=(0,Z.jsx)(fe,{errors:[d.principalArn]}),t[13]=d.principalArn,t[14]=b);let x;t[15]!==y||t[16]!==b?(x=(0,Z.jsxs)(q,{children:[h,y,b]}),t[15]=y,t[16]=b,t[17]=x):x=t[17];let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ae-groups`,children:`Kubernetes groups`})}),t[18]=S):S=t[18];let C;t[19]===l?C=t[20]:(C=l(`kubernetesGroups`),t[19]=l,t[20]=C);let w;t[21]===C?w=t[22]:(w=(0,Z.jsxs)(q,{children:[S,(0,Z.jsx)(v,{id:`ae-groups`,placeholder:`system:masters`,...C})]}),t[21]=C,t[22]=w);let T;t[23]!==x||t[24]!==w?(T=(0,Z.jsxs)(`form`,{className:`space-y-4`,id:`add-access-entry-form`,children:[x,w]}),t[23]=x,t[24]=w,t[25]=T):T=t[25];let E;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(_e,{children:`Cancel`}),t[26]=E):E=t[26];let D;t[27]!==c||t[28]!==p?(D=e=>{e.preventDefault(),c(p)()},t[27]=c,t[28]=p,t[29]=D):D=t[29];let O=a.isPending?`Creating…`:`Create`,k;t[30]!==a.isPending||t[31]!==D||t[32]!==O?(k=(0,Z.jsxs)(ge,{children:[E,(0,Z.jsx)(he,{disabled:a.isPending,onClick:D,children:O})]}),t[30]=a.isPending,t[31]=D,t[32]=O,t[33]=k):k=t[33];let M;t[34]!==T||t[35]!==k?(M=(0,Z.jsxs)(pe,{children:[m,T,k]}),t[34]=T,t[35]=k,t[36]=M):M=t[36];let N;return t[37]!==i||t[38]!==r||t[39]!==M?(N=(0,Z.jsx)(ye,{onOpenChange:i,open:r,children:M}),t[37]=i,t[38]=r,t[39]=M,t[40]=N):N=t[40],N}function Me(e){return e.trim()}function Ne(e){let t=(0,ke.c)(25),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=G(n),t[0]=n,t[1]=r);let{data:i}=a(r),o=L(),[s,c]=(0,X.useState)(!1),[l,u]=(0,X.useState)(),d;t[2]===i.accessEntries?d=t[3]:(d=i.accessEntries??[],t[2]=i.accessEntries,t[3]=d);let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,Z.jsx)(_,{onClick:()=>{c(!0)},size:`sm`,children:`Add access entry`})}),t[4]=p):p=t[4];let m;t[5]!==n||t[6]!==f?(m=f.length>0?(0,Z.jsx)(`div`,{className:`space-y-4`,children:f.map(e=>(0,Z.jsx)(Q,{clusterName:n,onDelete:u,principalArn:e},e))}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`No access entries.`}),t[5]=n,t[6]=f,t[7]=m):m=t[7];let h;t[8]!==n||t[9]!==s?(h=(0,Z.jsx)($,{clusterName:n,onOpenChange:c,open:s}),t[8]=n,t[9]=s,t[10]=h):h=t[10];let g=`Delete access entry for "${l??``}"?`,v;t[11]!==n||t[12]!==o||t[13]!==l?(v=()=>{l&&o.mutate({clusterName:n,principalArn:l},{onSuccess:()=>{u(void 0)}})},t[11]=n,t[12]=o,t[13]=l,t[14]=v):v=t[14];let y;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{e||u(void 0)},t[15]=y):y=t[15];let b=l!==void 0,x;t[16]!==o.isPending||t[17]!==g||t[18]!==v||t[19]!==b?(x=(0,Z.jsx)(be,{description:g,isPending:o.isPending,onConfirm:v,onOpenChange:y,open:b,title:`Delete access entry`}),t[16]=o.isPending,t[17]=g,t[18]=v,t[19]=b,t[20]=x):x=t[20];let S;return t[21]!==x||t[22]!==m||t[23]!==h?(S=(0,Z.jsxs)(Z.Fragment,{children:[p,m,h,x]}),t[21]=x,t[22]=m,t[23]=h,t[24]=S):S=t[24],S}var Pe=new Set([`CREATING`,`UPDATING`,`DELETING`]),Fe=5e3,Ie=`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`;function Le(e){let t=(0,ke.c)(97),{clusterName:n,catalog:r,installed:i,open:a,onOpenChange:o}=e,s=O(),c;t[0]===i?c=t[1]:(c=new Set(i),t[0]=i,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=e=>!l.has(e.addonName??``),t[2]=l,t[3]=u);let d=r.filter(u),f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f={resolver:ce(I),defaultValues:{addonName:``,addonVersion:``,serviceAccountRoleArn:``,configurationValues:``}},t[4]=f):f=t[4];let{control:p,formState:m,handleSubmit:h,register:g,reset:_,setValue:y}=oe(f),{errors:b}=m,x;t[5]===p?x=t[6]:(x={control:p,name:`addonName`},t[5]=p,t[6]=x);let S=ae(x),C;t[7]===p?C=t[8]:(C={control:p,name:`addonVersion`},t[7]=p,t[8]=C);let w=ae(C),T;t[9]===S?T=t[10]:(T=e=>e.addonName===S,t[9]=S,t[10]=T);let E=r.find(T)?.addonVersions??[],D;t[11]===w?D=t[12]:(D=e=>e.addonVersion===w,t[11]=w,t[12]=D);let k=E.find(D)?.requiresIamPermissions??!1,A;t[13]!==r||t[14]!==y?(A=e=>{let t=r.find(t=>t.addonName===e)?.addonVersions?.[0]?.addonVersion??``;y(`addonName`,e,{shouldValidate:!0}),y(`addonVersion`,t,{shouldValidate:!0})},t[13]=r,t[14]=y,t[15]=A):A=t[15];let j=A,M;t[16]!==n||t[17]!==s||t[18]!==o||t[19]!==_?(M=async e=>{await s.mutateAsync({clusterName:n,addonName:e.addonName,addonVersion:e.addonVersion||void 0,serviceAccountRoleArn:e.serviceAccountRoleArn.trim()||void 0,configurationValues:e.configurationValues.trim()||void 0}),_(),o(!1)},t[16]=n,t[17]=s,t[18]=o,t[19]=_,t[20]=M):M=t[20];let N=M,P=ye,F=pe,L;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(ve,{children:(0,Z.jsx)(me,{children:`Add add-on`})}),t[21]=L):L=t[21];let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`addon-name`,children:`Add-on`})}),t[22]=R):R=t[22];let z=!!b.addonName,B;t[23]===j?B=t[24]:(B=e=>{j(e.target.value)},t[23]=j,t[24]=B);let V;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(`option`,{value:``,children:`Select add-on`}),t[25]=V):V=t[25];let H=d.map(ze),U;t[26]!==S||t[27]!==z||t[28]!==B||t[29]!==H?(U=(0,Z.jsxs)(`select`,{"aria-invalid":z,className:Ie,id:`addon-name`,onChange:B,value:S,children:[V,H]}),t[26]=S,t[27]=z,t[28]=B,t[29]=H,t[30]=U):U=t[30];let W;t[31]===b.addonName?W=t[32]:(W=(0,Z.jsx)(fe,{errors:[b.addonName]}),t[31]=b.addonName,t[32]=W);let ee;t[33]!==U||t[34]!==W?(ee=(0,Z.jsxs)(q,{children:[R,U,W]}),t[33]=U,t[34]=W,t[35]=ee):ee=t[35];let te=q,ne;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`addon-version`,children:`Version`})}),t[36]=ne):ne=t[36];let G=!!b.addonVersion,re=Ie,ie=E.length===0,le;t[37]===y?le=t[38]:(le=e=>{y(`addonVersion`,e.target.value,{shouldValidate:!0})},t[37]=y,t[38]=le);let ue=E.map(Re),de;t[39]!==w||t[40]!==G||t[41]!==re||t[42]!==ie||t[43]!==le||t[44]!==ue?(de=(0,Z.jsx)(`select`,{"aria-invalid":G,className:re,disabled:ie,id:`addon-version`,onChange:le,value:w,children:ue}),t[39]=w,t[40]=G,t[41]=re,t[42]=ie,t[43]=le,t[44]=ue,t[45]=de):de=t[45];let be;t[46]===b.addonVersion?be=t[47]:(be=(0,Z.jsx)(fe,{errors:[b.addonVersion]}),t[46]=b.addonVersion,t[47]=be);let J;t[48]!==te||t[49]!==ne||t[50]!==de||t[51]!==be?(J=(0,Z.jsxs)(te,{children:[ne,de,be]}),t[48]=te,t[49]=ne,t[50]=de,t[51]=be,t[52]=J):J=t[52];let Y;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`addon-role`,children:`Service account IAM role ARN`})}),t[53]=Y):Y=t[53];let xe;t[54]===g?xe=t[55]:(xe=g(`serviceAccountRoleArn`),t[54]=g,t[55]=xe);let Se;t[56]===xe?Se=t[57]:(Se=(0,Z.jsx)(v,{id:`addon-role`,placeholder:`arn:aws:iam::…:role/…`,...xe}),t[56]=xe,t[57]=Se);let Ce;t[58]===k?Ce=t[59]:(Ce=k&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This add-on needs IAM permissions — provide an IRSA role ARN.`}),t[58]=k,t[59]=Ce);let we;t[60]!==Se||t[61]!==Ce?(we=(0,Z.jsxs)(q,{children:[Y,Se,Ce]}),t[60]=Se,t[61]=Ce,t[62]=we):we=t[62];let Te;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`addon-config`,children:`Configuration values (JSON)`})}),t[63]=Te):Te=t[63];let Ee;t[64]===b.configurationValues?Ee=t[65]:(Ee=e=>{let{field:t}=e,{onBlur:n,onChange:r,ref:i,value:a}=t;return(0,Z.jsx)(Oe,{error:!!b.configurationValues,id:`addon-config`,onBlur:n,onChange:r,placeholder:`{"replicaCount": 2}`,ref:i,rows:4,value:a})},t[64]=b.configurationValues,t[65]=Ee);let De;t[66]!==p||t[67]!==Ee?(De=(0,Z.jsx)(se,{control:p,name:`configurationValues`,render:Ee}),t[66]=p,t[67]=Ee,t[68]=De):De=t[68];let X;t[69]===b.configurationValues?X=t[70]:(X=(0,Z.jsx)(fe,{errors:[b.configurationValues]}),t[69]=b.configurationValues,t[70]=X);let Ae;t[71]!==De||t[72]!==X?(Ae=(0,Z.jsxs)(q,{children:[Te,De,X]}),t[71]=De,t[72]=X,t[73]=Ae):Ae=t[73];let Q;t[74]!==ee||t[75]!==J||t[76]!==we||t[77]!==Ae?(Q=(0,Z.jsxs)(`form`,{className:`space-y-4`,id:`add-addon-form`,children:[ee,J,we,Ae]}),t[74]=ee,t[75]=J,t[76]=we,t[77]=Ae,t[78]=Q):Q=t[78];let je;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,Z.jsx)(_e,{children:`Cancel`}),t[79]=je):je=t[79];let $;t[80]!==h||t[81]!==N?($=e=>{e.preventDefault(),h(N)()},t[80]=h,t[81]=N,t[82]=$):$=t[82];let Me=s.isPending?`Adding…`:`Add`,Ne;t[83]!==s.isPending||t[84]!==$||t[85]!==Me?(Ne=(0,Z.jsxs)(ge,{children:[je,(0,Z.jsx)(he,{disabled:s.isPending,onClick:$,children:Me})]}),t[83]=s.isPending,t[84]=$,t[85]=Me,t[86]=Ne):Ne=t[86];let Pe;t[87]!==F||t[88]!==L||t[89]!==Q||t[90]!==Ne?(Pe=(0,Z.jsxs)(F,{className:`max-h-[85vh] overflow-y-auto`,children:[L,Q,Ne]}),t[87]=F,t[88]=L,t[89]=Q,t[90]=Ne,t[91]=Pe):Pe=t[91];let Fe;return t[92]!==P||t[93]!==o||t[94]!==a||t[95]!==Pe?(Fe=(0,Z.jsx)(P,{onOpenChange:o,open:a,children:Pe}),t[92]=P,t[93]=o,t[94]=a,t[95]=Pe,t[96]=Fe):Fe=t[96],Fe}function Re(e,t){return(0,Z.jsxs)(`option`,{value:e.addonVersion??``,children:[e.addonVersion,t===0?` (latest)`:``]},e.addonVersion)}function ze(e){return(0,Z.jsx)(`option`,{value:e.addonName??``,children:e.addonName},e.addonName)}function Be(e){let t=(0,ke.c)(48),{clusterName:n,addonName:r,current:i,versions:a,open:o,onOpenChange:s}=e,c=R(),[l,u]=(0,X.useState)(i.addonVersion??``),[d,f]=(0,X.useState)(i.serviceAccountRoleArn??``),[p,m]=(0,X.useState)(i.configurationValues??``),[h,g]=(0,X.useState)(),[_,y]=(0,X.useState)(o);o!==_&&(y(o),o&&(u(i.addonVersion??``),f(i.serviceAccountRoleArn??``),m(i.configurationValues??``),g(void 0)));let b;t[0]!==r||t[1]!==n||t[2]!==p||t[3]!==s||t[4]!==d||t[5]!==c||t[6]!==l?(b=()=>{let e=F.safeParse(p);if(!e.success){g(e.error.issues[0]?.message??`Configuration must be valid JSON`);return}g(void 0),c.mutate({clusterName:n,addonName:r,addonVersion:l||void 0,serviceAccountRoleArn:d.trim()||void 0,configurationValues:p.trim()||void 0},{onSuccess:()=>{s(!1)}})},t[0]=r,t[1]=n,t[2]=p,t[3]=s,t[4]=d,t[5]=c,t[6]=l,t[7]=b):b=t[7];let x=b,S;t[8]===r?S=t[9]:(S=(0,Z.jsx)(ve,{children:(0,Z.jsxs)(me,{children:[`Update `,r]})}),t[8]=r,t[9]=S);let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`update-addon-version`,children:`Version`})}),t[10]=C):C=t[10];let w=a.length===0,T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{u(e.target.value)},t[11]=T):T=t[11];let E;t[12]===a?E=t[13]:(E=a.map(Ve),t[12]=a,t[13]=E);let D;t[14]!==w||t[15]!==E||t[16]!==l?(D=(0,Z.jsxs)(q,{children:[C,(0,Z.jsx)(`select`,{className:Ie,disabled:w,id:`update-addon-version`,onChange:T,value:l,children:E})]}),t[14]=w,t[15]=E,t[16]=l,t[17]=D):D=t[17];let O;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`update-addon-role`,children:`Service account IAM role ARN`})}),t[18]=O):O=t[18];let k;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>{f(e.target.value)},t[19]=k):k=t[19];let A;t[20]===d?A=t[21]:(A=(0,Z.jsxs)(q,{children:[O,(0,Z.jsx)(v,{id:`update-addon-role`,onChange:k,placeholder:`arn:aws:iam::…:role/…`,value:d})]}),t[20]=d,t[21]=A);let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`update-addon-config`,children:`Configuration values (JSON)`})}),t[22]=j):j=t[22];let M=!!h,N;t[23]!==p||t[24]!==M?(N=(0,Z.jsxs)(q,{children:[j,(0,Z.jsx)(Oe,{error:M,id:`update-addon-config`,onChange:m,rows:4,value:p})]}),t[23]=p,t[24]=M,t[25]=N):N=t[25];let P;t[26]!==A||t[27]!==N||t[28]!==D?(P=(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[D,A,N]}),t[26]=A,t[27]=N,t[28]=D,t[29]=P):P=t[29];let I;t[30]===h?I=t[31]:(I=h&&(0,Z.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:h}),t[30]=h,t[31]=I);let L;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(_e,{children:`Cancel`}),t[32]=L):L=t[32];let z;t[33]===x?z=t[34]:(z=e=>{e.preventDefault(),x()},t[33]=x,t[34]=z);let B=c.isPending?`Updating…`:`Update`,V;t[35]!==z||t[36]!==B||t[37]!==c.isPending?(V=(0,Z.jsxs)(ge,{children:[L,(0,Z.jsx)(he,{disabled:c.isPending,onClick:z,children:B})]}),t[35]=z,t[36]=B,t[37]=c.isPending,t[38]=V):V=t[38];let H;t[39]!==P||t[40]!==I||t[41]!==V||t[42]!==S?(H=(0,Z.jsxs)(pe,{className:`max-h-[85vh] overflow-y-auto`,children:[S,P,I,V]}),t[39]=P,t[40]=I,t[41]=V,t[42]=S,t[43]=H):H=t[43];let U;return t[44]!==s||t[45]!==o||t[46]!==H?(U=(0,Z.jsx)(ye,{onOpenChange:s,open:o,children:H}),t[44]=s,t[45]=o,t[46]=H,t[47]=U):U=t[47],U}function Ve(e){return(0,Z.jsx)(`option`,{value:e,children:e},e)}function He(e){let t=(0,ke.c)(53),{clusterName:n,addonName:r,catalog:a,onDelete:o}=e,s;t[0]!==r||t[1]!==n?(s=te(n,r),t[0]=r,t[1]=n,t[2]=s):s=t[2];let c;t[3]===s?c=t[4]:(c={...s,refetchInterval:We},t[3]=s,t[4]=c);let{data:l}=i(c),[u,f]=(0,X.useState)(!1),p=l?.addon,m=p?.health?.issues?.[0]?.message,g;t[5]!==r||t[6]!==a?(g=a.find(e=>e.addonName===r)?.addonVersions?.map(Ue).filter(Boolean)??[],t[5]=r,t[6]=a,t[7]=g):g=t[7];let v=g,y;t[8]===r?y=t[9]:(y=(0,Z.jsx)(`span`,{children:r}),t[8]=r,t[9]=y);let b=p?.status,x;t[10]===b?x=t[11]:(x=E(b),t[10]=b,t[11]=x);let S=p?.status??`UNKNOWN`,C;t[12]!==x||t[13]!==S?(C=(0,Z.jsx)(Ce,{variant:x,children:S}),t[12]=x,t[13]=S,t[14]=C):C=t[14];let w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{f(!0)},t[15]=w):w=t[15];let T;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(_,{"aria-label":`Update add-on`,onClick:w,size:`icon`,variant:`ghost`,children:(0,Z.jsx)(d,{className:`size-4`})}),t[16]=T):T=t[16];let D;t[17]!==r||t[18]!==o?(D=()=>{o(r)},t[17]=r,t[18]=o,t[19]=D):D=t[19];let O;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(h,{className:`size-4`}),t[20]=O):O=t[20];let k;t[21]===D?k=t[22]:(k=(0,Z.jsx)(_,{"aria-label":`Remove add-on`,onClick:D,size:`icon`,variant:`ghost`,children:O}),t[21]=D,t[22]=k);let A;t[23]!==k||t[24]!==C?(A=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[C,T,k]}),t[23]=k,t[24]=C,t[25]=A):A=t[25];let j;t[26]!==A||t[27]!==y?(j=(0,Z.jsx)(J.Header,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[y,A]})}),t[26]=A,t[27]=y,t[28]=j):j=t[28];let M=p?.addonVersion,N;t[29]===M?N=t[30]:(N=(0,Z.jsx)(Y,{label:`Version`,value:M}),t[29]=M,t[30]=N);let P=p?.serviceAccountRoleArn,F;t[31]===P?F=t[32]:(F=(0,Z.jsx)(Y,{label:`IRSA role`,value:P}),t[31]=P,t[32]=F);let I;t[33]===m?I=t[34]:(I=m&&(0,Z.jsx)(Y,{label:`Issue`,value:(0,Z.jsx)(`span`,{className:`text-destructive`,children:m})}),t[33]=m,t[34]=I);let L;t[35]!==N||t[36]!==F||t[37]!==I?(L=(0,Z.jsxs)(J.Content,{children:[N,F,I]}),t[35]=N,t[36]=F,t[37]=I,t[38]=L):L=t[38];let R=p?.addonVersion,z=p?.serviceAccountRoleArn,B=p?.configurationValues,V;t[39]!==R||t[40]!==z||t[41]!==B?(V={addonVersion:R,serviceAccountRoleArn:z,configurationValues:B},t[39]=R,t[40]=z,t[41]=B,t[42]=V):V=t[42];let H;t[43]!==r||t[44]!==n||t[45]!==u||t[46]!==V||t[47]!==v?(H=(0,Z.jsx)(Be,{addonName:r,clusterName:n,current:V,onOpenChange:f,open:u,versions:v}),t[43]=r,t[44]=n,t[45]=u,t[46]=V,t[47]=v,t[48]=H):H=t[48];let U;return t[49]!==j||t[50]!==L||t[51]!==H?(U=(0,Z.jsxs)(J,{children:[j,L,H]}),t[49]=j,t[50]=L,t[51]=H,t[52]=U):U=t[52],U}function Ue(e){return e.addonVersion??``}function We(e){return Pe.has(e.state.data?.addon?.status??``)?Fe:!1}function Ge(e){let t=(0,ke.c)(31),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=V(n),t[0]=n,t[1]=r);let{data:o}=a(r),{data:s}=i(H),c=B(),[l,u]=(0,X.useState)(!1),[d,f]=(0,X.useState)(),p;t[2]===o.addons?p=t[3]:(p=o.addons??[],t[2]=o.addons,t[3]=p);let m=p,h;t[4]===s?.addons?h=t[5]:(h=s?.addons??[],t[4]=s?.addons,t[5]=h);let g=h,v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add-on manifests are staged; activation completes when the cluster reports the workload ready.`}),t[6]=v):v=t[6];let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4`,children:[v,(0,Z.jsx)(_,{onClick:()=>{u(!0)},size:`sm`,children:`Add add-on`})]}),t[7]=y):y=t[7];let b;t[8]!==m||t[9]!==g||t[10]!==n?(b=m.length>0?(0,Z.jsx)(`div`,{className:`space-y-4`,children:m.map(e=>(0,Z.jsx)(He,{addonName:e,catalog:g,clusterName:n,onDelete:f},e))}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`No add-ons installed.`}),t[8]=m,t[9]=g,t[10]=n,t[11]=b):b=t[11];let x;t[12]!==m||t[13]!==g||t[14]!==n||t[15]!==l?(x=(0,Z.jsx)(Le,{catalog:g,clusterName:n,installed:m,onOpenChange:u,open:l}),t[12]=m,t[13]=g,t[14]=n,t[15]=l,t[16]=x):x=t[16];let S=`Remove add-on "${d??``}" from the cluster?`,C;t[17]!==n||t[18]!==c||t[19]!==d?(C=()=>{d&&c.mutate({clusterName:n,addonName:d},{onSuccess:()=>{f(void 0)}})},t[17]=n,t[18]=c,t[19]=d,t[20]=C):C=t[20];let w;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e||f(void 0)},t[21]=w):w=t[21];let T=d!==void 0,E;t[22]!==c.isPending||t[23]!==T||t[24]!==S||t[25]!==C?(E=(0,Z.jsx)(be,{confirmLabel:`Remove`,description:S,isPending:c.isPending,onConfirm:C,onOpenChange:w,open:T,pendingLabel:`Removing…`,title:`Remove add-on`}),t[22]=c.isPending,t[23]=T,t[24]=S,t[25]=C,t[26]=E):E=t[26];let D;return t[27]!==E||t[28]!==b||t[29]!==x?(D=(0,Z.jsxs)(Z.Fragment,{children:[y,b,x,E]}),t[27]=E,t[28]=b,t[29]=x,t[30]=D):D=t[30],D}function Ke(e){let t=(0,ke.c)(6),{to:n,id:r}=e,i;t[0]===r?i=t[1]:(i={id:r},t[0]=r,t[1]=i);let a;return t[2]!==r||t[3]!==i||t[4]!==n?(a=(0,Z.jsx)(o,{className:`font-mono text-primary underline-offset-2 hover:underline`,params:i,to:n,children:r}),t[2]=r,t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function qe(e){let t=(0,ke.c)(45),{cluster:n}=e,r=n?.resourcesVpcConfig,i;t[0]===r?.subnetIds?i=t[1]:(i=r?.subnetIds??[],t[0]=r?.subnetIds,t[1]=i);let a=i,o;t[2]===r?.securityGroupIds?o=t[3]:(o=r?.securityGroupIds??[],t[2]=r?.securityGroupIds,t[3]=o);let s=o,c;t[4]===r?.publicAccessCidrs?c=t[5]:(c=r?.publicAccessCidrs??[],t[4]=r?.publicAccessCidrs,t[5]=c);let l=c,u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(J.Header,{children:`VPC`}),t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=r?.vpcId?(0,Z.jsx)(Ke,{id:r.vpcId,to:`/ec2/describe-vpcs/$id`}):void 0,t[7]=r,t[8]=d);let f;t[9]===d?f=t[10]:(f=(0,Z.jsx)(Y,{label:`VPC`,value:d}),t[9]=d,t[10]=f);let p=n?.endpoint,m;t[11]===p?m=t[12]:(m=(0,Z.jsx)(Y,{label:`API server endpoint`,value:p}),t[11]=p,t[12]=m);let h=r?.endpointPublicAccess?`Enabled`:`Disabled`,g;t[13]===h?g=t[14]:(g=(0,Z.jsx)(Y,{label:`Public access`,value:h}),t[13]=h,t[14]=g);let _=r?.endpointPrivateAccess?`Enabled`:`Disabled`,v;t[15]===_?v=t[16]:(v=(0,Z.jsx)(Y,{label:`Private access`,value:_}),t[15]=_,t[16]=v);let y;t[17]!==l||t[18]!==r?.endpointPublicAccess?(y=r?.endpointPublicAccess&&(0,Z.jsx)(Y,{label:`Public access CIDRs`,value:l.length>0?(0,Z.jsx)(`div`,{className:`space-y-1 font-mono text-xs`,children:l.map(Xe)}):`Any (0.0.0.0/0)`}),t[17]=l,t[18]=r?.endpointPublicAccess,t[19]=y):y=t[19];let b;t[20]!==g||t[21]!==v||t[22]!==y||t[23]!==f||t[24]!==m?(b=(0,Z.jsxs)(J,{children:[u,(0,Z.jsxs)(J.Content,{children:[f,m,g,v,y]})]}),t[20]=g,t[21]=v,t[22]=y,t[23]=f,t[24]=m,t[25]=b):b=t[25];let x;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(J.Header,{children:`Subnets`}),t[26]=x):x=t[26];let S;t[27]===a?S=t[28]:(S=(0,Z.jsxs)(J,{children:[x,(0,Z.jsx)(J.Content,{children:a.length>0?(0,Z.jsx)(`div`,{className:`space-y-1`,children:a.map(Ye)}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`No subnets.`})})]}),t[27]=a,t[28]=S);let C;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(J.Header,{children:`Security groups`}),t[29]=C):C=t[29];let w;t[30]===r?w=t[31]:(w=r?.clusterSecurityGroupId?(0,Z.jsx)(Ke,{id:r.clusterSecurityGroupId,to:`/ec2/describe-security-groups/$id`}):void 0,t[30]=r,t[31]=w);let T;t[32]===w?T=t[33]:(T=(0,Z.jsx)(Y,{label:`Cluster security group`,value:w}),t[32]=w,t[33]=T);let E;t[34]===s?E=t[35]:(E=s.length>0?(0,Z.jsx)(`div`,{className:`space-y-1`,children:s.map(Je)}):`—`,t[34]=s,t[35]=E);let D;t[36]===E?D=t[37]:(D=(0,Z.jsx)(Y,{label:`Additional security groups`,value:E}),t[36]=E,t[37]=D);let O;t[38]!==T||t[39]!==D?(O=(0,Z.jsxs)(J,{children:[C,(0,Z.jsxs)(J.Content,{children:[T,D]})]}),t[38]=T,t[39]=D,t[40]=O):O=t[40];let k;return t[41]!==b||t[42]!==S||t[43]!==O?(k=(0,Z.jsxs)(Z.Fragment,{children:[b,S,O]}),t[41]=b,t[42]=S,t[43]=O,t[44]=k):k=t[44],k}function Je(e){return(0,Z.jsx)(Ke,{id:e,to:`/ec2/describe-security-groups/$id`},e)}function Ye(e){return(0,Z.jsx)(Ke,{id:e,to:`/ec2/describe-subnets/$id`},e)}function Xe(e){return(0,Z.jsx)(`div`,{children:e},e)}function Ze(e){return!!e&&(e.endsWith(`_GPU`)||e.endsWith(`_NVIDIA`))}function Qe(e,t){let n=t.find(t=>t.InstanceType===e);return!!n&&xe(n)}function $e(e){let t=(0,ke.c)(44),{clusterName:n,nodegroupName:r,current:i,open:a,onOpenChange:o}=e,s=x(),[c,l]=(0,X.useState)(i.minSize??0),[u,d]=(0,X.useState)(i.desiredSize??0),[f,p]=(0,X.useState)(i.maxSize??0),[m,h]=(0,X.useState)(),[g,_]=(0,X.useState)(a);a!==g&&(_(a),a&&(l(i.minSize??0),d(i.desiredSize??0),p(i.maxSize??0),h(void 0)));let y;t[0]!==n||t[1]!==u||t[2]!==f||t[3]!==c||t[4]!==r||t[5]!==o||t[6]!==s?(y=()=>{if(!(c<=u&&u<=f)){h(`Sizes must satisfy min ≤ desired ≤ max`);return}s.mutate({clusterName:n,nodegroupName:r,minSize:c,desiredSize:u,maxSize:f},{onSuccess:()=>{o(!1)}})},t[0]=n,t[1]=u,t[2]=f,t[3]=c,t[4]=r,t[5]=o,t[6]=s,t[7]=y):y=t[7];let b=y,S;t[8]===r?S=t[9]:(S=(0,Z.jsx)(ve,{children:(0,Z.jsxs)(me,{children:[`Scale `,r]})}),t[8]=r,t[9]=S);let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`scale-min`,children:`Min`})}),t[10]=C):C=t[10];let w;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{l(Number(e.target.value))},t[11]=w):w=t[11];let T;t[12]===c?T=t[13]:(T=(0,Z.jsxs)(q,{children:[C,(0,Z.jsx)(v,{id:`scale-min`,onChange:w,type:`number`,value:c})]}),t[12]=c,t[13]=T);let E;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`scale-desired`,children:`Desired`})}),t[14]=E):E=t[14];let D;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{d(Number(e.target.value))},t[15]=D):D=t[15];let O;t[16]===u?O=t[17]:(O=(0,Z.jsxs)(q,{children:[E,(0,Z.jsx)(v,{id:`scale-desired`,onChange:D,type:`number`,value:u})]}),t[16]=u,t[17]=O);let k;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`scale-max`,children:`Max`})}),t[18]=k):k=t[18];let A;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{p(Number(e.target.value))},t[19]=A):A=t[19];let j;t[20]===f?j=t[21]:(j=(0,Z.jsxs)(q,{children:[k,(0,Z.jsx)(v,{id:`scale-max`,onChange:A,type:`number`,value:f})]}),t[20]=f,t[21]=j);let M;t[22]!==j||t[23]!==T||t[24]!==O?(M=(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[T,O,j]}),t[22]=j,t[23]=T,t[24]=O,t[25]=M):M=t[25];let N;t[26]===m?N=t[27]:(N=m&&(0,Z.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:m}),t[26]=m,t[27]=N);let P;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(_e,{children:`Cancel`}),t[28]=P):P=t[28];let F;t[29]===b?F=t[30]:(F=e=>{e.preventDefault(),b()},t[29]=b,t[30]=F);let I=s.isPending?`Scaling…`:`Scale`,L;t[31]!==s.isPending||t[32]!==F||t[33]!==I?(L=(0,Z.jsxs)(ge,{children:[P,(0,Z.jsx)(he,{disabled:s.isPending,onClick:F,children:I})]}),t[31]=s.isPending,t[32]=F,t[33]=I,t[34]=L):L=t[34];let R;t[35]!==M||t[36]!==N||t[37]!==L||t[38]!==S?(R=(0,Z.jsxs)(pe,{children:[S,M,N,L]}),t[35]=M,t[36]=N,t[37]=L,t[38]=S,t[39]=R):R=t[39];let z;return t[40]!==o||t[41]!==a||t[42]!==R?(z=(0,Z.jsx)(ye,{onOpenChange:o,open:a,children:R}),t[40]=o,t[41]=a,t[42]=R,t[43]=z):z=t[43],z}function et(e){let t=(0,ke.c)(71),{clusterName:n,clusterVersion:r,nodegroupName:a,onDelete:o}=e,s;t[0]!==n||t[1]!==a?(s=U(n,a),t[0]=n,t[1]=a,t[2]=s):s=t[2];let{data:c}=i(s),l=C(),u=c?.nodegroup,p=u?.scalingConfig,[m,g]=(0,X.useState)(!1),[v,y]=(0,X.useState)(!1),b=!!r&&!!u?.version&&u.version!==r,x=u?.amiType,S;t[3]===x?S=t[4]:(S=Ze(x),t[3]=x,t[4]=S);let w=S,T;t[5]===a?T=t[6]:(T=(0,Z.jsx)(`span`,{children:a}),t[5]=a,t[6]=T);let E;t[7]===w?E=t[8]:(E=w&&(0,Z.jsx)(Ce,{variant:`secondary`,children:`GPU`}),t[7]=w,t[8]=E);let D;t[9]!==T||t[10]!==E?(D=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T,E]}),t[9]=T,t[10]=E,t[11]=D):D=t[11];let O;t[12]===b?O=t[13]:(O=b&&(0,Z.jsx)(_,{"aria-label":`Update node group version`,onClick:()=>{y(!0)},size:`icon`,variant:`ghost`,children:(0,Z.jsx)(d,{className:`size-4`})}),t[12]=b,t[13]=O);let k;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{g(!0)},t[14]=k):k=t[14];let A;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(_,{"aria-label":`Scale node group`,onClick:k,size:`icon`,variant:`ghost`,children:(0,Z.jsx)(f,{className:`size-4`})}),t[15]=A):A=t[15];let j;t[16]!==a||t[17]!==o?(j=()=>{o(a)},t[16]=a,t[17]=o,t[18]=j):j=t[18];let M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(h,{className:`size-4`}),t[19]=M):M=t[19];let N;t[20]===j?N=t[21]:(N=(0,Z.jsx)(_,{"aria-label":`Delete node group`,onClick:j,size:`icon`,variant:`ghost`,children:M}),t[20]=j,t[21]=N);let P;t[22]!==N||t[23]!==O?(P=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[O,A,N]}),t[22]=N,t[23]=O,t[24]=P):P=t[24];let F;t[25]!==P||t[26]!==D?(F=(0,Z.jsx)(J.Header,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[D,P]})}),t[25]=P,t[26]=D,t[27]=F):F=t[27];let I=u?.status,L;t[28]===I?L=t[29]:(L=(0,Z.jsx)(Y,{label:`Status`,value:I}),t[28]=I,t[29]=L);let R=b?`${u?.version} (cluster on ${r})`:u?.version,z;t[30]===R?z=t[31]:(z=(0,Z.jsx)(Y,{label:`Kubernetes version`,value:R}),t[30]=R,t[31]=z);let B;t[32]===u?.instanceTypes?B=t[33]:(B=u?.instanceTypes?.join(`, `),t[32]=u?.instanceTypes,t[33]=B);let V;t[34]===B?V=t[35]:(V=(0,Z.jsx)(Y,{label:`Instance types`,value:B}),t[34]=B,t[35]=V);let H=u?.amiType,W;t[36]===H?W=t[37]:(W=(0,Z.jsx)(Y,{label:`AMI type`,value:H}),t[36]=H,t[37]=W);let ee=u?.capacityType,te;t[38]===ee?te=t[39]:(te=(0,Z.jsx)(Y,{label:`Capacity type`,value:ee}),t[38]=ee,t[39]=te);let ne=p?`${p.minSize} / ${p.desiredSize} / ${p.maxSize}`:void 0,G;t[40]===ne?G=t[41]:(G=(0,Z.jsx)(Y,{label:`Scaling (min / desired / max)`,value:ne}),t[40]=ne,t[41]=G);let re;t[42]!==L||t[43]!==z||t[44]!==V||t[45]!==W||t[46]!==te||t[47]!==G?(re=(0,Z.jsxs)(J.Content,{children:[L,z,V,W,te,G]}),t[42]=L,t[43]=z,t[44]=V,t[45]=W,t[46]=te,t[47]=G,t[48]=re):re=t[48];let ie;t[49]===p?ie=t[50]:(ie=p??{},t[49]=p,t[50]=ie);let ae;t[51]!==n||t[52]!==a||t[53]!==m||t[54]!==ie?(ae=(0,Z.jsx)($e,{clusterName:n,current:ie,nodegroupName:a,onOpenChange:g,open:m}),t[51]=n,t[52]=a,t[53]=m,t[54]=ie,t[55]=ae):ae=t[55];let oe=`Update node group "${a}" from ${u?.version} to ${r}? Nodes are replaced in a rolling update.`,se;t[56]!==n||t[57]!==r||t[58]!==a||t[59]!==l?(se=()=>{l.mutate({clusterName:n,nodegroupName:a,version:r},{onSuccess:()=>{y(!1)}})},t[56]=n,t[57]=r,t[58]=a,t[59]=l,t[60]=se):se=t[60];let ce;t[61]!==v||t[62]!==oe||t[63]!==se||t[64]!==l.isPending?(ce=(0,Z.jsx)(be,{confirmLabel:`Update`,description:oe,isPending:l.isPending,onConfirm:se,onOpenChange:y,open:v,title:`Update node group version`}),t[61]=v,t[62]=oe,t[63]=se,t[64]=l.isPending,t[65]=ce):ce=t[65];let le;return t[66]!==F||t[67]!==re||t[68]!==ae||t[69]!==ce?(le=(0,Z.jsxs)(J,{children:[F,re,ae,ce]}),t[66]=F,t[67]=re,t[68]=ae,t[69]=ce,t[70]=le):le=t[70],le}function tt(e){let t=(0,ke.c)(145),{clusterName:n,vpcId:r,open:a,onOpenChange:o}=e,{data:s}=i(ie),{data:c}=i(y),{data:l}=i(b),u=w(),d;t[0]===s?.Roles?d=t[1]:(d=s?.Roles??[],t[0]=s?.Roles,t[1]=d);let f=d,p;t[2]===c?.Subnets?p=t[3]:(p=c?.Subnets??[],t[2]=c?.Subnets,t[3]=p);let m;t[4]===r?m=t[5]:(m=e=>e.VpcId===r,t[4]=r,t[5]=m);let h=p.filter(m),g;t[6]===l?.InstanceTypes?g=t[7]:(g=l?.InstanceTypes??[],t[6]=l?.InstanceTypes,t[7]=g);let _=g,x;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=ce(D),t[8]=x):x=t[8];let S;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(S={resolver:x,defaultValues:{nodegroupName:``,nodeRole:``,subnetIds:[],instanceTypes:`t3.medium`,amiType:`AL2_x86_64`,capacityType:`ON_DEMAND`,diskSize:20,minSize:1,desiredSize:2,maxSize:3}},t[9]=S):S=t[9];let{control:C,formState:T,handleSubmit:E,register:O,reset:A,setValue:j}=oe(S),{errors:M}=T,N;t[10]===C?N=t[11]:(N={control:C,name:`subnetIds`},t[10]=C,t[11]=N);let F=ae(N),I;t[12]===F?I=t[13]:(I=new Set(F),t[12]=F,t[13]=I);let L=I,R;t[14]===C?R=t[15]:(R={control:C,name:`instanceTypes`},t[14]=C,t[15]=R);let z=ae(R),B;t[16]!==_||t[17]!==z?(B=Qe(z,_),t[16]=_,t[17]=z,t[18]=B):B=t[18];let V=B,H;t[19]!==F||t[20]!==j?(H=e=>{let t=F.includes(e)?F.filter(t=>t!==e):[...F,e];j(`subnetIds`,t,{shouldValidate:!0})},t[19]=F,t[20]=j,t[21]=H):H=t[21];let U=H,W;t[22]!==n||t[23]!==u||t[24]!==o||t[25]!==A?(W=async e=>{await u.mutateAsync({clusterName:n,nodegroupName:e.nodegroupName,nodeRole:e.nodeRole,subnetIds:e.subnetIds,instanceTypes:e.instanceTypes.split(`,`).map(at).filter(Boolean),amiType:e.amiType,capacityType:e.capacityType,diskSize:e.diskSize,minSize:e.minSize,desiredSize:e.desiredSize,maxSize:e.maxSize}),A(),o(!1)},t[22]=n,t[23]=u,t[24]=o,t[25]=A,t[26]=W):W=t[26];let ee=W,te=ye,ne=pe,G;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Z.jsx)(ve,{children:(0,Z.jsx)(me,{children:`Add node group`})}),t[27]=G):G=t[27];let re;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-name`,children:`Name`})}),t[28]=re):re=t[28];let le=!!M.nodegroupName,ue;t[29]===O?ue=t[30]:(ue=O(`nodegroupName`),t[29]=O,t[30]=ue);let be;t[31]!==le||t[32]!==ue?(be=(0,Z.jsx)(v,{"aria-invalid":le,id:`ng-name`,placeholder:`my-nodegroup`,...ue}),t[31]=le,t[32]=ue,t[33]=be):be=t[33];let J;t[34]===M.nodegroupName?J=t[35]:(J=(0,Z.jsx)(fe,{errors:[M.nodegroupName]}),t[34]=M.nodegroupName,t[35]=J);let Y;t[36]!==be||t[37]!==J?(Y=(0,Z.jsxs)(q,{children:[re,be,J]}),t[36]=be,t[37]=J,t[38]=Y):Y=t[38];let xe;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-role`,children:`Node IAM role`})}),t[39]=xe):xe=t[39];let Ce=!!M.nodeRole,we;t[40]===O?we=t[41]:(we=O(`nodeRole`),t[40]=O,t[41]=we);let Te;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(`option`,{value:``,children:`Select role`}),t[42]=Te):Te=t[42];let Ee;t[43]===f?Ee=t[44]:(Ee=f.map(it),t[43]=f,t[44]=Ee);let De;t[45]!==Ce||t[46]!==we||t[47]!==Ee?(De=(0,Z.jsxs)(`select`,{"aria-invalid":Ce,className:`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`,id:`ng-role`,...we,children:[Te,Ee]}),t[45]=Ce,t[46]=we,t[47]=Ee,t[48]=De):De=t[48];let Oe;t[49]===M.nodeRole?Oe=t[50]:(Oe=(0,Z.jsx)(fe,{errors:[M.nodeRole]}),t[49]=M.nodeRole,t[50]=Oe);let X;t[51]!==De||t[52]!==Oe?(X=(0,Z.jsxs)(q,{children:[xe,De,Oe]}),t[51]=De,t[52]=Oe,t[53]=X):X=t[53];let Ae=q,Q;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,Z.jsx)(K,{children:`Subnets`}),t[54]=Q):Q=t[54];let je=h.length===0?(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No subnets in the cluster VPC.`}):(0,Z.jsx)(`div`,{className:`space-y-1`,children:h.map(e=>(0,Z.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,Z.jsx)(`input`,{"aria-label":`Subnet ${e.SubnetId}`,checked:L.has(e.SubnetId??``),onChange:()=>{U(e.SubnetId??``)},type:`checkbox`}),(0,Z.jsxs)(`span`,{className:`font-mono`,children:[e.SubnetId,` · `,e.CidrBlock]})]},e.SubnetId))}),$;t[55]===M.subnetIds?$=t[56]:($=(0,Z.jsx)(fe,{errors:[M.subnetIds]}),t[55]=M.subnetIds,t[56]=$);let Me;t[57]!==Ae||t[58]!==Q||t[59]!==je||t[60]!==$?(Me=(0,Z.jsxs)(Ae,{children:[Q,je,$]}),t[57]=Ae,t[58]=Q,t[59]=je,t[60]=$,t[61]=Me):Me=t[61];let Ne;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-instance-type`,children:`Instance type`})}),t[62]=Ne):Ne=t[62];let Pe;t[63]!==M.instanceTypes||t[64]!==_?(Pe=e=>{let{field:t}=e;return(0,Z.jsx)(Se,{"aria-invalid":!!M.instanceTypes,id:`ng-instance-type`,instanceTypes:_,onValueChange:t.onChange,value:t.value})},t[63]=M.instanceTypes,t[64]=_,t[65]=Pe):Pe=t[65];let Fe;t[66]!==C||t[67]!==Pe?(Fe=(0,Z.jsx)(se,{control:C,name:`instanceTypes`,render:Pe}),t[66]=C,t[67]=Pe,t[68]=Fe):Fe=t[68];let Ie;t[69]===V?Ie=t[70]:(Ie=V&&(0,Z.jsxs)(de,{children:[`GPU node AMI is auto-selected for this instance type. This node group is tainted `,(0,Z.jsx)(`code`,{children:`nvidia.com/gpu=present:NoSchedule`}),` `,`by default, so ordinary pods won't schedule onto GPU workers.`]}),t[69]=V,t[70]=Ie);let Le;t[71]===M.instanceTypes?Le=t[72]:(Le=(0,Z.jsx)(fe,{errors:[M.instanceTypes]}),t[71]=M.instanceTypes,t[72]=Le);let Re;t[73]!==Fe||t[74]!==Ie||t[75]!==Le?(Re=(0,Z.jsxs)(q,{children:[Ne,Fe,Ie,Le]}),t[73]=Fe,t[74]=Ie,t[75]=Le,t[76]=Re):Re=t[76];let ze;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-ami`,children:`AMI type`})}),t[77]=ze):ze=t[77];let Be;t[78]===O?Be=t[79]:(Be=O(`amiType`),t[78]=O,t[79]=Be);let Ve;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=P.map(rt),t[80]=Ve):Ve=t[80];let He;t[81]===Be?He=t[82]:(He=(0,Z.jsxs)(q,{children:[ze,(0,Z.jsx)(`select`,{className:`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`,id:`ng-ami`,...Be,children:Ve})]}),t[81]=Be,t[82]=He);let Ue;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-capacity`,children:`Capacity type`})}),t[83]=Ue):Ue=t[83];let We;t[84]===O?We=t[85]:(We=O(`capacityType`),t[84]=O,t[85]=We);let Ge;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=k.map(nt),t[86]=Ge):Ge=t[86];let Ke;t[87]===We?Ke=t[88]:(Ke=(0,Z.jsxs)(q,{children:[Ue,(0,Z.jsx)(`select`,{className:`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`,id:`ng-capacity`,...We,children:Ge})]}),t[87]=We,t[88]=Ke);let qe;t[89]!==He||t[90]!==Ke?(qe=(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[He,Ke]}),t[89]=He,t[90]=Ke,t[91]=qe):qe=t[91];let Je;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-disk`,children:`Disk (GB)`})}),t[92]=Je):Je=t[92];let Ye;t[93]===O?Ye=t[94]:(Ye=O(`diskSize`,{valueAsNumber:!0}),t[93]=O,t[94]=Ye);let Xe;t[95]===Ye?Xe=t[96]:(Xe=(0,Z.jsxs)(q,{children:[Je,(0,Z.jsx)(v,{id:`ng-disk`,type:`number`,...Ye})]}),t[95]=Ye,t[96]=Xe);let Ze;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-min`,children:`Min`})}),t[97]=Ze):Ze=t[97];let $e;t[98]===O?$e=t[99]:($e=O(`minSize`,{valueAsNumber:!0}),t[98]=O,t[99]=$e);let et;t[100]===$e?et=t[101]:(et=(0,Z.jsxs)(q,{children:[Ze,(0,Z.jsx)(v,{id:`ng-min`,type:`number`,...$e})]}),t[100]=$e,t[101]=et);let tt;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-desired`,children:`Desired`})}),t[102]=tt):tt=t[102];let ot;t[103]===O?ot=t[104]:(ot=O(`desiredSize`,{valueAsNumber:!0}),t[103]=O,t[104]=ot);let st;t[105]===ot?st=t[106]:(st=(0,Z.jsxs)(q,{children:[tt,(0,Z.jsx)(v,{id:`ng-desired`,type:`number`,...ot})]}),t[105]=ot,t[106]=st);let ct;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,Z.jsx)(K,{children:(0,Z.jsx)(`label`,{htmlFor:`ng-max`,children:`Max`})}),t[107]=ct):ct=t[107];let lt;t[108]===O?lt=t[109]:(lt=O(`maxSize`,{valueAsNumber:!0}),t[108]=O,t[109]=lt);let ut;t[110]===lt?ut=t[111]:(ut=(0,Z.jsxs)(q,{children:[ct,(0,Z.jsx)(v,{id:`ng-max`,type:`number`,...lt})]}),t[110]=lt,t[111]=ut);let dt;t[112]!==Xe||t[113]!==et||t[114]!==st||t[115]!==ut?(dt=(0,Z.jsxs)(`div`,{className:`grid grid-cols-4 gap-3`,children:[Xe,et,st,ut]}),t[112]=Xe,t[113]=et,t[114]=st,t[115]=ut,t[116]=dt):dt=t[116];let ft;t[117]===M.desiredSize?ft=t[118]:(ft=(0,Z.jsx)(fe,{errors:[M.desiredSize]}),t[117]=M.desiredSize,t[118]=ft);let pt;t[119]!==Y||t[120]!==X||t[121]!==Me||t[122]!==Re||t[123]!==qe||t[124]!==dt||t[125]!==ft?(pt=(0,Z.jsxs)(`form`,{className:`space-y-4`,id:`add-nodegroup-form`,children:[Y,X,Me,Re,qe,dt,ft]}),t[119]=Y,t[120]=X,t[121]=Me,t[122]=Re,t[123]=qe,t[124]=dt,t[125]=ft,t[126]=pt):pt=t[126];let mt;t[127]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,Z.jsx)(_e,{children:`Cancel`}),t[127]=mt):mt=t[127];let ht;t[128]!==E||t[129]!==ee?(ht=e=>{e.preventDefault(),E(ee)()},t[128]=E,t[129]=ee,t[130]=ht):ht=t[130];let gt=u.isPending?`Creating…`:`Create`,_t;t[131]!==u.isPending||t[132]!==ht||t[133]!==gt?(_t=(0,Z.jsxs)(ge,{children:[mt,(0,Z.jsx)(he,{disabled:u.isPending,onClick:ht,children:gt})]}),t[131]=u.isPending,t[132]=ht,t[133]=gt,t[134]=_t):_t=t[134];let vt;t[135]!==ne||t[136]!==G||t[137]!==pt||t[138]!==_t?(vt=(0,Z.jsxs)(ne,{className:`max-h-[85vh] overflow-y-auto`,children:[G,pt,_t]}),t[135]=ne,t[136]=G,t[137]=pt,t[138]=_t,t[139]=vt):vt=t[139];let yt;return t[140]!==te||t[141]!==o||t[142]!==a||t[143]!==vt?(yt=(0,Z.jsx)(te,{onOpenChange:o,open:a,children:vt}),t[140]=te,t[141]=o,t[142]=a,t[143]=vt,t[144]=yt):yt=t[144],yt}function nt(e){return(0,Z.jsx)(`option`,{value:e,children:e},e)}function rt(e){return(0,Z.jsx)(`option`,{value:e,children:e},e)}function it(e){return(0,Z.jsx)(`option`,{value:e.Arn??``,children:e.RoleName},e.Arn)}function at(e){return e.trim()}function ot(e){let t=(0,ke.c)(27),{clusterName:n,clusterVersion:r,vpcId:i}=e,o;t[0]===n?o=t[1]:(o=re(n),t[0]=n,t[1]=o);let{data:s}=a(o),c=z(),[l,u]=(0,X.useState)(!1),[d,f]=(0,X.useState)(),p;t[2]===s.nodegroups?p=t[3]:(p=s.nodegroups??[],t[2]=s.nodegroups,t[3]=p);let m=p,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,Z.jsx)(_,{onClick:()=>{u(!0)},size:`sm`,children:`Add node group`})}),t[4]=h):h=t[4];let g;t[5]!==n||t[6]!==r||t[7]!==m?(g=m.length>0?(0,Z.jsx)(`div`,{className:`space-y-4`,children:m.map(e=>(0,Z.jsx)(et,{clusterName:n,clusterVersion:r,nodegroupName:e,onDelete:f},e))}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`No node groups.`}),t[5]=n,t[6]=r,t[7]=m,t[8]=g):g=t[8];let v;t[9]!==n||t[10]!==l||t[11]!==i?(v=(0,Z.jsx)(tt,{clusterName:n,onOpenChange:u,open:l,vpcId:i}),t[9]=n,t[10]=l,t[11]=i,t[12]=v):v=t[12];let y=`Delete node group "${d??``}"? This terminates its nodes.`,b;t[13]!==n||t[14]!==c||t[15]!==d?(b=()=>{d&&c.mutate({clusterName:n,nodegroupName:d},{onSuccess:()=>{f(void 0)}})},t[13]=n,t[14]=c,t[15]=d,t[16]=b):b=t[16];let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{e||f(void 0)},t[17]=x):x=t[17];let S=d!==void 0,C;t[18]!==c.isPending||t[19]!==y||t[20]!==b||t[21]!==S?(C=(0,Z.jsx)(be,{description:y,isPending:c.isPending,onConfirm:b,onOpenChange:x,open:S,title:`Delete node group`}),t[18]=c.isPending,t[19]=y,t[20]=b,t[21]=S,t[22]=C):C=t[22];let w;return t[23]!==C||t[24]!==g||t[25]!==v?(w=(0,Z.jsxs)(Z.Fragment,{children:[h,g,v,C]}),t[23]=C,t[24]=g,t[25]=v,t[26]=w):w=t[26],w}function st(e){switch(e??``){case`ACTIVE`:return`default`;case`FAILED`:return`destructive`;default:return`secondary`}}function ct(e){let t=(0,ke.c)(101),{clusterName:n}=e,r=s(),[i,o]=(0,X.useState)(!1),d;t[0]===n?d=t[1]:(d=ne(n),t[0]=n,t[1]=d);let{data:f}=a(d),p=T(),{cluster:v}=f,y;t[2]===v?.health?.issues?y=t[3]:(y=v?.health?.issues??[],t[2]=v?.health?.issues,t[3]=y);let b=y,x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x={type:`bin`,value:`aws eks update-kubeconfig`},t[4]=x):x=t[4];let S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S={type:`flag`,value:` --name `},t[5]=S):S=t[5];let C;t[6]===n?C=t[7]:(C={type:`value`,value:n},t[6]=n,t[7]=C);let w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w={type:`flag`,value:` --region `},t[8]=w):w=t[8];let E;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(E={type:`value`,value:l()},t[9]=E):E=t[9];let D;t[10]===C?D=t[11]:(D={label:`Configure kubectl`,parts:[x,S,C,w,E]},t[10]=C,t[11]=D);let O;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(O={label:`Verify access`,parts:[{type:`bin`,value:`kubectl get nodes`}]},t[12]=O):O=t[12];let k;t[13]===D?k=t[14]:(k=[D,O],t[13]=D,t[14]=k);let A=k,j;t[15]!==n||t[16]!==p||t[17]!==r?(j=function(){p.mutate(n,{onSuccess:()=>{r({to:`/eks/list-clusters`})}})},t[15]=n,t[16]=p,t[17]=r,t[18]=j):j=t[18];let M=j,N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(u,{to:`/eks/list-clusters`,children:`Clusters`}),t[19]=N):N=t[19];let P;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{o(!0)},t[20]=P):P=t[20];let F;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsxs)(_,{onClick:P,size:`sm`,variant:`destructive`,children:[(0,Z.jsx)(h,{className:`size-4`}),`Delete`]}),t[21]=F):F=t[21];let I=v?.status,L;t[22]===I?L=t[23]:(L=st(I),t[22]=I,t[23]=L);let R=v?.status??`UNKNOWN`,z;t[24]!==L||t[25]!==R?(z=(0,Z.jsx)(Ce,{variant:L,children:R}),t[24]=L,t[25]=R,t[26]=z):z=t[26];let B;t[27]===b.length?B=t[28]:(B=b.length>0&&(0,Z.jsxs)(Ce,{variant:`destructive`,children:[(0,Z.jsx)(g,{className:`size-3`}),b.length===1?`1 health issue`:`${b.length} health issues`]}),t[27]=b.length,t[28]=B);let V;t[29]!==z||t[30]!==B?(V=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[F,z,B]}),t[29]=z,t[30]=B,t[31]=V):V=t[31];let H;t[32]!==n||t[33]!==V?(H=(0,Z.jsx)(ue,{actions:V,subtitle:`Cluster Details`,title:n}),t[32]=n,t[33]=V,t[34]=H):H=t[34];let U;t[35]!==p.error||t[36]!==p.isError?(U=p.isError&&(0,Z.jsx)(le,{error:p.error instanceof Error?p.error:void 0,msg:`Failed to delete cluster.`}),t[35]=p.error,t[36]=p.isError,t[37]=U):U=t[37];let W;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsxs)(Te,{children:[(0,Z.jsx)(we,{value:`overview`,children:`Overview`}),(0,Z.jsx)(we,{value:`compute`,children:`Compute`}),(0,Z.jsx)(we,{value:`addons`,children:`Add-ons`}),(0,Z.jsx)(we,{value:`access`,children:`Access`}),(0,Z.jsx)(we,{value:`networking`,children:`Networking`}),(0,Z.jsx)(we,{value:`connect`,children:`Connect`})]}),t[38]=W):W=t[38];let ee;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(J.Header,{children:`Cluster`}),t[39]=ee):ee=t[39];let te=v?.arn,G;t[40]===te?G=t[41]:(G=(0,Z.jsx)(Y,{label:`ARN`,value:te}),t[40]=te,t[41]=G);let re=v?.status,ie;t[42]===re?ie=t[43]:(ie=(0,Z.jsx)(Y,{label:`Status`,value:re}),t[42]=re,t[43]=ie);let ae;t[44]===b?ae=t[45]:(ae=b.length>0?b.map(lt).filter(Boolean).join(`; `):`OK`,t[44]=b,t[45]=ae);let oe;t[46]===ae?oe=t[47]:(oe=(0,Z.jsx)(Y,{label:`Health`,value:ae}),t[46]=ae,t[47]=oe);let se=v?.version,ce;t[48]===se?ce=t[49]:(ce=(0,Z.jsx)(Y,{label:`Kubernetes version`,value:se}),t[48]=se,t[49]=ce);let K=v?.platformVersion,de;t[50]===K?de=t[51]:(de=(0,Z.jsx)(Y,{label:`Platform version`,value:K}),t[50]=K,t[51]=de);let fe=v?.endpoint,q;t[52]===fe?q=t[53]:(q=(0,Z.jsx)(Y,{label:`Endpoint`,value:fe}),t[52]=fe,t[53]=q);let pe=v?.identity?.oidc?.issuer,me;t[54]===pe?me=t[55]:(me=(0,Z.jsx)(Y,{label:`OIDC issuer`,value:pe}),t[54]=pe,t[55]=me);let he=v?.resourcesVpcConfig?.vpcId,ge;t[56]===he?ge=t[57]:(ge=(0,Z.jsx)(Y,{label:`VPC`,value:he}),t[56]=he,t[57]=ge);let _e=v?.createdAt,ve;t[58]===_e?ve=t[59]:(ve=c(_e),t[58]=_e,t[59]=ve);let ye;t[60]===ve?ye=t[61]:(ye=(0,Z.jsx)(Y,{label:`Created at`,value:ve}),t[60]=ve,t[61]=ye);let xe;t[62]!==G||t[63]!==ie||t[64]!==oe||t[65]!==ce||t[66]!==de||t[67]!==q||t[68]!==me||t[69]!==ge||t[70]!==ye?(xe=(0,Z.jsx)(Ee,{value:`overview`,children:(0,Z.jsxs)(J,{children:[ee,(0,Z.jsxs)(J.Content,{children:[G,ie,oe,ce,de,q,me,ge,ye]})]})}),t[62]=G,t[63]=ie,t[64]=oe,t[65]=ce,t[66]=de,t[67]=q,t[68]=me,t[69]=ge,t[70]=ye,t[71]=xe):xe=t[71];let Se=v?.version,Oe=v?.resourcesVpcConfig?.vpcId,Ae;t[72]!==n||t[73]!==Se||t[74]!==Oe?(Ae=(0,Z.jsx)(Ee,{value:`compute`,children:(0,Z.jsx)(ot,{clusterName:n,clusterVersion:Se,vpcId:Oe})}),t[72]=n,t[73]=Se,t[74]=Oe,t[75]=Ae):Ae=t[75];let Q;t[76]===n?Q=t[77]:(Q=(0,Z.jsx)(Ee,{value:`addons`,children:(0,Z.jsx)(Ge,{clusterName:n})}),t[76]=n,t[77]=Q);let je;t[78]===n?je=t[79]:(je=(0,Z.jsx)(Ee,{value:`access`,children:(0,Z.jsx)(Ne,{clusterName:n})}),t[78]=n,t[79]=je);let $;t[80]===v?$=t[81]:($=(0,Z.jsx)(Ee,{value:`networking`,children:(0,Z.jsx)(qe,{cluster:v})}),t[80]=v,t[81]=$);let Me;t[82]===A?Me=t[83]:(Me=(0,Z.jsx)(Ee,{value:`connect`,children:(0,Z.jsx)(m,{commands:A})}),t[82]=A,t[83]=Me);let Pe;t[84]!==xe||t[85]!==Ae||t[86]!==Q||t[87]!==je||t[88]!==$||t[89]!==Me?(Pe=(0,Z.jsxs)(De,{defaultValue:`overview`,children:[W,xe,Ae,Q,je,$,Me]}),t[84]=xe,t[85]=Ae,t[86]=Q,t[87]=je,t[88]=$,t[89]=Me,t[90]=Pe):Pe=t[90];let Fe=`This permanently deletes cluster "${n}" and its control plane. This cannot be undone.`,Ie;t[91]!==p.isPending||t[92]!==M||t[93]!==i||t[94]!==Fe?(Ie=(0,Z.jsx)(be,{description:Fe,isPending:p.isPending,onConfirm:M,onOpenChange:o,open:i,title:`Delete cluster`}),t[91]=p.isPending,t[92]=M,t[93]=i,t[94]=Fe,t[95]=Ie):Ie=t[95];let Le;return t[96]!==H||t[97]!==U||t[98]!==Pe||t[99]!==Ie?(Le=(0,Z.jsxs)(Z.Fragment,{children:[N,H,U,Pe,Ie]}),t[96]=H,t[97]=U,t[98]=Pe,t[99]=Ie,t[100]=Le):Le=t[100],Le}function lt(e){return e.message}function ut(){let e=(0,ke.c)(2),{clusterName:t}=p.useParams(),n;return e[0]===t?n=e[1]:(n=(0,Z.jsx)(ct,{clusterName:t}),e[0]=t,e[1]=n),n}export{ut as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_groupName2.js b/spinifex/services/spinifexui/frontend/dist/assets/_groupName2.js index 134136777..aff8fe4be 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_groupName2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_groupName2.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{O as u,n as d,p as f}from"./iam.js";import{C as p,s as m}from"./iam2.js";import{t as h}from"./_groupName.js";import{t as g}from"./error-banner.js";import{t as _}from"./page-heading.js";import{t as v}from"./delete-confirmation-dialog.js";import{n as y,t as b}from"./detail-row.js";import{n as x,t as S}from"./inline-policies-panel.js";var C=e(n()),w=t();function T(){let{groupName:e}=h.useParams(),t=a(),{data:n}=r(m(e)),{data:T}=r(p),E=f(),D=d(),O=u(),[k,A]=(0,C.useState)(!1),[j,M]=(0,C.useState)(!1),[N,P]=(0,C.useState)(null),F=n.Group,I=n.Users??[],L=T.Users??[],R=new Set(I.map(e=>e.UserName)),z=L.filter(e=>e.UserName&&!R.has(e.UserName)),B=async()=>{try{await E.mutateAsync(e),t({to:`/iam/list-groups`})}finally{A(!1)}},V=async t=>{await D.mutateAsync({groupName:e,userName:t}),M(!1)},H=async t=>{P(t);try{await O.mutateAsync({groupName:e,userName:t})}finally{P(null)}};return F?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s,{to:`/iam/list-groups`,children:`Back to groups`}),E.error&&(0,w.jsx)(g,{error:E.error,msg:`Failed to delete group`}),D.error&&(0,w.jsx)(g,{error:D.error,msg:`Failed to add user`}),O.error&&(0,w.jsx)(g,{error:O.error,msg:`Failed to remove user`}),(0,w.jsxs)(`div`,{className:`space-y-6`,children:[(0,w.jsx)(_,{actions:(0,w.jsxs)(l,{onClick:()=>A(!0),size:`sm`,variant:`destructive`,children:[(0,w.jsx)(c,{className:`size-4`}),`Delete`]}),subtitle:`Group Details`,title:F.GroupName??``}),(0,w.jsxs)(y,{children:[(0,w.jsx)(y.Header,{children:`Group Information`}),(0,w.jsxs)(y.Content,{children:[(0,w.jsx)(b,{label:`Group Name`,value:F.GroupName}),(0,w.jsx)(b,{label:`Group ID`,value:F.GroupId}),(0,w.jsx)(b,{label:`ARN`,value:F.Arn}),(0,w.jsx)(b,{label:`Path`,value:F.Path}),(0,w.jsx)(b,{label:`Created`,value:o(F.CreateDate)})]})]}),(0,w.jsxs)(y,{children:[(0,w.jsx)(y.Header,{children:(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(`span`,{children:`Members`}),(0,w.jsx)(l,{onClick:()=>M(!j),size:`sm`,children:`Add User`})]})}),(0,w.jsxs)(y.Content,{children:[j&&z.length>0&&(0,w.jsxs)(`div`,{className:`col-span-2 space-y-2 rounded-md border p-3`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium`,children:`Select a user to add:`}),(0,w.jsx)(`div`,{className:`space-y-1`,children:z.map(e=>(0,w.jsxs)(`button`,{className:`flex w-full items-center justify-between rounded-md p-2 text-left text-sm hover:bg-accent`,disabled:D.isPending,onClick:()=>{e.UserName&&V(e.UserName)},type:`button`,children:[(0,w.jsx)(`span`,{children:e.UserName}),(0,w.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.Arn})]},e.UserName))})]}),j&&z.length===0&&(0,w.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No users available to add.`}),I.length>0?(0,w.jsx)(`div`,{className:`col-span-2 space-y-3`,children:I.map(e=>(0,w.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,w.jsx)(i,{className:`text-sm font-medium hover:underline`,params:{userName:e.UserName??``},to:`/iam/list-users/$userName`,children:e.UserName}),(0,w.jsx)(l,{disabled:N===e.UserName,onClick:()=>{e.UserName&&H(e.UserName)},size:`sm`,variant:`outline`,children:`Remove`})]},e.UserName))}):(0,w.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No members.`})]})]}),(0,w.jsx)(x,{kind:`group`,name:e}),(0,w.jsx)(S,{kind:`group`,name:e})]}),(0,w.jsx)(v,{description:`Are you sure you want to delete the group "${e}"? This action cannot be undone. You must remove all members and detach all policies first.`,isPending:E.isPending,onConfirm:B,onOpenChange:A,open:k,title:`Delete Group`})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s,{to:`/iam/list-groups`,children:`Back to groups`}),(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:`Group not found.`})]})}export{T as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{O as u,n as d,p as f}from"./iam.js";import{C as p,s as m}from"./iam2.js";import{t as h}from"./_groupName.js";import{t as g}from"./error-banner.js";import{t as _}from"./page-heading.js";import{t as v}from"./delete-confirmation-dialog.js";import{n as y,t as b}from"./detail-row.js";import{n as x,t as S}from"./inline-policies-panel.js";var C=e(n()),w=t();function T(){let{groupName:e}=h.useParams(),t=a(),{data:n}=r(m(e)),{data:T}=r(p),E=f(),D=d(),O=u(),[k,A]=(0,C.useState)(!1),[j,M]=(0,C.useState)(!1),[N,P]=(0,C.useState)(null),F=n.Group,I=n.Users??[],L=T.Users??[],R=new Set(I.map(e=>e.UserName)),z=L.filter(e=>e.UserName&&!R.has(e.UserName)),B=async()=>{try{await E.mutateAsync(e),t({to:`/iam/list-groups`})}finally{A(!1)}},V=async t=>{await D.mutateAsync({groupName:e,userName:t}),M(!1)},H=async t=>{P(t);try{await O.mutateAsync({groupName:e,userName:t})}finally{P(null)}};return F?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s,{to:`/iam/list-groups`,children:`Back to groups`}),E.error&&(0,w.jsx)(g,{error:E.error,msg:`Failed to delete group`}),D.error&&(0,w.jsx)(g,{error:D.error,msg:`Failed to add user`}),O.error&&(0,w.jsx)(g,{error:O.error,msg:`Failed to remove user`}),(0,w.jsxs)(`div`,{className:`space-y-6`,children:[(0,w.jsx)(_,{actions:(0,w.jsxs)(l,{onClick:()=>{A(!0)},size:`sm`,variant:`destructive`,children:[(0,w.jsx)(c,{className:`size-4`}),`Delete`]}),subtitle:`Group Details`,title:F.GroupName??``}),(0,w.jsxs)(y,{children:[(0,w.jsx)(y.Header,{children:`Group Information`}),(0,w.jsxs)(y.Content,{children:[(0,w.jsx)(b,{label:`Group Name`,value:F.GroupName}),(0,w.jsx)(b,{label:`Group ID`,value:F.GroupId}),(0,w.jsx)(b,{label:`ARN`,value:F.Arn}),(0,w.jsx)(b,{label:`Path`,value:F.Path}),(0,w.jsx)(b,{label:`Created`,value:o(F.CreateDate)})]})]}),(0,w.jsxs)(y,{children:[(0,w.jsx)(y.Header,{children:(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(`span`,{children:`Members`}),(0,w.jsx)(l,{onClick:()=>{M(!j)},size:`sm`,children:`Add User`})]})}),(0,w.jsxs)(y.Content,{children:[j&&z.length>0&&(0,w.jsxs)(`div`,{className:`col-span-2 space-y-2 rounded-md border p-3`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium`,children:`Select a user to add:`}),(0,w.jsx)(`div`,{className:`space-y-1`,children:z.map(e=>(0,w.jsxs)(`button`,{className:`flex w-full items-center justify-between rounded-md p-2 text-left text-sm hover:bg-accent`,disabled:D.isPending,onClick:()=>{e.UserName&&V(e.UserName)},type:`button`,children:[(0,w.jsx)(`span`,{children:e.UserName}),(0,w.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.Arn})]},e.UserName))})]}),j&&z.length===0&&(0,w.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No users available to add.`}),I.length>0?(0,w.jsx)(`div`,{className:`col-span-2 space-y-3`,children:I.map(e=>(0,w.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,w.jsx)(i,{className:`text-sm font-medium hover:underline`,params:{userName:e.UserName??``},to:`/iam/list-users/$userName`,children:e.UserName}),(0,w.jsx)(l,{disabled:N===e.UserName,onClick:()=>{e.UserName&&H(e.UserName)},size:`sm`,variant:`outline`,children:`Remove`})]},e.UserName))}):(0,w.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No members.`})]})]}),(0,w.jsx)(x,{kind:`group`,name:e}),(0,w.jsx)(S,{kind:`group`,name:e})]}),(0,w.jsx)(v,{description:`Are you sure you want to delete the group "${e}"? This action cannot be undone. You must remove all members and detach all policies first.`,isPending:E.isPending,onConfirm:B,onOpenChange:A,open:k,title:`Delete Group`})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s,{to:`/iam/list-groups`,children:`Back to groups`}),(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:`Group not found.`})]})}export{T as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id22.js b/spinifex/services/spinifexui/frontend/dist/assets/_id22.js index 5b5452797..a32f1efdc 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id22.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id22.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./useNavigate.js";import{nn as a}from"./cluster-config.js";import{t as o}from"./back-link.js";import{c as s,i as c,n as l,s as u,t as d}from"./select.js";import{t as f}from"./trash-2.js";import{t as p}from"./button.js";import{l as m,t as h}from"./ec2.js";import{$ as g,U as _,r as v}from"./ec22.js";import{t as y}from"./_id3.js";import{t as b}from"./error-banner.js";import{t as x}from"./page-heading.js";import{t as S}from"./delete-confirmation-dialog.js";import{n as C,t as w}from"./detail-row.js";var T=e(n()),E=t();function D(){let{id:e}=y.useParams(),t=i(),{data:n}=r(h(e)),{data:D}=r(m),O=v(),k=_(),A=g(),[j,M]=(0,T.useState)(!1),[N,P]=(0,T.useState)(``),F=n.Addresses?.[0],I=D.Reservations?.flatMap(e=>e.Instances??[]).filter(e=>e.State?.Name===`running`||e.State?.Name===`stopped`)??[],L=async()=>{try{await A.mutateAsync(e),t({to:`/ec2/describe-addresses`})}finally{M(!1)}},R=async()=>{N&&await O.mutateAsync({allocationId:e,instanceId:N})},z=async()=>{F?.AssociationId&&await k.mutateAsync(F.AssociationId)};if(!F?.AllocationId)return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(o,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),(0,E.jsx)(`p`,{className:`text-muted-foreground`,children:`Elastic IP not found.`})]});let B=!!F.AssociationId,V=a(F.Tags);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(o,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),(A.error??O.error??k.error)&&(0,E.jsx)(b,{error:A.error??O.error??k.error??void 0,msg:`Elastic IP action failed`}),(0,E.jsxs)(`div`,{className:`space-y-6`,children:[(0,E.jsx)(x,{actions:(0,E.jsxs)(p,{disabled:B||A.isPending,onClick:()=>M(!0),size:`sm`,variant:`destructive`,children:[(0,E.jsx)(f,{className:`size-4`}),`Release`]}),subtitle:`Elastic IP Details`,title:V?`${F.AllocationId} (${V})`:F.AllocationId}),(0,E.jsxs)(C,{children:[(0,E.jsx)(C.Header,{children:`Elastic IP Information`}),(0,E.jsxs)(C.Content,{children:[(0,E.jsx)(w,{label:`Allocation ID`,value:F.AllocationId}),(0,E.jsx)(w,{label:`Public IP`,value:F.PublicIp}),(0,E.jsx)(w,{label:`Domain`,value:F.Domain}),(0,E.jsx)(w,{label:`Association ID`,value:F.AssociationId??`—`}),(0,E.jsx)(w,{label:`Instance ID`,value:F.InstanceId??`—`}),(0,E.jsx)(w,{label:`Private IP`,value:F.PrivateIpAddress??`—`})]})]}),(0,E.jsxs)(C,{children:[(0,E.jsx)(C.Header,{children:`Association`}),(0,E.jsx)(C.Content,{children:B?(0,E.jsx)(p,{disabled:k.isPending,onClick:z,size:`sm`,variant:`outline`,children:`Disassociate`}):(0,E.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,E.jsx)(`div`,{className:`flex-1`,children:(0,E.jsxs)(d,{onValueChange:e=>P(e??``),value:N,children:[(0,E.jsx)(u,{className:`w-full`,children:(0,E.jsx)(s,{placeholder:`Select an instance`})}),(0,E.jsx)(l,{children:I.map(e=>{let t=a(e.Tags);return(0,E.jsx)(c,{value:e.InstanceId??``,children:t?`${e.InstanceId} (${t})`:e.InstanceId},e.InstanceId)})})]})}),(0,E.jsx)(p,{disabled:!N||O.isPending,onClick:R,size:`sm`,children:`Associate`})]})})]})]}),(0,E.jsx)(S,{description:`Are you sure you want to release the Elastic IP "${F.AllocationId}" (${F.PublicIp})? This action cannot be undone.`,isPending:A.isPending,onConfirm:L,onOpenChange:M,open:j,title:`Release Elastic IP`})]})}export{D as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./useNavigate.js";import{nn as a}from"./cluster-config.js";import{t as o}from"./back-link.js";import{c as s,i as c,n as l,s as u,t as d}from"./select.js";import{t as f}from"./trash-2.js";import{t as p}from"./button.js";import{l as m,t as h}from"./ec2.js";import{$ as g,U as _,r as v}from"./ec22.js";import{t as y}from"./_id3.js";import{t as b}from"./error-banner.js";import{t as x}from"./page-heading.js";import{t as S}from"./delete-confirmation-dialog.js";import{n as C,t as w}from"./detail-row.js";var T=e(n()),E=t();function D(){let{id:e}=y.useParams(),t=i(),{data:n}=r(h(e)),{data:D}=r(m),O=v(),k=_(),A=g(),[j,M]=(0,T.useState)(!1),[N,P]=(0,T.useState)(``),F=n.Addresses?.[0],I=D.Reservations?.flatMap(e=>e.Instances??[]).filter(e=>e.State?.Name===`running`||e.State?.Name===`stopped`)??[],L=async()=>{try{await A.mutateAsync(e),t({to:`/ec2/describe-addresses`})}finally{M(!1)}},R=async()=>{N&&await O.mutateAsync({allocationId:e,instanceId:N})},z=async()=>{F?.AssociationId&&await k.mutateAsync(F.AssociationId)};if(!F?.AllocationId)return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(o,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),(0,E.jsx)(`p`,{className:`text-muted-foreground`,children:`Elastic IP not found.`})]});let B=!!F.AssociationId,V=a(F.Tags);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(o,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),(A.error??O.error??k.error)&&(0,E.jsx)(b,{error:A.error??O.error??k.error??void 0,msg:`Elastic IP action failed`}),(0,E.jsxs)(`div`,{className:`space-y-6`,children:[(0,E.jsx)(x,{actions:(0,E.jsxs)(p,{disabled:B||A.isPending,onClick:()=>{M(!0)},size:`sm`,variant:`destructive`,children:[(0,E.jsx)(f,{className:`size-4`}),`Release`]}),subtitle:`Elastic IP Details`,title:V?`${F.AllocationId} (${V})`:F.AllocationId}),(0,E.jsxs)(C,{children:[(0,E.jsx)(C.Header,{children:`Elastic IP Information`}),(0,E.jsxs)(C.Content,{children:[(0,E.jsx)(w,{label:`Allocation ID`,value:F.AllocationId}),(0,E.jsx)(w,{label:`Public IP`,value:F.PublicIp}),(0,E.jsx)(w,{label:`Domain`,value:F.Domain}),(0,E.jsx)(w,{label:`Association ID`,value:F.AssociationId??`—`}),(0,E.jsx)(w,{label:`Instance ID`,value:F.InstanceId??`—`}),(0,E.jsx)(w,{label:`Private IP`,value:F.PrivateIpAddress??`—`})]})]}),(0,E.jsxs)(C,{children:[(0,E.jsx)(C.Header,{children:`Association`}),(0,E.jsx)(C.Content,{children:B?(0,E.jsx)(p,{disabled:k.isPending,onClick:z,size:`sm`,variant:`outline`,children:`Disassociate`}):(0,E.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,E.jsx)(`div`,{className:`flex-1`,children:(0,E.jsxs)(d,{onValueChange:e=>{P(e??``)},value:N,children:[(0,E.jsx)(u,{className:`w-full`,children:(0,E.jsx)(s,{placeholder:`Select an instance`})}),(0,E.jsx)(l,{children:I.map(e=>{let t=a(e.Tags);return(0,E.jsx)(c,{value:e.InstanceId??``,children:t?`${e.InstanceId} (${t})`:e.InstanceId},e.InstanceId)})})]})}),(0,E.jsx)(p,{disabled:!N||O.isPending,onClick:R,size:`sm`,children:`Associate`})]})})]})]}),(0,E.jsx)(S,{description:`Are you sure you want to release the Elastic IP "${F.AllocationId}" (${F.PublicIp})? This action cannot be undone.`,isPending:A.isPending,onConfirm:L,onOpenChange:M,open:j,title:`Release Elastic IP`})]})}export{D as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id23.js b/spinifex/services/spinifexui/frontend/dist/assets/_id23.js index dbc489b93..bfaef57f9 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id23.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id23.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{n as i}from"./QueryClientProvider.js";import{t as a}from"./useMutation.js";import{t as o}from"./useSuspenseQuery.js";import{t as s}from"./useNavigate.js";import{a as c}from"./cluster-config.js";import{t as l}from"./back-link.js";import{t as u}from"./circle-arrow-up.js";import{t as d}from"./trash-2.js";import{t as f}from"./button.js";import{n as p}from"./admin-context.js";import{n as m}from"./signed-fetch.js";import{a as h}from"./ec2.js";import{B as g}from"./ec22.js";import{t as _}from"./_id4.js";import{t as v}from"./error-banner.js";import{t as y}from"./page-heading.js";import{a as b,i as x,l as S,n as C,o as w,r as T,s as E,t as D}from"./alert-dialog.js";import{t as O}from"./delete-confirmation-dialog.js";import{t as k}from"./state-badge.js";import{i as A}from"./system-managed.js";import{t as j}from"./ami-details.js";var M=e(n()),N=r();function P(){let e=(0,N.c)(2),t=i(),n;return e[0]===t?n=e[1]:(n={mutationFn:F,onSuccess:()=>{t.invalidateQueries({queryKey:[`ec2`,`images`]})}},e[0]=t,e[1]=n),a(n)}async function F(e){let t=c();if(!t)throw Error(`Not authenticated`);return await m({action:`PromoteImage`,credentials:t,params:{ImageId:e}})}var I=t(),L=`000000000000`;function R(){let{id:e}=_.useParams(),t=s(),{data:n}=o(h(e)),r=n?.Images?.[0],{isAdmin:i}=p(),a=g(),c=P(),[m,N]=(0,M.useState)(!1),[F,R]=(0,M.useState)(!1);if(!r?.ImageId||A(r))return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(l,{to:`/ec2/describe-images`,children:`Back to images`}),(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`Image not found.`})]});let z=r.OwnerId===L;async function B(){try{await a.mutateAsync(e),t({to:`/ec2/describe-images`})}finally{N(!1)}}async function V(){try{await c.mutateAsync(e),R(!1)}catch{}}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(l,{to:`/ec2/describe-images`,children:`Back to images`}),a.error&&(0,I.jsx)(v,{error:a.error,msg:`Failed to deregister image`}),c.error&&(0,I.jsx)(v,{error:c.error,msg:`Failed to promote image`}),(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(y,{actions:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i&&!z&&(0,I.jsxs)(f,{onClick:()=>R(!0),size:`sm`,variant:`outline`,children:[(0,I.jsx)(u,{className:`size-4`}),`Promote to System`]}),(0,I.jsxs)(f,{onClick:()=>N(!0),size:`sm`,variant:`destructive`,children:[(0,I.jsx)(d,{className:`size-4`}),`Deregister`]}),(0,I.jsx)(k,{state:r.State})]}),subtitle:`Image Details`,title:r.ImageId}),(0,I.jsx)(j,{image:r,showExtendedDetails:!0})]}),(0,I.jsx)(O,{description:`Are you sure you want to deregister "${r.ImageId}"? The backing snapshot will not be deleted.`,isPending:a.isPending,onConfirm:B,onOpenChange:N,open:m,title:`Deregister Image`}),(0,I.jsx)(D,{onOpenChange:R,open:F,children:(0,I.jsxs)(x,{children:[(0,I.jsxs)(E,{children:[(0,I.jsx)(S,{children:`Promote to System Image`}),(0,I.jsxs)(b,{children:[`This will make “`,r.ImageId,`” visible to all accounts as a system image. This cannot be undone via the UI.`]})]}),(0,I.jsxs)(w,{children:[(0,I.jsx)(T,{children:`Cancel`}),(0,I.jsx)(C,{disabled:c.isPending,onClick:V,children:c.isPending?`Promoting…`:`Promote`})]})]})})]})}export{R as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{n as i}from"./QueryClientProvider.js";import{t as a}from"./useMutation.js";import{t as o}from"./useSuspenseQuery.js";import{t as s}from"./useNavigate.js";import{a as c}from"./cluster-config.js";import{t as l}from"./back-link.js";import{t as u}from"./circle-arrow-up.js";import{t as d}from"./trash-2.js";import{t as f}from"./button.js";import{n as p}from"./admin-context.js";import{n as m}from"./signed-fetch.js";import{a as h}from"./ec2.js";import{B as g}from"./ec22.js";import{t as _}from"./_id4.js";import{t as v}from"./error-banner.js";import{t as y}from"./page-heading.js";import{a as b,i as x,l as S,n as C,o as w,r as T,s as E,t as D}from"./alert-dialog.js";import{t as O}from"./delete-confirmation-dialog.js";import{t as k}from"./state-badge.js";import{i as A}from"./system-managed.js";import{t as j}from"./ami-details.js";var M=e(n()),N=r();function P(){let e=(0,N.c)(2),t=i(),n;return e[0]===t?n=e[1]:(n={mutationFn:F,onSuccess:()=>{t.invalidateQueries({queryKey:[`ec2`,`images`]})}},e[0]=t,e[1]=n),a(n)}async function F(e){let t=c();if(!t)throw Error(`Not authenticated`);return await m({action:`PromoteImage`,credentials:t,params:{ImageId:e}})}var I=t(),L=`000000000000`;function R(){let{id:e}=_.useParams(),t=s(),{data:n}=o(h(e)),r=n?.Images?.[0],{isAdmin:i}=p(),a=g(),c=P(),[m,N]=(0,M.useState)(!1),[F,R]=(0,M.useState)(!1);if(!r?.ImageId||A(r))return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(l,{to:`/ec2/describe-images`,children:`Back to images`}),(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`Image not found.`})]});let z=r.OwnerId===L;async function B(){try{await a.mutateAsync(e),t({to:`/ec2/describe-images`})}finally{N(!1)}}async function V(){try{await c.mutateAsync(e),R(!1)}catch{}}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(l,{to:`/ec2/describe-images`,children:`Back to images`}),a.error&&(0,I.jsx)(v,{error:a.error,msg:`Failed to deregister image`}),c.error&&(0,I.jsx)(v,{error:c.error,msg:`Failed to promote image`}),(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(y,{actions:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i&&!z&&(0,I.jsxs)(f,{onClick:()=>{R(!0)},size:`sm`,variant:`outline`,children:[(0,I.jsx)(u,{className:`size-4`}),`Promote to System`]}),(0,I.jsxs)(f,{onClick:()=>{N(!0)},size:`sm`,variant:`destructive`,children:[(0,I.jsx)(d,{className:`size-4`}),`Deregister`]}),(0,I.jsx)(k,{state:r.State})]}),subtitle:`Image Details`,title:r.ImageId}),(0,I.jsx)(j,{image:r,showExtendedDetails:!0})]}),(0,I.jsx)(O,{description:`Are you sure you want to deregister "${r.ImageId}"? The backing snapshot will not be deleted.`,isPending:a.isPending,onConfirm:B,onOpenChange:N,open:m,title:`Deregister Image`}),(0,I.jsx)(D,{onOpenChange:R,open:F,children:(0,I.jsxs)(x,{children:[(0,I.jsxs)(E,{children:[(0,I.jsx)(S,{children:`Promote to System Image`}),(0,I.jsxs)(b,{children:[`This will make “`,r.ImageId,`” visible to all accounts as a system image. This cannot be undone via the UI.`]})]}),(0,I.jsxs)(w,{children:[(0,I.jsx)(T,{children:`Cancel`}),(0,I.jsx)(C,{disabled:c.isPending,onClick:V,children:c.isPending?`Promoting…`:`Promote`})]})]})})]})}export{R as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id24.js b/spinifex/services/spinifexui/frontend/dist/assets/_id24.js index d1807dbef..e943cf572 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id24.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id24.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{$t as s,tn as c}from"./cluster-config.js";import{t as l}from"./createLucideIcon.js";import{t as u}from"./back-link.js";import{c as d,i as f,n as p,s as m,t as h}from"./select.js";import{t as g}from"./rotate-cw.js";import{t as _}from"./trash-2.js";import{t as v}from"./button.js";import{t as y}from"./input.js";import{n as b}from"./admin-context.js";import{a as x,c as S,i as C,s as w}from"./ec2.js";import{J as T,K as E,W as D,Z as O,d as k,i as ee,it as A,nt as j,rt as te}from"./ec22.js";import{f as ne}from"./iam2.js";import{t as re}from"./_id5.js";import{t as M}from"./error-banner.js";import{t as ie}from"./page-heading.js";import{a as ae,t as oe}from"./field.js";import{a as se,i as ce,l as le,n as ue,o as de,r as fe,s as pe,t as me}from"./alert-dialog.js";import{t as he}from"./delete-confirmation-dialog.js";import{n as N,t as P}from"./detail-row.js";import{t as ge}from"./state-badge.js";import{t as _e}from"./ami-details.js";import{t as ve}from"./gpu-instance-type-select.js";import{r as ye}from"./admin.js";import{t as be}from"./textarea.js";var xe=l(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Se=l(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Ce=l(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),we=l(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Te=l(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ee=r(),F=e(n(),1),I=t();function De(e){let t=(0,Ee.c)(36),{instanceId:n,open:r,onOpenChange:i}=e,a=k(),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)(null),f;t[0]===i?f=t[1]:(f=function(e){e||(s(``),l(``),d(null)),i(e)},t[0]=i,t[1]=f);let p=f,m;t[2]!==a||t[3]!==c||t[4]!==o||t[5]!==n?(m=async function(){try{let e=await a.mutateAsync({instanceId:n,name:o,description:c||void 0});d(e.ImageId??null),s(``),l(``)}catch{}},t[2]=a,t[3]=c,t[4]=o,t[5]=n,t[6]=m):m=t[6];let h=m,g=u?`Image Created`:`Create Image (AMI)`,_;t[7]===g?_=t[8]:(_=(0,I.jsx)(le,{children:g}),t[7]=g,t[8]=_);let v=u?`Image "${u}" was created successfully.`:`Create an AMI from instance "${n}".`,b;t[9]===v?b=t[10]:(b=(0,I.jsx)(se,{children:v}),t[9]=v,t[10]=b);let x;t[11]!==_||t[12]!==b?(x=(0,I.jsxs)(pe,{children:[_,b]}),t[11]=_,t[12]=b,t[13]=x):x=t[13];let S;t[14]!==u||t[15]!==c||t[16]!==o?(S=!u&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(oe,{children:[(0,I.jsx)(ae,{children:(0,I.jsx)(`label`,{htmlFor:`imageName`,children:`Name`})}),(0,I.jsx)(y,{id:`imageName`,onChange:e=>s(e.target.value),placeholder:`my-image`,value:o})]}),(0,I.jsxs)(oe,{children:[(0,I.jsx)(ae,{children:(0,I.jsx)(`label`,{htmlFor:`imageDescription`,children:`Description`})}),(0,I.jsx)(be,{id:`imageDescription`,onChange:e=>l(e.target.value),placeholder:`Optional description`,rows:2,value:c})]})]}),t[14]=u,t[15]=c,t[16]=o,t[17]=S):S=t[17];let C=u?`Close`:`Cancel`,w;t[18]===C?w=t[19]:(w=(0,I.jsx)(fe,{children:C}),t[18]=C,t[19]=w);let T;t[20]!==a||t[21]!==u||t[22]!==h||t[23]!==o?(T=!u&&(0,I.jsx)(ue,{disabled:a.isPending||!o.trim(),onClick:h,children:a.isPending?`Creating…`:`Create Image`}),t[20]=a,t[21]=u,t[22]=h,t[23]=o,t[24]=T):T=t[24];let E;t[25]!==w||t[26]!==T?(E=(0,I.jsxs)(de,{children:[w,T]}),t[25]=w,t[26]=T,t[27]=E):E=t[27];let D;t[28]!==E||t[29]!==x||t[30]!==S?(D=(0,I.jsxs)(ce,{children:[x,S,E]}),t[28]=E,t[29]=x,t[30]=S,t[31]=D):D=t[31];let O;return t[32]!==p||t[33]!==r||t[34]!==D?(O=(0,I.jsx)(me,{onOpenChange:p,open:r,children:D}),t[32]=p,t[33]=r,t[34]=D,t[35]=O):O=t[35],O}function Oe(e){let t=(0,Ee.c)(22),{gpu:n}=e;if(!n)return null;let r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,I.jsx)(N.Header,{children:`GPU`}),t[0]=r):r=t[0];let i;t[1]===n.model?i=t[2]:(i=(0,I.jsx)(P,{label:`Model`,value:n.model}),t[1]=n.model,t[2]=i);let a;t[3]===n.vram_mib?a=t[4]:(a=c(n.vram_mib),t[3]=n.vram_mib,t[4]=a);let o;t[5]===a?o=t[6]:(o=(0,I.jsx)(P,{label:`VRAM`,value:a}),t[5]=a,t[6]=o);let s=n.profile?`MIG slice`:`PCIe passthrough`,l;t[7]===s?l=t[8]:(l=(0,I.jsx)(P,{label:`Attachment`,value:s}),t[7]=s,t[8]=l);let u;t[9]===n.profile?u=t[10]:(u=n.profile&&(0,I.jsx)(P,{label:`Profile`,value:n.profile}),t[9]=n.profile,t[10]=u);let d;t[11]===n.mdev_path?d=t[12]:(d=n.mdev_path&&(0,I.jsx)(P,{label:`Mdev path`,value:n.mdev_path}),t[11]=n.mdev_path,t[12]=d);let f;t[13]===n.pci_address?f=t[14]:(f=n.pci_address&&(0,I.jsx)(P,{label:`PCI address`,value:n.pci_address}),t[13]=n.pci_address,t[14]=f);let p;return t[15]!==i||t[16]!==o||t[17]!==l||t[18]!==u||t[19]!==d||t[20]!==f?(p=(0,I.jsxs)(N,{children:[r,(0,I.jsxs)(N.Content,{children:[i,o,l,u,d,f]})]}),t[15]=i,t[16]=o,t[17]=l,t[18]=u,t[19]=d,t[20]=f,t[21]=p):p=t[21],p}function ke(e){let t=(0,Ee.c)(31),{instanceId:n}=e,r;t[0]===n?r=t[1]:(r=C(n),t[0]=n,t[1]=r);let{data:a}=i(r),{data:s}=i(ne),c=ee(),l=D(),[u,f]=(0,F.useState)(``),g;t[2]===a?.IamInstanceProfileAssociations?g=t[3]:(g=a?.IamInstanceProfileAssociations?.find(je),t[2]=a?.IamInstanceProfileAssociations,t[3]=g);let _=g,y;t[4]===s?.InstanceProfiles?y=t[5]:(y=s?.InstanceProfiles??[],t[4]=s?.InstanceProfiles,t[5]=y);let b=y,x;t[6]!==c||t[7]!==n||t[8]!==u?(x=async()=>{u&&(await c.mutateAsync({instanceId:n,instanceProfileName:u}),f(``))},t[6]=c,t[7]=n,t[8]=u,t[9]=x):x=t[9];let S=x,w;t[10]!==_||t[11]!==l||t[12]!==n?(w=async()=>{_?.AssociationId&&await l.mutateAsync({associationId:_.AssociationId,instanceId:n})},t[10]=_,t[11]=l,t[12]=n,t[13]=w):w=t[13];let T=w,E;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,I.jsx)(N.Header,{children:`IAM Role`}),t[14]=E):E=t[14];let O;t[15]===c.error?O=t[16]:(O=c.error&&(0,I.jsx)(`div`,{className:`col-span-2`,children:(0,I.jsx)(M,{error:c.error,msg:`Failed to associate instance profile`})}),t[15]=c.error,t[16]=O);let k;t[17]===l.error?k=t[18]:(k=l.error&&(0,I.jsx)(`div`,{className:`col-span-2`,children:(0,I.jsx)(M,{error:l.error,msg:`Failed to disassociate instance profile`})}),t[17]=l.error,t[18]=k);let A;t[19]!==c.isPending||t[20]!==_||t[21]!==l.isPending||t[22]!==S||t[23]!==T||t[24]!==b||t[25]!==u?(A=_?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(P,{label:`Instance Profile ARN`,value:_.IamInstanceProfile?.Arn}),(0,I.jsx)(P,{label:`State`,value:(0,I.jsx)(ge,{state:_.State})}),(0,I.jsx)(`div`,{className:`col-span-2 flex justify-end`,children:(0,I.jsx)(v,{disabled:l.isPending,onClick:T,size:`sm`,variant:`destructive`,children:l.isPending?`Detaching…`:`Detach`})})]}):(0,I.jsxs)(`div`,{className:`col-span-2 space-y-3`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No instance profile is associated. Associate one to flow role credentials to this instance via IMDS.`}),b.length>0?(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(h,{onValueChange:e=>f(e??``),value:u,children:[(0,I.jsx)(m,{className:`w-full`,children:(0,I.jsx)(d,{placeholder:`Select an instance profile`})}),(0,I.jsx)(p,{children:b.map(Ae)})]}),(0,I.jsx)(v,{disabled:!u||c.isPending,onClick:S,size:`sm`,children:c.isPending?`Associating…`:`Associate`})]}):(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No instance profiles exist.`,` `,(0,I.jsx)(o,{className:`text-primary hover:underline`,to:`/iam/create-instance-profile`,children:`Create one`}),` `,`first.`]})]}),t[19]=c.isPending,t[20]=_,t[21]=l.isPending,t[22]=S,t[23]=T,t[24]=b,t[25]=u,t[26]=A):A=t[26];let j;return t[27]!==O||t[28]!==k||t[29]!==A?(j=(0,I.jsxs)(N,{children:[E,(0,I.jsxs)(N.Content,{children:[O,k,A]})]}),t[27]=O,t[28]=k,t[29]=A,t[30]=j):j=t[30],j}function Ae(e){return(0,I.jsx)(f,{value:e.InstanceProfileName??``,children:e.InstanceProfileName},e.InstanceProfileName)}function je(e){return e.State===`associating`||e.State===`associated`}var L=new Set([`pending`,`stopping`,`shutting-down`,`terminated`]);function Me(e){let t=(0,Ee.c)(43),{instanceId:n,state:r}=e,i=j(),a=te(),o=O(),s=A(),[c,l]=(0,F.useState)(!1),u=L.has(r??``),d;t[0]!==n||t[1]!==s?(d=()=>{s.mutate(n,{onSettled:()=>l(!1)})},t[0]=n,t[1]=s,t[2]=d):d=t[2];let f=d;if(u&&r!==`terminated`){let e;return t[3]===r?e=t[4]:(e=(0,I.jsx)(`div`,{className:`rounded-lg border bg-muted/50 p-4`,children:(0,I.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[`Instance is `,r,`. Actions will be available once the operation completes.`]})}),t[3]=r,t[4]=e),e}if(r===`terminated`){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,I.jsx)(`div`,{className:`rounded-lg border bg-muted/50 p-4`,children:(0,I.jsx)(`p`,{className:`text-center text-sm text-muted-foreground`,children:`This instance has been terminated and cannot be managed.`})}),t[5]=e):e=t[5],e}let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,I.jsx)(`h2`,{className:`mb-4 font-semibold`,children:`Instance Actions`}),t[6]=p):p=t[6];let m;t[7]===i.error?m=t[8]:(m=i.error&&(0,I.jsx)(M,{error:i.error,msg:`Failed to start instance`}),t[7]=i.error,t[8]=m);let h;t[9]===a.error?h=t[10]:(h=a.error&&(0,I.jsx)(M,{error:a.error,msg:`Failed to stop instance`}),t[9]=a.error,t[10]=h);let y;t[11]===o.error?y=t[12]:(y=o.error&&(0,I.jsx)(M,{error:o.error,msg:`Failed to reboot instance`}),t[11]=o.error,t[12]=y);let b;t[13]===s.error?b=t[14]:(b=s.error&&(0,I.jsx)(M,{error:s.error,msg:`Failed to terminate instance`}),t[13]=s.error,t[14]=b);let x;t[15]!==n||t[16]!==i||t[17]!==r?(x=r===`stopped`&&(0,I.jsxs)(v,{disabled:i.isPending,onClick:()=>i.mutate(n),size:`sm`,variant:`default`,children:[(0,I.jsx)(Ce,{className:`size-4`}),i.isPending?`Starting`:`Start`]}),t[15]=n,t[16]=i,t[17]=r,t[18]=x):x=t[18];let S;t[19]!==n||t[20]!==o||t[21]!==r||t[22]!==a?(S=r===`running`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(v,{disabled:a.isPending,onClick:()=>a.mutate(n),size:`sm`,variant:`outline`,children:[(0,I.jsx)(Se,{className:`size-4`}),a.isPending?`Stopping`:`Stop`]}),(0,I.jsxs)(v,{disabled:o.isPending,onClick:()=>o.mutate(n),size:`sm`,variant:`outline`,children:[(0,I.jsx)(g,{className:`size-4`}),o.isPending?`Rebooting`:`Reboot`]})]}),t[19]=n,t[20]=o,t[21]=r,t[22]=a,t[23]=S):S=t[23];let C;t[24]!==r||t[25]!==s.isPending?(C=(r===`stopped`||r===`running`)&&(0,I.jsxs)(v,{disabled:s.isPending,onClick:()=>l(!0),size:`sm`,variant:`destructive`,children:[(0,I.jsx)(_,{className:`size-4`}),s.isPending?`Terminating`:`Terminate`]}),t[24]=r,t[25]=s.isPending,t[26]=C):C=t[26];let w;t[27]!==x||t[28]!==S||t[29]!==C?(w=(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[x,S,C]}),t[27]=x,t[28]=S,t[29]=C,t[30]=w):w=t[30];let T=`Are you sure you want to terminate the instance "${n}"? This action cannot be undone.`,E;t[31]!==f||t[32]!==c||t[33]!==T||t[34]!==s.isPending?(E=(0,I.jsx)(he,{confirmLabel:`Terminate`,description:T,isPending:s.isPending,onConfirm:f,onOpenChange:l,open:c,pendingLabel:`Terminating…`,title:`Terminate Instance`}),t[31]=f,t[32]=c,t[33]=T,t[34]=s.isPending,t[35]=E):E=t[35];let D;return t[36]!==w||t[37]!==E||t[38]!==m||t[39]!==h||t[40]!==y||t[41]!==b?(D=(0,I.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[p,m,h,y,b,w,E]}),t[36]=w,t[37]=E,t[38]=m,t[39]=h,t[40]=y,t[41]=b,t[42]=D):D=t[42],D}function R(){let e=(0,Ee.c)(136),{id:t}=re.useParams(),{isAdmin:n}=b(),r;e[0]===t?r=e[1]:(r=w(t),e[0]=t,e[1]=r);let{data:c}=a(r),l=c.Reservations?.[0]?.Instances?.[0],d=l?.ImageId,f;e[2]===d?f=e[3]:(f=x(d),e[2]=d,e[3]=f);let{data:p}=a(f),m=p?.Images?.[0],{data:h}=a(S),g;e[4]===n?g=e[5]:(g={...ye,enabled:n,refetchInterval:5e3},e[4]=n,e[5]=g);let{data:_}=i(g),y;e[6]!==t||e[7]!==_?.vms?(y=_?.vms?.find(e=>e.instance_id===t),e[6]=t,e[7]=_?.vms,e[8]=y):y=e[8];let C=y,D=T(),O=E(),[k,ee]=(0,F.useState)(!1),[A,j]=(0,F.useState)(``),[te,ne]=(0,F.useState)(!1),[he,be]=(0,F.useState)(null),[Se,Ce]=(0,F.useState)(!1);if(!l?.InstanceId){let t;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u,{to:`/ec2/describe-instances`,children:`Back to instances`}),(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`Instance not found.`})]}),e[9]=t):t=e[9],t}let Ae;e[10]===l.LaunchTime?Ae=e[11]:(Ae=s(l.LaunchTime),e[10]=l.LaunchTime,e[11]=Ae);let je=Ae,L=l.State?.Name===`running`,R=l.State?.Name===`stopped`,Fe;e[12]!==t||e[13]!==D||e[14]!==A?(Fe=async function(){try{await D.mutateAsync({instanceId:t,instanceType:A}),ee(!1),j(``)}catch{}},e[12]=t,e[13]=D,e[14]=A,e[15]=Fe):Fe=e[15];let Ie=Fe,Le;e[16]!==O||e[17]!==t?(Le=async function(){try{let e=await O.mutateAsync(t),n=e.Output?atob(e.Output):`(no output)`;be(n),ne(!0)}catch{}},e[16]=O,e[17]=t,e[18]=Le):Le=e[18];let Re=Le,ze;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,I.jsx)(u,{to:`/ec2/describe-instances`,children:`Back to instances`}),e[19]=ze):ze=e[19];let z;e[20]===D.error?z=e[21]:(z=D.error&&(0,I.jsx)(M,{error:D.error,msg:`Failed to modify instance`}),e[20]=D.error,e[21]=z);let B;e[22]===O.error?B=e[23]:(B=O.error&&(0,I.jsx)(M,{error:O.error,msg:`Failed to get console output`}),e[22]=O.error,e[23]=B);let V;e[24]!==O.isPending||e[25]!==Re||e[26]!==L?(V=L&&(0,I.jsxs)(v,{disabled:O.isPending,onClick:Re,size:`sm`,variant:`outline`,children:[(0,I.jsx)(Te,{className:`size-4`}),O.isPending?`Fetching…`:`View Console`]}),e[24]=O.isPending,e[25]=Re,e[26]=L,e[27]=V):V=e[27];let H;e[28]!==L||e[29]!==R?(H=(L||R)&&(0,I.jsxs)(v,{onClick:()=>Ce(!0),size:`sm`,variant:`outline`,children:[(0,I.jsx)(xe,{className:`size-4`}),`Create Image`]}),e[28]=L,e[29]=R,e[30]=H):H=e[30];let U;e[31]!==l.InstanceType||e[32]!==R?(U=R&&(0,I.jsxs)(v,{onClick:()=>{j(l.InstanceType??``),ee(!0)},size:`sm`,variant:`outline`,children:[(0,I.jsx)(we,{className:`size-4`}),`Modify Instance`]}),e[31]=l.InstanceType,e[32]=R,e[33]=U):U=e[33];let Be=l.State?.Name,W;e[34]===Be?W=e[35]:(W=(0,I.jsx)(ge,{state:Be}),e[34]=Be,e[35]=W);let G;e[36]!==V||e[37]!==H||e[38]!==U||e[39]!==W?(G=(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V,H,U,W]}),e[36]=V,e[37]=H,e[38]=U,e[39]=W,e[40]=G):G=e[40];let K;e[41]!==l.InstanceId||e[42]!==G?(K=(0,I.jsx)(ie,{actions:G,subtitle:`Instance Details`,title:l.InstanceId}),e[41]=l.InstanceId,e[42]=G,e[43]=K):K=e[43];let Ve=l.State?.Name,q;e[44]!==l.InstanceId||e[45]!==Ve?(q=(0,I.jsx)(Me,{instanceId:l.InstanceId,state:Ve}),e[44]=l.InstanceId,e[45]=Ve,e[46]=q):q=e[46];let J;e[47]!==he||e[48]!==te?(J=te&&he!==null&&(0,I.jsxs)(N,{children:[(0,I.jsx)(N.Header,{children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[`Console Output`,(0,I.jsx)(v,{onClick:()=>{ne(!1),be(null)},size:`sm`,variant:`ghost`,children:`Hide`})]})}),(0,I.jsx)(`div`,{className:`p-4`,children:(0,I.jsx)(`pre`,{className:`max-h-96 overflow-y-auto rounded bg-muted p-3 font-mono text-xs whitespace-pre-wrap`,children:he})})]}),e[47]=he,e[48]=te,e[49]=J):J=e[49];let He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,I.jsx)(N.Header,{children:`Instance Information`}),e[50]=He):He=e[50];let Y;e[51]===l.InstanceId?Y=e[52]:(Y=(0,I.jsx)(P,{label:`Instance ID`,value:l.InstanceId}),e[51]=l.InstanceId,e[52]=Y);let X;e[53]===l.InstanceType?X=e[54]:(X=(0,I.jsx)(P,{label:`Instance Type`,value:l.InstanceType}),e[53]=l.InstanceType,e[54]=X);let Ue=l.State?.Name,We;e[55]===Ue?We=e[56]:(We=(0,I.jsx)(P,{label:`Instance State`,value:Ue}),e[55]=Ue,e[56]=We);let Ge;e[57]===l.State?.Code?Ge=e[58]:(Ge=l.State?.Code?.toString(),e[57]=l.State?.Code,e[58]=Ge);let Ke;e[59]===Ge?Ke=e[60]:(Ke=(0,I.jsx)(P,{label:`State Code`,value:Ge}),e[59]=Ge,e[60]=Ke);let qe;e[61]===je?qe=e[62]:(qe=(0,I.jsx)(P,{label:`Launch Time`,value:je}),e[61]=je,e[62]=qe);let Je=l.Placement?.AvailabilityZone,Ye;e[63]===Je?Ye=e[64]:(Ye=(0,I.jsx)(P,{label:`Availability Zone`,value:Je}),e[63]=Je,e[64]=Ye);let Xe;e[65]===l.Placement?Xe=e[66]:(Xe=l.Placement?.GroupName?(0,I.jsx)(o,{className:`text-primary hover:underline`,to:`/ec2/describe-placement-groups`,children:l.Placement.GroupName}):void 0,e[65]=l.Placement,e[66]=Xe);let Ze;e[67]===Xe?Ze=e[68]:(Ze=(0,I.jsx)(P,{label:`Placement Group`,value:Xe}),e[67]=Xe,e[68]=Ze);let Qe;e[69]!==Y||e[70]!==X||e[71]!==We||e[72]!==Ke||e[73]!==qe||e[74]!==Ye||e[75]!==Ze?(Qe=(0,I.jsxs)(N,{children:[He,(0,I.jsxs)(N.Content,{children:[Y,X,We,Ke,qe,Ye,Ze]})]}),e[69]=Y,e[70]=X,e[71]=We,e[72]=Ke,e[73]=qe,e[74]=Ye,e[75]=Ze,e[76]=Qe):Qe=e[76];let $e;e[77]!==l.KeyName||e[78]!==l.PrivateDnsName||e[79]!==l.PrivateIpAddress||e[80]!==l.PublicDnsName||e[81]!==l.PublicIpAddress||e[82]!==l.SecurityGroups||e[83]!==l.SubnetId||e[84]!==l.VpcId?($e=(l.PrivateIpAddress||l.PublicIpAddress||l.VpcId||l.SubnetId||l.SecurityGroups&&l.SecurityGroups.length>0)&&(0,I.jsxs)(N,{children:[(0,I.jsx)(N.Header,{children:`Network & Security`}),(0,I.jsxs)(N.Content,{children:[(0,I.jsx)(P,{label:`Private IP Address`,value:l.PrivateIpAddress}),(0,I.jsx)(P,{label:`Public IP Address`,value:l.PublicIpAddress}),(0,I.jsx)(P,{label:`Private DNS`,value:l.PrivateDnsName}),(0,I.jsx)(P,{label:`Public DNS`,value:l.PublicDnsName}),(0,I.jsx)(P,{label:`VPC ID`,value:l.VpcId?(0,I.jsx)(o,{className:`text-primary hover:underline`,params:{id:l.VpcId},to:`/ec2/describe-vpcs/$id`,children:l.VpcId}):void 0}),(0,I.jsx)(P,{label:`Subnet ID`,value:l.SubnetId?(0,I.jsx)(o,{className:`text-primary hover:underline`,params:{id:l.SubnetId},to:`/ec2/describe-subnets/$id`,children:l.SubnetId}):void 0}),(0,I.jsx)(P,{label:`Key Name`,value:l.KeyName}),(0,I.jsx)(P,{label:`Security Groups`,value:l.SecurityGroups?.map(Pe).join(`, `)})]})]}),e[77]=l.KeyName,e[78]=l.PrivateDnsName,e[79]=l.PrivateIpAddress,e[80]=l.PublicDnsName,e[81]=l.PublicIpAddress,e[82]=l.SecurityGroups,e[83]=l.SubnetId,e[84]=l.VpcId,e[85]=$e):$e=e[85];let et;e[86]===l.InstanceId?et=e[87]:(et=(0,I.jsx)(ke,{instanceId:l.InstanceId}),e[86]=l.InstanceId,e[87]=et);let tt;e[88]!==n||e[89]!==C?.gpu?(tt=n&&(0,I.jsx)(Oe,{gpu:C?.gpu}),e[88]=n,e[89]=C?.gpu,e[90]=tt):tt=e[90];let nt;e[91]===l.BlockDeviceMappings?nt=e[92]:(nt=l.BlockDeviceMappings&&l.BlockDeviceMappings.length>0&&(0,I.jsxs)(N,{children:[(0,I.jsx)(N.Header,{children:`Block Device Mappings`}),l.BlockDeviceMappings.map(Ne)]}),e[91]=l.BlockDeviceMappings,e[92]=nt);let rt;e[93]===m?rt=e[94]:(rt=m&&(0,I.jsx)(_e,{image:m}),e[93]=m,e[94]=rt);let Z;e[95]!==K||e[96]!==q||e[97]!==J||e[98]!==Qe||e[99]!==$e||e[100]!==et||e[101]!==tt||e[102]!==nt||e[103]!==rt?(Z=(0,I.jsxs)(`div`,{className:`space-y-6`,children:[K,q,J,Qe,$e,et,tt,nt,rt]}),e[95]=K,e[96]=q,e[97]=J,e[98]=Qe,e[99]=$e,e[100]=et,e[101]=tt,e[102]=nt,e[103]=rt,e[104]=Z):Z=e[104];let it;e[105]===Symbol.for(`react.memo_cache_sentinel`)?(it=e=>{e||(ee(!1),j(``))},e[105]=it):it=e[105];let at;e[106]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,I.jsx)(le,{children:`Modify Instance`}),e[106]=at):at=e[106];let ot;e[107]===l.InstanceId?ot=e[108]:(ot=(0,I.jsxs)(pe,{children:[at,(0,I.jsxs)(se,{children:[`Select a new instance type for "`,l.InstanceId,`". The instance must be stopped to modify its attributes.`]})]}),e[107]=l.InstanceId,e[108]=ot);let st;e[109]===Symbol.for(`react.memo_cache_sentinel`)?(st=(0,I.jsx)(ae,{children:(0,I.jsx)(`label`,{htmlFor:`instanceType`,children:`Instance Type`})}),e[109]=st):st=e[109];let ct;e[110]===h.InstanceTypes?ct=e[111]:(ct=h.InstanceTypes??[],e[110]=h.InstanceTypes,e[111]=ct);let lt;e[112]!==A||e[113]!==ct?(lt=(0,I.jsxs)(oe,{children:[st,(0,I.jsx)(ve,{className:`w-full`,id:`instanceType`,instanceTypes:ct,onValueChange:j,value:A})]}),e[112]=A,e[113]=ct,e[114]=lt):lt=e[114];let ut;e[115]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,I.jsx)(fe,{children:`Cancel`}),e[115]=ut):ut=e[115];let dt=D.isPending||!A||A===l.InstanceType,ft=D.isPending?`Saving…`:`Save Changes`,pt;e[116]!==Ie||e[117]!==dt||e[118]!==ft?(pt=(0,I.jsxs)(de,{children:[ut,(0,I.jsx)(ue,{disabled:dt,onClick:Ie,children:ft})]}),e[116]=Ie,e[117]=dt,e[118]=ft,e[119]=pt):pt=e[119];let mt;e[120]!==ot||e[121]!==lt||e[122]!==pt?(mt=(0,I.jsxs)(ce,{children:[ot,lt,pt]}),e[120]=ot,e[121]=lt,e[122]=pt,e[123]=mt):mt=e[123];let Q;e[124]!==k||e[125]!==mt?(Q=(0,I.jsx)(me,{onOpenChange:it,open:k,children:mt}),e[124]=k,e[125]=mt,e[126]=Q):Q=e[126];let $;e[127]!==l.InstanceId||e[128]!==Se?($=(0,I.jsx)(De,{instanceId:l.InstanceId,onOpenChange:Ce,open:Se}),e[127]=l.InstanceId,e[128]=Se,e[129]=$):$=e[129];let ht;return e[130]!==B||e[131]!==Z||e[132]!==Q||e[133]!==$||e[134]!==z?(ht=(0,I.jsxs)(I.Fragment,{children:[ze,z,B,Z,Q,$]}),e[130]=B,e[131]=Z,e[132]=Q,e[133]=$,e[134]=z,e[135]=ht):ht=e[135],ht}function Ne(e){return(0,I.jsxs)(N.Content,{children:[(0,I.jsx)(P,{label:`Device Name`,value:e.DeviceName}),(0,I.jsx)(P,{label:`Volume ID`,value:e.Ebs?.VolumeId?(0,I.jsx)(o,{className:`text-primary hover:underline`,params:{id:e.Ebs.VolumeId},to:`/ec2/describe-volumes/$id`,children:e.Ebs.VolumeId}):void 0}),(0,I.jsx)(P,{label:`Status`,value:e.Ebs?.Status}),(0,I.jsx)(P,{label:`Attach Time`,value:s(e.Ebs?.AttachTime)}),(0,I.jsx)(P,{label:`Delete on Termination`,value:e.Ebs?.DeleteOnTermination?`Yes`:`No`})]},e.DeviceName)}function Pe(e){return e.GroupName}export{R as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{$t as s,tn as c}from"./cluster-config.js";import{t as l}from"./createLucideIcon.js";import{t as u}from"./back-link.js";import{c as d,i as f,n as p,s as m,t as h}from"./select.js";import{t as g}from"./rotate-cw.js";import{t as _}from"./trash-2.js";import{t as v}from"./button.js";import{t as y}from"./input.js";import{n as b}from"./admin-context.js";import{a as x,c as S,i as C,s as w}from"./ec2.js";import{J as T,K as E,W as D,Z as O,d as k,i as ee,it as A,nt as j,rt as te}from"./ec22.js";import{f as ne}from"./iam2.js";import{t as re}from"./_id5.js";import{t as M}from"./error-banner.js";import{t as ie}from"./page-heading.js";import{a as ae,t as oe}from"./field.js";import{a as se,i as ce,l as le,n as ue,o as de,r as fe,s as pe,t as me}from"./alert-dialog.js";import{t as he}from"./delete-confirmation-dialog.js";import{n as N,t as P}from"./detail-row.js";import{t as ge}from"./state-badge.js";import{t as _e}from"./ami-details.js";import{t as ve}from"./gpu-instance-type-select.js";import{r as ye}from"./admin.js";import{t as be}from"./textarea.js";var xe=l(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Se=l(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Ce=l(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),we=l(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Te=l(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ee=r(),F=e(n(),1),I=t();function De(e){let t=(0,Ee.c)(36),{instanceId:n,open:r,onOpenChange:i}=e,a=k(),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)(null),f;t[0]===i?f=t[1]:(f=function(e){e||(s(``),l(``),d(null)),i(e)},t[0]=i,t[1]=f);let p=f,m;t[2]!==a||t[3]!==c||t[4]!==o||t[5]!==n?(m=async function(){try{let e=await a.mutateAsync({instanceId:n,name:o,description:c||void 0});d(e.ImageId??null),s(``),l(``)}catch{}},t[2]=a,t[3]=c,t[4]=o,t[5]=n,t[6]=m):m=t[6];let h=m,g=u?`Image Created`:`Create Image (AMI)`,_;t[7]===g?_=t[8]:(_=(0,I.jsx)(le,{children:g}),t[7]=g,t[8]=_);let v=u?`Image "${u}" was created successfully.`:`Create an AMI from instance "${n}".`,b;t[9]===v?b=t[10]:(b=(0,I.jsx)(se,{children:v}),t[9]=v,t[10]=b);let x;t[11]!==_||t[12]!==b?(x=(0,I.jsxs)(pe,{children:[_,b]}),t[11]=_,t[12]=b,t[13]=x):x=t[13];let S;t[14]!==u||t[15]!==c||t[16]!==o?(S=!u&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(oe,{children:[(0,I.jsx)(ae,{children:(0,I.jsx)(`label`,{htmlFor:`imageName`,children:`Name`})}),(0,I.jsx)(y,{id:`imageName`,onChange:e=>{s(e.target.value)},placeholder:`my-image`,value:o})]}),(0,I.jsxs)(oe,{children:[(0,I.jsx)(ae,{children:(0,I.jsx)(`label`,{htmlFor:`imageDescription`,children:`Description`})}),(0,I.jsx)(be,{id:`imageDescription`,onChange:e=>{l(e.target.value)},placeholder:`Optional description`,rows:2,value:c})]})]}),t[14]=u,t[15]=c,t[16]=o,t[17]=S):S=t[17];let C=u?`Close`:`Cancel`,w;t[18]===C?w=t[19]:(w=(0,I.jsx)(fe,{children:C}),t[18]=C,t[19]=w);let T;t[20]!==a||t[21]!==u||t[22]!==h||t[23]!==o?(T=!u&&(0,I.jsx)(ue,{disabled:a.isPending||!o.trim(),onClick:h,children:a.isPending?`Creating…`:`Create Image`}),t[20]=a,t[21]=u,t[22]=h,t[23]=o,t[24]=T):T=t[24];let E;t[25]!==w||t[26]!==T?(E=(0,I.jsxs)(de,{children:[w,T]}),t[25]=w,t[26]=T,t[27]=E):E=t[27];let D;t[28]!==E||t[29]!==x||t[30]!==S?(D=(0,I.jsxs)(ce,{children:[x,S,E]}),t[28]=E,t[29]=x,t[30]=S,t[31]=D):D=t[31];let O;return t[32]!==p||t[33]!==r||t[34]!==D?(O=(0,I.jsx)(me,{onOpenChange:p,open:r,children:D}),t[32]=p,t[33]=r,t[34]=D,t[35]=O):O=t[35],O}function Oe(e){let t=(0,Ee.c)(22),{gpu:n}=e;if(!n)return null;let r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,I.jsx)(N.Header,{children:`GPU`}),t[0]=r):r=t[0];let i;t[1]===n.model?i=t[2]:(i=(0,I.jsx)(P,{label:`Model`,value:n.model}),t[1]=n.model,t[2]=i);let a;t[3]===n.vram_mib?a=t[4]:(a=c(n.vram_mib),t[3]=n.vram_mib,t[4]=a);let o;t[5]===a?o=t[6]:(o=(0,I.jsx)(P,{label:`VRAM`,value:a}),t[5]=a,t[6]=o);let s=n.profile?`MIG slice`:`PCIe passthrough`,l;t[7]===s?l=t[8]:(l=(0,I.jsx)(P,{label:`Attachment`,value:s}),t[7]=s,t[8]=l);let u;t[9]===n.profile?u=t[10]:(u=n.profile&&(0,I.jsx)(P,{label:`Profile`,value:n.profile}),t[9]=n.profile,t[10]=u);let d;t[11]===n.mdev_path?d=t[12]:(d=n.mdev_path&&(0,I.jsx)(P,{label:`Mdev path`,value:n.mdev_path}),t[11]=n.mdev_path,t[12]=d);let f;t[13]===n.pci_address?f=t[14]:(f=n.pci_address&&(0,I.jsx)(P,{label:`PCI address`,value:n.pci_address}),t[13]=n.pci_address,t[14]=f);let p;return t[15]!==i||t[16]!==o||t[17]!==l||t[18]!==u||t[19]!==d||t[20]!==f?(p=(0,I.jsxs)(N,{children:[r,(0,I.jsxs)(N.Content,{children:[i,o,l,u,d,f]})]}),t[15]=i,t[16]=o,t[17]=l,t[18]=u,t[19]=d,t[20]=f,t[21]=p):p=t[21],p}function ke(e){let t=(0,Ee.c)(31),{instanceId:n}=e,r;t[0]===n?r=t[1]:(r=C(n),t[0]=n,t[1]=r);let{data:a}=i(r),{data:s}=i(ne),c=ee(),l=D(),[u,f]=(0,F.useState)(``),g;t[2]===a?.IamInstanceProfileAssociations?g=t[3]:(g=a?.IamInstanceProfileAssociations?.find(je),t[2]=a?.IamInstanceProfileAssociations,t[3]=g);let _=g,y;t[4]===s?.InstanceProfiles?y=t[5]:(y=s?.InstanceProfiles??[],t[4]=s?.InstanceProfiles,t[5]=y);let b=y,x;t[6]!==c||t[7]!==n||t[8]!==u?(x=async()=>{u&&(await c.mutateAsync({instanceId:n,instanceProfileName:u}),f(``))},t[6]=c,t[7]=n,t[8]=u,t[9]=x):x=t[9];let S=x,w;t[10]!==_||t[11]!==l||t[12]!==n?(w=async()=>{_?.AssociationId&&await l.mutateAsync({associationId:_.AssociationId,instanceId:n})},t[10]=_,t[11]=l,t[12]=n,t[13]=w):w=t[13];let T=w,E;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,I.jsx)(N.Header,{children:`IAM Role`}),t[14]=E):E=t[14];let O;t[15]===c.error?O=t[16]:(O=c.error&&(0,I.jsx)(`div`,{className:`col-span-2`,children:(0,I.jsx)(M,{error:c.error,msg:`Failed to associate instance profile`})}),t[15]=c.error,t[16]=O);let k;t[17]===l.error?k=t[18]:(k=l.error&&(0,I.jsx)(`div`,{className:`col-span-2`,children:(0,I.jsx)(M,{error:l.error,msg:`Failed to disassociate instance profile`})}),t[17]=l.error,t[18]=k);let A;t[19]!==c.isPending||t[20]!==_||t[21]!==l.isPending||t[22]!==S||t[23]!==T||t[24]!==b||t[25]!==u?(A=_?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(P,{label:`Instance Profile ARN`,value:_.IamInstanceProfile?.Arn}),(0,I.jsx)(P,{label:`State`,value:(0,I.jsx)(ge,{state:_.State})}),(0,I.jsx)(`div`,{className:`col-span-2 flex justify-end`,children:(0,I.jsx)(v,{disabled:l.isPending,onClick:T,size:`sm`,variant:`destructive`,children:l.isPending?`Detaching…`:`Detach`})})]}):(0,I.jsxs)(`div`,{className:`col-span-2 space-y-3`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No instance profile is associated. Associate one to flow role credentials to this instance via IMDS.`}),b.length>0?(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(h,{onValueChange:e=>{f(e??``)},value:u,children:[(0,I.jsx)(m,{className:`w-full`,children:(0,I.jsx)(d,{placeholder:`Select an instance profile`})}),(0,I.jsx)(p,{children:b.map(Ae)})]}),(0,I.jsx)(v,{disabled:!u||c.isPending,onClick:S,size:`sm`,children:c.isPending?`Associating…`:`Associate`})]}):(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No instance profiles exist.`,` `,(0,I.jsx)(o,{className:`text-primary hover:underline`,to:`/iam/create-instance-profile`,children:`Create one`}),` `,`first.`]})]}),t[19]=c.isPending,t[20]=_,t[21]=l.isPending,t[22]=S,t[23]=T,t[24]=b,t[25]=u,t[26]=A):A=t[26];let j;return t[27]!==O||t[28]!==k||t[29]!==A?(j=(0,I.jsxs)(N,{children:[E,(0,I.jsxs)(N.Content,{children:[O,k,A]})]}),t[27]=O,t[28]=k,t[29]=A,t[30]=j):j=t[30],j}function Ae(e){return(0,I.jsx)(f,{value:e.InstanceProfileName??``,children:e.InstanceProfileName},e.InstanceProfileName)}function je(e){return e.State===`associating`||e.State===`associated`}var L=new Set([`pending`,`stopping`,`shutting-down`,`terminated`]);function Me(e){let t=(0,Ee.c)(43),{instanceId:n,state:r}=e,i=j(),a=te(),o=O(),s=A(),[c,l]=(0,F.useState)(!1),u=L.has(r??``),d;t[0]!==n||t[1]!==s?(d=()=>{s.mutate(n,{onSettled:()=>{l(!1)}})},t[0]=n,t[1]=s,t[2]=d):d=t[2];let f=d;if(u&&r!==`terminated`){let e;return t[3]===r?e=t[4]:(e=(0,I.jsx)(`div`,{className:`rounded-lg border bg-muted/50 p-4`,children:(0,I.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[`Instance is `,r,`. Actions will be available once the operation completes.`]})}),t[3]=r,t[4]=e),e}if(r===`terminated`){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,I.jsx)(`div`,{className:`rounded-lg border bg-muted/50 p-4`,children:(0,I.jsx)(`p`,{className:`text-center text-sm text-muted-foreground`,children:`This instance has been terminated and cannot be managed.`})}),t[5]=e):e=t[5],e}let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,I.jsx)(`h2`,{className:`mb-4 font-semibold`,children:`Instance Actions`}),t[6]=p):p=t[6];let m;t[7]===i.error?m=t[8]:(m=i.error&&(0,I.jsx)(M,{error:i.error,msg:`Failed to start instance`}),t[7]=i.error,t[8]=m);let h;t[9]===a.error?h=t[10]:(h=a.error&&(0,I.jsx)(M,{error:a.error,msg:`Failed to stop instance`}),t[9]=a.error,t[10]=h);let y;t[11]===o.error?y=t[12]:(y=o.error&&(0,I.jsx)(M,{error:o.error,msg:`Failed to reboot instance`}),t[11]=o.error,t[12]=y);let b;t[13]===s.error?b=t[14]:(b=s.error&&(0,I.jsx)(M,{error:s.error,msg:`Failed to terminate instance`}),t[13]=s.error,t[14]=b);let x;t[15]!==n||t[16]!==i||t[17]!==r?(x=r===`stopped`&&(0,I.jsxs)(v,{disabled:i.isPending,onClick:()=>{i.mutate(n)},size:`sm`,variant:`default`,children:[(0,I.jsx)(Ce,{className:`size-4`}),i.isPending?`Starting`:`Start`]}),t[15]=n,t[16]=i,t[17]=r,t[18]=x):x=t[18];let S;t[19]!==n||t[20]!==o||t[21]!==r||t[22]!==a?(S=r===`running`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(v,{disabled:a.isPending,onClick:()=>{a.mutate(n)},size:`sm`,variant:`outline`,children:[(0,I.jsx)(Se,{className:`size-4`}),a.isPending?`Stopping`:`Stop`]}),(0,I.jsxs)(v,{disabled:o.isPending,onClick:()=>{o.mutate(n)},size:`sm`,variant:`outline`,children:[(0,I.jsx)(g,{className:`size-4`}),o.isPending?`Rebooting`:`Reboot`]})]}),t[19]=n,t[20]=o,t[21]=r,t[22]=a,t[23]=S):S=t[23];let C;t[24]!==r||t[25]!==s.isPending?(C=(r===`stopped`||r===`running`)&&(0,I.jsxs)(v,{disabled:s.isPending,onClick:()=>{l(!0)},size:`sm`,variant:`destructive`,children:[(0,I.jsx)(_,{className:`size-4`}),s.isPending?`Terminating`:`Terminate`]}),t[24]=r,t[25]=s.isPending,t[26]=C):C=t[26];let w;t[27]!==x||t[28]!==S||t[29]!==C?(w=(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[x,S,C]}),t[27]=x,t[28]=S,t[29]=C,t[30]=w):w=t[30];let T=`Are you sure you want to terminate the instance "${n}"? This action cannot be undone.`,E;t[31]!==f||t[32]!==c||t[33]!==T||t[34]!==s.isPending?(E=(0,I.jsx)(he,{confirmLabel:`Terminate`,description:T,isPending:s.isPending,onConfirm:f,onOpenChange:l,open:c,pendingLabel:`Terminating…`,title:`Terminate Instance`}),t[31]=f,t[32]=c,t[33]=T,t[34]=s.isPending,t[35]=E):E=t[35];let D;return t[36]!==w||t[37]!==E||t[38]!==m||t[39]!==h||t[40]!==y||t[41]!==b?(D=(0,I.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[p,m,h,y,b,w,E]}),t[36]=w,t[37]=E,t[38]=m,t[39]=h,t[40]=y,t[41]=b,t[42]=D):D=t[42],D}function R(){let e=(0,Ee.c)(136),{id:t}=re.useParams(),{isAdmin:n}=b(),r;e[0]===t?r=e[1]:(r=w(t),e[0]=t,e[1]=r);let{data:c}=a(r),l=c.Reservations?.[0]?.Instances?.[0],d=l?.ImageId,f;e[2]===d?f=e[3]:(f=x(d),e[2]=d,e[3]=f);let{data:p}=a(f),m=p?.Images?.[0],{data:h}=a(S),g;e[4]===n?g=e[5]:(g={...ye,enabled:n,refetchInterval:5e3},e[4]=n,e[5]=g);let{data:_}=i(g),y;e[6]!==t||e[7]!==_?.vms?(y=_?.vms?.find(e=>e.instance_id===t),e[6]=t,e[7]=_?.vms,e[8]=y):y=e[8];let C=y,D=T(),O=E(),[k,ee]=(0,F.useState)(!1),[A,j]=(0,F.useState)(``),[te,ne]=(0,F.useState)(!1),[he,be]=(0,F.useState)(null),[Se,Ce]=(0,F.useState)(!1);if(!l?.InstanceId){let t;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u,{to:`/ec2/describe-instances`,children:`Back to instances`}),(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`Instance not found.`})]}),e[9]=t):t=e[9],t}let Ae;e[10]===l.LaunchTime?Ae=e[11]:(Ae=s(l.LaunchTime),e[10]=l.LaunchTime,e[11]=Ae);let je=Ae,L=l.State?.Name===`running`,R=l.State?.Name===`stopped`,Fe;e[12]!==t||e[13]!==D||e[14]!==A?(Fe=async function(){try{await D.mutateAsync({instanceId:t,instanceType:A}),ee(!1),j(``)}catch{}},e[12]=t,e[13]=D,e[14]=A,e[15]=Fe):Fe=e[15];let Ie=Fe,Le;e[16]!==O||e[17]!==t?(Le=async function(){try{let e=await O.mutateAsync(t),n=e.Output?atob(e.Output):`(no output)`;be(n),ne(!0)}catch{}},e[16]=O,e[17]=t,e[18]=Le):Le=e[18];let Re=Le,ze;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,I.jsx)(u,{to:`/ec2/describe-instances`,children:`Back to instances`}),e[19]=ze):ze=e[19];let z;e[20]===D.error?z=e[21]:(z=D.error&&(0,I.jsx)(M,{error:D.error,msg:`Failed to modify instance`}),e[20]=D.error,e[21]=z);let B;e[22]===O.error?B=e[23]:(B=O.error&&(0,I.jsx)(M,{error:O.error,msg:`Failed to get console output`}),e[22]=O.error,e[23]=B);let V;e[24]!==O.isPending||e[25]!==Re||e[26]!==L?(V=L&&(0,I.jsxs)(v,{disabled:O.isPending,onClick:Re,size:`sm`,variant:`outline`,children:[(0,I.jsx)(Te,{className:`size-4`}),O.isPending?`Fetching…`:`View Console`]}),e[24]=O.isPending,e[25]=Re,e[26]=L,e[27]=V):V=e[27];let H;e[28]!==L||e[29]!==R?(H=(L||R)&&(0,I.jsxs)(v,{onClick:()=>{Ce(!0)},size:`sm`,variant:`outline`,children:[(0,I.jsx)(xe,{className:`size-4`}),`Create Image`]}),e[28]=L,e[29]=R,e[30]=H):H=e[30];let U;e[31]!==l.InstanceType||e[32]!==R?(U=R&&(0,I.jsxs)(v,{onClick:()=>{j(l.InstanceType??``),ee(!0)},size:`sm`,variant:`outline`,children:[(0,I.jsx)(we,{className:`size-4`}),`Modify Instance`]}),e[31]=l.InstanceType,e[32]=R,e[33]=U):U=e[33];let Be=l.State?.Name,W;e[34]===Be?W=e[35]:(W=(0,I.jsx)(ge,{state:Be}),e[34]=Be,e[35]=W);let G;e[36]!==V||e[37]!==H||e[38]!==U||e[39]!==W?(G=(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V,H,U,W]}),e[36]=V,e[37]=H,e[38]=U,e[39]=W,e[40]=G):G=e[40];let K;e[41]!==l.InstanceId||e[42]!==G?(K=(0,I.jsx)(ie,{actions:G,subtitle:`Instance Details`,title:l.InstanceId}),e[41]=l.InstanceId,e[42]=G,e[43]=K):K=e[43];let Ve=l.State?.Name,q;e[44]!==l.InstanceId||e[45]!==Ve?(q=(0,I.jsx)(Me,{instanceId:l.InstanceId,state:Ve}),e[44]=l.InstanceId,e[45]=Ve,e[46]=q):q=e[46];let J;e[47]!==he||e[48]!==te?(J=te&&he!==null&&(0,I.jsxs)(N,{children:[(0,I.jsx)(N.Header,{children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[`Console Output`,(0,I.jsx)(v,{onClick:()=>{ne(!1),be(null)},size:`sm`,variant:`ghost`,children:`Hide`})]})}),(0,I.jsx)(`div`,{className:`p-4`,children:(0,I.jsx)(`pre`,{className:`max-h-96 overflow-y-auto rounded bg-muted p-3 font-mono text-xs whitespace-pre-wrap`,children:he})})]}),e[47]=he,e[48]=te,e[49]=J):J=e[49];let He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,I.jsx)(N.Header,{children:`Instance Information`}),e[50]=He):He=e[50];let Y;e[51]===l.InstanceId?Y=e[52]:(Y=(0,I.jsx)(P,{label:`Instance ID`,value:l.InstanceId}),e[51]=l.InstanceId,e[52]=Y);let X;e[53]===l.InstanceType?X=e[54]:(X=(0,I.jsx)(P,{label:`Instance Type`,value:l.InstanceType}),e[53]=l.InstanceType,e[54]=X);let Ue=l.State?.Name,We;e[55]===Ue?We=e[56]:(We=(0,I.jsx)(P,{label:`Instance State`,value:Ue}),e[55]=Ue,e[56]=We);let Ge;e[57]===l.State?.Code?Ge=e[58]:(Ge=l.State?.Code?.toString(),e[57]=l.State?.Code,e[58]=Ge);let Ke;e[59]===Ge?Ke=e[60]:(Ke=(0,I.jsx)(P,{label:`State Code`,value:Ge}),e[59]=Ge,e[60]=Ke);let qe;e[61]===je?qe=e[62]:(qe=(0,I.jsx)(P,{label:`Launch Time`,value:je}),e[61]=je,e[62]=qe);let Je=l.Placement?.AvailabilityZone,Ye;e[63]===Je?Ye=e[64]:(Ye=(0,I.jsx)(P,{label:`Availability Zone`,value:Je}),e[63]=Je,e[64]=Ye);let Xe;e[65]===l.Placement?Xe=e[66]:(Xe=l.Placement?.GroupName?(0,I.jsx)(o,{className:`text-primary hover:underline`,to:`/ec2/describe-placement-groups`,children:l.Placement.GroupName}):void 0,e[65]=l.Placement,e[66]=Xe);let Ze;e[67]===Xe?Ze=e[68]:(Ze=(0,I.jsx)(P,{label:`Placement Group`,value:Xe}),e[67]=Xe,e[68]=Ze);let Qe;e[69]!==Y||e[70]!==X||e[71]!==We||e[72]!==Ke||e[73]!==qe||e[74]!==Ye||e[75]!==Ze?(Qe=(0,I.jsxs)(N,{children:[He,(0,I.jsxs)(N.Content,{children:[Y,X,We,Ke,qe,Ye,Ze]})]}),e[69]=Y,e[70]=X,e[71]=We,e[72]=Ke,e[73]=qe,e[74]=Ye,e[75]=Ze,e[76]=Qe):Qe=e[76];let $e;e[77]!==l.KeyName||e[78]!==l.PrivateDnsName||e[79]!==l.PrivateIpAddress||e[80]!==l.PublicDnsName||e[81]!==l.PublicIpAddress||e[82]!==l.SecurityGroups||e[83]!==l.SubnetId||e[84]!==l.VpcId?($e=(l.PrivateIpAddress||l.PublicIpAddress||l.VpcId||l.SubnetId||l.SecurityGroups&&l.SecurityGroups.length>0)&&(0,I.jsxs)(N,{children:[(0,I.jsx)(N.Header,{children:`Network & Security`}),(0,I.jsxs)(N.Content,{children:[(0,I.jsx)(P,{label:`Private IP Address`,value:l.PrivateIpAddress}),(0,I.jsx)(P,{label:`Public IP Address`,value:l.PublicIpAddress}),(0,I.jsx)(P,{label:`Private DNS`,value:l.PrivateDnsName}),(0,I.jsx)(P,{label:`Public DNS`,value:l.PublicDnsName}),(0,I.jsx)(P,{label:`VPC ID`,value:l.VpcId?(0,I.jsx)(o,{className:`text-primary hover:underline`,params:{id:l.VpcId},to:`/ec2/describe-vpcs/$id`,children:l.VpcId}):void 0}),(0,I.jsx)(P,{label:`Subnet ID`,value:l.SubnetId?(0,I.jsx)(o,{className:`text-primary hover:underline`,params:{id:l.SubnetId},to:`/ec2/describe-subnets/$id`,children:l.SubnetId}):void 0}),(0,I.jsx)(P,{label:`Key Name`,value:l.KeyName}),(0,I.jsx)(P,{label:`Security Groups`,value:l.SecurityGroups?.map(Pe).join(`, `)})]})]}),e[77]=l.KeyName,e[78]=l.PrivateDnsName,e[79]=l.PrivateIpAddress,e[80]=l.PublicDnsName,e[81]=l.PublicIpAddress,e[82]=l.SecurityGroups,e[83]=l.SubnetId,e[84]=l.VpcId,e[85]=$e):$e=e[85];let et;e[86]===l.InstanceId?et=e[87]:(et=(0,I.jsx)(ke,{instanceId:l.InstanceId}),e[86]=l.InstanceId,e[87]=et);let tt;e[88]!==n||e[89]!==C?.gpu?(tt=n&&(0,I.jsx)(Oe,{gpu:C?.gpu}),e[88]=n,e[89]=C?.gpu,e[90]=tt):tt=e[90];let nt;e[91]===l.BlockDeviceMappings?nt=e[92]:(nt=l.BlockDeviceMappings&&l.BlockDeviceMappings.length>0&&(0,I.jsxs)(N,{children:[(0,I.jsx)(N.Header,{children:`Block Device Mappings`}),l.BlockDeviceMappings.map(Ne)]}),e[91]=l.BlockDeviceMappings,e[92]=nt);let rt;e[93]===m?rt=e[94]:(rt=m&&(0,I.jsx)(_e,{image:m}),e[93]=m,e[94]=rt);let Z;e[95]!==K||e[96]!==q||e[97]!==J||e[98]!==Qe||e[99]!==$e||e[100]!==et||e[101]!==tt||e[102]!==nt||e[103]!==rt?(Z=(0,I.jsxs)(`div`,{className:`space-y-6`,children:[K,q,J,Qe,$e,et,tt,nt,rt]}),e[95]=K,e[96]=q,e[97]=J,e[98]=Qe,e[99]=$e,e[100]=et,e[101]=tt,e[102]=nt,e[103]=rt,e[104]=Z):Z=e[104];let it;e[105]===Symbol.for(`react.memo_cache_sentinel`)?(it=e=>{e||(ee(!1),j(``))},e[105]=it):it=e[105];let at;e[106]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,I.jsx)(le,{children:`Modify Instance`}),e[106]=at):at=e[106];let ot;e[107]===l.InstanceId?ot=e[108]:(ot=(0,I.jsxs)(pe,{children:[at,(0,I.jsxs)(se,{children:[`Select a new instance type for "`,l.InstanceId,`". The instance must be stopped to modify its attributes.`]})]}),e[107]=l.InstanceId,e[108]=ot);let st;e[109]===Symbol.for(`react.memo_cache_sentinel`)?(st=(0,I.jsx)(ae,{children:(0,I.jsx)(`label`,{htmlFor:`instanceType`,children:`Instance Type`})}),e[109]=st):st=e[109];let ct;e[110]===h.InstanceTypes?ct=e[111]:(ct=h.InstanceTypes??[],e[110]=h.InstanceTypes,e[111]=ct);let lt;e[112]!==A||e[113]!==ct?(lt=(0,I.jsxs)(oe,{children:[st,(0,I.jsx)(ve,{className:`w-full`,id:`instanceType`,instanceTypes:ct,onValueChange:j,value:A})]}),e[112]=A,e[113]=ct,e[114]=lt):lt=e[114];let ut;e[115]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,I.jsx)(fe,{children:`Cancel`}),e[115]=ut):ut=e[115];let dt=D.isPending||!A||A===l.InstanceType,ft=D.isPending?`Saving…`:`Save Changes`,pt;e[116]!==Ie||e[117]!==dt||e[118]!==ft?(pt=(0,I.jsxs)(de,{children:[ut,(0,I.jsx)(ue,{disabled:dt,onClick:Ie,children:ft})]}),e[116]=Ie,e[117]=dt,e[118]=ft,e[119]=pt):pt=e[119];let mt;e[120]!==ot||e[121]!==lt||e[122]!==pt?(mt=(0,I.jsxs)(ce,{children:[ot,lt,pt]}),e[120]=ot,e[121]=lt,e[122]=pt,e[123]=mt):mt=e[123];let Q;e[124]!==k||e[125]!==mt?(Q=(0,I.jsx)(me,{onOpenChange:it,open:k,children:mt}),e[124]=k,e[125]=mt,e[126]=Q):Q=e[126];let $;e[127]!==l.InstanceId||e[128]!==Se?($=(0,I.jsx)(De,{instanceId:l.InstanceId,onOpenChange:Ce,open:Se}),e[127]=l.InstanceId,e[128]=Se,e[129]=$):$=e[129];let ht;return e[130]!==B||e[131]!==Z||e[132]!==Q||e[133]!==$||e[134]!==z?(ht=(0,I.jsxs)(I.Fragment,{children:[ze,z,B,Z,Q,$]}),e[130]=B,e[131]=Z,e[132]=Q,e[133]=$,e[134]=z,e[135]=ht):ht=e[135],ht}function Ne(e){return(0,I.jsxs)(N.Content,{children:[(0,I.jsx)(P,{label:`Device Name`,value:e.DeviceName}),(0,I.jsx)(P,{label:`Volume ID`,value:e.Ebs?.VolumeId?(0,I.jsx)(o,{className:`text-primary hover:underline`,params:{id:e.Ebs.VolumeId},to:`/ec2/describe-volumes/$id`,children:e.Ebs.VolumeId}):void 0}),(0,I.jsx)(P,{label:`Status`,value:e.Ebs?.Status}),(0,I.jsx)(P,{label:`Attach Time`,value:s(e.Ebs?.AttachTime)}),(0,I.jsx)(P,{label:`Delete on Termination`,value:e.Ebs?.DeleteOnTermination?`Yes`:`No`})]},e.DeviceName)}function Pe(e){return e.GroupName}export{R as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id25.js b/spinifex/services/spinifexui/frontend/dist/assets/_id25.js index c3d076f92..d211f3d9d 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id25.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id25.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{c,i as l,n as u,s as d,t as f}from"./select.js";import{t as p}from"./trash-2.js";import{t as m}from"./button.js";import{M as h,u as g}from"./ec2.js";import{D as _,V as v,o as y}from"./ec22.js";import{t as b}from"./_id6.js";import{t as x}from"./error-banner.js";import{t as S}from"./page-heading.js";import{t as C}from"./delete-confirmation-dialog.js";import{n as w,t as T}from"./detail-row.js";var E=e(n()),D=t();function O(){let{id:e}=b.useParams(),t=a(),{data:n}=r(g(e)),{data:O}=r(h),k=y(),A=v(),j=_(),[M,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(``),I=n.InternetGateways?.[0],L=O.Vpcs??[],R=async()=>{try{await j.mutateAsync(e),t({to:`/ec2/describe-internet-gateways`})}finally{N(!1)}},z=async()=>{P&&await k.mutateAsync({internetGatewayId:e,vpcId:P})},B=async t=>{await A.mutateAsync({internetGatewayId:e,vpcId:t})};if(!I?.InternetGatewayId)return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(s,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),(0,D.jsx)(`p`,{className:`text-muted-foreground`,children:`Internet Gateway not found.`})]});let V=I.Attachments?.[0],H=!!V?.VpcId,U=o(I.Tags);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(s,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),(j.error??k.error??A.error)&&(0,D.jsx)(x,{error:j.error??k.error??A.error??void 0,msg:`Internet Gateway action failed`}),(0,D.jsxs)(`div`,{className:`space-y-6`,children:[(0,D.jsx)(S,{actions:(0,D.jsxs)(m,{disabled:H||j.isPending,onClick:()=>N(!0),size:`sm`,variant:`destructive`,children:[(0,D.jsx)(p,{className:`size-4`}),`Delete`]}),subtitle:`Internet Gateway Details`,title:U?`${I.InternetGatewayId} (${U})`:I.InternetGatewayId}),(0,D.jsxs)(w,{children:[(0,D.jsx)(w.Header,{children:`Internet Gateway Information`}),(0,D.jsxs)(w.Content,{children:[(0,D.jsx)(T,{label:`Internet Gateway ID`,value:I.InternetGatewayId}),(0,D.jsx)(T,{label:`Owner ID`,value:I.OwnerId??`—`}),(0,D.jsx)(T,{label:`State`,value:V?.State??`detached`})]})]}),(0,D.jsxs)(w,{children:[(0,D.jsx)(w.Header,{children:`VPC Attachment`}),(0,D.jsx)(w.Content,{children:H?(0,D.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,D.jsx)(i,{className:`text-primary hover:underline`,params:{id:V.VpcId??``},to:`/ec2/describe-vpcs/$id`,children:V.VpcId}),(0,D.jsx)(m,{disabled:A.isPending,onClick:async()=>await B(V.VpcId??``),size:`sm`,variant:`outline`,children:`Detach`})]}):(0,D.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,D.jsx)(`div`,{className:`flex-1`,children:(0,D.jsxs)(f,{onValueChange:e=>F(e??``),value:P,children:[(0,D.jsx)(d,{className:`w-full`,children:(0,D.jsx)(c,{placeholder:`Select a VPC`})}),(0,D.jsx)(u,{children:L.map(e=>{let t=o(e.Tags);return(0,D.jsx)(l,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)})})]})}),(0,D.jsx)(m,{disabled:!P||k.isPending,onClick:z,size:`sm`,children:`Attach`})]})})]})]}),(0,D.jsx)(C,{description:`Are you sure you want to delete the Internet Gateway "${I.InternetGatewayId}"? This action cannot be undone.`,isPending:j.isPending,onConfirm:R,onOpenChange:N,open:M,title:`Delete Internet Gateway`})]})}export{O as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{c,i as l,n as u,s as d,t as f}from"./select.js";import{t as p}from"./trash-2.js";import{t as m}from"./button.js";import{M as h,u as g}from"./ec2.js";import{D as _,V as v,o as y}from"./ec22.js";import{t as b}from"./_id6.js";import{t as x}from"./error-banner.js";import{t as S}from"./page-heading.js";import{t as C}from"./delete-confirmation-dialog.js";import{n as w,t as T}from"./detail-row.js";var E=e(n()),D=t();function O(){let{id:e}=b.useParams(),t=a(),{data:n}=r(g(e)),{data:O}=r(h),k=y(),A=v(),j=_(),[M,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(``),I=n.InternetGateways?.[0],L=O.Vpcs??[],R=async()=>{try{await j.mutateAsync(e),t({to:`/ec2/describe-internet-gateways`})}finally{N(!1)}},z=async()=>{P&&await k.mutateAsync({internetGatewayId:e,vpcId:P})},B=async t=>{await A.mutateAsync({internetGatewayId:e,vpcId:t})};if(!I?.InternetGatewayId)return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(s,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),(0,D.jsx)(`p`,{className:`text-muted-foreground`,children:`Internet Gateway not found.`})]});let V=I.Attachments?.[0],H=!!V?.VpcId,U=o(I.Tags);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(s,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),(j.error??k.error??A.error)&&(0,D.jsx)(x,{error:j.error??k.error??A.error??void 0,msg:`Internet Gateway action failed`}),(0,D.jsxs)(`div`,{className:`space-y-6`,children:[(0,D.jsx)(S,{actions:(0,D.jsxs)(m,{disabled:H||j.isPending,onClick:()=>{N(!0)},size:`sm`,variant:`destructive`,children:[(0,D.jsx)(p,{className:`size-4`}),`Delete`]}),subtitle:`Internet Gateway Details`,title:U?`${I.InternetGatewayId} (${U})`:I.InternetGatewayId}),(0,D.jsxs)(w,{children:[(0,D.jsx)(w.Header,{children:`Internet Gateway Information`}),(0,D.jsxs)(w.Content,{children:[(0,D.jsx)(T,{label:`Internet Gateway ID`,value:I.InternetGatewayId}),(0,D.jsx)(T,{label:`Owner ID`,value:I.OwnerId??`—`}),(0,D.jsx)(T,{label:`State`,value:V?.State??`detached`})]})]}),(0,D.jsxs)(w,{children:[(0,D.jsx)(w.Header,{children:`VPC Attachment`}),(0,D.jsx)(w.Content,{children:H?(0,D.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,D.jsx)(i,{className:`text-primary hover:underline`,params:{id:V.VpcId??``},to:`/ec2/describe-vpcs/$id`,children:V.VpcId}),(0,D.jsx)(m,{disabled:A.isPending,onClick:async()=>{await B(V.VpcId??``)},size:`sm`,variant:`outline`,children:`Detach`})]}):(0,D.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,D.jsx)(`div`,{className:`flex-1`,children:(0,D.jsxs)(f,{onValueChange:e=>{F(e??``)},value:P,children:[(0,D.jsx)(d,{className:`w-full`,children:(0,D.jsx)(c,{placeholder:`Select a VPC`})}),(0,D.jsx)(u,{children:L.map(e=>{let t=o(e.Tags);return(0,D.jsx)(l,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)})})]})}),(0,D.jsx)(m,{disabled:!P||k.isPending,onClick:z,size:`sm`,children:`Attach`})]})})]})]}),(0,D.jsx)(C,{description:`Are you sure you want to delete the Internet Gateway "${I.InternetGatewayId}"? This action cannot be undone.`,isPending:j.isPending,onConfirm:R,onOpenChange:N,open:M,title:`Delete Internet Gateway`})]})}export{O as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id26.js b/spinifex/services/spinifexui/frontend/dist/assets/_id26.js index cf4da4ac1..1e57a6afd 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id26.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id26.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./useNavigate.js";import{$t as a}from"./cluster-config.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{f as l}from"./ec2.js";import{O as u}from"./ec22.js";import{t as d}from"./_id7.js";import{t as f}from"./error-banner.js";import{t as p}from"./page-heading.js";import{t as m}from"./delete-confirmation-dialog.js";import{n as h,t as g}from"./detail-row.js";var _=e(n()),v=t();function y(){let{id:e}=d.useParams(),t=i(),{data:n}=r(l(e)),y=n.KeyPairs?.[0],b=u(),[x,S]=(0,_.useState)(!1),C=async()=>{try{await b.mutateAsync(e),t({to:`/ec2/describe-key-pairs`})}finally{S(!1)}};if(!y?.KeyPairId)return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(o,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),(0,v.jsx)(`p`,{className:`text-muted-foreground`,children:`Key pair not found.`})]});let w=a(y.CreateTime);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(o,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),b.error&&(0,v.jsx)(f,{error:b.error,msg:`Failed to delete key pair`}),(0,v.jsxs)(`div`,{className:`space-y-6`,children:[(0,v.jsx)(p,{actions:(0,v.jsxs)(c,{onClick:()=>S(!0),size:`sm`,variant:`destructive`,children:[(0,v.jsx)(s,{className:`size-4`}),`Delete`]}),subtitle:`Key Pair Details`,title:y.KeyName??``}),(0,v.jsxs)(h,{children:[(0,v.jsx)(h.Header,{children:`Key Pair Information`}),(0,v.jsxs)(h.Content,{children:[(0,v.jsx)(g,{label:`Key Pair ID`,value:y.KeyPairId}),(0,v.jsx)(g,{label:`Key Name`,value:y.KeyName}),(0,v.jsx)(g,{label:`Key Type`,value:y.KeyType}),(0,v.jsx)(g,{label:`Key Fingerprint`,value:y.KeyFingerprint}),(0,v.jsx)(g,{label:`Creation Date`,value:w})]})]}),y.Tags&&y.Tags.length>0&&(0,v.jsxs)(h,{children:[(0,v.jsx)(h.Header,{children:`Tags`}),(0,v.jsx)(h.Content,{children:y.Tags.map(e=>(0,v.jsx)(g,{label:e.Key??``,value:e.Value},e.Key))})]})]}),(0,v.jsx)(m,{description:`Are you sure you want to delete the key pair "${y.KeyName}"? This action cannot be undone. Any instances using this key pair will no longer be able to be accessed with it.`,isPending:b.isPending,onConfirm:C,onOpenChange:S,open:x,title:`Delete Key Pair`})]})}export{y as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./useNavigate.js";import{$t as a}from"./cluster-config.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{f as l}from"./ec2.js";import{O as u}from"./ec22.js";import{t as d}from"./_id7.js";import{t as f}from"./error-banner.js";import{t as p}from"./page-heading.js";import{t as m}from"./delete-confirmation-dialog.js";import{n as h,t as g}from"./detail-row.js";var _=e(n()),v=t();function y(){let{id:e}=d.useParams(),t=i(),{data:n}=r(l(e)),y=n.KeyPairs?.[0],b=u(),[x,S]=(0,_.useState)(!1),C=async()=>{try{await b.mutateAsync(e),t({to:`/ec2/describe-key-pairs`})}finally{S(!1)}};if(!y?.KeyPairId)return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(o,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),(0,v.jsx)(`p`,{className:`text-muted-foreground`,children:`Key pair not found.`})]});let w=a(y.CreateTime);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(o,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),b.error&&(0,v.jsx)(f,{error:b.error,msg:`Failed to delete key pair`}),(0,v.jsxs)(`div`,{className:`space-y-6`,children:[(0,v.jsx)(p,{actions:(0,v.jsxs)(c,{onClick:()=>{S(!0)},size:`sm`,variant:`destructive`,children:[(0,v.jsx)(s,{className:`size-4`}),`Delete`]}),subtitle:`Key Pair Details`,title:y.KeyName??``}),(0,v.jsxs)(h,{children:[(0,v.jsx)(h.Header,{children:`Key Pair Information`}),(0,v.jsxs)(h.Content,{children:[(0,v.jsx)(g,{label:`Key Pair ID`,value:y.KeyPairId}),(0,v.jsx)(g,{label:`Key Name`,value:y.KeyName}),(0,v.jsx)(g,{label:`Key Type`,value:y.KeyType}),(0,v.jsx)(g,{label:`Key Fingerprint`,value:y.KeyFingerprint}),(0,v.jsx)(g,{label:`Creation Date`,value:w})]})]}),y.Tags&&y.Tags.length>0&&(0,v.jsxs)(h,{children:[(0,v.jsx)(h.Header,{children:`Tags`}),(0,v.jsx)(h.Content,{children:y.Tags.map(e=>(0,v.jsx)(g,{label:e.Key??``,value:e.Value},e.Key))})]})]}),(0,v.jsx)(m,{description:`Are you sure you want to delete the key pair "${y.KeyName}"? This action cannot be undone. Any instances using this key pair will no longer be able to be accessed with it.`,isPending:b.isPending,onConfirm:C,onOpenChange:S,open:x,title:`Delete Key Pair`})]})}export{y as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id27.js b/spinifex/services/spinifexui/frontend/dist/assets/_id27.js index 6489624d4..5867750d9 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id27.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id27.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o}from"./cluster-config.js";import{t as s}from"./createLucideIcon.js";import{t as c}from"./back-link.js";import{c as l,i as u,n as d,s as f,t as p}from"./select.js";import{t as m}from"./trash-2.js";import{t as h}from"./button.js";import{t as g}from"./input.js";import{h as _,m as v}from"./ec2.js";import{A as y,Y as b,g as ee,k as x}from"./ec22.js";import{t as S}from"./_id8.js";import{i as C,t as te}from"./zod.js";import{t as w}from"./error-banner.js";import{t as T}from"./page-heading.js";import{a as E,t as D}from"./field.js";import{c as ne}from"./ec23.js";import{t as re}from"./delete-confirmation-dialog.js";import{n as O,t as k}from"./detail-row.js";import{t as A}from"./launch-template-data-fields.js";import{t as j}from"./badge.js";var M=s(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),N=s(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),P=e(n()),F=t();function I(e){if(!e)return``;try{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;et.LaunchTemplateId===e),G=(s.LaunchTemplateVersions??[]).toSorted((e,t)=>(t.VersionNumber??0)-(e.VersionNumber??0)),{control:K,handleSubmit:q,register:J,getValues:Y,reset:X,formState:{errors:ie,isSubmitting:Z}}=C({resolver:te(ne),defaultValues:{versionDescription:``,...R}});if(!W?.LaunchTemplateId)return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(c,{to:`/ec2/describe-launch-templates`,children:`Back to launch templates`}),(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:`Launch template not found.`})]});let Q=W.DefaultVersionNumber,ae=e=>{if(e===`none`){X({...Y(),sourceVersion:void 0,...R});return}let t=G.find(t=>String(t.VersionNumber)===e);X({...Y(),sourceVersion:e,...L(t?.LaunchTemplateData)})},oe=async t=>{await I.mutateAsync({launchTemplateId:e,defaultVersion:String(t)})},se=async t=>{await z.mutateAsync({launchTemplateId:e,versions:[String(t)]})},ce=async()=>{try{await B.mutateAsync(e),t({to:`/ec2/describe-launch-templates`})}finally{U(!1)}},le=async t=>{await V.mutateAsync({...t,launchTemplateId:e}),X({versionDescription:``,sourceVersion:void 0,...R})},$=I.error??z.error;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(c,{to:`/ec2/describe-launch-templates`,children:`Back to launch templates`}),B.error&&(0,F.jsx)(w,{error:B.error,msg:`Failed to delete launch template`}),(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(T,{actions:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(h,{disabled:B.isPending,onClick:()=>U(!0),size:`sm`,variant:`destructive`,children:[(0,F.jsx)(m,{className:`size-4`}),`Delete`]}),(0,F.jsxs)(j,{variant:`secondary`,children:[`default v`,Q]})]}),subtitle:`Launch Template Details`,title:W.LaunchTemplateName??W.LaunchTemplateId}),(0,F.jsxs)(O,{children:[(0,F.jsx)(O.Header,{children:`Launch Template Information`}),(0,F.jsxs)(O.Content,{children:[(0,F.jsx)(k,{label:`Launch Template ID`,value:W.LaunchTemplateId}),(0,F.jsx)(k,{label:`Name`,value:W.LaunchTemplateName}),(0,F.jsx)(k,{label:`Default Version`,value:String(W.DefaultVersionNumber)}),(0,F.jsx)(k,{label:`Latest Version`,value:String(W.LatestVersionNumber)}),(0,F.jsx)(k,{label:`Created`,value:o(W.CreateTime)})]})]}),(0,F.jsxs)(O,{children:[(0,F.jsx)(O.Header,{children:`Versions`}),(0,F.jsxs)(`div`,{className:`space-y-4 p-4`,children:[$&&(0,F.jsx)(w,{error:$,msg:`Failed to update version`}),(0,F.jsx)(`div`,{className:`overflow-x-auto rounded-md border`,children:(0,F.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,F.jsx)(`thead`,{className:`bg-muted/50 text-left text-muted-foreground`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`p-2 font-medium`,children:`Version`}),(0,F.jsx)(`th`,{className:`p-2 font-medium`,children:`Description`}),(0,F.jsx)(`th`,{className:`p-2 font-medium`,children:`Default`}),(0,F.jsx)(`th`,{className:`p-2 font-medium`,children:`Created`}),(0,F.jsx)(`th`,{className:`p-2`,children:(0,F.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,F.jsx)(`tbody`,{children:G.map(t=>{let n=t.VersionNumber,r=n===Q;return(0,F.jsxs)(`tr`,{className:`border-t`,children:[(0,F.jsx)(`td`,{className:`p-2 font-mono`,children:n}),(0,F.jsx)(`td`,{className:`p-2`,children:t.VersionDescription??`—`}),(0,F.jsx)(`td`,{className:`p-2`,children:r?(0,F.jsx)(j,{variant:`secondary`,children:`Default`}):`—`}),(0,F.jsx)(`td`,{className:`p-2`,children:o(t.CreateTime)}),(0,F.jsx)(`td`,{className:`p-2`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,F.jsx)(i,{search:{launchTemplateId:e,launchTemplateVersion:String(n)},to:`/ec2/run-instances`,children:(0,F.jsxs)(h,{size:`sm`,variant:`ghost`,children:[(0,F.jsx)(M,{className:`size-4`}),`Launch`]})}),!r&&n!==void 0&&(0,F.jsxs)(h,{disabled:I.isPending,onClick:async()=>await oe(n),size:`sm`,variant:`ghost`,children:[(0,F.jsx)(N,{className:`size-4`}),`Set default`]}),(0,F.jsx)(h,{disabled:r||z.isPending||n===void 0,onClick:async()=>{n!==void 0&&await se(n)},size:`sm`,variant:`ghost`,children:(0,F.jsx)(m,{className:`size-4`})})]})})]},n)})})]})})]})]}),(0,F.jsxs)(O,{children:[(0,F.jsx)(O.Header,{children:`Create Version`}),(0,F.jsxs)(`div`,{className:`p-4`,children:[V.error&&(0,F.jsx)(w,{error:V.error,msg:`Failed to create version`}),(0,F.jsxs)(`form`,{className:`space-y-6`,onSubmit:q(le),children:[(0,F.jsxs)(D,{children:[(0,F.jsx)(E,{children:(0,F.jsx)(`label`,{htmlFor:`sourceVersion`,children:`Clone from version`})}),(0,F.jsxs)(p,{onValueChange:e=>ae(e??`none`),value:Y(`sourceVersion`)??`none`,children:[(0,F.jsx)(f,{className:`w-full`,id:`sourceVersion`,children:(0,F.jsx)(l,{})}),(0,F.jsxs)(d,{children:[(0,F.jsx)(u,{value:`none`,children:`none (start blank)`}),G.map(e=>(0,F.jsxs)(u,{value:String(e.VersionNumber),children:[`v`,e.VersionNumber,e.VersionDescription?` — ${e.VersionDescription}`:``]},e.VersionNumber))]})]})]}),(0,F.jsxs)(D,{children:[(0,F.jsx)(E,{children:(0,F.jsx)(`label`,{htmlFor:`versionDescription`,children:`Version Description`})}),(0,F.jsx)(g,{id:`versionDescription`,placeholder:`What changed in this version`,...J(`versionDescription`)})]}),(0,F.jsx)(A,{control:K,errors:ie,register:J}),(0,F.jsx)(h,{disabled:Z||V.isPending,type:`submit`,children:Z||V.isPending?`Creating…`:`Create Version`})]})]})]})]}),(0,F.jsx)(re,{description:`Are you sure you want to delete the launch template "${W.LaunchTemplateName??W.LaunchTemplateId}"? All versions will be deleted. This action cannot be undone.`,isPending:B.isPending,onConfirm:ce,onOpenChange:U,open:H,title:`Delete Launch Template`})]})}export{z as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o}from"./cluster-config.js";import{t as s}from"./createLucideIcon.js";import{t as c}from"./back-link.js";import{c as l,i as u,n as d,s as f,t as p}from"./select.js";import{t as m}from"./trash-2.js";import{t as h}from"./button.js";import{t as g}from"./input.js";import{h as _,m as v}from"./ec2.js";import{A as y,Y as b,g as ee,k as x}from"./ec22.js";import{t as S}from"./_id8.js";import{i as C,t as te}from"./zod.js";import{t as w}from"./error-banner.js";import{t as T}from"./page-heading.js";import{a as E,t as D}from"./field.js";import{c as ne}from"./ec23.js";import{t as re}from"./delete-confirmation-dialog.js";import{n as O,t as k}from"./detail-row.js";import{t as A}from"./launch-template-data-fields.js";import{t as j}from"./badge.js";var M=s(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),N=s(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),P=e(n()),F=t();function I(e){if(!e)return``;try{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;et.LaunchTemplateId===e),G=(s.LaunchTemplateVersions??[]).toSorted((e,t)=>(t.VersionNumber??0)-(e.VersionNumber??0)),{control:K,handleSubmit:q,register:J,getValues:Y,reset:X,formState:{errors:ie,isSubmitting:Z}}=C({resolver:te(ne),defaultValues:{versionDescription:``,...R}});if(!W?.LaunchTemplateId)return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(c,{to:`/ec2/describe-launch-templates`,children:`Back to launch templates`}),(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:`Launch template not found.`})]});let Q=W.DefaultVersionNumber,ae=e=>{if(e===`none`){X({...Y(),sourceVersion:void 0,...R});return}let t=G.find(t=>String(t.VersionNumber)===e);X({...Y(),sourceVersion:e,...L(t?.LaunchTemplateData)})},oe=async t=>{await I.mutateAsync({launchTemplateId:e,defaultVersion:String(t)})},se=async t=>{await z.mutateAsync({launchTemplateId:e,versions:[String(t)]})},ce=async()=>{try{await B.mutateAsync(e),t({to:`/ec2/describe-launch-templates`})}finally{U(!1)}},le=async t=>{await V.mutateAsync({...t,launchTemplateId:e}),X({versionDescription:``,sourceVersion:void 0,...R})},$=I.error??z.error;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(c,{to:`/ec2/describe-launch-templates`,children:`Back to launch templates`}),B.error&&(0,F.jsx)(w,{error:B.error,msg:`Failed to delete launch template`}),(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(T,{actions:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(h,{disabled:B.isPending,onClick:()=>{U(!0)},size:`sm`,variant:`destructive`,children:[(0,F.jsx)(m,{className:`size-4`}),`Delete`]}),(0,F.jsxs)(j,{variant:`secondary`,children:[`default v`,Q]})]}),subtitle:`Launch Template Details`,title:W.LaunchTemplateName??W.LaunchTemplateId}),(0,F.jsxs)(O,{children:[(0,F.jsx)(O.Header,{children:`Launch Template Information`}),(0,F.jsxs)(O.Content,{children:[(0,F.jsx)(k,{label:`Launch Template ID`,value:W.LaunchTemplateId}),(0,F.jsx)(k,{label:`Name`,value:W.LaunchTemplateName}),(0,F.jsx)(k,{label:`Default Version`,value:String(W.DefaultVersionNumber)}),(0,F.jsx)(k,{label:`Latest Version`,value:String(W.LatestVersionNumber)}),(0,F.jsx)(k,{label:`Created`,value:o(W.CreateTime)})]})]}),(0,F.jsxs)(O,{children:[(0,F.jsx)(O.Header,{children:`Versions`}),(0,F.jsxs)(`div`,{className:`space-y-4 p-4`,children:[$&&(0,F.jsx)(w,{error:$,msg:`Failed to update version`}),(0,F.jsx)(`div`,{className:`overflow-x-auto rounded-md border`,children:(0,F.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,F.jsx)(`thead`,{className:`bg-muted/50 text-left text-muted-foreground`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`p-2 font-medium`,children:`Version`}),(0,F.jsx)(`th`,{className:`p-2 font-medium`,children:`Description`}),(0,F.jsx)(`th`,{className:`p-2 font-medium`,children:`Default`}),(0,F.jsx)(`th`,{className:`p-2 font-medium`,children:`Created`}),(0,F.jsx)(`th`,{className:`p-2`,children:(0,F.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,F.jsx)(`tbody`,{children:G.map(t=>{let n=t.VersionNumber,r=n===Q;return(0,F.jsxs)(`tr`,{className:`border-t`,children:[(0,F.jsx)(`td`,{className:`p-2 font-mono`,children:n}),(0,F.jsx)(`td`,{className:`p-2`,children:t.VersionDescription??`—`}),(0,F.jsx)(`td`,{className:`p-2`,children:r?(0,F.jsx)(j,{variant:`secondary`,children:`Default`}):`—`}),(0,F.jsx)(`td`,{className:`p-2`,children:o(t.CreateTime)}),(0,F.jsx)(`td`,{className:`p-2`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,F.jsx)(i,{search:{launchTemplateId:e,launchTemplateVersion:String(n)},to:`/ec2/run-instances`,children:(0,F.jsxs)(h,{size:`sm`,variant:`ghost`,children:[(0,F.jsx)(M,{className:`size-4`}),`Launch`]})}),!r&&n!==void 0&&(0,F.jsxs)(h,{disabled:I.isPending,onClick:async()=>{await oe(n)},size:`sm`,variant:`ghost`,children:[(0,F.jsx)(N,{className:`size-4`}),`Set default`]}),(0,F.jsx)(h,{disabled:r||z.isPending||n===void 0,onClick:async()=>{n!==void 0&&await se(n)},size:`sm`,variant:`ghost`,children:(0,F.jsx)(m,{className:`size-4`})})]})})]},n)})})]})})]})]}),(0,F.jsxs)(O,{children:[(0,F.jsx)(O.Header,{children:`Create Version`}),(0,F.jsxs)(`div`,{className:`p-4`,children:[V.error&&(0,F.jsx)(w,{error:V.error,msg:`Failed to create version`}),(0,F.jsxs)(`form`,{className:`space-y-6`,onSubmit:q(le),children:[(0,F.jsxs)(D,{children:[(0,F.jsx)(E,{children:(0,F.jsx)(`label`,{htmlFor:`sourceVersion`,children:`Clone from version`})}),(0,F.jsxs)(p,{onValueChange:e=>{ae(e??`none`)},value:Y(`sourceVersion`)??`none`,children:[(0,F.jsx)(f,{className:`w-full`,id:`sourceVersion`,children:(0,F.jsx)(l,{})}),(0,F.jsxs)(d,{children:[(0,F.jsx)(u,{value:`none`,children:`none (start blank)`}),G.map(e=>(0,F.jsxs)(u,{value:String(e.VersionNumber),children:[`v`,e.VersionNumber,e.VersionDescription?` — ${e.VersionDescription}`:``]},e.VersionNumber))]})]})]}),(0,F.jsxs)(D,{children:[(0,F.jsx)(E,{children:(0,F.jsx)(`label`,{htmlFor:`versionDescription`,children:`Version Description`})}),(0,F.jsx)(g,{id:`versionDescription`,placeholder:`What changed in this version`,...J(`versionDescription`)})]}),(0,F.jsx)(A,{control:K,errors:ie,register:J}),(0,F.jsx)(h,{disabled:Z||V.isPending,type:`submit`,children:Z||V.isPending?`Creating…`:`Create Version`})]})]})]})]}),(0,F.jsx)(re,{description:`Are you sure you want to delete the launch template "${W.LaunchTemplateName??W.LaunchTemplateId}"? All versions will be deleted. This action cannot be undone.`,isPending:B.isPending,onConfirm:ce,onOpenChange:U,open:H,title:`Delete Launch Template`})]})}export{z as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id28.js b/spinifex/services/spinifexui/frontend/dist/assets/_id28.js index aabfa6070..10b848c66 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id28.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id28.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./useNavigate.js";import{$t as o,nn as s}from"./cluster-config.js";import{t as c}from"./back-link.js";import{c as l,i as u,n as d,s as f,t as p}from"./select.js";import{t as m}from"./pencil.js";import{t as h}from"./trash-2.js";import{t as g}from"./button.js";import{t as _}from"./input.js";import{t as v}from"./acm.js";import{t as y}from"./certificate-import-dialog.js";import{O as b,w as x}from"./ec2.js";import{_ as S,a as C,d as w,f as T,g as E,h as D,o as O,r as k,s as A,t as j,u as M}from"./elbv2.js";import{i as N,n as P,o as F,r as I,s as L,t as R,u as z}from"./elbv22.js";import{t as B}from"./_id9.js";import{a as V,i as H,n as ee,r as te,t as U}from"./zod.js";import{t as W}from"./error-banner.js";import{t as G}from"./page-heading.js";import{a as K,r as ne,t as q}from"./field.js";import{a as J,i as Y,l as re,n as ie,o as ae,r as oe,s as se,t as ce}from"./alert-dialog.js";import{t as le}from"./delete-confirmation-dialog.js";import{n as X,t as Z}from"./detail-row.js";import{t as ue}from"./state-badge.js";import{c as de,i as fe,n as pe,o as me,s as he,t as ge}from"./elbv23.js";import{n as _e,t as ve}from"./attributes-editor.js";import{t as ye}from"./tags-editor.js";import{i as be,n as xe,r as Se,t as Ce}from"./tabs.js";var we=r(),Q=e(n(),1),$=t(),Te=80,Ee=443,De=[],Oe=[];function ke(e){let t=e.CertificateArn?.split(`/`).pop()??e.CertificateArn??``;return e.DomainName?`${e.DomainName} · ${t}`:t}function Ae(e){let t=(0,we.c)(55),{form:n,protocols:r,targetGroups:i,certificates:a,sslPolicies:o}=e,s=a===void 0?De:a,c=o===void 0?Oe:o,{control:u,register:m,getValues:h,setValue:v,formState:b}=n,{errors:x}=b,[S,C]=(0,Q.useState)(!1),w;t[0]===u?w=t[1]:(w={control:u,name:`protocol`},t[0]=u,t[1]=w);let T=V(w),E=T===`HTTPS`,D;t[2]===T?D=t[3]:(D=he(T),t[2]=T,t[3]=D);let O=D,k;t[4]!==h||t[5]!==v?(k=e=>{if(!e)return;let t=h(`port`);he(e)?(t===Te&&v(`port`,Ee),e===`HTTPS`?h(`sslPolicy`)||v(`sslPolicy`,ge):v(`sslPolicy`,void 0)):(t===Ee&&v(`port`,Te),v(`certificateArn`,void 0),v(`sslPolicy`,void 0))},t[4]=h,t[5]=v,t[6]=k):k=t[6];let A=k,j;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`listener-protocol`,children:`Protocol`})}),t[7]=j):j=t[7];let M;t[8]!==A||t[9]!==r?(M=e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:e=>{t.onChange(e),A(e)},value:t.value,children:[(0,$.jsx)(f,{className:`w-full`,id:`listener-protocol`,children:(0,$.jsx)(l,{})}),(0,$.jsx)(d,{children:r.map(Pe)})]})},t[8]=A,t[9]=r,t[10]=M):M=t[10];let N;t[11]!==u||t[12]!==M?(N=(0,$.jsxs)(q,{children:[j,(0,$.jsx)(ee,{control:u,name:`protocol`,render:M})]}),t[11]=u,t[12]=M,t[13]=N):N=t[13];let P;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`listener-port`,children:`Port`})}),t[14]=P):P=t[14];let F=!!x.port,I=O?`443`:`80`,L;t[15]===m?L=t[16]:(L=m(`port`,{valueAsNumber:!0}),t[15]=m,t[16]=L);let R;t[17]!==F||t[18]!==I||t[19]!==L?(R=(0,$.jsx)(_,{"aria-invalid":F,id:`listener-port`,inputMode:`numeric`,placeholder:I,type:`number`,...L}),t[17]=F,t[18]=I,t[19]=L,t[20]=R):R=t[20];let z;t[21]===x.port?z=t[22]:(z=(0,$.jsx)(ne,{errors:[x.port]}),t[21]=x.port,t[22]=z);let B;t[23]!==R||t[24]!==z?(B=(0,$.jsxs)(q,{children:[P,R,z]}),t[23]=R,t[24]=z,t[25]=B):B=t[25];let H;t[26]!==s||t[27]!==u||t[28]!==x.certificateArn||t[29]!==S||t[30]!==E||t[31]!==O||t[32]!==v||t[33]!==c?(H=O&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`listener-certificate`,children:`Certificate`})}),(0,$.jsx)(ee,{control:u,name:`certificateArn`,render:e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:t.onChange,value:t.value??``,children:[(0,$.jsx)(f,{"aria-invalid":!!x.certificateArn,className:`w-full`,id:`listener-certificate`,children:(0,$.jsx)(l,{placeholder:`Select certificate`})}),(0,$.jsx)(d,{children:s.map(Ne)})]})}}),(0,$.jsx)(ne,{errors:[x.certificateArn]}),(0,$.jsxs)(`div`,{className:`mt-1 flex items-center justify-between`,children:[s.length===0&&(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No certificates imported yet.`}),(0,$.jsx)(g,{className:`ml-auto`,onClick:()=>C(!0),size:`sm`,type:`button`,variant:`ghost`,children:`Import certificate…`})]})]}),E&&(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`listener-ssl-policy`,children:`Security policy`})}),(0,$.jsx)(ee,{control:u,name:`sslPolicy`,render:e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:t.onChange,value:t.value??`ELBSecurityPolicy-2016-08`,children:[(0,$.jsx)(f,{className:`w-full`,id:`listener-ssl-policy`,children:(0,$.jsx)(l,{})}),(0,$.jsx)(d,{children:c.map(Me)})]})}})]}),(0,$.jsx)(y,{onImported:e=>v(`certificateArn`,e,{shouldValidate:!0}),onOpenChange:C,open:S})]}),t[26]=s,t[27]=u,t[28]=x.certificateArn,t[29]=S,t[30]=E,t[31]=O,t[32]=v,t[33]=c,t[34]=H):H=t[34];let te;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`listener-default-tg`,children:`Default target group`})}),t[35]=te):te=t[35];let U;t[36]!==x.defaultTargetGroupArn||t[37]!==i?(U=e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:t.onChange,value:t.value??``,children:[(0,$.jsx)(f,{"aria-invalid":!!x.defaultTargetGroupArn,className:`w-full`,id:`listener-default-tg`,children:(0,$.jsx)(l,{placeholder:`Select target group`})}),(0,$.jsx)(d,{children:i.map(je)})]})},t[36]=x.defaultTargetGroupArn,t[37]=i,t[38]=U):U=t[38];let W;t[39]!==u||t[40]!==U?(W=(0,$.jsx)(ee,{control:u,name:`defaultTargetGroupArn`,render:U}),t[39]=u,t[40]=U,t[41]=W):W=t[41];let G;t[42]===x.defaultTargetGroupArn?G=t[43]:(G=(0,$.jsx)(ne,{errors:[x.defaultTargetGroupArn]}),t[42]=x.defaultTargetGroupArn,t[43]=G);let J;t[44]===i.length?J=t[45]:(J=i.length===0&&(0,$.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No target groups available in this VPC. Create one first.`}),t[44]=i.length,t[45]=J);let Y;t[46]!==W||t[47]!==G||t[48]!==J?(Y=(0,$.jsxs)(q,{children:[te,W,G,J]}),t[46]=W,t[47]=G,t[48]=J,t[49]=Y):Y=t[49];let re;return t[50]!==B||t[51]!==H||t[52]!==Y||t[53]!==N?(re=(0,$.jsxs)($.Fragment,{children:[N,B,H,Y]}),t[50]=B,t[51]=H,t[52]=Y,t[53]=N,t[54]=re):re=t[54],re}function je(e){return(0,$.jsxs)(u,{value:e.TargetGroupArn??``,children:[e.TargetGroupName,` · `,e.Protocol,`:`,e.Port]},e.TargetGroupArn)}function Me(e){return(0,$.jsx)(u,{value:e.Name??``,children:e.Name},e.Name)}function Ne(e){return(0,$.jsx)(u,{value:e.CertificateArn??``,children:ke(e)},e.CertificateArn)}function Pe(e){return(0,$.jsx)(u,{value:e,children:e},e)}function Fe({listenerArn:e,targetGroups:t}){let{data:n}=i(R(e)),r=k(),a=T(),o=A(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(),[d,f]=(0,Q.useState)(),p=n.Rules??[],_=new Map;for(let e of t)e.TargetGroupArn&&e.TargetGroupName&&_.set(e.TargetGroupArn,e.TargetGroupName);return(0,$.jsxs)(`div`,{className:`space-y-3`,children:[r.error&&(0,$.jsx)(W,{error:r.error,msg:`Failed to create rule`}),a.error&&(0,$.jsx)(W,{error:a.error,msg:`Failed to modify rule`}),o.error&&(0,$.jsx)(W,{error:o.error,msg:`Failed to delete rule`}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[p.length,` rule`,p.length===1?``:`s`,` (including default)`]}),(0,$.jsx)(g,{onClick:()=>c(!0),size:`sm`,children:`Add rule`})]}),(0,$.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,$.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Priority`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Conditions`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Forward to`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,$.jsx)(`tbody`,{children:p.map(e=>(0,$.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,$.jsx)(`td`,{className:`px-4 py-2`,children:e.Priority}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:Ie(e.Conditions,e.IsDefault===!0)}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:Re(e,_)}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-right`,children:e.IsDefault===!0?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Edit via listener`}):(0,$.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,$.jsx)(g,{"aria-label":`Edit rule ${e.Priority}`,onClick:()=>u(e),size:`sm`,variant:`ghost`,children:(0,$.jsx)(m,{className:`size-4`})}),(0,$.jsx)(g,{"aria-label":`Delete rule ${e.Priority}`,onClick:()=>f(e),size:`sm`,variant:`ghost`,children:(0,$.jsx)(h,{className:`size-4`})})]})})]},e.RuleArn??e.Priority??`default`))})]})}),s&&(0,$.jsx)(Ue,{isPending:r.isPending,mode:`add`,onOpenChange:c,onSubmit:async t=>{try{await r.mutateAsync({listenerArn:e,priority:t.priority,conditions:t.conditions.map(ze),forwardTargetGroupArn:t.forwardTargetGroupArn}),c(!1)}catch{}},open:s,targetGroups:t}),(0,$.jsx)(Ue,{initialRule:l,isPending:a.isPending,mode:`edit`,onOpenChange:e=>!e&&u(void 0),onSubmit:async t=>{if(l?.RuleArn)try{await a.mutateAsync({ruleArn:l.RuleArn,listenerArn:e,conditions:t.conditions.map(ze),forwardTargetGroupArn:t.forwardTargetGroupArn}),u(void 0)}catch{}},open:l!==void 0,targetGroups:t}),(0,$.jsx)(le,{description:d?`Delete rule with priority ${d.Priority}? This cannot be undone.`:``,isPending:o.isPending,onConfirm:async()=>{if(d?.RuleArn)try{await o.mutateAsync({ruleArn:d.RuleArn,listenerArn:e})}finally{f(void 0)}},onOpenChange:e=>!e&&f(void 0),open:d!==void 0,title:`Delete rule`})]})}function Ie(e,t){return t?`default`:!e||e.length===0?`—`:e.map(e=>{let t=Le(e);return`${e.Field}: ${t.join(`, `)}`}).join(` AND `)}function Le(e){if(e.Field===void 0)return e.Values??[];switch(e.Field){case`host-header`:return e.HostHeaderConfig?.Values??e.Values??[];case`path-pattern`:return e.PathPatternConfig?.Values??e.Values??[];case`http-header`:{let t=e.HttpHeaderConfig?.HttpHeaderName??`?`;return(e.HttpHeaderConfig?.Values??[]).map(e=>`${t}=${e}`)}case`http-request-method`:return e.HttpRequestMethodConfig?.Values??[];case`source-ip`:return e.SourceIpConfig?.Values??[];case`query-string`:return(e.QueryStringConfig?.Values??[]).map(e=>e.Key?`${e.Key}=${e.Value??``}`:e.Value??``);default:return e.Values??[]}}function Re(e,t){let n=e.Actions?.[0];return n?n.Type===`forward`&&n.TargetGroupArn?t.get(n.TargetGroupArn)??n.TargetGroupArn:n.Type??`—`:`—`}function ze(e){let t=e.rawValues.split(/[\n,]/).map(e=>e.trim()).filter(e=>e.length>0);return e.field===`query-string`?{field:e.field,values:[],queryStringPairs:t.map(e=>{let t=e.indexOf(`=`);return t===-1?{value:e}:{key:e.slice(0,t),value:e.slice(t+1)}})}:{field:e.field,values:t,httpHeaderName:e.httpHeaderName}}var Be=1,Ve=[{field:`path-pattern`,rawValues:``}];function He(e){let t=Number(e.Priority??Be),n=e.Conditions?.map(e=>Ye(e))??[];return{priority:Number.isFinite(t)?t:Be,conditions:n.length>0?n:Ve,forwardTargetGroupArn:e.Actions?.[0]?.TargetGroupArn??``}}function Ue(e){let t=(0,we.c)(84),{open:n,onOpenChange:r,onSubmit:i,isPending:a,targetGroups:o,mode:s,initialRule:c}=e,u,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=U(fe),m={priority:Be,conditions:Ve,forwardTargetGroupArn:``},t[0]=u,t[1]=m):(u=t[0],m=t[1]);let h;t[2]===c?h=t[3]:(h=c?He(c):void 0,t[2]=c,t[3]=h);let v;t[4]===h?v=t[5]:(v={resolver:u,defaultValues:m,values:h},t[4]=h,t[5]=v);let y=H(v),b;t[6]===y.control?b=t[7]:(b={control:y.control,name:`conditions`},t[6]=y.control,t[7]=b);let{fields:x,append:S,remove:C}=te(b),w;t[8]!==y||t[9]!==i?(w=y.handleSubmit(i),t[8]=y,t[9]=i,t[10]=w):w=t[10];let T=w,E;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(E={maxWidth:`40rem`,width:`calc(100vw - 2rem)`},t[11]=E):E=t[11];let D=s===`add`?`Add rule`:`Edit rule`,O;t[12]===D?O=t[13]:(O=(0,$.jsx)(re,{children:D}),t[12]=D,t[13]=O);let k;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(J,{children:`Routing rules match incoming requests and forward them to a target group. Rules evaluate in priority order; the listener default applies when no rule matches.`}),t[14]=k):k=t[14];let A;t[15]===O?A=t[16]:(A=(0,$.jsxs)(se,{children:[O,k]}),t[15]=O,t[16]=A);let j;t[17]===T?j=t[18]:(j=e=>{e.preventDefault(),T()},t[17]=T,t[18]=j);let M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`rule-priority`,children:`Priority`})}),t[19]=M):M=t[19];let N=!!y.formState.errors.priority,P;t[20]===y?P=t[21]:(P=y.register(`priority`,{valueAsNumber:!0}),t[20]=y,t[21]=P);let F;t[22]!==N||t[23]!==P?(F=(0,$.jsx)(_,{"aria-invalid":N,id:`rule-priority`,inputMode:`numeric`,type:`number`,...P}),t[22]=N,t[23]=P,t[24]=F):F=t[24];let I;t[25]===y.formState.errors.priority?I=t[26]:(I=(0,$.jsx)(ne,{errors:[y.formState.errors.priority]}),t[25]=y.formState.errors.priority,t[26]=I);let L;t[27]!==F||t[28]!==I?(L=(0,$.jsxs)(q,{children:[M,F,I]}),t[27]=F,t[28]=I,t[29]=L):L=t[29];let R;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(K,{children:`Conditions`}),t[30]=R):R=t[30];let z=x.length>=5,B;t[31]===S?B=t[32]:(B=()=>S({field:`path-pattern`,rawValues:``}),t[31]=S,t[32]=B);let V;t[33]!==z||t[34]!==B?(V=(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[R,(0,$.jsx)(g,{disabled:z,onClick:B,size:`sm`,type:`button`,variant:`outline`,children:`Add condition`})]}),t[33]=z,t[34]=B,t[35]=V):V=t[35];let W;if(t[36]!==x||t[37]!==y||t[38]!==C){let e;t[40]!==x.length||t[41]!==y||t[42]!==C?(e=(e,t)=>(0,$.jsx)(Ge,{form:y,index:t,onRemove:x.length>1?()=>C(t):void 0},e.id),t[40]=x.length,t[41]=y,t[42]=C,t[43]=e):e=t[43],W=x.map(e),t[36]=x,t[37]=y,t[38]=C,t[39]=W}else W=t[39];let G;t[44]!==V||t[45]!==W?(G=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[V,W]}),t[44]=V,t[45]=W,t[46]=G):G=t[46];let le;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`rule-forward-tg`,children:`Forward to target group`})}),t[47]=le):le=t[47];let X;t[48]!==y.formState.errors.forwardTargetGroupArn||t[49]!==o?(X=e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:t.onChange,value:t.value??``,children:[(0,$.jsx)(f,{"aria-invalid":!!y.formState.errors.forwardTargetGroupArn,className:`w-full`,id:`rule-forward-tg`,children:(0,$.jsx)(l,{placeholder:`Select target group`})}),(0,$.jsx)(d,{children:o.map(We)})]})},t[48]=y.formState.errors.forwardTargetGroupArn,t[49]=o,t[50]=X):X=t[50];let Z;t[51]!==y.control||t[52]!==X?(Z=(0,$.jsx)(ee,{control:y.control,name:`forwardTargetGroupArn`,render:X}),t[51]=y.control,t[52]=X,t[53]=Z):Z=t[53];let ue;t[54]===y.formState.errors.forwardTargetGroupArn?ue=t[55]:(ue=(0,$.jsx)(ne,{errors:[y.formState.errors.forwardTargetGroupArn]}),t[54]=y.formState.errors.forwardTargetGroupArn,t[55]=ue);let de;t[56]!==Z||t[57]!==ue?(de=(0,$.jsxs)(q,{children:[le,Z,ue]}),t[56]=Z,t[57]=ue,t[58]=de):de=t[58];let pe;t[59]!==j||t[60]!==L||t[61]!==G||t[62]!==de?(pe=(0,$.jsxs)(`form`,{className:`min-w-0 space-y-4`,onSubmit:j,children:[L,G,de]}),t[59]=j,t[60]=L,t[61]=G,t[62]=de,t[63]=pe):pe=t[63];let me;t[64]===a?me=t[65]:(me=(0,$.jsx)(oe,{disabled:a,children:`Cancel`}),t[64]=a,t[65]=me);let he;t[66]!==a||t[67]!==s?(he=Xe(s,a),t[66]=a,t[67]=s,t[68]=he):he=t[68];let ge;t[69]!==T||t[70]!==a||t[71]!==he?(ge=(0,$.jsx)(ie,{disabled:a,onClick:T,children:he}),t[69]=T,t[70]=a,t[71]=he,t[72]=ge):ge=t[72];let _e;t[73]!==me||t[74]!==ge?(_e=(0,$.jsxs)(ae,{children:[me,ge]}),t[73]=me,t[74]=ge,t[75]=_e):_e=t[75];let ve;t[76]!==A||t[77]!==pe||t[78]!==_e?(ve=(0,$.jsxs)(Y,{className:`grid-cols-[minmax(0,1fr)]`,style:E,children:[A,pe,_e]}),t[76]=A,t[77]=pe,t[78]=_e,t[79]=ve):ve=t[79];let ye;return t[80]!==r||t[81]!==n||t[82]!==ve?(ye=(0,$.jsx)(ce,{onOpenChange:r,open:n,children:ve}),t[80]=r,t[81]=n,t[82]=ve,t[83]=ye):ye=t[83],ye}function We(e){return(0,$.jsxs)(u,{value:e.TargetGroupArn??``,children:[e.TargetGroupName,` · `,e.Protocol,`:`,e.Port]},e.TargetGroupArn)}function Ge(e){let t=(0,we.c)(54),{form:n,index:r,onRemove:i}=e,a,o,s,c,m,v,y,b,x,S;if(t[0]!==n||t[1]!==r||t[2]!==i){let e=n.watch(`conditions.${r}.field`);s=n.formState.errors.conditions?.[r],b=`space-y-2 rounded-md border p-3`;let C=`rule-cond-${r}-field`,w;t[13]===C?w=t[14]:(w=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:C,children:`Type`})}),t[13]=C,t[14]=w);let T=`conditions.${r}.field`,E;t[15]===r?E=t[16]:(E=e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:t.onChange,value:t.value,children:[(0,$.jsx)(f,{className:`w-full`,id:`rule-cond-${r}-field`,children:(0,$.jsx)(l,{})}),(0,$.jsxs)(d,{children:[(0,$.jsx)(u,{value:`path-pattern`,children:`Path pattern`}),(0,$.jsx)(u,{value:`host-header`,children:`Host header`}),(0,$.jsx)(u,{value:`http-header`,children:`HTTP header`}),(0,$.jsx)(u,{value:`http-request-method`,children:`HTTP method`}),(0,$.jsx)(u,{value:`source-ip`,children:`Source IP CIDR`}),(0,$.jsx)(u,{value:`query-string`,children:`Query string`})]})]})},t[15]=r,t[16]=E);let D;t[17]!==n.control||t[18]!==T||t[19]!==E?(D=(0,$.jsx)(ee,{control:n.control,name:T,render:E}),t[17]=n.control,t[18]=T,t[19]=E,t[20]=D):D=t[20];let O;t[21]!==D||t[22]!==w?(O=(0,$.jsxs)(`div`,{className:`flex-1`,children:[w,D]}),t[21]=D,t[22]=w,t[23]=O):O=t[23];let k;t[24]!==r||t[25]!==i?(k=i&&(0,$.jsx)(g,{"aria-label":`Remove condition ${r+1}`,className:`self-end`,onClick:i,size:`sm`,type:`button`,variant:`ghost`,children:(0,$.jsx)(h,{className:`size-4`})}),t[24]=r,t[25]=i,t[26]=k):k=t[26],t[27]!==O||t[28]!==k?(x=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[O,k]}),t[27]=O,t[28]=k,t[29]=x):x=t[29],S=e===`http-header`&&(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`rule-cond-${r}-hdr-name`,children:`Header name`})}),(0,$.jsx)(_,{"aria-invalid":!!s?.httpHeaderName,id:`rule-cond-${r}-hdr-name`,placeholder:`X-Tenant`,...n.register(`conditions.${r}.httpHeaderName`)}),(0,$.jsx)(ne,{errors:[s?.httpHeaderName]})]}),o=q;let A=`rule-cond-${r}-values`,j;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`(comma or newline separated, max 5)`}),t[30]=j):j=t[30],t[31]===A?y=t[32]:(y=(0,$.jsx)(K,{children:(0,$.jsxs)(`label`,{htmlFor:A,children:[`Values`,` `,j]})}),t[31]=A,t[32]=y),a=_,c=!!s?.rawValues,m=`rule-cond-${r}-values`,v=Ke(e),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=m,t[8]=v,t[9]=y,t[10]=b,t[11]=x,t[12]=S}else a=t[3],o=t[4],s=t[5],c=t[6],m=t[7],v=t[8],y=t[9],b=t[10],x=t[11],S=t[12];let C;t[33]!==n||t[34]!==r?(C=n.register(`conditions.${r}.rawValues`),t[33]=n,t[34]=r,t[35]=C):C=t[35];let w;t[36]!==a||t[37]!==c||t[38]!==m||t[39]!==v||t[40]!==C?(w=(0,$.jsx)(a,{"aria-invalid":c,id:m,placeholder:v,...C}),t[36]=a,t[37]=c,t[38]=m,t[39]=v,t[40]=C,t[41]=w):w=t[41];let T=s?.rawValues,E;t[42]===T?E=t[43]:(E=(0,$.jsx)(ne,{errors:[T]}),t[42]=T,t[43]=E);let D;t[44]!==o||t[45]!==E||t[46]!==y||t[47]!==w?(D=(0,$.jsxs)(o,{children:[y,w,E]}),t[44]=o,t[45]=E,t[46]=y,t[47]=w,t[48]=D):D=t[48];let O;return t[49]!==D||t[50]!==b||t[51]!==x||t[52]!==S?(O=(0,$.jsxs)(`div`,{className:b,children:[x,S,D]}),t[49]=D,t[50]=b,t[51]=x,t[52]=S,t[53]=O):O=t[53],O}function Ke(e){switch(e){case`path-pattern`:return`/api/*`;case`host-header`:return`*.example.com`;case`http-header`:return`acme`;case`http-request-method`:return`GET, POST`;case`source-ip`:return`10.0.0.0/8`;case`query-string`:return`key=value`;default:return``}}var qe=new Set([`host-header`,`path-pattern`,`http-header`,`http-request-method`,`source-ip`,`query-string`]);function Je(e){return e!==void 0&&qe.has(e)}function Ye(e){let t=Le(e);return{field:Je(e.Field)?e.Field:`path-pattern`,httpHeaderName:e.HttpHeaderConfig?.HttpHeaderName,rawValues:t.join(`, `)}}function Xe(e,t){return t?e===`add`?`Adding…`:`Saving…`:e===`add`?`Add rule`:`Save changes`}function Ze(e){return{protocol:me(e),port:80,defaultTargetGroupArn:``}}function Qe(e,t){let n=t.find(t=>t===e.Protocol)??t[0]??`HTTP`,r=he(n);return{protocol:n,port:e.Port??80,defaultTargetGroupArn:e.DefaultActions?.[0]?.TargetGroupArn??``,certificateArn:r?e.Certificates?.[0]?.CertificateArn:void 0,sslPolicy:n===`HTTPS`?e.SslPolicy:void 0}}function $e(e){if(e.Protocol!==`HTTPS`)return`—`;let t=e.Certificates?.[0]?.CertificateArn?.split(`/`).pop(),n=e.SslPolicy;return t&&n?`${n} · ${t}`:n??t??`—`}function et({loadBalancerArn:e,vpcId:t,lbType:n}){let r=de(n),{data:a}=i(P(e)),{data:o}=i(z),{data:s}=i(v),{data:c}=i(F),l=j(),u=C(),d=M(),[f,p]=(0,Q.useState)(!1),[_,y]=(0,Q.useState)(),[b,x]=(0,Q.useState)(),[S,w]=(0,Q.useState)(),T=a.Listeners??[],E=o.TargetGroups??[],D=E.filter(e=>e.VpcId===t),O=s.CertificateSummaryList??[],k=c.SslPolicies??[],A=new Map;for(let e of E)e.TargetGroupArn&&e.TargetGroupName&&A.set(e.TargetGroupArn,e.TargetGroupName);let N=e=>{let t=e.DefaultActions?.[0];if(!t)return`—`;if(t.Type===`forward`&&t.TargetGroupArn){let e=A.get(t.TargetGroupArn);return e?`forward → ${e}`:`forward → ${t.TargetGroupArn}`}return t.Type??`—`};return(0,$.jsxs)(`div`,{className:`space-y-3`,children:[l.error&&(0,$.jsx)(W,{error:l.error,msg:`Failed to create listener`}),d.error&&(0,$.jsx)(W,{error:d.error,msg:`Failed to modify listener`}),u.error&&(0,$.jsx)(W,{error:u.error,msg:`Failed to delete listener`}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[T.length,` listener`,T.length===1?``:`s`]}),(0,$.jsx)(g,{onClick:()=>p(!0),size:`sm`,children:`Add listener`})]}),T.length===0?(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`No listeners configured.`}):(0,$.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,$.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Protocol`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Port`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`TLS`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Default action`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Listener ARN`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,$.jsx)(`tbody`,{children:T.map(e=>{let t=e.ListenerArn??``,n=S===t;return(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,$.jsx)(`td`,{className:`px-4 py-2`,children:e.Protocol}),(0,$.jsx)(`td`,{className:`px-4 py-2`,children:e.Port}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:$e(e)}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:N(e)}),(0,$.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:t}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,$.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,$.jsx)(g,{"aria-label":`${n?`Hide`:`Show`} rules for listener ${e.Protocol}:${e.Port}`,onClick:()=>w(n?void 0:t),size:`sm`,variant:`ghost`,children:n?`Hide rules`:`Rules`}),(0,$.jsx)(g,{"aria-label":`Edit listener ${e.Protocol}:${e.Port}`,onClick:()=>y(e),size:`sm`,variant:`ghost`,children:(0,$.jsx)(m,{className:`size-4`})}),(0,$.jsx)(g,{"aria-label":`Delete listener ${e.Protocol}:${e.Port}`,onClick:()=>x(e),size:`sm`,variant:`ghost`,children:(0,$.jsx)(h,{className:`size-4`})})]})})]}),n&&t&&(0,$.jsx)(`tr`,{className:`border-b bg-muted/30 last:border-0`,children:(0,$.jsx)(`td`,{className:`px-4 py-3`,colSpan:6,children:(0,$.jsx)(Fe,{listenerArn:t,targetGroups:D})})})]},t)})})]})}),f&&(0,$.jsx)(tt,{certificates:O,isPending:l.isPending,lbType:n,onOpenChange:p,onSubmit:async t=>{try{await l.mutateAsync({loadBalancerArn:e,protocol:t.protocol,port:t.port,defaultTargetGroupArn:t.defaultTargetGroupArn,certificateArn:t.certificateArn,sslPolicy:t.sslPolicy}),p(!1)}catch{}},open:f,protocols:r,sslPolicies:k,targetGroups:D}),(0,$.jsx)(nt,{certificates:O,isPending:d.isPending,listener:_,onOpenChange:e=>!e&&y(void 0),onSubmit:async t=>{if(_?.ListenerArn)try{await d.mutateAsync({listenerArn:_.ListenerArn,loadBalancerArn:e,protocol:t.protocol,port:t.port,defaultTargetGroupArn:t.defaultTargetGroupArn,certificateArn:t.certificateArn,sslPolicy:t.sslPolicy}),y(void 0)}catch{}},protocols:r,sslPolicies:k,targetGroups:D}),(0,$.jsx)(le,{description:b?`Delete listener ${b.Protocol}:${b.Port}? This cannot be undone.`:``,isPending:u.isPending,onConfirm:async()=>{if(b?.ListenerArn)try{await u.mutateAsync(b.ListenerArn)}finally{x(void 0)}},onOpenChange:e=>!e&&x(void 0),open:b!==void 0,title:`Delete listener`})]})}function tt(e){let t=(0,we.c)(37),{open:n,onOpenChange:r,lbType:i,protocols:a,targetGroups:o,certificates:s,sslPolicies:c,isPending:l,onSubmit:u}=e,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=U(pe),t[0]=d):d=t[0];let f;t[1]===i?f=t[2]:(f=Ze(i),t[1]=i,t[2]=f);let p;t[3]===f?p=t[4]:(p={resolver:d,defaultValues:f},t[3]=f,t[4]=p);let m=H(p),h;t[5]!==m||t[6]!==u?(h=m.handleSubmit(u),t[5]=m,t[6]=u,t[7]=h):h=t[7];let g=h,_;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_={maxWidth:`32rem`,width:`calc(100vw - 2rem)`},t[8]=_):_=t[8];let v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(se,{children:[(0,$.jsx)(re,{children:`Add listener`}),(0,$.jsx)(J,{children:`Listeners forward incoming traffic to a default target group.`})]}),t[9]=v):v=t[9];let y;t[10]===g?y=t[11]:(y=e=>{e.preventDefault(),g()},t[10]=g,t[11]=y);let b;t[12]!==s||t[13]!==m||t[14]!==a||t[15]!==c||t[16]!==o?(b=(0,$.jsx)(Ae,{certificates:s,form:m,protocols:a,sslPolicies:c,targetGroups:o}),t[12]=s,t[13]=m,t[14]=a,t[15]=c,t[16]=o,t[17]=b):b=t[17];let x;t[18]!==y||t[19]!==b?(x=(0,$.jsx)(`form`,{className:`min-w-0 space-y-4`,onSubmit:y,children:b}),t[18]=y,t[19]=b,t[20]=x):x=t[20];let S;t[21]===l?S=t[22]:(S=(0,$.jsx)(oe,{disabled:l,children:`Cancel`}),t[21]=l,t[22]=S);let C=l?`Adding…`:`Add listener`,w;t[23]!==g||t[24]!==l||t[25]!==C?(w=(0,$.jsx)(ie,{disabled:l,onClick:g,children:C}),t[23]=g,t[24]=l,t[25]=C,t[26]=w):w=t[26];let T;t[27]!==S||t[28]!==w?(T=(0,$.jsxs)(ae,{children:[S,w]}),t[27]=S,t[28]=w,t[29]=T):T=t[29];let E;t[30]!==T||t[31]!==x?(E=(0,$.jsxs)(Y,{className:`grid-cols-[minmax(0,1fr)]`,style:_,children:[v,x,T]}),t[30]=T,t[31]=x,t[32]=E):E=t[32];let D;return t[33]!==r||t[34]!==n||t[35]!==E?(D=(0,$.jsx)(ce,{onOpenChange:r,open:n,children:E}),t[33]=r,t[34]=n,t[35]=E,t[36]=D):D=t[36],D}function nt(e){let t=(0,we.c)(39),{listener:n,onOpenChange:r,protocols:i,targetGroups:a,certificates:o,sslPolicies:s,isPending:c,onSubmit:l}=e,u=n!==void 0,d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=U(pe),f={protocol:`HTTP`,port:80,defaultTargetGroupArn:``},t[0]=d,t[1]=f):(d=t[0],f=t[1]);let p;t[2]!==n||t[3]!==i?(p=n?Qe(n,i):void 0,t[2]=n,t[3]=i,t[4]=p):p=t[4];let m;t[5]===p?m=t[6]:(m={resolver:d,defaultValues:f,values:p},t[5]=p,t[6]=m);let h=H(m),g;t[7]!==h||t[8]!==l?(g=h.handleSubmit(l),t[7]=h,t[8]=l,t[9]=g):g=t[9];let _=g,v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={maxWidth:`32rem`,width:`calc(100vw - 2rem)`},t[10]=v):v=t[10];let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsxs)(se,{children:[(0,$.jsx)(re,{children:`Edit listener`}),(0,$.jsx)(J,{children:`Update port, protocol, or default target group. Changes apply without dropping the listener.`})]}),t[11]=y):y=t[11];let b;t[12]===_?b=t[13]:(b=e=>{e.preventDefault(),_()},t[12]=_,t[13]=b);let x;t[14]!==o||t[15]!==h||t[16]!==i||t[17]!==s||t[18]!==a?(x=(0,$.jsx)(Ae,{certificates:o,form:h,protocols:i,sslPolicies:s,targetGroups:a}),t[14]=o,t[15]=h,t[16]=i,t[17]=s,t[18]=a,t[19]=x):x=t[19];let S;t[20]!==b||t[21]!==x?(S=(0,$.jsx)(`form`,{className:`min-w-0 space-y-4`,onSubmit:b,children:x}),t[20]=b,t[21]=x,t[22]=S):S=t[22];let C;t[23]===c?C=t[24]:(C=(0,$.jsx)(oe,{disabled:c,children:`Cancel`}),t[23]=c,t[24]=C);let w=c?`Saving…`:`Save changes`,T;t[25]!==_||t[26]!==c||t[27]!==w?(T=(0,$.jsx)(ie,{disabled:c,onClick:_,children:w}),t[25]=_,t[26]=c,t[27]=w,t[28]=T):T=t[28];let E;t[29]!==C||t[30]!==T?(E=(0,$.jsxs)(ae,{children:[C,T]}),t[29]=C,t[30]=T,t[31]=E):E=t[31];let D;t[32]!==S||t[33]!==E?(D=(0,$.jsxs)(Y,{className:`grid-cols-[minmax(0,1fr)]`,style:v,children:[y,S,E]}),t[32]=S,t[33]=E,t[34]=D):D=t[34];let O;return t[35]!==r||t[36]!==u||t[37]!==D?(O=(0,$.jsx)(ce,{onOpenChange:r,open:u,children:D}),t[35]=r,t[36]=u,t[37]=D,t[38]=O):O=t[38],O}function rt(e,t){if(e.length!==t.length)return!1;let n=new Set(t);return e.every(e=>n.has(e))}function it(e){let t=(0,we.c)(48),{available:n,current:r,onSubmit:i,isPending:a,error:o,isSuccess:s}=e,c;t[0]===r?c=t[1]:(c=[...r],t[0]=r,t[1]=c);let l=c,[u,d]=(0,Q.useState)(l),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},t[2]=f):f=t[2];let p=f,m;t[3]===l?m=t[4]:(m=()=>d(l),t[3]=l,t[4]=m);let h=m,_;t[5]!==l||t[6]!==u?(_=rt(u,l),t[5]=l,t[6]=u,t[7]=_):_=t[7];let v=!_,y=u.length===0,b;t[8]===u?b=t[9]:(b=new Set(u),t[8]=u,t[9]=b);let x=b,S;t[10]!==v||t[11]!==y||t[12]!==i||t[13]!==u?(S=e=>{e.preventDefault(),!(!v||y)&&i(u)},t[10]=v,t[11]=y,t[12]=i,t[13]=u,t[14]=S):S=t[14];let C;t[15]===o?C=t[16]:(C=o&&(0,$.jsx)(`div`,{className:`mb-4 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive`,role:`alert`,children:o.message||`Failed to update security groups`}),t[15]=o,t[16]=C);let w;t[17]!==v||t[18]!==s?(w=s&&!v&&(0,$.jsx)(`div`,{className:`mb-4 rounded-md border border-emerald-500 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-400`,role:`status`,children:`Security groups updated.`}),t[17]=v,t[18]=s,t[19]=w):w=t[19];let T;t[20]!==n||t[21]!==x?(T=n.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No security groups in this VPC.`}):n.map(e=>(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,$.jsx)(`input`,{"aria-label":`Security group ${e.GroupId} (${e.GroupName})`,checked:x.has(e.GroupId??``),onChange:()=>p(e.GroupId??``),type:`checkbox`}),(0,$.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId)),t[20]=n,t[21]=x,t[22]=T):T=t[22];let E;t[23]===y?E=t[24]:(E=y&&(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:`At least one security group is required.`}),t[23]=y,t[24]=E);let D;t[25]!==E||t[26]!==T?(D=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 p-4`,children:[T,E]}),t[25]=E,t[26]=T,t[27]=D):D=t[27];let O=v?`Unsaved changes`:`No changes`,k;t[28]===O?k=t[29]:(k=(0,$.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:O}),t[28]=O,t[29]=k);let A=a||!v,j;t[30]!==h||t[31]!==A?(j=(0,$.jsx)(g,{disabled:A,onClick:h,size:`sm`,type:`button`,variant:`secondary`,children:`Reset`}),t[30]=h,t[31]=A,t[32]=j):j=t[32];let M=a||!v||y,N=a?`Saving…`:`Save changes`,P;t[33]!==M||t[34]!==N?(P=(0,$.jsx)(g,{disabled:M,size:`sm`,type:`submit`,children:N}),t[33]=M,t[34]=N,t[35]=P):P=t[35];let F;t[36]!==k||t[37]!==j||t[38]!==P?(F=(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t p-4`,children:[k,j,P]}),t[36]=k,t[37]=j,t[38]=P,t[39]=F):F=t[39];let I;t[40]!==D||t[41]!==F?(I=(0,$.jsxs)(`div`,{className:`rounded-lg border bg-card`,children:[D,F]}),t[40]=D,t[41]=F,t[42]=I):I=t[42];let L;return t[43]!==I||t[44]!==S||t[45]!==C||t[46]!==w?(L=(0,$.jsxs)(`form`,{onSubmit:S,children:[C,w,I]}),t[43]=I,t[44]=S,t[45]=C,t[46]=w,t[47]=L):L=t[47],L}function at(e,t){if(e.length!==t.length)return!1;let n=new Set(t);return e.every(e=>n.has(e))}function ot(e){let t=s(e.Tags),n=e.AvailabilityZone?` · ${e.AvailabilityZone}`:``,r=e.CidrBlock?` (${e.CidrBlock})`:``;return`${e.SubnetId}${t?` — ${t}`:``}${r}${n}`}function st(e){let t=(0,we.c)(49),{available:n,current:r,onSubmit:i,isPending:a,error:o,isSuccess:s}=e,c;t[0]===r?c=t[1]:(c=[...r],t[0]=r,t[1]=c);let l=c,[u,d]=(0,Q.useState)(l),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},t[2]=f):f=t[2];let p=f,m;t[3]===l?m=t[4]:(m=()=>d(l),t[3]=l,t[4]=m);let h=m,_;t[5]!==l||t[6]!==u?(_=at(u,l),t[5]=l,t[6]=u,t[7]=_):_=t[7];let v=!_,y=u.length===0,b;t[8]===u?b=t[9]:(b=new Set(u),t[8]=u,t[9]=b);let x=b,S;t[10]!==v||t[11]!==y||t[12]!==i||t[13]!==u?(S=e=>{e.preventDefault(),!(!v||y)&&i(u)},t[10]=v,t[11]=y,t[12]=i,t[13]=u,t[14]=S):S=t[14];let C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`div`,{className:`mb-4 rounded-md border border-amber-500 bg-amber-500/10 p-3 text-sm text-amber-700 dark:text-amber-400`,role:`note`,children:`Applying a subnet change re-homes the load balancer by relaunching its underlying system VM. Expect a brief data-plane interruption while it restarts.`}),t[15]=C):C=t[15];let w;t[16]===o?w=t[17]:(w=o&&(0,$.jsx)(`div`,{className:`mb-4 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive`,role:`alert`,children:o.message||`Failed to update subnets`}),t[16]=o,t[17]=w);let T;t[18]!==v||t[19]!==s?(T=s&&!v&&(0,$.jsx)(`div`,{className:`mb-4 rounded-md border border-emerald-500 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-400`,role:`status`,children:`Subnets updated.`}),t[18]=v,t[19]=s,t[20]=T):T=t[20];let E;t[21]!==n||t[22]!==x?(E=n.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No subnets in this VPC.`}):n.map(e=>(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,$.jsx)(`input`,{"aria-label":`Subnet ${e.SubnetId}`,checked:x.has(e.SubnetId??``),onChange:()=>p(e.SubnetId??``),type:`checkbox`}),(0,$.jsx)(`span`,{className:`font-mono`,children:ot(e)})]},e.SubnetId)),t[21]=n,t[22]=x,t[23]=E):E=t[23];let D;t[24]===y?D=t[25]:(D=y&&(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:`At least one subnet is required.`}),t[24]=y,t[25]=D);let O;t[26]!==E||t[27]!==D?(O=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 p-4`,children:[E,D]}),t[26]=E,t[27]=D,t[28]=O):O=t[28];let k=v?`Unsaved changes`:`No changes`,A;t[29]===k?A=t[30]:(A=(0,$.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:k}),t[29]=k,t[30]=A);let j=a||!v,M;t[31]!==h||t[32]!==j?(M=(0,$.jsx)(g,{disabled:j,onClick:h,size:`sm`,type:`button`,variant:`secondary`,children:`Reset`}),t[31]=h,t[32]=j,t[33]=M):M=t[33];let N=a||!v||y,P=a?`Saving…`:`Save changes`,F;t[34]!==N||t[35]!==P?(F=(0,$.jsx)(g,{disabled:N,size:`sm`,type:`submit`,children:P}),t[34]=N,t[35]=P,t[36]=F):F=t[36];let I;t[37]!==A||t[38]!==M||t[39]!==F?(I=(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t p-4`,children:[A,M,F]}),t[37]=A,t[38]=M,t[39]=F,t[40]=I):I=t[40];let L;t[41]!==O||t[42]!==I?(L=(0,$.jsxs)(`div`,{className:`rounded-lg border bg-card`,children:[O,I]}),t[41]=O,t[42]=I,t[43]=L):L=t[43];let R;return t[44]!==L||t[45]!==S||t[46]!==w||t[47]!==T?(R=(0,$.jsxs)(`form`,{onSubmit:S,children:[C,w,T,L]}),t[44]=L,t[45]=S,t[46]=w,t[47]=T,t[48]=R):R=t[48],R}function ct({arn:e}){let t=a(),{data:n}=i(N(e)),{data:r}=i(I(e)),{data:l}=i(L([e])),{data:u}=i(b),{data:d}=i(x),f=O(),p=w(),m=S(),_=D(),v=E(),[y,C]=(0,Q.useState)(!1),T=n.LoadBalancers?.[0];if(!T?.LoadBalancerArn)return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{to:`/ec2/describe-load-balancers`,children:`Back to load balancers`}),(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`Load balancer not found.`})]});let k=async()=>{try{await f.mutateAsync(e),t({to:`/ec2/describe-load-balancers`})}finally{C(!1)}},A=u.Subnets??[],j=e=>{let t=A.find(t=>t.SubnetId===e);if(!t)return e;let n=s(t.Tags),r=t.CidrBlock?` (${t.CidrBlock})`:``;return n?`${e} — ${n}${r}`:`${e}${r}`},M=r.Attributes??[],P=l?.TagDescriptions?.find(t=>t.ResourceArn===e)?.Tags??[],F=(T.SecurityGroups??[]).filter(e=>e!==void 0),R=(d.SecurityGroups??[]).filter(e=>e.VpcId===T.VpcId),z=A.filter(e=>e.VpcId===T.VpcId),B=(T.AvailabilityZones??[]).map(e=>e.SubnetId).filter(e=>e!==void 0),V=T.Type===`network`;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{to:`/ec2/describe-load-balancers`,children:`Back to load balancers`}),f.error&&(0,$.jsx)(W,{error:f.error,msg:`Failed to delete load balancer`}),(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsx)(G,{actions:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(g,{onClick:()=>C(!0),size:`sm`,variant:`destructive`,children:[(0,$.jsx)(h,{className:`size-4`}),`Delete`]}),(0,$.jsx)(ue,{state:T.State?.Code})]}),subtitle:`Load Balancer Details`,title:T.LoadBalancerName??T.LoadBalancerArn}),(0,$.jsxs)(Ce,{defaultValue:`overview`,children:[(0,$.jsxs)(xe,{children:[(0,$.jsx)(be,{value:`overview`,children:`Overview`}),(0,$.jsx)(be,{value:`listeners`,children:`Listeners`}),(0,$.jsx)(be,{value:`subnets`,children:`Subnets`}),!V&&(0,$.jsx)(be,{value:`security-groups`,children:`Security groups`}),(0,$.jsx)(be,{value:`attributes`,children:`Attributes`}),(0,$.jsx)(be,{value:`tags`,children:`Tags`})]}),(0,$.jsxs)(Se,{value:`overview`,children:[(0,$.jsxs)(X,{children:[(0,$.jsx)(X.Header,{children:`Load balancer`}),(0,$.jsxs)(X.Content,{children:[(0,$.jsx)(Z,{label:`ARN`,value:T.LoadBalancerArn}),(0,$.jsx)(Z,{label:`DNS name`,value:T.DNSName}),(0,$.jsx)(Z,{label:`State`,value:T.State?.Reason?`${T.State.Code} — ${T.State.Reason}`:T.State?.Code}),(0,$.jsx)(Z,{label:`Type`,value:T.Type}),(0,$.jsx)(Z,{label:`Scheme`,value:T.Scheme}),(0,$.jsx)(Z,{label:`IP address type`,value:T.IpAddressType}),(0,$.jsx)(Z,{label:`VPC`,value:T.VpcId}),(0,$.jsx)(Z,{label:`Created at`,value:o(T.CreatedTime)})]})]}),(0,$.jsxs)(X,{children:[(0,$.jsx)(X.Header,{children:`Availability zones`}),(0,$.jsx)(X.Content,{children:(T.AvailabilityZones??[]).map(e=>(0,$.jsx)(Z,{label:e.ZoneName??`—`,value:e.SubnetId?j(e.SubnetId):void 0},`${e.ZoneName}-${e.SubnetId}`))})]}),(T.SecurityGroups??[]).length>0&&(0,$.jsxs)(X,{children:[(0,$.jsx)(X.Header,{children:`Security groups`}),(0,$.jsx)(X.Content,{children:(T.SecurityGroups??[]).map(e=>(0,$.jsx)(Z,{label:`Security group`,value:e},e))})]})]}),(0,$.jsx)(Se,{value:`listeners`,children:(0,$.jsx)(et,{lbType:V?`network`:`application`,loadBalancerArn:e,vpcId:T.VpcId})}),(0,$.jsx)(Se,{value:`subnets`,children:(0,$.jsx)(st,{available:z,current:B,error:v.error,isPending:v.isPending,isSuccess:v.isSuccess,onSubmit:t=>v.mutate({loadBalancerArn:e,subnetIds:t})})}),!V&&(0,$.jsx)(Se,{value:`security-groups`,children:(0,$.jsx)(it,{available:R,current:F,error:_.error,isPending:_.isPending,isSuccess:_.isSuccess,onSubmit:t=>_.mutate({loadBalancerArn:e,securityGroupIds:t})})}),(0,$.jsx)(Se,{value:`attributes`,children:(0,$.jsx)(ve,{attributes:M,error:p.error,isPending:p.isPending,isSuccess:p.isSuccess,onSubmit:t=>{p.mutate({loadBalancerArn:e,attributes:t})},specs:_e})}),(0,$.jsx)(Se,{value:`tags`,children:(0,$.jsx)(ye,{error:m.error,isPending:m.isPending,isSuccess:m.isSuccess,onSubmit:t=>m.mutate({resourceArn:e,tags:t,initialKeys:P.map(e=>e.Key??``).filter(e=>e.length>0)}),tags:P})})]})]}),(0,$.jsx)(le,{description:`Are you sure you want to delete load balancer "${T.LoadBalancerName??T.LoadBalancerArn}"? This action cannot be undone.`,isPending:f.isPending,onConfirm:k,onOpenChange:C,open:y,title:`Delete load balancer`})]})}function lt(){let e=(0,we.c)(2),{id:t}=B.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,$.jsx)(ct,{arn:n}),e[0]=n,e[1]=r),r}export{lt as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./useNavigate.js";import{$t as o,nn as s}from"./cluster-config.js";import{t as c}from"./back-link.js";import{c as l,i as u,n as d,s as f,t as p}from"./select.js";import{t as m}from"./pencil.js";import{t as h}from"./trash-2.js";import{t as g}from"./button.js";import{t as _}from"./input.js";import{t as v}from"./acm.js";import{t as y}from"./certificate-import-dialog.js";import{O as b,w as x}from"./ec2.js";import{_ as S,a as C,d as w,f as T,g as E,h as D,o as O,r as k,s as A,t as j,u as M}from"./elbv2.js";import{i as N,n as P,o as F,r as I,s as L,t as R,u as z}from"./elbv22.js";import{t as B}from"./_id9.js";import{a as V,i as H,n as ee,r as te,t as U}from"./zod.js";import{t as W}from"./error-banner.js";import{t as G}from"./page-heading.js";import{a as K,r as ne,t as q}from"./field.js";import{a as J,i as Y,l as re,n as ie,o as ae,r as oe,s as se,t as ce}from"./alert-dialog.js";import{t as le}from"./delete-confirmation-dialog.js";import{n as X,t as Z}from"./detail-row.js";import{t as ue}from"./state-badge.js";import{c as de,i as fe,n as pe,o as me,s as he,t as ge}from"./elbv23.js";import{n as _e,t as ve}from"./attributes-editor.js";import{t as ye}from"./tags-editor.js";import{i as be,n as xe,r as Se,t as Ce}from"./tabs.js";var we=r(),Q=e(n(),1),$=t(),Te=80,Ee=443,De=[],Oe=[];function ke(e){let t=e.CertificateArn?.split(`/`).pop()??e.CertificateArn??``;return e.DomainName?`${e.DomainName} · ${t}`:t}function Ae(e){let t=(0,we.c)(55),{form:n,protocols:r,targetGroups:i,certificates:a,sslPolicies:o}=e,s=a===void 0?De:a,c=o===void 0?Oe:o,{control:u,register:m,getValues:h,setValue:v,formState:b}=n,{errors:x}=b,[S,C]=(0,Q.useState)(!1),w;t[0]===u?w=t[1]:(w={control:u,name:`protocol`},t[0]=u,t[1]=w);let T=V(w),E=T===`HTTPS`,D;t[2]===T?D=t[3]:(D=he(T),t[2]=T,t[3]=D);let O=D,k;t[4]!==h||t[5]!==v?(k=e=>{if(!e)return;let t=h(`port`);he(e)?(t===Te&&v(`port`,Ee),e===`HTTPS`?h(`sslPolicy`)||v(`sslPolicy`,ge):v(`sslPolicy`,void 0)):(t===Ee&&v(`port`,Te),v(`certificateArn`,void 0),v(`sslPolicy`,void 0))},t[4]=h,t[5]=v,t[6]=k):k=t[6];let A=k,j;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`listener-protocol`,children:`Protocol`})}),t[7]=j):j=t[7];let M;t[8]!==A||t[9]!==r?(M=e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:e=>{t.onChange(e),A(e)},value:t.value,children:[(0,$.jsx)(f,{className:`w-full`,id:`listener-protocol`,children:(0,$.jsx)(l,{})}),(0,$.jsx)(d,{children:r.map(Pe)})]})},t[8]=A,t[9]=r,t[10]=M):M=t[10];let N;t[11]!==u||t[12]!==M?(N=(0,$.jsxs)(q,{children:[j,(0,$.jsx)(ee,{control:u,name:`protocol`,render:M})]}),t[11]=u,t[12]=M,t[13]=N):N=t[13];let P;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`listener-port`,children:`Port`})}),t[14]=P):P=t[14];let F=!!x.port,I=O?`443`:`80`,L;t[15]===m?L=t[16]:(L=m(`port`,{valueAsNumber:!0}),t[15]=m,t[16]=L);let R;t[17]!==F||t[18]!==I||t[19]!==L?(R=(0,$.jsx)(_,{"aria-invalid":F,id:`listener-port`,inputMode:`numeric`,placeholder:I,type:`number`,...L}),t[17]=F,t[18]=I,t[19]=L,t[20]=R):R=t[20];let z;t[21]===x.port?z=t[22]:(z=(0,$.jsx)(ne,{errors:[x.port]}),t[21]=x.port,t[22]=z);let B;t[23]!==R||t[24]!==z?(B=(0,$.jsxs)(q,{children:[P,R,z]}),t[23]=R,t[24]=z,t[25]=B):B=t[25];let H;t[26]!==s||t[27]!==u||t[28]!==x.certificateArn||t[29]!==S||t[30]!==E||t[31]!==O||t[32]!==v||t[33]!==c?(H=O&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`listener-certificate`,children:`Certificate`})}),(0,$.jsx)(ee,{control:u,name:`certificateArn`,render:e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:t.onChange,value:t.value??``,children:[(0,$.jsx)(f,{"aria-invalid":!!x.certificateArn,className:`w-full`,id:`listener-certificate`,children:(0,$.jsx)(l,{placeholder:`Select certificate`})}),(0,$.jsx)(d,{children:s.map(Ne)})]})}}),(0,$.jsx)(ne,{errors:[x.certificateArn]}),(0,$.jsxs)(`div`,{className:`mt-1 flex items-center justify-between`,children:[s.length===0&&(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No certificates imported yet.`}),(0,$.jsx)(g,{className:`ml-auto`,onClick:()=>{C(!0)},size:`sm`,type:`button`,variant:`ghost`,children:`Import certificate…`})]})]}),E&&(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`listener-ssl-policy`,children:`Security policy`})}),(0,$.jsx)(ee,{control:u,name:`sslPolicy`,render:e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:t.onChange,value:t.value??`ELBSecurityPolicy-2016-08`,children:[(0,$.jsx)(f,{className:`w-full`,id:`listener-ssl-policy`,children:(0,$.jsx)(l,{})}),(0,$.jsx)(d,{children:c.map(Me)})]})}})]}),(0,$.jsx)(y,{onImported:e=>{v(`certificateArn`,e,{shouldValidate:!0})},onOpenChange:C,open:S})]}),t[26]=s,t[27]=u,t[28]=x.certificateArn,t[29]=S,t[30]=E,t[31]=O,t[32]=v,t[33]=c,t[34]=H):H=t[34];let te;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`listener-default-tg`,children:`Default target group`})}),t[35]=te):te=t[35];let U;t[36]!==x.defaultTargetGroupArn||t[37]!==i?(U=e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:t.onChange,value:t.value??``,children:[(0,$.jsx)(f,{"aria-invalid":!!x.defaultTargetGroupArn,className:`w-full`,id:`listener-default-tg`,children:(0,$.jsx)(l,{placeholder:`Select target group`})}),(0,$.jsx)(d,{children:i.map(je)})]})},t[36]=x.defaultTargetGroupArn,t[37]=i,t[38]=U):U=t[38];let W;t[39]!==u||t[40]!==U?(W=(0,$.jsx)(ee,{control:u,name:`defaultTargetGroupArn`,render:U}),t[39]=u,t[40]=U,t[41]=W):W=t[41];let G;t[42]===x.defaultTargetGroupArn?G=t[43]:(G=(0,$.jsx)(ne,{errors:[x.defaultTargetGroupArn]}),t[42]=x.defaultTargetGroupArn,t[43]=G);let J;t[44]===i.length?J=t[45]:(J=i.length===0&&(0,$.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No target groups available in this VPC. Create one first.`}),t[44]=i.length,t[45]=J);let Y;t[46]!==W||t[47]!==G||t[48]!==J?(Y=(0,$.jsxs)(q,{children:[te,W,G,J]}),t[46]=W,t[47]=G,t[48]=J,t[49]=Y):Y=t[49];let re;return t[50]!==B||t[51]!==H||t[52]!==Y||t[53]!==N?(re=(0,$.jsxs)($.Fragment,{children:[N,B,H,Y]}),t[50]=B,t[51]=H,t[52]=Y,t[53]=N,t[54]=re):re=t[54],re}function je(e){return(0,$.jsxs)(u,{value:e.TargetGroupArn??``,children:[e.TargetGroupName,` · `,e.Protocol,`:`,e.Port]},e.TargetGroupArn)}function Me(e){return(0,$.jsx)(u,{value:e.Name??``,children:e.Name},e.Name)}function Ne(e){return(0,$.jsx)(u,{value:e.CertificateArn??``,children:ke(e)},e.CertificateArn)}function Pe(e){return(0,$.jsx)(u,{value:e,children:e},e)}function Fe({listenerArn:e,targetGroups:t}){let{data:n}=i(R(e)),r=k(),a=T(),o=A(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(),[d,f]=(0,Q.useState)(),p=n.Rules??[],_=new Map;for(let e of t)e.TargetGroupArn&&e.TargetGroupName&&_.set(e.TargetGroupArn,e.TargetGroupName);return(0,$.jsxs)(`div`,{className:`space-y-3`,children:[r.error&&(0,$.jsx)(W,{error:r.error,msg:`Failed to create rule`}),a.error&&(0,$.jsx)(W,{error:a.error,msg:`Failed to modify rule`}),o.error&&(0,$.jsx)(W,{error:o.error,msg:`Failed to delete rule`}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[p.length,` rule`,p.length===1?``:`s`,` (including default)`]}),(0,$.jsx)(g,{onClick:()=>{c(!0)},size:`sm`,children:`Add rule`})]}),(0,$.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,$.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Priority`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Conditions`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Forward to`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,$.jsx)(`tbody`,{children:p.map(e=>(0,$.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,$.jsx)(`td`,{className:`px-4 py-2`,children:e.Priority}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:Ie(e.Conditions,e.IsDefault===!0)}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:Re(e,_)}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-right`,children:e.IsDefault===!0?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Edit via listener`}):(0,$.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,$.jsx)(g,{"aria-label":`Edit rule ${e.Priority}`,onClick:()=>{u(e)},size:`sm`,variant:`ghost`,children:(0,$.jsx)(m,{className:`size-4`})}),(0,$.jsx)(g,{"aria-label":`Delete rule ${e.Priority}`,onClick:()=>{f(e)},size:`sm`,variant:`ghost`,children:(0,$.jsx)(h,{className:`size-4`})})]})})]},e.RuleArn??e.Priority??`default`))})]})}),s&&(0,$.jsx)(Ue,{isPending:r.isPending,mode:`add`,onOpenChange:c,onSubmit:async t=>{try{await r.mutateAsync({listenerArn:e,priority:t.priority,conditions:t.conditions.map(ze),forwardTargetGroupArn:t.forwardTargetGroupArn}),c(!1)}catch{}},open:s,targetGroups:t}),(0,$.jsx)(Ue,{initialRule:l,isPending:a.isPending,mode:`edit`,onOpenChange:e=>{e||u(void 0)},onSubmit:async t=>{if(l?.RuleArn)try{await a.mutateAsync({ruleArn:l.RuleArn,listenerArn:e,conditions:t.conditions.map(ze),forwardTargetGroupArn:t.forwardTargetGroupArn}),u(void 0)}catch{}},open:l!==void 0,targetGroups:t}),(0,$.jsx)(le,{description:d?`Delete rule with priority ${d.Priority}? This cannot be undone.`:``,isPending:o.isPending,onConfirm:async()=>{if(d?.RuleArn)try{await o.mutateAsync({ruleArn:d.RuleArn,listenerArn:e})}finally{f(void 0)}},onOpenChange:e=>{e||f(void 0)},open:d!==void 0,title:`Delete rule`})]})}function Ie(e,t){return t?`default`:!e||e.length===0?`—`:e.map(e=>{let t=Le(e);return`${e.Field}: ${t.join(`, `)}`}).join(` AND `)}function Le(e){if(e.Field===void 0)return e.Values??[];switch(e.Field){case`host-header`:return e.HostHeaderConfig?.Values??e.Values??[];case`path-pattern`:return e.PathPatternConfig?.Values??e.Values??[];case`http-header`:{let t=e.HttpHeaderConfig?.HttpHeaderName??`?`;return(e.HttpHeaderConfig?.Values??[]).map(e=>`${t}=${e}`)}case`http-request-method`:return e.HttpRequestMethodConfig?.Values??[];case`source-ip`:return e.SourceIpConfig?.Values??[];case`query-string`:return(e.QueryStringConfig?.Values??[]).map(e=>e.Key?`${e.Key}=${e.Value??``}`:e.Value??``);default:return e.Values??[]}}function Re(e,t){let n=e.Actions?.[0];return n?n.Type===`forward`&&n.TargetGroupArn?t.get(n.TargetGroupArn)??n.TargetGroupArn:n.Type??`—`:`—`}function ze(e){let t=e.rawValues.split(/[\n,]/).map(e=>e.trim()).filter(e=>e.length>0);return e.field===`query-string`?{field:e.field,values:[],queryStringPairs:t.map(e=>{let t=e.indexOf(`=`);return t===-1?{value:e}:{key:e.slice(0,t),value:e.slice(t+1)}})}:{field:e.field,values:t,httpHeaderName:e.httpHeaderName}}var Be=1,Ve=[{field:`path-pattern`,rawValues:``}];function He(e){let t=Number(e.Priority??Be),n=e.Conditions?.map(e=>Ye(e))??[];return{priority:Number.isFinite(t)?t:Be,conditions:n.length>0?n:Ve,forwardTargetGroupArn:e.Actions?.[0]?.TargetGroupArn??``}}function Ue(e){let t=(0,we.c)(84),{open:n,onOpenChange:r,onSubmit:i,isPending:a,targetGroups:o,mode:s,initialRule:c}=e,u,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=U(fe),m={priority:Be,conditions:Ve,forwardTargetGroupArn:``},t[0]=u,t[1]=m):(u=t[0],m=t[1]);let h;t[2]===c?h=t[3]:(h=c?He(c):void 0,t[2]=c,t[3]=h);let v;t[4]===h?v=t[5]:(v={resolver:u,defaultValues:m,values:h},t[4]=h,t[5]=v);let y=H(v),b;t[6]===y.control?b=t[7]:(b={control:y.control,name:`conditions`},t[6]=y.control,t[7]=b);let{fields:x,append:S,remove:C}=te(b),w;t[8]!==y||t[9]!==i?(w=y.handleSubmit(i),t[8]=y,t[9]=i,t[10]=w):w=t[10];let T=w,E;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(E={maxWidth:`40rem`,width:`calc(100vw - 2rem)`},t[11]=E):E=t[11];let D=s===`add`?`Add rule`:`Edit rule`,O;t[12]===D?O=t[13]:(O=(0,$.jsx)(re,{children:D}),t[12]=D,t[13]=O);let k;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(J,{children:`Routing rules match incoming requests and forward them to a target group. Rules evaluate in priority order; the listener default applies when no rule matches.`}),t[14]=k):k=t[14];let A;t[15]===O?A=t[16]:(A=(0,$.jsxs)(se,{children:[O,k]}),t[15]=O,t[16]=A);let j;t[17]===T?j=t[18]:(j=e=>{e.preventDefault(),T()},t[17]=T,t[18]=j);let M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`rule-priority`,children:`Priority`})}),t[19]=M):M=t[19];let N=!!y.formState.errors.priority,P;t[20]===y?P=t[21]:(P=y.register(`priority`,{valueAsNumber:!0}),t[20]=y,t[21]=P);let F;t[22]!==N||t[23]!==P?(F=(0,$.jsx)(_,{"aria-invalid":N,id:`rule-priority`,inputMode:`numeric`,type:`number`,...P}),t[22]=N,t[23]=P,t[24]=F):F=t[24];let I;t[25]===y.formState.errors.priority?I=t[26]:(I=(0,$.jsx)(ne,{errors:[y.formState.errors.priority]}),t[25]=y.formState.errors.priority,t[26]=I);let L;t[27]!==F||t[28]!==I?(L=(0,$.jsxs)(q,{children:[M,F,I]}),t[27]=F,t[28]=I,t[29]=L):L=t[29];let R;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(K,{children:`Conditions`}),t[30]=R):R=t[30];let z=x.length>=5,B;t[31]===S?B=t[32]:(B=()=>{S({field:`path-pattern`,rawValues:``})},t[31]=S,t[32]=B);let V;t[33]!==z||t[34]!==B?(V=(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[R,(0,$.jsx)(g,{disabled:z,onClick:B,size:`sm`,type:`button`,variant:`outline`,children:`Add condition`})]}),t[33]=z,t[34]=B,t[35]=V):V=t[35];let W;if(t[36]!==x||t[37]!==y||t[38]!==C){let e;t[40]!==x.length||t[41]!==y||t[42]!==C?(e=(e,t)=>(0,$.jsx)(Ge,{form:y,index:t,onRemove:x.length>1?()=>{C(t)}:void 0},e.id),t[40]=x.length,t[41]=y,t[42]=C,t[43]=e):e=t[43],W=x.map(e),t[36]=x,t[37]=y,t[38]=C,t[39]=W}else W=t[39];let G;t[44]!==V||t[45]!==W?(G=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[V,W]}),t[44]=V,t[45]=W,t[46]=G):G=t[46];let le;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`rule-forward-tg`,children:`Forward to target group`})}),t[47]=le):le=t[47];let X;t[48]!==y.formState.errors.forwardTargetGroupArn||t[49]!==o?(X=e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:t.onChange,value:t.value??``,children:[(0,$.jsx)(f,{"aria-invalid":!!y.formState.errors.forwardTargetGroupArn,className:`w-full`,id:`rule-forward-tg`,children:(0,$.jsx)(l,{placeholder:`Select target group`})}),(0,$.jsx)(d,{children:o.map(We)})]})},t[48]=y.formState.errors.forwardTargetGroupArn,t[49]=o,t[50]=X):X=t[50];let Z;t[51]!==y.control||t[52]!==X?(Z=(0,$.jsx)(ee,{control:y.control,name:`forwardTargetGroupArn`,render:X}),t[51]=y.control,t[52]=X,t[53]=Z):Z=t[53];let ue;t[54]===y.formState.errors.forwardTargetGroupArn?ue=t[55]:(ue=(0,$.jsx)(ne,{errors:[y.formState.errors.forwardTargetGroupArn]}),t[54]=y.formState.errors.forwardTargetGroupArn,t[55]=ue);let de;t[56]!==Z||t[57]!==ue?(de=(0,$.jsxs)(q,{children:[le,Z,ue]}),t[56]=Z,t[57]=ue,t[58]=de):de=t[58];let pe;t[59]!==j||t[60]!==L||t[61]!==G||t[62]!==de?(pe=(0,$.jsxs)(`form`,{className:`min-w-0 space-y-4`,onSubmit:j,children:[L,G,de]}),t[59]=j,t[60]=L,t[61]=G,t[62]=de,t[63]=pe):pe=t[63];let me;t[64]===a?me=t[65]:(me=(0,$.jsx)(oe,{disabled:a,children:`Cancel`}),t[64]=a,t[65]=me);let he;t[66]!==a||t[67]!==s?(he=Xe(s,a),t[66]=a,t[67]=s,t[68]=he):he=t[68];let ge;t[69]!==T||t[70]!==a||t[71]!==he?(ge=(0,$.jsx)(ie,{disabled:a,onClick:T,children:he}),t[69]=T,t[70]=a,t[71]=he,t[72]=ge):ge=t[72];let _e;t[73]!==me||t[74]!==ge?(_e=(0,$.jsxs)(ae,{children:[me,ge]}),t[73]=me,t[74]=ge,t[75]=_e):_e=t[75];let ve;t[76]!==A||t[77]!==pe||t[78]!==_e?(ve=(0,$.jsxs)(Y,{className:`grid-cols-[minmax(0,1fr)]`,style:E,children:[A,pe,_e]}),t[76]=A,t[77]=pe,t[78]=_e,t[79]=ve):ve=t[79];let ye;return t[80]!==r||t[81]!==n||t[82]!==ve?(ye=(0,$.jsx)(ce,{onOpenChange:r,open:n,children:ve}),t[80]=r,t[81]=n,t[82]=ve,t[83]=ye):ye=t[83],ye}function We(e){return(0,$.jsxs)(u,{value:e.TargetGroupArn??``,children:[e.TargetGroupName,` · `,e.Protocol,`:`,e.Port]},e.TargetGroupArn)}function Ge(e){let t=(0,we.c)(54),{form:n,index:r,onRemove:i}=e,a,o,s,c,m,v,y,b,x,S;if(t[0]!==n||t[1]!==r||t[2]!==i){let e=n.watch(`conditions.${r}.field`);s=n.formState.errors.conditions?.[r],b=`space-y-2 rounded-md border p-3`;let C=`rule-cond-${r}-field`,w;t[13]===C?w=t[14]:(w=(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:C,children:`Type`})}),t[13]=C,t[14]=w);let T=`conditions.${r}.field`,E;t[15]===r?E=t[16]:(E=e=>{let{field:t}=e;return(0,$.jsxs)(p,{onValueChange:t.onChange,value:t.value,children:[(0,$.jsx)(f,{className:`w-full`,id:`rule-cond-${r}-field`,children:(0,$.jsx)(l,{})}),(0,$.jsxs)(d,{children:[(0,$.jsx)(u,{value:`path-pattern`,children:`Path pattern`}),(0,$.jsx)(u,{value:`host-header`,children:`Host header`}),(0,$.jsx)(u,{value:`http-header`,children:`HTTP header`}),(0,$.jsx)(u,{value:`http-request-method`,children:`HTTP method`}),(0,$.jsx)(u,{value:`source-ip`,children:`Source IP CIDR`}),(0,$.jsx)(u,{value:`query-string`,children:`Query string`})]})]})},t[15]=r,t[16]=E);let D;t[17]!==n.control||t[18]!==T||t[19]!==E?(D=(0,$.jsx)(ee,{control:n.control,name:T,render:E}),t[17]=n.control,t[18]=T,t[19]=E,t[20]=D):D=t[20];let O;t[21]!==D||t[22]!==w?(O=(0,$.jsxs)(`div`,{className:`flex-1`,children:[w,D]}),t[21]=D,t[22]=w,t[23]=O):O=t[23];let k;t[24]!==r||t[25]!==i?(k=i&&(0,$.jsx)(g,{"aria-label":`Remove condition ${r+1}`,className:`self-end`,onClick:i,size:`sm`,type:`button`,variant:`ghost`,children:(0,$.jsx)(h,{className:`size-4`})}),t[24]=r,t[25]=i,t[26]=k):k=t[26],t[27]!==O||t[28]!==k?(x=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[O,k]}),t[27]=O,t[28]=k,t[29]=x):x=t[29],S=e===`http-header`&&(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{children:(0,$.jsx)(`label`,{htmlFor:`rule-cond-${r}-hdr-name`,children:`Header name`})}),(0,$.jsx)(_,{"aria-invalid":!!s?.httpHeaderName,id:`rule-cond-${r}-hdr-name`,placeholder:`X-Tenant`,...n.register(`conditions.${r}.httpHeaderName`)}),(0,$.jsx)(ne,{errors:[s?.httpHeaderName]})]}),o=q;let A=`rule-cond-${r}-values`,j;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`(comma or newline separated, max 5)`}),t[30]=j):j=t[30],t[31]===A?y=t[32]:(y=(0,$.jsx)(K,{children:(0,$.jsxs)(`label`,{htmlFor:A,children:[`Values`,` `,j]})}),t[31]=A,t[32]=y),a=_,c=!!s?.rawValues,m=`rule-cond-${r}-values`,v=Ke(e),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=m,t[8]=v,t[9]=y,t[10]=b,t[11]=x,t[12]=S}else a=t[3],o=t[4],s=t[5],c=t[6],m=t[7],v=t[8],y=t[9],b=t[10],x=t[11],S=t[12];let C;t[33]!==n||t[34]!==r?(C=n.register(`conditions.${r}.rawValues`),t[33]=n,t[34]=r,t[35]=C):C=t[35];let w;t[36]!==a||t[37]!==c||t[38]!==m||t[39]!==v||t[40]!==C?(w=(0,$.jsx)(a,{"aria-invalid":c,id:m,placeholder:v,...C}),t[36]=a,t[37]=c,t[38]=m,t[39]=v,t[40]=C,t[41]=w):w=t[41];let T=s?.rawValues,E;t[42]===T?E=t[43]:(E=(0,$.jsx)(ne,{errors:[T]}),t[42]=T,t[43]=E);let D;t[44]!==o||t[45]!==E||t[46]!==y||t[47]!==w?(D=(0,$.jsxs)(o,{children:[y,w,E]}),t[44]=o,t[45]=E,t[46]=y,t[47]=w,t[48]=D):D=t[48];let O;return t[49]!==D||t[50]!==b||t[51]!==x||t[52]!==S?(O=(0,$.jsxs)(`div`,{className:b,children:[x,S,D]}),t[49]=D,t[50]=b,t[51]=x,t[52]=S,t[53]=O):O=t[53],O}function Ke(e){switch(e){case`path-pattern`:return`/api/*`;case`host-header`:return`*.example.com`;case`http-header`:return`acme`;case`http-request-method`:return`GET, POST`;case`source-ip`:return`10.0.0.0/8`;case`query-string`:return`key=value`;default:return``}}var qe=new Set([`host-header`,`path-pattern`,`http-header`,`http-request-method`,`source-ip`,`query-string`]);function Je(e){return e!==void 0&&qe.has(e)}function Ye(e){let t=Le(e);return{field:Je(e.Field)?e.Field:`path-pattern`,httpHeaderName:e.HttpHeaderConfig?.HttpHeaderName,rawValues:t.join(`, `)}}function Xe(e,t){return t?e===`add`?`Adding…`:`Saving…`:e===`add`?`Add rule`:`Save changes`}function Ze(e){return{protocol:me(e),port:80,defaultTargetGroupArn:``}}function Qe(e,t){let n=t.find(t=>t===e.Protocol)??t[0]??`HTTP`,r=he(n);return{protocol:n,port:e.Port??80,defaultTargetGroupArn:e.DefaultActions?.[0]?.TargetGroupArn??``,certificateArn:r?e.Certificates?.[0]?.CertificateArn:void 0,sslPolicy:n===`HTTPS`?e.SslPolicy:void 0}}function $e(e){if(e.Protocol!==`HTTPS`)return`—`;let t=e.Certificates?.[0]?.CertificateArn?.split(`/`).pop(),n=e.SslPolicy;return t&&n?`${n} · ${t}`:n??t??`—`}function et({loadBalancerArn:e,vpcId:t,lbType:n}){let r=de(n),{data:a}=i(P(e)),{data:o}=i(z),{data:s}=i(v),{data:c}=i(F),l=j(),u=C(),d=M(),[f,p]=(0,Q.useState)(!1),[_,y]=(0,Q.useState)(),[b,x]=(0,Q.useState)(),[S,w]=(0,Q.useState)(),T=a.Listeners??[],E=o.TargetGroups??[],D=E.filter(e=>e.VpcId===t),O=s.CertificateSummaryList??[],k=c.SslPolicies??[],A=new Map;for(let e of E)e.TargetGroupArn&&e.TargetGroupName&&A.set(e.TargetGroupArn,e.TargetGroupName);let N=e=>{let t=e.DefaultActions?.[0];if(!t)return`—`;if(t.Type===`forward`&&t.TargetGroupArn){let e=A.get(t.TargetGroupArn);return e?`forward → ${e}`:`forward → ${t.TargetGroupArn}`}return t.Type??`—`};return(0,$.jsxs)(`div`,{className:`space-y-3`,children:[l.error&&(0,$.jsx)(W,{error:l.error,msg:`Failed to create listener`}),d.error&&(0,$.jsx)(W,{error:d.error,msg:`Failed to modify listener`}),u.error&&(0,$.jsx)(W,{error:u.error,msg:`Failed to delete listener`}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[T.length,` listener`,T.length===1?``:`s`]}),(0,$.jsx)(g,{onClick:()=>{p(!0)},size:`sm`,children:`Add listener`})]}),T.length===0?(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`No listeners configured.`}):(0,$.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,$.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Protocol`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Port`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`TLS`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Default action`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Listener ARN`}),(0,$.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,$.jsx)(`tbody`,{children:T.map(e=>{let t=e.ListenerArn??``,n=S===t;return(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,$.jsx)(`td`,{className:`px-4 py-2`,children:e.Protocol}),(0,$.jsx)(`td`,{className:`px-4 py-2`,children:e.Port}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:$e(e)}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:N(e)}),(0,$.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:t}),(0,$.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,$.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,$.jsx)(g,{"aria-label":`${n?`Hide`:`Show`} rules for listener ${e.Protocol}:${e.Port}`,onClick:()=>{w(n?void 0:t)},size:`sm`,variant:`ghost`,children:n?`Hide rules`:`Rules`}),(0,$.jsx)(g,{"aria-label":`Edit listener ${e.Protocol}:${e.Port}`,onClick:()=>{y(e)},size:`sm`,variant:`ghost`,children:(0,$.jsx)(m,{className:`size-4`})}),(0,$.jsx)(g,{"aria-label":`Delete listener ${e.Protocol}:${e.Port}`,onClick:()=>{x(e)},size:`sm`,variant:`ghost`,children:(0,$.jsx)(h,{className:`size-4`})})]})})]}),n&&t&&(0,$.jsx)(`tr`,{className:`border-b bg-muted/30 last:border-0`,children:(0,$.jsx)(`td`,{className:`px-4 py-3`,colSpan:6,children:(0,$.jsx)(Fe,{listenerArn:t,targetGroups:D})})})]},t)})})]})}),f&&(0,$.jsx)(tt,{certificates:O,isPending:l.isPending,lbType:n,onOpenChange:p,onSubmit:async t=>{try{await l.mutateAsync({loadBalancerArn:e,protocol:t.protocol,port:t.port,defaultTargetGroupArn:t.defaultTargetGroupArn,certificateArn:t.certificateArn,sslPolicy:t.sslPolicy}),p(!1)}catch{}},open:f,protocols:r,sslPolicies:k,targetGroups:D}),(0,$.jsx)(nt,{certificates:O,isPending:d.isPending,listener:_,onOpenChange:e=>{e||y(void 0)},onSubmit:async t=>{if(_?.ListenerArn)try{await d.mutateAsync({listenerArn:_.ListenerArn,loadBalancerArn:e,protocol:t.protocol,port:t.port,defaultTargetGroupArn:t.defaultTargetGroupArn,certificateArn:t.certificateArn,sslPolicy:t.sslPolicy}),y(void 0)}catch{}},protocols:r,sslPolicies:k,targetGroups:D}),(0,$.jsx)(le,{description:b?`Delete listener ${b.Protocol}:${b.Port}? This cannot be undone.`:``,isPending:u.isPending,onConfirm:async()=>{if(b?.ListenerArn)try{await u.mutateAsync(b.ListenerArn)}finally{x(void 0)}},onOpenChange:e=>{e||x(void 0)},open:b!==void 0,title:`Delete listener`})]})}function tt(e){let t=(0,we.c)(37),{open:n,onOpenChange:r,lbType:i,protocols:a,targetGroups:o,certificates:s,sslPolicies:c,isPending:l,onSubmit:u}=e,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=U(pe),t[0]=d):d=t[0];let f;t[1]===i?f=t[2]:(f=Ze(i),t[1]=i,t[2]=f);let p;t[3]===f?p=t[4]:(p={resolver:d,defaultValues:f},t[3]=f,t[4]=p);let m=H(p),h;t[5]!==m||t[6]!==u?(h=m.handleSubmit(u),t[5]=m,t[6]=u,t[7]=h):h=t[7];let g=h,_;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_={maxWidth:`32rem`,width:`calc(100vw - 2rem)`},t[8]=_):_=t[8];let v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(se,{children:[(0,$.jsx)(re,{children:`Add listener`}),(0,$.jsx)(J,{children:`Listeners forward incoming traffic to a default target group.`})]}),t[9]=v):v=t[9];let y;t[10]===g?y=t[11]:(y=e=>{e.preventDefault(),g()},t[10]=g,t[11]=y);let b;t[12]!==s||t[13]!==m||t[14]!==a||t[15]!==c||t[16]!==o?(b=(0,$.jsx)(Ae,{certificates:s,form:m,protocols:a,sslPolicies:c,targetGroups:o}),t[12]=s,t[13]=m,t[14]=a,t[15]=c,t[16]=o,t[17]=b):b=t[17];let x;t[18]!==y||t[19]!==b?(x=(0,$.jsx)(`form`,{className:`min-w-0 space-y-4`,onSubmit:y,children:b}),t[18]=y,t[19]=b,t[20]=x):x=t[20];let S;t[21]===l?S=t[22]:(S=(0,$.jsx)(oe,{disabled:l,children:`Cancel`}),t[21]=l,t[22]=S);let C=l?`Adding…`:`Add listener`,w;t[23]!==g||t[24]!==l||t[25]!==C?(w=(0,$.jsx)(ie,{disabled:l,onClick:g,children:C}),t[23]=g,t[24]=l,t[25]=C,t[26]=w):w=t[26];let T;t[27]!==S||t[28]!==w?(T=(0,$.jsxs)(ae,{children:[S,w]}),t[27]=S,t[28]=w,t[29]=T):T=t[29];let E;t[30]!==T||t[31]!==x?(E=(0,$.jsxs)(Y,{className:`grid-cols-[minmax(0,1fr)]`,style:_,children:[v,x,T]}),t[30]=T,t[31]=x,t[32]=E):E=t[32];let D;return t[33]!==r||t[34]!==n||t[35]!==E?(D=(0,$.jsx)(ce,{onOpenChange:r,open:n,children:E}),t[33]=r,t[34]=n,t[35]=E,t[36]=D):D=t[36],D}function nt(e){let t=(0,we.c)(39),{listener:n,onOpenChange:r,protocols:i,targetGroups:a,certificates:o,sslPolicies:s,isPending:c,onSubmit:l}=e,u=n!==void 0,d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=U(pe),f={protocol:`HTTP`,port:80,defaultTargetGroupArn:``},t[0]=d,t[1]=f):(d=t[0],f=t[1]);let p;t[2]!==n||t[3]!==i?(p=n?Qe(n,i):void 0,t[2]=n,t[3]=i,t[4]=p):p=t[4];let m;t[5]===p?m=t[6]:(m={resolver:d,defaultValues:f,values:p},t[5]=p,t[6]=m);let h=H(m),g;t[7]!==h||t[8]!==l?(g=h.handleSubmit(l),t[7]=h,t[8]=l,t[9]=g):g=t[9];let _=g,v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={maxWidth:`32rem`,width:`calc(100vw - 2rem)`},t[10]=v):v=t[10];let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsxs)(se,{children:[(0,$.jsx)(re,{children:`Edit listener`}),(0,$.jsx)(J,{children:`Update port, protocol, or default target group. Changes apply without dropping the listener.`})]}),t[11]=y):y=t[11];let b;t[12]===_?b=t[13]:(b=e=>{e.preventDefault(),_()},t[12]=_,t[13]=b);let x;t[14]!==o||t[15]!==h||t[16]!==i||t[17]!==s||t[18]!==a?(x=(0,$.jsx)(Ae,{certificates:o,form:h,protocols:i,sslPolicies:s,targetGroups:a}),t[14]=o,t[15]=h,t[16]=i,t[17]=s,t[18]=a,t[19]=x):x=t[19];let S;t[20]!==b||t[21]!==x?(S=(0,$.jsx)(`form`,{className:`min-w-0 space-y-4`,onSubmit:b,children:x}),t[20]=b,t[21]=x,t[22]=S):S=t[22];let C;t[23]===c?C=t[24]:(C=(0,$.jsx)(oe,{disabled:c,children:`Cancel`}),t[23]=c,t[24]=C);let w=c?`Saving…`:`Save changes`,T;t[25]!==_||t[26]!==c||t[27]!==w?(T=(0,$.jsx)(ie,{disabled:c,onClick:_,children:w}),t[25]=_,t[26]=c,t[27]=w,t[28]=T):T=t[28];let E;t[29]!==C||t[30]!==T?(E=(0,$.jsxs)(ae,{children:[C,T]}),t[29]=C,t[30]=T,t[31]=E):E=t[31];let D;t[32]!==S||t[33]!==E?(D=(0,$.jsxs)(Y,{className:`grid-cols-[minmax(0,1fr)]`,style:v,children:[y,S,E]}),t[32]=S,t[33]=E,t[34]=D):D=t[34];let O;return t[35]!==r||t[36]!==u||t[37]!==D?(O=(0,$.jsx)(ce,{onOpenChange:r,open:u,children:D}),t[35]=r,t[36]=u,t[37]=D,t[38]=O):O=t[38],O}function rt(e,t){if(e.length!==t.length)return!1;let n=new Set(t);return e.every(e=>n.has(e))}function it(e){let t=(0,we.c)(48),{available:n,current:r,onSubmit:i,isPending:a,error:o,isSuccess:s}=e,c;t[0]===r?c=t[1]:(c=[...r],t[0]=r,t[1]=c);let l=c,[u,d]=(0,Q.useState)(l),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},t[2]=f):f=t[2];let p=f,m;t[3]===l?m=t[4]:(m=()=>{d(l)},t[3]=l,t[4]=m);let h=m,_;t[5]!==l||t[6]!==u?(_=rt(u,l),t[5]=l,t[6]=u,t[7]=_):_=t[7];let v=!_,y=u.length===0,b;t[8]===u?b=t[9]:(b=new Set(u),t[8]=u,t[9]=b);let x=b,S;t[10]!==v||t[11]!==y||t[12]!==i||t[13]!==u?(S=e=>{e.preventDefault(),!(!v||y)&&i(u)},t[10]=v,t[11]=y,t[12]=i,t[13]=u,t[14]=S):S=t[14];let C;t[15]===o?C=t[16]:(C=o&&(0,$.jsx)(`div`,{className:`mb-4 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive`,role:`alert`,children:o.message||`Failed to update security groups`}),t[15]=o,t[16]=C);let w;t[17]!==v||t[18]!==s?(w=s&&!v&&(0,$.jsx)(`div`,{className:`mb-4 rounded-md border border-emerald-500 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-400`,role:`status`,children:`Security groups updated.`}),t[17]=v,t[18]=s,t[19]=w):w=t[19];let T;t[20]!==n||t[21]!==x?(T=n.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No security groups in this VPC.`}):n.map(e=>(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,$.jsx)(`input`,{"aria-label":`Security group ${e.GroupId} (${e.GroupName})`,checked:x.has(e.GroupId??``),onChange:()=>{p(e.GroupId??``)},type:`checkbox`}),(0,$.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId)),t[20]=n,t[21]=x,t[22]=T):T=t[22];let E;t[23]===y?E=t[24]:(E=y&&(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:`At least one security group is required.`}),t[23]=y,t[24]=E);let D;t[25]!==E||t[26]!==T?(D=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 p-4`,children:[T,E]}),t[25]=E,t[26]=T,t[27]=D):D=t[27];let O=v?`Unsaved changes`:`No changes`,k;t[28]===O?k=t[29]:(k=(0,$.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:O}),t[28]=O,t[29]=k);let A=a||!v,j;t[30]!==h||t[31]!==A?(j=(0,$.jsx)(g,{disabled:A,onClick:h,size:`sm`,type:`button`,variant:`secondary`,children:`Reset`}),t[30]=h,t[31]=A,t[32]=j):j=t[32];let M=a||!v||y,N=a?`Saving…`:`Save changes`,P;t[33]!==M||t[34]!==N?(P=(0,$.jsx)(g,{disabled:M,size:`sm`,type:`submit`,children:N}),t[33]=M,t[34]=N,t[35]=P):P=t[35];let F;t[36]!==k||t[37]!==j||t[38]!==P?(F=(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t p-4`,children:[k,j,P]}),t[36]=k,t[37]=j,t[38]=P,t[39]=F):F=t[39];let I;t[40]!==D||t[41]!==F?(I=(0,$.jsxs)(`div`,{className:`rounded-lg border bg-card`,children:[D,F]}),t[40]=D,t[41]=F,t[42]=I):I=t[42];let L;return t[43]!==I||t[44]!==S||t[45]!==C||t[46]!==w?(L=(0,$.jsxs)(`form`,{onSubmit:S,children:[C,w,I]}),t[43]=I,t[44]=S,t[45]=C,t[46]=w,t[47]=L):L=t[47],L}function at(e,t){if(e.length!==t.length)return!1;let n=new Set(t);return e.every(e=>n.has(e))}function ot(e){let t=s(e.Tags),n=e.AvailabilityZone?` · ${e.AvailabilityZone}`:``,r=e.CidrBlock?` (${e.CidrBlock})`:``;return`${e.SubnetId}${t?` — ${t}`:``}${r}${n}`}function st(e){let t=(0,we.c)(49),{available:n,current:r,onSubmit:i,isPending:a,error:o,isSuccess:s}=e,c;t[0]===r?c=t[1]:(c=[...r],t[0]=r,t[1]=c);let l=c,[u,d]=(0,Q.useState)(l),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},t[2]=f):f=t[2];let p=f,m;t[3]===l?m=t[4]:(m=()=>{d(l)},t[3]=l,t[4]=m);let h=m,_;t[5]!==l||t[6]!==u?(_=at(u,l),t[5]=l,t[6]=u,t[7]=_):_=t[7];let v=!_,y=u.length===0,b;t[8]===u?b=t[9]:(b=new Set(u),t[8]=u,t[9]=b);let x=b,S;t[10]!==v||t[11]!==y||t[12]!==i||t[13]!==u?(S=e=>{e.preventDefault(),!(!v||y)&&i(u)},t[10]=v,t[11]=y,t[12]=i,t[13]=u,t[14]=S):S=t[14];let C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`div`,{className:`mb-4 rounded-md border border-amber-500 bg-amber-500/10 p-3 text-sm text-amber-700 dark:text-amber-400`,role:`note`,children:`Applying a subnet change re-homes the load balancer by relaunching its underlying system VM. Expect a brief data-plane interruption while it restarts.`}),t[15]=C):C=t[15];let w;t[16]===o?w=t[17]:(w=o&&(0,$.jsx)(`div`,{className:`mb-4 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive`,role:`alert`,children:o.message||`Failed to update subnets`}),t[16]=o,t[17]=w);let T;t[18]!==v||t[19]!==s?(T=s&&!v&&(0,$.jsx)(`div`,{className:`mb-4 rounded-md border border-emerald-500 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-400`,role:`status`,children:`Subnets updated.`}),t[18]=v,t[19]=s,t[20]=T):T=t[20];let E;t[21]!==n||t[22]!==x?(E=n.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No subnets in this VPC.`}):n.map(e=>(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,$.jsx)(`input`,{"aria-label":`Subnet ${e.SubnetId}`,checked:x.has(e.SubnetId??``),onChange:()=>{p(e.SubnetId??``)},type:`checkbox`}),(0,$.jsx)(`span`,{className:`font-mono`,children:ot(e)})]},e.SubnetId)),t[21]=n,t[22]=x,t[23]=E):E=t[23];let D;t[24]===y?D=t[25]:(D=y&&(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:`At least one subnet is required.`}),t[24]=y,t[25]=D);let O;t[26]!==E||t[27]!==D?(O=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 p-4`,children:[E,D]}),t[26]=E,t[27]=D,t[28]=O):O=t[28];let k=v?`Unsaved changes`:`No changes`,A;t[29]===k?A=t[30]:(A=(0,$.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:k}),t[29]=k,t[30]=A);let j=a||!v,M;t[31]!==h||t[32]!==j?(M=(0,$.jsx)(g,{disabled:j,onClick:h,size:`sm`,type:`button`,variant:`secondary`,children:`Reset`}),t[31]=h,t[32]=j,t[33]=M):M=t[33];let N=a||!v||y,P=a?`Saving…`:`Save changes`,F;t[34]!==N||t[35]!==P?(F=(0,$.jsx)(g,{disabled:N,size:`sm`,type:`submit`,children:P}),t[34]=N,t[35]=P,t[36]=F):F=t[36];let I;t[37]!==A||t[38]!==M||t[39]!==F?(I=(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t p-4`,children:[A,M,F]}),t[37]=A,t[38]=M,t[39]=F,t[40]=I):I=t[40];let L;t[41]!==O||t[42]!==I?(L=(0,$.jsxs)(`div`,{className:`rounded-lg border bg-card`,children:[O,I]}),t[41]=O,t[42]=I,t[43]=L):L=t[43];let R;return t[44]!==L||t[45]!==S||t[46]!==w||t[47]!==T?(R=(0,$.jsxs)(`form`,{onSubmit:S,children:[C,w,T,L]}),t[44]=L,t[45]=S,t[46]=w,t[47]=T,t[48]=R):R=t[48],R}function ct({arn:e}){let t=a(),{data:n}=i(N(e)),{data:r}=i(I(e)),{data:l}=i(L([e])),{data:u}=i(b),{data:d}=i(x),f=O(),p=w(),m=S(),_=D(),v=E(),[y,C]=(0,Q.useState)(!1),T=n.LoadBalancers?.[0];if(!T?.LoadBalancerArn)return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{to:`/ec2/describe-load-balancers`,children:`Back to load balancers`}),(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`Load balancer not found.`})]});let k=async()=>{try{await f.mutateAsync(e),t({to:`/ec2/describe-load-balancers`})}finally{C(!1)}},A=u.Subnets??[],j=e=>{let t=A.find(t=>t.SubnetId===e);if(!t)return e;let n=s(t.Tags),r=t.CidrBlock?` (${t.CidrBlock})`:``;return n?`${e} — ${n}${r}`:`${e}${r}`},M=r.Attributes??[],P=l?.TagDescriptions?.find(t=>t.ResourceArn===e)?.Tags??[],F=(T.SecurityGroups??[]).filter(e=>e!==void 0),R=(d.SecurityGroups??[]).filter(e=>e.VpcId===T.VpcId),z=A.filter(e=>e.VpcId===T.VpcId),B=(T.AvailabilityZones??[]).map(e=>e.SubnetId).filter(e=>e!==void 0),V=T.Type===`network`;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{to:`/ec2/describe-load-balancers`,children:`Back to load balancers`}),f.error&&(0,$.jsx)(W,{error:f.error,msg:`Failed to delete load balancer`}),(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsx)(G,{actions:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(g,{onClick:()=>{C(!0)},size:`sm`,variant:`destructive`,children:[(0,$.jsx)(h,{className:`size-4`}),`Delete`]}),(0,$.jsx)(ue,{state:T.State?.Code})]}),subtitle:`Load Balancer Details`,title:T.LoadBalancerName??T.LoadBalancerArn}),(0,$.jsxs)(Ce,{defaultValue:`overview`,children:[(0,$.jsxs)(xe,{children:[(0,$.jsx)(be,{value:`overview`,children:`Overview`}),(0,$.jsx)(be,{value:`listeners`,children:`Listeners`}),(0,$.jsx)(be,{value:`subnets`,children:`Subnets`}),!V&&(0,$.jsx)(be,{value:`security-groups`,children:`Security groups`}),(0,$.jsx)(be,{value:`attributes`,children:`Attributes`}),(0,$.jsx)(be,{value:`tags`,children:`Tags`})]}),(0,$.jsxs)(Se,{value:`overview`,children:[(0,$.jsxs)(X,{children:[(0,$.jsx)(X.Header,{children:`Load balancer`}),(0,$.jsxs)(X.Content,{children:[(0,$.jsx)(Z,{label:`ARN`,value:T.LoadBalancerArn}),(0,$.jsx)(Z,{label:`DNS name`,value:T.DNSName}),(0,$.jsx)(Z,{label:`State`,value:T.State?.Reason?`${T.State.Code} — ${T.State.Reason}`:T.State?.Code}),(0,$.jsx)(Z,{label:`Type`,value:T.Type}),(0,$.jsx)(Z,{label:`Scheme`,value:T.Scheme}),(0,$.jsx)(Z,{label:`IP address type`,value:T.IpAddressType}),(0,$.jsx)(Z,{label:`VPC`,value:T.VpcId}),(0,$.jsx)(Z,{label:`Created at`,value:o(T.CreatedTime)})]})]}),(0,$.jsxs)(X,{children:[(0,$.jsx)(X.Header,{children:`Availability zones`}),(0,$.jsx)(X.Content,{children:(T.AvailabilityZones??[]).map(e=>(0,$.jsx)(Z,{label:e.ZoneName??`—`,value:e.SubnetId?j(e.SubnetId):void 0},`${e.ZoneName}-${e.SubnetId}`))})]}),(T.SecurityGroups??[]).length>0&&(0,$.jsxs)(X,{children:[(0,$.jsx)(X.Header,{children:`Security groups`}),(0,$.jsx)(X.Content,{children:(T.SecurityGroups??[]).map(e=>(0,$.jsx)(Z,{label:`Security group`,value:e},e))})]})]}),(0,$.jsx)(Se,{value:`listeners`,children:(0,$.jsx)(et,{lbType:V?`network`:`application`,loadBalancerArn:e,vpcId:T.VpcId})}),(0,$.jsx)(Se,{value:`subnets`,children:(0,$.jsx)(st,{available:z,current:B,error:v.error,isPending:v.isPending,isSuccess:v.isSuccess,onSubmit:t=>{v.mutate({loadBalancerArn:e,subnetIds:t})}})}),!V&&(0,$.jsx)(Se,{value:`security-groups`,children:(0,$.jsx)(it,{available:R,current:F,error:_.error,isPending:_.isPending,isSuccess:_.isSuccess,onSubmit:t=>{_.mutate({loadBalancerArn:e,securityGroupIds:t})}})}),(0,$.jsx)(Se,{value:`attributes`,children:(0,$.jsx)(ve,{attributes:M,error:p.error,isPending:p.isPending,isSuccess:p.isSuccess,onSubmit:t=>{p.mutate({loadBalancerArn:e,attributes:t})},specs:_e})}),(0,$.jsx)(Se,{value:`tags`,children:(0,$.jsx)(ye,{error:m.error,isPending:m.isPending,isSuccess:m.isSuccess,onSubmit:t=>{m.mutate({resourceArn:e,tags:t,initialKeys:P.map(e=>e.Key??``).filter(e=>e.length>0)})},tags:P})})]})]}),(0,$.jsx)(le,{description:`Are you sure you want to delete load balancer "${T.LoadBalancerName??T.LoadBalancerArn}"? This action cannot be undone.`,isPending:f.isPending,onConfirm:k,onOpenChange:C,open:y,title:`Delete load balancer`})]})}function lt(){let e=(0,we.c)(2),{id:t}=B.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,$.jsx)(ct,{arn:n}),e[0]=n,e[1]=r),r}export{lt as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id29.js b/spinifex/services/spinifexui/frontend/dist/assets/_id29.js index 436aceb72..3efaa2644 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id29.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id29.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{g as u}from"./ec2.js";import{j as d}from"./ec22.js";import{t as f}from"./_id10.js";import{t as p}from"./error-banner.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=e(n()),b=t();function x(){let{id:e}=f.useParams(),t=a(),{data:n}=r(u(e)),x=d(),[S,C]=(0,y.useState)(!1),w=n.NatGateways?.[0],T=async()=>{try{await x.mutateAsync(e),t({to:`/ec2/describe-nat-gateways`})}finally{C(!1)}};if(!w?.NatGatewayId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`NAT Gateway not found.`})]});let E=o(w.Tags),D=w.NatGatewayAddresses?.[0];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),x.error&&(0,b.jsx)(p,{error:x.error,msg:`Failed to delete NAT Gateway`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(l,{disabled:x.isPending,onClick:()=>C(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(c,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:w.State})]}),subtitle:`NAT Gateway Details`,title:E?`${w.NatGatewayId} (${E})`:w.NatGatewayId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`NAT Gateway Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`NAT Gateway ID`,value:w.NatGatewayId}),(0,b.jsx)(_,{label:`State`,value:w.State}),(0,b.jsx)(_,{label:`Connectivity`,value:w.ConnectivityType}),(0,b.jsx)(_,{label:`Subnet ID`,value:w.SubnetId?(0,b.jsx)(i,{className:`text-primary hover:underline`,params:{id:w.SubnetId},to:`/ec2/describe-subnets/$id`,children:w.SubnetId}):`—`}),(0,b.jsx)(_,{label:`VPC ID`,value:w.VpcId?(0,b.jsx)(i,{className:`text-primary hover:underline`,params:{id:w.VpcId},to:`/ec2/describe-vpcs/$id`,children:w.VpcId}):`—`}),(0,b.jsx)(_,{label:`Public IP`,value:D?.PublicIp??`—`}),(0,b.jsx)(_,{label:`Allocation ID`,value:D?.AllocationId?(0,b.jsx)(i,{className:`text-primary hover:underline`,params:{id:D.AllocationId},to:`/ec2/describe-addresses/$id`,children:D.AllocationId}):`—`})]})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the NAT Gateway "${w.NatGatewayId}"? This action cannot be undone. The associated Elastic IP is not released.`,isPending:x.isPending,onConfirm:T,onOpenChange:C,open:S,title:`Delete NAT Gateway`})]})}export{x as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{g as u}from"./ec2.js";import{j as d}from"./ec22.js";import{t as f}from"./_id10.js";import{t as p}from"./error-banner.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=e(n()),b=t();function x(){let{id:e}=f.useParams(),t=a(),{data:n}=r(u(e)),x=d(),[S,C]=(0,y.useState)(!1),w=n.NatGateways?.[0],T=async()=>{try{await x.mutateAsync(e),t({to:`/ec2/describe-nat-gateways`})}finally{C(!1)}};if(!w?.NatGatewayId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`NAT Gateway not found.`})]});let E=o(w.Tags),D=w.NatGatewayAddresses?.[0];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),x.error&&(0,b.jsx)(p,{error:x.error,msg:`Failed to delete NAT Gateway`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(l,{disabled:x.isPending,onClick:()=>{C(!0)},size:`sm`,variant:`destructive`,children:[(0,b.jsx)(c,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:w.State})]}),subtitle:`NAT Gateway Details`,title:E?`${w.NatGatewayId} (${E})`:w.NatGatewayId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`NAT Gateway Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`NAT Gateway ID`,value:w.NatGatewayId}),(0,b.jsx)(_,{label:`State`,value:w.State}),(0,b.jsx)(_,{label:`Connectivity`,value:w.ConnectivityType}),(0,b.jsx)(_,{label:`Subnet ID`,value:w.SubnetId?(0,b.jsx)(i,{className:`text-primary hover:underline`,params:{id:w.SubnetId},to:`/ec2/describe-subnets/$id`,children:w.SubnetId}):`—`}),(0,b.jsx)(_,{label:`VPC ID`,value:w.VpcId?(0,b.jsx)(i,{className:`text-primary hover:underline`,params:{id:w.VpcId},to:`/ec2/describe-vpcs/$id`,children:w.VpcId}):`—`}),(0,b.jsx)(_,{label:`Public IP`,value:D?.PublicIp??`—`}),(0,b.jsx)(_,{label:`Allocation ID`,value:D?.AllocationId?(0,b.jsx)(i,{className:`text-primary hover:underline`,params:{id:D.AllocationId},to:`/ec2/describe-addresses/$id`,children:D.AllocationId}):`—`})]})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the NAT Gateway "${w.NatGatewayId}"? This action cannot be undone. The associated Elastic IP is not released.`,isPending:x.isPending,onConfirm:T,onOpenChange:C,open:S,title:`Delete NAT Gateway`})]})}export{x as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id30.js b/spinifex/services/spinifexui/frontend/dist/assets/_id30.js index 329a86d26..94a5c3500 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id30.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id30.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{l,v as u}from"./ec2.js";import{M as d}from"./ec22.js";import{t as f}from"./_id11.js";import{t as p}from"./error-banner.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=e(n()),b=t();function x(){let{id:e}=f.useParams(),t=a(),{data:n}=r(u(e)),{data:x}=r(l),S=d(),[C,w]=(0,y.useState)(!1),T=n.PlacementGroups?.[0],E=x.Reservations?.flatMap(e=>e.Instances??[]).filter(e=>e.Placement?.GroupName===T?.GroupName)??[];return T?.GroupId?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),S.error&&(0,b.jsx)(p,{error:S.error,msg:`Failed to delete placement group`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(c,{onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(s,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:T.State})]}),subtitle:`Placement Group Details`,title:T.GroupName??T.GroupId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Placement Group Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Group ID`,value:T.GroupId}),(0,b.jsx)(_,{label:`Group Name`,value:T.GroupName}),(0,b.jsx)(_,{label:`Strategy`,value:T.Strategy}),(0,b.jsx)(_,{label:`State`,value:T.State}),(0,b.jsx)(_,{label:`Spread Level`,value:T.SpreadLevel})]})]}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Instances`}),E.length>0?E.map(e=>(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Instance ID`,value:e.InstanceId?(0,b.jsx)(i,{className:`text-primary hover:underline`,params:{id:e.InstanceId},to:`/ec2/describe-instances/$id`,children:e.InstanceId}):void 0}),(0,b.jsx)(_,{label:`State`,value:e.State?.Name}),(0,b.jsx)(_,{label:`Instance Type`,value:e.InstanceType}),(0,b.jsx)(_,{label:`Availability Zone`,value:e.Placement?.AvailabilityZone})]},e.InstanceId)):(0,b.jsx)(g.Content,{children:(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`No instances in this placement group.`})})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the placement group "${T.GroupName}"? The group must have no running instances.`,isPending:S.isPending,onConfirm:async()=>{if(T?.GroupName)try{await S.mutateAsync(T.GroupName),t({to:`/ec2/describe-placement-groups`})}finally{w(!1)}},onOpenChange:w,open:C,title:`Delete Placement Group`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Placement group not found.`})]})}export{x as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{l,v as u}from"./ec2.js";import{M as d}from"./ec22.js";import{t as f}from"./_id11.js";import{t as p}from"./error-banner.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=e(n()),b=t();function x(){let{id:e}=f.useParams(),t=a(),{data:n}=r(u(e)),{data:x}=r(l),S=d(),[C,w]=(0,y.useState)(!1),T=n.PlacementGroups?.[0],E=x.Reservations?.flatMap(e=>e.Instances??[]).filter(e=>e.Placement?.GroupName===T?.GroupName)??[];return T?.GroupId?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),S.error&&(0,b.jsx)(p,{error:S.error,msg:`Failed to delete placement group`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(c,{onClick:()=>{w(!0)},size:`sm`,variant:`destructive`,children:[(0,b.jsx)(s,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:T.State})]}),subtitle:`Placement Group Details`,title:T.GroupName??T.GroupId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Placement Group Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Group ID`,value:T.GroupId}),(0,b.jsx)(_,{label:`Group Name`,value:T.GroupName}),(0,b.jsx)(_,{label:`Strategy`,value:T.Strategy}),(0,b.jsx)(_,{label:`State`,value:T.State}),(0,b.jsx)(_,{label:`Spread Level`,value:T.SpreadLevel})]})]}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Instances`}),E.length>0?E.map(e=>(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Instance ID`,value:e.InstanceId?(0,b.jsx)(i,{className:`text-primary hover:underline`,params:{id:e.InstanceId},to:`/ec2/describe-instances/$id`,children:e.InstanceId}):void 0}),(0,b.jsx)(_,{label:`State`,value:e.State?.Name}),(0,b.jsx)(_,{label:`Instance Type`,value:e.InstanceType}),(0,b.jsx)(_,{label:`Availability Zone`,value:e.Placement?.AvailabilityZone})]},e.InstanceId)):(0,b.jsx)(g.Content,{children:(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`No instances in this placement group.`})})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the placement group "${T.GroupName}"? The group must have no running instances.`,isPending:S.isPending,onConfirm:async()=>{if(T?.GroupName)try{await S.mutateAsync(T.GroupName),t({to:`/ec2/describe-placement-groups`})}finally{w(!1)}},onOpenChange:w,open:C,title:`Delete Placement Group`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Placement group not found.`})]})}export{x as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id31.js b/spinifex/services/spinifexui/frontend/dist/assets/_id31.js index 8b1dc4b67..3a2cfd9b5 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id31.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id31.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{c,i as l,n as u,s as d,t as f}from"./select.js";import{t as p}from"./trash-2.js";import{t as m}from"./button.js";import{t as h}from"./input.js";import{O as g,_ as ee,d as te,x as _}from"./ec2.js";import{G as v,N as y,P as b,a as x,y as S}from"./ec22.js";import{t as C}from"./_id12.js";import{a as ne,i as w,n as T,t as E}from"./zod.js";import{t as D}from"./error-banner.js";import{t as re}from"./page-heading.js";import{a as O,r as k,t as A}from"./field.js";import{d as ie,r as ae}from"./ec23.js";import{t as oe}from"./delete-confirmation-dialog.js";import{n as j,t as M}from"./detail-row.js";import{t as se}from"./badge.js";var N=e(n()),P=t();function F(e){return e.GatewayId??e.NatGatewayId??e.NetworkInterfaceId??e.InstanceId??e.VpcPeeringConnectionId??`—`}function I(){let{id:e}=C.useParams(),t=a(),{data:n}=r(_(e)),{data:I}=r(te),{data:L}=r(ee),{data:R}=r(g),z=b(),B=S(),V=y(),H=x(),U=v(),[W,G]=(0,N.useState)(!1),K=n.RouteTables?.[0],q=w({resolver:E(ie),defaultValues:{destinationCidrBlock:`0.0.0.0/0`,targetType:`igw`,targetId:``}}),ce=ne({control:q.control,name:`targetType`}),J=w({resolver:E(ae),defaultValues:{subnetId:``}});if(!K?.RouteTableId)return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s,{to:`/ec2/describe-route-tables`,children:`Back to Route Tables`}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:`Route Table not found.`})]});let Y=K.RouteTableId,X=o(K.Tags),Z=K.Associations?.some(e=>e.Main)??!1,Q=K.Routes??[],$=(K.Associations??[]).filter(e=>e.SubnetId),le=(I.InternetGateways??[]).filter(e=>e.Attachments?.some(e=>e.VpcId===K.VpcId)),ue=(L.NatGateways??[]).filter(e=>e.VpcId===K.VpcId&&e.State===`available`),de=new Set($.map(e=>e.SubnetId)),fe=(R.Subnets??[]).filter(e=>e.VpcId===K.VpcId&&!de.has(e.SubnetId)),pe=async()=>{try{await z.mutateAsync(Y),t({to:`/ec2/describe-route-tables`})}finally{G(!1)}},me=async e=>{await B.mutateAsync({routeTableId:Y,destinationCidrBlock:e.destinationCidrBlock,gatewayId:e.targetType===`igw`?e.targetId:void 0,natGatewayId:e.targetType===`nat`?e.targetId:void 0}),q.reset({destinationCidrBlock:`0.0.0.0/0`,targetType:`igw`,targetId:``})},he=async e=>{await H.mutateAsync({routeTableId:Y,subnetId:e.subnetId}),J.reset({subnetId:``})};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s,{to:`/ec2/describe-route-tables`,children:`Back to Route Tables`}),z.error&&(0,P.jsx)(D,{error:z.error,msg:`Failed to delete Route Table`}),(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsx)(re,{actions:(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(m,{disabled:Z||z.isPending,onClick:()=>G(!0),size:`sm`,variant:`destructive`,children:[(0,P.jsx)(p,{className:`size-4`}),`Delete`]}),Z&&(0,P.jsx)(se,{variant:`secondary`,children:`Main`})]}),subtitle:`Route Table Details`,title:X?`${K.RouteTableId} (${X})`:K.RouteTableId}),(0,P.jsxs)(j,{children:[(0,P.jsx)(j.Header,{children:`Route Table Information`}),(0,P.jsxs)(j.Content,{children:[(0,P.jsx)(M,{label:`Route Table ID`,value:K.RouteTableId}),(0,P.jsx)(M,{label:`Main`,value:Z?`Yes`:`No`}),(0,P.jsx)(M,{label:`VPC ID`,value:K.VpcId?(0,P.jsx)(i,{className:`text-primary hover:underline`,params:{id:K.VpcId},to:`/ec2/describe-vpcs/$id`,children:K.VpcId}):`—`}),(0,P.jsx)(M,{label:`Owner ID`,value:K.OwnerId??`—`})]})]}),(0,P.jsxs)(j,{children:[(0,P.jsx)(j.Header,{children:`Routes`}),(0,P.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,P.jsx)(`div`,{className:`overflow-x-auto rounded-md border`,children:(0,P.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,P.jsx)(`thead`,{className:`bg-muted/50 text-left text-muted-foreground`,children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{className:`p-2 font-medium`,children:`Destination`}),(0,P.jsx)(`th`,{className:`p-2 font-medium`,children:`Target`}),(0,P.jsx)(`th`,{className:`p-2 font-medium`,children:`Status`}),(0,P.jsx)(`th`,{className:`p-2`,children:(0,P.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,P.jsx)(`tbody`,{children:Q.length>0?Q.map(e=>{let t=e.DestinationCidrBlock??e.DestinationPrefixListId??`—`,n=e.GatewayId===`local`,r=e.DestinationCidrBlock;return(0,P.jsxs)(`tr`,{className:`border-t`,children:[(0,P.jsx)(`td`,{className:`p-2 font-mono`,children:t}),(0,P.jsx)(`td`,{className:`p-2 font-mono`,children:F(e)}),(0,P.jsx)(`td`,{className:`p-2`,children:e.State??`—`}),(0,P.jsx)(`td`,{className:`p-2 text-right`,children:!n&&r&&(0,P.jsx)(m,{disabled:V.isPending,onClick:async()=>await V.mutateAsync({routeTableId:Y,destinationCidrBlock:r}),size:`sm`,variant:`ghost`,children:(0,P.jsx)(p,{className:`size-4`})})})]},t)}):(0,P.jsx)(`tr`,{children:(0,P.jsx)(`td`,{className:`p-2 text-muted-foreground`,colSpan:4,children:`No routes.`})})})]})}),(B.error??V.error)&&(0,P.jsx)(D,{error:B.error??V.error??void 0,msg:`Failed to update route`}),(0,P.jsxs)(`form`,{className:`grid items-end gap-3 sm:grid-cols-[1fr_1fr_1fr_auto]`,onSubmit:q.handleSubmit(me),children:[(0,P.jsxs)(A,{children:[(0,P.jsx)(O,{children:(0,P.jsx)(`label`,{htmlFor:`destinationCidrBlock`,children:`Destination`})}),(0,P.jsx)(h,{id:`destinationCidrBlock`,placeholder:`0.0.0.0/0`,...q.register(`destinationCidrBlock`)}),(0,P.jsx)(k,{errors:[q.formState.errors.destinationCidrBlock]})]}),(0,P.jsxs)(A,{children:[(0,P.jsx)(O,{children:(0,P.jsx)(`label`,{htmlFor:`targetType`,children:`Target type`})}),(0,P.jsx)(T,{control:q.control,name:`targetType`,render:({field:e})=>(0,P.jsxs)(f,{onValueChange:t=>{e.onChange(t),q.setValue(`targetId`,``)},value:e.value,children:[(0,P.jsx)(d,{className:`w-full`,id:`targetType`,children:(0,P.jsx)(c,{})}),(0,P.jsxs)(u,{children:[(0,P.jsx)(l,{value:`igw`,children:`Internet Gateway`}),(0,P.jsx)(l,{value:`nat`,children:`NAT Gateway`})]})]})})]}),(0,P.jsxs)(A,{children:[(0,P.jsx)(O,{children:(0,P.jsx)(`label`,{htmlFor:`targetId`,children:`Target`})}),(0,P.jsx)(T,{control:q.control,name:`targetId`,render:({field:e})=>(0,P.jsxs)(f,{onValueChange:t=>e.onChange(t),value:e.value??``,children:[(0,P.jsx)(d,{"aria-invalid":!!q.formState.errors.targetId,className:`w-full`,id:`targetId`,children:(0,P.jsx)(c,{placeholder:`Select target`})}),(0,P.jsx)(u,{children:ce===`igw`?le.map(e=>(0,P.jsx)(l,{value:e.InternetGatewayId??``,children:e.InternetGatewayId},e.InternetGatewayId)):ue.map(e=>(0,P.jsx)(l,{value:e.NatGatewayId??``,children:e.NatGatewayId},e.NatGatewayId))})]})}),(0,P.jsx)(k,{errors:[q.formState.errors.targetId]})]}),(0,P.jsx)(m,{disabled:B.isPending,size:`sm`,type:`submit`,children:`Add route`})]})]})]}),(0,P.jsxs)(j,{children:[(0,P.jsx)(j.Header,{children:`Subnet Associations`}),(0,P.jsxs)(`div`,{className:`space-y-4 p-4`,children:[$.length>0?(0,P.jsx)(`ul`,{className:`space-y-2`,children:$.map(e=>{let t=e.RouteTableAssociationId;return(0,P.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border p-2 text-sm`,children:[(0,P.jsx)(i,{className:`font-mono text-primary hover:underline`,params:{id:e.SubnetId??``},to:`/ec2/describe-subnets/$id`,children:e.SubnetId}),(0,P.jsx)(m,{disabled:!t||U.isPending,onClick:async()=>{t&&await U.mutateAsync(t)},size:`sm`,variant:`ghost`,children:(0,P.jsx)(p,{className:`size-4`})})]},t)})}):(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No subnet associations.`}),(H.error??U.error)&&(0,P.jsx)(D,{error:H.error??U.error??void 0,msg:`Failed to update association`}),(0,P.jsxs)(`form`,{className:`grid items-end gap-3 sm:grid-cols-[1fr_auto]`,onSubmit:J.handleSubmit(he),children:[(0,P.jsxs)(A,{children:[(0,P.jsx)(O,{children:(0,P.jsx)(`label`,{htmlFor:`subnetId`,children:`Associate subnet`})}),(0,P.jsx)(T,{control:J.control,name:`subnetId`,render:({field:e})=>(0,P.jsxs)(f,{onValueChange:t=>e.onChange(t),value:e.value??``,children:[(0,P.jsx)(d,{"aria-invalid":!!J.formState.errors.subnetId,className:`w-full`,id:`subnetId`,children:(0,P.jsx)(c,{placeholder:`Select a subnet`})}),(0,P.jsx)(u,{children:fe.map(e=>{let t=o(e.Tags);return(0,P.jsx)(l,{value:e.SubnetId??``,children:t?`${e.SubnetId} (${t})`:`${e.SubnetId} (${e.CidrBlock})`},e.SubnetId)})})]})}),(0,P.jsx)(k,{errors:[J.formState.errors.subnetId]})]}),(0,P.jsx)(m,{disabled:H.isPending,size:`sm`,type:`submit`,children:`Associate`})]})]})]})]}),(0,P.jsx)(oe,{description:`Are you sure you want to delete the Route Table "${K.RouteTableId}"? This action cannot be undone.`,isPending:z.isPending,onConfirm:pe,onOpenChange:G,open:W,title:`Delete Route Table`})]})}export{I as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{c,i as l,n as u,s as d,t as f}from"./select.js";import{t as p}from"./trash-2.js";import{t as m}from"./button.js";import{t as h}from"./input.js";import{O as g,_ as ee,d as te,x as _}from"./ec2.js";import{G as v,N as y,P as b,a as x,y as S}from"./ec22.js";import{t as C}from"./_id12.js";import{a as ne,i as w,n as T,t as E}from"./zod.js";import{t as D}from"./error-banner.js";import{t as re}from"./page-heading.js";import{a as O,r as k,t as A}from"./field.js";import{d as ie,r as ae}from"./ec23.js";import{t as oe}from"./delete-confirmation-dialog.js";import{n as j,t as M}from"./detail-row.js";import{t as se}from"./badge.js";var N=e(n()),P=t();function F(e){return e.GatewayId??e.NatGatewayId??e.NetworkInterfaceId??e.InstanceId??e.VpcPeeringConnectionId??`—`}function I(){let{id:e}=C.useParams(),t=a(),{data:n}=r(_(e)),{data:I}=r(te),{data:L}=r(ee),{data:R}=r(g),z=b(),B=S(),V=y(),H=x(),U=v(),[W,G]=(0,N.useState)(!1),K=n.RouteTables?.[0],q=w({resolver:E(ie),defaultValues:{destinationCidrBlock:`0.0.0.0/0`,targetType:`igw`,targetId:``}}),ce=ne({control:q.control,name:`targetType`}),J=w({resolver:E(ae),defaultValues:{subnetId:``}});if(!K?.RouteTableId)return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s,{to:`/ec2/describe-route-tables`,children:`Back to Route Tables`}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:`Route Table not found.`})]});let Y=K.RouteTableId,X=o(K.Tags),Z=K.Associations?.some(e=>e.Main)??!1,Q=K.Routes??[],$=(K.Associations??[]).filter(e=>e.SubnetId),le=(I.InternetGateways??[]).filter(e=>e.Attachments?.some(e=>e.VpcId===K.VpcId)),ue=(L.NatGateways??[]).filter(e=>e.VpcId===K.VpcId&&e.State===`available`),de=new Set($.map(e=>e.SubnetId)),fe=(R.Subnets??[]).filter(e=>e.VpcId===K.VpcId&&!de.has(e.SubnetId)),pe=async()=>{try{await z.mutateAsync(Y),t({to:`/ec2/describe-route-tables`})}finally{G(!1)}},me=async e=>{await B.mutateAsync({routeTableId:Y,destinationCidrBlock:e.destinationCidrBlock,gatewayId:e.targetType===`igw`?e.targetId:void 0,natGatewayId:e.targetType===`nat`?e.targetId:void 0}),q.reset({destinationCidrBlock:`0.0.0.0/0`,targetType:`igw`,targetId:``})},he=async e=>{await H.mutateAsync({routeTableId:Y,subnetId:e.subnetId}),J.reset({subnetId:``})};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s,{to:`/ec2/describe-route-tables`,children:`Back to Route Tables`}),z.error&&(0,P.jsx)(D,{error:z.error,msg:`Failed to delete Route Table`}),(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsx)(re,{actions:(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(m,{disabled:Z||z.isPending,onClick:()=>{G(!0)},size:`sm`,variant:`destructive`,children:[(0,P.jsx)(p,{className:`size-4`}),`Delete`]}),Z&&(0,P.jsx)(se,{variant:`secondary`,children:`Main`})]}),subtitle:`Route Table Details`,title:X?`${K.RouteTableId} (${X})`:K.RouteTableId}),(0,P.jsxs)(j,{children:[(0,P.jsx)(j.Header,{children:`Route Table Information`}),(0,P.jsxs)(j.Content,{children:[(0,P.jsx)(M,{label:`Route Table ID`,value:K.RouteTableId}),(0,P.jsx)(M,{label:`Main`,value:Z?`Yes`:`No`}),(0,P.jsx)(M,{label:`VPC ID`,value:K.VpcId?(0,P.jsx)(i,{className:`text-primary hover:underline`,params:{id:K.VpcId},to:`/ec2/describe-vpcs/$id`,children:K.VpcId}):`—`}),(0,P.jsx)(M,{label:`Owner ID`,value:K.OwnerId??`—`})]})]}),(0,P.jsxs)(j,{children:[(0,P.jsx)(j.Header,{children:`Routes`}),(0,P.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,P.jsx)(`div`,{className:`overflow-x-auto rounded-md border`,children:(0,P.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,P.jsx)(`thead`,{className:`bg-muted/50 text-left text-muted-foreground`,children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{className:`p-2 font-medium`,children:`Destination`}),(0,P.jsx)(`th`,{className:`p-2 font-medium`,children:`Target`}),(0,P.jsx)(`th`,{className:`p-2 font-medium`,children:`Status`}),(0,P.jsx)(`th`,{className:`p-2`,children:(0,P.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,P.jsx)(`tbody`,{children:Q.length>0?Q.map(e=>{let t=e.DestinationCidrBlock??e.DestinationPrefixListId??`—`,n=e.GatewayId===`local`,r=e.DestinationCidrBlock;return(0,P.jsxs)(`tr`,{className:`border-t`,children:[(0,P.jsx)(`td`,{className:`p-2 font-mono`,children:t}),(0,P.jsx)(`td`,{className:`p-2 font-mono`,children:F(e)}),(0,P.jsx)(`td`,{className:`p-2`,children:e.State??`—`}),(0,P.jsx)(`td`,{className:`p-2 text-right`,children:!n&&r&&(0,P.jsx)(m,{disabled:V.isPending,onClick:async()=>await V.mutateAsync({routeTableId:Y,destinationCidrBlock:r}),size:`sm`,variant:`ghost`,children:(0,P.jsx)(p,{className:`size-4`})})})]},t)}):(0,P.jsx)(`tr`,{children:(0,P.jsx)(`td`,{className:`p-2 text-muted-foreground`,colSpan:4,children:`No routes.`})})})]})}),(B.error??V.error)&&(0,P.jsx)(D,{error:B.error??V.error??void 0,msg:`Failed to update route`}),(0,P.jsxs)(`form`,{className:`grid items-end gap-3 sm:grid-cols-[1fr_1fr_1fr_auto]`,onSubmit:q.handleSubmit(me),children:[(0,P.jsxs)(A,{children:[(0,P.jsx)(O,{children:(0,P.jsx)(`label`,{htmlFor:`destinationCidrBlock`,children:`Destination`})}),(0,P.jsx)(h,{id:`destinationCidrBlock`,placeholder:`0.0.0.0/0`,...q.register(`destinationCidrBlock`)}),(0,P.jsx)(k,{errors:[q.formState.errors.destinationCidrBlock]})]}),(0,P.jsxs)(A,{children:[(0,P.jsx)(O,{children:(0,P.jsx)(`label`,{htmlFor:`targetType`,children:`Target type`})}),(0,P.jsx)(T,{control:q.control,name:`targetType`,render:({field:e})=>(0,P.jsxs)(f,{onValueChange:t=>{e.onChange(t),q.setValue(`targetId`,``)},value:e.value,children:[(0,P.jsx)(d,{className:`w-full`,id:`targetType`,children:(0,P.jsx)(c,{})}),(0,P.jsxs)(u,{children:[(0,P.jsx)(l,{value:`igw`,children:`Internet Gateway`}),(0,P.jsx)(l,{value:`nat`,children:`NAT Gateway`})]})]})})]}),(0,P.jsxs)(A,{children:[(0,P.jsx)(O,{children:(0,P.jsx)(`label`,{htmlFor:`targetId`,children:`Target`})}),(0,P.jsx)(T,{control:q.control,name:`targetId`,render:({field:e})=>(0,P.jsxs)(f,{onValueChange:t=>{e.onChange(t)},value:e.value??``,children:[(0,P.jsx)(d,{"aria-invalid":!!q.formState.errors.targetId,className:`w-full`,id:`targetId`,children:(0,P.jsx)(c,{placeholder:`Select target`})}),(0,P.jsx)(u,{children:ce===`igw`?le.map(e=>(0,P.jsx)(l,{value:e.InternetGatewayId??``,children:e.InternetGatewayId},e.InternetGatewayId)):ue.map(e=>(0,P.jsx)(l,{value:e.NatGatewayId??``,children:e.NatGatewayId},e.NatGatewayId))})]})}),(0,P.jsx)(k,{errors:[q.formState.errors.targetId]})]}),(0,P.jsx)(m,{disabled:B.isPending,size:`sm`,type:`submit`,children:`Add route`})]})]})]}),(0,P.jsxs)(j,{children:[(0,P.jsx)(j.Header,{children:`Subnet Associations`}),(0,P.jsxs)(`div`,{className:`space-y-4 p-4`,children:[$.length>0?(0,P.jsx)(`ul`,{className:`space-y-2`,children:$.map(e=>{let t=e.RouteTableAssociationId;return(0,P.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border p-2 text-sm`,children:[(0,P.jsx)(i,{className:`font-mono text-primary hover:underline`,params:{id:e.SubnetId??``},to:`/ec2/describe-subnets/$id`,children:e.SubnetId}),(0,P.jsx)(m,{disabled:!t||U.isPending,onClick:async()=>{t&&await U.mutateAsync(t)},size:`sm`,variant:`ghost`,children:(0,P.jsx)(p,{className:`size-4`})})]},t)})}):(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No subnet associations.`}),(H.error??U.error)&&(0,P.jsx)(D,{error:H.error??U.error??void 0,msg:`Failed to update association`}),(0,P.jsxs)(`form`,{className:`grid items-end gap-3 sm:grid-cols-[1fr_auto]`,onSubmit:J.handleSubmit(he),children:[(0,P.jsxs)(A,{children:[(0,P.jsx)(O,{children:(0,P.jsx)(`label`,{htmlFor:`subnetId`,children:`Associate subnet`})}),(0,P.jsx)(T,{control:J.control,name:`subnetId`,render:({field:e})=>(0,P.jsxs)(f,{onValueChange:t=>{e.onChange(t)},value:e.value??``,children:[(0,P.jsx)(d,{"aria-invalid":!!J.formState.errors.subnetId,className:`w-full`,id:`subnetId`,children:(0,P.jsx)(c,{placeholder:`Select a subnet`})}),(0,P.jsx)(u,{children:fe.map(e=>{let t=o(e.Tags);return(0,P.jsx)(l,{value:e.SubnetId??``,children:t?`${e.SubnetId} (${t})`:`${e.SubnetId} (${e.CidrBlock})`},e.SubnetId)})})]})}),(0,P.jsx)(k,{errors:[J.formState.errors.subnetId]})]}),(0,P.jsx)(m,{disabled:H.isPending,size:`sm`,type:`submit`,children:`Associate`})]})]})]})]}),(0,P.jsx)(oe,{description:`Are you sure you want to delete the Route Table "${K.RouteTableId}"? This action cannot be undone.`,isPending:z.isPending,onConfirm:pe,onOpenChange:G,open:W,title:`Delete Route Table`})]})}export{I as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id32.js b/spinifex/services/spinifexui/frontend/dist/assets/_id32.js index 4643181ea..076f3f648 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id32.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id32.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as ee}from"./useNavigate.js";import{t as te}from"./back-link.js";import{c as o,i as s,n as c,s as l,t as u}from"./select.js";import{t as d}from"./plus.js";import{t as f}from"./trash-2.js";import{n as p,t as m}from"./_id2.js";import{t as h}from"./button.js";import{t as g}from"./input.js";import{C as _}from"./ec2.js";import{F as v,c as y,et as b,l as x,tt as ne}from"./ec22.js";import{a as S,i as re,n as C,t as w}from"./zod.js";import{t as ie}from"./error-banner.js";import{t as T}from"./page-heading.js";import{a as E,r as ae,t as oe}from"./field.js";import{x as se}from"./ec23.js";import{i as ce,l as le,n as ue,o as de,r as fe,s as pe,t as me}from"./alert-dialog.js";import{t as D}from"./delete-confirmation-dialog.js";import{n as O,t as k}from"./detail-row.js";var he=r(),A=e(n()),j=t();function M(e){if(!e||e===`-1`)return`All traffic`;let t=e.toUpperCase();return t===`TCP`||t===`UDP`||t===`ICMP`?t:e}function N(e,t,n){return!n||n===`-1`||e===void 0||t===void 0||e===-1&&t===-1?`All`:e===t?e.toString():`${e}-${t}`}function P(e){let t=(0,he.c)(87),{open:n,onOpenChange:r,direction:i,groupId:a}=e,ee=x(),te=y(),o=i===`ingress`?ee:te,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={resolver:w(se),defaultValues:{ipProtocol:`tcp`,fromPort:0,toPort:0,cidrIp:`0.0.0.0/0`}},t[0]=s):s=t[0];let{control:c,handleSubmit:l,register:u,reset:d,formState:f}=re(s),{errors:p}=f,m;t[1]===c?m=t[2]:(m={control:c,name:`ipProtocol`},t[1]=c,t[2]=m);let h=S(m),_=h===`-1`||h===`icmp`,v;t[3]!==a||t[4]!==o||t[5]!==r||t[6]!==_||t[7]!==d?(v=async e=>{let t={groupId:a,ipProtocol:e.ipProtocol,fromPort:_?-1:e.fromPort,toPort:_?-1:e.toPort,cidrIp:e.cidrIp};await o.mutateAsync(t),d(),r(!1)},t[3]=a,t[4]=o,t[5]=r,t[6]=_,t[7]=d,t[8]=v):v=t[8];let b=v,ne=i===`ingress`?`Inbound`:`Outbound`,T;t[9]===ne?T=t[10]:(T=(0,j.jsx)(pe,{children:(0,j.jsxs)(le,{children:[`Add `,ne,` Rule`]})}),t[9]=ne,t[10]=T);let D;t[11]===o.error?D=t[12]:(D=o.error&&(0,j.jsx)(ie,{error:o.error,msg:`Failed to add rule`}),t[11]=o.error,t[12]=D);let O;t[13]!==l||t[14]!==b?(O=l(b),t[13]=l,t[14]=b,t[15]=O):O=t[15];let k;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,j.jsx)(E,{children:(0,j.jsx)(`label`,{htmlFor:`ipProtocol`,children:`Protocol`})}),t[16]=k):k=t[16];let A;t[17]===c?A=t[18]:(A=(0,j.jsx)(C,{control:c,name:`ipProtocol`,render:ge}),t[17]=c,t[18]=A);let M;t[19]===p.ipProtocol?M=t[20]:(M=(0,j.jsx)(ae,{errors:[p.ipProtocol]}),t[19]=p.ipProtocol,t[20]=M);let N;t[21]!==A||t[22]!==M?(N=(0,j.jsxs)(oe,{children:[k,A,M]}),t[21]=A,t[22]=M,t[23]=N):N=t[23];let P;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,j.jsx)(E,{children:(0,j.jsx)(`label`,{htmlFor:`fromPort`,children:`From Port`})}),t[24]=P):P=t[24];let _e=!!p.fromPort,F;t[25]===u?F=t[26]:(F=u(`fromPort`,{valueAsNumber:!0}),t[25]=u,t[26]=F);let I;t[27]!==_||t[28]!==_e||t[29]!==F?(I=(0,j.jsx)(g,{"aria-invalid":_e,disabled:_,id:`fromPort`,type:`number`,...F}),t[27]=_,t[28]=_e,t[29]=F,t[30]=I):I=t[30];let L;t[31]===p.fromPort?L=t[32]:(L=(0,j.jsx)(ae,{errors:[p.fromPort]}),t[31]=p.fromPort,t[32]=L);let R;t[33]!==I||t[34]!==L?(R=(0,j.jsxs)(oe,{children:[P,I,L]}),t[33]=I,t[34]=L,t[35]=R):R=t[35];let ve;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,j.jsx)(E,{children:(0,j.jsx)(`label`,{htmlFor:`toPort`,children:`To Port`})}),t[36]=ve):ve=t[36];let ye=!!p.toPort,z;t[37]===u?z=t[38]:(z=u(`toPort`,{valueAsNumber:!0}),t[37]=u,t[38]=z);let B;t[39]!==_||t[40]!==ye||t[41]!==z?(B=(0,j.jsx)(g,{"aria-invalid":ye,disabled:_,id:`toPort`,type:`number`,...z}),t[39]=_,t[40]=ye,t[41]=z,t[42]=B):B=t[42];let V;t[43]===p.toPort?V=t[44]:(V=(0,j.jsx)(ae,{errors:[p.toPort]}),t[43]=p.toPort,t[44]=V);let H;t[45]!==B||t[46]!==V?(H=(0,j.jsxs)(oe,{children:[ve,B,V]}),t[45]=B,t[46]=V,t[47]=H):H=t[47];let U;t[48]!==R||t[49]!==H?(U=(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[R,H]}),t[48]=R,t[49]=H,t[50]=U):U=t[50];let be=i===`ingress`?`Source`:`Destination`,W;t[51]===be?W=t[52]:(W=(0,j.jsx)(E,{children:(0,j.jsxs)(`label`,{htmlFor:`cidrIp`,children:[be,` CIDR`]})}),t[51]=be,t[52]=W);let xe=!!p.cidrIp,G;t[53]===u?G=t[54]:(G=u(`cidrIp`),t[53]=u,t[54]=G);let K;t[55]!==xe||t[56]!==G?(K=(0,j.jsx)(g,{"aria-invalid":xe,id:`cidrIp`,placeholder:`0.0.0.0/0`,...G}),t[55]=xe,t[56]=G,t[57]=K):K=t[57];let q;t[58]===p.cidrIp?q=t[59]:(q=(0,j.jsx)(ae,{errors:[p.cidrIp]}),t[58]=p.cidrIp,t[59]=q);let J;t[60]!==W||t[61]!==K||t[62]!==q?(J=(0,j.jsxs)(oe,{children:[W,K,q]}),t[60]=W,t[61]=K,t[62]=q,t[63]=J):J=t[63];let Y;t[64]!==N||t[65]!==U||t[66]!==J||t[67]!==O?(Y=(0,j.jsxs)(`form`,{className:`space-y-4`,id:`add-rule-form`,onSubmit:O,children:[N,U,J]}),t[64]=N,t[65]=U,t[66]=J,t[67]=O,t[68]=Y):Y=t[68];let X;t[69]!==o||t[70]!==d?(X=(0,j.jsx)(fe,{onClick:()=>{d(),o.reset()},children:`Cancel`}),t[69]=o,t[70]=d,t[71]=X):X=t[71];let Se=o.isPending?`Adding…`:`Add Rule`,Z;t[72]!==o.isPending||t[73]!==Se?(Z=(0,j.jsx)(ue,{disabled:o.isPending,form:`add-rule-form`,type:`submit`,children:Se}),t[72]=o.isPending,t[73]=Se,t[74]=Z):Z=t[74];let Q;t[75]!==X||t[76]!==Z?(Q=(0,j.jsxs)(de,{children:[X,Z]}),t[75]=X,t[76]=Z,t[77]=Q):Q=t[77];let $;t[78]!==Y||t[79]!==Q||t[80]!==T||t[81]!==D?($=(0,j.jsxs)(ce,{children:[T,D,Y,Q]}),t[78]=Y,t[79]=Q,t[80]=T,t[81]=D,t[82]=$):$=t[82];let Ce;return t[83]!==r||t[84]!==n||t[85]!==$?(Ce=(0,j.jsx)(me,{onOpenChange:r,open:n,children:$}),t[83]=r,t[84]=n,t[85]=$,t[86]=Ce):Ce=t[86],Ce}function ge(e){let{field:t}=e;return(0,j.jsxs)(u,{onValueChange:e=>t.onChange(e),value:t.value,children:[(0,j.jsx)(l,{className:`w-full`,id:`ipProtocol`,children:(0,j.jsx)(o,{})}),(0,j.jsxs)(c,{children:[(0,j.jsx)(s,{value:`tcp`,children:`TCP`}),(0,j.jsx)(s,{value:`udp`,children:`UDP`}),(0,j.jsx)(s,{value:`icmp`,children:`ICMP`}),(0,j.jsx)(s,{value:`-1`,children:`All traffic (-1)`})]})]})}function _e(e){return[...(e.IpRanges??[]).map(e=>({kind:`cidr`,value:e.CidrIp??``})),...(e.UserIdGroupPairs??[]).map(e=>({kind:`group`,value:e.GroupId??``}))]}function F(e){let t=(0,he.c)(41),{rule:n,source:r,groupId:i,direction:a}=e,ee=ne(),te=b(),o=a===`ingress`?ee:te,s;t[0]!==i||t[1]!==o||t[2]!==n.FromPort||t[3]!==n.IpProtocol||t[4]!==n.ToPort||t[5]!==r.kind||t[6]!==r.value?(s=async()=>{try{await o.mutateAsync({groupId:i,ipProtocol:n.IpProtocol??`-1`,fromPort:n.FromPort??-1,toPort:n.ToPort??-1,...r.kind===`group`?{sourceGroupId:r.value}:{cidrIp:r.value}})}catch{}},t[0]=i,t[1]=o,t[2]=n.FromPort,t[3]=n.IpProtocol,t[4]=n.ToPort,t[5]=r.kind,t[6]=r.value,t[7]=s):s=t[7];let c=s,l=r.kind===`group`&&r.value===i?`${r.value} (this security group)`:r.value,u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`Protocol: `}),t[8]=u):u=t[8];let d;t[9]===n.IpProtocol?d=t[10]:(d=M(n.IpProtocol),t[9]=n.IpProtocol,t[10]=d);let f;t[11]===d?f=t[12]:(f=(0,j.jsxs)(`div`,{children:[u,d]}),t[11]=d,t[12]=f);let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`Port Range: `}),t[13]=m):m=t[13];let g;t[14]!==n.FromPort||t[15]!==n.IpProtocol||t[16]!==n.ToPort?(g=N(n.FromPort,n.ToPort,n.IpProtocol),t[14]=n.FromPort,t[15]=n.IpProtocol,t[16]=n.ToPort,t[17]=g):g=t[17];let _;t[18]===g?_=t[19]:(_=(0,j.jsxs)(`div`,{children:[m,g]}),t[18]=g,t[19]=_);let v=a===`ingress`?`Source`:`Destination`,y;t[20]===v?y=t[21]:(y=(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[v,`:`,` `]}),t[20]=v,t[21]=y);let x;t[22]!==l||t[23]!==y?(x=(0,j.jsxs)(`div`,{children:[y,l]}),t[22]=l,t[23]=y,t[24]=x):x=t[24];let S;t[25]!==x||t[26]!==f||t[27]!==_?(S=(0,j.jsxs)(`div`,{className:`grid flex-1 grid-cols-3 gap-4 text-sm`,children:[f,_,x]}),t[25]=x,t[26]=f,t[27]=_,t[28]=S):S=t[28];let re;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,j.jsx)(p,{className:`size-3`}),t[29]=re):re=t[29];let C;t[30]!==c||t[31]!==o.isPending?(C=(0,j.jsx)(h,{disabled:o.isPending,onClick:c,size:`icon-xs`,variant:`ghost`,children:re}),t[30]=c,t[31]=o.isPending,t[32]=C):C=t[32];let w;t[33]!==S||t[34]!==C?(w=(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b px-4 py-3 last:border-b-0`,children:[S,C]}),t[33]=S,t[34]=C,t[35]=w):w=t[35];let T;t[36]===o.error?T=t[37]:(T=o.error&&(0,j.jsx)(`div`,{className:`px-4 pb-2`,children:(0,j.jsx)(ie,{error:o.error,msg:`Failed to remove rule`})}),t[36]=o.error,t[37]=T);let E;return t[38]!==w||t[39]!==T?(E=(0,j.jsxs)(`div`,{className:`space-y-0`,children:[w,T]}),t[38]=w,t[39]=T,t[40]=E):E=t[40],E}function I(){let{id:e}=m.useParams(),t=ee(),{data:n}=i(_(e)),r=n.SecurityGroups?.[0],o=v(),[s,c]=(0,A.useState)(!1),[l,u]=(0,A.useState)(!1),[p,g]=(0,A.useState)(!1),y=async()=>{try{await o.mutateAsync(e),t({to:`/ec2/describe-security-groups`})}finally{c(!1)}};if(!r?.GroupId)return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(te,{to:`/ec2/describe-security-groups`,children:`Back to Security Groups`}),(0,j.jsx)(`p`,{className:`text-muted-foreground`,children:`Security group not found.`})]});let b=r.IpPermissions??[],x=r.IpPermissionsEgress??[];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(te,{to:`/ec2/describe-security-groups`,children:`Back to Security Groups`}),o.error&&(0,j.jsx)(ie,{error:o.error,msg:`Failed to delete security group`}),(0,j.jsxs)(`div`,{className:`space-y-6`,children:[(0,j.jsx)(T,{actions:(0,j.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,j.jsxs)(h,{onClick:()=>c(!0),size:`sm`,variant:`destructive`,children:[(0,j.jsx)(f,{className:`size-4`}),`Delete`]})}),subtitle:`Security Group Details`,title:r.GroupName?`${r.GroupId} (${r.GroupName})`:r.GroupId}),(0,j.jsxs)(O,{children:[(0,j.jsx)(O.Header,{children:`Security Group Information`}),(0,j.jsxs)(O.Content,{children:[(0,j.jsx)(k,{label:`Group ID`,value:r.GroupId}),(0,j.jsx)(k,{label:`Group Name`,value:r.GroupName}),(0,j.jsx)(k,{label:`Description`,value:r.Description}),(0,j.jsx)(k,{label:`VPC ID`,value:r.VpcId?(0,j.jsx)(a,{className:`text-primary hover:underline`,params:{id:r.VpcId},to:`/ec2/describe-vpcs/$id`,children:r.VpcId}):`—`}),(0,j.jsx)(k,{label:`Owner ID`,value:r.OwnerId})]})]}),(0,j.jsxs)(O,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b p-4`,children:[(0,j.jsxs)(`h2`,{className:`font-semibold`,children:[`Inbound Rules (`,b.length,`)`]}),(0,j.jsxs)(h,{onClick:()=>u(!0),size:`sm`,variant:`outline`,children:[(0,j.jsx)(d,{className:`size-4`}),`Add Rule`]})]}),b.length>0?(0,j.jsx)(`div`,{children:b.flatMap(e=>_e(e).map(t=>(0,j.jsx)(F,{direction:`ingress`,groupId:r.GroupId??``,rule:e,source:t},`${e.IpProtocol}-${e.FromPort}-${e.ToPort}-${t.kind}-${t.value}`)))}):(0,j.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:`No inbound rules.`})]}),(0,j.jsxs)(O,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b p-4`,children:[(0,j.jsxs)(`h2`,{className:`font-semibold`,children:[`Outbound Rules (`,x.length,`)`]}),(0,j.jsxs)(h,{onClick:()=>g(!0),size:`sm`,variant:`outline`,children:[(0,j.jsx)(d,{className:`size-4`}),`Add Rule`]})]}),x.length>0?(0,j.jsx)(`div`,{children:x.flatMap(e=>_e(e).map(t=>(0,j.jsx)(F,{direction:`egress`,groupId:r.GroupId??``,rule:e,source:t},`${e.IpProtocol}-${e.FromPort}-${e.ToPort}-${t.kind}-${t.value}`)))}):(0,j.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:`No outbound rules.`})]})]}),(0,j.jsx)(D,{description:`Are you sure you want to delete the security group "${r.GroupId}"? This action cannot be undone.`,isPending:o.isPending,onConfirm:y,onOpenChange:c,open:s,title:`Delete Security Group`}),(0,j.jsx)(P,{direction:`ingress`,groupId:r.GroupId,onOpenChange:u,open:l}),(0,j.jsx)(P,{direction:`egress`,groupId:r.GroupId,onOpenChange:g,open:p})]})}export{I as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as ee}from"./useNavigate.js";import{t as te}from"./back-link.js";import{c as o,i as s,n as c,s as l,t as u}from"./select.js";import{t as d}from"./plus.js";import{t as f}from"./trash-2.js";import{n as p,t as m}from"./_id2.js";import{t as h}from"./button.js";import{t as g}from"./input.js";import{C as _}from"./ec2.js";import{F as v,c as y,et as b,l as x,tt as ne}from"./ec22.js";import{a as S,i as re,n as C,t as w}from"./zod.js";import{t as ie}from"./error-banner.js";import{t as T}from"./page-heading.js";import{a as E,r as ae,t as oe}from"./field.js";import{x as se}from"./ec23.js";import{i as ce,l as le,n as ue,o as de,r as fe,s as pe,t as me}from"./alert-dialog.js";import{t as D}from"./delete-confirmation-dialog.js";import{n as O,t as k}from"./detail-row.js";var he=r(),A=e(n()),j=t();function M(e){if(!e||e===`-1`)return`All traffic`;let t=e.toUpperCase();return t===`TCP`||t===`UDP`||t===`ICMP`?t:e}function N(e,t,n){return!n||n===`-1`||e===void 0||t===void 0||e===-1&&t===-1?`All`:e===t?e.toString():`${e}-${t}`}function P(e){let t=(0,he.c)(87),{open:n,onOpenChange:r,direction:i,groupId:a}=e,ee=x(),te=y(),o=i===`ingress`?ee:te,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={resolver:w(se),defaultValues:{ipProtocol:`tcp`,fromPort:0,toPort:0,cidrIp:`0.0.0.0/0`}},t[0]=s):s=t[0];let{control:c,handleSubmit:l,register:u,reset:d,formState:f}=re(s),{errors:p}=f,m;t[1]===c?m=t[2]:(m={control:c,name:`ipProtocol`},t[1]=c,t[2]=m);let h=S(m),_=h===`-1`||h===`icmp`,v;t[3]!==a||t[4]!==o||t[5]!==r||t[6]!==_||t[7]!==d?(v=async e=>{let t={groupId:a,ipProtocol:e.ipProtocol,fromPort:_?-1:e.fromPort,toPort:_?-1:e.toPort,cidrIp:e.cidrIp};await o.mutateAsync(t),d(),r(!1)},t[3]=a,t[4]=o,t[5]=r,t[6]=_,t[7]=d,t[8]=v):v=t[8];let b=v,ne=i===`ingress`?`Inbound`:`Outbound`,T;t[9]===ne?T=t[10]:(T=(0,j.jsx)(pe,{children:(0,j.jsxs)(le,{children:[`Add `,ne,` Rule`]})}),t[9]=ne,t[10]=T);let D;t[11]===o.error?D=t[12]:(D=o.error&&(0,j.jsx)(ie,{error:o.error,msg:`Failed to add rule`}),t[11]=o.error,t[12]=D);let O;t[13]!==l||t[14]!==b?(O=l(b),t[13]=l,t[14]=b,t[15]=O):O=t[15];let k;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,j.jsx)(E,{children:(0,j.jsx)(`label`,{htmlFor:`ipProtocol`,children:`Protocol`})}),t[16]=k):k=t[16];let A;t[17]===c?A=t[18]:(A=(0,j.jsx)(C,{control:c,name:`ipProtocol`,render:ge}),t[17]=c,t[18]=A);let M;t[19]===p.ipProtocol?M=t[20]:(M=(0,j.jsx)(ae,{errors:[p.ipProtocol]}),t[19]=p.ipProtocol,t[20]=M);let N;t[21]!==A||t[22]!==M?(N=(0,j.jsxs)(oe,{children:[k,A,M]}),t[21]=A,t[22]=M,t[23]=N):N=t[23];let P;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,j.jsx)(E,{children:(0,j.jsx)(`label`,{htmlFor:`fromPort`,children:`From Port`})}),t[24]=P):P=t[24];let _e=!!p.fromPort,F;t[25]===u?F=t[26]:(F=u(`fromPort`,{valueAsNumber:!0}),t[25]=u,t[26]=F);let I;t[27]!==_||t[28]!==_e||t[29]!==F?(I=(0,j.jsx)(g,{"aria-invalid":_e,disabled:_,id:`fromPort`,type:`number`,...F}),t[27]=_,t[28]=_e,t[29]=F,t[30]=I):I=t[30];let L;t[31]===p.fromPort?L=t[32]:(L=(0,j.jsx)(ae,{errors:[p.fromPort]}),t[31]=p.fromPort,t[32]=L);let R;t[33]!==I||t[34]!==L?(R=(0,j.jsxs)(oe,{children:[P,I,L]}),t[33]=I,t[34]=L,t[35]=R):R=t[35];let ve;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,j.jsx)(E,{children:(0,j.jsx)(`label`,{htmlFor:`toPort`,children:`To Port`})}),t[36]=ve):ve=t[36];let ye=!!p.toPort,z;t[37]===u?z=t[38]:(z=u(`toPort`,{valueAsNumber:!0}),t[37]=u,t[38]=z);let B;t[39]!==_||t[40]!==ye||t[41]!==z?(B=(0,j.jsx)(g,{"aria-invalid":ye,disabled:_,id:`toPort`,type:`number`,...z}),t[39]=_,t[40]=ye,t[41]=z,t[42]=B):B=t[42];let V;t[43]===p.toPort?V=t[44]:(V=(0,j.jsx)(ae,{errors:[p.toPort]}),t[43]=p.toPort,t[44]=V);let H;t[45]!==B||t[46]!==V?(H=(0,j.jsxs)(oe,{children:[ve,B,V]}),t[45]=B,t[46]=V,t[47]=H):H=t[47];let U;t[48]!==R||t[49]!==H?(U=(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[R,H]}),t[48]=R,t[49]=H,t[50]=U):U=t[50];let be=i===`ingress`?`Source`:`Destination`,W;t[51]===be?W=t[52]:(W=(0,j.jsx)(E,{children:(0,j.jsxs)(`label`,{htmlFor:`cidrIp`,children:[be,` CIDR`]})}),t[51]=be,t[52]=W);let xe=!!p.cidrIp,G;t[53]===u?G=t[54]:(G=u(`cidrIp`),t[53]=u,t[54]=G);let K;t[55]!==xe||t[56]!==G?(K=(0,j.jsx)(g,{"aria-invalid":xe,id:`cidrIp`,placeholder:`0.0.0.0/0`,...G}),t[55]=xe,t[56]=G,t[57]=K):K=t[57];let q;t[58]===p.cidrIp?q=t[59]:(q=(0,j.jsx)(ae,{errors:[p.cidrIp]}),t[58]=p.cidrIp,t[59]=q);let J;t[60]!==W||t[61]!==K||t[62]!==q?(J=(0,j.jsxs)(oe,{children:[W,K,q]}),t[60]=W,t[61]=K,t[62]=q,t[63]=J):J=t[63];let Y;t[64]!==N||t[65]!==U||t[66]!==J||t[67]!==O?(Y=(0,j.jsxs)(`form`,{className:`space-y-4`,id:`add-rule-form`,onSubmit:O,children:[N,U,J]}),t[64]=N,t[65]=U,t[66]=J,t[67]=O,t[68]=Y):Y=t[68];let X;t[69]!==o||t[70]!==d?(X=(0,j.jsx)(fe,{onClick:()=>{d(),o.reset()},children:`Cancel`}),t[69]=o,t[70]=d,t[71]=X):X=t[71];let Se=o.isPending?`Adding…`:`Add Rule`,Z;t[72]!==o.isPending||t[73]!==Se?(Z=(0,j.jsx)(ue,{disabled:o.isPending,form:`add-rule-form`,type:`submit`,children:Se}),t[72]=o.isPending,t[73]=Se,t[74]=Z):Z=t[74];let Q;t[75]!==X||t[76]!==Z?(Q=(0,j.jsxs)(de,{children:[X,Z]}),t[75]=X,t[76]=Z,t[77]=Q):Q=t[77];let $;t[78]!==Y||t[79]!==Q||t[80]!==T||t[81]!==D?($=(0,j.jsxs)(ce,{children:[T,D,Y,Q]}),t[78]=Y,t[79]=Q,t[80]=T,t[81]=D,t[82]=$):$=t[82];let Ce;return t[83]!==r||t[84]!==n||t[85]!==$?(Ce=(0,j.jsx)(me,{onOpenChange:r,open:n,children:$}),t[83]=r,t[84]=n,t[85]=$,t[86]=Ce):Ce=t[86],Ce}function ge(e){let{field:t}=e;return(0,j.jsxs)(u,{onValueChange:e=>{t.onChange(e)},value:t.value,children:[(0,j.jsx)(l,{className:`w-full`,id:`ipProtocol`,children:(0,j.jsx)(o,{})}),(0,j.jsxs)(c,{children:[(0,j.jsx)(s,{value:`tcp`,children:`TCP`}),(0,j.jsx)(s,{value:`udp`,children:`UDP`}),(0,j.jsx)(s,{value:`icmp`,children:`ICMP`}),(0,j.jsx)(s,{value:`-1`,children:`All traffic (-1)`})]})]})}function _e(e){return[...(e.IpRanges??[]).map(e=>({kind:`cidr`,value:e.CidrIp??``})),...(e.UserIdGroupPairs??[]).map(e=>({kind:`group`,value:e.GroupId??``}))]}function F(e){let t=(0,he.c)(41),{rule:n,source:r,groupId:i,direction:a}=e,ee=ne(),te=b(),o=a===`ingress`?ee:te,s;t[0]!==i||t[1]!==o||t[2]!==n.FromPort||t[3]!==n.IpProtocol||t[4]!==n.ToPort||t[5]!==r.kind||t[6]!==r.value?(s=async()=>{try{await o.mutateAsync({groupId:i,ipProtocol:n.IpProtocol??`-1`,fromPort:n.FromPort??-1,toPort:n.ToPort??-1,...r.kind===`group`?{sourceGroupId:r.value}:{cidrIp:r.value}})}catch{}},t[0]=i,t[1]=o,t[2]=n.FromPort,t[3]=n.IpProtocol,t[4]=n.ToPort,t[5]=r.kind,t[6]=r.value,t[7]=s):s=t[7];let c=s,l=r.kind===`group`&&r.value===i?`${r.value} (this security group)`:r.value,u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`Protocol: `}),t[8]=u):u=t[8];let d;t[9]===n.IpProtocol?d=t[10]:(d=M(n.IpProtocol),t[9]=n.IpProtocol,t[10]=d);let f;t[11]===d?f=t[12]:(f=(0,j.jsxs)(`div`,{children:[u,d]}),t[11]=d,t[12]=f);let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`Port Range: `}),t[13]=m):m=t[13];let g;t[14]!==n.FromPort||t[15]!==n.IpProtocol||t[16]!==n.ToPort?(g=N(n.FromPort,n.ToPort,n.IpProtocol),t[14]=n.FromPort,t[15]=n.IpProtocol,t[16]=n.ToPort,t[17]=g):g=t[17];let _;t[18]===g?_=t[19]:(_=(0,j.jsxs)(`div`,{children:[m,g]}),t[18]=g,t[19]=_);let v=a===`ingress`?`Source`:`Destination`,y;t[20]===v?y=t[21]:(y=(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[v,`:`,` `]}),t[20]=v,t[21]=y);let x;t[22]!==l||t[23]!==y?(x=(0,j.jsxs)(`div`,{children:[y,l]}),t[22]=l,t[23]=y,t[24]=x):x=t[24];let S;t[25]!==x||t[26]!==f||t[27]!==_?(S=(0,j.jsxs)(`div`,{className:`grid flex-1 grid-cols-3 gap-4 text-sm`,children:[f,_,x]}),t[25]=x,t[26]=f,t[27]=_,t[28]=S):S=t[28];let re;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,j.jsx)(p,{className:`size-3`}),t[29]=re):re=t[29];let C;t[30]!==c||t[31]!==o.isPending?(C=(0,j.jsx)(h,{disabled:o.isPending,onClick:c,size:`icon-xs`,variant:`ghost`,children:re}),t[30]=c,t[31]=o.isPending,t[32]=C):C=t[32];let w;t[33]!==S||t[34]!==C?(w=(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b px-4 py-3 last:border-b-0`,children:[S,C]}),t[33]=S,t[34]=C,t[35]=w):w=t[35];let T;t[36]===o.error?T=t[37]:(T=o.error&&(0,j.jsx)(`div`,{className:`px-4 pb-2`,children:(0,j.jsx)(ie,{error:o.error,msg:`Failed to remove rule`})}),t[36]=o.error,t[37]=T);let E;return t[38]!==w||t[39]!==T?(E=(0,j.jsxs)(`div`,{className:`space-y-0`,children:[w,T]}),t[38]=w,t[39]=T,t[40]=E):E=t[40],E}function I(){let{id:e}=m.useParams(),t=ee(),{data:n}=i(_(e)),r=n.SecurityGroups?.[0],o=v(),[s,c]=(0,A.useState)(!1),[l,u]=(0,A.useState)(!1),[p,g]=(0,A.useState)(!1),y=async()=>{try{await o.mutateAsync(e),t({to:`/ec2/describe-security-groups`})}finally{c(!1)}};if(!r?.GroupId)return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(te,{to:`/ec2/describe-security-groups`,children:`Back to Security Groups`}),(0,j.jsx)(`p`,{className:`text-muted-foreground`,children:`Security group not found.`})]});let b=r.IpPermissions??[],x=r.IpPermissionsEgress??[];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(te,{to:`/ec2/describe-security-groups`,children:`Back to Security Groups`}),o.error&&(0,j.jsx)(ie,{error:o.error,msg:`Failed to delete security group`}),(0,j.jsxs)(`div`,{className:`space-y-6`,children:[(0,j.jsx)(T,{actions:(0,j.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,j.jsxs)(h,{onClick:()=>{c(!0)},size:`sm`,variant:`destructive`,children:[(0,j.jsx)(f,{className:`size-4`}),`Delete`]})}),subtitle:`Security Group Details`,title:r.GroupName?`${r.GroupId} (${r.GroupName})`:r.GroupId}),(0,j.jsxs)(O,{children:[(0,j.jsx)(O.Header,{children:`Security Group Information`}),(0,j.jsxs)(O.Content,{children:[(0,j.jsx)(k,{label:`Group ID`,value:r.GroupId}),(0,j.jsx)(k,{label:`Group Name`,value:r.GroupName}),(0,j.jsx)(k,{label:`Description`,value:r.Description}),(0,j.jsx)(k,{label:`VPC ID`,value:r.VpcId?(0,j.jsx)(a,{className:`text-primary hover:underline`,params:{id:r.VpcId},to:`/ec2/describe-vpcs/$id`,children:r.VpcId}):`—`}),(0,j.jsx)(k,{label:`Owner ID`,value:r.OwnerId})]})]}),(0,j.jsxs)(O,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b p-4`,children:[(0,j.jsxs)(`h2`,{className:`font-semibold`,children:[`Inbound Rules (`,b.length,`)`]}),(0,j.jsxs)(h,{onClick:()=>{u(!0)},size:`sm`,variant:`outline`,children:[(0,j.jsx)(d,{className:`size-4`}),`Add Rule`]})]}),b.length>0?(0,j.jsx)(`div`,{children:b.flatMap(e=>_e(e).map(t=>(0,j.jsx)(F,{direction:`ingress`,groupId:r.GroupId??``,rule:e,source:t},`${e.IpProtocol}-${e.FromPort}-${e.ToPort}-${t.kind}-${t.value}`)))}):(0,j.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:`No inbound rules.`})]}),(0,j.jsxs)(O,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b p-4`,children:[(0,j.jsxs)(`h2`,{className:`font-semibold`,children:[`Outbound Rules (`,x.length,`)`]}),(0,j.jsxs)(h,{onClick:()=>{g(!0)},size:`sm`,variant:`outline`,children:[(0,j.jsx)(d,{className:`size-4`}),`Add Rule`]})]}),x.length>0?(0,j.jsx)(`div`,{children:x.flatMap(e=>_e(e).map(t=>(0,j.jsx)(F,{direction:`egress`,groupId:r.GroupId??``,rule:e,source:t},`${e.IpProtocol}-${e.FromPort}-${e.ToPort}-${t.kind}-${t.value}`)))}):(0,j.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:`No outbound rules.`})]})]}),(0,j.jsx)(D,{description:`Are you sure you want to delete the security group "${r.GroupId}"? This action cannot be undone.`,isPending:o.isPending,onConfirm:y,onOpenChange:c,open:s,title:`Delete Security Group`}),(0,j.jsx)(P,{direction:`ingress`,groupId:r.GroupId,onOpenChange:u,open:l}),(0,j.jsx)(P,{direction:`egress`,groupId:r.GroupId,onOpenChange:g,open:p})]})}export{I as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id33.js b/spinifex/services/spinifexui/frontend/dist/assets/_id33.js index e6ac3d37f..bed417fed 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id33.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id33.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o,t as s}from"./cluster-config.js";import{t as c}from"./back-link.js";import{t as ee}from"./copy.js";import{n as te,t as ne}from"./_id.js";import{t as l}from"./trash-2.js";import{t as u}from"./button.js";import{t as d}from"./input.js";import{T as f,b as p}from"./ec2.js";import{I as m,Q as h,u as g}from"./ec22.js";import{t as _}from"./error-banner.js";import{t as re}from"./page-heading.js";import{a as v,t as y}from"./field.js";import{a as b,i as x,l as S,n as C,o as w,r as T,s as E,t as D}from"./alert-dialog.js";import{t as O}from"./delete-confirmation-dialog.js";import{n as k,t as A}from"./detail-row.js";import{t as ie}from"./state-badge.js";import{t as ae}from"./textarea.js";var j=e(n()),M=t();function N(){let{id:e}=ne.useParams(),t=a(),{data:n}=r(f(e)),{data:N}=r(p),P=n.Snapshots?.[0],F=m(),I=g(),L=h(),[R,z]=(0,j.useState)(!1),[B,V]=(0,j.useState)(!1),[H,U]=(0,j.useState)(``),[W,G]=(0,j.useState)(!1),[K,q]=(0,j.useState)(``),[J,Y]=(0,j.useState)(``),[X,Z]=(0,j.useState)(null),oe=N.Regions?.[0]?.RegionName??s(),Q=P?.State===`completed`,se=P?.State===`completed`;function ce(e){e||(q(``),Y(``),Z(null)),G(e)}async function le(){try{let t=await L.mutateAsync({snapshotId:e,name:K,description:J||void 0});Z(t.ImageId??null),q(``),Y(``)}catch{}}let $=async()=>{try{await F.mutateAsync(e),t({to:`/ec2/describe-snapshots`})}finally{z(!1)}},ue=async()=>{try{await I.mutateAsync({sourceSnapshotId:e,sourceRegion:oe,description:H||void 0}),V(!1),U(``)}catch{}};if(!P?.SnapshotId)return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(c,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),(0,M.jsx)(`p`,{className:`text-muted-foreground`,children:`Snapshot not found.`})]});let de=o(P.StartTime);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(c,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),F.error&&(0,M.jsx)(_,{error:F.error,msg:`Failed to delete snapshot`}),I.error&&(0,M.jsx)(_,{error:I.error,msg:`Failed to copy snapshot`}),L.error&&(0,M.jsx)(_,{error:L.error,msg:`Failed to register image`}),(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(re,{actions:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsxs)(u,{disabled:!Q,onClick:()=>z(!0),size:`sm`,variant:`destructive`,children:[(0,M.jsx)(l,{className:`size-4`}),`Delete`]}),(0,M.jsxs)(u,{disabled:!Q,onClick:()=>V(!0),size:`sm`,variant:`outline`,children:[(0,M.jsx)(ee,{className:`size-4`}),`Copy Snapshot`]}),(0,M.jsxs)(u,{disabled:!se,onClick:()=>G(!0),size:`sm`,variant:`outline`,children:[(0,M.jsx)(te,{className:`size-4`}),`Register as AMI`]}),(0,M.jsx)(ie,{state:P.State})]}),subtitle:`Snapshot Details`,title:P.SnapshotId}),(0,M.jsxs)(k,{children:[(0,M.jsx)(k.Header,{children:`Snapshot Information`}),(0,M.jsxs)(k.Content,{children:[(0,M.jsx)(A,{label:`Snapshot ID`,value:P.SnapshotId}),(0,M.jsx)(A,{label:`Volume ID`,value:P.VolumeId?(0,M.jsx)(i,{className:`text-primary hover:underline`,params:{id:P.VolumeId},to:`/ec2/describe-volumes/$id`,children:P.VolumeId}):void 0}),(0,M.jsx)(A,{label:`Volume Size`,value:`${P.VolumeSize} GiB`}),(0,M.jsx)(A,{label:`State`,value:P.State}),(0,M.jsx)(A,{label:`Description`,value:P.Description}),(0,M.jsx)(A,{label:`Progress`,value:P.Progress}),(0,M.jsx)(A,{label:`Start Time`,value:de}),(0,M.jsx)(A,{label:`Owner ID`,value:P.OwnerId}),(0,M.jsx)(A,{label:`Encrypted`,value:P.Encrypted?`Yes`:`No`})]})]})]}),(0,M.jsx)(O,{description:`Are you sure you want to delete the snapshot "${P.SnapshotId}"? This action cannot be undone.`,isPending:F.isPending,onConfirm:$,onOpenChange:z,open:R,title:`Delete Snapshot`}),(0,M.jsx)(D,{onOpenChange:V,open:B,children:(0,M.jsxs)(x,{children:[(0,M.jsxs)(E,{children:[(0,M.jsx)(S,{children:`Copy Snapshot`}),(0,M.jsx)(b,{children:`Create a copy of this snapshot in the current region.`})]}),(0,M.jsxs)(y,{children:[(0,M.jsx)(v,{children:(0,M.jsx)(`label`,{htmlFor:`copyDescription`,children:`Description (optional)`})}),(0,M.jsx)(d,{id:`copyDescription`,onChange:e=>U(e.target.value),placeholder:`Description for the snapshot copy`,value:H})]}),(0,M.jsxs)(w,{children:[(0,M.jsx)(T,{children:`Cancel`}),(0,M.jsx)(C,{disabled:I.isPending,onClick:ue,children:I.isPending?`Copying…`:`Copy Snapshot`})]})]})}),(0,M.jsx)(D,{onOpenChange:ce,open:W,children:(0,M.jsxs)(x,{children:[(0,M.jsxs)(E,{children:[(0,M.jsx)(S,{children:X?`Image Registered`:`Register as AMI`}),(0,M.jsx)(b,{children:X?(0,M.jsxs)(M.Fragment,{children:[`AMI`,` `,(0,M.jsx)(i,{className:`text-primary hover:underline`,params:{id:X},to:`/ec2/describe-images/$id`,children:X}),` `,`was registered successfully.`]}):`Create an AMI from snapshot "${e}".`})]}),!X&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(y,{children:[(0,M.jsx)(v,{children:(0,M.jsx)(`label`,{htmlFor:`registerName`,children:`Name`})}),(0,M.jsx)(d,{id:`registerName`,onChange:e=>q(e.target.value),placeholder:`my-image`,value:K})]}),(0,M.jsxs)(y,{children:[(0,M.jsx)(v,{children:(0,M.jsx)(`label`,{htmlFor:`registerDescription`,children:`Description (optional)`})}),(0,M.jsx)(ae,{id:`registerDescription`,onChange:e=>Y(e.target.value),placeholder:`Optional description`,rows:2,value:J})]})]}),(0,M.jsxs)(w,{children:[(0,M.jsx)(T,{children:X?`Close`:`Cancel`}),!X&&(0,M.jsx)(C,{disabled:L.isPending||!K.trim(),onClick:le,children:L.isPending?`Registering…`:`Register AMI`})]})]})})]})}export{N as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o,t as s}from"./cluster-config.js";import{t as c}from"./back-link.js";import{t as ee}from"./copy.js";import{n as te,t as ne}from"./_id.js";import{t as l}from"./trash-2.js";import{t as u}from"./button.js";import{t as d}from"./input.js";import{T as f,b as p}from"./ec2.js";import{I as m,Q as h,u as g}from"./ec22.js";import{t as _}from"./error-banner.js";import{t as re}from"./page-heading.js";import{a as v,t as y}from"./field.js";import{a as b,i as x,l as S,n as C,o as w,r as T,s as E,t as D}from"./alert-dialog.js";import{t as O}from"./delete-confirmation-dialog.js";import{n as k,t as A}from"./detail-row.js";import{t as ie}from"./state-badge.js";import{t as ae}from"./textarea.js";var j=e(n()),M=t();function N(){let{id:e}=ne.useParams(),t=a(),{data:n}=r(f(e)),{data:N}=r(p),P=n.Snapshots?.[0],F=m(),I=g(),L=h(),[R,z]=(0,j.useState)(!1),[B,V]=(0,j.useState)(!1),[H,U]=(0,j.useState)(``),[W,G]=(0,j.useState)(!1),[K,q]=(0,j.useState)(``),[J,Y]=(0,j.useState)(``),[X,Z]=(0,j.useState)(null),oe=N.Regions?.[0]?.RegionName??s(),Q=P?.State===`completed`,se=P?.State===`completed`;function ce(e){e||(q(``),Y(``),Z(null)),G(e)}async function le(){try{let t=await L.mutateAsync({snapshotId:e,name:K,description:J||void 0});Z(t.ImageId??null),q(``),Y(``)}catch{}}let $=async()=>{try{await F.mutateAsync(e),t({to:`/ec2/describe-snapshots`})}finally{z(!1)}},ue=async()=>{try{await I.mutateAsync({sourceSnapshotId:e,sourceRegion:oe,description:H||void 0}),V(!1),U(``)}catch{}};if(!P?.SnapshotId)return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(c,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),(0,M.jsx)(`p`,{className:`text-muted-foreground`,children:`Snapshot not found.`})]});let de=o(P.StartTime);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(c,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),F.error&&(0,M.jsx)(_,{error:F.error,msg:`Failed to delete snapshot`}),I.error&&(0,M.jsx)(_,{error:I.error,msg:`Failed to copy snapshot`}),L.error&&(0,M.jsx)(_,{error:L.error,msg:`Failed to register image`}),(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(re,{actions:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsxs)(u,{disabled:!Q,onClick:()=>{z(!0)},size:`sm`,variant:`destructive`,children:[(0,M.jsx)(l,{className:`size-4`}),`Delete`]}),(0,M.jsxs)(u,{disabled:!Q,onClick:()=>{V(!0)},size:`sm`,variant:`outline`,children:[(0,M.jsx)(ee,{className:`size-4`}),`Copy Snapshot`]}),(0,M.jsxs)(u,{disabled:!se,onClick:()=>{G(!0)},size:`sm`,variant:`outline`,children:[(0,M.jsx)(te,{className:`size-4`}),`Register as AMI`]}),(0,M.jsx)(ie,{state:P.State})]}),subtitle:`Snapshot Details`,title:P.SnapshotId}),(0,M.jsxs)(k,{children:[(0,M.jsx)(k.Header,{children:`Snapshot Information`}),(0,M.jsxs)(k.Content,{children:[(0,M.jsx)(A,{label:`Snapshot ID`,value:P.SnapshotId}),(0,M.jsx)(A,{label:`Volume ID`,value:P.VolumeId?(0,M.jsx)(i,{className:`text-primary hover:underline`,params:{id:P.VolumeId},to:`/ec2/describe-volumes/$id`,children:P.VolumeId}):void 0}),(0,M.jsx)(A,{label:`Volume Size`,value:`${P.VolumeSize} GiB`}),(0,M.jsx)(A,{label:`State`,value:P.State}),(0,M.jsx)(A,{label:`Description`,value:P.Description}),(0,M.jsx)(A,{label:`Progress`,value:P.Progress}),(0,M.jsx)(A,{label:`Start Time`,value:de}),(0,M.jsx)(A,{label:`Owner ID`,value:P.OwnerId}),(0,M.jsx)(A,{label:`Encrypted`,value:P.Encrypted?`Yes`:`No`})]})]})]}),(0,M.jsx)(O,{description:`Are you sure you want to delete the snapshot "${P.SnapshotId}"? This action cannot be undone.`,isPending:F.isPending,onConfirm:$,onOpenChange:z,open:R,title:`Delete Snapshot`}),(0,M.jsx)(D,{onOpenChange:V,open:B,children:(0,M.jsxs)(x,{children:[(0,M.jsxs)(E,{children:[(0,M.jsx)(S,{children:`Copy Snapshot`}),(0,M.jsx)(b,{children:`Create a copy of this snapshot in the current region.`})]}),(0,M.jsxs)(y,{children:[(0,M.jsx)(v,{children:(0,M.jsx)(`label`,{htmlFor:`copyDescription`,children:`Description (optional)`})}),(0,M.jsx)(d,{id:`copyDescription`,onChange:e=>{U(e.target.value)},placeholder:`Description for the snapshot copy`,value:H})]}),(0,M.jsxs)(w,{children:[(0,M.jsx)(T,{children:`Cancel`}),(0,M.jsx)(C,{disabled:I.isPending,onClick:ue,children:I.isPending?`Copying…`:`Copy Snapshot`})]})]})}),(0,M.jsx)(D,{onOpenChange:ce,open:W,children:(0,M.jsxs)(x,{children:[(0,M.jsxs)(E,{children:[(0,M.jsx)(S,{children:X?`Image Registered`:`Register as AMI`}),(0,M.jsx)(b,{children:X?(0,M.jsxs)(M.Fragment,{children:[`AMI`,` `,(0,M.jsx)(i,{className:`text-primary hover:underline`,params:{id:X},to:`/ec2/describe-images/$id`,children:X}),` `,`was registered successfully.`]}):`Create an AMI from snapshot "${e}".`})]}),!X&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(y,{children:[(0,M.jsx)(v,{children:(0,M.jsx)(`label`,{htmlFor:`registerName`,children:`Name`})}),(0,M.jsx)(d,{id:`registerName`,onChange:e=>{q(e.target.value)},placeholder:`my-image`,value:K})]}),(0,M.jsxs)(y,{children:[(0,M.jsx)(v,{children:(0,M.jsx)(`label`,{htmlFor:`registerDescription`,children:`Description (optional)`})}),(0,M.jsx)(ae,{id:`registerDescription`,onChange:e=>{Y(e.target.value)},placeholder:`Optional description`,rows:2,value:J})]})]}),(0,M.jsxs)(w,{children:[(0,M.jsx)(T,{children:X?`Close`:`Cancel`}),!X&&(0,M.jsx)(C,{disabled:L.isPending||!K.trim(),onClick:le,children:L.isPending?`Registering…`:`Register AMI`})]})]})})]})}export{N as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id34.js b/spinifex/services/spinifexui/frontend/dist/assets/_id34.js index acf582d59..fab7eb759 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id34.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id34.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{D as u}from"./ec2.js";import{L as d}from"./ec22.js";import{t as f}from"./_id13.js";import{t as p}from"./error-banner.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=e(n()),b=t();function x(){let{id:e}=f.useParams(),t=a(),{data:n}=r(u(e)),x=n.Subnets?.[0],S=d(),[C,w]=(0,y.useState)(!1),T=async()=>{try{await S.mutateAsync(e),t({to:`/ec2/describe-subnets`})}finally{w(!1)}};if(!x?.SubnetId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Subnet not found.`})]});let E=o(x.Tags);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),S.error&&(0,b.jsx)(p,{error:S.error,msg:`Failed to delete subnet`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(l,{onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(c,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:x.State})]}),subtitle:`Subnet Details`,title:E?`${x.SubnetId} (${E})`:x.SubnetId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Subnet Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Subnet ID`,value:x.SubnetId}),(0,b.jsx)(_,{label:`VPC ID`,value:x.VpcId?(0,b.jsx)(i,{className:`text-primary hover:underline`,params:{id:x.VpcId},to:`/ec2/describe-vpcs/$id`,children:x.VpcId}):`—`}),(0,b.jsx)(_,{label:`State`,value:x.State}),(0,b.jsx)(_,{label:`CIDR Block`,value:x.CidrBlock}),(0,b.jsx)(_,{label:`Availability Zone`,value:x.AvailabilityZone}),(0,b.jsx)(_,{label:`Available IP Count`,value:x.AvailableIpAddressCount?.toString()}),(0,b.jsx)(_,{label:`Map Public IP on Launch`,value:x.MapPublicIpOnLaunch?`Yes`:`No`}),(0,b.jsx)(_,{label:`Default for AZ`,value:x.DefaultForAz?`Yes`:`No`})]})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the subnet "${x.SubnetId}"? This action cannot be undone.`,isPending:S.isPending,onConfirm:T,onOpenChange:w,open:C,title:`Delete Subnet`})]})}export{x as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{D as u}from"./ec2.js";import{L as d}from"./ec22.js";import{t as f}from"./_id13.js";import{t as p}from"./error-banner.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=e(n()),b=t();function x(){let{id:e}=f.useParams(),t=a(),{data:n}=r(u(e)),x=n.Subnets?.[0],S=d(),[C,w]=(0,y.useState)(!1),T=async()=>{try{await S.mutateAsync(e),t({to:`/ec2/describe-subnets`})}finally{w(!1)}};if(!x?.SubnetId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Subnet not found.`})]});let E=o(x.Tags);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),S.error&&(0,b.jsx)(p,{error:S.error,msg:`Failed to delete subnet`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(l,{onClick:()=>{w(!0)},size:`sm`,variant:`destructive`,children:[(0,b.jsx)(c,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:x.State})]}),subtitle:`Subnet Details`,title:E?`${x.SubnetId} (${E})`:x.SubnetId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Subnet Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Subnet ID`,value:x.SubnetId}),(0,b.jsx)(_,{label:`VPC ID`,value:x.VpcId?(0,b.jsx)(i,{className:`text-primary hover:underline`,params:{id:x.VpcId},to:`/ec2/describe-vpcs/$id`,children:x.VpcId}):`—`}),(0,b.jsx)(_,{label:`State`,value:x.State}),(0,b.jsx)(_,{label:`CIDR Block`,value:x.CidrBlock}),(0,b.jsx)(_,{label:`Availability Zone`,value:x.AvailabilityZone}),(0,b.jsx)(_,{label:`Available IP Count`,value:x.AvailableIpAddressCount?.toString()}),(0,b.jsx)(_,{label:`Map Public IP on Launch`,value:x.MapPublicIpOnLaunch?`Yes`:`No`}),(0,b.jsx)(_,{label:`Default for AZ`,value:x.DefaultForAz?`Yes`:`No`})]})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the subnet "${x.SubnetId}"? This action cannot be undone.`,isPending:S.isPending,onConfirm:T,onOpenChange:w,open:C,title:`Delete Subnet`})]})}export{x as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id35.js b/spinifex/services/spinifexui/frontend/dist/assets/_id35.js index f51e93af3..ca17c7d8a 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id35.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id35.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./useNavigate.js";import{Xt as s,nn as c}from"./cluster-config.js";import{t as l}from"./back-link.js";import{t as u}from"./trash-2.js";import{t as d}from"./button.js";import{t as f}from"./input.js";import{l as p}from"./ec2.js";import{_ as m,c as h,l as g,m as _,p as v}from"./elbv2.js";import{c as y,d as b,l as x,s as S}from"./elbv22.js";import{t as C}from"./_id14.js";import{t as w}from"./error-banner.js";import{t as T}from"./page-heading.js";import{a as E,i as D,l as O,n as k,o as A,r as j,s as M,t as N}from"./alert-dialog.js";import{t as P}from"./delete-confirmation-dialog.js";import{n as F,t as I}from"./detail-row.js";import{r as L,t as R}from"./attributes-editor.js";import{t as z}from"./tags-editor.js";import{i as B,n as V,r as H,t as U}from"./tabs.js";var W=r(),G=e(n(),1),K=t();function q(e){let t=e.trim();if(t===``)return;let n=Number(t);if(!(!Number.isInteger(n)||n<1||n>65535))return n}function J(e){let t=(0,W.c)(33),{open:n,onOpenChange:r,instances:i,defaultPort:a,isPending:o,onConfirm:s}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={},t[0]=l):l=t[0];let[u,d]=(0,G.useState)(l),[p,m]=(0,G.useState)(),[h,g]=(0,G.useState)(n);n!==h&&(g(n),n||(d({}),m(void 0)));let _;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{d(t=>{let n=t[e];return n?.checked?{...t,[e]:{...n,checked:!1}}:{...t,[e]:{checked:!0,port:n?.port??``}}})},t[1]=_):_=t[1];let v=_,y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=(e,t)=>{d(n=>({...n,[e]:{checked:n[e]?.checked??!0,port:t}}))},t[2]=y):y=t[2];let b=y,x;t[3]!==s||t[4]!==u?(x=()=>{let e=Object.entries(u).filter(Y);if(e.length===0){m(`Select at least one instance.`);return}let t=[];for(let[n,r]of e){if(r.port.trim()===``){t.push({id:n});continue}let e=q(r.port);if(e===void 0){m(`Port for ${n} must be an integer between 1 and 65535.`);return}t.push({id:n,port:e})}m(void 0),s(t)},t[3]=s,t[4]=u,t[5]=x):x=t[5];let S=x,C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(O,{children:`Register targets`}),t[6]=C):C=t[6];let w;t[7]===a?w=t[8]:(w=(0,K.jsxs)(M,{children:[C,(0,K.jsxs)(E,{children:[`Select instances to register. Leave port blank to use the target group port (`,a,`).`]})]}),t[7]=a,t[8]=w);let T;t[9]!==a||t[10]!==i||t[11]!==u?(T=i.length===0?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No instances available in this VPC.`}):(0,K.jsx)(`div`,{className:`max-h-72 space-y-1 overflow-y-auto`,children:i.map(e=>{let t=e.InstanceId??``,n=u[t],r=n?.checked??!1,i=c(e.Tags);return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded px-1 py-1 text-xs hover:bg-accent`,children:[(0,K.jsx)(`input`,{"aria-label":`Register target ${t}`,checked:r,id:`register-target-${t}`,onChange:()=>v(t),type:`checkbox`}),(0,K.jsxs)(`label`,{className:`flex flex-1 items-center gap-2`,htmlFor:`register-target-${t}`,children:[(0,K.jsx)(`span`,{className:`font-mono`,children:t}),i&&(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,i,`)`]}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e.State?.Name??``})]}),r&&(0,K.jsx)(f,{"aria-label":`Port override for ${t}`,className:`w-24`,onChange:e=>b(t,e.target.value),placeholder:String(a),value:n?.port??``})]},t)})}),t[9]=a,t[10]=i,t[11]=u,t[12]=T):T=t[12];let P;t[13]===p?P=t[14]:(P=p&&(0,K.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:p}),t[13]=p,t[14]=P);let F;t[15]===o?F=t[16]:(F=(0,K.jsx)(j,{disabled:o,children:`Cancel`}),t[15]=o,t[16]=F);let I=o?`Registering…`:`Register`,L;t[17]!==S||t[18]!==o||t[19]!==I?(L=(0,K.jsx)(k,{disabled:o,onClick:S,children:I}),t[17]=S,t[18]=o,t[19]=I,t[20]=L):L=t[20];let R;t[21]!==L||t[22]!==F?(R=(0,K.jsxs)(A,{children:[F,L]}),t[21]=L,t[22]=F,t[23]=R):R=t[23];let z;t[24]!==R||t[25]!==w||t[26]!==T||t[27]!==P?(z=(0,K.jsxs)(D,{className:`sm:max-w-lg`,children:[w,T,P,R]}),t[24]=R,t[25]=w,t[26]=T,t[27]=P,t[28]=z):z=t[28];let B;return t[29]!==r||t[30]!==n||t[31]!==z?(B=(0,K.jsx)(N,{onOpenChange:r,open:n,children:z}),t[29]=r,t[30]=n,t[31]=z,t[32]=B):B=t[32],B}function Y(e){let[,t]=e;return t.checked&&t!==void 0}var X=5e3,Z=new Set([`healthy`]),Q=new Set([`unhealthy`,`unavailable`]),$=new Set([`initial`,`draining`]);function ee(e){return e&&Z.has(e)?`bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100`:e&&Q.has(e)?`bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100`:e&&$.has(e)?`bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100`:`bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100`}function te(e){return`${e.Id??``}:${e.Port??``}`}function ne({targetGroupArn:e,vpcId:t,defaultPort:n,isActive:r}){let{data:o}=a(p),{data:c,isLoading:l,error:f}=i({...b(e),refetchInterval:r?X:!1,refetchIntervalInBackground:!1}),m=_(),h=g(),[v,y]=(0,G.useState)(!1),[x,S]=(0,G.useState)(),C=(o.Reservations?.flatMap(e=>e.Instances??[])??[]).filter(e=>e.VpcId===t&&e.State?.Name!==`terminated`),T=c?.TargetHealthDescriptions??[];return(0,K.jsxs)(`div`,{className:`space-y-3`,children:[m.error&&(0,K.jsx)(w,{error:m.error,msg:`Failed to register targets`}),h.error&&(0,K.jsx)(w,{error:h.error,msg:`Failed to deregister target`}),f&&(0,K.jsx)(w,{error:f,msg:`Failed to load target health`}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l?`Loading target health…`:`${T.length} target${T.length===1?``:`s`}`}),(0,K.jsx)(d,{onClick:()=>y(!0),size:`sm`,children:`Register targets`})]}),T.length===0?(0,K.jsx)(`p`,{className:`text-muted-foreground`,children:`No targets registered.`}):(0,K.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,K.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Target`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Port`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`AZ`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Health`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Reason`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Description`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,K.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,K.jsx)(`tbody`,{children:T.map(e=>{let t=e.Target??{Id:``},n=e.TargetHealth?.State;return(0,K.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,K.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:t.Id??``}),(0,K.jsx)(`td`,{className:`px-4 py-2`,children:t.Port??``}),(0,K.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:t.AvailabilityZone??``}),(0,K.jsx)(`td`,{className:`px-4 py-2`,children:(0,K.jsx)(`span`,{className:s(`rounded-full px-2 py-0.5 text-xs`,ee(n)),children:n??`unknown`})}),(0,K.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:e.TargetHealth?.Reason??``}),(0,K.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:e.TargetHealth?.Description??``}),(0,K.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,K.jsx)(d,{"aria-label":`Deregister ${t.Id}`,onClick:()=>S(t),size:`sm`,variant:`ghost`,children:(0,K.jsx)(u,{className:`size-4`})})})]},te(t))})})]})}),(0,K.jsx)(J,{defaultPort:n,instances:C,isPending:m.isPending,onConfirm:async t=>{try{await m.mutateAsync({targetGroupArn:e,targets:t}),y(!1)}catch{}},onOpenChange:y,open:v}),(0,K.jsx)(P,{description:x?`Deregister ${x.Id}${x.Port?`:${x.Port}`:``} from this target group?`:``,isPending:h.isPending,onConfirm:async()=>{if(x?.Id)try{await h.mutateAsync({targetGroupArn:e,targets:[{id:x.Id,port:x.Port}]})}finally{S(void 0)}},onOpenChange:e=>!e&&S(void 0),open:x!==void 0,title:`Deregister target`})]})}function re({arn:e}){let t=o(),{data:n}=a(x(e)),{data:r}=a(y(e)),{data:i}=a(S([e])),s=h(),c=v(),f=m(),[p,g]=(0,G.useState)(!1),[_,b]=(0,G.useState)(`overview`),C=n.TargetGroups?.[0];if(!C?.TargetGroupArn)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(l,{to:`/ec2/describe-target-groups`,children:`Back to target groups`}),(0,K.jsx)(`p`,{className:`text-muted-foreground`,children:`Target group not found.`})]});let E=async()=>{try{await s.mutateAsync(e),t({to:`/ec2/describe-target-groups`})}finally{g(!1)}},D=r.Attributes??[],O=i?.TagDescriptions?.find(t=>t.ResourceArn===e)?.Tags??[];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(l,{to:`/ec2/describe-target-groups`,children:`Back to target groups`}),s.error&&(0,K.jsx)(w,{error:s.error,msg:`Failed to delete target group`}),(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsx)(T,{actions:(0,K.jsxs)(d,{onClick:()=>g(!0),size:`sm`,variant:`destructive`,children:[(0,K.jsx)(u,{className:`size-4`}),`Delete`]}),subtitle:`Target Group Details`,title:C.TargetGroupName??C.TargetGroupArn}),(0,K.jsxs)(U,{onValueChange:b,value:_,children:[(0,K.jsxs)(V,{children:[(0,K.jsx)(B,{value:`overview`,children:`Overview`}),(0,K.jsx)(B,{value:`targets`,children:`Targets`}),(0,K.jsx)(B,{value:`health-checks`,children:`Health checks`}),(0,K.jsx)(B,{value:`attributes`,children:`Attributes`}),(0,K.jsx)(B,{value:`tags`,children:`Tags`})]}),(0,K.jsx)(H,{value:`overview`,children:(0,K.jsxs)(F,{children:[(0,K.jsx)(F.Header,{children:`Target group`}),(0,K.jsxs)(F.Content,{children:[(0,K.jsx)(I,{label:`ARN`,value:C.TargetGroupArn}),(0,K.jsx)(I,{label:`Protocol`,value:C.Protocol}),(0,K.jsx)(I,{label:`Port`,value:C.Port?.toString()}),(0,K.jsx)(I,{label:`VPC`,value:C.VpcId}),(0,K.jsx)(I,{label:`Target type`,value:C.TargetType}),(0,K.jsx)(I,{label:`Protocol version`,value:C.ProtocolVersion}),(0,K.jsx)(I,{label:`IP address type`,value:C.IpAddressType})]})]})}),(0,K.jsx)(H,{value:`targets`,children:(0,K.jsx)(ne,{defaultPort:C.Port??80,isActive:_===`targets`,targetGroupArn:C.TargetGroupArn,vpcId:C.VpcId})}),(0,K.jsxs)(H,{value:`health-checks`,children:[(0,K.jsx)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:`Health-check settings are set at creation time. Editing lands in a future enhancement.`}),(0,K.jsxs)(F,{children:[(0,K.jsx)(F.Header,{children:`Health check`}),(0,K.jsxs)(F.Content,{children:[(0,K.jsx)(I,{label:`Enabled`,value:C.HealthCheckEnabled===void 0?void 0:String(C.HealthCheckEnabled)}),(0,K.jsx)(I,{label:`Protocol`,value:C.HealthCheckProtocol}),(0,K.jsx)(I,{label:`Path`,value:C.HealthCheckPath}),(0,K.jsx)(I,{label:`Port`,value:C.HealthCheckPort}),(0,K.jsx)(I,{label:`Interval (s)`,value:C.HealthCheckIntervalSeconds?.toString()}),(0,K.jsx)(I,{label:`Timeout (s)`,value:C.HealthCheckTimeoutSeconds?.toString()}),(0,K.jsx)(I,{label:`Healthy threshold`,value:C.HealthyThresholdCount?.toString()}),(0,K.jsx)(I,{label:`Unhealthy threshold`,value:C.UnhealthyThresholdCount?.toString()}),(0,K.jsx)(I,{label:`Matcher (HTTP codes)`,value:C.Matcher?.HttpCode??C.Matcher?.GrpcCode})]})]})]}),(0,K.jsx)(H,{value:`attributes`,children:(0,K.jsx)(R,{attributes:D,error:c.error,isPending:c.isPending,isSuccess:c.isSuccess,onSubmit:t=>{c.mutate({targetGroupArn:e,attributes:t})},specs:L})}),(0,K.jsx)(H,{value:`tags`,children:(0,K.jsx)(z,{error:f.error,isPending:f.isPending,isSuccess:f.isSuccess,onSubmit:t=>f.mutate({resourceArn:e,tags:t,initialKeys:O.map(e=>e.Key??``).filter(e=>e.length>0)}),tags:O})})]})]}),(0,K.jsx)(P,{description:`Are you sure you want to delete target group "${C.TargetGroupName??C.TargetGroupArn}"? This action cannot be undone.`,isPending:s.isPending,onConfirm:E,onOpenChange:g,open:p,title:`Delete Target Group`})]})}function ie(){let e=(0,W.c)(2),{id:t}=C.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,K.jsx)(re,{arn:n}),e[0]=n,e[1]=r),r}export{ie as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./useNavigate.js";import{Xt as s,nn as c}from"./cluster-config.js";import{t as l}from"./back-link.js";import{t as u}from"./trash-2.js";import{t as d}from"./button.js";import{t as f}from"./input.js";import{l as p}from"./ec2.js";import{_ as m,c as h,l as g,m as _,p as v}from"./elbv2.js";import{c as y,d as b,l as x,s as S}from"./elbv22.js";import{t as C}from"./_id14.js";import{t as w}from"./error-banner.js";import{t as T}from"./page-heading.js";import{a as E,i as D,l as O,n as k,o as A,r as j,s as M,t as N}from"./alert-dialog.js";import{t as P}from"./delete-confirmation-dialog.js";import{n as F,t as I}from"./detail-row.js";import{r as L,t as R}from"./attributes-editor.js";import{t as z}from"./tags-editor.js";import{i as B,n as V,r as H,t as U}from"./tabs.js";var W=r(),G=e(n(),1),K=t();function q(e){let t=e.trim();if(t===``)return;let n=Number(t);if(!(!Number.isInteger(n)||n<1||n>65535))return n}function J(e){let t=(0,W.c)(33),{open:n,onOpenChange:r,instances:i,defaultPort:a,isPending:o,onConfirm:s}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={},t[0]=l):l=t[0];let[u,d]=(0,G.useState)(l),[p,m]=(0,G.useState)(),[h,g]=(0,G.useState)(n);n!==h&&(g(n),n||(d({}),m(void 0)));let _;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{d(t=>{let n=t[e];return n?.checked?{...t,[e]:{...n,checked:!1}}:{...t,[e]:{checked:!0,port:n?.port??``}}})},t[1]=_):_=t[1];let v=_,y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=(e,t)=>{d(n=>({...n,[e]:{checked:n[e]?.checked??!0,port:t}}))},t[2]=y):y=t[2];let b=y,x;t[3]!==s||t[4]!==u?(x=()=>{let e=Object.entries(u).filter(Y);if(e.length===0){m(`Select at least one instance.`);return}let t=[];for(let[n,r]of e){if(r.port.trim()===``){t.push({id:n});continue}let e=q(r.port);if(e===void 0){m(`Port for ${n} must be an integer between 1 and 65535.`);return}t.push({id:n,port:e})}m(void 0),s(t)},t[3]=s,t[4]=u,t[5]=x):x=t[5];let S=x,C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(O,{children:`Register targets`}),t[6]=C):C=t[6];let w;t[7]===a?w=t[8]:(w=(0,K.jsxs)(M,{children:[C,(0,K.jsxs)(E,{children:[`Select instances to register. Leave port blank to use the target group port (`,a,`).`]})]}),t[7]=a,t[8]=w);let T;t[9]!==a||t[10]!==i||t[11]!==u?(T=i.length===0?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No instances available in this VPC.`}):(0,K.jsx)(`div`,{className:`max-h-72 space-y-1 overflow-y-auto`,children:i.map(e=>{let t=e.InstanceId??``,n=u[t],r=n?.checked??!1,i=c(e.Tags);return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded px-1 py-1 text-xs hover:bg-accent`,children:[(0,K.jsx)(`input`,{"aria-label":`Register target ${t}`,checked:r,id:`register-target-${t}`,onChange:()=>{v(t)},type:`checkbox`}),(0,K.jsxs)(`label`,{className:`flex flex-1 items-center gap-2`,htmlFor:`register-target-${t}`,children:[(0,K.jsx)(`span`,{className:`font-mono`,children:t}),i&&(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,i,`)`]}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e.State?.Name??``})]}),r&&(0,K.jsx)(f,{"aria-label":`Port override for ${t}`,className:`w-24`,onChange:e=>{b(t,e.target.value)},placeholder:String(a),value:n?.port??``})]},t)})}),t[9]=a,t[10]=i,t[11]=u,t[12]=T):T=t[12];let P;t[13]===p?P=t[14]:(P=p&&(0,K.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:p}),t[13]=p,t[14]=P);let F;t[15]===o?F=t[16]:(F=(0,K.jsx)(j,{disabled:o,children:`Cancel`}),t[15]=o,t[16]=F);let I=o?`Registering…`:`Register`,L;t[17]!==S||t[18]!==o||t[19]!==I?(L=(0,K.jsx)(k,{disabled:o,onClick:S,children:I}),t[17]=S,t[18]=o,t[19]=I,t[20]=L):L=t[20];let R;t[21]!==L||t[22]!==F?(R=(0,K.jsxs)(A,{children:[F,L]}),t[21]=L,t[22]=F,t[23]=R):R=t[23];let z;t[24]!==R||t[25]!==w||t[26]!==T||t[27]!==P?(z=(0,K.jsxs)(D,{className:`sm:max-w-lg`,children:[w,T,P,R]}),t[24]=R,t[25]=w,t[26]=T,t[27]=P,t[28]=z):z=t[28];let B;return t[29]!==r||t[30]!==n||t[31]!==z?(B=(0,K.jsx)(N,{onOpenChange:r,open:n,children:z}),t[29]=r,t[30]=n,t[31]=z,t[32]=B):B=t[32],B}function Y(e){let[,t]=e;return t.checked&&t!==void 0}var X=5e3,Z=new Set([`healthy`]),Q=new Set([`unhealthy`,`unavailable`]),$=new Set([`initial`,`draining`]);function ee(e){return e&&Z.has(e)?`bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100`:e&&Q.has(e)?`bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100`:e&&$.has(e)?`bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100`:`bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100`}function te(e){return`${e.Id??``}:${e.Port??``}`}function ne({targetGroupArn:e,vpcId:t,defaultPort:n,isActive:r}){let{data:o}=a(p),{data:c,isLoading:l,error:f}=i({...b(e),refetchInterval:r?X:!1,refetchIntervalInBackground:!1}),m=_(),h=g(),[v,y]=(0,G.useState)(!1),[x,S]=(0,G.useState)(),C=(o.Reservations?.flatMap(e=>e.Instances??[])??[]).filter(e=>e.VpcId===t&&e.State?.Name!==`terminated`),T=c?.TargetHealthDescriptions??[];return(0,K.jsxs)(`div`,{className:`space-y-3`,children:[m.error&&(0,K.jsx)(w,{error:m.error,msg:`Failed to register targets`}),h.error&&(0,K.jsx)(w,{error:h.error,msg:`Failed to deregister target`}),f&&(0,K.jsx)(w,{error:f,msg:`Failed to load target health`}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l?`Loading target health…`:`${T.length} target${T.length===1?``:`s`}`}),(0,K.jsx)(d,{onClick:()=>{y(!0)},size:`sm`,children:`Register targets`})]}),T.length===0?(0,K.jsx)(`p`,{className:`text-muted-foreground`,children:`No targets registered.`}):(0,K.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,K.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Target`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Port`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`AZ`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Health`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Reason`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Description`}),(0,K.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,K.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,K.jsx)(`tbody`,{children:T.map(e=>{let t=e.Target??{Id:``},n=e.TargetHealth?.State;return(0,K.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,K.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:t.Id??``}),(0,K.jsx)(`td`,{className:`px-4 py-2`,children:t.Port??``}),(0,K.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:t.AvailabilityZone??``}),(0,K.jsx)(`td`,{className:`px-4 py-2`,children:(0,K.jsx)(`span`,{className:s(`rounded-full px-2 py-0.5 text-xs`,ee(n)),children:n??`unknown`})}),(0,K.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:e.TargetHealth?.Reason??``}),(0,K.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:e.TargetHealth?.Description??``}),(0,K.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,K.jsx)(d,{"aria-label":`Deregister ${t.Id}`,onClick:()=>{S(t)},size:`sm`,variant:`ghost`,children:(0,K.jsx)(u,{className:`size-4`})})})]},te(t))})})]})}),(0,K.jsx)(J,{defaultPort:n,instances:C,isPending:m.isPending,onConfirm:async t=>{try{await m.mutateAsync({targetGroupArn:e,targets:t}),y(!1)}catch{}},onOpenChange:y,open:v}),(0,K.jsx)(P,{description:x?`Deregister ${x.Id}${x.Port?`:${x.Port}`:``} from this target group?`:``,isPending:h.isPending,onConfirm:async()=>{if(x?.Id)try{await h.mutateAsync({targetGroupArn:e,targets:[{id:x.Id,port:x.Port}]})}finally{S(void 0)}},onOpenChange:e=>{e||S(void 0)},open:x!==void 0,title:`Deregister target`})]})}function re({arn:e}){let t=o(),{data:n}=a(x(e)),{data:r}=a(y(e)),{data:i}=a(S([e])),s=h(),c=v(),f=m(),[p,g]=(0,G.useState)(!1),[_,b]=(0,G.useState)(`overview`),C=n.TargetGroups?.[0];if(!C?.TargetGroupArn)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(l,{to:`/ec2/describe-target-groups`,children:`Back to target groups`}),(0,K.jsx)(`p`,{className:`text-muted-foreground`,children:`Target group not found.`})]});let E=async()=>{try{await s.mutateAsync(e),t({to:`/ec2/describe-target-groups`})}finally{g(!1)}},D=r.Attributes??[],O=i?.TagDescriptions?.find(t=>t.ResourceArn===e)?.Tags??[];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(l,{to:`/ec2/describe-target-groups`,children:`Back to target groups`}),s.error&&(0,K.jsx)(w,{error:s.error,msg:`Failed to delete target group`}),(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsx)(T,{actions:(0,K.jsxs)(d,{onClick:()=>{g(!0)},size:`sm`,variant:`destructive`,children:[(0,K.jsx)(u,{className:`size-4`}),`Delete`]}),subtitle:`Target Group Details`,title:C.TargetGroupName??C.TargetGroupArn}),(0,K.jsxs)(U,{onValueChange:b,value:_,children:[(0,K.jsxs)(V,{children:[(0,K.jsx)(B,{value:`overview`,children:`Overview`}),(0,K.jsx)(B,{value:`targets`,children:`Targets`}),(0,K.jsx)(B,{value:`health-checks`,children:`Health checks`}),(0,K.jsx)(B,{value:`attributes`,children:`Attributes`}),(0,K.jsx)(B,{value:`tags`,children:`Tags`})]}),(0,K.jsx)(H,{value:`overview`,children:(0,K.jsxs)(F,{children:[(0,K.jsx)(F.Header,{children:`Target group`}),(0,K.jsxs)(F.Content,{children:[(0,K.jsx)(I,{label:`ARN`,value:C.TargetGroupArn}),(0,K.jsx)(I,{label:`Protocol`,value:C.Protocol}),(0,K.jsx)(I,{label:`Port`,value:C.Port?.toString()}),(0,K.jsx)(I,{label:`VPC`,value:C.VpcId}),(0,K.jsx)(I,{label:`Target type`,value:C.TargetType}),(0,K.jsx)(I,{label:`Protocol version`,value:C.ProtocolVersion}),(0,K.jsx)(I,{label:`IP address type`,value:C.IpAddressType})]})]})}),(0,K.jsx)(H,{value:`targets`,children:(0,K.jsx)(ne,{defaultPort:C.Port??80,isActive:_===`targets`,targetGroupArn:C.TargetGroupArn,vpcId:C.VpcId})}),(0,K.jsxs)(H,{value:`health-checks`,children:[(0,K.jsx)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:`Health-check settings are set at creation time. Editing lands in a future enhancement.`}),(0,K.jsxs)(F,{children:[(0,K.jsx)(F.Header,{children:`Health check`}),(0,K.jsxs)(F.Content,{children:[(0,K.jsx)(I,{label:`Enabled`,value:C.HealthCheckEnabled===void 0?void 0:String(C.HealthCheckEnabled)}),(0,K.jsx)(I,{label:`Protocol`,value:C.HealthCheckProtocol}),(0,K.jsx)(I,{label:`Path`,value:C.HealthCheckPath}),(0,K.jsx)(I,{label:`Port`,value:C.HealthCheckPort}),(0,K.jsx)(I,{label:`Interval (s)`,value:C.HealthCheckIntervalSeconds?.toString()}),(0,K.jsx)(I,{label:`Timeout (s)`,value:C.HealthCheckTimeoutSeconds?.toString()}),(0,K.jsx)(I,{label:`Healthy threshold`,value:C.HealthyThresholdCount?.toString()}),(0,K.jsx)(I,{label:`Unhealthy threshold`,value:C.UnhealthyThresholdCount?.toString()}),(0,K.jsx)(I,{label:`Matcher (HTTP codes)`,value:C.Matcher?.HttpCode??C.Matcher?.GrpcCode})]})]})]}),(0,K.jsx)(H,{value:`attributes`,children:(0,K.jsx)(R,{attributes:D,error:c.error,isPending:c.isPending,isSuccess:c.isSuccess,onSubmit:t=>{c.mutate({targetGroupArn:e,attributes:t})},specs:L})}),(0,K.jsx)(H,{value:`tags`,children:(0,K.jsx)(z,{error:f.error,isPending:f.isPending,isSuccess:f.isSuccess,onSubmit:t=>{f.mutate({resourceArn:e,tags:t,initialKeys:O.map(e=>e.Key??``).filter(e=>e.length>0)})},tags:O})})]})]}),(0,K.jsx)(P,{description:`Are you sure you want to delete target group "${C.TargetGroupName??C.TargetGroupArn}"? This action cannot be undone.`,isPending:s.isPending,onConfirm:E,onOpenChange:g,open:p,title:`Delete Target Group`})]})}function ie(){let e=(0,W.c)(2),{id:t}=C.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,K.jsx)(re,{arn:n}),e[0]=n,e[1]=r),r}export{ie as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id36.js b/spinifex/services/spinifexui/frontend/dist/assets/_id36.js index 1dbc81ff1..32b0edd2d 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id36.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id36.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o,nn as ee}from"./cluster-config.js";import{t as s}from"./createLucideIcon.js";import{t as c}from"./back-link.js";import{t as l}from"./camera.js";import{c as u,i as d,n as f,s as p,t as m}from"./select.js";import{t as h}from"./trash-2.js";import{n as g,t as _}from"./button.js";import{t as v}from"./input.js";import{k as te,l as ne}from"./ec2.js";import{H as re,R as ie,s as y}from"./ec22.js";import{t as b}from"./_id15.js";import{t as x}from"./error-banner.js";import{t as S}from"./page-heading.js";import{a as C,t as w}from"./field.js";import{a as T,i as E,l as D,n as O,o as k,r as A,s as j,t as M}from"./alert-dialog.js";import{t as ae}from"./delete-confirmation-dialog.js";import{n as N,t as P}from"./detail-row.js";import{t as F}from"./state-badge.js";var I=s(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),L=s(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),R=e(n()),z=t();function B(){let{id:e}=b.useParams(),t=a(),{data:n}=r(te(e)),{data:s}=r(ne),B=n.Volumes?.[0],V=ie(),H=y(),U=re(),[W,G]=(0,R.useState)(null),[K,q]=(0,R.useState)(``),[J,Y]=(0,R.useState)(``),[X,Z]=(0,R.useState)(!1),oe=s.Reservations?.flatMap(e=>e.Instances?.filter(e=>e.State?.Name===`running`)??[])??[],Q=B?.State===`available`&&(!B.Attachments||B.Attachments.length===0),$=()=>G(null);return B?.VolumeId?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(c,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),V.error&&(0,z.jsx)(x,{error:V.error,msg:`Failed to delete volume`}),H.error&&(0,z.jsx)(x,{error:H.error,msg:`Failed to attach volume`}),U.error&&(0,z.jsx)(x,{error:U.error,msg:`Failed to detach volume`}),(0,z.jsxs)(`div`,{className:`space-y-6`,children:[(0,z.jsx)(S,{actions:(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsxs)(_,{disabled:!Q,onClick:()=>G(`delete`),size:`sm`,variant:`destructive`,children:[(0,z.jsx)(h,{className:`size-4`}),`Delete`]}),Q?(0,z.jsx)(i,{className:g({variant:`outline`}),params:{id:B.VolumeId},to:`/ec2/modify-volume/$id`,children:`Resize Volume`}):(0,z.jsx)(_,{disabled:!0,variant:`outline`,children:`Resize Volume`}),Q?(0,z.jsxs)(_,{onClick:()=>G(`attach`),size:`sm`,variant:`outline`,children:[(0,z.jsx)(I,{className:`size-4`}),`Attach`]}):null,B.Attachments&&B.Attachments.length>0?(0,z.jsxs)(_,{onClick:()=>G(`detach`),size:`sm`,variant:`outline`,children:[(0,z.jsx)(L,{className:`size-4`}),`Detach`]}):null,(0,z.jsxs)(i,{className:g({variant:`outline`,size:`sm`}),search:{volumeId:B.VolumeId},to:`/ec2/create-snapshot`,children:[(0,z.jsx)(l,{className:`size-4`}),`Create Snapshot`]}),(0,z.jsx)(F,{state:B.State})]}),subtitle:`Volume Details`,title:B.VolumeId}),(0,z.jsxs)(N,{children:[(0,z.jsx)(N.Header,{children:`Volume Information`}),(0,z.jsxs)(N.Content,{children:[(0,z.jsx)(P,{label:`Volume ID`,value:B.VolumeId}),(0,z.jsx)(P,{label:`Size`,value:`${B.Size} GiB`}),(0,z.jsx)(P,{label:`Volume Type`,value:B.VolumeType}),(0,z.jsx)(P,{label:`State`,value:B.State}),(0,z.jsx)(P,{label:`Availability Zone`,value:B.AvailabilityZone}),(0,z.jsx)(P,{label:`Create Time`,value:o(B.CreateTime)}),(0,z.jsx)(P,{label:`Encrypted`,value:B.Encrypted?`Yes`:`No`}),(0,z.jsx)(P,{label:`KMS Key ID`,value:B.KmsKeyId})]})]}),B.Attachments&&B.Attachments.length>0&&(0,z.jsxs)(N,{children:[(0,z.jsx)(N.Header,{children:`Attachments`}),B.Attachments.map(e=>(0,z.jsxs)(N.Content,{children:[(0,z.jsx)(P,{label:`Instance ID`,value:e.InstanceId?(0,z.jsx)(i,{className:`text-primary hover:underline`,params:{id:e.InstanceId},to:`/ec2/describe-instances/$id`,children:e.InstanceId}):void 0}),(0,z.jsx)(P,{label:`Device`,value:e.Device}),(0,z.jsx)(P,{label:`Status`,value:e.State}),(0,z.jsx)(P,{label:`Attach Time`,value:o(e.AttachTime)}),(0,z.jsx)(P,{label:`Delete on Termination`,value:e.DeleteOnTermination?`Yes`:`No`})]},e.InstanceId))]})]}),(0,z.jsx)(ae,{description:`Are you sure you want to delete the volume "${B.VolumeId}"? This action cannot be undone.`,isPending:V.isPending,onConfirm:async()=>{try{await V.mutateAsync(e),t({to:`/ec2/describe-volumes`})}finally{$()}},onOpenChange:e=>{e||$()},open:W===`delete`,title:`Delete Volume`}),(0,z.jsx)(M,{onOpenChange:e=>{e||($(),q(``),Y(``))},open:W===`attach`,children:(0,z.jsxs)(E,{children:[(0,z.jsxs)(j,{children:[(0,z.jsx)(D,{children:`Attach Volume`}),(0,z.jsx)(T,{children:`Attach this volume to a running instance.`})]}),(0,z.jsxs)(w,{children:[(0,z.jsx)(C,{children:(0,z.jsx)(`label`,{htmlFor:`attachInstance`,children:`Instance`})}),(0,z.jsxs)(m,{onValueChange:e=>q(e??``),value:K,children:[(0,z.jsx)(p,{className:`w-full`,id:`attachInstance`,children:(0,z.jsx)(u,{placeholder:`Select an instance`})}),(0,z.jsx)(f,{children:oe.map(e=>{let t=ee(e.Tags);return(0,z.jsxs)(d,{value:e.InstanceId??``,children:[e.InstanceId,t?` (${t})`:``]},e.InstanceId)})})]})]}),(0,z.jsxs)(w,{children:[(0,z.jsx)(C,{children:(0,z.jsx)(`label`,{htmlFor:`attachDevice`,children:`Device (optional)`})}),(0,z.jsx)(v,{id:`attachDevice`,onChange:e=>Y(e.target.value),placeholder:`/dev/sdf`,value:J})]}),(0,z.jsxs)(k,{children:[(0,z.jsx)(A,{children:`Cancel`}),(0,z.jsx)(O,{disabled:H.isPending||!K,onClick:async()=>{try{await H.mutateAsync({volumeId:e,instanceId:K,device:J||void 0}),$(),q(``),Y(``)}catch{}},children:H.isPending?`Attaching…`:`Attach`})]})]})}),(0,z.jsx)(M,{onOpenChange:e=>{e||($(),Z(!1))},open:W===`detach`,children:(0,z.jsxs)(E,{children:[(0,z.jsxs)(j,{children:[(0,z.jsx)(D,{children:`Detach Volume`}),(0,z.jsxs)(T,{children:[`Are you sure you want to detach the volume "`,B.VolumeId,`" from instance "`,B.Attachments?.[0]?.InstanceId,`"?`]})]}),(0,z.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,z.jsx)(`input`,{"aria-label":`Force detach`,checked:X,onChange:e=>Z(e.target.checked),type:`checkbox`}),`Force detach`]}),(0,z.jsxs)(k,{children:[(0,z.jsx)(A,{children:`Cancel`}),(0,z.jsx)(O,{disabled:U.isPending,onClick:async()=>{let t=B?.Attachments?.[0]?.InstanceId;try{await U.mutateAsync({volumeId:e,instanceId:t??void 0,force:X||void 0}),$(),Z(!1)}catch{}},children:U.isPending?`Detaching…`:`Detach`})]})]})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(c,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),(0,z.jsx)(`p`,{className:`text-muted-foreground`,children:`Volume not found.`})]})}export{B as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o,nn as ee}from"./cluster-config.js";import{t as s}from"./createLucideIcon.js";import{t as c}from"./back-link.js";import{t as l}from"./camera.js";import{c as u,i as d,n as f,s as p,t as m}from"./select.js";import{t as h}from"./trash-2.js";import{n as g,t as _}from"./button.js";import{t as v}from"./input.js";import{k as te,l as ne}from"./ec2.js";import{H as re,R as ie,s as y}from"./ec22.js";import{t as b}from"./_id15.js";import{t as x}from"./error-banner.js";import{t as S}from"./page-heading.js";import{a as C,t as w}from"./field.js";import{a as T,i as E,l as D,n as O,o as k,r as A,s as j,t as M}from"./alert-dialog.js";import{t as ae}from"./delete-confirmation-dialog.js";import{n as N,t as P}from"./detail-row.js";import{t as F}from"./state-badge.js";var I=s(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),L=s(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),R=e(n()),z=t();function B(){let{id:e}=b.useParams(),t=a(),{data:n}=r(te(e)),{data:s}=r(ne),B=n.Volumes?.[0],V=ie(),H=y(),U=re(),[W,G]=(0,R.useState)(null),[K,q]=(0,R.useState)(``),[J,Y]=(0,R.useState)(``),[X,Z]=(0,R.useState)(!1),oe=s.Reservations?.flatMap(e=>e.Instances?.filter(e=>e.State?.Name===`running`)??[])??[],Q=B?.State===`available`&&(!B.Attachments||B.Attachments.length===0),$=()=>{G(null)};return B?.VolumeId?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(c,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),V.error&&(0,z.jsx)(x,{error:V.error,msg:`Failed to delete volume`}),H.error&&(0,z.jsx)(x,{error:H.error,msg:`Failed to attach volume`}),U.error&&(0,z.jsx)(x,{error:U.error,msg:`Failed to detach volume`}),(0,z.jsxs)(`div`,{className:`space-y-6`,children:[(0,z.jsx)(S,{actions:(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsxs)(_,{disabled:!Q,onClick:()=>{G(`delete`)},size:`sm`,variant:`destructive`,children:[(0,z.jsx)(h,{className:`size-4`}),`Delete`]}),Q?(0,z.jsx)(i,{className:g({variant:`outline`}),params:{id:B.VolumeId},to:`/ec2/modify-volume/$id`,children:`Resize Volume`}):(0,z.jsx)(_,{disabled:!0,variant:`outline`,children:`Resize Volume`}),Q?(0,z.jsxs)(_,{onClick:()=>{G(`attach`)},size:`sm`,variant:`outline`,children:[(0,z.jsx)(I,{className:`size-4`}),`Attach`]}):null,B.Attachments&&B.Attachments.length>0?(0,z.jsxs)(_,{onClick:()=>{G(`detach`)},size:`sm`,variant:`outline`,children:[(0,z.jsx)(L,{className:`size-4`}),`Detach`]}):null,(0,z.jsxs)(i,{className:g({variant:`outline`,size:`sm`}),search:{volumeId:B.VolumeId},to:`/ec2/create-snapshot`,children:[(0,z.jsx)(l,{className:`size-4`}),`Create Snapshot`]}),(0,z.jsx)(F,{state:B.State})]}),subtitle:`Volume Details`,title:B.VolumeId}),(0,z.jsxs)(N,{children:[(0,z.jsx)(N.Header,{children:`Volume Information`}),(0,z.jsxs)(N.Content,{children:[(0,z.jsx)(P,{label:`Volume ID`,value:B.VolumeId}),(0,z.jsx)(P,{label:`Size`,value:`${B.Size} GiB`}),(0,z.jsx)(P,{label:`Volume Type`,value:B.VolumeType}),(0,z.jsx)(P,{label:`State`,value:B.State}),(0,z.jsx)(P,{label:`Availability Zone`,value:B.AvailabilityZone}),(0,z.jsx)(P,{label:`Create Time`,value:o(B.CreateTime)}),(0,z.jsx)(P,{label:`Encrypted`,value:B.Encrypted?`Yes`:`No`}),(0,z.jsx)(P,{label:`KMS Key ID`,value:B.KmsKeyId})]})]}),B.Attachments&&B.Attachments.length>0&&(0,z.jsxs)(N,{children:[(0,z.jsx)(N.Header,{children:`Attachments`}),B.Attachments.map(e=>(0,z.jsxs)(N.Content,{children:[(0,z.jsx)(P,{label:`Instance ID`,value:e.InstanceId?(0,z.jsx)(i,{className:`text-primary hover:underline`,params:{id:e.InstanceId},to:`/ec2/describe-instances/$id`,children:e.InstanceId}):void 0}),(0,z.jsx)(P,{label:`Device`,value:e.Device}),(0,z.jsx)(P,{label:`Status`,value:e.State}),(0,z.jsx)(P,{label:`Attach Time`,value:o(e.AttachTime)}),(0,z.jsx)(P,{label:`Delete on Termination`,value:e.DeleteOnTermination?`Yes`:`No`})]},e.InstanceId))]})]}),(0,z.jsx)(ae,{description:`Are you sure you want to delete the volume "${B.VolumeId}"? This action cannot be undone.`,isPending:V.isPending,onConfirm:async()=>{try{await V.mutateAsync(e),t({to:`/ec2/describe-volumes`})}finally{$()}},onOpenChange:e=>{e||$()},open:W===`delete`,title:`Delete Volume`}),(0,z.jsx)(M,{onOpenChange:e=>{e||($(),q(``),Y(``))},open:W===`attach`,children:(0,z.jsxs)(E,{children:[(0,z.jsxs)(j,{children:[(0,z.jsx)(D,{children:`Attach Volume`}),(0,z.jsx)(T,{children:`Attach this volume to a running instance.`})]}),(0,z.jsxs)(w,{children:[(0,z.jsx)(C,{children:(0,z.jsx)(`label`,{htmlFor:`attachInstance`,children:`Instance`})}),(0,z.jsxs)(m,{onValueChange:e=>{q(e??``)},value:K,children:[(0,z.jsx)(p,{className:`w-full`,id:`attachInstance`,children:(0,z.jsx)(u,{placeholder:`Select an instance`})}),(0,z.jsx)(f,{children:oe.map(e=>{let t=ee(e.Tags);return(0,z.jsxs)(d,{value:e.InstanceId??``,children:[e.InstanceId,t?` (${t})`:``]},e.InstanceId)})})]})]}),(0,z.jsxs)(w,{children:[(0,z.jsx)(C,{children:(0,z.jsx)(`label`,{htmlFor:`attachDevice`,children:`Device (optional)`})}),(0,z.jsx)(v,{id:`attachDevice`,onChange:e=>{Y(e.target.value)},placeholder:`/dev/sdf`,value:J})]}),(0,z.jsxs)(k,{children:[(0,z.jsx)(A,{children:`Cancel`}),(0,z.jsx)(O,{disabled:H.isPending||!K,onClick:async()=>{try{await H.mutateAsync({volumeId:e,instanceId:K,device:J||void 0}),$(),q(``),Y(``)}catch{}},children:H.isPending?`Attaching…`:`Attach`})]})]})}),(0,z.jsx)(M,{onOpenChange:e=>{e||($(),Z(!1))},open:W===`detach`,children:(0,z.jsxs)(E,{children:[(0,z.jsxs)(j,{children:[(0,z.jsx)(D,{children:`Detach Volume`}),(0,z.jsxs)(T,{children:[`Are you sure you want to detach the volume "`,B.VolumeId,`" from instance "`,B.Attachments?.[0]?.InstanceId,`"?`]})]}),(0,z.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,z.jsx)(`input`,{"aria-label":`Force detach`,checked:X,onChange:e=>{Z(e.target.checked)},type:`checkbox`}),`Force detach`]}),(0,z.jsxs)(k,{children:[(0,z.jsx)(A,{children:`Cancel`}),(0,z.jsx)(O,{disabled:U.isPending,onClick:async()=>{let t=B?.Attachments?.[0]?.InstanceId;try{await U.mutateAsync({volumeId:e,instanceId:t??void 0,force:X||void 0}),$(),Z(!1)}catch{}},children:U.isPending?`Detaching…`:`Detach`})]})]})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(c,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),(0,z.jsx)(`p`,{className:`text-muted-foreground`,children:`Volume not found.`})]})}export{B as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id37.js b/spinifex/services/spinifexui/frontend/dist/assets/_id37.js index 879ca2929..e92570b9b 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id37.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id37.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{t as i}from"./back-link.js";import{t as a}from"./input.js";import{k as o}from"./ec2.js";import{X as s}from"./ec22.js";import{t as c}from"./_id16.js";import{i as l,t as u}from"./zod.js";import{t as d}from"./error-banner.js";import{t as f}from"./form-actions.js";import{t as p}from"./page-heading.js";import{a as m,r as h,t as g}from"./field.js";import{y as _}from"./ec23.js";var v=t(),y=e();function b(){let e=(0,v.c)(53),{id:t}=c.useParams(),b=r(),x;e[0]===t?x=e[1]:(x=o(t),e[0]=t,e[1]=x);let{data:S}=n(x),C=S.Volumes?.[0],w=C?.VolumeId,T=s(),E=C?.Size??1,D;e[2]===E?D=e[3]:(D=u(_.refine(e=>e.size>E,{message:`New size must be greater than current size (${E} GiB)`,path:[`size`]})),e[2]=E,e[3]=D);let O;e[4]===E?O=e[5]:(O={size:E},e[4]=E,e[5]=O);let k;e[6]!==D||e[7]!==O?(k={resolver:D,defaultValues:O},e[6]=D,e[7]=O,e[8]=k):k=e[8];let{handleSubmit:A,register:j,formState:M}=l(k),{errors:N,isSubmitting:P}=M;if(!w){let t;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),(0,y.jsx)(`p`,{className:`text-muted-foreground`,children:`Volume not found.`})]}),e[9]=t):t=e[9],t}let F;e[10]!==T||e[11]!==b||e[12]!==w?(F=async e=>{await T.mutateAsync({...e,volumeId:w}),b({to:`/ec2/describe-volumes/$id`,params:{id:w}})},e[10]=T,e[11]=b,e[12]=w,e[13]=F):F=e[13];let I=F,L,R;e[14]===w?(L=e[15],R=e[16]):(L=(0,y.jsx)(i,{params:{id:w},to:`/ec2/describe-volumes/$id`,children:`Back to volume`}),R=(0,y.jsx)(p,{subtitle:w,title:`Resize Volume`}),e[14]=w,e[15]=L,e[16]=R);let z;e[17]===T.error?z=e[18]:(z=T.error&&(0,y.jsx)(d,{error:T.error,msg:`Failed to resize volume`}),e[17]=T.error,e[18]=z);let B;e[19]!==A||e[20]!==I?(B=A(I),e[19]=A,e[20]=I,e[21]=B):B=e[21];let V;e[22]===E?V=e[23]:(V=(0,y.jsx)(`div`,{className:`space-y-2`,children:(0,y.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Current size: `,E,` GiB`]})}),e[22]=E,e[23]=V);let H;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,y.jsx)(m,{children:(0,y.jsx)(`label`,{htmlFor:`size`,children:`New size (GiB)`})}),e[24]=H):H=e[24];let U=!!N.size,W=E+1,G;e[25]===j?G=e[26]:(G=j(`size`,{valueAsNumber:!0}),e[25]=j,e[26]=G);let K;e[27]!==U||e[28]!==W||e[29]!==G?(K=(0,y.jsx)(a,{"aria-invalid":U,id:`size`,min:W,type:`number`,...G}),e[27]=U,e[28]=W,e[29]=G,e[30]=K):K=e[30];let q;e[31]===N.size?q=e[32]:(q=(0,y.jsx)(h,{errors:[N.size]}),e[31]=N.size,e[32]=q);let J;e[33]!==K||e[34]!==q?(J=(0,y.jsxs)(g,{children:[H,K,q]}),e[33]=K,e[34]=q,e[35]=J):J=e[35];let Y;e[36]!==b||e[37]!==w?(Y=async()=>await b({to:`/ec2/describe-volumes/$id`,params:{id:w}}),e[36]=b,e[37]=w,e[38]=Y):Y=e[38];let X;e[39]!==P||e[40]!==T.isPending||e[41]!==Y?(X=(0,y.jsx)(f,{isPending:T.isPending,isSubmitting:P,onCancel:Y,pendingLabel:`Resizing\\u2026`,submitLabel:`Resize Volume`}),e[39]=P,e[40]=T.isPending,e[41]=Y,e[42]=X):X=e[42];let Z;e[43]!==V||e[44]!==J||e[45]!==X||e[46]!==B?(Z=(0,y.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:B,children:[V,J,X]}),e[43]=V,e[44]=J,e[45]=X,e[46]=B,e[47]=Z):Z=e[47];let Q;return e[48]!==Z||e[49]!==L||e[50]!==R||e[51]!==z?(Q=(0,y.jsxs)(y.Fragment,{children:[L,R,z,Z]}),e[48]=Z,e[49]=L,e[50]=R,e[51]=z,e[52]=Q):Q=e[52],Q}export{b as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{t as i}from"./back-link.js";import{t as a}from"./input.js";import{k as o}from"./ec2.js";import{X as s}from"./ec22.js";import{t as c}from"./_id16.js";import{i as l,t as u}from"./zod.js";import{t as d}from"./error-banner.js";import{t as f}from"./form-actions.js";import{t as p}from"./page-heading.js";import{a as m,r as h,t as g}from"./field.js";import{y as _}from"./ec23.js";var v=t(),y=e();function b(){let e=(0,v.c)(53),{id:t}=c.useParams(),b=r(),x;e[0]===t?x=e[1]:(x=o(t),e[0]=t,e[1]=x);let{data:S}=n(x),C=S.Volumes?.[0],w=C?.VolumeId,T=s(),E=C?.Size??1,D;e[2]===E?D=e[3]:(D=u(_.refine(e=>e.size>E,{message:`New size must be greater than current size (${E} GiB)`,path:[`size`]})),e[2]=E,e[3]=D);let O;e[4]===E?O=e[5]:(O={size:E},e[4]=E,e[5]=O);let k;e[6]!==D||e[7]!==O?(k={resolver:D,defaultValues:O},e[6]=D,e[7]=O,e[8]=k):k=e[8];let{handleSubmit:A,register:j,formState:M}=l(k),{errors:N,isSubmitting:P}=M;if(!w){let t;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),(0,y.jsx)(`p`,{className:`text-muted-foreground`,children:`Volume not found.`})]}),e[9]=t):t=e[9],t}let F;e[10]!==T||e[11]!==b||e[12]!==w?(F=async e=>{await T.mutateAsync({...e,volumeId:w}),b({to:`/ec2/describe-volumes/$id`,params:{id:w}})},e[10]=T,e[11]=b,e[12]=w,e[13]=F):F=e[13];let I=F,L,R;e[14]===w?(L=e[15],R=e[16]):(L=(0,y.jsx)(i,{params:{id:w},to:`/ec2/describe-volumes/$id`,children:`Back to volume`}),R=(0,y.jsx)(p,{subtitle:w,title:`Resize Volume`}),e[14]=w,e[15]=L,e[16]=R);let z;e[17]===T.error?z=e[18]:(z=T.error&&(0,y.jsx)(d,{error:T.error,msg:`Failed to resize volume`}),e[17]=T.error,e[18]=z);let B;e[19]!==A||e[20]!==I?(B=A(I),e[19]=A,e[20]=I,e[21]=B):B=e[21];let V;e[22]===E?V=e[23]:(V=(0,y.jsx)(`div`,{className:`space-y-2`,children:(0,y.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Current size: `,E,` GiB`]})}),e[22]=E,e[23]=V);let H;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,y.jsx)(m,{children:(0,y.jsx)(`label`,{htmlFor:`size`,children:`New size (GiB)`})}),e[24]=H):H=e[24];let U=!!N.size,W=E+1,G;e[25]===j?G=e[26]:(G=j(`size`,{valueAsNumber:!0}),e[25]=j,e[26]=G);let K;e[27]!==U||e[28]!==W||e[29]!==G?(K=(0,y.jsx)(a,{"aria-invalid":U,id:`size`,min:W,type:`number`,...G}),e[27]=U,e[28]=W,e[29]=G,e[30]=K):K=e[30];let q;e[31]===N.size?q=e[32]:(q=(0,y.jsx)(h,{errors:[N.size]}),e[31]=N.size,e[32]=q);let J;e[33]!==K||e[34]!==q?(J=(0,y.jsxs)(g,{children:[H,K,q]}),e[33]=K,e[34]=q,e[35]=J):J=e[35];let Y;e[36]!==b||e[37]!==w?(Y=async()=>{await b({to:`/ec2/describe-volumes/$id`,params:{id:w}})},e[36]=b,e[37]=w,e[38]=Y):Y=e[38];let X;e[39]!==P||e[40]!==T.isPending||e[41]!==Y?(X=(0,y.jsx)(f,{isPending:T.isPending,isSubmitting:P,onCancel:Y,pendingLabel:`Resizing\\u2026`,submitLabel:`Resize Volume`}),e[39]=P,e[40]=T.isPending,e[41]=Y,e[42]=X):X=e[42];let Z;e[43]!==V||e[44]!==J||e[45]!==X||e[46]!==B?(Z=(0,y.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:B,children:[V,J,X]}),e[43]=V,e[44]=J,e[45]=X,e[46]=B,e[47]=Z):Z=e[47];let Q;return e[48]!==Z||e[49]!==L||e[50]!==R||e[51]!==z?(Q=(0,y.jsxs)(y.Fragment,{children:[L,R,z,Z]}),e[48]=Z,e[49]=L,e[50]=R,e[51]=z,e[52]=Q):Q=e[52],Q}export{b as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id38.js b/spinifex/services/spinifexui/frontend/dist/assets/_id38.js index f4e58cade..4a908730a 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id38.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id38.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{O as u,j as d}from"./ec2.js";import{z as f}from"./ec22.js";import{t as p}from"./_id17.js";import{t as m}from"./error-banner.js";import{t as h}from"./page-heading.js";import{t as g}from"./delete-confirmation-dialog.js";import{n as _,t as v}from"./detail-row.js";import{t as y}from"./state-badge.js";var b=e(n()),x=t();function S(){let{id:e}=p.useParams(),t=a(),{data:n}=r(d(e)),{data:S}=r(u),C=n.Vpcs?.[0],w=f(),[T,E]=(0,b.useState)(!1),D=S.Subnets?.filter(t=>t.VpcId===e)??[],O=async()=>{try{await w.mutateAsync(e),t({to:`/ec2/describe-vpcs`})}finally{E(!1)}};if(!C?.VpcId)return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),(0,x.jsx)(`p`,{className:`text-muted-foreground`,children:`VPC not found.`})]});let k=o(C.Tags);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),w.error&&(0,x.jsx)(m,{error:w.error,msg:`Failed to delete VPC`}),(0,x.jsxs)(`div`,{className:`space-y-6`,children:[(0,x.jsx)(h,{actions:(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(l,{onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:[(0,x.jsx)(c,{className:`size-4`}),`Delete`]}),(0,x.jsx)(y,{state:C.State})]}),subtitle:`VPC Details`,title:k?`${C.VpcId} (${k})`:C.VpcId}),(0,x.jsxs)(_,{children:[(0,x.jsx)(_.Header,{children:`VPC Information`}),(0,x.jsxs)(_.Content,{children:[(0,x.jsx)(v,{label:`VPC ID`,value:C.VpcId}),(0,x.jsx)(v,{label:`State`,value:C.State}),(0,x.jsx)(v,{label:`CIDR Block`,value:C.CidrBlock}),(0,x.jsx)(v,{label:`Is Default`,value:C.IsDefault?`Yes`:`No`}),(0,x.jsx)(v,{label:`DHCP Options ID`,value:C.DhcpOptionsId}),(0,x.jsx)(v,{label:`Instance Tenancy`,value:C.InstanceTenancy}),(0,x.jsx)(v,{label:`Owner ID`,value:C.OwnerId})]})]}),D.length>0&&(0,x.jsxs)(_,{children:[(0,x.jsxs)(_.Header,{children:[`Subnets (`,D.length,`)`]}),D.map(e=>e.SubnetId?(0,x.jsxs)(_.Content,{children:[(0,x.jsx)(v,{label:`Subnet ID`,value:(0,x.jsx)(i,{className:`text-primary hover:underline`,params:{id:e.SubnetId},to:`/ec2/describe-subnets/$id`,children:e.SubnetId})}),(0,x.jsx)(v,{label:`CIDR Block`,value:e.CidrBlock}),(0,x.jsx)(v,{label:`Availability Zone`,value:e.AvailabilityZone}),(0,x.jsx)(v,{label:`State`,value:e.State})]},e.SubnetId):null)]})]}),(0,x.jsx)(g,{description:`Are you sure you want to delete the VPC "${C.VpcId}"? This action cannot be undone. The VPC must have no associated subnets or internet gateways.`,isPending:w.isPending,onConfirm:O,onOpenChange:E,open:T,title:`Delete VPC`})]})}export{S as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{nn as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{O as u,j as d}from"./ec2.js";import{z as f}from"./ec22.js";import{t as p}from"./_id17.js";import{t as m}from"./error-banner.js";import{t as h}from"./page-heading.js";import{t as g}from"./delete-confirmation-dialog.js";import{n as _,t as v}from"./detail-row.js";import{t as y}from"./state-badge.js";var b=e(n()),x=t();function S(){let{id:e}=p.useParams(),t=a(),{data:n}=r(d(e)),{data:S}=r(u),C=n.Vpcs?.[0],w=f(),[T,E]=(0,b.useState)(!1),D=S.Subnets?.filter(t=>t.VpcId===e)??[],O=async()=>{try{await w.mutateAsync(e),t({to:`/ec2/describe-vpcs`})}finally{E(!1)}};if(!C?.VpcId)return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),(0,x.jsx)(`p`,{className:`text-muted-foreground`,children:`VPC not found.`})]});let k=o(C.Tags);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),w.error&&(0,x.jsx)(m,{error:w.error,msg:`Failed to delete VPC`}),(0,x.jsxs)(`div`,{className:`space-y-6`,children:[(0,x.jsx)(h,{actions:(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(l,{onClick:()=>{E(!0)},size:`sm`,variant:`destructive`,children:[(0,x.jsx)(c,{className:`size-4`}),`Delete`]}),(0,x.jsx)(y,{state:C.State})]}),subtitle:`VPC Details`,title:k?`${C.VpcId} (${k})`:C.VpcId}),(0,x.jsxs)(_,{children:[(0,x.jsx)(_.Header,{children:`VPC Information`}),(0,x.jsxs)(_.Content,{children:[(0,x.jsx)(v,{label:`VPC ID`,value:C.VpcId}),(0,x.jsx)(v,{label:`State`,value:C.State}),(0,x.jsx)(v,{label:`CIDR Block`,value:C.CidrBlock}),(0,x.jsx)(v,{label:`Is Default`,value:C.IsDefault?`Yes`:`No`}),(0,x.jsx)(v,{label:`DHCP Options ID`,value:C.DhcpOptionsId}),(0,x.jsx)(v,{label:`Instance Tenancy`,value:C.InstanceTenancy}),(0,x.jsx)(v,{label:`Owner ID`,value:C.OwnerId})]})]}),D.length>0&&(0,x.jsxs)(_,{children:[(0,x.jsxs)(_.Header,{children:[`Subnets (`,D.length,`)`]}),D.map(e=>e.SubnetId?(0,x.jsxs)(_.Content,{children:[(0,x.jsx)(v,{label:`Subnet ID`,value:(0,x.jsx)(i,{className:`text-primary hover:underline`,params:{id:e.SubnetId},to:`/ec2/describe-subnets/$id`,children:e.SubnetId})}),(0,x.jsx)(v,{label:`CIDR Block`,value:e.CidrBlock}),(0,x.jsx)(v,{label:`Availability Zone`,value:e.AvailabilityZone}),(0,x.jsx)(v,{label:`State`,value:e.State})]},e.SubnetId):null)]})]}),(0,x.jsx)(g,{description:`Are you sure you want to delete the VPC "${C.VpcId}"? This action cannot be undone. The VPC must have no associated subnets or internet gateways.`,isPending:w.isPending,onConfirm:O,onOpenChange:E,open:T,title:`Delete VPC`})]})}export{S as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id39.js b/spinifex/services/spinifexui/frontend/dist/assets/_id39.js index 0f21a1d2a..4947e5c05 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id39.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id39.js @@ -13,5 +13,5 @@ import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}fro } ] }`;function te(e){let t=(0,L.c)(54),{repositoryName:n}=e,r;t[0]===n?r=t[1]:(r=p(n),t[0]=n,t[1]=r);let{data:a}=i(r),o=h(),s=v(),c=_(),[u,d]=(0,R.useState)(a??``),[f,m]=(0,R.useState)(a);a!==f&&(m(a),d(a??``));let g;t[2]!==u||t[3]!==o||t[4]!==n?(g=async function(){try{await o.mutateAsync({repositoryName:n,lifecyclePolicyText:u})}catch{}},t[2]=u,t[3]=o,t[4]=n,t[5]=g):g=t[5];let y=g,b;t[6]!==s||t[7]!==n?(b=async function(){try{await s.mutateAsync(n)}catch{}},t[6]=s,t[7]=n,t[8]=b):b=t[8];let S=b,C;t[9]!==c||t[10]!==n?(C=async function(){try{await c.mutateAsync(n)}catch{}},t[9]=c,t[10]=n,t[11]=C):C=t[11];let w=C,T;t[12]===u?T=t[13]:(T=u.trim(),t[12]=u,t[13]=T);let E=T,D;t[14]!==u||t[15]!==E.length?(D=E.length>0&&!x(u),t[14]=u,t[15]=E.length,t[16]=D):D=t[16];let O=D,k=o.error??s.error??c.error,A;t[17]===c.data?.previewResults?A=t[18]:(A=c.data?.previewResults??[],t[17]=c.data?.previewResults,t[18]=A);let j=A,M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,z.jsx)(`h2`,{className:`text-sm font-medium`,children:`Lifecycle policy`}),t[19]=M):M=t[19];let N=s.isPending||!a,P=s.isPending?`Deleting…`:`Delete`,F;t[20]!==S||t[21]!==P||t[22]!==N?(F=(0,z.jsx)(l,{disabled:N,onClick:S,size:`sm`,variant:`destructive`,children:P}),t[20]=S,t[21]=P,t[22]=N,t[23]=F):F=t[23];let I=c.isPending||!a,te=c.isPending?`Previewing…`:`Preview`,V;t[24]!==w||t[25]!==I||t[26]!==te?(V=(0,z.jsx)(l,{disabled:I,onClick:w,size:`sm`,variant:`outline`,children:te}),t[24]=w,t[25]=I,t[26]=te,t[27]=V):V=t[27];let H=o.isPending||E.length===0||O,U=o.isPending?`Saving…`:`Save`,W;t[28]!==y||t[29]!==H||t[30]!==U?(W=(0,z.jsx)(l,{disabled:H,onClick:y,size:`sm`,children:U}),t[28]=y,t[29]=H,t[30]=U,t[31]=W):W=t[31];let G;t[32]!==F||t[33]!==V||t[34]!==W?(G=(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[M,(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[F,V,W]})]}),t[32]=F,t[33]=V,t[34]=W,t[35]=G):G=t[35];let K;t[36]!==u||t[37]!==O?(K=(0,z.jsx)(ee,{className:`text-xs`,error:O,onChange:d,placeholder:B,rows:14,value:u}),t[36]=u,t[37]=O,t[38]=K):K=t[38];let q;t[39]===O?q=t[40]:(q=O&&(0,z.jsx)(`p`,{className:`mt-2 text-sm text-destructive`,children:`Lifecycle policy must be valid JSON.`}),t[39]=O,t[40]=q);let J;t[41]===k?J=t[42]:(J=k&&(0,z.jsx)(`p`,{className:`mt-2 text-sm text-destructive`,children:k.message}),t[41]=k,t[42]=J);let Y;t[43]!==G||t[44]!==K||t[45]!==q||t[46]!==J?(Y=(0,z.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[G,K,q,J]}),t[43]=G,t[44]=K,t[45]=q,t[46]=J,t[47]=Y):Y=t[47];let X;t[48]!==c.isSuccess||t[49]!==j?(X=c.isSuccess&&(0,z.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[(0,z.jsxs)(`h3`,{className:`mb-2 text-sm font-medium`,children:[`Preview: `,j.length,` image`,j.length===1?``:`s`,` would expire`]}),j.length>0?(0,z.jsx)(`div`,{className:`overflow-x-auto rounded-lg border`,children:(0,z.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Tags`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Digest`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pushed`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Rule`})]})}),(0,z.jsx)(`tbody`,{children:j.map(ne)})]})}):(0,z.jsx)(`p`,{className:`text-muted-foreground`,children:`No images match this policy.`})]}),t[48]=c.isSuccess,t[49]=j,t[50]=X):X=t[50];let Z;return t[51]!==Y||t[52]!==X?(Z=(0,z.jsxs)(`div`,{className:`space-y-4`,children:[Y,X]}),t[51]=Y,t[52]=X,t[53]=Z):Z=t[53],Z}function ne(e){return(0,z.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,z.jsx)(`td`,{className:`px-4 py-2`,children:e.imageTags&&e.imageTags.length>0?e.imageTags.join(`, `):``}),(0,z.jsxs)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:[e.imageDigest?.slice(0,19),`…`]}),(0,z.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:o(e.imagePushedAt)}),(0,z.jsx)(`td`,{className:`px-4 py-2`,children:e.appliedRulePriority})]},e.imageDigest)}function V(e){let t=(0,L.c)(38),{repositoryName:n}=e,r;t[0]===n?r=t[1]:(r=u(n),t[0]=n,t[1]=r);let{data:a}=i(r),o=g(),s=m(),[c,d]=(0,R.useState)(a??``),[f,p]=(0,R.useState)(a);a!==f&&(p(a),d(a??``));let h;t[2]!==c||t[3]!==n||t[4]!==o?(h=async function(){try{await o.mutateAsync({repositoryName:n,policyText:c})}catch{}},t[2]=c,t[3]=n,t[4]=o,t[5]=h):h=t[5];let _=h,v;t[6]!==s||t[7]!==n?(v=async function(){try{await s.mutateAsync(n)}catch{}},t[6]=s,t[7]=n,t[8]=v):v=t[8];let y=v,b;t[9]===c?b=t[10]:(b=c.trim(),t[9]=c,t[10]=b);let S=b,C;t[11]!==c||t[12]!==S.length?(C=S.length>0&&!x(c),t[11]=c,t[12]=S.length,t[13]=C):C=t[13];let w=C,T=o.error??s.error,E;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,z.jsx)(`h2`,{className:`text-sm font-medium`,children:`Repository policy`}),t[14]=E):E=t[14];let D=s.isPending||!a,O=s.isPending?`Deleting…`:`Delete`,k;t[15]!==y||t[16]!==D||t[17]!==O?(k=(0,z.jsx)(l,{disabled:D,onClick:y,size:`sm`,variant:`destructive`,children:O}),t[15]=y,t[16]=D,t[17]=O,t[18]=k):k=t[18];let A=o.isPending||S.length===0||w,j=o.isPending?`Saving…`:`Save`,M;t[19]!==_||t[20]!==A||t[21]!==j?(M=(0,z.jsx)(l,{disabled:A,onClick:_,size:`sm`,children:j}),t[19]=_,t[20]=A,t[21]=j,t[22]=M):M=t[22];let N;t[23]!==M||t[24]!==k?(N=(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[E,(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[k,M]})]}),t[23]=M,t[24]=k,t[25]=N):N=t[25];let P;t[26]!==c||t[27]!==w?(P=(0,z.jsx)(ee,{className:`text-xs`,error:w,onChange:d,placeholder:`No policy attached. Paste an IAM policy document to set one.`,rows:10,value:c}),t[26]=c,t[27]=w,t[28]=P):P=t[28];let F;t[29]===w?F=t[30]:(F=w&&(0,z.jsx)(`p`,{className:`mt-2 text-sm text-destructive`,children:`Policy must be valid JSON.`}),t[29]=w,t[30]=F);let I;t[31]===T?I=t[32]:(I=T&&(0,z.jsx)(`p`,{className:`mt-2 text-sm text-destructive`,children:T.message}),t[31]=T,t[32]=I);let B;return t[33]!==N||t[34]!==P||t[35]!==F||t[36]!==I?(B=(0,z.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[N,P,F,I]}),t[33]=N,t[34]=P,t[35]=F,t[36]=I,t[37]=B):B=t[37],B}function H(e){if(!e)return``;let t=e.indexOf(`/`);return t===-1?e:e.slice(0,t)}function U(e){let t=(0,L.c)(19),{repositoryName:n,repositoryUri:r}=e,[i,a]=(0,R.useState)(!1),o;t[0]===r?o=t[1]:(o=H(r),t[0]=r,t[1]=o);let s=o,u=r??`${s}/${n}`,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=c(),t[2]=d):d=t[2];let f=`aws ecr get-login-password --region ${d} | docker login --username AWS --password-stdin ${s}`,p=`docker build -t ${n} .`,m=`docker tag ${n}:latest ${u}:latest`,h=`docker push ${u}:latest`,g;t[3]!==f||t[4]!==p||t[5]!==m||t[6]!==h?(g=[f,p,m,h],t[3]=f,t[4]=p,t[5]=m,t[6]=h,t[7]=g):g=t[7];let _=g,v;t[8]===_?v=t[9]:(v=async function(){await navigator.clipboard.writeText(_.join(` -`)),a(!0),setTimeout(()=>a(!1),2e3)},t[8]=_,t[9]=v);let y=v,b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,z.jsx)(`h2`,{className:`text-sm font-medium`,children:`Push commands`}),t[10]=b):b=t[10];let x=i?`Copied`:`Copy`,S;t[11]!==y||t[12]!==x?(S=(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[b,(0,z.jsx)(l,{onClick:y,size:`sm`,variant:`outline`,children:x})]}),t[11]=y,t[12]=x,t[13]=S):S=t[13];let C=_.join(` -`),w;t[14]===C?w=t[15]:(w=(0,z.jsx)(`pre`,{className:`overflow-x-auto rounded bg-muted p-3 font-mono text-xs`,children:C}),t[14]=C,t[15]=w);let T;return t[16]!==S||t[17]!==w?(T=(0,z.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[S,w]}),t[16]=S,t[17]=w,t[18]=T):T=t[18],T}function W(e){let t=(0,L.c)(31),{repositoryName:n,repositoryUri:r,imageTagMutability:i}=e,a=y(),o=i===`IMMUTABLE`,s=o?`MUTABLE`:`IMMUTABLE`,c=o?`Make mutable`:`Make immutable`,u;t[0]!==s||t[1]!==a||t[2]!==n?(u=async function(){try{await a.mutateAsync({repositoryName:n,imageTagMutability:s})}catch{}},t[0]=s,t[1]=a,t[2]=n,t[3]=u):u=t[3];let d=u,f;t[4]!==n||t[5]!==r?(f=(0,z.jsx)(U,{repositoryName:n,repositoryUri:r}),t[4]=n,t[5]=r,t[6]=f):f=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,z.jsx)(`h2`,{className:`text-sm font-medium`,children:`Tag immutability`}),t[7]=p):p=t[7];let m=o?`Tags cannot be overwritten to point at a different image.`:`Tags can be overwritten by a new push.`,h;t[8]===m?h=t[9]:(h=(0,z.jsxs)(`div`,{children:[p,(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:m})]}),t[8]=m,t[9]=h);let g=o?`default`:`outline`,_=o?`Immutable`:`Mutable`,v;t[10]!==g||t[11]!==_?(v=(0,z.jsx)(M,{variant:g,children:_}),t[10]=g,t[11]=_,t[12]=v):v=t[12];let b;t[13]!==h||t[14]!==v?(b=(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[h,v]}),t[13]=h,t[14]=v,t[15]=b):b=t[15];let x;t[16]===a.error?x=t[17]:(x=a.error&&(0,z.jsx)(`p`,{className:`mt-2 text-sm text-destructive`,children:a.error.message}),t[16]=a.error,t[17]=x);let S;t[18]===d?S=t[19]:(S=()=>{d()},t[18]=d,t[19]=S);let C=a.isPending?`Saving…`:c,w;t[20]!==a.isPending||t[21]!==S||t[22]!==C?(w=(0,z.jsx)(l,{className:`mt-3`,disabled:a.isPending,onClick:S,size:`sm`,variant:`outline`,children:C}),t[20]=a.isPending,t[21]=S,t[22]=C,t[23]=w):w=t[23];let T;t[24]!==x||t[25]!==w||t[26]!==b?(T=(0,z.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[b,x,w]}),t[24]=x,t[25]=w,t[26]=b,t[27]=T):T=t[27];let E;return t[28]!==T||t[29]!==f?(E=(0,z.jsxs)(`div`,{className:`space-y-6`,children:[f,T]}),t[28]=T,t[29]=f,t[30]=E):E=t[30],E}function G(){let e=(0,L.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[(0,z.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:`Image scanning`}),(0,z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Vulnerability scanning is not supported by this registry. Pushed images are stored and served without scan findings.`})]}),e[0]=t):t=e[0],t}function K(e){let t=(0,L.c)(57),{repositoryName:n}=e,{data:r}=i(d),c;t[0]===n?c=t[1]:(c=f(n),t[0]=n,t[1]=c);let{data:u}=i(c),p=b(),[m,h]=(0,R.useState)(null),g;t[2]===r.repositories?g=t[3]:(g=r.repositories??[],t[2]=r.repositories,t[3]=g);let _;if(t[4]!==n||t[5]!==g){let e;t[7]===n?e=t[8]:(e=e=>e.repositoryName===n,t[7]=n,t[8]=e),_=g.find(e),t[4]=n,t[5]=g,t[6]=_}else _=t[6];let v=_,y;t[9]===u.imageDetails?y=t[10]:(y=u.imageDetails??[],t[9]=u.imageDetails,t[10]=y);let x=y,S;t[11]!==p||t[12]!==m||t[13]!==n?(S=async function(){if(m)try{await p.mutateAsync({repositoryName:n,imageIds:[{imageDigest:m}]}),h(null)}catch{}},t[11]=p,t[12]=m,t[13]=n,t[14]=S):S=t[14];let M=S,ee=v?.repositoryUri,B;t[15]!==n||t[16]!==ee?(B=(0,z.jsx)(C,{subtitle:ee,title:n}),t[15]=n,t[16]=ee,t[17]=B):B=t[17];let ne;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,z.jsx)(`div`,{className:`mb-4`,children:(0,z.jsx)(a,{className:`text-sm text-primary hover:underline`,to:`/ecr/list-repositories`,children:`← Back to repositories`})}),t[18]=ne):ne=t[18];let H;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,z.jsxs)(P,{children:[(0,z.jsx)(N,{value:`summary`,children:`Summary`}),(0,z.jsx)(N,{value:`images`,children:`Images`}),(0,z.jsx)(N,{value:`lifecycle`,children:`Lifecycle`}),(0,z.jsx)(N,{value:`scan`,children:`Scan`}),(0,z.jsx)(N,{value:`permissions`,children:`Permissions`})]}),t[19]=H):H=t[19];let U=v?.imageTagMutability,K=v?.repositoryUri,q;t[20]!==n||t[21]!==U||t[22]!==K?(q=(0,z.jsx)(F,{value:`summary`,children:(0,z.jsx)(W,{imageTagMutability:U,repositoryName:n,repositoryUri:K})}),t[20]=n,t[21]=U,t[22]=K,t[23]=q):q=t[23];let J;t[24]===x?J=t[25]:(J=(0,z.jsx)(F,{value:`images`,children:x.length>0?(0,z.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,z.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Tags`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Digest`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Size`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pushed`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,z.jsx)(`tbody`,{children:x.map(e=>{if(!e.imageDigest)return null;let t=e.imageDigest;return(0,z.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,z.jsx)(`td`,{className:`px-4 py-2`,children:e.imageTags&&e.imageTags.length>0?e.imageTags.join(`, `):``}),(0,z.jsxs)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:[t.slice(0,19),`…`]}),(0,z.jsx)(`td`,{className:`px-4 py-2`,children:s(e.imageSizeInBytes??0)}),(0,z.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:o(e.imagePushedAt)}),(0,z.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,z.jsx)(l,{onClick:()=>h(t),size:`sm`,variant:`destructive`,children:`Delete`})})]},t)})})]})}):(0,z.jsx)(`p`,{className:`text-muted-foreground`,children:`No images pushed yet.`})}),t[24]=x,t[25]=J);let Y;t[26]===n?Y=t[27]:(Y=(0,z.jsx)(F,{value:`lifecycle`,children:(0,z.jsx)(te,{repositoryName:n})}),t[26]=n,t[27]=Y);let X;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,z.jsx)(F,{value:`scan`,children:(0,z.jsx)(G,{})}),t[28]=X):X=t[28];let Z;t[29]===n?Z=t[30]:(Z=(0,z.jsx)(F,{value:`permissions`,children:(0,z.jsx)(V,{repositoryName:n})}),t[29]=n,t[30]=Z);let Q;t[31]!==q||t[32]!==J||t[33]!==Y||t[34]!==Z?(Q=(0,z.jsxs)(I,{defaultValue:`summary`,children:[H,q,J,Y,X,Z]}),t[31]=q,t[32]=J,t[33]=Y,t[34]=Z,t[35]=Q):Q=t[35];let re;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>!e&&h(null),t[36]=re):re=t[36];let ie=m!==null,ae;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,z.jsxs)(A,{children:[(0,z.jsx)(E,{children:`Delete image?`}),(0,z.jsx)(w,{children:`This permanently deletes the image manifest and any tags pointing at it. This cannot be undone.`})]}),t[37]=ae):ae=t[37];let $;t[38]===p.error?$=t[39]:($=p.error&&(0,z.jsx)(`p`,{className:`text-sm text-destructive`,children:p.error.message}),t[38]=p.error,t[39]=$);let oe;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,z.jsx)(k,{children:`Cancel`}),t[40]=oe):oe=t[40];let se;t[41]===M?se=t[42]:(se=e=>{e.preventDefault(),M()},t[41]=M,t[42]=se);let ce=p.isPending?`Deleting…`:`Delete`,le;t[43]!==p.isPending||t[44]!==se||t[45]!==ce?(le=(0,z.jsxs)(O,{children:[oe,(0,z.jsx)(D,{disabled:p.isPending,onClick:se,children:ce})]}),t[43]=p.isPending,t[44]=se,t[45]=ce,t[46]=le):le=t[46];let ue;t[47]!==$||t[48]!==le?(ue=(0,z.jsxs)(T,{children:[ae,$,le]}),t[47]=$,t[48]=le,t[49]=ue):ue=t[49];let de;t[50]!==ie||t[51]!==ue?(de=(0,z.jsx)(j,{onOpenChange:re,open:ie,children:ue}),t[50]=ie,t[51]=ue,t[52]=de):de=t[52];let fe;return t[53]!==Q||t[54]!==de||t[55]!==B?(fe=(0,z.jsxs)(z.Fragment,{children:[B,ne,Q,de]}),t[53]=Q,t[54]=de,t[55]=B,t[56]=fe):fe=t[56],fe}function q(){let e=(0,L.c)(2),{id:t}=S.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,z.jsx)(K,{repositoryName:n}),e[0]=n,e[1]=r),r}export{q as component}; \ No newline at end of file +`)),a(!0),setTimeout(()=>{a(!1)},2e3)},t[8]=_,t[9]=v);let y=v,b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,z.jsx)(`h2`,{className:`text-sm font-medium`,children:`Push commands`}),t[10]=b):b=t[10];let x=i?`Copied`:`Copy`,S;t[11]!==y||t[12]!==x?(S=(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[b,(0,z.jsx)(l,{onClick:y,size:`sm`,variant:`outline`,children:x})]}),t[11]=y,t[12]=x,t[13]=S):S=t[13];let C=_.join(` +`),w;t[14]===C?w=t[15]:(w=(0,z.jsx)(`pre`,{className:`overflow-x-auto rounded bg-muted p-3 font-mono text-xs`,children:C}),t[14]=C,t[15]=w);let T;return t[16]!==S||t[17]!==w?(T=(0,z.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[S,w]}),t[16]=S,t[17]=w,t[18]=T):T=t[18],T}function W(e){let t=(0,L.c)(31),{repositoryName:n,repositoryUri:r,imageTagMutability:i}=e,a=y(),o=i===`IMMUTABLE`,s=o?`MUTABLE`:`IMMUTABLE`,c=o?`Make mutable`:`Make immutable`,u;t[0]!==s||t[1]!==a||t[2]!==n?(u=async function(){try{await a.mutateAsync({repositoryName:n,imageTagMutability:s})}catch{}},t[0]=s,t[1]=a,t[2]=n,t[3]=u):u=t[3];let d=u,f;t[4]!==n||t[5]!==r?(f=(0,z.jsx)(U,{repositoryName:n,repositoryUri:r}),t[4]=n,t[5]=r,t[6]=f):f=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,z.jsx)(`h2`,{className:`text-sm font-medium`,children:`Tag immutability`}),t[7]=p):p=t[7];let m=o?`Tags cannot be overwritten to point at a different image.`:`Tags can be overwritten by a new push.`,h;t[8]===m?h=t[9]:(h=(0,z.jsxs)(`div`,{children:[p,(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:m})]}),t[8]=m,t[9]=h);let g=o?`default`:`outline`,_=o?`Immutable`:`Mutable`,v;t[10]!==g||t[11]!==_?(v=(0,z.jsx)(M,{variant:g,children:_}),t[10]=g,t[11]=_,t[12]=v):v=t[12];let b;t[13]!==h||t[14]!==v?(b=(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[h,v]}),t[13]=h,t[14]=v,t[15]=b):b=t[15];let x;t[16]===a.error?x=t[17]:(x=a.error&&(0,z.jsx)(`p`,{className:`mt-2 text-sm text-destructive`,children:a.error.message}),t[16]=a.error,t[17]=x);let S;t[18]===d?S=t[19]:(S=()=>{d()},t[18]=d,t[19]=S);let C=a.isPending?`Saving…`:c,w;t[20]!==a.isPending||t[21]!==S||t[22]!==C?(w=(0,z.jsx)(l,{className:`mt-3`,disabled:a.isPending,onClick:S,size:`sm`,variant:`outline`,children:C}),t[20]=a.isPending,t[21]=S,t[22]=C,t[23]=w):w=t[23];let T;t[24]!==x||t[25]!==w||t[26]!==b?(T=(0,z.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[b,x,w]}),t[24]=x,t[25]=w,t[26]=b,t[27]=T):T=t[27];let E;return t[28]!==T||t[29]!==f?(E=(0,z.jsxs)(`div`,{className:`space-y-6`,children:[f,T]}),t[28]=T,t[29]=f,t[30]=E):E=t[30],E}function G(){let e=(0,L.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[(0,z.jsx)(`h2`,{className:`mb-2 text-sm font-medium`,children:`Image scanning`}),(0,z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Vulnerability scanning is not supported by this registry. Pushed images are stored and served without scan findings.`})]}),e[0]=t):t=e[0],t}function K(e){let t=(0,L.c)(57),{repositoryName:n}=e,{data:r}=i(d),c;t[0]===n?c=t[1]:(c=f(n),t[0]=n,t[1]=c);let{data:u}=i(c),p=b(),[m,h]=(0,R.useState)(null),g;t[2]===r.repositories?g=t[3]:(g=r.repositories??[],t[2]=r.repositories,t[3]=g);let _;if(t[4]!==n||t[5]!==g){let e;t[7]===n?e=t[8]:(e=e=>e.repositoryName===n,t[7]=n,t[8]=e),_=g.find(e),t[4]=n,t[5]=g,t[6]=_}else _=t[6];let v=_,y;t[9]===u.imageDetails?y=t[10]:(y=u.imageDetails??[],t[9]=u.imageDetails,t[10]=y);let x=y,S;t[11]!==p||t[12]!==m||t[13]!==n?(S=async function(){if(m)try{await p.mutateAsync({repositoryName:n,imageIds:[{imageDigest:m}]}),h(null)}catch{}},t[11]=p,t[12]=m,t[13]=n,t[14]=S):S=t[14];let M=S,ee=v?.repositoryUri,B;t[15]!==n||t[16]!==ee?(B=(0,z.jsx)(C,{subtitle:ee,title:n}),t[15]=n,t[16]=ee,t[17]=B):B=t[17];let ne;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,z.jsx)(`div`,{className:`mb-4`,children:(0,z.jsx)(a,{className:`text-sm text-primary hover:underline`,to:`/ecr/list-repositories`,children:`← Back to repositories`})}),t[18]=ne):ne=t[18];let H;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,z.jsxs)(P,{children:[(0,z.jsx)(N,{value:`summary`,children:`Summary`}),(0,z.jsx)(N,{value:`images`,children:`Images`}),(0,z.jsx)(N,{value:`lifecycle`,children:`Lifecycle`}),(0,z.jsx)(N,{value:`scan`,children:`Scan`}),(0,z.jsx)(N,{value:`permissions`,children:`Permissions`})]}),t[19]=H):H=t[19];let U=v?.imageTagMutability,K=v?.repositoryUri,q;t[20]!==n||t[21]!==U||t[22]!==K?(q=(0,z.jsx)(F,{value:`summary`,children:(0,z.jsx)(W,{imageTagMutability:U,repositoryName:n,repositoryUri:K})}),t[20]=n,t[21]=U,t[22]=K,t[23]=q):q=t[23];let J;t[24]===x?J=t[25]:(J=(0,z.jsx)(F,{value:`images`,children:x.length>0?(0,z.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,z.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Tags`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Digest`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Size`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pushed`}),(0,z.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,z.jsx)(`tbody`,{children:x.map(e=>{if(!e.imageDigest)return null;let t=e.imageDigest;return(0,z.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,z.jsx)(`td`,{className:`px-4 py-2`,children:e.imageTags&&e.imageTags.length>0?e.imageTags.join(`, `):``}),(0,z.jsxs)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:[t.slice(0,19),`…`]}),(0,z.jsx)(`td`,{className:`px-4 py-2`,children:s(e.imageSizeInBytes??0)}),(0,z.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:o(e.imagePushedAt)}),(0,z.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,z.jsx)(l,{onClick:()=>{h(t)},size:`sm`,variant:`destructive`,children:`Delete`})})]},t)})})]})}):(0,z.jsx)(`p`,{className:`text-muted-foreground`,children:`No images pushed yet.`})}),t[24]=x,t[25]=J);let Y;t[26]===n?Y=t[27]:(Y=(0,z.jsx)(F,{value:`lifecycle`,children:(0,z.jsx)(te,{repositoryName:n})}),t[26]=n,t[27]=Y);let X;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,z.jsx)(F,{value:`scan`,children:(0,z.jsx)(G,{})}),t[28]=X):X=t[28];let Z;t[29]===n?Z=t[30]:(Z=(0,z.jsx)(F,{value:`permissions`,children:(0,z.jsx)(V,{repositoryName:n})}),t[29]=n,t[30]=Z);let Q;t[31]!==q||t[32]!==J||t[33]!==Y||t[34]!==Z?(Q=(0,z.jsxs)(I,{defaultValue:`summary`,children:[H,q,J,Y,X,Z]}),t[31]=q,t[32]=J,t[33]=Y,t[34]=Z,t[35]=Q):Q=t[35];let re;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>{e||h(null)},t[36]=re):re=t[36];let ie=m!==null,ae;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,z.jsxs)(A,{children:[(0,z.jsx)(E,{children:`Delete image?`}),(0,z.jsx)(w,{children:`This permanently deletes the image manifest and any tags pointing at it. This cannot be undone.`})]}),t[37]=ae):ae=t[37];let $;t[38]===p.error?$=t[39]:($=p.error&&(0,z.jsx)(`p`,{className:`text-sm text-destructive`,children:p.error.message}),t[38]=p.error,t[39]=$);let oe;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,z.jsx)(k,{children:`Cancel`}),t[40]=oe):oe=t[40];let se;t[41]===M?se=t[42]:(se=e=>{e.preventDefault(),M()},t[41]=M,t[42]=se);let ce=p.isPending?`Deleting…`:`Delete`,le;t[43]!==p.isPending||t[44]!==se||t[45]!==ce?(le=(0,z.jsxs)(O,{children:[oe,(0,z.jsx)(D,{disabled:p.isPending,onClick:se,children:ce})]}),t[43]=p.isPending,t[44]=se,t[45]=ce,t[46]=le):le=t[46];let ue;t[47]!==$||t[48]!==le?(ue=(0,z.jsxs)(T,{children:[ae,$,le]}),t[47]=$,t[48]=le,t[49]=ue):ue=t[49];let de;t[50]!==ie||t[51]!==ue?(de=(0,z.jsx)(j,{onOpenChange:re,open:ie,children:ue}),t[50]=ie,t[51]=ue,t[52]=de):de=t[52];let fe;return t[53]!==Q||t[54]!==de||t[55]!==B?(fe=(0,z.jsxs)(z.Fragment,{children:[B,ne,Q,de]}),t[53]=Q,t[54]=de,t[55]=B,t[56]=fe):fe=t[56],fe}function q(){let e=(0,L.c)(2),{id:t}=S.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,z.jsx)(K,{repositoryName:n}),e[0]=n,e[1]=r),r}export{q as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id40.js b/spinifex/services/spinifexui/frontend/dist/assets/_id40.js index 44c98db87..db8a6bac4 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id40.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id40.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{t as s}from"./useNavigate.js";import{$t as ee}from"./cluster-config.js";import{t as te}from"./back-link.js";import{t as ne}from"./camera.js";import{t as re}from"./pencil.js";import{t as ie}from"./cli-command-panel.js";import{t as ae}from"./trash-2.js";import{t as c}from"./button.js";import{t as oe}from"./input.js";import{w as l}from"./ec2.js";import{S as u,a as d,c as se,d as f,f as ce,l as p,m as le,p as ue,u as de}from"./rds.js";import{d as fe,l as pe,m,p as h}from"./rds2.js";import{c as me,d as he,l as ge,n as _e,o as g,s as _,t as ve}from"./rds3.js";import{t as v}from"./_id19.js";import{a as y,i as b,n as x,t as ye}from"./zod.js";import{t as be}from"./error-banner.js";import{t as xe}from"./form-actions.js";import{t as Se}from"./page-heading.js";import{a as S,n as Ce,r as we,t as Te}from"./field.js";import{a as Ee,i as De,l as C,s as Oe,t as ke}from"./alert-dialog.js";import{n as w,t as T}from"./detail-row.js";import{t as Ae}from"./state-badge.js";import{i as je,n as Me,r as Ne,t as Pe}from"./tabs.js";import{n as Fe,t as Ie}from"./picker-notice.js";import{a as Le,o as Re,s as ze,t as Be}from"./security-group-checkboxes.js";import{t as Ve}from"./create-db-snapshot-dialog.js";import{t as He}from"./delete-db-snapshot-dialog.js";import{t as Ue}from"./rds-events-panel.js";import{t as We}from"./rds-tags-tab.js";import{t as Ge}from"./delete-db-instance-dialog.js";var Ke=e(n(),1),qe=r(),E=t(),Je=[{label:`Identifier`,note:`The identifier is the endpoint hostname and the certificate subject; renaming in place is not implemented.`},{label:`Engine version`,note:`There is no in-place engine-version upgrade.`},{label:`Port`,note:`The port is fixed at create; changing it would break every client and the serving certificate.`},{label:`DB subnet group`,note:`The endpoint ENI is placed at create; moving it would change the address clients resolve.`}];function D(e){let t=(0,qe.c)(222),{open:n,onOpenChange:r,instance:a}=e,o=pe(),s=i(he),ee=i(l),te=i(g),ne=a.Engine??``,re;t[0]===ne?re=t[1]:(re=ge(ne),t[0]=ne,t[1]=re);let ie=i(re),ae=a.DBInstanceIdentifier??``,c=a.AllocatedStorage??0,d;t[2]===a.VpcSecurityGroups?d=t[3]:(d=a.VpcSecurityGroups?.map(et).filter(Boolean)??[],t[2]=a.VpcSecurityGroups,t[3]=d);let se=d,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=ye(u),t[4]=f):f=t[4];let ce=a.DBInstanceClass??``,p=a.DBParameterGroups?.[0]?.DBParameterGroupName??``,le=a.DeletionProtection??!1,ue=a.BackupRetentionPeriod??0,de=a.PreferredBackupWindow??``,fe=a.PreferredMaintenanceWindow??``,m;t[5]!==se||t[6]!==c||t[7]!==fe||t[8]!==ce||t[9]!==p||t[10]!==le||t[11]!==ue||t[12]!==de?(m={resolver:f,defaultValues:{currentAllocatedStorage:c,dbInstanceClass:ce,allocatedStorage:c,dbParameterGroupName:p,vpcSecurityGroupIds:se,deletionProtection:le,backupRetentionPeriod:ue,preferredBackupWindow:de,preferredMaintenanceWindow:fe,masterUserPassword:``,applyImmediately:!1}},t[5]=se,t[6]=c,t[7]=fe,t[8]=ce,t[9]=p,t[10]=le,t[11]=ue,t[12]=de,t[13]=m):m=t[13];let{control:h,formState:me,handleSubmit:_e,register:_,setValue:ve}=b(m),{errors:v,isSubmitting:Se}=me,w;t[14]===h?w=t[15]:(w={control:h},t[14]=h,t[15]=w);let T=y(w),Ae=T.dbInstanceClass??``,je=T.allocatedStorage??c,Me;t[16]===T.vpcSecurityGroupIds?Me=t[17]:(Me=T.vpcSecurityGroupIds??[],t[16]=T.vpcSecurityGroupIds,t[17]=Me);let Ne=Me,Pe;t[18]===ie.data?.OrderableDBInstanceOptions?Pe=t[19]:(Pe=ie.data?.OrderableDBInstanceOptions??[],t[18]=ie.data?.OrderableDBInstanceOptions,t[19]=Pe);let Ve;t[20]===Pe?Ve=t[21]:(Ve=new Set(Pe.map($e).filter(Boolean)),t[20]=Pe,t[21]=Ve);let He;t[22]===Ve?He=t[23]:(He=[...Ve],t[22]=Ve,t[23]=He);let Ue=He,We,Ge,Ke,D,O,tt,nt,rt,it,at,ot,st,ct,lt,ut,k,A,j,dt,M;if(t[24]!==h||t[25]!==c||t[26]!==te.data?.DBEngineVersions||t[27]!==v.allocatedStorage||t[28]!==_e||t[29]!==ae||t[30]!==a.DBInstanceClass||t[31]!==a.DBSubnetGroup?.VpcId||t[32]!==a.Engine||t[33]!==Ue||t[34]!==o||t[35]!==r||t[36]!==n||t[37]!==ie||t[38]!==s||t[39]!==_||t[40]!==ee||t[41]!==Ae||t[42]!==je||t[43]!==ve){let e;t[64]===s.data?.DBParameterGroups?e=t[65]:(e=s.data?.DBParameterGroups??[],t[64]=s.data?.DBParameterGroups,t[65]=e);let i;t[66]===te.data?.DBEngineVersions?i=t[67]:(i=te.data?.DBEngineVersions??[],t[66]=te.data?.DBEngineVersions,t[67]=i);let ne=ze(e,i,a.Engine??``),re=a.DBSubnetGroup?.VpcId,l;t[68]===ee.data?.SecurityGroups?l=t[69]:(l=ee.data?.SecurityGroups??[],t[68]=ee.data?.SecurityGroups,t[69]=l);let u;if(t[70]!==re||t[71]!==l){let e;t[73]===re?e=t[74]:(e=e=>re===void 0||e.VpcId===re,t[73]=re,t[74]=e),u=l.filter(e),t[70]=re,t[71]=l,t[72]=u}else u=t[72];O=u;let d=Ae!==a.DBInstanceClass,se=je!==c,f=Ue.length===0,ce=`No instance class this cluster's nodes can run is available for ${a.Engine}.`,p;t[75]!==ie||t[76]!==f||t[77]!==ce?(p=Fe(ie,f,{loading:`Loading the instance classes…`,failed:`Could not read the instance classes`,empty:ce}),t[75]=ie,t[76]=f,t[77]=ce,t[78]=p):p=t[78];let le=p,ue=ne.length===0,de;t[79]!==s||t[80]!==ue?(de=Fe(s,ue,{loading:`Loading the parameter groups…`,failed:`Could not read the parameter groups`,empty:`No parameter group of this instance's engine family exists.`}),t[79]=s,t[80]=ue,t[81]=de):de=t[81];let fe=de,pe=O.length===0,m;t[82]!==ee||t[83]!==pe?(m=Fe(ee,pe,{loading:`Loading the security groups…`,failed:`Could not read the security groups`,empty:`No security group in this instance's VPC is available.`}),t[82]=ee,t[83]=pe,t[84]=m):m=t[84],D=m;let me;t[85]===ve?me=t[86]:(me=e=>ve(`vpcSecurityGroupIds`,e,{shouldValidate:!0}),t[85]=ve,t[86]=me),tt=me;let he;t[87]!==ae||t[88]!==o||t[89]!==r?(he=async e=>{await o.mutateAsync({...e,dbInstanceIdentifier:ae}),r(!1)},t[87]=ae,t[88]=o,t[89]=r,t[90]=he):he=t[90];let ge=he;Ke=ke,dt=r,M=n,Ge=De,A=`max-h-[85vh] overflow-y-auto`;let g;t[91]===ae?g=t[92]:(g=(0,E.jsxs)(C,{children:[`Modify `,ae]}),t[91]=ae,t[92]=g);let y;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,E.jsx)(Ee,{children:`Changes apply in the maintenance window unless you apply them immediately.`}),t[93]=y):y=t[93],t[94]===g?j=t[95]:(j=(0,E.jsxs)(Oe,{children:[g,y]}),t[94]=g,t[95]=j),ct=`space-y-4`,t[96]!==_e||t[97]!==ge?(lt=_e(ge),t[96]=_e,t[97]=ge,t[98]=lt):lt=t[98];let b;t[99]===Ue?b=t[100]:(b=Ue.map(Qe),t[99]=Ue,t[100]=b);let x=d&&`Changing the class replaces the VM. The database is unavailable while it does.`;t[101]!==le||t[102]!==h||t[103]!==b||t[104]!==x?(ut=(0,E.jsx)(Re,{control:h,id:`modify-class`,label:`DB instance class`,name:`dbInstanceClass`,notice:le,options:b,placeholder:`Select an instance class`,warning:x}),t[101]=le,t[102]=h,t[103]=b,t[104]=x,t[105]=ut):ut=t[105];let ye;t[106]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,E.jsx)(S,{children:(0,E.jsx)(`label`,{htmlFor:`modify-storage`,children:`Allocated storage (GiB)`})}),t[106]=ye):ye=t[106];let be=!!v.allocatedStorage,xe;t[107]===_?xe=t[108]:(xe=_(`allocatedStorage`,{valueAsNumber:!0}),t[107]=_,t[108]=xe);let Se;t[109]!==c||t[110]!==be||t[111]!==xe?(Se=(0,E.jsx)(oe,{"aria-invalid":be,id:`modify-storage`,min:c,type:`number`,...xe}),t[109]=c,t[110]=be,t[111]=xe,t[112]=Se):Se=t[112];let w;t[113]===c?w=t[114]:(w=(0,E.jsxs)(Ce,{children:[`Currently `,c,` GiB. Storage grows only.`]}),t[113]=c,t[114]=w);let T;t[115]===se?T=t[116]:(T=se&&(0,E.jsx)(`p`,{className:`text-xs text-tactical-amber`,children:`Growing storage stops and starts the instance to extend the filesystem.`}),t[115]=se,t[116]=T);let Me;t[117]===v.allocatedStorage?Me=t[118]:(Me=(0,E.jsx)(we,{errors:[v.allocatedStorage]}),t[117]=v.allocatedStorage,t[118]=Me),t[119]!==Se||t[120]!==w||t[121]!==T||t[122]!==Me?(k=(0,E.jsxs)(Te,{children:[ye,Se,w,T,Me]}),t[119]=Se,t[120]=w,t[121]=T,t[122]=Me,t[123]=k):k=t[123],We=Re,nt=h,rt=`modify-parameter-group`,it=`DB parameter group`,at=`dbParameterGroupName`,ot=fe,st=ne.map(Ze),t[24]=h,t[25]=c,t[26]=te.data?.DBEngineVersions,t[27]=v.allocatedStorage,t[28]=_e,t[29]=ae,t[30]=a.DBInstanceClass,t[31]=a.DBSubnetGroup?.VpcId,t[32]=a.Engine,t[33]=Ue,t[34]=o,t[35]=r,t[36]=n,t[37]=ie,t[38]=s,t[39]=_,t[40]=ee,t[41]=Ae,t[42]=je,t[43]=ve,t[44]=We,t[45]=Ge,t[46]=Ke,t[47]=D,t[48]=O,t[49]=tt,t[50]=nt,t[51]=rt,t[52]=it,t[53]=at,t[54]=ot,t[55]=st,t[56]=ct,t[57]=lt,t[58]=ut,t[59]=k,t[60]=A,t[61]=j,t[62]=dt,t[63]=M}else We=t[44],Ge=t[45],Ke=t[46],D=t[47],O=t[48],tt=t[49],nt=t[50],rt=t[51],it=t[52],at=t[53],ot=t[54],st=t[55],ct=t[56],lt=t[57],ut=t[58],k=t[59],A=t[60],j=t[61],dt=t[62],M=t[63];let N;t[124]!==We||t[125]!==nt||t[126]!==rt||t[127]!==it||t[128]!==at||t[129]!==ot||t[130]!==st?(N=(0,E.jsx)(We,{control:nt,id:rt,label:it,name:at,notice:ot,options:st,placeholder:`Engine default group`}),t[124]=We,t[125]=nt,t[126]=rt,t[127]=it,t[128]=at,t[129]=ot,t[130]=st,t[131]=N):N=t[131];let ft;t[132]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,E.jsx)(S,{children:`VPC security groups`}),t[132]=ft):ft=t[132];let P;t[133]!==D||t[134]!==O||t[135]!==Ne||t[136]!==tt?(P=(0,E.jsxs)(Te,{children:[ft,D?(0,E.jsx)(Ie,{notice:D}):(0,E.jsx)(Be,{emptyText:`No security group in this instance's VPC is available.`,groups:O,onChange:tt,selected:Ne})]}),t[133]=D,t[134]=O,t[135]=Ne,t[136]=tt,t[137]=P):P=t[137];let pt;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(pt=(0,E.jsx)(S,{children:(0,E.jsx)(`label`,{htmlFor:`modify-retention`,children:`Backup retention (days)`})}),t[138]=pt):pt=t[138];let mt=!!v.backupRetentionPeriod,F;t[139]===_?F=t[140]:(F=_(`backupRetentionPeriod`,{valueAsNumber:!0}),t[139]=_,t[140]=F);let I;t[141]!==mt||t[142]!==F?(I=(0,E.jsx)(oe,{"aria-invalid":mt,id:`modify-retention`,max:7,min:0,type:`number`,...F}),t[141]=mt,t[142]=F,t[143]=I):I=t[143];let L;t[144]===v.backupRetentionPeriod?L=t[145]:(L=(0,E.jsx)(we,{errors:[v.backupRetentionPeriod]}),t[144]=v.backupRetentionPeriod,t[145]=L);let R;t[146]!==I||t[147]!==L?(R=(0,E.jsxs)(Te,{children:[pt,I,L]}),t[146]=I,t[147]=L,t[148]=R):R=t[148];let z;t[149]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,E.jsx)(S,{children:(0,E.jsx)(`label`,{htmlFor:`modify-backup-window`,children:`Preferred backup window`})}),t[149]=z):z=t[149];let ht=!!v.preferredBackupWindow,B;t[150]===_?B=t[151]:(B=_(`preferredBackupWindow`),t[150]=_,t[151]=B);let V;t[152]!==ht||t[153]!==B?(V=(0,E.jsx)(oe,{"aria-invalid":ht,id:`modify-backup-window`,placeholder:`hh24:mi-hh24:mi in UTC`,...B}),t[152]=ht,t[153]=B,t[154]=V):V=t[154];let H;t[155]===v.preferredBackupWindow?H=t[156]:(H=(0,E.jsx)(we,{errors:[v.preferredBackupWindow]}),t[155]=v.preferredBackupWindow,t[156]=H);let U;t[157]!==V||t[158]!==H?(U=(0,E.jsxs)(Te,{children:[z,V,H]}),t[157]=V,t[158]=H,t[159]=U):U=t[159];let W;t[160]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,E.jsx)(S,{children:(0,E.jsx)(`label`,{htmlFor:`modify-maintenance-window`,children:`Preferred maintenance window`})}),t[160]=W):W=t[160];let G=!!v.preferredMaintenanceWindow,K;t[161]===_?K=t[162]:(K=_(`preferredMaintenanceWindow`),t[161]=_,t[162]=K);let q;t[163]!==G||t[164]!==K?(q=(0,E.jsx)(oe,{"aria-invalid":G,id:`modify-maintenance-window`,placeholder:`ddd:hh24:mi-ddd:hh24:mi in UTC`,...K}),t[163]=G,t[164]=K,t[165]=q):q=t[165];let J;t[166]===v.preferredMaintenanceWindow?J=t[167]:(J=(0,E.jsx)(we,{errors:[v.preferredMaintenanceWindow]}),t[166]=v.preferredMaintenanceWindow,t[167]=J);let Y;t[168]!==q||t[169]!==J?(Y=(0,E.jsxs)(Te,{children:[W,q,J]}),t[168]=q,t[169]=J,t[170]=Y):Y=t[170];let X;t[171]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,E.jsx)(S,{children:(0,E.jsx)(`label`,{htmlFor:`modify-password`,children:`Reset master password`})}),t[171]=X):X=t[171];let gt=!!v.masterUserPassword,Z;t[172]===_?Z=t[173]:(Z=_(`masterUserPassword`),t[172]=_,t[173]=Z);let Q;t[174]!==gt||t[175]!==Z?(Q=(0,E.jsx)(oe,{"aria-invalid":gt,id:`modify-password`,type:`password`,...Z}),t[174]=gt,t[175]=Z,t[176]=Q):Q=t[176];let _t;t[177]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,E.jsx)(Ce,{children:`Leave blank to keep the current password.`}),t[177]=_t):_t=t[177];let $;t[178]===v.masterUserPassword?$=t[179]:($=(0,E.jsx)(we,{errors:[v.masterUserPassword]}),t[178]=v.masterUserPassword,t[179]=$);let vt;t[180]!==Q||t[181]!==$?(vt=(0,E.jsxs)(Te,{children:[X,Q,_t,$]}),t[180]=Q,t[181]=$,t[182]=vt):vt=t[182];let yt;t[183]===h?yt=t[184]:(yt=(0,E.jsx)(Le,{control:h,name:`deletionProtection`}),t[183]=h,t[184]=yt);let bt;t[185]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,E.jsx)(S,{children:`Apply immediately`}),t[185]=bt):bt=t[185];let xt;t[186]===h?xt=t[187]:(xt=(0,E.jsxs)(Te,{children:[bt,(0,E.jsx)(x,{control:h,name:`applyImmediately`,render:Xe})]}),t[186]=h,t[187]=xt);let St;t[188]===Symbol.for(`react.memo_cache_sentinel`)?(St=(0,E.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border p-3`,children:[(0,E.jsx)(`h3`,{className:`text-xs font-medium`,children:`Fixed at create`}),Je.map(Ye)]}),t[188]=St):St=t[188];let Ct;t[189]===o.error?Ct=t[190]:(Ct=o.error&&(0,E.jsx)(be,{error:o.error,msg:`Failed to modify the DB instance`}),t[189]=o.error,t[190]=Ct);let wt;t[191]===r?wt=t[192]:(wt=()=>r(!1),t[191]=r,t[192]=wt);let Tt;t[193]!==Se||t[194]!==o.isPending||t[195]!==wt?(Tt=(0,E.jsx)(`div`,{className:`flex justify-end`,children:(0,E.jsx)(xe,{isPending:o.isPending,isSubmitting:Se,onCancel:wt,pendingLabel:`Saving…`,submitLabel:`Save Changes`})}),t[193]=Se,t[194]=o.isPending,t[195]=wt,t[196]=Tt):Tt=t[196];let Et;t[197]!==ct||t[198]!==lt||t[199]!==ut||t[200]!==k||t[201]!==N||t[202]!==P||t[203]!==R||t[204]!==U||t[205]!==Y||t[206]!==vt||t[207]!==yt||t[208]!==xt||t[209]!==Ct||t[210]!==Tt?(Et=(0,E.jsxs)(`form`,{className:ct,onSubmit:lt,children:[ut,k,N,P,R,U,Y,vt,yt,xt,St,Ct,Tt]}),t[197]=ct,t[198]=lt,t[199]=ut,t[200]=k,t[201]=N,t[202]=P,t[203]=R,t[204]=U,t[205]=Y,t[206]=vt,t[207]=yt,t[208]=xt,t[209]=Ct,t[210]=Tt,t[211]=Et):Et=t[211];let Dt;t[212]!==Ge||t[213]!==A||t[214]!==j||t[215]!==Et?(Dt=(0,E.jsxs)(Ge,{className:A,children:[j,Et]}),t[212]=Ge,t[213]=A,t[214]=j,t[215]=Et,t[216]=Dt):Dt=t[216];let Ot;return t[217]!==Ke||t[218]!==dt||t[219]!==M||t[220]!==Dt?(Ot=(0,E.jsx)(Ke,{onOpenChange:dt,open:M,children:Dt}),t[217]=Ke,t[218]=dt,t[219]=M,t[220]=Dt,t[221]=Ot):Ot=t[221],Ot}function Ye(e){return(0,E.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,E.jsx)(`span`,{className:`font-medium`,children:e.label}),` —`,` `,e.note]},e.label)}function Xe(e){let{field:t}=e;return(0,E.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,E.jsx)(`input`,{"aria-label":`Apply immediately`,checked:t.value,onChange:e=>t.onChange(e.target.checked),type:`checkbox`}),(0,E.jsx)(`span`,{children:`Apply now instead of waiting for the maintenance window`})]})}function Ze(e){return{value:e.DBParameterGroupName??``,label:e.DBParameterGroupName??``}}function Qe(e){return{value:e,label:e}}function $e(e){return e.DBInstanceClass??``}function et(e){return e.VpcSecurityGroupId??``}function O(e,t){return e.EventCategories?.includes(t)??!1}function tt(e,t){return e.filter(t).toSorted((e,t)=>(e.Date?.getTime()??0)-(t.Date?.getTime()??0)).at(-1)}function nt(e){let t=e.Endpoint?.Address;if(!t)return[];let n=e.Endpoint?.Port??e.DbInstancePort,r=e.MasterUsername??``,i=e.DBName??r;return e.Engine===`postgres`?[{label:`Connect`,parts:[{type:`bin`,value:`psql`},{type:`value`,value:` "host=${t} port=${n} dbname=${i} user=${r} sslmode=require"`}]}]:[{label:`Connect`,parts:[{type:`bin`,value:`mariadb`},{type:`flag`,value:` --host`},{type:`value`,value:`=${t}`},{type:`flag`,value:` --port`},{type:`value`,value:`=${n}`},{type:`flag`,value:` --user`},{type:`value`,value:`=${r}`},{type:`flag`,value:` --ssl`},{type:`value`,value:` ${i}`}]}]}function rt(e){let t=(0,qe.c)(266),{dbInstanceIdentifier:n}=e,r=s(),i;t[0]===n?i=t[1]:(i=_e(n),t[0]=n,t[1]=i);let{data:oe}=a(i),l=oe.DBInstances?.[0],u=l?.DBInstanceArn??``,d;t[2]===n?d=t[3]:(d=_(n),t[2]=n,t[3]=d);let{data:pe}=a(d),he;t[4]===n?he=t[5]:(he=me(n),t[4]=n,t[5]=he);let{data:ge}=a(he),g;t[6]===n?g=t[7]:(g=ve(n),t[6]=n,t[7]=g);let{data:v}=a(g),y=h(),b=m(),x=fe(),[ye,xe]=(0,Ke.useState)(!1),[S,Ce]=(0,Ke.useState)(!1),[we,Te]=(0,Ke.useState)(!1),[Ee,De]=(0,Ke.useState)(null);if(!l?.DBInstanceIdentifier){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(te,{to:`/rds/describe-db-instances`,children:`Back to databases`}),(0,E.jsx)(`p`,{className:`text-muted-foreground`,children:`DB instance not found.`})]}),t[8]=e):e=t[8],e}let C=l.DBInstanceStatus,Oe;t[9]===pe.Events?Oe=t[10]:(Oe=pe.Events??[],t[9]=pe.Events,t[10]=Oe);let ke=Oe,Fe=y.error??b.error??x.error,Ie,Le,Re,ze,Be,Je,Ye,Xe,Ze,Qe,$e,et,O,rt,k,A,j,dt,M,N,ft,P,pt,mt,F,I;if(t[11]!==v.DBInstanceAutomatedBackups?.[0]||t[12]!==n||t[13]!==ke||t[14]!==l||t[15]!==Fe||t[16]!==x||t[17]!==ge.DBSnapshots||t[18]!==y||t[19]!==C||t[20]!==b){let e=tt(ke,ut),r=tt(ke,lt),i;t[47]===ge.DBSnapshots?i=t[48]:(i=ge.DBSnapshots??[],t[47]=ge.DBSnapshots,t[48]=i),Je=i;let a=Je.filter(ct).toSorted(st).at(-1),o=v.DBInstanceAutomatedBackups?.[0],s=l.PendingModifiedValues,oe=s?.AllocatedStorage!==void 0||s?.DBInstanceClass!==void 0;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,E.jsx)(te,{to:`/rds/describe-db-instances`,children:`Back to databases`}),t[49]=ft):ft=t[49],t[50]===Fe?P=t[51]:(P=Fe&&(0,E.jsx)(be,{error:Fe,msg:`Failed to change the DB instance state.`}),t[50]=Fe,t[51]=P),dt=`space-y-6`;let u;t[52]!==y.isPending||t[53]!==C?(u=!ue(C)||y.isPending,t[52]=y.isPending,t[53]=C,t[54]=u):u=t[54];let d;t[55]!==n||t[56]!==y?(d=()=>y.mutate(n),t[55]=n,t[56]=y,t[57]=d):d=t[57];let f;t[58]!==u||t[59]!==d?(f=(0,E.jsx)(c,{disabled:u,onClick:d,size:`sm`,variant:`outline`,children:`Start`}),t[58]=u,t[59]=d,t[60]=f):f=t[60];let p;t[61]!==C||t[62]!==b.isPending?(p=!le(C)||b.isPending,t[61]=C,t[62]=b.isPending,t[63]=p):p=t[63];let fe;t[64]!==n||t[65]!==b?(fe=()=>b.mutate(n),t[64]=n,t[65]=b,t[66]=fe):fe=t[66];let pe;t[67]!==p||t[68]!==fe?(pe=(0,E.jsx)(c,{disabled:p,onClick:fe,size:`sm`,variant:`outline`,children:`Stop`}),t[67]=p,t[68]=fe,t[69]=pe):pe=t[69];let m;t[70]!==x.isPending||t[71]!==C?(m=!de(C)||x.isPending,t[70]=x.isPending,t[71]=C,t[72]=m):m=t[72];let h;t[73]!==n||t[74]!==x?(h=()=>x.mutate(n),t[73]=n,t[74]=x,t[75]=h):h=t[75];let me;t[76]!==m||t[77]!==h?(me=(0,E.jsx)(c,{disabled:m,onClick:h,size:`sm`,variant:`outline`,children:`Reboot`}),t[76]=m,t[77]=h,t[78]=me):me=t[78];let he;t[79]===C?he=t[80]:(he=ce(C),t[79]=C,t[80]=he);let _e=!he,g;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>Te(!0),t[81]=g):g=t[81];let _;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,E.jsx)(ne,{className:`size-4`}),t[82]=_):_=t[82];let ve;t[83]===_e?ve=t[84]:(ve=(0,E.jsxs)(c,{disabled:_e,onClick:g,size:`sm`,variant:`outline`,children:[_,`Take Snapshot`]}),t[83]=_e,t[84]=ve);let ye;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(ye=()=>Ce(!0),t[85]=ye):ye=t[85];let S;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,E.jsxs)(c,{onClick:ye,size:`sm`,variant:`outline`,children:[(0,E.jsx)(re,{className:`size-4`}),`Modify`]}),t[86]=S):S=t[86];let we;t[87]===C?we=t[88]:(we=se(C),t[87]=C,t[88]=we);let Ee=!we,De;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(De=()=>xe(!0),t[89]=De):De=t[89];let Oe;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,E.jsx)(ae,{className:`size-4`}),t[90]=Oe):Oe=t[90];let Ve;t[91]===Ee?Ve=t[92]:(Ve=(0,E.jsxs)(c,{disabled:Ee,onClick:De,size:`sm`,variant:`destructive`,children:[Oe,`Delete`]}),t[91]=Ee,t[92]=Ve);let He;t[93]!==f||t[94]!==pe||t[95]!==me||t[96]!==ve||t[97]!==Ve?(He=(0,E.jsxs)(`div`,{className:`flex gap-2`,children:[f,pe,me,ve,S,Ve]}),t[93]=f,t[94]=pe,t[95]=me,t[96]=ve,t[97]=Ve,t[98]=He):He=t[98],t[99]!==n||t[100]!==He?(M=(0,E.jsx)(Se,{actions:He,subtitle:`DB Instance`,title:n}),t[99]=n,t[100]=He,t[101]=M):M=t[101];let Ue;t[102]===C?Ue=t[103]:(Ue=(0,E.jsx)(Ae,{state:C}),t[102]=C,t[103]=Ue);let We;t[104]===l.StatusInfos?We=t[105]:(We=l.StatusInfos?.map(ot),t[104]=l.StatusInfos,t[105]=We),t[106]!==Ue||t[107]!==We?(N=(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[Ue,We]}),t[106]=Ue,t[107]=We,t[108]=N):N=t[108],Be=Pe,rt=`connectivity`,t[109]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,E.jsxs)(Me,{children:[(0,E.jsx)(je,{value:`connectivity`,children:`Connectivity`}),(0,E.jsx)(je,{value:`configuration`,children:`Configuration`}),(0,E.jsx)(je,{value:`backups`,children:`Backups`}),(0,E.jsx)(je,{value:`tags`,children:`Tags`}),(0,E.jsx)(je,{value:`events`,children:`Events`})]}),t[109]=k):k=t[109];let Ge;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,E.jsx)(w.Header,{children:`Endpoint`}),t[110]=Ge):Ge=t[110];let Ke=l.Endpoint?.Address,qe;t[111]===Ke?qe=t[112]:(qe=(0,E.jsx)(T,{label:`Address`,value:Ke}),t[111]=Ke,t[112]=qe);let D;t[113]!==l.DbInstancePort||t[114]!==l.Endpoint?.Port?(D=(l.Endpoint?.Port??l.DbInstancePort)?.toString(),t[113]=l.DbInstancePort,t[114]=l.Endpoint?.Port,t[115]=D):D=t[115];let L;t[116]===D?L=t[117]:(L=(0,E.jsx)(T,{label:`Port`,value:D}),t[116]=D,t[117]=L);let R=l.DBSubnetGroup?.VpcId,z;t[118]===R?z=t[119]:(z=(0,E.jsx)(T,{label:`VPC`,value:R}),t[118]=R,t[119]=z);let ht=l.DBSubnetGroup?.DBSubnetGroupName,B;t[120]===ht?B=t[121]:(B=(0,E.jsx)(T,{label:`DB subnet group`,value:ht}),t[120]=ht,t[121]=B);let V;t[122]===l.VpcSecurityGroups?V=t[123]:(V=l.VpcSecurityGroups?.map(at).join(`, `),t[122]=l.VpcSecurityGroups,t[123]=V);let H;t[124]===V?H=t[125]:(H=(0,E.jsx)(T,{label:`Security groups`,value:V}),t[124]=V,t[125]=H);let U;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,E.jsx)(T,{label:`Publicly accessible`,value:`No — private VPC address`}),t[126]=U):U=t[126];let W;t[127]!==qe||t[128]!==L||t[129]!==z||t[130]!==B||t[131]!==H?(W=(0,E.jsxs)(w,{children:[Ge,(0,E.jsxs)(w.Content,{children:[qe,L,z,B,H,U]})]}),t[127]=qe,t[128]=L,t[129]=z,t[130]=B,t[131]=H,t[132]=W):W=t[132];let G;t[133]===l?G=t[134]:(G=nt(l),t[133]=l,t[134]=G);let K;t[135]===G?K=t[136]:(K=(0,E.jsx)(ie,{commands:G}),t[135]=G,t[136]=K),t[137]!==W||t[138]!==K?(A=(0,E.jsx)(Ne,{value:`connectivity`,children:(0,E.jsxs)(`div`,{className:`space-y-4`,children:[W,K]})}),t[137]=W,t[138]=K,t[139]=A):A=t[139];let q;t[140]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,E.jsx)(w.Header,{children:`Configuration`}),t[140]=q):q=t[140];let J;t[141]===l.Engine?J=t[142]:(J=(0,E.jsx)(T,{label:`Engine`,value:l.Engine}),t[141]=l.Engine,t[142]=J);let Y;t[143]===l.EngineVersion?Y=t[144]:(Y=(0,E.jsx)(T,{label:`Version`,value:l.EngineVersion}),t[143]=l.EngineVersion,t[144]=Y);let X;t[145]===l.DBInstanceClass?X=t[146]:(X=(0,E.jsx)(T,{label:`Instance class`,value:l.DBInstanceClass}),t[145]=l.DBInstanceClass,t[146]=X);let gt=l.AllocatedStorage?`${l.AllocatedStorage} GiB`:void 0,Z;t[147]===gt?Z=t[148]:(Z=(0,E.jsx)(T,{label:`Allocated storage`,value:gt}),t[147]=gt,t[148]=Z);let Q;t[149]===l.StorageType?Q=t[150]:(Q=(0,E.jsx)(T,{label:`Storage type`,value:l.StorageType}),t[149]=l.StorageType,t[150]=Q);let _t=l.StorageEncrypted?`Encrypted — always on`:`Not encrypted`,$;t[151]===_t?$=t[152]:($=(0,E.jsx)(T,{label:`Encryption`,value:_t}),t[151]=_t,t[152]=$);let vt;t[153]===l.DBParameterGroups?vt=t[154]:(vt=l.DBParameterGroups?.map(it).join(`, `),t[153]=l.DBParameterGroups,t[154]=vt);let yt;t[155]===vt?yt=t[156]:(yt=(0,E.jsx)(T,{label:`Parameter group`,value:vt}),t[155]=vt,t[156]=yt);let bt;t[157]===l.MasterUsername?bt=t[158]:(bt=(0,E.jsx)(T,{label:`Master username`,value:l.MasterUsername}),t[157]=l.MasterUsername,t[158]=bt);let xt;t[159]===l.DBName?xt=t[160]:(xt=(0,E.jsx)(T,{label:`Initial database`,value:l.DBName}),t[159]=l.DBName,t[160]=xt);let St=l.DeletionProtection?`On`:`Off`,Ct;t[161]===St?Ct=t[162]:(Ct=(0,E.jsx)(T,{label:`Deletion protection`,value:St}),t[161]=St,t[162]=Ct);let wt;t[163]===l.InstanceCreateTime?wt=t[164]:(wt=ee(l.InstanceCreateTime),t[163]=l.InstanceCreateTime,t[164]=wt);let Tt;t[165]===wt?Tt=t[166]:(Tt=(0,E.jsx)(T,{label:`Created`,value:wt}),t[165]=wt,t[166]=Tt);let Et;t[167]!==J||t[168]!==Y||t[169]!==X||t[170]!==Z||t[171]!==Q||t[172]!==$||t[173]!==yt||t[174]!==bt||t[175]!==xt||t[176]!==Ct||t[177]!==Tt?(Et=(0,E.jsxs)(w,{children:[q,(0,E.jsxs)(w.Content,{children:[J,Y,X,Z,Q,$,yt,bt,xt,Ct,Tt]})]}),t[167]=J,t[168]=Y,t[169]=X,t[170]=Z,t[171]=Q,t[172]=$,t[173]=yt,t[174]=bt,t[175]=xt,t[176]=Ct,t[177]=Tt,t[178]=Et):Et=t[178];let Dt;t[179]!==oe||t[180]!==s?(Dt=oe&&(0,E.jsxs)(w,{children:[(0,E.jsx)(w.Header,{children:`Pending Changes`}),(0,E.jsxs)(w.Content,{children:[(0,E.jsx)(T,{label:`Instance class`,value:s?.DBInstanceClass}),(0,E.jsx)(T,{label:`Allocated storage`,value:s?.AllocatedStorage?`${s.AllocatedStorage} GiB`:void 0})]})]}),t[179]=oe,t[180]=s,t[181]=Dt):Dt=t[181],t[182]!==Et||t[183]!==Dt?(j=(0,E.jsx)(Ne,{value:`configuration`,children:(0,E.jsxs)(`div`,{className:`space-y-4`,children:[Et,Dt]})}),t[182]=Et,t[183]=Dt,t[184]=j):j=t[184],ze=Ne,O=`backups`,Qe=`space-y-4`,$e=e&&(0,E.jsxs)(`div`,{className:`rounded-md border border-tactical-amber/40 bg-tactical-amber/5 p-4 text-sm`,role:`alert`,children:[(0,E.jsx)(`p`,{className:`font-medium`,children:`An automated backup failed`}),(0,E.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.Message,` (`,ee(e.Date),`)`]})]}),et=r&&(0,E.jsxs)(`div`,{className:`rounded-md border border-tactical-amber/40 bg-tactical-amber/5 p-4 text-sm`,role:`alert`,children:[(0,E.jsx)(`p`,{className:`font-medium`,children:`A backup raised a warning`}),(0,E.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[r.Message,` (`,ee(r.Date),`)`]})]}),Re=w,t[185]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,E.jsx)(w.Header,{children:`Automated Backups`}),t[185]=Ze):Ze=t[185],Le=w.Content;let Ot=l.BackupRetentionPeriod===0?`Disabled`:`${l.BackupRetentionPeriod} days`;t[186]===Ot?F=t[187]:(F=(0,E.jsx)(T,{label:`Retention`,value:Ot}),t[186]=Ot,t[187]=F);let kt=o?.Status??`None — automated backups are off`;t[188]===kt?I=t[189]:(I=(0,E.jsx)(T,{label:`Status`,value:kt}),t[188]=kt,t[189]=I),t[190]===l.PreferredBackupWindow?Ye=t[191]:(Ye=(0,E.jsx)(T,{label:`Preferred backup window`,value:l.PreferredBackupWindow}),t[190]=l.PreferredBackupWindow,t[191]=Ye),t[192]===l.PreferredMaintenanceWindow?Xe=t[193]:(Xe=(0,E.jsx)(T,{label:`Preferred maintenance window`,value:l.PreferredMaintenanceWindow}),t[192]=l.PreferredMaintenanceWindow,t[193]=Xe),Ie=T,pt=`Last backup`,mt=a?.SnapshotCreateTime&&ee(a.SnapshotCreateTime),t[11]=v.DBInstanceAutomatedBackups?.[0],t[12]=n,t[13]=ke,t[14]=l,t[15]=Fe,t[16]=x,t[17]=ge.DBSnapshots,t[18]=y,t[19]=C,t[20]=b,t[21]=Ie,t[22]=Le,t[23]=Re,t[24]=ze,t[25]=Be,t[26]=Je,t[27]=Ye,t[28]=Xe,t[29]=Ze,t[30]=Qe,t[31]=$e,t[32]=et,t[33]=O,t[34]=rt,t[35]=k,t[36]=A,t[37]=j,t[38]=dt,t[39]=M,t[40]=N,t[41]=ft,t[42]=P,t[43]=pt,t[44]=mt,t[45]=F,t[46]=I}else Ie=t[21],Le=t[22],Re=t[23],ze=t[24],Be=t[25],Je=t[26],Ye=t[27],Xe=t[28],Ze=t[29],Qe=t[30],$e=t[31],et=t[32],O=t[33],rt=t[34],k=t[35],A=t[36],j=t[37],dt=t[38],M=t[39],N=t[40],ft=t[41],P=t[42],pt=t[43],mt=t[44],F=t[45],I=t[46];let L;t[194]!==Ie||t[195]!==pt||t[196]!==mt?(L=(0,E.jsx)(Ie,{label:pt,value:mt}),t[194]=Ie,t[195]=pt,t[196]=mt,t[197]=L):L=t[197];let R;t[198]!==Le||t[199]!==Ye||t[200]!==Xe||t[201]!==L||t[202]!==F||t[203]!==I?(R=(0,E.jsxs)(Le,{children:[F,I,Ye,Xe,L]}),t[198]=Le,t[199]=Ye,t[200]=Xe,t[201]=L,t[202]=F,t[203]=I,t[204]=R):R=t[204];let z;t[205]!==Re||t[206]!==Ze||t[207]!==R?(z=(0,E.jsxs)(Re,{children:[Ze,R]}),t[205]=Re,t[206]=Ze,t[207]=R,t[208]=z):z=t[208];let ht;t[209]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,E.jsx)(`h3`,{className:`text-sm font-medium`,children:`Snapshots`}),t[209]=ht):ht=t[209];let B;t[210]!==r||t[211]!==Je?(B=(0,E.jsxs)(`div`,{className:`space-y-2`,children:[ht,Je.length>0?(0,E.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,E.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,E.jsx)(`thead`,{children:(0,E.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Identifier`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Type`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Created`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,E.jsx)(`tbody`,{children:Je.map(e=>{let t=e.DBSnapshotIdentifier;return t?(0,E.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,E.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,E.jsx)(o,{className:`text-primary hover:underline`,params:{id:t},to:`/rds/describe-db-snapshots/$id`,children:t})}),(0,E.jsx)(`td`,{className:`px-4 py-2`,children:e.SnapshotType}),(0,E.jsx)(`td`,{className:`px-4 py-2`,children:(0,E.jsx)(Ae,{state:e.Status})}),(0,E.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:ee(e.SnapshotCreateTime)}),(0,E.jsxs)(`td`,{className:`space-x-2 px-4 py-2 text-right`,children:[(0,E.jsx)(c,{disabled:!f(e.Status),onClick:async()=>await r({to:`/rds/restore-db-instance-from-db-snapshot/$id`,params:{id:t}}),size:`sm`,variant:`outline`,children:`Restore`}),(0,E.jsx)(c,{disabled:!p(e.Status,e.SnapshotType),onClick:()=>De(t),size:`sm`,variant:`destructive`,children:`Delete`})]})]},t):null})})]})}):(0,E.jsx)(`p`,{className:`text-muted-foreground`,children:`No snapshots of this instance.`})]}),t[210]=r,t[211]=Je,t[212]=B):B=t[212];let V;t[213]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,E.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Automated backups are daily snapshots taken in the backup window, deleted by retention rather than by hand. There is no point-in-time restore.`}),t[213]=V):V=t[213];let H;t[214]!==Qe||t[215]!==$e||t[216]!==et||t[217]!==z||t[218]!==B?(H=(0,E.jsxs)(`div`,{className:Qe,children:[$e,et,z,B,V]}),t[214]=Qe,t[215]=$e,t[216]=et,t[217]=z,t[218]=B,t[219]=H):H=t[219];let U;t[220]!==ze||t[221]!==O||t[222]!==H?(U=(0,E.jsx)(ze,{value:O,children:H}),t[220]=ze,t[221]=O,t[222]=H,t[223]=U):U=t[223];let W;t[224]===u?W=t[225]:(W=(0,E.jsx)(Ne,{value:`tags`,children:(0,E.jsx)(We,{arn:u})}),t[224]=u,t[225]=W);let G;t[226]===ke?G=t[227]:(G=(0,E.jsx)(Ne,{value:`events`,children:(0,E.jsx)(Ue,{events:ke})}),t[226]=ke,t[227]=G);let K;t[228]!==Be||t[229]!==rt||t[230]!==k||t[231]!==A||t[232]!==j||t[233]!==U||t[234]!==W||t[235]!==G?(K=(0,E.jsxs)(Be,{defaultValue:rt,children:[k,A,j,U,W,G]}),t[228]=Be,t[229]=rt,t[230]=k,t[231]=A,t[232]=j,t[233]=U,t[234]=W,t[235]=G,t[236]=K):K=t[236];let q;t[237]!==dt||t[238]!==M||t[239]!==N||t[240]!==K?(q=(0,E.jsxs)(`div`,{className:dt,children:[M,N,K]}),t[237]=dt,t[238]=M,t[239]=N,t[240]=K,t[241]=q):q=t[241];let J;t[242]!==l||t[243]!==S?(J=S&&(0,E.jsx)(D,{instance:l,onOpenChange:Ce,open:!0}),t[242]=l,t[243]=S,t[244]=J):J=t[244];let Y;t[245]!==n||t[246]!==we?(Y=we&&(0,E.jsx)(Ve,{dbInstanceIdentifier:n,onOpenChange:Te,open:!0}),t[245]=n,t[246]=we,t[247]=Y):Y=t[247];let X;t[248]===Ee?X=t[249]:(X=Ee&&(0,E.jsx)(He,{dbSnapshotIdentifier:Ee,onOpenChange:e=>!e&&De(null),open:!0}),t[248]=Ee,t[249]=X);let gt=l.DeletionProtection??!1,Z;t[250]===r?Z=t[251]:(Z=async()=>await r({to:`/rds/describe-db-instances`}),t[250]=r,t[251]=Z);let Q;t[252]===Symbol.for(`react.memo_cache_sentinel`)?(Q=()=>{xe(!1),Ce(!0)},t[252]=Q):Q=t[252];let _t;t[253]!==n||t[254]!==ye||t[255]!==gt||t[256]!==Z?(_t=(0,E.jsx)(Ge,{dbInstanceIdentifier:n,deletionProtection:gt,onDeleted:Z,onModify:Q,onOpenChange:xe,open:ye}),t[253]=n,t[254]=ye,t[255]=gt,t[256]=Z,t[257]=_t):_t=t[257];let $;return t[258]!==ft||t[259]!==P||t[260]!==q||t[261]!==J||t[262]!==Y||t[263]!==X||t[264]!==_t?($=(0,E.jsxs)(E.Fragment,{children:[ft,P,q,J,Y,X,_t]}),t[258]=ft,t[259]=P,t[260]=q,t[261]=J,t[262]=Y,t[263]=X,t[264]=_t,t[265]=$):$=t[265],$}function it(e){return`${e.DBParameterGroupName} (${e.ParameterApplyStatus})`}function at(e){return e.VpcSecurityGroupId}function ot(e){return(0,E.jsxs)(`span`,{className:`text-xs text-tactical-amber`,children:[e.StatusType,`: `,e.Message??e.Status]},`${e.StatusType}-${e.Status}`)}function st(e,t){return(e.SnapshotCreateTime?.getTime()??0)-(t.SnapshotCreateTime?.getTime()??0)}function ct(e){return e.SnapshotType===d}function lt(e){return O(e,`backup`)&&O(e,`notification`)}function ut(e){return O(e,`backup`)&&O(e,`failure`)}function k(){let e=(0,qe.c)(2),{id:t}=v.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,E.jsx)(rt,{dbInstanceIdentifier:n}),e[0]=n,e[1]=r),r}export{k as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{t as s}from"./useNavigate.js";import{$t as ee}from"./cluster-config.js";import{t as te}from"./back-link.js";import{t as ne}from"./camera.js";import{t as re}from"./pencil.js";import{t as ie}from"./cli-command-panel.js";import{t as ae}from"./trash-2.js";import{t as c}from"./button.js";import{t as oe}from"./input.js";import{w as l}from"./ec2.js";import{S as u,a as d,c as se,d as f,f as ce,l as p,m as le,p as ue,u as de}from"./rds.js";import{d as fe,l as pe,m,p as h}from"./rds2.js";import{c as me,d as he,l as ge,n as _e,o as g,s as _,t as ve}from"./rds3.js";import{t as v}from"./_id19.js";import{a as y,i as b,n as x,t as ye}from"./zod.js";import{t as be}from"./error-banner.js";import{t as xe}from"./form-actions.js";import{t as Se}from"./page-heading.js";import{a as S,n as Ce,r as we,t as Te}from"./field.js";import{a as Ee,i as De,l as C,s as Oe,t as ke}from"./alert-dialog.js";import{n as w,t as T}from"./detail-row.js";import{t as Ae}from"./state-badge.js";import{i as je,n as Me,r as Ne,t as Pe}from"./tabs.js";import{n as Fe,t as Ie}from"./picker-notice.js";import{a as Le,o as Re,s as ze,t as Be}from"./security-group-checkboxes.js";import{t as Ve}from"./create-db-snapshot-dialog.js";import{t as He}from"./delete-db-snapshot-dialog.js";import{t as Ue}from"./rds-events-panel.js";import{t as We}from"./rds-tags-tab.js";import{t as Ge}from"./delete-db-instance-dialog.js";var Ke=e(n(),1),qe=r(),E=t(),Je=[{label:`Identifier`,note:`The identifier is the endpoint hostname and the certificate subject; renaming in place is not implemented.`},{label:`Engine version`,note:`There is no in-place engine-version upgrade.`},{label:`Port`,note:`The port is fixed at create; changing it would break every client and the serving certificate.`},{label:`DB subnet group`,note:`The endpoint ENI is placed at create; moving it would change the address clients resolve.`}];function D(e){let t=(0,qe.c)(222),{open:n,onOpenChange:r,instance:a}=e,o=pe(),s=i(he),ee=i(l),te=i(g),ne=a.Engine??``,re;t[0]===ne?re=t[1]:(re=ge(ne),t[0]=ne,t[1]=re);let ie=i(re),ae=a.DBInstanceIdentifier??``,c=a.AllocatedStorage??0,d;t[2]===a.VpcSecurityGroups?d=t[3]:(d=a.VpcSecurityGroups?.map(et).filter(Boolean)??[],t[2]=a.VpcSecurityGroups,t[3]=d);let se=d,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=ye(u),t[4]=f):f=t[4];let ce=a.DBInstanceClass??``,p=a.DBParameterGroups?.[0]?.DBParameterGroupName??``,le=a.DeletionProtection??!1,ue=a.BackupRetentionPeriod??0,de=a.PreferredBackupWindow??``,fe=a.PreferredMaintenanceWindow??``,m;t[5]!==se||t[6]!==c||t[7]!==fe||t[8]!==ce||t[9]!==p||t[10]!==le||t[11]!==ue||t[12]!==de?(m={resolver:f,defaultValues:{currentAllocatedStorage:c,dbInstanceClass:ce,allocatedStorage:c,dbParameterGroupName:p,vpcSecurityGroupIds:se,deletionProtection:le,backupRetentionPeriod:ue,preferredBackupWindow:de,preferredMaintenanceWindow:fe,masterUserPassword:``,applyImmediately:!1}},t[5]=se,t[6]=c,t[7]=fe,t[8]=ce,t[9]=p,t[10]=le,t[11]=ue,t[12]=de,t[13]=m):m=t[13];let{control:h,formState:me,handleSubmit:_e,register:_,setValue:ve}=b(m),{errors:v,isSubmitting:Se}=me,w;t[14]===h?w=t[15]:(w={control:h},t[14]=h,t[15]=w);let T=y(w),Ae=T.dbInstanceClass??``,je=T.allocatedStorage??c,Me;t[16]===T.vpcSecurityGroupIds?Me=t[17]:(Me=T.vpcSecurityGroupIds??[],t[16]=T.vpcSecurityGroupIds,t[17]=Me);let Ne=Me,Pe;t[18]===ie.data?.OrderableDBInstanceOptions?Pe=t[19]:(Pe=ie.data?.OrderableDBInstanceOptions??[],t[18]=ie.data?.OrderableDBInstanceOptions,t[19]=Pe);let Ve;t[20]===Pe?Ve=t[21]:(Ve=new Set(Pe.map($e).filter(Boolean)),t[20]=Pe,t[21]=Ve);let He;t[22]===Ve?He=t[23]:(He=[...Ve],t[22]=Ve,t[23]=He);let Ue=He,We,Ge,Ke,D,O,tt,nt,rt,it,at,ot,st,ct,lt,ut,k,A,j,dt,M;if(t[24]!==h||t[25]!==c||t[26]!==te.data?.DBEngineVersions||t[27]!==v.allocatedStorage||t[28]!==_e||t[29]!==ae||t[30]!==a.DBInstanceClass||t[31]!==a.DBSubnetGroup?.VpcId||t[32]!==a.Engine||t[33]!==Ue||t[34]!==o||t[35]!==r||t[36]!==n||t[37]!==ie||t[38]!==s||t[39]!==_||t[40]!==ee||t[41]!==Ae||t[42]!==je||t[43]!==ve){let e;t[64]===s.data?.DBParameterGroups?e=t[65]:(e=s.data?.DBParameterGroups??[],t[64]=s.data?.DBParameterGroups,t[65]=e);let i;t[66]===te.data?.DBEngineVersions?i=t[67]:(i=te.data?.DBEngineVersions??[],t[66]=te.data?.DBEngineVersions,t[67]=i);let ne=ze(e,i,a.Engine??``),re=a.DBSubnetGroup?.VpcId,l;t[68]===ee.data?.SecurityGroups?l=t[69]:(l=ee.data?.SecurityGroups??[],t[68]=ee.data?.SecurityGroups,t[69]=l);let u;if(t[70]!==re||t[71]!==l){let e;t[73]===re?e=t[74]:(e=e=>re===void 0||e.VpcId===re,t[73]=re,t[74]=e),u=l.filter(e),t[70]=re,t[71]=l,t[72]=u}else u=t[72];O=u;let d=Ae!==a.DBInstanceClass,se=je!==c,f=Ue.length===0,ce=`No instance class this cluster's nodes can run is available for ${a.Engine}.`,p;t[75]!==ie||t[76]!==f||t[77]!==ce?(p=Fe(ie,f,{loading:`Loading the instance classes…`,failed:`Could not read the instance classes`,empty:ce}),t[75]=ie,t[76]=f,t[77]=ce,t[78]=p):p=t[78];let le=p,ue=ne.length===0,de;t[79]!==s||t[80]!==ue?(de=Fe(s,ue,{loading:`Loading the parameter groups…`,failed:`Could not read the parameter groups`,empty:`No parameter group of this instance's engine family exists.`}),t[79]=s,t[80]=ue,t[81]=de):de=t[81];let fe=de,pe=O.length===0,m;t[82]!==ee||t[83]!==pe?(m=Fe(ee,pe,{loading:`Loading the security groups…`,failed:`Could not read the security groups`,empty:`No security group in this instance's VPC is available.`}),t[82]=ee,t[83]=pe,t[84]=m):m=t[84],D=m;let me;t[85]===ve?me=t[86]:(me=e=>{ve(`vpcSecurityGroupIds`,e,{shouldValidate:!0})},t[85]=ve,t[86]=me),tt=me;let he;t[87]!==ae||t[88]!==o||t[89]!==r?(he=async e=>{await o.mutateAsync({...e,dbInstanceIdentifier:ae}),r(!1)},t[87]=ae,t[88]=o,t[89]=r,t[90]=he):he=t[90];let ge=he;Ke=ke,dt=r,M=n,Ge=De,A=`max-h-[85vh] overflow-y-auto`;let g;t[91]===ae?g=t[92]:(g=(0,E.jsxs)(C,{children:[`Modify `,ae]}),t[91]=ae,t[92]=g);let y;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,E.jsx)(Ee,{children:`Changes apply in the maintenance window unless you apply them immediately.`}),t[93]=y):y=t[93],t[94]===g?j=t[95]:(j=(0,E.jsxs)(Oe,{children:[g,y]}),t[94]=g,t[95]=j),ct=`space-y-4`,t[96]!==_e||t[97]!==ge?(lt=_e(ge),t[96]=_e,t[97]=ge,t[98]=lt):lt=t[98];let b;t[99]===Ue?b=t[100]:(b=Ue.map(Qe),t[99]=Ue,t[100]=b);let x=d&&`Changing the class replaces the VM. The database is unavailable while it does.`;t[101]!==le||t[102]!==h||t[103]!==b||t[104]!==x?(ut=(0,E.jsx)(Re,{control:h,id:`modify-class`,label:`DB instance class`,name:`dbInstanceClass`,notice:le,options:b,placeholder:`Select an instance class`,warning:x}),t[101]=le,t[102]=h,t[103]=b,t[104]=x,t[105]=ut):ut=t[105];let ye;t[106]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,E.jsx)(S,{children:(0,E.jsx)(`label`,{htmlFor:`modify-storage`,children:`Allocated storage (GiB)`})}),t[106]=ye):ye=t[106];let be=!!v.allocatedStorage,xe;t[107]===_?xe=t[108]:(xe=_(`allocatedStorage`,{valueAsNumber:!0}),t[107]=_,t[108]=xe);let Se;t[109]!==c||t[110]!==be||t[111]!==xe?(Se=(0,E.jsx)(oe,{"aria-invalid":be,id:`modify-storage`,min:c,type:`number`,...xe}),t[109]=c,t[110]=be,t[111]=xe,t[112]=Se):Se=t[112];let w;t[113]===c?w=t[114]:(w=(0,E.jsxs)(Ce,{children:[`Currently `,c,` GiB. Storage grows only.`]}),t[113]=c,t[114]=w);let T;t[115]===se?T=t[116]:(T=se&&(0,E.jsx)(`p`,{className:`text-xs text-tactical-amber`,children:`Growing storage stops and starts the instance to extend the filesystem.`}),t[115]=se,t[116]=T);let Me;t[117]===v.allocatedStorage?Me=t[118]:(Me=(0,E.jsx)(we,{errors:[v.allocatedStorage]}),t[117]=v.allocatedStorage,t[118]=Me),t[119]!==Se||t[120]!==w||t[121]!==T||t[122]!==Me?(k=(0,E.jsxs)(Te,{children:[ye,Se,w,T,Me]}),t[119]=Se,t[120]=w,t[121]=T,t[122]=Me,t[123]=k):k=t[123],We=Re,nt=h,rt=`modify-parameter-group`,it=`DB parameter group`,at=`dbParameterGroupName`,ot=fe,st=ne.map(Ze),t[24]=h,t[25]=c,t[26]=te.data?.DBEngineVersions,t[27]=v.allocatedStorage,t[28]=_e,t[29]=ae,t[30]=a.DBInstanceClass,t[31]=a.DBSubnetGroup?.VpcId,t[32]=a.Engine,t[33]=Ue,t[34]=o,t[35]=r,t[36]=n,t[37]=ie,t[38]=s,t[39]=_,t[40]=ee,t[41]=Ae,t[42]=je,t[43]=ve,t[44]=We,t[45]=Ge,t[46]=Ke,t[47]=D,t[48]=O,t[49]=tt,t[50]=nt,t[51]=rt,t[52]=it,t[53]=at,t[54]=ot,t[55]=st,t[56]=ct,t[57]=lt,t[58]=ut,t[59]=k,t[60]=A,t[61]=j,t[62]=dt,t[63]=M}else We=t[44],Ge=t[45],Ke=t[46],D=t[47],O=t[48],tt=t[49],nt=t[50],rt=t[51],it=t[52],at=t[53],ot=t[54],st=t[55],ct=t[56],lt=t[57],ut=t[58],k=t[59],A=t[60],j=t[61],dt=t[62],M=t[63];let N;t[124]!==We||t[125]!==nt||t[126]!==rt||t[127]!==it||t[128]!==at||t[129]!==ot||t[130]!==st?(N=(0,E.jsx)(We,{control:nt,id:rt,label:it,name:at,notice:ot,options:st,placeholder:`Engine default group`}),t[124]=We,t[125]=nt,t[126]=rt,t[127]=it,t[128]=at,t[129]=ot,t[130]=st,t[131]=N):N=t[131];let ft;t[132]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,E.jsx)(S,{children:`VPC security groups`}),t[132]=ft):ft=t[132];let P;t[133]!==D||t[134]!==O||t[135]!==Ne||t[136]!==tt?(P=(0,E.jsxs)(Te,{children:[ft,D?(0,E.jsx)(Ie,{notice:D}):(0,E.jsx)(Be,{emptyText:`No security group in this instance's VPC is available.`,groups:O,onChange:tt,selected:Ne})]}),t[133]=D,t[134]=O,t[135]=Ne,t[136]=tt,t[137]=P):P=t[137];let pt;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(pt=(0,E.jsx)(S,{children:(0,E.jsx)(`label`,{htmlFor:`modify-retention`,children:`Backup retention (days)`})}),t[138]=pt):pt=t[138];let mt=!!v.backupRetentionPeriod,F;t[139]===_?F=t[140]:(F=_(`backupRetentionPeriod`,{valueAsNumber:!0}),t[139]=_,t[140]=F);let I;t[141]!==mt||t[142]!==F?(I=(0,E.jsx)(oe,{"aria-invalid":mt,id:`modify-retention`,max:7,min:0,type:`number`,...F}),t[141]=mt,t[142]=F,t[143]=I):I=t[143];let L;t[144]===v.backupRetentionPeriod?L=t[145]:(L=(0,E.jsx)(we,{errors:[v.backupRetentionPeriod]}),t[144]=v.backupRetentionPeriod,t[145]=L);let R;t[146]!==I||t[147]!==L?(R=(0,E.jsxs)(Te,{children:[pt,I,L]}),t[146]=I,t[147]=L,t[148]=R):R=t[148];let z;t[149]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,E.jsx)(S,{children:(0,E.jsx)(`label`,{htmlFor:`modify-backup-window`,children:`Preferred backup window`})}),t[149]=z):z=t[149];let ht=!!v.preferredBackupWindow,B;t[150]===_?B=t[151]:(B=_(`preferredBackupWindow`),t[150]=_,t[151]=B);let V;t[152]!==ht||t[153]!==B?(V=(0,E.jsx)(oe,{"aria-invalid":ht,id:`modify-backup-window`,placeholder:`hh24:mi-hh24:mi in UTC`,...B}),t[152]=ht,t[153]=B,t[154]=V):V=t[154];let H;t[155]===v.preferredBackupWindow?H=t[156]:(H=(0,E.jsx)(we,{errors:[v.preferredBackupWindow]}),t[155]=v.preferredBackupWindow,t[156]=H);let U;t[157]!==V||t[158]!==H?(U=(0,E.jsxs)(Te,{children:[z,V,H]}),t[157]=V,t[158]=H,t[159]=U):U=t[159];let W;t[160]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,E.jsx)(S,{children:(0,E.jsx)(`label`,{htmlFor:`modify-maintenance-window`,children:`Preferred maintenance window`})}),t[160]=W):W=t[160];let G=!!v.preferredMaintenanceWindow,K;t[161]===_?K=t[162]:(K=_(`preferredMaintenanceWindow`),t[161]=_,t[162]=K);let q;t[163]!==G||t[164]!==K?(q=(0,E.jsx)(oe,{"aria-invalid":G,id:`modify-maintenance-window`,placeholder:`ddd:hh24:mi-ddd:hh24:mi in UTC`,...K}),t[163]=G,t[164]=K,t[165]=q):q=t[165];let J;t[166]===v.preferredMaintenanceWindow?J=t[167]:(J=(0,E.jsx)(we,{errors:[v.preferredMaintenanceWindow]}),t[166]=v.preferredMaintenanceWindow,t[167]=J);let Y;t[168]!==q||t[169]!==J?(Y=(0,E.jsxs)(Te,{children:[W,q,J]}),t[168]=q,t[169]=J,t[170]=Y):Y=t[170];let X;t[171]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,E.jsx)(S,{children:(0,E.jsx)(`label`,{htmlFor:`modify-password`,children:`Reset master password`})}),t[171]=X):X=t[171];let gt=!!v.masterUserPassword,Z;t[172]===_?Z=t[173]:(Z=_(`masterUserPassword`),t[172]=_,t[173]=Z);let Q;t[174]!==gt||t[175]!==Z?(Q=(0,E.jsx)(oe,{"aria-invalid":gt,id:`modify-password`,type:`password`,...Z}),t[174]=gt,t[175]=Z,t[176]=Q):Q=t[176];let _t;t[177]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,E.jsx)(Ce,{children:`Leave blank to keep the current password.`}),t[177]=_t):_t=t[177];let $;t[178]===v.masterUserPassword?$=t[179]:($=(0,E.jsx)(we,{errors:[v.masterUserPassword]}),t[178]=v.masterUserPassword,t[179]=$);let vt;t[180]!==Q||t[181]!==$?(vt=(0,E.jsxs)(Te,{children:[X,Q,_t,$]}),t[180]=Q,t[181]=$,t[182]=vt):vt=t[182];let yt;t[183]===h?yt=t[184]:(yt=(0,E.jsx)(Le,{control:h,name:`deletionProtection`}),t[183]=h,t[184]=yt);let bt;t[185]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,E.jsx)(S,{children:`Apply immediately`}),t[185]=bt):bt=t[185];let xt;t[186]===h?xt=t[187]:(xt=(0,E.jsxs)(Te,{children:[bt,(0,E.jsx)(x,{control:h,name:`applyImmediately`,render:Xe})]}),t[186]=h,t[187]=xt);let St;t[188]===Symbol.for(`react.memo_cache_sentinel`)?(St=(0,E.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border p-3`,children:[(0,E.jsx)(`h3`,{className:`text-xs font-medium`,children:`Fixed at create`}),Je.map(Ye)]}),t[188]=St):St=t[188];let Ct;t[189]===o.error?Ct=t[190]:(Ct=o.error&&(0,E.jsx)(be,{error:o.error,msg:`Failed to modify the DB instance`}),t[189]=o.error,t[190]=Ct);let wt;t[191]===r?wt=t[192]:(wt=()=>{r(!1)},t[191]=r,t[192]=wt);let Tt;t[193]!==Se||t[194]!==o.isPending||t[195]!==wt?(Tt=(0,E.jsx)(`div`,{className:`flex justify-end`,children:(0,E.jsx)(xe,{isPending:o.isPending,isSubmitting:Se,onCancel:wt,pendingLabel:`Saving…`,submitLabel:`Save Changes`})}),t[193]=Se,t[194]=o.isPending,t[195]=wt,t[196]=Tt):Tt=t[196];let Et;t[197]!==ct||t[198]!==lt||t[199]!==ut||t[200]!==k||t[201]!==N||t[202]!==P||t[203]!==R||t[204]!==U||t[205]!==Y||t[206]!==vt||t[207]!==yt||t[208]!==xt||t[209]!==Ct||t[210]!==Tt?(Et=(0,E.jsxs)(`form`,{className:ct,onSubmit:lt,children:[ut,k,N,P,R,U,Y,vt,yt,xt,St,Ct,Tt]}),t[197]=ct,t[198]=lt,t[199]=ut,t[200]=k,t[201]=N,t[202]=P,t[203]=R,t[204]=U,t[205]=Y,t[206]=vt,t[207]=yt,t[208]=xt,t[209]=Ct,t[210]=Tt,t[211]=Et):Et=t[211];let Dt;t[212]!==Ge||t[213]!==A||t[214]!==j||t[215]!==Et?(Dt=(0,E.jsxs)(Ge,{className:A,children:[j,Et]}),t[212]=Ge,t[213]=A,t[214]=j,t[215]=Et,t[216]=Dt):Dt=t[216];let Ot;return t[217]!==Ke||t[218]!==dt||t[219]!==M||t[220]!==Dt?(Ot=(0,E.jsx)(Ke,{onOpenChange:dt,open:M,children:Dt}),t[217]=Ke,t[218]=dt,t[219]=M,t[220]=Dt,t[221]=Ot):Ot=t[221],Ot}function Ye(e){return(0,E.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,E.jsx)(`span`,{className:`font-medium`,children:e.label}),` —`,` `,e.note]},e.label)}function Xe(e){let{field:t}=e;return(0,E.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,E.jsx)(`input`,{"aria-label":`Apply immediately`,checked:t.value,onChange:e=>{t.onChange(e.target.checked)},type:`checkbox`}),(0,E.jsx)(`span`,{children:`Apply now instead of waiting for the maintenance window`})]})}function Ze(e){return{value:e.DBParameterGroupName??``,label:e.DBParameterGroupName??``}}function Qe(e){return{value:e,label:e}}function $e(e){return e.DBInstanceClass??``}function et(e){return e.VpcSecurityGroupId??``}function O(e,t){return e.EventCategories?.includes(t)??!1}function tt(e,t){return e.filter(t).toSorted((e,t)=>(e.Date?.getTime()??0)-(t.Date?.getTime()??0)).at(-1)}function nt(e){let t=e.Endpoint?.Address;if(!t)return[];let n=e.Endpoint?.Port??e.DbInstancePort,r=e.MasterUsername??``,i=e.DBName??r;return e.Engine===`postgres`?[{label:`Connect`,parts:[{type:`bin`,value:`psql`},{type:`value`,value:` "host=${t} port=${n} dbname=${i} user=${r} sslmode=require"`}]}]:[{label:`Connect`,parts:[{type:`bin`,value:`mariadb`},{type:`flag`,value:` --host`},{type:`value`,value:`=${t}`},{type:`flag`,value:` --port`},{type:`value`,value:`=${n}`},{type:`flag`,value:` --user`},{type:`value`,value:`=${r}`},{type:`flag`,value:` --ssl`},{type:`value`,value:` ${i}`}]}]}function rt(e){let t=(0,qe.c)(266),{dbInstanceIdentifier:n}=e,r=s(),i;t[0]===n?i=t[1]:(i=_e(n),t[0]=n,t[1]=i);let{data:oe}=a(i),l=oe.DBInstances?.[0],u=l?.DBInstanceArn??``,d;t[2]===n?d=t[3]:(d=_(n),t[2]=n,t[3]=d);let{data:pe}=a(d),he;t[4]===n?he=t[5]:(he=me(n),t[4]=n,t[5]=he);let{data:ge}=a(he),g;t[6]===n?g=t[7]:(g=ve(n),t[6]=n,t[7]=g);let{data:v}=a(g),y=h(),b=m(),x=fe(),[ye,xe]=(0,Ke.useState)(!1),[S,Ce]=(0,Ke.useState)(!1),[we,Te]=(0,Ke.useState)(!1),[Ee,De]=(0,Ke.useState)(null);if(!l?.DBInstanceIdentifier){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(te,{to:`/rds/describe-db-instances`,children:`Back to databases`}),(0,E.jsx)(`p`,{className:`text-muted-foreground`,children:`DB instance not found.`})]}),t[8]=e):e=t[8],e}let C=l.DBInstanceStatus,Oe;t[9]===pe.Events?Oe=t[10]:(Oe=pe.Events??[],t[9]=pe.Events,t[10]=Oe);let ke=Oe,Fe=y.error??b.error??x.error,Ie,Le,Re,ze,Be,Je,Ye,Xe,Ze,Qe,$e,et,O,rt,k,A,j,dt,M,N,ft,P,pt,mt,F,I;if(t[11]!==v.DBInstanceAutomatedBackups?.[0]||t[12]!==n||t[13]!==ke||t[14]!==l||t[15]!==Fe||t[16]!==x||t[17]!==ge.DBSnapshots||t[18]!==y||t[19]!==C||t[20]!==b){let e=tt(ke,ut),r=tt(ke,lt),i;t[47]===ge.DBSnapshots?i=t[48]:(i=ge.DBSnapshots??[],t[47]=ge.DBSnapshots,t[48]=i),Je=i;let a=Je.filter(ct).toSorted(st).at(-1),o=v.DBInstanceAutomatedBackups?.[0],s=l.PendingModifiedValues,oe=s?.AllocatedStorage!==void 0||s?.DBInstanceClass!==void 0;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,E.jsx)(te,{to:`/rds/describe-db-instances`,children:`Back to databases`}),t[49]=ft):ft=t[49],t[50]===Fe?P=t[51]:(P=Fe&&(0,E.jsx)(be,{error:Fe,msg:`Failed to change the DB instance state.`}),t[50]=Fe,t[51]=P),dt=`space-y-6`;let u;t[52]!==y.isPending||t[53]!==C?(u=!ue(C)||y.isPending,t[52]=y.isPending,t[53]=C,t[54]=u):u=t[54];let d;t[55]!==n||t[56]!==y?(d=()=>{y.mutate(n)},t[55]=n,t[56]=y,t[57]=d):d=t[57];let f;t[58]!==u||t[59]!==d?(f=(0,E.jsx)(c,{disabled:u,onClick:d,size:`sm`,variant:`outline`,children:`Start`}),t[58]=u,t[59]=d,t[60]=f):f=t[60];let p;t[61]!==C||t[62]!==b.isPending?(p=!le(C)||b.isPending,t[61]=C,t[62]=b.isPending,t[63]=p):p=t[63];let fe;t[64]!==n||t[65]!==b?(fe=()=>{b.mutate(n)},t[64]=n,t[65]=b,t[66]=fe):fe=t[66];let pe;t[67]!==p||t[68]!==fe?(pe=(0,E.jsx)(c,{disabled:p,onClick:fe,size:`sm`,variant:`outline`,children:`Stop`}),t[67]=p,t[68]=fe,t[69]=pe):pe=t[69];let m;t[70]!==x.isPending||t[71]!==C?(m=!de(C)||x.isPending,t[70]=x.isPending,t[71]=C,t[72]=m):m=t[72];let h;t[73]!==n||t[74]!==x?(h=()=>{x.mutate(n)},t[73]=n,t[74]=x,t[75]=h):h=t[75];let me;t[76]!==m||t[77]!==h?(me=(0,E.jsx)(c,{disabled:m,onClick:h,size:`sm`,variant:`outline`,children:`Reboot`}),t[76]=m,t[77]=h,t[78]=me):me=t[78];let he;t[79]===C?he=t[80]:(he=ce(C),t[79]=C,t[80]=he);let _e=!he,g;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{Te(!0)},t[81]=g):g=t[81];let _;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,E.jsx)(ne,{className:`size-4`}),t[82]=_):_=t[82];let ve;t[83]===_e?ve=t[84]:(ve=(0,E.jsxs)(c,{disabled:_e,onClick:g,size:`sm`,variant:`outline`,children:[_,`Take Snapshot`]}),t[83]=_e,t[84]=ve);let ye;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(ye=()=>{Ce(!0)},t[85]=ye):ye=t[85];let S;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,E.jsxs)(c,{onClick:ye,size:`sm`,variant:`outline`,children:[(0,E.jsx)(re,{className:`size-4`}),`Modify`]}),t[86]=S):S=t[86];let we;t[87]===C?we=t[88]:(we=se(C),t[87]=C,t[88]=we);let Ee=!we,De;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(De=()=>{xe(!0)},t[89]=De):De=t[89];let Oe;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,E.jsx)(ae,{className:`size-4`}),t[90]=Oe):Oe=t[90];let Ve;t[91]===Ee?Ve=t[92]:(Ve=(0,E.jsxs)(c,{disabled:Ee,onClick:De,size:`sm`,variant:`destructive`,children:[Oe,`Delete`]}),t[91]=Ee,t[92]=Ve);let He;t[93]!==f||t[94]!==pe||t[95]!==me||t[96]!==ve||t[97]!==Ve?(He=(0,E.jsxs)(`div`,{className:`flex gap-2`,children:[f,pe,me,ve,S,Ve]}),t[93]=f,t[94]=pe,t[95]=me,t[96]=ve,t[97]=Ve,t[98]=He):He=t[98],t[99]!==n||t[100]!==He?(M=(0,E.jsx)(Se,{actions:He,subtitle:`DB Instance`,title:n}),t[99]=n,t[100]=He,t[101]=M):M=t[101];let Ue;t[102]===C?Ue=t[103]:(Ue=(0,E.jsx)(Ae,{state:C}),t[102]=C,t[103]=Ue);let We;t[104]===l.StatusInfos?We=t[105]:(We=l.StatusInfos?.map(ot),t[104]=l.StatusInfos,t[105]=We),t[106]!==Ue||t[107]!==We?(N=(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[Ue,We]}),t[106]=Ue,t[107]=We,t[108]=N):N=t[108],Be=Pe,rt=`connectivity`,t[109]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,E.jsxs)(Me,{children:[(0,E.jsx)(je,{value:`connectivity`,children:`Connectivity`}),(0,E.jsx)(je,{value:`configuration`,children:`Configuration`}),(0,E.jsx)(je,{value:`backups`,children:`Backups`}),(0,E.jsx)(je,{value:`tags`,children:`Tags`}),(0,E.jsx)(je,{value:`events`,children:`Events`})]}),t[109]=k):k=t[109];let Ge;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,E.jsx)(w.Header,{children:`Endpoint`}),t[110]=Ge):Ge=t[110];let Ke=l.Endpoint?.Address,qe;t[111]===Ke?qe=t[112]:(qe=(0,E.jsx)(T,{label:`Address`,value:Ke}),t[111]=Ke,t[112]=qe);let D;t[113]!==l.DbInstancePort||t[114]!==l.Endpoint?.Port?(D=(l.Endpoint?.Port??l.DbInstancePort)?.toString(),t[113]=l.DbInstancePort,t[114]=l.Endpoint?.Port,t[115]=D):D=t[115];let L;t[116]===D?L=t[117]:(L=(0,E.jsx)(T,{label:`Port`,value:D}),t[116]=D,t[117]=L);let R=l.DBSubnetGroup?.VpcId,z;t[118]===R?z=t[119]:(z=(0,E.jsx)(T,{label:`VPC`,value:R}),t[118]=R,t[119]=z);let ht=l.DBSubnetGroup?.DBSubnetGroupName,B;t[120]===ht?B=t[121]:(B=(0,E.jsx)(T,{label:`DB subnet group`,value:ht}),t[120]=ht,t[121]=B);let V;t[122]===l.VpcSecurityGroups?V=t[123]:(V=l.VpcSecurityGroups?.map(at).join(`, `),t[122]=l.VpcSecurityGroups,t[123]=V);let H;t[124]===V?H=t[125]:(H=(0,E.jsx)(T,{label:`Security groups`,value:V}),t[124]=V,t[125]=H);let U;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,E.jsx)(T,{label:`Publicly accessible`,value:`No — private VPC address`}),t[126]=U):U=t[126];let W;t[127]!==qe||t[128]!==L||t[129]!==z||t[130]!==B||t[131]!==H?(W=(0,E.jsxs)(w,{children:[Ge,(0,E.jsxs)(w.Content,{children:[qe,L,z,B,H,U]})]}),t[127]=qe,t[128]=L,t[129]=z,t[130]=B,t[131]=H,t[132]=W):W=t[132];let G;t[133]===l?G=t[134]:(G=nt(l),t[133]=l,t[134]=G);let K;t[135]===G?K=t[136]:(K=(0,E.jsx)(ie,{commands:G}),t[135]=G,t[136]=K),t[137]!==W||t[138]!==K?(A=(0,E.jsx)(Ne,{value:`connectivity`,children:(0,E.jsxs)(`div`,{className:`space-y-4`,children:[W,K]})}),t[137]=W,t[138]=K,t[139]=A):A=t[139];let q;t[140]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,E.jsx)(w.Header,{children:`Configuration`}),t[140]=q):q=t[140];let J;t[141]===l.Engine?J=t[142]:(J=(0,E.jsx)(T,{label:`Engine`,value:l.Engine}),t[141]=l.Engine,t[142]=J);let Y;t[143]===l.EngineVersion?Y=t[144]:(Y=(0,E.jsx)(T,{label:`Version`,value:l.EngineVersion}),t[143]=l.EngineVersion,t[144]=Y);let X;t[145]===l.DBInstanceClass?X=t[146]:(X=(0,E.jsx)(T,{label:`Instance class`,value:l.DBInstanceClass}),t[145]=l.DBInstanceClass,t[146]=X);let gt=l.AllocatedStorage?`${l.AllocatedStorage} GiB`:void 0,Z;t[147]===gt?Z=t[148]:(Z=(0,E.jsx)(T,{label:`Allocated storage`,value:gt}),t[147]=gt,t[148]=Z);let Q;t[149]===l.StorageType?Q=t[150]:(Q=(0,E.jsx)(T,{label:`Storage type`,value:l.StorageType}),t[149]=l.StorageType,t[150]=Q);let _t=l.StorageEncrypted?`Encrypted — always on`:`Not encrypted`,$;t[151]===_t?$=t[152]:($=(0,E.jsx)(T,{label:`Encryption`,value:_t}),t[151]=_t,t[152]=$);let vt;t[153]===l.DBParameterGroups?vt=t[154]:(vt=l.DBParameterGroups?.map(it).join(`, `),t[153]=l.DBParameterGroups,t[154]=vt);let yt;t[155]===vt?yt=t[156]:(yt=(0,E.jsx)(T,{label:`Parameter group`,value:vt}),t[155]=vt,t[156]=yt);let bt;t[157]===l.MasterUsername?bt=t[158]:(bt=(0,E.jsx)(T,{label:`Master username`,value:l.MasterUsername}),t[157]=l.MasterUsername,t[158]=bt);let xt;t[159]===l.DBName?xt=t[160]:(xt=(0,E.jsx)(T,{label:`Initial database`,value:l.DBName}),t[159]=l.DBName,t[160]=xt);let St=l.DeletionProtection?`On`:`Off`,Ct;t[161]===St?Ct=t[162]:(Ct=(0,E.jsx)(T,{label:`Deletion protection`,value:St}),t[161]=St,t[162]=Ct);let wt;t[163]===l.InstanceCreateTime?wt=t[164]:(wt=ee(l.InstanceCreateTime),t[163]=l.InstanceCreateTime,t[164]=wt);let Tt;t[165]===wt?Tt=t[166]:(Tt=(0,E.jsx)(T,{label:`Created`,value:wt}),t[165]=wt,t[166]=Tt);let Et;t[167]!==J||t[168]!==Y||t[169]!==X||t[170]!==Z||t[171]!==Q||t[172]!==$||t[173]!==yt||t[174]!==bt||t[175]!==xt||t[176]!==Ct||t[177]!==Tt?(Et=(0,E.jsxs)(w,{children:[q,(0,E.jsxs)(w.Content,{children:[J,Y,X,Z,Q,$,yt,bt,xt,Ct,Tt]})]}),t[167]=J,t[168]=Y,t[169]=X,t[170]=Z,t[171]=Q,t[172]=$,t[173]=yt,t[174]=bt,t[175]=xt,t[176]=Ct,t[177]=Tt,t[178]=Et):Et=t[178];let Dt;t[179]!==oe||t[180]!==s?(Dt=oe&&(0,E.jsxs)(w,{children:[(0,E.jsx)(w.Header,{children:`Pending Changes`}),(0,E.jsxs)(w.Content,{children:[(0,E.jsx)(T,{label:`Instance class`,value:s?.DBInstanceClass}),(0,E.jsx)(T,{label:`Allocated storage`,value:s?.AllocatedStorage?`${s.AllocatedStorage} GiB`:void 0})]})]}),t[179]=oe,t[180]=s,t[181]=Dt):Dt=t[181],t[182]!==Et||t[183]!==Dt?(j=(0,E.jsx)(Ne,{value:`configuration`,children:(0,E.jsxs)(`div`,{className:`space-y-4`,children:[Et,Dt]})}),t[182]=Et,t[183]=Dt,t[184]=j):j=t[184],ze=Ne,O=`backups`,Qe=`space-y-4`,$e=e&&(0,E.jsxs)(`div`,{className:`rounded-md border border-tactical-amber/40 bg-tactical-amber/5 p-4 text-sm`,role:`alert`,children:[(0,E.jsx)(`p`,{className:`font-medium`,children:`An automated backup failed`}),(0,E.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.Message,` (`,ee(e.Date),`)`]})]}),et=r&&(0,E.jsxs)(`div`,{className:`rounded-md border border-tactical-amber/40 bg-tactical-amber/5 p-4 text-sm`,role:`alert`,children:[(0,E.jsx)(`p`,{className:`font-medium`,children:`A backup raised a warning`}),(0,E.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[r.Message,` (`,ee(r.Date),`)`]})]}),Re=w,t[185]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,E.jsx)(w.Header,{children:`Automated Backups`}),t[185]=Ze):Ze=t[185],Le=w.Content;let Ot=l.BackupRetentionPeriod===0?`Disabled`:`${l.BackupRetentionPeriod} days`;t[186]===Ot?F=t[187]:(F=(0,E.jsx)(T,{label:`Retention`,value:Ot}),t[186]=Ot,t[187]=F);let kt=o?.Status??`None — automated backups are off`;t[188]===kt?I=t[189]:(I=(0,E.jsx)(T,{label:`Status`,value:kt}),t[188]=kt,t[189]=I),t[190]===l.PreferredBackupWindow?Ye=t[191]:(Ye=(0,E.jsx)(T,{label:`Preferred backup window`,value:l.PreferredBackupWindow}),t[190]=l.PreferredBackupWindow,t[191]=Ye),t[192]===l.PreferredMaintenanceWindow?Xe=t[193]:(Xe=(0,E.jsx)(T,{label:`Preferred maintenance window`,value:l.PreferredMaintenanceWindow}),t[192]=l.PreferredMaintenanceWindow,t[193]=Xe),Ie=T,pt=`Last backup`,mt=a?.SnapshotCreateTime&&ee(a.SnapshotCreateTime),t[11]=v.DBInstanceAutomatedBackups?.[0],t[12]=n,t[13]=ke,t[14]=l,t[15]=Fe,t[16]=x,t[17]=ge.DBSnapshots,t[18]=y,t[19]=C,t[20]=b,t[21]=Ie,t[22]=Le,t[23]=Re,t[24]=ze,t[25]=Be,t[26]=Je,t[27]=Ye,t[28]=Xe,t[29]=Ze,t[30]=Qe,t[31]=$e,t[32]=et,t[33]=O,t[34]=rt,t[35]=k,t[36]=A,t[37]=j,t[38]=dt,t[39]=M,t[40]=N,t[41]=ft,t[42]=P,t[43]=pt,t[44]=mt,t[45]=F,t[46]=I}else Ie=t[21],Le=t[22],Re=t[23],ze=t[24],Be=t[25],Je=t[26],Ye=t[27],Xe=t[28],Ze=t[29],Qe=t[30],$e=t[31],et=t[32],O=t[33],rt=t[34],k=t[35],A=t[36],j=t[37],dt=t[38],M=t[39],N=t[40],ft=t[41],P=t[42],pt=t[43],mt=t[44],F=t[45],I=t[46];let L;t[194]!==Ie||t[195]!==pt||t[196]!==mt?(L=(0,E.jsx)(Ie,{label:pt,value:mt}),t[194]=Ie,t[195]=pt,t[196]=mt,t[197]=L):L=t[197];let R;t[198]!==Le||t[199]!==Ye||t[200]!==Xe||t[201]!==L||t[202]!==F||t[203]!==I?(R=(0,E.jsxs)(Le,{children:[F,I,Ye,Xe,L]}),t[198]=Le,t[199]=Ye,t[200]=Xe,t[201]=L,t[202]=F,t[203]=I,t[204]=R):R=t[204];let z;t[205]!==Re||t[206]!==Ze||t[207]!==R?(z=(0,E.jsxs)(Re,{children:[Ze,R]}),t[205]=Re,t[206]=Ze,t[207]=R,t[208]=z):z=t[208];let ht;t[209]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,E.jsx)(`h3`,{className:`text-sm font-medium`,children:`Snapshots`}),t[209]=ht):ht=t[209];let B;t[210]!==r||t[211]!==Je?(B=(0,E.jsxs)(`div`,{className:`space-y-2`,children:[ht,Je.length>0?(0,E.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,E.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,E.jsx)(`thead`,{children:(0,E.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Identifier`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Type`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Created`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,E.jsx)(`tbody`,{children:Je.map(e=>{let t=e.DBSnapshotIdentifier;return t?(0,E.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,E.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,E.jsx)(o,{className:`text-primary hover:underline`,params:{id:t},to:`/rds/describe-db-snapshots/$id`,children:t})}),(0,E.jsx)(`td`,{className:`px-4 py-2`,children:e.SnapshotType}),(0,E.jsx)(`td`,{className:`px-4 py-2`,children:(0,E.jsx)(Ae,{state:e.Status})}),(0,E.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:ee(e.SnapshotCreateTime)}),(0,E.jsxs)(`td`,{className:`space-x-2 px-4 py-2 text-right`,children:[(0,E.jsx)(c,{disabled:!f(e.Status),onClick:async()=>{await r({to:`/rds/restore-db-instance-from-db-snapshot/$id`,params:{id:t}})},size:`sm`,variant:`outline`,children:`Restore`}),(0,E.jsx)(c,{disabled:!p(e.Status,e.SnapshotType),onClick:()=>{De(t)},size:`sm`,variant:`destructive`,children:`Delete`})]})]},t):null})})]})}):(0,E.jsx)(`p`,{className:`text-muted-foreground`,children:`No snapshots of this instance.`})]}),t[210]=r,t[211]=Je,t[212]=B):B=t[212];let V;t[213]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,E.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Automated backups are daily snapshots taken in the backup window, deleted by retention rather than by hand. There is no point-in-time restore.`}),t[213]=V):V=t[213];let H;t[214]!==Qe||t[215]!==$e||t[216]!==et||t[217]!==z||t[218]!==B?(H=(0,E.jsxs)(`div`,{className:Qe,children:[$e,et,z,B,V]}),t[214]=Qe,t[215]=$e,t[216]=et,t[217]=z,t[218]=B,t[219]=H):H=t[219];let U;t[220]!==ze||t[221]!==O||t[222]!==H?(U=(0,E.jsx)(ze,{value:O,children:H}),t[220]=ze,t[221]=O,t[222]=H,t[223]=U):U=t[223];let W;t[224]===u?W=t[225]:(W=(0,E.jsx)(Ne,{value:`tags`,children:(0,E.jsx)(We,{arn:u})}),t[224]=u,t[225]=W);let G;t[226]===ke?G=t[227]:(G=(0,E.jsx)(Ne,{value:`events`,children:(0,E.jsx)(Ue,{events:ke})}),t[226]=ke,t[227]=G);let K;t[228]!==Be||t[229]!==rt||t[230]!==k||t[231]!==A||t[232]!==j||t[233]!==U||t[234]!==W||t[235]!==G?(K=(0,E.jsxs)(Be,{defaultValue:rt,children:[k,A,j,U,W,G]}),t[228]=Be,t[229]=rt,t[230]=k,t[231]=A,t[232]=j,t[233]=U,t[234]=W,t[235]=G,t[236]=K):K=t[236];let q;t[237]!==dt||t[238]!==M||t[239]!==N||t[240]!==K?(q=(0,E.jsxs)(`div`,{className:dt,children:[M,N,K]}),t[237]=dt,t[238]=M,t[239]=N,t[240]=K,t[241]=q):q=t[241];let J;t[242]!==l||t[243]!==S?(J=S&&(0,E.jsx)(D,{instance:l,onOpenChange:Ce,open:!0}),t[242]=l,t[243]=S,t[244]=J):J=t[244];let Y;t[245]!==n||t[246]!==we?(Y=we&&(0,E.jsx)(Ve,{dbInstanceIdentifier:n,onOpenChange:Te,open:!0}),t[245]=n,t[246]=we,t[247]=Y):Y=t[247];let X;t[248]===Ee?X=t[249]:(X=Ee&&(0,E.jsx)(He,{dbSnapshotIdentifier:Ee,onOpenChange:e=>{e||De(null)},open:!0}),t[248]=Ee,t[249]=X);let gt=l.DeletionProtection??!1,Z;t[250]===r?Z=t[251]:(Z=async()=>{await r({to:`/rds/describe-db-instances`})},t[250]=r,t[251]=Z);let Q;t[252]===Symbol.for(`react.memo_cache_sentinel`)?(Q=()=>{xe(!1),Ce(!0)},t[252]=Q):Q=t[252];let _t;t[253]!==n||t[254]!==ye||t[255]!==gt||t[256]!==Z?(_t=(0,E.jsx)(Ge,{dbInstanceIdentifier:n,deletionProtection:gt,onDeleted:Z,onModify:Q,onOpenChange:xe,open:ye}),t[253]=n,t[254]=ye,t[255]=gt,t[256]=Z,t[257]=_t):_t=t[257];let $;return t[258]!==ft||t[259]!==P||t[260]!==q||t[261]!==J||t[262]!==Y||t[263]!==X||t[264]!==_t?($=(0,E.jsxs)(E.Fragment,{children:[ft,P,q,J,Y,X,_t]}),t[258]=ft,t[259]=P,t[260]=q,t[261]=J,t[262]=Y,t[263]=X,t[264]=_t,t[265]=$):$=t[265],$}function it(e){return`${e.DBParameterGroupName} (${e.ParameterApplyStatus})`}function at(e){return e.VpcSecurityGroupId}function ot(e){return(0,E.jsxs)(`span`,{className:`text-xs text-tactical-amber`,children:[e.StatusType,`: `,e.Message??e.Status]},`${e.StatusType}-${e.Status}`)}function st(e,t){return(e.SnapshotCreateTime?.getTime()??0)-(t.SnapshotCreateTime?.getTime()??0)}function ct(e){return e.SnapshotType===d}function lt(e){return O(e,`backup`)&&O(e,`notification`)}function ut(e){return O(e,`backup`)&&O(e,`failure`)}function k(){let e=(0,qe.c)(2),{id:t}=v.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,E.jsx)(rt,{dbInstanceIdentifier:n}),e[0]=n,e[1]=r),r}export{k as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id41.js b/spinifex/services/spinifexui/frontend/dist/assets/_id41.js index 74c310dee..1bca87fa9 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id41.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id41.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as ee}from"./useSuspenseQuery.js";import{t as te}from"./link.js";import{t as ne}from"./useNavigate.js";import{$t as re}from"./cluster-config.js";import{t as ie}from"./back-link.js";import{t as ae}from"./trash-2.js";import{t as oe}from"./button.js";import{a as se,d as ce,l as le}from"./rds.js";import{i as ue,p as de}from"./rds3.js";import{t as i}from"./_id20.js";import{t as fe}from"./page-heading.js";import{n as a,t as o}from"./detail-row.js";import{t as pe}from"./state-badge.js";import{i as me,n as he,r as ge,t as _e}from"./tabs.js";import{t as ve}from"./delete-db-snapshot-dialog.js";import{t as ye}from"./rds-events-panel.js";import{t as be}from"./rds-tags-tab.js";var xe=r(),Se=e(n(),1),s=t();function Ce(e){let t=(0,xe.c)(114),{dbSnapshotIdentifier:n}=e,r=ne(),i;t[0]===n?i=t[1]:(i=ue(n),t[0]=n,t[1]=i);let{data:Ce}=ee(i),c=Ce.DBSnapshots?.[0],we=c?.DBSnapshotArn??``,l;t[2]===n?l=t[3]:(l=de(n),t[2]=n,t[3]=l);let{data:Te}=ee(l),[Ee,De]=(0,Se.useState)(!1);if(!c?.DBSnapshotIdentifier){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ie,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),(0,s.jsx)(`p`,{className:`text-muted-foreground`,children:`DB snapshot not found.`})]}),t[4]=e):e=t[4],e}let u=c.Status,d=c.SnapshotType,Oe=d===se,f=c.DBInstanceIdentifier??``,ke;t[5]===Te.Events?ke=t[6]:(ke=Te.Events??[],t[5]=Te.Events,t[6]=ke);let Ae=ke,je;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,s.jsx)(ie,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),t[7]=je):je=t[7];let Me;t[8]===u?Me=t[9]:(Me=ce(u),t[8]=u,t[9]=Me);let Ne=!Me,p;t[10]!==n||t[11]!==r?(p=async()=>await r({to:`/rds/restore-db-instance-from-db-snapshot/$id`,params:{id:n}}),t[10]=n,t[11]=r,t[12]=p):p=t[12];let m;t[13]!==Ne||t[14]!==p?(m=(0,s.jsx)(oe,{disabled:Ne,onClick:p,size:`sm`,variant:`outline`,children:`Restore`}),t[13]=Ne,t[14]=p,t[15]=m):m=t[15];let h;t[16]!==d||t[17]!==u?(h=le(u,d),t[16]=d,t[17]=u,t[18]=h):h=t[18];let Pe=!h,g;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>De(!0),t[19]=g):g=t[19];let _;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,s.jsx)(ae,{className:`size-4`}),t[20]=_):_=t[20];let v;t[21]===Pe?v=t[22]:(v=(0,s.jsxs)(oe,{disabled:Pe,onClick:g,size:`sm`,variant:`destructive`,children:[_,`Delete`]}),t[21]=Pe,t[22]=v);let y;t[23]!==v||t[24]!==m?(y=(0,s.jsxs)(`div`,{className:`flex gap-2`,children:[m,v]}),t[23]=v,t[24]=m,t[25]=y):y=t[25];let b;t[26]!==n||t[27]!==y?(b=(0,s.jsx)(fe,{actions:y,subtitle:`DB Snapshot`,title:n}),t[26]=n,t[27]=y,t[28]=b):b=t[28];let x;t[29]===u?x=t[30]:(x=(0,s.jsx)(pe,{state:u}),t[29]=u,t[30]=x);let S;t[31]===Oe?S=t[32]:(S=Oe&&(0,s.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`An automated backup: it is deleted by the source instance's backup retention, not by hand.`}),t[31]=Oe,t[32]=S);let C;t[33]!==x||t[34]!==S?(C=(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x,S]}),t[33]=x,t[34]=S,t[35]=C):C=t[35];let w;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,s.jsxs)(he,{children:[(0,s.jsx)(me,{value:`overview`,children:`Overview`}),(0,s.jsx)(me,{value:`tags`,children:`Tags`}),(0,s.jsx)(me,{value:`events`,children:`Events`})]}),t[36]=w):w=t[36];let T;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,s.jsx)(a.Header,{children:`Snapshot`}),t[37]=T):T=t[37];let E;t[38]===d?E=t[39]:(E=(0,s.jsx)(o,{label:`Type`,value:d}),t[38]=d,t[39]=E);let D;t[40]===u?D=t[41]:(D=(0,s.jsx)(o,{label:`Status`,value:u}),t[40]=u,t[41]=D);let O;t[42]===c.SnapshotCreateTime?O=t[43]:(O=re(c.SnapshotCreateTime),t[42]=c.SnapshotCreateTime,t[43]=O);let k;t[44]===O?k=t[45]:(k=(0,s.jsx)(o,{label:`Created`,value:O}),t[44]=O,t[45]=k);let Fe=c.PercentProgress===void 0?void 0:`${c.PercentProgress}%`,A;t[46]===Fe?A=t[47]:(A=(0,s.jsx)(o,{label:`Progress`,value:Fe}),t[46]=Fe,t[47]=A);let j;t[48]===c.DBSnapshotArn?j=t[49]:(j=(0,s.jsx)(o,{label:`ARN`,value:c.DBSnapshotArn}),t[48]=c.DBSnapshotArn,t[49]=j);let M;t[50]!==E||t[51]!==D||t[52]!==k||t[53]!==A||t[54]!==j?(M=(0,s.jsxs)(a,{children:[T,(0,s.jsxs)(a.Content,{children:[E,D,k,A,j]})]}),t[50]=E,t[51]=D,t[52]=k,t[53]=A,t[54]=j,t[55]=M):M=t[55];let N;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,s.jsx)(a.Header,{children:`Source`}),t[56]=N):N=t[56];let P;t[57]===f?P=t[58]:(P=f===``?void 0:(0,s.jsx)(te,{className:`text-primary hover:underline`,params:{id:f},to:`/rds/describe-db-instances/$id`,children:f}),t[57]=f,t[58]=P);let F;t[59]===P?F=t[60]:(F=(0,s.jsx)(o,{label:`DB instance`,value:P}),t[59]=P,t[60]=F);let I;t[61]===c.Engine?I=t[62]:(I=(0,s.jsx)(o,{label:`Engine`,value:c.Engine}),t[61]=c.Engine,t[62]=I);let L;t[63]===c.EngineVersion?L=t[64]:(L=(0,s.jsx)(o,{label:`Version`,value:c.EngineVersion}),t[63]=c.EngineVersion,t[64]=L);let Ie=c.AllocatedStorage?`${c.AllocatedStorage} GiB`:void 0,R;t[65]===Ie?R=t[66]:(R=(0,s.jsx)(o,{label:`Allocated storage`,value:Ie}),t[65]=Ie,t[66]=R);let z;t[67]===c.StorageType?z=t[68]:(z=(0,s.jsx)(o,{label:`Storage type`,value:c.StorageType}),t[67]=c.StorageType,t[68]=z);let Le=c.Encrypted?`Encrypted — always on`:`Not encrypted`,B;t[69]===Le?B=t[70]:(B=(0,s.jsx)(o,{label:`Encryption`,value:Le}),t[69]=Le,t[70]=B);let V;t[71]===c.MasterUsername?V=t[72]:(V=(0,s.jsx)(o,{label:`Master username`,value:c.MasterUsername}),t[71]=c.MasterUsername,t[72]=V);let H;t[73]===c.Port?H=t[74]:(H=c.Port?.toString(),t[73]=c.Port,t[74]=H);let U;t[75]===H?U=t[76]:(U=(0,s.jsx)(o,{label:`Port`,value:H}),t[75]=H,t[76]=U);let W;t[77]===c.VpcId?W=t[78]:(W=(0,s.jsx)(o,{label:`VPC`,value:c.VpcId}),t[77]=c.VpcId,t[78]=W);let G;t[79]!==F||t[80]!==I||t[81]!==L||t[82]!==R||t[83]!==z||t[84]!==B||t[85]!==V||t[86]!==U||t[87]!==W?(G=(0,s.jsxs)(a,{children:[N,(0,s.jsxs)(a.Content,{children:[F,I,L,R,z,B,V,U,W]})]}),t[79]=F,t[80]=I,t[81]=L,t[82]=R,t[83]=z,t[84]=B,t[85]=V,t[86]=U,t[87]=W,t[88]=G):G=t[88];let Re;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A restore starts on this snapshot's datadir, so the engine, the master credentials and the initial database come with it and cannot be changed.`}),t[89]=Re):Re=t[89];let K;t[90]!==M||t[91]!==G?(K=(0,s.jsx)(ge,{value:`overview`,children:(0,s.jsxs)(`div`,{className:`space-y-4`,children:[M,G,Re]})}),t[90]=M,t[91]=G,t[92]=K):K=t[92];let q;t[93]===we?q=t[94]:(q=(0,s.jsx)(ge,{value:`tags`,children:(0,s.jsx)(be,{arn:we})}),t[93]=we,t[94]=q);let J;t[95]===Ae?J=t[96]:(J=(0,s.jsx)(ge,{value:`events`,children:(0,s.jsx)(ye,{events:Ae})}),t[95]=Ae,t[96]=J);let Y;t[97]!==K||t[98]!==q||t[99]!==J?(Y=(0,s.jsxs)(_e,{defaultValue:`overview`,children:[w,K,q,J]}),t[97]=K,t[98]=q,t[99]=J,t[100]=Y):Y=t[100];let X;t[101]!==b||t[102]!==C||t[103]!==Y?(X=(0,s.jsxs)(`div`,{className:`space-y-6`,children:[b,C,Y]}),t[101]=b,t[102]=C,t[103]=Y,t[104]=X):X=t[104];let Z;t[105]===r?Z=t[106]:(Z=async()=>await r({to:`/rds/describe-db-snapshots`}),t[105]=r,t[106]=Z);let Q;t[107]!==n||t[108]!==Ee||t[109]!==Z?(Q=(0,s.jsx)(ve,{dbSnapshotIdentifier:n,onDeleted:Z,onOpenChange:De,open:Ee}),t[107]=n,t[108]=Ee,t[109]=Z,t[110]=Q):Q=t[110];let $;return t[111]!==X||t[112]!==Q?($=(0,s.jsxs)(s.Fragment,{children:[je,X,Q]}),t[111]=X,t[112]=Q,t[113]=$):$=t[113],$}function c(){let e=(0,xe.c)(2),{id:t}=i.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,s.jsx)(Ce,{dbSnapshotIdentifier:n}),e[0]=n,e[1]=r),r}export{c as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as ee}from"./useSuspenseQuery.js";import{t as te}from"./link.js";import{t as ne}from"./useNavigate.js";import{$t as re}from"./cluster-config.js";import{t as ie}from"./back-link.js";import{t as ae}from"./trash-2.js";import{t as oe}from"./button.js";import{a as se,d as ce,l as le}from"./rds.js";import{i as ue,p as de}from"./rds3.js";import{t as i}from"./_id20.js";import{t as fe}from"./page-heading.js";import{n as a,t as o}from"./detail-row.js";import{t as pe}from"./state-badge.js";import{i as me,n as he,r as ge,t as _e}from"./tabs.js";import{t as ve}from"./delete-db-snapshot-dialog.js";import{t as ye}from"./rds-events-panel.js";import{t as be}from"./rds-tags-tab.js";var xe=r(),Se=e(n(),1),s=t();function Ce(e){let t=(0,xe.c)(114),{dbSnapshotIdentifier:n}=e,r=ne(),i;t[0]===n?i=t[1]:(i=ue(n),t[0]=n,t[1]=i);let{data:Ce}=ee(i),c=Ce.DBSnapshots?.[0],we=c?.DBSnapshotArn??``,l;t[2]===n?l=t[3]:(l=de(n),t[2]=n,t[3]=l);let{data:Te}=ee(l),[Ee,De]=(0,Se.useState)(!1);if(!c?.DBSnapshotIdentifier){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ie,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),(0,s.jsx)(`p`,{className:`text-muted-foreground`,children:`DB snapshot not found.`})]}),t[4]=e):e=t[4],e}let u=c.Status,d=c.SnapshotType,Oe=d===se,f=c.DBInstanceIdentifier??``,ke;t[5]===Te.Events?ke=t[6]:(ke=Te.Events??[],t[5]=Te.Events,t[6]=ke);let Ae=ke,je;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,s.jsx)(ie,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),t[7]=je):je=t[7];let Me;t[8]===u?Me=t[9]:(Me=ce(u),t[8]=u,t[9]=Me);let Ne=!Me,p;t[10]!==n||t[11]!==r?(p=async()=>{await r({to:`/rds/restore-db-instance-from-db-snapshot/$id`,params:{id:n}})},t[10]=n,t[11]=r,t[12]=p):p=t[12];let m;t[13]!==Ne||t[14]!==p?(m=(0,s.jsx)(oe,{disabled:Ne,onClick:p,size:`sm`,variant:`outline`,children:`Restore`}),t[13]=Ne,t[14]=p,t[15]=m):m=t[15];let h;t[16]!==d||t[17]!==u?(h=le(u,d),t[16]=d,t[17]=u,t[18]=h):h=t[18];let Pe=!h,g;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{De(!0)},t[19]=g):g=t[19];let _;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,s.jsx)(ae,{className:`size-4`}),t[20]=_):_=t[20];let v;t[21]===Pe?v=t[22]:(v=(0,s.jsxs)(oe,{disabled:Pe,onClick:g,size:`sm`,variant:`destructive`,children:[_,`Delete`]}),t[21]=Pe,t[22]=v);let y;t[23]!==v||t[24]!==m?(y=(0,s.jsxs)(`div`,{className:`flex gap-2`,children:[m,v]}),t[23]=v,t[24]=m,t[25]=y):y=t[25];let b;t[26]!==n||t[27]!==y?(b=(0,s.jsx)(fe,{actions:y,subtitle:`DB Snapshot`,title:n}),t[26]=n,t[27]=y,t[28]=b):b=t[28];let x;t[29]===u?x=t[30]:(x=(0,s.jsx)(pe,{state:u}),t[29]=u,t[30]=x);let S;t[31]===Oe?S=t[32]:(S=Oe&&(0,s.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`An automated backup: it is deleted by the source instance's backup retention, not by hand.`}),t[31]=Oe,t[32]=S);let C;t[33]!==x||t[34]!==S?(C=(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x,S]}),t[33]=x,t[34]=S,t[35]=C):C=t[35];let w;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,s.jsxs)(he,{children:[(0,s.jsx)(me,{value:`overview`,children:`Overview`}),(0,s.jsx)(me,{value:`tags`,children:`Tags`}),(0,s.jsx)(me,{value:`events`,children:`Events`})]}),t[36]=w):w=t[36];let T;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,s.jsx)(a.Header,{children:`Snapshot`}),t[37]=T):T=t[37];let E;t[38]===d?E=t[39]:(E=(0,s.jsx)(o,{label:`Type`,value:d}),t[38]=d,t[39]=E);let D;t[40]===u?D=t[41]:(D=(0,s.jsx)(o,{label:`Status`,value:u}),t[40]=u,t[41]=D);let O;t[42]===c.SnapshotCreateTime?O=t[43]:(O=re(c.SnapshotCreateTime),t[42]=c.SnapshotCreateTime,t[43]=O);let k;t[44]===O?k=t[45]:(k=(0,s.jsx)(o,{label:`Created`,value:O}),t[44]=O,t[45]=k);let Fe=c.PercentProgress===void 0?void 0:`${c.PercentProgress}%`,A;t[46]===Fe?A=t[47]:(A=(0,s.jsx)(o,{label:`Progress`,value:Fe}),t[46]=Fe,t[47]=A);let j;t[48]===c.DBSnapshotArn?j=t[49]:(j=(0,s.jsx)(o,{label:`ARN`,value:c.DBSnapshotArn}),t[48]=c.DBSnapshotArn,t[49]=j);let M;t[50]!==E||t[51]!==D||t[52]!==k||t[53]!==A||t[54]!==j?(M=(0,s.jsxs)(a,{children:[T,(0,s.jsxs)(a.Content,{children:[E,D,k,A,j]})]}),t[50]=E,t[51]=D,t[52]=k,t[53]=A,t[54]=j,t[55]=M):M=t[55];let N;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,s.jsx)(a.Header,{children:`Source`}),t[56]=N):N=t[56];let P;t[57]===f?P=t[58]:(P=f===``?void 0:(0,s.jsx)(te,{className:`text-primary hover:underline`,params:{id:f},to:`/rds/describe-db-instances/$id`,children:f}),t[57]=f,t[58]=P);let F;t[59]===P?F=t[60]:(F=(0,s.jsx)(o,{label:`DB instance`,value:P}),t[59]=P,t[60]=F);let I;t[61]===c.Engine?I=t[62]:(I=(0,s.jsx)(o,{label:`Engine`,value:c.Engine}),t[61]=c.Engine,t[62]=I);let L;t[63]===c.EngineVersion?L=t[64]:(L=(0,s.jsx)(o,{label:`Version`,value:c.EngineVersion}),t[63]=c.EngineVersion,t[64]=L);let Ie=c.AllocatedStorage?`${c.AllocatedStorage} GiB`:void 0,R;t[65]===Ie?R=t[66]:(R=(0,s.jsx)(o,{label:`Allocated storage`,value:Ie}),t[65]=Ie,t[66]=R);let z;t[67]===c.StorageType?z=t[68]:(z=(0,s.jsx)(o,{label:`Storage type`,value:c.StorageType}),t[67]=c.StorageType,t[68]=z);let Le=c.Encrypted?`Encrypted — always on`:`Not encrypted`,B;t[69]===Le?B=t[70]:(B=(0,s.jsx)(o,{label:`Encryption`,value:Le}),t[69]=Le,t[70]=B);let V;t[71]===c.MasterUsername?V=t[72]:(V=(0,s.jsx)(o,{label:`Master username`,value:c.MasterUsername}),t[71]=c.MasterUsername,t[72]=V);let H;t[73]===c.Port?H=t[74]:(H=c.Port?.toString(),t[73]=c.Port,t[74]=H);let U;t[75]===H?U=t[76]:(U=(0,s.jsx)(o,{label:`Port`,value:H}),t[75]=H,t[76]=U);let W;t[77]===c.VpcId?W=t[78]:(W=(0,s.jsx)(o,{label:`VPC`,value:c.VpcId}),t[77]=c.VpcId,t[78]=W);let G;t[79]!==F||t[80]!==I||t[81]!==L||t[82]!==R||t[83]!==z||t[84]!==B||t[85]!==V||t[86]!==U||t[87]!==W?(G=(0,s.jsxs)(a,{children:[N,(0,s.jsxs)(a.Content,{children:[F,I,L,R,z,B,V,U,W]})]}),t[79]=F,t[80]=I,t[81]=L,t[82]=R,t[83]=z,t[84]=B,t[85]=V,t[86]=U,t[87]=W,t[88]=G):G=t[88];let Re;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A restore starts on this snapshot's datadir, so the engine, the master credentials and the initial database come with it and cannot be changed.`}),t[89]=Re):Re=t[89];let K;t[90]!==M||t[91]!==G?(K=(0,s.jsx)(ge,{value:`overview`,children:(0,s.jsxs)(`div`,{className:`space-y-4`,children:[M,G,Re]})}),t[90]=M,t[91]=G,t[92]=K):K=t[92];let q;t[93]===we?q=t[94]:(q=(0,s.jsx)(ge,{value:`tags`,children:(0,s.jsx)(be,{arn:we})}),t[93]=we,t[94]=q);let J;t[95]===Ae?J=t[96]:(J=(0,s.jsx)(ge,{value:`events`,children:(0,s.jsx)(ye,{events:Ae})}),t[95]=Ae,t[96]=J);let Y;t[97]!==K||t[98]!==q||t[99]!==J?(Y=(0,s.jsxs)(_e,{defaultValue:`overview`,children:[w,K,q,J]}),t[97]=K,t[98]=q,t[99]=J,t[100]=Y):Y=t[100];let X;t[101]!==b||t[102]!==C||t[103]!==Y?(X=(0,s.jsxs)(`div`,{className:`space-y-6`,children:[b,C,Y]}),t[101]=b,t[102]=C,t[103]=Y,t[104]=X):X=t[104];let Z;t[105]===r?Z=t[106]:(Z=async()=>{await r({to:`/rds/describe-db-snapshots`})},t[105]=r,t[106]=Z);let Q;t[107]!==n||t[108]!==Ee||t[109]!==Z?(Q=(0,s.jsx)(ve,{dbSnapshotIdentifier:n,onDeleted:Z,onOpenChange:De,open:Ee}),t[107]=n,t[108]=Ee,t[109]=Z,t[110]=Q):Q=t[110];let $;return t[111]!==X||t[112]!==Q?($=(0,s.jsxs)(s.Fragment,{children:[je,X,Q]}),t[111]=X,t[112]=Q,t[113]=$):$=t[113],$}function c(){let e=(0,xe.c)(2),{id:t}=i.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,s.jsx)(Ce,{dbSnapshotIdentifier:n}),e[0]=n,e[1]=r),r}export{c as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_id42.js b/spinifex/services/spinifexui/frontend/dist/assets/_id42.js index 0e4b05ad2..e7cac351e 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_id42.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_id42.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{n as ee}from"./QueryClientProvider.js";import{t as te}from"./useQuery.js";import{t as i}from"./useSuspenseQuery.js";import{t as ne}from"./useNavigate.js";import{t as a}from"./back-link.js";import{i as o,n as s,r as c,t as re}from"./cli-command-panel.js";import{t as l}from"./input.js";import{o as u,w as ie}from"./ec2.js";import{C as ae,d as oe,w as se}from"./rds.js";import{f as d}from"./rds2.js";import{d as f,h as p,i as m,l as h,o as ce}from"./rds3.js";import{t as g}from"./_id21.js";import{a as le,i as ue,t as de}from"./zod.js";import{t as fe}from"./error-banner.js";import{t as pe}from"./form-actions.js";import{t as _}from"./page-heading.js";import{a as v,n as y,r as b,t as x}from"./field.js";import{n as S,t as C}from"./detail-row.js";import{a as me,r as he}from"./system-managed.js";import{t as ge}from"./tags-field-array.js";import{t as _e}from"./system-image-required.js";import{n as w}from"./picker-notice.js";import{a as T,i as E,n as D,o as O,r as k,s as A,t as j}from"./security-group-checkboxes.js";var M=r(),N=e(n(),1),P=t(),F=[{label:`Engine and version`,note:`The datadir is written in one engine's on-disk format; restoring it as another is refused.`},{label:`Master username and password`,note:`The datadir already holds the master role and its password hash, so no bootstrap runs.`},{label:`Initial database`,note:`A restore cannot create a database the snapshot does not hold.`},{label:`Backup retention and windows`,note:`The restored instance takes the platform defaults; change them with a modify afterwards.`}];function I({dbSnapshotIdentifier:e}){let t=ne(),n=ee(),r=d(),[o,s]=(0,N.useState)(!1),{data:c}=i(m(e)),{data:g}=i(ce),{data:M}=i(p),{data:I}=i(f),{data:L}=i(ie),{data:ye}=i(u),R=c.DBSnapshots?.[0],z=R?.Engine??``,B=R?.AllocatedStorage??0,V=te(h(z)),{clearErrors:be,control:H,formState:{errors:U,isSubmitting:xe},handleSubmit:Se,register:W,setError:Ce,setValue:G}=ue({resolver:de(ae),defaultValues:{snapshotAllocatedStorage:B,dbInstanceIdentifier:se(R?.DBInstanceIdentifier??``,`restored`),dbInstanceClass:``,allocatedStorage:B,port:R?.Port?String(R.Port):``,dbSubnetGroupName:``,vpcSecurityGroupIds:[],dbParameterGroupName:``,deletionProtection:!1,tags:[]}}),K=le({control:H}),q=K.dbSubnetGroupName??``,J=K.vpcSecurityGroupIds??[],we=async()=>{s(!0);try{await n.invalidateQueries({queryKey:u.queryKey})}finally{s(!1)}},Y=e=>{be(`vpcSecurityGroupIds`),G(`vpcSecurityGroupIds`,e,{shouldValidate:!0})},Te=e=>{let t=Z.find(t=>t.DBSubnetGroupName===e)?.VpcId??R?.VpcId,n=k($,t,J);if(e!==``&&t!==R?.VpcId&&n.length===0){let e=D($,t);n=e?[e]:[]}G(`dbSubnetGroupName`,e,{shouldValidate:!0}),Y(n)},Ee=async n=>{if(n.dbSubnetGroupName!==``&&Q!==R?.VpcId&&n.vpcSecurityGroupIds.length===0){Ce(`vpcSecurityGroupIds`,{message:`Select a security group in the new placement VPC`});return}try{await r.mutateAsync({...n,dbSnapshotIdentifier:e})}catch{return}await t({to:`/rds/describe-db-instances/$id`,params:{id:n.dbInstanceIdentifier}})};if(!R?.DBSnapshotIdentifier)return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:`DB snapshot not found.`})]});if(!oe(R.Status))return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(_,{subtitle:e,title:`Restore Snapshot`}),(0,P.jsxs)(`p`,{className:`text-muted-foreground`,children:[e,` is `,R.Status,`. A snapshot can only be restored once it is available.`]})]});if(!(ye.Images??[]).some(e=>he(e,z,R.EngineVersion??``)))return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(_,{subtitle:e,title:`Restore Snapshot`}),(0,P.jsx)(_e,{description:`This snapshot holds ${z} data and can only be restored onto a ${z} instance, but no ${z} image is imported on this cluster.`,importCommand:me(z),isRechecking:o,onRecheck:we,title:`${z} image not found`})]});let De=V.data?.OrderableDBInstanceOptions??[],X=[...new Set(De.map(e=>e.DBInstanceClass??``).filter(Boolean))],Oe=w(V,X.length===0,{loading:`Loading the instance classes…`,failed:`Could not read the instance classes`,empty:`No instance class this cluster's nodes can run is available for ${z}.`}),Z=M.DBSubnetGroups??[],ke=A(I.DBParameterGroups??[],g.DBEngineVersions??[],z),Q=Z.find(e=>e.DBSubnetGroupName===q)?.VpcId??R.VpcId,$=L.SecurityGroups??[],Ae=E($,Q);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(_,{subtitle:e,title:`Restore Snapshot`}),r.error&&(0,P.jsx)(fe,{error:r.error,msg:`Failed to restore the DB snapshot`}),(0,P.jsxs)(`div`,{className:`max-w-4xl space-y-6`,children:[(0,P.jsxs)(S,{children:[(0,P.jsx)(S.Header,{children:`Restoring From`}),(0,P.jsxs)(S.Content,{children:[(0,P.jsx)(C,{label:`Snapshot`,value:e}),(0,P.jsx)(C,{label:`Source DB instance`,value:R.DBInstanceIdentifier}),(0,P.jsx)(C,{label:`Engine`,value:[z,R.EngineVersion].filter(Boolean).join(` `)}),(0,P.jsx)(C,{label:`Master username`,value:R.MasterUsername}),(0,P.jsx)(C,{label:`Snapshot storage`,value:B?`${B} GiB`:void 0})]})]}),(0,P.jsxs)(`form`,{className:`space-y-6`,onSubmit:Se(Ee),children:[(0,P.jsxs)(x,{children:[(0,P.jsx)(v,{children:(0,P.jsx)(`label`,{htmlFor:`restore-identifier`,children:`New DB instance identifier`})}),(0,P.jsx)(l,{"aria-invalid":!!U.dbInstanceIdentifier,id:`restore-identifier`,...W(`dbInstanceIdentifier`)}),(0,P.jsx)(y,{children:`A restore always creates a new instance; it never writes back over the one the snapshot came from.`}),(0,P.jsx)(b,{errors:[U.dbInstanceIdentifier]})]}),(0,P.jsx)(O,{control:H,id:`restore-class`,label:`DB instance class`,name:`dbInstanceClass`,notice:Oe,options:X.map(e=>({value:e,label:e})),placeholder:`Select an instance class`}),(0,P.jsxs)(x,{children:[(0,P.jsx)(v,{children:(0,P.jsx)(`label`,{htmlFor:`restore-storage`,children:`Allocated storage (GiB)`})}),(0,P.jsx)(l,{"aria-invalid":!!U.allocatedStorage,id:`restore-storage`,min:B,type:`number`,...W(`allocatedStorage`,{valueAsNumber:!0})}),(0,P.jsxs)(y,{children:[`The snapshot holds `,B,` GiB. A restore may grow the volume but never shrink it.`]}),(0,P.jsx)(b,{errors:[U.allocatedStorage]})]}),(0,P.jsxs)(x,{children:[(0,P.jsx)(v,{children:(0,P.jsx)(`label`,{htmlFor:`restore-port`,children:`Port`})}),(0,P.jsx)(l,{"aria-invalid":!!U.port,id:`restore-port`,placeholder:`Snapshot's port`,...W(`port`)}),(0,P.jsx)(y,{children:`Leave blank to keep the port the snapshot was taken on. The port is fixed once the instance exists.`}),(0,P.jsx)(b,{errors:[U.port]})]}),(0,P.jsx)(O,{control:H,description:`Leave unset to place the restored endpoint in the group the snapshot recorded.`,id:`restore-subnet-group`,label:`DB subnet group`,name:`dbSubnetGroupName`,onValueChange:Te,options:Z.map(e=>({value:e.DBSubnetGroupName??``,label:`${e.DBSubnetGroupName} (${e.VpcId})`})),placeholder:`The snapshot's subnet group`}),(0,P.jsxs)(x,{children:[(0,P.jsx)(v,{children:`VPC security groups`}),(0,P.jsx)(j,{emptyText:Q?`No security groups available in ${Q}.`:`The snapshot does not identify a placement VPC.`,groups:Ae,onChange:Y,selected:J}),(0,P.jsx)(y,{children:`Leave every box clear to inherit the groups the snapshot recorded.`}),(0,P.jsx)(b,{errors:[U.vpcSecurityGroupIds]})]}),(0,P.jsx)(O,{control:H,id:`restore-parameter-group`,label:`DB parameter group`,name:`dbParameterGroupName`,options:ke.map(e=>({value:e.DBParameterGroupName??``,label:e.DBParameterGroupName??``})),placeholder:`The snapshot's parameter group`}),(0,P.jsx)(T,{control:H,name:`deletionProtection`}),(0,P.jsx)(ge,{control:H,name:`tags`}),(0,P.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border p-4`,children:[(0,P.jsx)(`h3`,{className:`text-xs font-medium`,children:`Inherited from the snapshot`}),F.map(e=>(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:`font-medium`,children:e.label}),` —`,` `,e.note]},e.label))]}),(0,P.jsx)(re,{commands:ve(e,{dbInstanceIdentifier:K.dbInstanceIdentifier??``,dbInstanceClass:K.dbInstanceClass??``,allocatedStorage:K.allocatedStorage??B,port:K.port??``,dbSubnetGroupName:q,vpcSecurityGroupIds:J,dbParameterGroupName:K.dbParameterGroupName??``,deletionProtection:K.deletionProtection??!1})}),(0,P.jsx)(pe,{isPending:r.isPending,isSubmitting:xe,onCancel:async()=>await t({to:`/rds/describe-db-snapshots`}),pendingLabel:`Restoring…`,submitLabel:`Restore Snapshot`})]})]})]})}function ve(e,t){return[{label:`Restore DB Instance`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws rds restore-db-instance-from-db-snapshot`},...c(`--db-snapshot-identifier`,e),...c(`--db-instance-identifier`,s(t.dbInstanceIdentifier,`DBInstanceIdentifier`)),...c(`--db-instance-class`,s(t.dbInstanceClass,`DBInstanceClass`)),...c(`--allocated-storage`,t.allocatedStorage),...o(`--port`,t.port),...o(`--db-subnet-group-name`,t.dbSubnetGroupName),...o(`--vpc-security-group-ids`,t.vpcSecurityGroupIds.join(` `)),...o(`--db-parameter-group-name`,t.dbParameterGroupName),...o(`--deletion-protection`,t.deletionProtection)]}]}function L(){let e=(0,M.c)(2),{id:t}=g.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,P.jsx)(I,{dbSnapshotIdentifier:n}),e[0]=n,e[1]=r),r}export{L as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{n as ee}from"./QueryClientProvider.js";import{t as te}from"./useQuery.js";import{t as i}from"./useSuspenseQuery.js";import{t as ne}from"./useNavigate.js";import{t as a}from"./back-link.js";import{i as o,n as s,r as c,t as re}from"./cli-command-panel.js";import{t as l}from"./input.js";import{o as u,w as ie}from"./ec2.js";import{C as ae,d as oe,w as se}from"./rds.js";import{f as d}from"./rds2.js";import{d as f,h as p,i as m,l as h,o as ce}from"./rds3.js";import{t as g}from"./_id21.js";import{a as le,i as ue,t as de}from"./zod.js";import{t as fe}from"./error-banner.js";import{t as pe}from"./form-actions.js";import{t as _}from"./page-heading.js";import{a as v,n as y,r as b,t as x}from"./field.js";import{n as S,t as C}from"./detail-row.js";import{a as me,r as he}from"./system-managed.js";import{t as ge}from"./tags-field-array.js";import{t as _e}from"./system-image-required.js";import{n as w}from"./picker-notice.js";import{a as T,i as E,n as D,o as O,r as k,s as A,t as j}from"./security-group-checkboxes.js";var M=r(),N=e(n(),1),P=t(),F=[{label:`Engine and version`,note:`The datadir is written in one engine's on-disk format; restoring it as another is refused.`},{label:`Master username and password`,note:`The datadir already holds the master role and its password hash, so no bootstrap runs.`},{label:`Initial database`,note:`A restore cannot create a database the snapshot does not hold.`},{label:`Backup retention and windows`,note:`The restored instance takes the platform defaults; change them with a modify afterwards.`}];function I({dbSnapshotIdentifier:e}){let t=ne(),n=ee(),r=d(),[o,s]=(0,N.useState)(!1),{data:c}=i(m(e)),{data:g}=i(ce),{data:M}=i(p),{data:I}=i(f),{data:L}=i(ie),{data:ye}=i(u),R=c.DBSnapshots?.[0],z=R?.Engine??``,B=R?.AllocatedStorage??0,V=te(h(z)),{clearErrors:be,control:H,formState:{errors:U,isSubmitting:xe},handleSubmit:Se,register:W,setError:Ce,setValue:G}=ue({resolver:de(ae),defaultValues:{snapshotAllocatedStorage:B,dbInstanceIdentifier:se(R?.DBInstanceIdentifier??``,`restored`),dbInstanceClass:``,allocatedStorage:B,port:R?.Port?String(R.Port):``,dbSubnetGroupName:``,vpcSecurityGroupIds:[],dbParameterGroupName:``,deletionProtection:!1,tags:[]}}),K=le({control:H}),q=K.dbSubnetGroupName??``,J=K.vpcSecurityGroupIds??[],we=async()=>{s(!0);try{await n.invalidateQueries({queryKey:u.queryKey})}finally{s(!1)}},Y=e=>{be(`vpcSecurityGroupIds`),G(`vpcSecurityGroupIds`,e,{shouldValidate:!0})},Te=e=>{let t=Z.find(t=>t.DBSubnetGroupName===e)?.VpcId??R?.VpcId,n=k($,t,J);if(e!==``&&t!==R?.VpcId&&n.length===0){let e=D($,t);n=e?[e]:[]}G(`dbSubnetGroupName`,e,{shouldValidate:!0}),Y(n)},Ee=async n=>{if(n.dbSubnetGroupName!==``&&Q!==R?.VpcId&&n.vpcSecurityGroupIds.length===0){Ce(`vpcSecurityGroupIds`,{message:`Select a security group in the new placement VPC`});return}try{await r.mutateAsync({...n,dbSnapshotIdentifier:e})}catch{return}await t({to:`/rds/describe-db-instances/$id`,params:{id:n.dbInstanceIdentifier}})};if(!R?.DBSnapshotIdentifier)return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:`DB snapshot not found.`})]});if(!oe(R.Status))return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(_,{subtitle:e,title:`Restore Snapshot`}),(0,P.jsxs)(`p`,{className:`text-muted-foreground`,children:[e,` is `,R.Status,`. A snapshot can only be restored once it is available.`]})]});if(!(ye.Images??[]).some(e=>he(e,z,R.EngineVersion??``)))return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(_,{subtitle:e,title:`Restore Snapshot`}),(0,P.jsx)(_e,{description:`This snapshot holds ${z} data and can only be restored onto a ${z} instance, but no ${z} image is imported on this cluster.`,importCommand:me(z),isRechecking:o,onRecheck:we,title:`${z} image not found`})]});let De=V.data?.OrderableDBInstanceOptions??[],X=[...new Set(De.map(e=>e.DBInstanceClass??``).filter(Boolean))],Oe=w(V,X.length===0,{loading:`Loading the instance classes…`,failed:`Could not read the instance classes`,empty:`No instance class this cluster's nodes can run is available for ${z}.`}),Z=M.DBSubnetGroups??[],ke=A(I.DBParameterGroups??[],g.DBEngineVersions??[],z),Q=Z.find(e=>e.DBSubnetGroupName===q)?.VpcId??R.VpcId,$=L.SecurityGroups??[],Ae=E($,Q);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{to:`/rds/describe-db-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(_,{subtitle:e,title:`Restore Snapshot`}),r.error&&(0,P.jsx)(fe,{error:r.error,msg:`Failed to restore the DB snapshot`}),(0,P.jsxs)(`div`,{className:`max-w-4xl space-y-6`,children:[(0,P.jsxs)(S,{children:[(0,P.jsx)(S.Header,{children:`Restoring From`}),(0,P.jsxs)(S.Content,{children:[(0,P.jsx)(C,{label:`Snapshot`,value:e}),(0,P.jsx)(C,{label:`Source DB instance`,value:R.DBInstanceIdentifier}),(0,P.jsx)(C,{label:`Engine`,value:[z,R.EngineVersion].filter(Boolean).join(` `)}),(0,P.jsx)(C,{label:`Master username`,value:R.MasterUsername}),(0,P.jsx)(C,{label:`Snapshot storage`,value:B?`${B} GiB`:void 0})]})]}),(0,P.jsxs)(`form`,{className:`space-y-6`,onSubmit:Se(Ee),children:[(0,P.jsxs)(x,{children:[(0,P.jsx)(v,{children:(0,P.jsx)(`label`,{htmlFor:`restore-identifier`,children:`New DB instance identifier`})}),(0,P.jsx)(l,{"aria-invalid":!!U.dbInstanceIdentifier,id:`restore-identifier`,...W(`dbInstanceIdentifier`)}),(0,P.jsx)(y,{children:`A restore always creates a new instance; it never writes back over the one the snapshot came from.`}),(0,P.jsx)(b,{errors:[U.dbInstanceIdentifier]})]}),(0,P.jsx)(O,{control:H,id:`restore-class`,label:`DB instance class`,name:`dbInstanceClass`,notice:Oe,options:X.map(e=>({value:e,label:e})),placeholder:`Select an instance class`}),(0,P.jsxs)(x,{children:[(0,P.jsx)(v,{children:(0,P.jsx)(`label`,{htmlFor:`restore-storage`,children:`Allocated storage (GiB)`})}),(0,P.jsx)(l,{"aria-invalid":!!U.allocatedStorage,id:`restore-storage`,min:B,type:`number`,...W(`allocatedStorage`,{valueAsNumber:!0})}),(0,P.jsxs)(y,{children:[`The snapshot holds `,B,` GiB. A restore may grow the volume but never shrink it.`]}),(0,P.jsx)(b,{errors:[U.allocatedStorage]})]}),(0,P.jsxs)(x,{children:[(0,P.jsx)(v,{children:(0,P.jsx)(`label`,{htmlFor:`restore-port`,children:`Port`})}),(0,P.jsx)(l,{"aria-invalid":!!U.port,id:`restore-port`,placeholder:`Snapshot's port`,...W(`port`)}),(0,P.jsx)(y,{children:`Leave blank to keep the port the snapshot was taken on. The port is fixed once the instance exists.`}),(0,P.jsx)(b,{errors:[U.port]})]}),(0,P.jsx)(O,{control:H,description:`Leave unset to place the restored endpoint in the group the snapshot recorded.`,id:`restore-subnet-group`,label:`DB subnet group`,name:`dbSubnetGroupName`,onValueChange:Te,options:Z.map(e=>({value:e.DBSubnetGroupName??``,label:`${e.DBSubnetGroupName} (${e.VpcId})`})),placeholder:`The snapshot's subnet group`}),(0,P.jsxs)(x,{children:[(0,P.jsx)(v,{children:`VPC security groups`}),(0,P.jsx)(j,{emptyText:Q?`No security groups available in ${Q}.`:`The snapshot does not identify a placement VPC.`,groups:Ae,onChange:Y,selected:J}),(0,P.jsx)(y,{children:`Leave every box clear to inherit the groups the snapshot recorded.`}),(0,P.jsx)(b,{errors:[U.vpcSecurityGroupIds]})]}),(0,P.jsx)(O,{control:H,id:`restore-parameter-group`,label:`DB parameter group`,name:`dbParameterGroupName`,options:ke.map(e=>({value:e.DBParameterGroupName??``,label:e.DBParameterGroupName??``})),placeholder:`The snapshot's parameter group`}),(0,P.jsx)(T,{control:H,name:`deletionProtection`}),(0,P.jsx)(ge,{control:H,name:`tags`}),(0,P.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border p-4`,children:[(0,P.jsx)(`h3`,{className:`text-xs font-medium`,children:`Inherited from the snapshot`}),F.map(e=>(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:`font-medium`,children:e.label}),` —`,` `,e.note]},e.label))]}),(0,P.jsx)(re,{commands:ve(e,{dbInstanceIdentifier:K.dbInstanceIdentifier??``,dbInstanceClass:K.dbInstanceClass??``,allocatedStorage:K.allocatedStorage??B,port:K.port??``,dbSubnetGroupName:q,vpcSecurityGroupIds:J,dbParameterGroupName:K.dbParameterGroupName??``,deletionProtection:K.deletionProtection??!1})}),(0,P.jsx)(pe,{isPending:r.isPending,isSubmitting:xe,onCancel:async()=>{await t({to:`/rds/describe-db-snapshots`})},pendingLabel:`Restoring…`,submitLabel:`Restore Snapshot`})]})]})]})}function ve(e,t){return[{label:`Restore DB Instance`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws rds restore-db-instance-from-db-snapshot`},...c(`--db-snapshot-identifier`,e),...c(`--db-instance-identifier`,s(t.dbInstanceIdentifier,`DBInstanceIdentifier`)),...c(`--db-instance-class`,s(t.dbInstanceClass,`DBInstanceClass`)),...c(`--allocated-storage`,t.allocatedStorage),...o(`--port`,t.port),...o(`--db-subnet-group-name`,t.dbSubnetGroupName),...o(`--vpc-security-group-ids`,t.vpcSecurityGroupIds.join(` `)),...o(`--db-parameter-group-name`,t.dbParameterGroupName),...o(`--deletion-protection`,t.deletionProtection)]}]}function L(){let e=(0,M.c)(2),{id:t}=g.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,P.jsx)(I,{dbSnapshotIdentifier:n}),e[0]=n,e[1]=r),r}export{L as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_instanceProfileName2.js b/spinifex/services/spinifexui/frontend/dist/assets/_instanceProfileName2.js index a99b792d9..e78dffbd5 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_instanceProfileName2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_instanceProfileName2.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{D as u,h as d,t as f}from"./iam.js";import{u as p,y as m}from"./iam2.js";import{t as h}from"./_instanceProfileName.js";import{t as g}from"./error-banner.js";import{t as _}from"./page-heading.js";import{t as v}from"./delete-confirmation-dialog.js";import{n as y,t as b}from"./detail-row.js";var x=e(n()),S=t();function C(){let{instanceProfileName:e}=h.useParams(),t=a(),{data:n}=r(p(e)),{data:C}=r(m),w=d(),T=f(),E=u(),[D,O]=(0,x.useState)(!1),[k,A]=(0,x.useState)(!1),[j,M]=(0,x.useState)(null),N=n.InstanceProfile,P=N?.Roles??[],F=C.Roles??[],I=new Set(P.map(e=>e.RoleName)),L=F.filter(e=>e.RoleName&&!I.has(e.RoleName)),R=async()=>{try{await w.mutateAsync(e),t({to:`/iam/list-instance-profiles`})}finally{O(!1)}},z=async t=>{await T.mutateAsync({instanceProfileName:e,roleName:t}),A(!1)},B=async t=>{M(t);try{await E.mutateAsync({instanceProfileName:e,roleName:t})}finally{M(null)}};return N?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(s,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),w.error&&(0,S.jsx)(g,{error:w.error,msg:`Failed to delete instance profile`}),T.error&&(0,S.jsx)(g,{error:T.error,msg:`Failed to add role`}),E.error&&(0,S.jsx)(g,{error:E.error,msg:`Failed to remove role`}),(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsx)(_,{actions:(0,S.jsxs)(l,{onClick:()=>O(!0),size:`sm`,variant:`destructive`,children:[(0,S.jsx)(c,{className:`size-4`}),`Delete`]}),subtitle:`Instance Profile Details`,title:N.InstanceProfileName??``}),(0,S.jsxs)(y,{children:[(0,S.jsx)(y.Header,{children:`Instance Profile Information`}),(0,S.jsxs)(y.Content,{children:[(0,S.jsx)(b,{label:`Name`,value:N.InstanceProfileName}),(0,S.jsx)(b,{label:`ID`,value:N.InstanceProfileId}),(0,S.jsx)(b,{label:`ARN`,value:N.Arn}),(0,S.jsx)(b,{label:`Path`,value:N.Path}),(0,S.jsx)(b,{label:`Created`,value:o(N.CreateDate)})]})]}),(0,S.jsxs)(y,{children:[(0,S.jsx)(y.Header,{children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(`span`,{children:`Roles`}),(0,S.jsx)(l,{onClick:()=>A(!k),size:`sm`,children:`Add Role`})]})}),(0,S.jsxs)(y.Content,{children:[k&&L.length>0&&(0,S.jsxs)(`div`,{className:`col-span-2 space-y-2 rounded-md border p-3`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium`,children:`Select a role to add:`}),(0,S.jsx)(`div`,{className:`space-y-1`,children:L.map(e=>(0,S.jsxs)(`button`,{className:`flex w-full items-center justify-between rounded-md p-2 text-left text-sm hover:bg-accent`,disabled:T.isPending,onClick:()=>{e.RoleName&&z(e.RoleName)},type:`button`,children:[(0,S.jsx)(`span`,{children:e.RoleName}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.Arn})]},e.RoleName))})]}),k&&L.length===0&&(0,S.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No roles available to add.`}),P.length>0?(0,S.jsx)(`div`,{className:`col-span-2 space-y-3`,children:P.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,S.jsx)(i,{className:`text-sm font-medium text-primary hover:underline`,params:{roleName:e.RoleName??``},to:`/iam/list-roles/$roleName`,children:e.RoleName}),(0,S.jsx)(l,{disabled:j===e.RoleName,onClick:()=>{e.RoleName&&B(e.RoleName)},size:`sm`,variant:`outline`,children:`Remove`})]},e.RoleName))}):(0,S.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No roles in this instance profile.`})]})]})]}),(0,S.jsx)(v,{description:`Are you sure you want to delete the instance profile "${e}"? This action cannot be undone. You must remove all roles first.`,isPending:w.isPending,onConfirm:R,onOpenChange:O,open:D,title:`Delete Instance Profile`})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(s,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:`Instance profile not found.`})]})}export{C as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{D as u,h as d,t as f}from"./iam.js";import{u as p,y as m}from"./iam2.js";import{t as h}from"./_instanceProfileName.js";import{t as g}from"./error-banner.js";import{t as _}from"./page-heading.js";import{t as v}from"./delete-confirmation-dialog.js";import{n as y,t as b}from"./detail-row.js";var x=e(n()),S=t();function C(){let{instanceProfileName:e}=h.useParams(),t=a(),{data:n}=r(p(e)),{data:C}=r(m),w=d(),T=f(),E=u(),[D,O]=(0,x.useState)(!1),[k,A]=(0,x.useState)(!1),[j,M]=(0,x.useState)(null),N=n.InstanceProfile,P=N?.Roles??[],F=C.Roles??[],I=new Set(P.map(e=>e.RoleName)),L=F.filter(e=>e.RoleName&&!I.has(e.RoleName)),R=async()=>{try{await w.mutateAsync(e),t({to:`/iam/list-instance-profiles`})}finally{O(!1)}},z=async t=>{await T.mutateAsync({instanceProfileName:e,roleName:t}),A(!1)},B=async t=>{M(t);try{await E.mutateAsync({instanceProfileName:e,roleName:t})}finally{M(null)}};return N?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(s,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),w.error&&(0,S.jsx)(g,{error:w.error,msg:`Failed to delete instance profile`}),T.error&&(0,S.jsx)(g,{error:T.error,msg:`Failed to add role`}),E.error&&(0,S.jsx)(g,{error:E.error,msg:`Failed to remove role`}),(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsx)(_,{actions:(0,S.jsxs)(l,{onClick:()=>{O(!0)},size:`sm`,variant:`destructive`,children:[(0,S.jsx)(c,{className:`size-4`}),`Delete`]}),subtitle:`Instance Profile Details`,title:N.InstanceProfileName??``}),(0,S.jsxs)(y,{children:[(0,S.jsx)(y.Header,{children:`Instance Profile Information`}),(0,S.jsxs)(y.Content,{children:[(0,S.jsx)(b,{label:`Name`,value:N.InstanceProfileName}),(0,S.jsx)(b,{label:`ID`,value:N.InstanceProfileId}),(0,S.jsx)(b,{label:`ARN`,value:N.Arn}),(0,S.jsx)(b,{label:`Path`,value:N.Path}),(0,S.jsx)(b,{label:`Created`,value:o(N.CreateDate)})]})]}),(0,S.jsxs)(y,{children:[(0,S.jsx)(y.Header,{children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(`span`,{children:`Roles`}),(0,S.jsx)(l,{onClick:()=>{A(!k)},size:`sm`,children:`Add Role`})]})}),(0,S.jsxs)(y.Content,{children:[k&&L.length>0&&(0,S.jsxs)(`div`,{className:`col-span-2 space-y-2 rounded-md border p-3`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium`,children:`Select a role to add:`}),(0,S.jsx)(`div`,{className:`space-y-1`,children:L.map(e=>(0,S.jsxs)(`button`,{className:`flex w-full items-center justify-between rounded-md p-2 text-left text-sm hover:bg-accent`,disabled:T.isPending,onClick:()=>{e.RoleName&&z(e.RoleName)},type:`button`,children:[(0,S.jsx)(`span`,{children:e.RoleName}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.Arn})]},e.RoleName))})]}),k&&L.length===0&&(0,S.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No roles available to add.`}),P.length>0?(0,S.jsx)(`div`,{className:`col-span-2 space-y-3`,children:P.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,S.jsx)(i,{className:`text-sm font-medium text-primary hover:underline`,params:{roleName:e.RoleName??``},to:`/iam/list-roles/$roleName`,children:e.RoleName}),(0,S.jsx)(l,{disabled:j===e.RoleName,onClick:()=>{e.RoleName&&B(e.RoleName)},size:`sm`,variant:`outline`,children:`Remove`})]},e.RoleName))}):(0,S.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No roles in this instance profile.`})]})]})]}),(0,S.jsx)(v,{description:`Are you sure you want to delete the instance profile "${e}"? This action cannot be undone. You must remove all roles first.`,isPending:w.isPending,onConfirm:R,onOpenChange:O,open:D,title:`Delete Instance Profile`})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(s,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:`Instance profile not found.`})]})}export{C as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_name3.js b/spinifex/services/spinifexui/frontend/dist/assets/_name3.js index 7d4327e5d..356429964 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_name3.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_name3.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./useNavigate.js";import{t as o}from"./back-link.js";import{c as s,i as c,n as l,s as u,t as d}from"./select.js";import{t as f}from"./trash-2.js";import{t as p}from"./button.js";import{t as m}from"./input.js";import{b as h,s as g,t as _}from"./rds.js";import{u as ee}from"./rds2.js";import{f as v,u as te}from"./rds3.js";import{t as y}from"./_name.js";import{t as ne}from"./page-heading.js";import{n as re,t as b}from"./detail-row.js";import{i as ie,n as ae,r as oe,t as se}from"./tabs.js";import{t as ce}from"./rds-tags-tab.js";import{t as le}from"./delete-db-parameter-group-dialog.js";var ue=r(),de=e(n(),1),x=t();function S(e){let t=e.AllowedValues??``;if(e.DataType!==`boolean`&&e.DataType!==`enum`)return null;let n=t.split(`,`).filter(e=>e.length>0);return n.length===0?null:n.includes(e.ParameterValue??``)?n:null}function C(e){return e.DataType===`integer`||e.DataType===`real`}function w(e){return e.ApplyType===`static`?_:e.ApplyMethod??`pending-reboot`}function T(e){let t=(0,ue.c)(23),{parameter:n,value:r,options:i,editable:a,onChange:o}=e,c=n.ParameterName??``;if(!a){let e;return t[0]===r?e=t[1]:(e=(0,x.jsx)(`span`,{className:`font-mono text-xs`,children:r}),t[0]=r,t[1]=e),e}if(i){let e;t[2]===o?e=t[3]:(e=e=>o(e??``),t[2]=o,t[3]=e);let n=`Value of ${c}`,a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,x.jsx)(s,{}),t[4]=a):a=t[4];let f;t[5]===n?f=t[6]:(f=(0,x.jsx)(u,{"aria-label":n,className:`w-40`,children:a}),t[5]=n,t[6]=f);let p;t[7]===i?p=t[8]:(p=i.map(E),t[7]=i,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,x.jsx)(l,{children:p}),t[9]=p,t[10]=m);let h;return t[11]!==e||t[12]!==f||t[13]!==m||t[14]!==r?(h=(0,x.jsxs)(d,{onValueChange:e,value:r,children:[f,m]}),t[11]=e,t[12]=f,t[13]=m,t[14]=r,t[15]=h):h=t[15],h}let f=`Value of ${c}`,p;t[16]===o?p=t[17]:(p=e=>o(e.target.value),t[16]=o,t[17]=p);let h=C(n)?`number`:`text`,g;return t[18]!==f||t[19]!==p||t[20]!==h||t[21]!==r?(g=(0,x.jsx)(m,{"aria-label":f,className:`w-40`,onChange:p,type:h,value:r}),t[18]=f,t[19]=p,t[20]=h,t[21]=r,t[22]=g):g=t[22],g}function E(e){return(0,x.jsx)(c,{value:e,children:e},e)}function fe({dbParameterGroupName:e,parameters:t,readOnly:n}){let r=ee(),[i,a]=(0,de.useState)({}),[o,f]=(0,de.useState)(``),[h,_]=(0,de.useState)(`all`),v=Object.keys(i),te=v.length>20,y=v.some(e=>(i[e]?.value??``).trim()===``),ne=(e,t)=>{let n=e.ParameterName??``;a(r=>({...r,[n]:{value:e.ParameterValue??``,applyMethod:w(e),...r[n],...t}}))},re=e=>{a(t=>{let{[e]:n,...r}=t;return r})},b=async()=>{try{await r.mutateAsync({dbParameterGroupName:e,parameters:v.map(e=>({name:e,value:i[e]?.value??``,applyMethod:i[e]?.applyMethod??`pending-reboot`}))}),a({})}catch{}},ie=o.trim().toLowerCase(),ae=t.filter(e=>{let t=e.Source??``;return h===`user`&&t!==`user`||h===`engine-default`&&t===`user`?!1:(e.ParameterName??``).toLowerCase().includes(ie)});return(0,x.jsxs)(`div`,{className:`space-y-4`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,x.jsxs)(`div`,{className:`grow`,children:[(0,x.jsx)(`label`,{className:`sr-only`,htmlFor:`parameter-filter`,children:`Filter parameters`}),(0,x.jsx)(m,{id:`parameter-filter`,onChange:e=>f(e.target.value),placeholder:`Filter by parameter name`,value:o})]}),(0,x.jsxs)(d,{onValueChange:e=>_(e??`all`),value:h,children:[(0,x.jsx)(u,{"aria-label":`Filter by source`,className:`w-56`,children:(0,x.jsx)(s,{})}),(0,x.jsxs)(l,{children:[(0,x.jsx)(c,{value:`all`,children:`All parameters`}),(0,x.jsx)(c,{value:`user`,children:`Modified (user)`}),(0,x.jsx)(c,{value:`engine-default`,children:`Engine default`})]})]})]}),!n&&v.length>0&&(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-md border p-3`,children:[(0,x.jsxs)(`p`,{className:`text-sm`,children:[v.length,` parameter`,v.length===1?``:`s`,` edited`]}),(0,x.jsx)(p,{disabled:te||y||r.isPending,onClick:()=>{b()},size:`sm`,children:r.isPending?`Saving…`:`Save Changes`}),(0,x.jsx)(p,{onClick:()=>a({}),size:`sm`,variant:`outline`,children:`Discard`}),te&&(0,x.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`At most `,20,` parameters can be saved at once. Each save is applied as a whole, so a larger edit is split by you rather than half-applied by us.`]}),y&&(0,x.jsx)(`p`,{className:`text-xs text-destructive`,children:`An edited parameter cannot be left blank.`})]}),r.error&&(0,x.jsx)(`p`,{className:`text-sm text-destructive`,children:r.error.message}),ae.length>0?(0,x.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,x.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Value`}),(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Allowed`}),(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Source`}),(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Apply`}),(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,x.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,x.jsx)(`tbody`,{children:ae.map(e=>{let t=e.ParameterName??``,r=i[t],a=S(e),o=!n&&e.IsModifiable,f=r?.value??e.ParameterValue??``,m=r?.applyMethod??w(e),h=g(e.ApplyType);return(0,x.jsxs)(`tr`,{className:`border-b align-top last:border-0`,children:[(0,x.jsxs)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:[t,(0,x.jsx)(`span`,{className:`mt-0.5 block font-sans text-muted-foreground`,children:e.Description})]}),(0,x.jsx)(`td`,{className:`px-4 py-2`,children:(0,x.jsx)(T,{editable:o??!1,onChange:t=>ne(e,{value:t}),options:a,parameter:e,value:f})}),(0,x.jsxs)(`td`,{className:`px-4 py-2 font-mono text-xs text-muted-foreground`,children:[e.AllowedValues??`—`,(0,x.jsxs)(`span`,{className:`mt-0.5 block font-sans`,children:[e.DataType,!e.IsModifiable&&` · fixed by the platform`]})]}),(0,x.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:e.Source}),(0,x.jsx)(`td`,{className:`px-4 py-2`,children:o&&r&&h.length>1?(0,x.jsxs)(d,{onValueChange:t=>ne(e,{applyMethod:t??`pending-reboot`}),value:m,children:[(0,x.jsx)(u,{"aria-label":`Apply method of ${t}`,className:`w-44`,children:(0,x.jsx)(s,{})}),(0,x.jsx)(l,{children:h.map(e=>(0,x.jsx)(c,{value:e,children:e},e))})]}):(0,x.jsxs)(`span`,{className:`text-xs`,children:[m,e.ApplyType===`static`&&(0,x.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:`static — adopted at the next reboot`})]})}),(0,x.jsx)(`td`,{className:`px-4 py-2 text-right`,children:r&&(0,x.jsx)(p,{onClick:()=>re(t),size:`sm`,variant:`ghost`,children:`Reset`})})]},t)})})]})}):(0,x.jsx)(`p`,{className:`text-muted-foreground`,children:`No parameter matches this filter.`})]})}function D(e){let t=(0,ue.c)(112),{dbParameterGroupName:n}=e,r=a(),s;t[0]===n?s=t[1]:(s=te(n),t[0]=n,t[1]=s);let{data:c}=i(s),l=c.DBParameterGroups?.[0],u;t[2]===n?u=t[3]:(u=h(n),t[2]=n,t[3]=u);let d=u,m=d?``:l?.DBParameterGroupArn??``,g;t[4]===n?g=t[5]:(g=v(n),t[4]=n,t[5]=g);let{data:_}=i(g),[ee,y]=(0,de.useState)(!1);if(!l?.DBParameterGroupName){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(o,{to:`/rds/describe-db-parameter-groups`,children:`Back to parameter groups`}),(0,x.jsx)(`p`,{className:`text-muted-foreground`,children:`DB parameter group not found.`})]}),t[6]=e):e=t[6],e}let S;t[7]===_.Parameters?S=t[8]:(S=_.Parameters??[],t[7]=_.Parameters,t[8]=S);let C=S,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U;if(t[9]!==n||t[10]!==l.DBParameterGroupFamily||t[11]!==l.Description||t[12]!==d||t[13]!==C){let e=C.filter(pe).length;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,x.jsx)(o,{to:`/rds/describe-db-parameter-groups`,children:`Back to parameter groups`}),t[34]=R):R=t[34],F=`space-y-6`;let r;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>y(!0),t[35]=r):r=t[35];let i;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,x.jsx)(f,{className:`size-4`}),t[36]=i):i=t[36];let a;t[37]===d?a=t[38]:(a=(0,x.jsxs)(p,{disabled:d,onClick:r,size:`sm`,variant:`destructive`,children:[i,`Delete`]}),t[37]=d,t[38]=a),t[39]!==n||t[40]!==a?(I=(0,x.jsx)(ne,{actions:a,subtitle:`DB Parameter Group`,title:n}),t[39]=n,t[40]=a,t[41]=I):I=t[41],t[42]===d?L=t[43]:(L=d&&(0,x.jsxs)(`div`,{className:`rounded-md border border-tactical-amber/40 bg-tactical-amber/5 p-4 text-sm`,role:`note`,children:[(0,x.jsx)(`p`,{className:`font-medium`,children:`This is a default parameter group`}),(0,x.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`The service owns it. It can be read and attached to an instance, but it cannot be modified, deleted or tagged. Create your own group of the same family to change a value.`})]}),t[42]=d,t[43]=L),O=se,M=`parameters`;let s,c;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,x.jsx)(ie,{value:`parameters`,children:`Parameters`}),c=(0,x.jsx)(ie,{value:`details`,children:`Details`}),t[44]=s,t[45]=c):(s=t[44],c=t[45]);let u;t[46]===d?u=t[47]:(u=!d&&(0,x.jsx)(ie,{value:`tags`,children:`Tags`}),t[46]=d,t[47]=u),t[48]===u?N=t[49]:(N=(0,x.jsxs)(ae,{children:[s,c,u]}),t[48]=u,t[49]=N),t[50]!==n||t[51]!==d||t[52]!==C?(P=(0,x.jsx)(oe,{value:`parameters`,children:(0,x.jsx)(fe,{dbParameterGroupName:n,parameters:C,readOnly:d})}),t[50]=n,t[51]=d,t[52]=C,t[53]=P):P=t[53],D=oe,j=`details`,E=re,t[54]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,x.jsx)(re.Header,{children:`Details`}),t[54]=A):A=t[54],T=re.Content,t[55]===l.DBParameterGroupFamily?V=t[56]:(V=(0,x.jsx)(b,{label:`Family`,value:l.DBParameterGroupFamily}),t[55]=l.DBParameterGroupFamily,t[56]=V),t[57]===l.Description?H=t[58]:(H=(0,x.jsx)(b,{label:`Description`,value:l.Description}),t[57]=l.Description,t[58]=H);let m=d?`Default`:`Customer`;t[59]===m?U=t[60]:(U=(0,x.jsx)(b,{label:`Type`,value:m}),t[59]=m,t[60]=U);let h;t[61]===C.length?h=t[62]:(h=C.length.toString(),t[61]=C.length,t[62]=h),t[63]===h?k=t[64]:(k=(0,x.jsx)(b,{label:`Parameters`,value:h}),t[63]=h,t[64]=k),w=b,z=`Overridden`,B=e.toString(),t[9]=n,t[10]=l.DBParameterGroupFamily,t[11]=l.Description,t[12]=d,t[13]=C,t[14]=w,t[15]=T,t[16]=E,t[17]=D,t[18]=O,t[19]=k,t[20]=A,t[21]=j,t[22]=M,t[23]=N,t[24]=P,t[25]=F,t[26]=I,t[27]=L,t[28]=R,t[29]=z,t[30]=B,t[31]=V,t[32]=H,t[33]=U}else w=t[14],T=t[15],E=t[16],D=t[17],O=t[18],k=t[19],A=t[20],j=t[21],M=t[22],N=t[23],P=t[24],F=t[25],I=t[26],L=t[27],R=t[28],z=t[29],B=t[30],V=t[31],H=t[32],U=t[33];let W;t[65]!==w||t[66]!==z||t[67]!==B?(W=(0,x.jsx)(w,{label:z,value:B}),t[65]=w,t[66]=z,t[67]=B,t[68]=W):W=t[68];let G;t[69]===l.DBParameterGroupArn?G=t[70]:(G=(0,x.jsx)(b,{label:`ARN`,value:l.DBParameterGroupArn}),t[69]=l.DBParameterGroupArn,t[70]=G);let K;t[71]!==T||t[72]!==k||t[73]!==W||t[74]!==G||t[75]!==V||t[76]!==H||t[77]!==U?(K=(0,x.jsxs)(T,{children:[V,H,U,k,W,G]}),t[71]=T,t[72]=k,t[73]=W,t[74]=G,t[75]=V,t[76]=H,t[77]=U,t[78]=K):K=t[78];let q;t[79]!==E||t[80]!==A||t[81]!==K?(q=(0,x.jsxs)(E,{children:[A,K]}),t[79]=E,t[80]=A,t[81]=K,t[82]=q):q=t[82];let J;t[83]!==D||t[84]!==j||t[85]!==q?(J=(0,x.jsx)(D,{value:j,children:q}),t[83]=D,t[84]=j,t[85]=q,t[86]=J):J=t[86];let Y;t[87]!==m||t[88]!==d?(Y=!d&&(0,x.jsx)(oe,{value:`tags`,children:(0,x.jsx)(ce,{arn:m})}),t[87]=m,t[88]=d,t[89]=Y):Y=t[89];let X;t[90]!==O||t[91]!==M||t[92]!==N||t[93]!==P||t[94]!==J||t[95]!==Y?(X=(0,x.jsxs)(O,{defaultValue:M,children:[N,P,J,Y]}),t[90]=O,t[91]=M,t[92]=N,t[93]=P,t[94]=J,t[95]=Y,t[96]=X):X=t[96];let Z;t[97]!==F||t[98]!==I||t[99]!==L||t[100]!==X?(Z=(0,x.jsxs)(`div`,{className:F,children:[I,L,X]}),t[97]=F,t[98]=I,t[99]=L,t[100]=X,t[101]=Z):Z=t[101];let Q;t[102]===r?Q=t[103]:(Q=async()=>await r({to:`/rds/describe-db-parameter-groups`}),t[102]=r,t[103]=Q);let $;t[104]!==n||t[105]!==ee||t[106]!==Q?($=(0,x.jsx)(le,{dbParameterGroupName:n,onDeleted:Q,onOpenChange:y,open:ee}),t[104]=n,t[105]=ee,t[106]=Q,t[107]=$):$=t[107];let me;return t[108]!==R||t[109]!==Z||t[110]!==$?(me=(0,x.jsxs)(x.Fragment,{children:[R,Z,$]}),t[108]=R,t[109]=Z,t[110]=$,t[111]=me):me=t[111],me}function pe(e){return e.Source===`user`}function O(){let e=(0,ue.c)(2),{name:t}=y.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,x.jsx)(D,{dbParameterGroupName:n}),e[0]=n,e[1]=r),r}export{O as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./useNavigate.js";import{t as o}from"./back-link.js";import{c as s,i as c,n as l,s as u,t as d}from"./select.js";import{t as f}from"./trash-2.js";import{t as p}from"./button.js";import{t as m}from"./input.js";import{b as h,s as g,t as _}from"./rds.js";import{u as ee}from"./rds2.js";import{f as v,u as te}from"./rds3.js";import{t as y}from"./_name.js";import{t as ne}from"./page-heading.js";import{n as re,t as b}from"./detail-row.js";import{i as ie,n as ae,r as oe,t as se}from"./tabs.js";import{t as ce}from"./rds-tags-tab.js";import{t as le}from"./delete-db-parameter-group-dialog.js";var ue=r(),de=e(n(),1),x=t();function S(e){let t=e.AllowedValues??``;if(e.DataType!==`boolean`&&e.DataType!==`enum`)return null;let n=t.split(`,`).filter(e=>e.length>0);return n.length===0?null:n.includes(e.ParameterValue??``)?n:null}function C(e){return e.DataType===`integer`||e.DataType===`real`}function w(e){return e.ApplyType===`static`?_:e.ApplyMethod??`pending-reboot`}function T(e){let t=(0,ue.c)(23),{parameter:n,value:r,options:i,editable:a,onChange:o}=e,c=n.ParameterName??``;if(!a){let e;return t[0]===r?e=t[1]:(e=(0,x.jsx)(`span`,{className:`font-mono text-xs`,children:r}),t[0]=r,t[1]=e),e}if(i){let e;t[2]===o?e=t[3]:(e=e=>{o(e??``)},t[2]=o,t[3]=e);let n=`Value of ${c}`,a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,x.jsx)(s,{}),t[4]=a):a=t[4];let f;t[5]===n?f=t[6]:(f=(0,x.jsx)(u,{"aria-label":n,className:`w-40`,children:a}),t[5]=n,t[6]=f);let p;t[7]===i?p=t[8]:(p=i.map(E),t[7]=i,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,x.jsx)(l,{children:p}),t[9]=p,t[10]=m);let h;return t[11]!==e||t[12]!==f||t[13]!==m||t[14]!==r?(h=(0,x.jsxs)(d,{onValueChange:e,value:r,children:[f,m]}),t[11]=e,t[12]=f,t[13]=m,t[14]=r,t[15]=h):h=t[15],h}let f=`Value of ${c}`,p;t[16]===o?p=t[17]:(p=e=>{o(e.target.value)},t[16]=o,t[17]=p);let h=C(n)?`number`:`text`,g;return t[18]!==f||t[19]!==p||t[20]!==h||t[21]!==r?(g=(0,x.jsx)(m,{"aria-label":f,className:`w-40`,onChange:p,type:h,value:r}),t[18]=f,t[19]=p,t[20]=h,t[21]=r,t[22]=g):g=t[22],g}function E(e){return(0,x.jsx)(c,{value:e,children:e},e)}function fe({dbParameterGroupName:e,parameters:t,readOnly:n}){let r=ee(),[i,a]=(0,de.useState)({}),[o,f]=(0,de.useState)(``),[h,_]=(0,de.useState)(`all`),v=Object.keys(i),te=v.length>20,y=v.some(e=>(i[e]?.value??``).trim()===``),ne=(e,t)=>{let n=e.ParameterName??``;a(r=>({...r,[n]:{value:e.ParameterValue??``,applyMethod:w(e),...r[n],...t}}))},re=e=>{a(t=>{let{[e]:n,...r}=t;return r})},b=async()=>{try{await r.mutateAsync({dbParameterGroupName:e,parameters:v.map(e=>({name:e,value:i[e]?.value??``,applyMethod:i[e]?.applyMethod??`pending-reboot`}))}),a({})}catch{}},ie=o.trim().toLowerCase(),ae=t.filter(e=>{let t=e.Source??``;return h===`user`&&t!==`user`||h===`engine-default`&&t===`user`?!1:(e.ParameterName??``).toLowerCase().includes(ie)});return(0,x.jsxs)(`div`,{className:`space-y-4`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,x.jsxs)(`div`,{className:`grow`,children:[(0,x.jsx)(`label`,{className:`sr-only`,htmlFor:`parameter-filter`,children:`Filter parameters`}),(0,x.jsx)(m,{id:`parameter-filter`,onChange:e=>{f(e.target.value)},placeholder:`Filter by parameter name`,value:o})]}),(0,x.jsxs)(d,{onValueChange:e=>{_(e??`all`)},value:h,children:[(0,x.jsx)(u,{"aria-label":`Filter by source`,className:`w-56`,children:(0,x.jsx)(s,{})}),(0,x.jsxs)(l,{children:[(0,x.jsx)(c,{value:`all`,children:`All parameters`}),(0,x.jsx)(c,{value:`user`,children:`Modified (user)`}),(0,x.jsx)(c,{value:`engine-default`,children:`Engine default`})]})]})]}),!n&&v.length>0&&(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-md border p-3`,children:[(0,x.jsxs)(`p`,{className:`text-sm`,children:[v.length,` parameter`,v.length===1?``:`s`,` edited`]}),(0,x.jsx)(p,{disabled:te||y||r.isPending,onClick:()=>{b()},size:`sm`,children:r.isPending?`Saving…`:`Save Changes`}),(0,x.jsx)(p,{onClick:()=>{a({})},size:`sm`,variant:`outline`,children:`Discard`}),te&&(0,x.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`At most `,20,` parameters can be saved at once. Each save is applied as a whole, so a larger edit is split by you rather than half-applied by us.`]}),y&&(0,x.jsx)(`p`,{className:`text-xs text-destructive`,children:`An edited parameter cannot be left blank.`})]}),r.error&&(0,x.jsx)(`p`,{className:`text-sm text-destructive`,children:r.error.message}),ae.length>0?(0,x.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,x.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Value`}),(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Allowed`}),(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Source`}),(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Apply`}),(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,x.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,x.jsx)(`tbody`,{children:ae.map(e=>{let t=e.ParameterName??``,r=i[t],a=S(e),o=!n&&e.IsModifiable,f=r?.value??e.ParameterValue??``,m=r?.applyMethod??w(e),h=g(e.ApplyType);return(0,x.jsxs)(`tr`,{className:`border-b align-top last:border-0`,children:[(0,x.jsxs)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:[t,(0,x.jsx)(`span`,{className:`mt-0.5 block font-sans text-muted-foreground`,children:e.Description})]}),(0,x.jsx)(`td`,{className:`px-4 py-2`,children:(0,x.jsx)(T,{editable:o??!1,onChange:t=>{ne(e,{value:t})},options:a,parameter:e,value:f})}),(0,x.jsxs)(`td`,{className:`px-4 py-2 font-mono text-xs text-muted-foreground`,children:[e.AllowedValues??`—`,(0,x.jsxs)(`span`,{className:`mt-0.5 block font-sans`,children:[e.DataType,!e.IsModifiable&&` · fixed by the platform`]})]}),(0,x.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:e.Source}),(0,x.jsx)(`td`,{className:`px-4 py-2`,children:o&&r&&h.length>1?(0,x.jsxs)(d,{onValueChange:t=>{ne(e,{applyMethod:t??`pending-reboot`})},value:m,children:[(0,x.jsx)(u,{"aria-label":`Apply method of ${t}`,className:`w-44`,children:(0,x.jsx)(s,{})}),(0,x.jsx)(l,{children:h.map(e=>(0,x.jsx)(c,{value:e,children:e},e))})]}):(0,x.jsxs)(`span`,{className:`text-xs`,children:[m,e.ApplyType===`static`&&(0,x.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:`static — adopted at the next reboot`})]})}),(0,x.jsx)(`td`,{className:`px-4 py-2 text-right`,children:r&&(0,x.jsx)(p,{onClick:()=>{re(t)},size:`sm`,variant:`ghost`,children:`Reset`})})]},t)})})]})}):(0,x.jsx)(`p`,{className:`text-muted-foreground`,children:`No parameter matches this filter.`})]})}function D(e){let t=(0,ue.c)(112),{dbParameterGroupName:n}=e,r=a(),s;t[0]===n?s=t[1]:(s=te(n),t[0]=n,t[1]=s);let{data:c}=i(s),l=c.DBParameterGroups?.[0],u;t[2]===n?u=t[3]:(u=h(n),t[2]=n,t[3]=u);let d=u,m=d?``:l?.DBParameterGroupArn??``,g;t[4]===n?g=t[5]:(g=v(n),t[4]=n,t[5]=g);let{data:_}=i(g),[ee,y]=(0,de.useState)(!1);if(!l?.DBParameterGroupName){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(o,{to:`/rds/describe-db-parameter-groups`,children:`Back to parameter groups`}),(0,x.jsx)(`p`,{className:`text-muted-foreground`,children:`DB parameter group not found.`})]}),t[6]=e):e=t[6],e}let S;t[7]===_.Parameters?S=t[8]:(S=_.Parameters??[],t[7]=_.Parameters,t[8]=S);let C=S,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U;if(t[9]!==n||t[10]!==l.DBParameterGroupFamily||t[11]!==l.Description||t[12]!==d||t[13]!==C){let e=C.filter(pe).length;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,x.jsx)(o,{to:`/rds/describe-db-parameter-groups`,children:`Back to parameter groups`}),t[34]=R):R=t[34],F=`space-y-6`;let r;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{y(!0)},t[35]=r):r=t[35];let i;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,x.jsx)(f,{className:`size-4`}),t[36]=i):i=t[36];let a;t[37]===d?a=t[38]:(a=(0,x.jsxs)(p,{disabled:d,onClick:r,size:`sm`,variant:`destructive`,children:[i,`Delete`]}),t[37]=d,t[38]=a),t[39]!==n||t[40]!==a?(I=(0,x.jsx)(ne,{actions:a,subtitle:`DB Parameter Group`,title:n}),t[39]=n,t[40]=a,t[41]=I):I=t[41],t[42]===d?L=t[43]:(L=d&&(0,x.jsxs)(`div`,{className:`rounded-md border border-tactical-amber/40 bg-tactical-amber/5 p-4 text-sm`,role:`note`,children:[(0,x.jsx)(`p`,{className:`font-medium`,children:`This is a default parameter group`}),(0,x.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`The service owns it. It can be read and attached to an instance, but it cannot be modified, deleted or tagged. Create your own group of the same family to change a value.`})]}),t[42]=d,t[43]=L),O=se,M=`parameters`;let s,c;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,x.jsx)(ie,{value:`parameters`,children:`Parameters`}),c=(0,x.jsx)(ie,{value:`details`,children:`Details`}),t[44]=s,t[45]=c):(s=t[44],c=t[45]);let u;t[46]===d?u=t[47]:(u=!d&&(0,x.jsx)(ie,{value:`tags`,children:`Tags`}),t[46]=d,t[47]=u),t[48]===u?N=t[49]:(N=(0,x.jsxs)(ae,{children:[s,c,u]}),t[48]=u,t[49]=N),t[50]!==n||t[51]!==d||t[52]!==C?(P=(0,x.jsx)(oe,{value:`parameters`,children:(0,x.jsx)(fe,{dbParameterGroupName:n,parameters:C,readOnly:d})}),t[50]=n,t[51]=d,t[52]=C,t[53]=P):P=t[53],D=oe,j=`details`,E=re,t[54]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,x.jsx)(re.Header,{children:`Details`}),t[54]=A):A=t[54],T=re.Content,t[55]===l.DBParameterGroupFamily?V=t[56]:(V=(0,x.jsx)(b,{label:`Family`,value:l.DBParameterGroupFamily}),t[55]=l.DBParameterGroupFamily,t[56]=V),t[57]===l.Description?H=t[58]:(H=(0,x.jsx)(b,{label:`Description`,value:l.Description}),t[57]=l.Description,t[58]=H);let m=d?`Default`:`Customer`;t[59]===m?U=t[60]:(U=(0,x.jsx)(b,{label:`Type`,value:m}),t[59]=m,t[60]=U);let h;t[61]===C.length?h=t[62]:(h=C.length.toString(),t[61]=C.length,t[62]=h),t[63]===h?k=t[64]:(k=(0,x.jsx)(b,{label:`Parameters`,value:h}),t[63]=h,t[64]=k),w=b,z=`Overridden`,B=e.toString(),t[9]=n,t[10]=l.DBParameterGroupFamily,t[11]=l.Description,t[12]=d,t[13]=C,t[14]=w,t[15]=T,t[16]=E,t[17]=D,t[18]=O,t[19]=k,t[20]=A,t[21]=j,t[22]=M,t[23]=N,t[24]=P,t[25]=F,t[26]=I,t[27]=L,t[28]=R,t[29]=z,t[30]=B,t[31]=V,t[32]=H,t[33]=U}else w=t[14],T=t[15],E=t[16],D=t[17],O=t[18],k=t[19],A=t[20],j=t[21],M=t[22],N=t[23],P=t[24],F=t[25],I=t[26],L=t[27],R=t[28],z=t[29],B=t[30],V=t[31],H=t[32],U=t[33];let W;t[65]!==w||t[66]!==z||t[67]!==B?(W=(0,x.jsx)(w,{label:z,value:B}),t[65]=w,t[66]=z,t[67]=B,t[68]=W):W=t[68];let G;t[69]===l.DBParameterGroupArn?G=t[70]:(G=(0,x.jsx)(b,{label:`ARN`,value:l.DBParameterGroupArn}),t[69]=l.DBParameterGroupArn,t[70]=G);let K;t[71]!==T||t[72]!==k||t[73]!==W||t[74]!==G||t[75]!==V||t[76]!==H||t[77]!==U?(K=(0,x.jsxs)(T,{children:[V,H,U,k,W,G]}),t[71]=T,t[72]=k,t[73]=W,t[74]=G,t[75]=V,t[76]=H,t[77]=U,t[78]=K):K=t[78];let q;t[79]!==E||t[80]!==A||t[81]!==K?(q=(0,x.jsxs)(E,{children:[A,K]}),t[79]=E,t[80]=A,t[81]=K,t[82]=q):q=t[82];let J;t[83]!==D||t[84]!==j||t[85]!==q?(J=(0,x.jsx)(D,{value:j,children:q}),t[83]=D,t[84]=j,t[85]=q,t[86]=J):J=t[86];let Y;t[87]!==m||t[88]!==d?(Y=!d&&(0,x.jsx)(oe,{value:`tags`,children:(0,x.jsx)(ce,{arn:m})}),t[87]=m,t[88]=d,t[89]=Y):Y=t[89];let X;t[90]!==O||t[91]!==M||t[92]!==N||t[93]!==P||t[94]!==J||t[95]!==Y?(X=(0,x.jsxs)(O,{defaultValue:M,children:[N,P,J,Y]}),t[90]=O,t[91]=M,t[92]=N,t[93]=P,t[94]=J,t[95]=Y,t[96]=X):X=t[96];let Z;t[97]!==F||t[98]!==I||t[99]!==L||t[100]!==X?(Z=(0,x.jsxs)(`div`,{className:F,children:[I,L,X]}),t[97]=F,t[98]=I,t[99]=L,t[100]=X,t[101]=Z):Z=t[101];let Q;t[102]===r?Q=t[103]:(Q=async()=>{await r({to:`/rds/describe-db-parameter-groups`})},t[102]=r,t[103]=Q);let $;t[104]!==n||t[105]!==ee||t[106]!==Q?($=(0,x.jsx)(le,{dbParameterGroupName:n,onDeleted:Q,onOpenChange:y,open:ee}),t[104]=n,t[105]=ee,t[106]=Q,t[107]=$):$=t[107];let me;return t[108]!==R||t[109]!==Z||t[110]!==$?(me=(0,x.jsxs)(x.Fragment,{children:[R,Z,$]}),t[108]=R,t[109]=Z,t[110]=$,t[111]=me):me=t[111],me}function pe(e){return e.Source===`user`}function O(){let e=(0,ue.c)(2),{name:t}=y.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,x.jsx)(D,{dbParameterGroupName:n}),e[0]=n,e[1]=r),r}export{O as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_name4.js b/spinifex/services/spinifexui/frontend/dist/assets/_name4.js index 8fb0e9b3a..328a3b3fc 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_name4.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_name4.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{m as u}from"./rds3.js";import{t as d}from"./_name2.js";import{t as f}from"./page-heading.js";import{n as p,t as m}from"./detail-row.js";import{t as h}from"./state-badge.js";import{i as g,n as _,r as v,t as y}from"./tabs.js";import{t as b}from"./rds-tags-tab.js";import{t as x}from"./delete-db-subnet-group-dialog.js";var S=r(),C=e(n(),1),w=t();function T(e){let t=(0,S.c)(53),{dbSubnetGroupName:n}=e,r=o(),a;t[0]===n?a=t[1]:(a=u(n),t[0]=n,t[1]=a);let{data:d}=i(a),T=d.DBSubnetGroups?.[0],D=T?.DBSubnetGroupArn??``,[O,k]=(0,C.useState)(!1);if(!T?.DBSubnetGroupName){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s,{to:`/rds/describe-db-subnet-groups`,children:`Back to subnet groups`}),(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:`DB subnet group not found.`})]}),t[2]=e):e=t[2],e}let A;t[3]===T.Subnets?A=t[4]:(A=T.Subnets??[],t[3]=T.Subnets,t[4]=A);let j=A,M;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,w.jsx)(s,{to:`/rds/describe-db-subnet-groups`,children:`Back to subnet groups`}),t[5]=M):M=t[5];let N;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>k(!0),t[6]=N):N=t[6];let P;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,w.jsxs)(l,{onClick:N,size:`sm`,variant:`destructive`,children:[(0,w.jsx)(c,{className:`size-4`}),`Delete`]}),t[7]=P):P=t[7];let F;t[8]===n?F=t[9]:(F=(0,w.jsx)(f,{actions:P,subtitle:`DB Subnet Group`,title:n}),t[8]=n,t[9]=F);let I;t[10]===T.SubnetGroupStatus?I=t[11]:(I=(0,w.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,w.jsx)(h,{state:T.SubnetGroupStatus})}),t[10]=T.SubnetGroupStatus,t[11]=I);let L;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,w.jsxs)(_,{children:[(0,w.jsx)(g,{value:`subnets`,children:`Subnets`}),(0,w.jsx)(g,{value:`tags`,children:`Tags`})]}),t[12]=L):L=t[12];let R;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,w.jsx)(p.Header,{children:`Details`}),t[13]=R):R=t[13];let z;t[14]===T.DBSubnetGroupDescription?z=t[15]:(z=(0,w.jsx)(m,{label:`Description`,value:T.DBSubnetGroupDescription}),t[14]=T.DBSubnetGroupDescription,t[15]=z);let B;t[16]===T.VpcId?B=t[17]:(B=(0,w.jsx)(m,{label:`VPC`,value:T.VpcId}),t[16]=T.VpcId,t[17]=B);let V;t[18]===j.length?V=t[19]:(V=j.length.toString(),t[18]=j.length,t[19]=V);let H;t[20]===V?H=t[21]:(H=(0,w.jsx)(m,{label:`Subnets`,value:V}),t[20]=V,t[21]=H);let U;t[22]===T.DBSubnetGroupArn?U=t[23]:(U=(0,w.jsx)(m,{label:`ARN`,value:T.DBSubnetGroupArn}),t[22]=T.DBSubnetGroupArn,t[23]=U);let W;t[24]!==z||t[25]!==B||t[26]!==H||t[27]!==U?(W=(0,w.jsxs)(p,{children:[R,(0,w.jsxs)(p.Content,{children:[z,B,H,U]})]}),t[24]=z,t[25]=B,t[26]=H,t[27]=U,t[28]=W):W=t[28];let G;t[29]===j?G=t[30]:(G=j.length>0?(0,w.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,w.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Subnet`}),(0,w.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Availability zone`}),(0,w.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`})]})}),(0,w.jsx)(`tbody`,{children:j.map(E)})]})}):(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:`This group holds no subnets.`}),t[29]=j,t[30]=G);let K;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This group records which subnets RDS may place an endpoint in; each subnet's own CIDR, addresses and routing live on its EC2 page. Membership is fixed at create — ModifyDBSubnetGroup is not implemented. Changing it means creating a new group, which a DB instance can only adopt by being recreated.`}),t[31]=K):K=t[31];let q;t[32]!==W||t[33]!==G?(q=(0,w.jsx)(v,{value:`subnets`,children:(0,w.jsxs)(`div`,{className:`space-y-4`,children:[W,G,K]})}),t[32]=W,t[33]=G,t[34]=q):q=t[34];let J;t[35]===D?J=t[36]:(J=(0,w.jsx)(v,{value:`tags`,children:(0,w.jsx)(b,{arn:D})}),t[35]=D,t[36]=J);let Y;t[37]!==q||t[38]!==J?(Y=(0,w.jsxs)(y,{defaultValue:`subnets`,children:[L,q,J]}),t[37]=q,t[38]=J,t[39]=Y):Y=t[39];let X;t[40]!==Y||t[41]!==F||t[42]!==I?(X=(0,w.jsxs)(`div`,{className:`space-y-6`,children:[F,I,Y]}),t[40]=Y,t[41]=F,t[42]=I,t[43]=X):X=t[43];let Z;t[44]===r?Z=t[45]:(Z=async()=>await r({to:`/rds/describe-db-subnet-groups`}),t[44]=r,t[45]=Z);let Q;t[46]!==n||t[47]!==O||t[48]!==Z?(Q=(0,w.jsx)(x,{dbSubnetGroupName:n,onDeleted:Z,onOpenChange:k,open:O}),t[46]=n,t[47]=O,t[48]=Z,t[49]=Q):Q=t[49];let $;return t[50]!==X||t[51]!==Q?($=(0,w.jsxs)(w.Fragment,{children:[M,X,Q]}),t[50]=X,t[51]=Q,t[52]=$):$=t[52],$}function E(e){return(0,w.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:(0,w.jsx)(a,{className:`text-primary hover:underline`,params:{id:e.SubnetIdentifier??``},to:`/ec2/describe-subnets/$id`,children:e.SubnetIdentifier})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:e.SubnetAvailabilityZone?.Name??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:e.SubnetStatus})]},e.SubnetIdentifier)}function D(){let e=(0,S.c)(2),{name:t}=d.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,w.jsx)(T,{dbSubnetGroupName:n}),e[0]=n,e[1]=r),r}export{D as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{m as u}from"./rds3.js";import{t as d}from"./_name2.js";import{t as f}from"./page-heading.js";import{n as p,t as m}from"./detail-row.js";import{t as h}from"./state-badge.js";import{i as g,n as _,r as v,t as y}from"./tabs.js";import{t as b}from"./rds-tags-tab.js";import{t as x}from"./delete-db-subnet-group-dialog.js";var S=r(),C=e(n(),1),w=t();function T(e){let t=(0,S.c)(53),{dbSubnetGroupName:n}=e,r=o(),a;t[0]===n?a=t[1]:(a=u(n),t[0]=n,t[1]=a);let{data:d}=i(a),T=d.DBSubnetGroups?.[0],D=T?.DBSubnetGroupArn??``,[O,k]=(0,C.useState)(!1);if(!T?.DBSubnetGroupName){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s,{to:`/rds/describe-db-subnet-groups`,children:`Back to subnet groups`}),(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:`DB subnet group not found.`})]}),t[2]=e):e=t[2],e}let A;t[3]===T.Subnets?A=t[4]:(A=T.Subnets??[],t[3]=T.Subnets,t[4]=A);let j=A,M;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,w.jsx)(s,{to:`/rds/describe-db-subnet-groups`,children:`Back to subnet groups`}),t[5]=M):M=t[5];let N;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>{k(!0)},t[6]=N):N=t[6];let P;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,w.jsxs)(l,{onClick:N,size:`sm`,variant:`destructive`,children:[(0,w.jsx)(c,{className:`size-4`}),`Delete`]}),t[7]=P):P=t[7];let F;t[8]===n?F=t[9]:(F=(0,w.jsx)(f,{actions:P,subtitle:`DB Subnet Group`,title:n}),t[8]=n,t[9]=F);let I;t[10]===T.SubnetGroupStatus?I=t[11]:(I=(0,w.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,w.jsx)(h,{state:T.SubnetGroupStatus})}),t[10]=T.SubnetGroupStatus,t[11]=I);let L;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,w.jsxs)(_,{children:[(0,w.jsx)(g,{value:`subnets`,children:`Subnets`}),(0,w.jsx)(g,{value:`tags`,children:`Tags`})]}),t[12]=L):L=t[12];let R;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,w.jsx)(p.Header,{children:`Details`}),t[13]=R):R=t[13];let z;t[14]===T.DBSubnetGroupDescription?z=t[15]:(z=(0,w.jsx)(m,{label:`Description`,value:T.DBSubnetGroupDescription}),t[14]=T.DBSubnetGroupDescription,t[15]=z);let B;t[16]===T.VpcId?B=t[17]:(B=(0,w.jsx)(m,{label:`VPC`,value:T.VpcId}),t[16]=T.VpcId,t[17]=B);let V;t[18]===j.length?V=t[19]:(V=j.length.toString(),t[18]=j.length,t[19]=V);let H;t[20]===V?H=t[21]:(H=(0,w.jsx)(m,{label:`Subnets`,value:V}),t[20]=V,t[21]=H);let U;t[22]===T.DBSubnetGroupArn?U=t[23]:(U=(0,w.jsx)(m,{label:`ARN`,value:T.DBSubnetGroupArn}),t[22]=T.DBSubnetGroupArn,t[23]=U);let W;t[24]!==z||t[25]!==B||t[26]!==H||t[27]!==U?(W=(0,w.jsxs)(p,{children:[R,(0,w.jsxs)(p.Content,{children:[z,B,H,U]})]}),t[24]=z,t[25]=B,t[26]=H,t[27]=U,t[28]=W):W=t[28];let G;t[29]===j?G=t[30]:(G=j.length>0?(0,w.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,w.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Subnet`}),(0,w.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Availability zone`}),(0,w.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`})]})}),(0,w.jsx)(`tbody`,{children:j.map(E)})]})}):(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:`This group holds no subnets.`}),t[29]=j,t[30]=G);let K;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This group records which subnets RDS may place an endpoint in; each subnet's own CIDR, addresses and routing live on its EC2 page. Membership is fixed at create — ModifyDBSubnetGroup is not implemented. Changing it means creating a new group, which a DB instance can only adopt by being recreated.`}),t[31]=K):K=t[31];let q;t[32]!==W||t[33]!==G?(q=(0,w.jsx)(v,{value:`subnets`,children:(0,w.jsxs)(`div`,{className:`space-y-4`,children:[W,G,K]})}),t[32]=W,t[33]=G,t[34]=q):q=t[34];let J;t[35]===D?J=t[36]:(J=(0,w.jsx)(v,{value:`tags`,children:(0,w.jsx)(b,{arn:D})}),t[35]=D,t[36]=J);let Y;t[37]!==q||t[38]!==J?(Y=(0,w.jsxs)(y,{defaultValue:`subnets`,children:[L,q,J]}),t[37]=q,t[38]=J,t[39]=Y):Y=t[39];let X;t[40]!==Y||t[41]!==F||t[42]!==I?(X=(0,w.jsxs)(`div`,{className:`space-y-6`,children:[F,I,Y]}),t[40]=Y,t[41]=F,t[42]=I,t[43]=X):X=t[43];let Z;t[44]===r?Z=t[45]:(Z=async()=>{await r({to:`/rds/describe-db-subnet-groups`})},t[44]=r,t[45]=Z);let Q;t[46]!==n||t[47]!==O||t[48]!==Z?(Q=(0,w.jsx)(x,{dbSubnetGroupName:n,onDeleted:Z,onOpenChange:k,open:O}),t[46]=n,t[47]=O,t[48]=Z,t[49]=Q):Q=t[49];let $;return t[50]!==X||t[51]!==Q?($=(0,w.jsxs)(w.Fragment,{children:[M,X,Q]}),t[50]=X,t[51]=Q,t[52]=$):$=t[52],$}function E(e){return(0,w.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:(0,w.jsx)(a,{className:`text-primary hover:underline`,params:{id:e.SubnetIdentifier??``},to:`/ec2/describe-subnets/$id`,children:e.SubnetIdentifier})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:e.SubnetAvailabilityZone?.Name??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:e.SubnetStatus})]},e.SubnetIdentifier)}function D(){let e=(0,S.c)(2),{name:t}=d.useParams(),n=decodeURIComponent(t),r;return e[0]===n?r=e[1]:(r=(0,w.jsx)(T,{dbSubnetGroupName:n}),e[0]=n,e[1]=r),r}export{D as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_policyArn2.js b/spinifex/services/spinifexui/frontend/dist/assets/_policyArn2.js index 18fb173ca..0f45cf2ef 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_policyArn2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_policyArn2.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./useNavigate.js";import{$t as a}from"./cluster-config.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{g as l}from"./iam.js";import{h as u,m as d}from"./iam2.js";import{t as f}from"./_policyArn.js";import{t as p}from"./error-banner.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./policy-document-viewer.js";var y=e(n()),b=t();function x(){let{policyArn:e}=f.useParams(),t=decodeURIComponent(e),n=i(),{data:x}=r(d(t)),S=x.Policy,C=l(),[w,T]=(0,y.useState)(!1),E=S?.DefaultVersionId??`v1`,{data:D}=r(u(t,E)),O=D?.PolicyVersion?.Document?decodeURIComponent(D.PolicyVersion.Document):null;return S?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/iam/list-policies`,children:`Back to policies`}),C.error&&(0,b.jsx)(p,{error:C.error,msg:`Failed to delete policy`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(c,{onClick:()=>T(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(s,{className:`size-4`}),`Delete`]}),subtitle:`Policy Details`,title:S.PolicyName??``}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Policy Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Policy Name`,value:S.PolicyName}),(0,b.jsx)(_,{label:`Policy ID`,value:S.PolicyId}),(0,b.jsx)(_,{label:`ARN`,value:S.Arn}),(0,b.jsx)(_,{label:`Path`,value:S.Path}),(0,b.jsx)(_,{label:`Description`,value:S.Description??`-`}),(0,b.jsx)(_,{label:`Created`,value:a(S.CreateDate)})]})]}),O&&(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Policy Document`}),(0,b.jsx)(`div`,{className:`p-4`,children:(0,b.jsx)(v,{document:O})})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the policy "${S.PolicyName}"? This action cannot be undone.`,isPending:C.isPending,onConfirm:async()=>{try{await C.mutateAsync(t),n({to:`/iam/list-policies`})}finally{T(!1)}},onOpenChange:T,open:w,title:`Delete Policy`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/iam/list-policies`,children:`Back to policies`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Policy not found.`})]})}export{x as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./useNavigate.js";import{$t as a}from"./cluster-config.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{g as l}from"./iam.js";import{h as u,m as d}from"./iam2.js";import{t as f}from"./_policyArn.js";import{t as p}from"./error-banner.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./policy-document-viewer.js";var y=e(n()),b=t();function x(){let{policyArn:e}=f.useParams(),t=decodeURIComponent(e),n=i(),{data:x}=r(d(t)),S=x.Policy,C=l(),[w,T]=(0,y.useState)(!1),E=S?.DefaultVersionId??`v1`,{data:D}=r(u(t,E)),O=D?.PolicyVersion?.Document?decodeURIComponent(D.PolicyVersion.Document):null;return S?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/iam/list-policies`,children:`Back to policies`}),C.error&&(0,b.jsx)(p,{error:C.error,msg:`Failed to delete policy`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(c,{onClick:()=>{T(!0)},size:`sm`,variant:`destructive`,children:[(0,b.jsx)(s,{className:`size-4`}),`Delete`]}),subtitle:`Policy Details`,title:S.PolicyName??``}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Policy Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Policy Name`,value:S.PolicyName}),(0,b.jsx)(_,{label:`Policy ID`,value:S.PolicyId}),(0,b.jsx)(_,{label:`ARN`,value:S.Arn}),(0,b.jsx)(_,{label:`Path`,value:S.Path}),(0,b.jsx)(_,{label:`Description`,value:S.Description??`-`}),(0,b.jsx)(_,{label:`Created`,value:a(S.CreateDate)})]})]}),O&&(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Policy Document`}),(0,b.jsx)(`div`,{className:`p-4`,children:(0,b.jsx)(v,{document:O})})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the policy "${S.PolicyName}"? This action cannot be undone.`,isPending:C.isPending,onConfirm:async()=>{try{await C.mutateAsync(t),n({to:`/iam/list-policies`})}finally{T(!1)}},onOpenChange:T,open:w,title:`Delete Policy`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/iam/list-policies`,children:`Back to policies`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Policy not found.`})]})}export{x as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_roleName2.js b/spinifex/services/spinifexui/frontend/dist/assets/_roleName2.js index c11f1d62a..6f722f1c1 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_roleName2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_roleName2.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{_ as u}from"./iam.js";import{d,v as f}from"./iam2.js";import{t as p}from"./_roleName.js";import{t as m}from"./error-banner.js";import{t as h}from"./page-heading.js";import{t as g}from"./delete-confirmation-dialog.js";import{n as _,t as v}from"./detail-row.js";import{t as y}from"./policy-document-viewer.js";import{n as b,t as x}from"./inline-policies-panel.js";var S=e(n()),C=t();function w(){let{roleName:e}=p.useParams(),t=a(),{data:n}=r(f(e)),{data:w}=r(d(e)),T=u(),[E,D]=(0,S.useState)(!1),O=n.Role,k=w.InstanceProfiles??[],A=O?.AssumeRolePolicyDocument?decodeURIComponent(O.AssumeRolePolicyDocument):null;return O?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(s,{to:`/iam/list-roles`,children:`Back to roles`}),T.error&&(0,C.jsx)(m,{error:T.error,msg:`Failed to delete role`}),(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsx)(h,{actions:(0,C.jsxs)(l,{onClick:()=>D(!0),size:`sm`,variant:`destructive`,children:[(0,C.jsx)(c,{className:`size-4`}),`Delete`]}),subtitle:`Role Details`,title:O.RoleName??``}),(0,C.jsxs)(_,{children:[(0,C.jsx)(_.Header,{children:`Role Information`}),(0,C.jsxs)(_.Content,{children:[(0,C.jsx)(v,{label:`Role Name`,value:O.RoleName}),(0,C.jsx)(v,{label:`Role ID`,value:O.RoleId}),(0,C.jsx)(v,{label:`ARN`,value:O.Arn}),(0,C.jsx)(v,{label:`Path`,value:O.Path}),(0,C.jsx)(v,{label:`Description`,value:O.Description??`-`}),(0,C.jsx)(v,{label:`Created`,value:o(O.CreateDate)})]})]}),A&&(0,C.jsxs)(_,{children:[(0,C.jsx)(_.Header,{children:`Trust Policy`}),(0,C.jsx)(`div`,{className:`p-4`,children:(0,C.jsx)(y,{document:A})})]}),(0,C.jsx)(b,{kind:`role`,name:e}),(0,C.jsx)(x,{kind:`role`,name:e}),(0,C.jsxs)(_,{children:[(0,C.jsx)(_.Header,{children:`Instance Profiles`}),(0,C.jsx)(_.Content,{children:k.length>0?(0,C.jsx)(`div`,{className:`col-span-2 space-y-3`,children:k.map(e=>(0,C.jsxs)(i,{className:`flex items-center justify-between rounded-md border p-3 transition-colors hover:bg-accent`,params:{instanceProfileName:e.InstanceProfileName??``},to:`/iam/list-instance-profiles/$instanceProfileName`,children:[(0,C.jsx)(`p`,{className:`text-sm font-medium`,children:e.InstanceProfileName}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.Arn})]},e.InstanceProfileName))}):(0,C.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`This role is not in any instance profile.`})})]})]}),(0,C.jsx)(g,{description:`Are you sure you want to delete the role "${e}"? This action cannot be undone. You must detach all policies and remove it from all instance profiles first.`,isPending:T.isPending,onConfirm:async()=>{try{await T.mutateAsync(e),t({to:`/iam/list-roles`})}finally{D(!1)}},onOpenChange:D,open:E,title:`Delete Role`})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(s,{to:`/iam/list-roles`,children:`Back to roles`}),(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:`Role not found.`})]})}export{w as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{$t as o}from"./cluster-config.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{_ as u}from"./iam.js";import{d,v as f}from"./iam2.js";import{t as p}from"./_roleName.js";import{t as m}from"./error-banner.js";import{t as h}from"./page-heading.js";import{t as g}from"./delete-confirmation-dialog.js";import{n as _,t as v}from"./detail-row.js";import{t as y}from"./policy-document-viewer.js";import{n as b,t as x}from"./inline-policies-panel.js";var S=e(n()),C=t();function w(){let{roleName:e}=p.useParams(),t=a(),{data:n}=r(f(e)),{data:w}=r(d(e)),T=u(),[E,D]=(0,S.useState)(!1),O=n.Role,k=w.InstanceProfiles??[],A=O?.AssumeRolePolicyDocument?decodeURIComponent(O.AssumeRolePolicyDocument):null;return O?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(s,{to:`/iam/list-roles`,children:`Back to roles`}),T.error&&(0,C.jsx)(m,{error:T.error,msg:`Failed to delete role`}),(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsx)(h,{actions:(0,C.jsxs)(l,{onClick:()=>{D(!0)},size:`sm`,variant:`destructive`,children:[(0,C.jsx)(c,{className:`size-4`}),`Delete`]}),subtitle:`Role Details`,title:O.RoleName??``}),(0,C.jsxs)(_,{children:[(0,C.jsx)(_.Header,{children:`Role Information`}),(0,C.jsxs)(_.Content,{children:[(0,C.jsx)(v,{label:`Role Name`,value:O.RoleName}),(0,C.jsx)(v,{label:`Role ID`,value:O.RoleId}),(0,C.jsx)(v,{label:`ARN`,value:O.Arn}),(0,C.jsx)(v,{label:`Path`,value:O.Path}),(0,C.jsx)(v,{label:`Description`,value:O.Description??`-`}),(0,C.jsx)(v,{label:`Created`,value:o(O.CreateDate)})]})]}),A&&(0,C.jsxs)(_,{children:[(0,C.jsx)(_.Header,{children:`Trust Policy`}),(0,C.jsx)(`div`,{className:`p-4`,children:(0,C.jsx)(y,{document:A})})]}),(0,C.jsx)(b,{kind:`role`,name:e}),(0,C.jsx)(x,{kind:`role`,name:e}),(0,C.jsxs)(_,{children:[(0,C.jsx)(_.Header,{children:`Instance Profiles`}),(0,C.jsx)(_.Content,{children:k.length>0?(0,C.jsx)(`div`,{className:`col-span-2 space-y-3`,children:k.map(e=>(0,C.jsxs)(i,{className:`flex items-center justify-between rounded-md border p-3 transition-colors hover:bg-accent`,params:{instanceProfileName:e.InstanceProfileName??``},to:`/iam/list-instance-profiles/$instanceProfileName`,children:[(0,C.jsx)(`p`,{className:`text-sm font-medium`,children:e.InstanceProfileName}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.Arn})]},e.InstanceProfileName))}):(0,C.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`This role is not in any instance profile.`})})]})]}),(0,C.jsx)(g,{description:`Are you sure you want to delete the role "${e}"? This action cannot be undone. You must detach all policies and remove it from all instance profiles first.`,isPending:T.isPending,onConfirm:async()=>{try{await T.mutateAsync(e),t({to:`/iam/list-roles`})}finally{D(!1)}},onOpenChange:D,open:E,title:`Delete Role`})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(s,{to:`/iam/list-roles`,children:`Back to roles`}),(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:`Role not found.`})]})}export{w as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_userName2.js b/spinifex/services/spinifexui/frontend/dist/assets/_userName2.js index 9d67a46ba..ef9ad3da1 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_userName2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_userName2.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{$t as s}from"./cluster-config.js";import{t as c}from"./back-link.js";import{t as l}from"./check.js";import{t as u}from"./trash-2.js";import{t as d}from"./triangle-alert.js";import{t as f}from"./button.js";import{O as p,f as m,k as h,o as g,y as _}from"./iam.js";import{S as v,c as y,t as b}from"./iam2.js";import{t as x}from"./_userName.js";import{t as S}from"./use-copy-to-clipboard.js";import{t as C}from"./error-banner.js";import{t as w}from"./page-heading.js";import{a as T,c as E,i as D,l as O,o as k,r as A,s as j,t as M}from"./alert-dialog.js";import{t as N}from"./delete-confirmation-dialog.js";import{n as P,t as F}from"./detail-row.js";import{t as I}from"./state-badge.js";import{n as L,t as R}from"./inline-policies-panel.js";var z=e(n()),B=r(),V=t();function H(e){let t=(0,B.c)(27),{onClose:n,accessKeyId:r,secretAccessKey:i}=e,{copied:a,copy:o}=S(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsxs)(j,{children:[(0,V.jsx)(E,{children:(0,V.jsx)(d,{className:`text-destructive`})}),(0,V.jsx)(O,{children:`Save Your Access Key`}),(0,V.jsx)(T,{children:`This is your only chance to view the secret access key. Please copy it now. You won't be able to retrieve it again.`})]}),t[0]=s):s=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Access Key ID: `}),t[1]=c):c=t[1];let u;t[2]===r?u=t[3]:(u=(0,V.jsxs)(`div`,{children:[c,r]}),t[2]=r,t[3]=u);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Secret Access Key: `}),t[4]=p):p=t[4];let m;t[5]===i?m=t[6]:(m=(0,V.jsxs)(`div`,{children:[p,i]}),t[5]=i,t[6]=m);let h;t[7]!==u||t[8]!==m?(h=(0,V.jsxs)(`div`,{className:`space-y-2 rounded-md border p-4 font-mono text-sm`,children:[u,m]}),t[7]=u,t[8]=m,t[9]=h):h=t[9];let g;t[10]!==r||t[11]!==o||t[12]!==i?(g=async()=>await o(`Access Key ID: ${r}\nSecret Access Key: ${i}`),t[10]=r,t[11]=o,t[12]=i,t[13]=g):g=t[13];let _;t[14]===a?_=t[15]:(_=a?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l,{className:`mr-2 size-4`}),`Copied!`]}):`Copy to Clipboard`,t[14]=a,t[15]=_);let v;t[16]!==g||t[17]!==_?(v=(0,V.jsx)(f,{className:`w-full`,onClick:g,type:`button`,variant:`outline`,children:_}),t[16]=g,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==h||t[20]!==v?(y=(0,V.jsxs)(`div`,{className:`space-y-3`,children:[h,v]}),t[19]=h,t[20]=v,t[21]=y):y=t[21];let b;t[22]===n?b=t[23]:(b=(0,V.jsx)(k,{children:(0,V.jsx)(A,{onClick:n,children:`Close and Continue`})}),t[22]=n,t[23]=b);let x;return t[24]!==y||t[25]!==b?(x=(0,V.jsx)(M,{open:!0,children:(0,V.jsxs)(D,{className:`max-w-2xl`,children:[s,y,b]})}),t[24]=y,t[25]=b,t[26]=x):x=t[26],x}function U(){let{userName:e}=x.useParams(),t=o(),{data:n}=i(v(e)),{data:r}=i(b(e)),{data:l}=i(y(e)),d=_(),S=g(),T=m(),E=h(),D=p(),[O,k]=(0,z.useState)(!1),[A,j]=(0,z.useState)(null),[M,B]=(0,z.useState)(null),[U,W]=(0,z.useState)(null),G=n.User,K=r.AccessKeyMetadata??[],q=l.Groups??[],J=async()=>{try{await d.mutateAsync(e),t({to:`/iam/list-users`})}finally{k(!1)}},Y=async()=>{let t=await S.mutateAsync(e);t.AccessKey&&j({accessKeyId:t.AccessKey.AccessKeyId??``,secretAccessKey:t.AccessKey.SecretAccessKey??``})},X=async t=>{if(t.AccessKeyId){B(t.AccessKeyId);try{await E.mutateAsync({userName:e,accessKeyId:t.AccessKeyId,status:t.Status===`Active`?`Inactive`:`Active`})}finally{B(null)}}},Z=async t=>{B(t);try{await T.mutateAsync({userName:e,accessKeyId:t})}finally{B(null)}},Q=async t=>{W(t);try{await D.mutateAsync({groupName:t,userName:e})}finally{W(null)}};return G?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{to:`/iam/list-users`,children:`Back to users`}),d.error&&(0,V.jsx)(C,{error:d.error,msg:`Failed to delete user`}),S.error&&(0,V.jsx)(C,{error:S.error,msg:`Failed to create access key`}),T.error&&(0,V.jsx)(C,{error:T.error,msg:`Failed to delete access key`}),D.error&&(0,V.jsx)(C,{error:D.error,msg:`Failed to remove from group`}),(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsx)(w,{actions:(0,V.jsxs)(f,{onClick:()=>k(!0),size:`sm`,variant:`destructive`,children:[(0,V.jsx)(u,{className:`size-4`}),`Delete`]}),subtitle:`User Details`,title:G.UserName??``}),(0,V.jsxs)(P,{children:[(0,V.jsx)(P.Header,{children:`User Information`}),(0,V.jsxs)(P.Content,{children:[(0,V.jsx)(F,{label:`User Name`,value:G.UserName}),(0,V.jsx)(F,{label:`User ID`,value:G.UserId}),(0,V.jsx)(F,{label:`ARN`,value:G.Arn}),(0,V.jsx)(F,{label:`Path`,value:G.Path}),(0,V.jsx)(F,{label:`Created`,value:s(G.CreateDate)})]})]}),(0,V.jsxs)(P,{children:[(0,V.jsx)(P.Header,{children:(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{children:`Access Keys`}),(0,V.jsx)(f,{disabled:S.isPending,onClick:Y,size:`sm`,children:S.isPending?`Creating...`:`Create Access Key`})]})}),(0,V.jsx)(P.Content,{children:K.length>0?(0,V.jsx)(`div`,{className:`col-span-2 space-y-3`,children:K.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`p`,{className:`font-mono text-sm`,children:e.AccessKeyId}),(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Created `,s(e.CreateDate)]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(I,{state:e.Status}),(0,V.jsx)(f,{disabled:M===e.AccessKeyId,onClick:async()=>await X(e),size:`sm`,variant:`outline`,children:e.Status===`Active`?`Deactivate`:`Activate`}),(0,V.jsx)(f,{disabled:M===e.AccessKeyId,onClick:()=>{e.AccessKeyId&&Z(e.AccessKeyId)},size:`sm`,variant:`destructive`,children:`Delete`})]})]},e.AccessKeyId))}):(0,V.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No access keys.`})})]}),(0,V.jsx)(L,{kind:`user`,name:e}),(0,V.jsx)(R,{kind:`user`,name:e}),(0,V.jsxs)(P,{children:[(0,V.jsx)(P.Header,{children:`Groups`}),(0,V.jsx)(P.Content,{children:q.length>0?(0,V.jsx)(`div`,{className:`col-span-2 space-y-3`,children:q.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,V.jsx)(a,{className:`text-sm font-medium hover:underline`,params:{groupName:e.GroupName??``},to:`/iam/list-groups/$groupName`,children:e.GroupName}),(0,V.jsx)(f,{disabled:U===e.GroupName,onClick:()=>{e.GroupName&&Q(e.GroupName)},size:`sm`,variant:`outline`,children:`Remove`})]},e.GroupName))}):(0,V.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`Not a member of any group.`})})]})]}),(0,V.jsx)(N,{description:`Are you sure you want to delete the user "${e}"? This action cannot be undone. You must detach all policies and delete all access keys first.`,isPending:d.isPending,onConfirm:J,onOpenChange:k,open:O,title:`Delete User`}),A&&(0,V.jsx)(H,{accessKeyId:A.accessKeyId,onClose:()=>j(null),secretAccessKey:A.secretAccessKey})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{to:`/iam/list-users`,children:`Back to users`}),(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:`User not found.`})]})}export{U as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{$t as s}from"./cluster-config.js";import{t as c}from"./back-link.js";import{t as l}from"./check.js";import{t as u}from"./trash-2.js";import{t as d}from"./triangle-alert.js";import{t as f}from"./button.js";import{O as p,f as m,k as h,o as g,y as _}from"./iam.js";import{S as v,c as y,t as b}from"./iam2.js";import{t as x}from"./_userName.js";import{t as S}from"./use-copy-to-clipboard.js";import{t as C}from"./error-banner.js";import{t as w}from"./page-heading.js";import{a as T,c as E,i as D,l as O,o as k,r as A,s as j,t as M}from"./alert-dialog.js";import{t as N}from"./delete-confirmation-dialog.js";import{n as P,t as F}from"./detail-row.js";import{t as I}from"./state-badge.js";import{n as L,t as R}from"./inline-policies-panel.js";var z=e(n()),B=r(),V=t();function H(e){let t=(0,B.c)(27),{onClose:n,accessKeyId:r,secretAccessKey:i}=e,{copied:a,copy:o}=S(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsxs)(j,{children:[(0,V.jsx)(E,{children:(0,V.jsx)(d,{className:`text-destructive`})}),(0,V.jsx)(O,{children:`Save Your Access Key`}),(0,V.jsx)(T,{children:`This is your only chance to view the secret access key. Please copy it now. You won't be able to retrieve it again.`})]}),t[0]=s):s=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Access Key ID: `}),t[1]=c):c=t[1];let u;t[2]===r?u=t[3]:(u=(0,V.jsxs)(`div`,{children:[c,r]}),t[2]=r,t[3]=u);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Secret Access Key: `}),t[4]=p):p=t[4];let m;t[5]===i?m=t[6]:(m=(0,V.jsxs)(`div`,{children:[p,i]}),t[5]=i,t[6]=m);let h;t[7]!==u||t[8]!==m?(h=(0,V.jsxs)(`div`,{className:`space-y-2 rounded-md border p-4 font-mono text-sm`,children:[u,m]}),t[7]=u,t[8]=m,t[9]=h):h=t[9];let g;t[10]!==r||t[11]!==o||t[12]!==i?(g=async()=>{await o(`Access Key ID: ${r}\nSecret Access Key: ${i}`)},t[10]=r,t[11]=o,t[12]=i,t[13]=g):g=t[13];let _;t[14]===a?_=t[15]:(_=a?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l,{className:`mr-2 size-4`}),`Copied!`]}):`Copy to Clipboard`,t[14]=a,t[15]=_);let v;t[16]!==g||t[17]!==_?(v=(0,V.jsx)(f,{className:`w-full`,onClick:g,type:`button`,variant:`outline`,children:_}),t[16]=g,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==h||t[20]!==v?(y=(0,V.jsxs)(`div`,{className:`space-y-3`,children:[h,v]}),t[19]=h,t[20]=v,t[21]=y):y=t[21];let b;t[22]===n?b=t[23]:(b=(0,V.jsx)(k,{children:(0,V.jsx)(A,{onClick:n,children:`Close and Continue`})}),t[22]=n,t[23]=b);let x;return t[24]!==y||t[25]!==b?(x=(0,V.jsx)(M,{open:!0,children:(0,V.jsxs)(D,{className:`max-w-2xl`,children:[s,y,b]})}),t[24]=y,t[25]=b,t[26]=x):x=t[26],x}function U(){let{userName:e}=x.useParams(),t=o(),{data:n}=i(v(e)),{data:r}=i(b(e)),{data:l}=i(y(e)),d=_(),S=g(),T=m(),E=h(),D=p(),[O,k]=(0,z.useState)(!1),[A,j]=(0,z.useState)(null),[M,B]=(0,z.useState)(null),[U,W]=(0,z.useState)(null),G=n.User,K=r.AccessKeyMetadata??[],q=l.Groups??[],J=async()=>{try{await d.mutateAsync(e),t({to:`/iam/list-users`})}finally{k(!1)}},Y=async()=>{let t=await S.mutateAsync(e);t.AccessKey&&j({accessKeyId:t.AccessKey.AccessKeyId??``,secretAccessKey:t.AccessKey.SecretAccessKey??``})},X=async t=>{if(t.AccessKeyId){B(t.AccessKeyId);try{await E.mutateAsync({userName:e,accessKeyId:t.AccessKeyId,status:t.Status===`Active`?`Inactive`:`Active`})}finally{B(null)}}},Z=async t=>{B(t);try{await T.mutateAsync({userName:e,accessKeyId:t})}finally{B(null)}},Q=async t=>{W(t);try{await D.mutateAsync({groupName:t,userName:e})}finally{W(null)}};return G?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{to:`/iam/list-users`,children:`Back to users`}),d.error&&(0,V.jsx)(C,{error:d.error,msg:`Failed to delete user`}),S.error&&(0,V.jsx)(C,{error:S.error,msg:`Failed to create access key`}),T.error&&(0,V.jsx)(C,{error:T.error,msg:`Failed to delete access key`}),D.error&&(0,V.jsx)(C,{error:D.error,msg:`Failed to remove from group`}),(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsx)(w,{actions:(0,V.jsxs)(f,{onClick:()=>{k(!0)},size:`sm`,variant:`destructive`,children:[(0,V.jsx)(u,{className:`size-4`}),`Delete`]}),subtitle:`User Details`,title:G.UserName??``}),(0,V.jsxs)(P,{children:[(0,V.jsx)(P.Header,{children:`User Information`}),(0,V.jsxs)(P.Content,{children:[(0,V.jsx)(F,{label:`User Name`,value:G.UserName}),(0,V.jsx)(F,{label:`User ID`,value:G.UserId}),(0,V.jsx)(F,{label:`ARN`,value:G.Arn}),(0,V.jsx)(F,{label:`Path`,value:G.Path}),(0,V.jsx)(F,{label:`Created`,value:s(G.CreateDate)})]})]}),(0,V.jsxs)(P,{children:[(0,V.jsx)(P.Header,{children:(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{children:`Access Keys`}),(0,V.jsx)(f,{disabled:S.isPending,onClick:Y,size:`sm`,children:S.isPending?`Creating...`:`Create Access Key`})]})}),(0,V.jsx)(P.Content,{children:K.length>0?(0,V.jsx)(`div`,{className:`col-span-2 space-y-3`,children:K.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`p`,{className:`font-mono text-sm`,children:e.AccessKeyId}),(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Created `,s(e.CreateDate)]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(I,{state:e.Status}),(0,V.jsx)(f,{disabled:M===e.AccessKeyId,onClick:async()=>{await X(e)},size:`sm`,variant:`outline`,children:e.Status===`Active`?`Deactivate`:`Activate`}),(0,V.jsx)(f,{disabled:M===e.AccessKeyId,onClick:()=>{e.AccessKeyId&&Z(e.AccessKeyId)},size:`sm`,variant:`destructive`,children:`Delete`})]})]},e.AccessKeyId))}):(0,V.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No access keys.`})})]}),(0,V.jsx)(L,{kind:`user`,name:e}),(0,V.jsx)(R,{kind:`user`,name:e}),(0,V.jsxs)(P,{children:[(0,V.jsx)(P.Header,{children:`Groups`}),(0,V.jsx)(P.Content,{children:q.length>0?(0,V.jsx)(`div`,{className:`col-span-2 space-y-3`,children:q.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,V.jsx)(a,{className:`text-sm font-medium hover:underline`,params:{groupName:e.GroupName??``},to:`/iam/list-groups/$groupName`,children:e.GroupName}),(0,V.jsx)(f,{disabled:U===e.GroupName,onClick:()=>{e.GroupName&&Q(e.GroupName)},size:`sm`,variant:`outline`,children:`Remove`})]},e.GroupName))}):(0,V.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`Not a member of any group.`})})]})]}),(0,V.jsx)(N,{description:`Are you sure you want to delete the user "${e}"? This action cannot be undone. You must detach all policies and delete all access keys first.`,isPending:d.isPending,onConfirm:J,onOpenChange:k,open:O,title:`Delete User`}),A&&(0,V.jsx)(H,{accessKeyId:A.accessKeyId,onClose:()=>{j(null)},secretAccessKey:A.secretAccessKey})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{to:`/iam/list-users`,children:`Back to users`}),(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:`User not found.`})]})}export{U as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/allocate-address.js b/spinifex/services/spinifexui/frontend/dist/assets/allocate-address.js index 0613bab23..342154660 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/allocate-address.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/allocate-address.js @@ -1,3 +1,3 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{n as o}from"./ec22.js";import{a as s,i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,t as m}from"./field.js";import{n as h}from"./ec23.js";var g=t(),_=e();function v(){let e=(0,g.c)(36),t=n(),v=o(),b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:l(h),defaultValues:{name:``}},e[0]=b):b=e[0];let{control:x,handleSubmit:S,register:C,formState:w}=c(b),{isSubmitting:T}=w,E;e[1]===x?E=e[2]:(E={control:x},e[1]=x,e[2]=E);let D=s(E),O;e[3]!==v||e[4]!==t?(O=async e=>{let n=(await v.mutateAsync({name:e.name?.trim()??void 0})).AllocationId;t(n?{to:`/ec2/describe-addresses/$id`,params:{id:n}}:{to:`/ec2/describe-addresses`})},e[3]=v,e[4]=t,e[5]=O):O=e[5];let k=O,A,j;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,_.jsx)(r,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),j=(0,_.jsx)(f,{title:`Allocate Elastic IP`}),e[6]=A,e[7]=j):(A=e[6],j=e[7]);let M;e[8]===v.error?M=e[9]:(M=v.error&&(0,_.jsx)(u,{error:v.error,msg:`Failed to allocate Elastic IP`}),e[8]=v.error,e[9]=M);let N;e[10]!==S||e[11]!==k?(N=S(k),e[10]=S,e[11]=k,e[12]=N):N=e[12];let P;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,_.jsx)(p,{children:(0,_.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),e[13]=P):P=e[13];let F;e[14]===C?F=e[15]:(F=C(`name`),e[14]=C,e[15]=F);let I;e[16]===F?I=e[17]:(I=(0,_.jsxs)(m,{children:[P,(0,_.jsx)(a,{id:`name`,placeholder:`my-elastic-ip`,...F})]}),e[16]=F,e[17]=I);let L=D.name??``,R;e[18]===L?R=e[19]:(R=y(L),e[18]=L,e[19]=R);let z;e[20]===R?z=e[21]:(z=(0,_.jsx)(i,{commands:R}),e[20]=R,e[21]=z);let B;e[22]===t?B=e[23]:(B=async()=>await t({to:`/ec2/describe-addresses`}),e[22]=t,e[23]=B);let V;e[24]!==v.isPending||e[25]!==T||e[26]!==B?(V=(0,_.jsx)(d,{isPending:v.isPending,isSubmitting:T,onCancel:B,pendingLabel:`Allocating…`,submitLabel:`Allocate`}),e[24]=v.isPending,e[25]=T,e[26]=B,e[27]=V):V=e[27];let H;e[28]!==I||e[29]!==z||e[30]!==V||e[31]!==N?(H=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:N,children:[I,z,V]}),e[28]=I,e[29]=z,e[30]=V,e[31]=N,e[32]=H):H=e[32];let U;return e[33]!==H||e[34]!==M?(U=(0,_.jsxs)(_.Fragment,{children:[A,j,M,H]}),e[33]=H,e[34]=M,e[35]=U):U=e[35],U}function y(e){let t=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 allocate-address`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{n as o}from"./ec22.js";import{a as s,i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,t as m}from"./field.js";import{n as h}from"./ec23.js";var g=t(),_=e();function v(){let e=(0,g.c)(36),t=n(),v=o(),b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:l(h),defaultValues:{name:``}},e[0]=b):b=e[0];let{control:x,handleSubmit:S,register:C,formState:w}=c(b),{isSubmitting:T}=w,E;e[1]===x?E=e[2]:(E={control:x},e[1]=x,e[2]=E);let D=s(E),O;e[3]!==v||e[4]!==t?(O=async e=>{let n=(await v.mutateAsync({name:e.name?.trim()??void 0})).AllocationId;t(n?{to:`/ec2/describe-addresses/$id`,params:{id:n}}:{to:`/ec2/describe-addresses`})},e[3]=v,e[4]=t,e[5]=O):O=e[5];let k=O,A,j;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,_.jsx)(r,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),j=(0,_.jsx)(f,{title:`Allocate Elastic IP`}),e[6]=A,e[7]=j):(A=e[6],j=e[7]);let M;e[8]===v.error?M=e[9]:(M=v.error&&(0,_.jsx)(u,{error:v.error,msg:`Failed to allocate Elastic IP`}),e[8]=v.error,e[9]=M);let N;e[10]!==S||e[11]!==k?(N=S(k),e[10]=S,e[11]=k,e[12]=N):N=e[12];let P;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,_.jsx)(p,{children:(0,_.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),e[13]=P):P=e[13];let F;e[14]===C?F=e[15]:(F=C(`name`),e[14]=C,e[15]=F);let I;e[16]===F?I=e[17]:(I=(0,_.jsxs)(m,{children:[P,(0,_.jsx)(a,{id:`name`,placeholder:`my-elastic-ip`,...F})]}),e[16]=F,e[17]=I);let L=D.name??``,R;e[18]===L?R=e[19]:(R=y(L),e[18]=L,e[19]=R);let z;e[20]===R?z=e[21]:(z=(0,_.jsx)(i,{commands:R}),e[20]=R,e[21]=z);let B;e[22]===t?B=e[23]:(B=async()=>{await t({to:`/ec2/describe-addresses`})},e[22]=t,e[23]=B);let V;e[24]!==v.isPending||e[25]!==T||e[26]!==B?(V=(0,_.jsx)(d,{isPending:v.isPending,isSubmitting:T,onCancel:B,pendingLabel:`Allocating…`,submitLabel:`Allocate`}),e[24]=v.isPending,e[25]=T,e[26]=B,e[27]=V):V=e[27];let H;e[28]!==I||e[29]!==z||e[30]!==V||e[31]!==N?(H=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:N,children:[I,z,V]}),e[28]=I,e[29]=z,e[30]=V,e[31]=N,e[32]=H):H=e[32];let U;return e[33]!==H||e[34]!==M?(U=(0,_.jsxs)(_.Fragment,{children:[A,j,M,H]}),e[33]=H,e[34]=M,e[35]=U):U=e[35],U}function y(e){let t=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 allocate-address`},{type:`flag`,value:` \\ --domain`},{type:`value`,value:` vpc`}];return e.trim()&&t.push({type:`flag`,value:` \\ --tag-specifications`},{type:`value`,value:` 'ResourceType=elastic-ip,Tags=[{Key=Name,Value=${e.trim()}}]'`}),[{label:`Allocate Elastic IP`,parts:t}]}export{v as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/attributes-editor.js b/spinifex/services/spinifexui/frontend/dist/assets/attributes-editor.js index b2405a5a1..0a3a480fc 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/attributes-editor.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/attributes-editor.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{c as i,i as a,n as o,s,t as c}from"./select.js";import{t as l}from"./button.js";import{t as u}from"./input.js";import{a as d,r as f,t as p}from"./field.js";var m=r(),h=e(n(),1),g=t();function _(e,t){let n=new Map;for(let e of t)e.Key!==void 0&&n.set(e.Key,e.Value??``);return Object.fromEntries(e.map(e=>[e.key,n.get(e.key)??``]))}function v(e,t){if(e.type===`int`){if(t.trim()===``)return`Value is required`;if(!/^-?\d+$/.test(t))return`Must be a whole number`;let n=Number(t);if(e.min!==void 0&&ne.max)return`Must be at most ${e.max}`}}function y(e){let t=(0,m.c)(56),{specs:n,attributes:r,onSubmit:a,isPending:y,error:x,isSuccess:S}=e,C;t[0]!==r||t[1]!==n?(C=_(n,r),t[0]=r,t[1]=n,t[2]=C):C=t[2];let w=C,[T,E]=(0,h.useState)(w),D;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(D=(e,t)=>{E(n=>({...n,[e]:t}))},t[3]=D):D=t[3];let O=D,k;if(t[4]!==n||t[5]!==T){k={};for(let e of n)k[e.key]=v(e,T[e.key]??``);t[4]=n,t[5]=T,t[6]=k}else k=t[6];let A=Object.values(k).some(Boolean),j;if(t[7]!==w||t[8]!==n||t[9]!==T){let e;t[11]!==w||t[12]!==T?(e=e=>(T[e.key]??``)!==(w[e.key]??``),t[11]=w,t[12]=T,t[13]=e):e=t[13];let r;t[14]===T?r=t[15]:(r=e=>({key:e.key,value:T[e.key]??``}),t[14]=T,t[15]=r),j=n.filter(e).map(r),t[7]=w,t[8]=n,t[9]=T,t[10]=j}else j=t[10];let M=j,N;t[16]===w?N=t[17]:(N=()=>{E(w)},t[16]=w,t[17]=N);let P=N,F;t[18]!==M||t[19]!==A||t[20]!==a?(F=e=>{e.preventDefault(),!(A||M.length===0)&&a(M)},t[18]=M,t[19]=A,t[20]=a,t[21]=F):F=t[21];let I;t[22]===x?I=t[23]:(I=x&&(0,g.jsx)(`div`,{className:`mb-4 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive`,role:`alert`,children:x.message||`Failed to save attributes`}),t[22]=x,t[23]=I);let L;t[24]!==M.length||t[25]!==S?(L=S&&M.length===0&&(0,g.jsx)(`div`,{className:`mb-4 rounded-md border border-emerald-500 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-400`,role:`status`,children:`Attributes saved.`}),t[24]=M.length,t[25]=S,t[26]=L):L=t[26];let R;if(t[27]!==k||t[28]!==n||t[29]!==T){let e;t[31]!==k||t[32]!==T?(e=e=>{let t=`attr-${e.key}`,n=T[e.key]??``,r=k[e.key];return(0,g.jsxs)(p,{children:[(0,g.jsx)(d,{children:(0,g.jsx)(`label`,{htmlFor:t,children:e.label})}),e.type===`bool`&&(0,g.jsx)(`input`,{"aria-label":e.label,checked:n===`true`,id:t,onChange:t=>O(e.key,t.target.checked?`true`:`false`),type:`checkbox`}),e.type===`int`&&(0,g.jsx)(u,{"aria-invalid":!!r,id:t,inputMode:`numeric`,onChange:t=>O(e.key,t.target.value),value:n}),e.type===`text`&&(0,g.jsx)(u,{id:t,onChange:t=>O(e.key,t.target.value),placeholder:e.placeholder,value:n}),e.type===`select`&&(0,g.jsxs)(c,{onValueChange:t=>O(e.key,t??``),value:n,children:[(0,g.jsx)(s,{className:`w-full`,id:t,children:(0,g.jsx)(i,{})}),(0,g.jsx)(o,{children:e.options.map(b)})]}),e.description&&(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}),(0,g.jsx)(f,{errors:[r?{message:r}:void 0]})]},e.key)},t[31]=k,t[32]=T,t[33]=e):e=t[33],R=n.map(e),t[27]=k,t[28]=n,t[29]=T,t[30]=R}else R=t[30];let z;t[34]===R?z=t[35]:(z=(0,g.jsx)(`div`,{className:`grid gap-4 p-4 sm:grid-cols-2`,children:R}),t[34]=R,t[35]=z);let B=M.length===0?`No changes`:`${M.length} change${M.length===1?``:`s`} pending`,V;t[36]===B?V=t[37]:(V=(0,g.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:B}),t[36]=B,t[37]=V);let H=y||M.length===0,U;t[38]!==P||t[39]!==H?(U=(0,g.jsx)(l,{disabled:H,onClick:P,size:`sm`,type:`button`,variant:`secondary`,children:`Reset`}),t[38]=P,t[39]=H,t[40]=U):U=t[40];let W=y||A||M.length===0,G=y?`Saving…`:`Save changes`,K;t[41]!==W||t[42]!==G?(K=(0,g.jsx)(l,{disabled:W,size:`sm`,type:`submit`,children:G}),t[41]=W,t[42]=G,t[43]=K):K=t[43];let q;t[44]!==V||t[45]!==U||t[46]!==K?(q=(0,g.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t p-4`,children:[V,U,K]}),t[44]=V,t[45]=U,t[46]=K,t[47]=q):q=t[47];let J;t[48]!==q||t[49]!==z?(J=(0,g.jsxs)(`div`,{className:`rounded-lg border bg-card`,children:[z,q]}),t[48]=q,t[49]=z,t[50]=J):J=t[50];let Y;return t[51]!==J||t[52]!==F||t[53]!==I||t[54]!==L?(Y=(0,g.jsxs)(`form`,{onSubmit:F,children:[I,L,J]}),t[51]=J,t[52]=F,t[53]=I,t[54]=L,t[55]=Y):Y=t[55],Y}function b(e){return(0,g.jsx)(a,{value:e,children:e},e)}var x=[{key:`deletion_protection.enabled`,label:`Deletion protection`,type:`bool`},{key:`load_balancing.cross_zone.enabled`,label:`Cross-zone load balancing`,type:`bool`},{key:`idle_timeout.timeout_seconds`,label:`Idle timeout (s)`,type:`int`,min:1,max:4e3},{key:`client_keep_alive.seconds`,label:`Client keep-alive (s)`,type:`int`,min:60,max:604800},{key:`routing.http2.enabled`,label:`HTTP/2`,type:`bool`},{key:`routing.http.drop_invalid_header_fields.enabled`,label:`Drop invalid header fields`,type:`bool`},{key:`routing.http.preserve_host_header.enabled`,label:`Preserve host header`,type:`bool`},{key:`routing.http.xff_client_port.enabled`,label:`XFF client port`,type:`bool`},{key:`routing.http.xff_header_processing.mode`,label:`XFF header processing`,type:`select`,options:[`append`,`preserve`,`remove`]},{key:`routing.http.desync_mitigation_mode`,label:`Desync mitigation mode`,type:`select`,options:[`defensive`,`strictest`,`monitor`]},{key:`routing.http.x_amzn_tls_version_and_cipher_suite.enabled`,label:`Add TLS version & cipher headers`,type:`bool`},{key:`waf.fail_open.enabled`,label:`WAF fail open`,type:`bool`},{key:`zonal_shift.config.enabled`,label:`Zonal shift`,type:`bool`},{key:`access_logs.s3.enabled`,label:`Access logs: enabled`,type:`bool`},{key:`access_logs.s3.bucket`,label:`Access logs: S3 bucket`,type:`text`},{key:`access_logs.s3.prefix`,label:`Access logs: S3 prefix`,type:`text`},{key:`connection_logs.s3.enabled`,label:`Connection logs: enabled`,type:`bool`},{key:`connection_logs.s3.bucket`,label:`Connection logs: S3 bucket`,type:`text`},{key:`connection_logs.s3.prefix`,label:`Connection logs: S3 prefix`,type:`text`}],S=[{key:`deregistration_delay.timeout_seconds`,label:`Deregistration delay (s)`,type:`int`,min:0,max:3600},{key:`stickiness.enabled`,label:`Stickiness`,type:`bool`},{key:`stickiness.type`,label:`Stickiness type`,type:`select`,options:[`lb_cookie`,`source_ip`]},{key:`stickiness.lb_cookie.duration_seconds`,label:`Stickiness lb_cookie duration (s)`,type:`int`,min:1,max:604800},{key:`load_balancing.cross_zone.enabled`,label:`Cross-zone load balancing`,type:`select`,options:[`true`,`false`,`use_load_balancer_configuration`]},{key:`load_balancing.algorithm.type`,label:`Load balancing algorithm`,type:`select`,options:[`round_robin`,`least_outstanding_requests`]},{key:`slow_start.duration_seconds`,label:`Slow start duration (s)`,type:`int`,min:0,max:900}];export{x as n,S as r,y as t}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{c as i,i as a,n as o,s,t as c}from"./select.js";import{t as l}from"./button.js";import{t as u}from"./input.js";import{a as d,r as f,t as p}from"./field.js";var m=r(),h=e(n(),1),g=t();function _(e,t){let n=new Map;for(let e of t)e.Key!==void 0&&n.set(e.Key,e.Value??``);return Object.fromEntries(e.map(e=>[e.key,n.get(e.key)??``]))}function v(e,t){if(e.type===`int`){if(t.trim()===``)return`Value is required`;if(!/^-?\d+$/.test(t))return`Must be a whole number`;let n=Number(t);if(e.min!==void 0&&ne.max)return`Must be at most ${e.max}`}}function y(e){let t=(0,m.c)(56),{specs:n,attributes:r,onSubmit:a,isPending:y,error:x,isSuccess:S}=e,C;t[0]!==r||t[1]!==n?(C=_(n,r),t[0]=r,t[1]=n,t[2]=C):C=t[2];let w=C,[T,E]=(0,h.useState)(w),D;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(D=(e,t)=>{E(n=>({...n,[e]:t}))},t[3]=D):D=t[3];let O=D,k;if(t[4]!==n||t[5]!==T){k={};for(let e of n)k[e.key]=v(e,T[e.key]??``);t[4]=n,t[5]=T,t[6]=k}else k=t[6];let A=Object.values(k).some(Boolean),j;if(t[7]!==w||t[8]!==n||t[9]!==T){let e;t[11]!==w||t[12]!==T?(e=e=>(T[e.key]??``)!==(w[e.key]??``),t[11]=w,t[12]=T,t[13]=e):e=t[13];let r;t[14]===T?r=t[15]:(r=e=>({key:e.key,value:T[e.key]??``}),t[14]=T,t[15]=r),j=n.filter(e).map(r),t[7]=w,t[8]=n,t[9]=T,t[10]=j}else j=t[10];let M=j,N;t[16]===w?N=t[17]:(N=()=>{E(w)},t[16]=w,t[17]=N);let P=N,F;t[18]!==M||t[19]!==A||t[20]!==a?(F=e=>{e.preventDefault(),!(A||M.length===0)&&a(M)},t[18]=M,t[19]=A,t[20]=a,t[21]=F):F=t[21];let I;t[22]===x?I=t[23]:(I=x&&(0,g.jsx)(`div`,{className:`mb-4 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive`,role:`alert`,children:x.message||`Failed to save attributes`}),t[22]=x,t[23]=I);let L;t[24]!==M.length||t[25]!==S?(L=S&&M.length===0&&(0,g.jsx)(`div`,{className:`mb-4 rounded-md border border-emerald-500 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-400`,role:`status`,children:`Attributes saved.`}),t[24]=M.length,t[25]=S,t[26]=L):L=t[26];let R;if(t[27]!==k||t[28]!==n||t[29]!==T){let e;t[31]!==k||t[32]!==T?(e=e=>{let t=`attr-${e.key}`,n=T[e.key]??``,r=k[e.key];return(0,g.jsxs)(p,{children:[(0,g.jsx)(d,{children:(0,g.jsx)(`label`,{htmlFor:t,children:e.label})}),e.type===`bool`&&(0,g.jsx)(`input`,{"aria-label":e.label,checked:n===`true`,id:t,onChange:t=>{O(e.key,t.target.checked?`true`:`false`)},type:`checkbox`}),e.type===`int`&&(0,g.jsx)(u,{"aria-invalid":!!r,id:t,inputMode:`numeric`,onChange:t=>{O(e.key,t.target.value)},value:n}),e.type===`text`&&(0,g.jsx)(u,{id:t,onChange:t=>{O(e.key,t.target.value)},placeholder:e.placeholder,value:n}),e.type===`select`&&(0,g.jsxs)(c,{onValueChange:t=>{O(e.key,t??``)},value:n,children:[(0,g.jsx)(s,{className:`w-full`,id:t,children:(0,g.jsx)(i,{})}),(0,g.jsx)(o,{children:e.options.map(b)})]}),e.description&&(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}),(0,g.jsx)(f,{errors:[r?{message:r}:void 0]})]},e.key)},t[31]=k,t[32]=T,t[33]=e):e=t[33],R=n.map(e),t[27]=k,t[28]=n,t[29]=T,t[30]=R}else R=t[30];let z;t[34]===R?z=t[35]:(z=(0,g.jsx)(`div`,{className:`grid gap-4 p-4 sm:grid-cols-2`,children:R}),t[34]=R,t[35]=z);let B=M.length===0?`No changes`:`${M.length} change${M.length===1?``:`s`} pending`,V;t[36]===B?V=t[37]:(V=(0,g.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:B}),t[36]=B,t[37]=V);let H=y||M.length===0,U;t[38]!==P||t[39]!==H?(U=(0,g.jsx)(l,{disabled:H,onClick:P,size:`sm`,type:`button`,variant:`secondary`,children:`Reset`}),t[38]=P,t[39]=H,t[40]=U):U=t[40];let W=y||A||M.length===0,G=y?`Saving…`:`Save changes`,K;t[41]!==W||t[42]!==G?(K=(0,g.jsx)(l,{disabled:W,size:`sm`,type:`submit`,children:G}),t[41]=W,t[42]=G,t[43]=K):K=t[43];let q;t[44]!==V||t[45]!==U||t[46]!==K?(q=(0,g.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t p-4`,children:[V,U,K]}),t[44]=V,t[45]=U,t[46]=K,t[47]=q):q=t[47];let J;t[48]!==q||t[49]!==z?(J=(0,g.jsxs)(`div`,{className:`rounded-lg border bg-card`,children:[z,q]}),t[48]=q,t[49]=z,t[50]=J):J=t[50];let Y;return t[51]!==J||t[52]!==F||t[53]!==I||t[54]!==L?(Y=(0,g.jsxs)(`form`,{onSubmit:F,children:[I,L,J]}),t[51]=J,t[52]=F,t[53]=I,t[54]=L,t[55]=Y):Y=t[55],Y}function b(e){return(0,g.jsx)(a,{value:e,children:e},e)}var x=[{key:`deletion_protection.enabled`,label:`Deletion protection`,type:`bool`},{key:`load_balancing.cross_zone.enabled`,label:`Cross-zone load balancing`,type:`bool`},{key:`idle_timeout.timeout_seconds`,label:`Idle timeout (s)`,type:`int`,min:1,max:4e3},{key:`client_keep_alive.seconds`,label:`Client keep-alive (s)`,type:`int`,min:60,max:604800},{key:`routing.http2.enabled`,label:`HTTP/2`,type:`bool`},{key:`routing.http.drop_invalid_header_fields.enabled`,label:`Drop invalid header fields`,type:`bool`},{key:`routing.http.preserve_host_header.enabled`,label:`Preserve host header`,type:`bool`},{key:`routing.http.xff_client_port.enabled`,label:`XFF client port`,type:`bool`},{key:`routing.http.xff_header_processing.mode`,label:`XFF header processing`,type:`select`,options:[`append`,`preserve`,`remove`]},{key:`routing.http.desync_mitigation_mode`,label:`Desync mitigation mode`,type:`select`,options:[`defensive`,`strictest`,`monitor`]},{key:`routing.http.x_amzn_tls_version_and_cipher_suite.enabled`,label:`Add TLS version & cipher headers`,type:`bool`},{key:`waf.fail_open.enabled`,label:`WAF fail open`,type:`bool`},{key:`zonal_shift.config.enabled`,label:`Zonal shift`,type:`bool`},{key:`access_logs.s3.enabled`,label:`Access logs: enabled`,type:`bool`},{key:`access_logs.s3.bucket`,label:`Access logs: S3 bucket`,type:`text`},{key:`access_logs.s3.prefix`,label:`Access logs: S3 prefix`,type:`text`},{key:`connection_logs.s3.enabled`,label:`Connection logs: enabled`,type:`bool`},{key:`connection_logs.s3.bucket`,label:`Connection logs: S3 bucket`,type:`text`},{key:`connection_logs.s3.prefix`,label:`Connection logs: S3 prefix`,type:`text`}],S=[{key:`deregistration_delay.timeout_seconds`,label:`Deregistration delay (s)`,type:`int`,min:0,max:3600},{key:`stickiness.enabled`,label:`Stickiness`,type:`bool`},{key:`stickiness.type`,label:`Stickiness type`,type:`select`,options:[`lb_cookie`,`source_ip`]},{key:`stickiness.lb_cookie.duration_seconds`,label:`Stickiness lb_cookie duration (s)`,type:`int`,min:1,max:604800},{key:`load_balancing.cross_zone.enabled`,label:`Cross-zone load balancing`,type:`select`,options:[`true`,`false`,`use_load_balancer_configuration`]},{key:`load_balancing.algorithm.type`,label:`Load balancing algorithm`,type:`select`,options:[`round_robin`,`least_outstanding_requests`]},{key:`slow_start.duration_seconds`,label:`Slow start duration (s)`,type:`int`,min:0,max:900}];export{x as n,S as r,y as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/certificate-import-dialog.js b/spinifex/services/spinifexui/frontend/dist/assets/certificate-import-dialog.js index 682c8d878..f31da8f72 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/certificate-import-dialog.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/certificate-import-dialog.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{n as i}from"./QueryClientProvider.js";import{t as a}from"./useMutation.js";import{fa as o,n as s}from"./awsClient.js";import{i as c,n as l,r as u}from"./acm.js";import{t as d}from"./error-banner.js";import{a as f,t as p}from"./field.js";import{a as m,i as ee,l as te,n as h,o as g,r as _,s as v,t as y}from"./alert-dialog.js";import{t as b}from"./textarea.js";var x=class extends c(l,u,`ImportCertificate`,o){},S=e(n(),1),C=r(),w=new TextEncoder;function T(){let e=(0,C.c)(2),t=i(),n;return e[0]===t?n=e[1]:(n={mutationFn:E,onSuccess:()=>{t.invalidateQueries({queryKey:[`acm`,`certificates`]})}},e[0]=t,e[1]=n),a(n)}async function E(e){let t=new x({Certificate:w.encode(e.certificate),PrivateKey:w.encode(e.privateKey),CertificateChain:e.certificateChain&&e.certificateChain.length>0?w.encode(e.certificateChain):void 0});return await s().send(t)}var D=t();function O(e){let t=(0,C.c)(54),{open:n,onOpenChange:r,onImported:i}=e,[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(``),[l,u]=(0,S.useState)(``),x=T(),w;t[0]===x?w=t[1]:(w=()=>{o(``),c(``),u(``),x.reset()},t[0]=x,t[1]=w);let E=w,O;t[2]!==r||t[3]!==E?(O=e=>{e||E(),r(e)},t[2]=r,t[3]=E,t[4]=O):O=t[4];let k=O,A;t[5]!==a||t[6]!==s?(A=a.trim().length>0&&s.trim().length>0,t[5]=a,t[6]=s,t[7]=A):A=t[7];let j=A,M;t[8]!==j||t[9]!==a||t[10]!==l||t[11]!==x||t[12]!==i||t[13]!==r||t[14]!==s||t[15]!==E?(M=async()=>{if(j)try{let e=await x.mutateAsync({certificate:a,privateKey:s,certificateChain:l});e.CertificateArn&&i(e.CertificateArn),E(),r(!1)}catch{}},t[8]=j,t[9]=a,t[10]=l,t[11]=x,t[12]=i,t[13]=r,t[14]=s,t[15]=E,t[16]=M):M=t[16];let N=M,P;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(P={maxWidth:`36rem`,width:`calc(100vw - 2rem)`},t[17]=P):P=t[17];let F;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,D.jsxs)(v,{children:[(0,D.jsx)(te,{children:`Import certificate`}),(0,D.jsx)(m,{children:`Paste a PEM-encoded certificate and its private key. The optional chain is appended for intermediate CAs.`})]}),t[18]=F):F=t[18];let I;t[19]===x.error?I=t[20]:(I=x.error&&(0,D.jsx)(d,{error:x.error,msg:`Failed to import certificate`}),t[19]=x.error,t[20]=I);let L;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-body`,children:`Certificate body`})}),t[21]=L):L=t[21];let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>o(e.target.value),t[22]=R):R=t[22];let z;t[23]===a?z=t[24]:(z=(0,D.jsxs)(p,{children:[L,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-body`,onChange:R,placeholder:`-----BEGIN CERTIFICATE-----`,rows:5,value:a})]}),t[23]=a,t[24]=z);let B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-key`,children:`Private key`})}),t[25]=B):B=t[25];let V;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>c(e.target.value),t[26]=V):V=t[26];let H;t[27]===s?H=t[28]:(H=(0,D.jsxs)(p,{children:[B,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-key`,onChange:V,placeholder:`-----BEGIN PRIVATE KEY-----`,rows:5,value:s})]}),t[27]=s,t[28]=H);let U;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-chain`,children:`Certificate chain (optional)`})}),t[29]=U):U=t[29];let W;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>u(e.target.value),t[30]=W):W=t[30];let G;t[31]===l?G=t[32]:(G=(0,D.jsxs)(p,{children:[U,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-chain`,onChange:W,placeholder:`-----BEGIN CERTIFICATE-----`,rows:4,value:l})]}),t[31]=l,t[32]=G);let K;t[33]!==z||t[34]!==H||t[35]!==G?(K=(0,D.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[z,H,G]}),t[33]=z,t[34]=H,t[35]=G,t[36]=K):K=t[36];let q;t[37]===x.isPending?q=t[38]:(q=(0,D.jsx)(_,{disabled:x.isPending,children:`Cancel`}),t[37]=x.isPending,t[38]=q);let J=!j||x.isPending,Y=x.isPending?`Importing…`:`Import`,X;t[39]!==N||t[40]!==J||t[41]!==Y?(X=(0,D.jsx)(h,{disabled:J,onClick:N,children:Y}),t[39]=N,t[40]=J,t[41]=Y,t[42]=X):X=t[42];let Z;t[43]!==q||t[44]!==X?(Z=(0,D.jsxs)(g,{children:[q,X]}),t[43]=q,t[44]=X,t[45]=Z):Z=t[45];let Q;t[46]!==K||t[47]!==Z||t[48]!==I?(Q=(0,D.jsxs)(ee,{className:`grid-cols-[minmax(0,1fr)]`,style:P,children:[F,I,K,Z]}),t[46]=K,t[47]=Z,t[48]=I,t[49]=Q):Q=t[49];let $;return t[50]!==k||t[51]!==n||t[52]!==Q?($=(0,D.jsx)(y,{onOpenChange:k,open:n,children:Q}),t[50]=k,t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}export{O as t}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{n as i}from"./QueryClientProvider.js";import{t as a}from"./useMutation.js";import{fa as o,n as s}from"./awsClient.js";import{i as c,n as l,r as u}from"./acm.js";import{t as d}from"./error-banner.js";import{a as f,t as p}from"./field.js";import{a as m,i as ee,l as te,n as h,o as g,r as _,s as v,t as y}from"./alert-dialog.js";import{t as b}from"./textarea.js";var x=class extends c(l,u,`ImportCertificate`,o){},S=e(n(),1),C=r(),w=new TextEncoder;function T(){let e=(0,C.c)(2),t=i(),n;return e[0]===t?n=e[1]:(n={mutationFn:E,onSuccess:()=>{t.invalidateQueries({queryKey:[`acm`,`certificates`]})}},e[0]=t,e[1]=n),a(n)}async function E(e){let t=new x({Certificate:w.encode(e.certificate),PrivateKey:w.encode(e.privateKey),CertificateChain:e.certificateChain&&e.certificateChain.length>0?w.encode(e.certificateChain):void 0});return await s().send(t)}var D=t();function O(e){let t=(0,C.c)(54),{open:n,onOpenChange:r,onImported:i}=e,[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(``),[l,u]=(0,S.useState)(``),x=T(),w;t[0]===x?w=t[1]:(w=()=>{o(``),c(``),u(``),x.reset()},t[0]=x,t[1]=w);let E=w,O;t[2]!==r||t[3]!==E?(O=e=>{e||E(),r(e)},t[2]=r,t[3]=E,t[4]=O):O=t[4];let k=O,A;t[5]!==a||t[6]!==s?(A=a.trim().length>0&&s.trim().length>0,t[5]=a,t[6]=s,t[7]=A):A=t[7];let j=A,M;t[8]!==j||t[9]!==a||t[10]!==l||t[11]!==x||t[12]!==i||t[13]!==r||t[14]!==s||t[15]!==E?(M=async()=>{if(j)try{let e=await x.mutateAsync({certificate:a,privateKey:s,certificateChain:l});e.CertificateArn&&i(e.CertificateArn),E(),r(!1)}catch{}},t[8]=j,t[9]=a,t[10]=l,t[11]=x,t[12]=i,t[13]=r,t[14]=s,t[15]=E,t[16]=M):M=t[16];let N=M,P;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(P={maxWidth:`36rem`,width:`calc(100vw - 2rem)`},t[17]=P):P=t[17];let F;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,D.jsxs)(v,{children:[(0,D.jsx)(te,{children:`Import certificate`}),(0,D.jsx)(m,{children:`Paste a PEM-encoded certificate and its private key. The optional chain is appended for intermediate CAs.`})]}),t[18]=F):F=t[18];let I;t[19]===x.error?I=t[20]:(I=x.error&&(0,D.jsx)(d,{error:x.error,msg:`Failed to import certificate`}),t[19]=x.error,t[20]=I);let L;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-body`,children:`Certificate body`})}),t[21]=L):L=t[21];let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{o(e.target.value)},t[22]=R):R=t[22];let z;t[23]===a?z=t[24]:(z=(0,D.jsxs)(p,{children:[L,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-body`,onChange:R,placeholder:`-----BEGIN CERTIFICATE-----`,rows:5,value:a})]}),t[23]=a,t[24]=z);let B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-key`,children:`Private key`})}),t[25]=B):B=t[25];let V;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>{c(e.target.value)},t[26]=V):V=t[26];let H;t[27]===s?H=t[28]:(H=(0,D.jsxs)(p,{children:[B,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-key`,onChange:V,placeholder:`-----BEGIN PRIVATE KEY-----`,rows:5,value:s})]}),t[27]=s,t[28]=H);let U;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-chain`,children:`Certificate chain (optional)`})}),t[29]=U):U=t[29];let W;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>{u(e.target.value)},t[30]=W):W=t[30];let G;t[31]===l?G=t[32]:(G=(0,D.jsxs)(p,{children:[U,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-chain`,onChange:W,placeholder:`-----BEGIN CERTIFICATE-----`,rows:4,value:l})]}),t[31]=l,t[32]=G);let K;t[33]!==z||t[34]!==H||t[35]!==G?(K=(0,D.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[z,H,G]}),t[33]=z,t[34]=H,t[35]=G,t[36]=K):K=t[36];let q;t[37]===x.isPending?q=t[38]:(q=(0,D.jsx)(_,{disabled:x.isPending,children:`Cancel`}),t[37]=x.isPending,t[38]=q);let J=!j||x.isPending,Y=x.isPending?`Importing…`:`Import`,X;t[39]!==N||t[40]!==J||t[41]!==Y?(X=(0,D.jsx)(h,{disabled:J,onClick:N,children:Y}),t[39]=N,t[40]=J,t[41]=Y,t[42]=X):X=t[42];let Z;t[43]!==q||t[44]!==X?(Z=(0,D.jsxs)(g,{children:[q,X]}),t[43]=q,t[44]=X,t[45]=Z):Z=t[45];let Q;t[46]!==K||t[47]!==Z||t[48]!==I?(Q=(0,D.jsxs)(ee,{className:`grid-cols-[minmax(0,1fr)]`,style:P,children:[F,I,K,Z]}),t[46]=K,t[47]=Z,t[48]=I,t[49]=Q):Q=t[49];let $;return t[50]!==k||t[51]!==n||t[52]!==Q?($=(0,D.jsx)(y,{onOpenChange:k,open:n,children:Q}),t[50]=k,t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}export{O as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/cli-command-panel.js b/spinifex/services/spinifexui/frontend/dist/assets/cli-command-panel.js index 8733f38dd..6e2b8e044 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/cli-command-panel.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/cli-command-panel.js @@ -1,3 +1,3 @@ import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{Xt as i}from"./cluster-config.js";import{t as a}from"./createLucideIcon.js";import{t as o}from"./check.js";import{t as s}from"./chevron-down.js";import{t as c}from"./copy.js";import{t as l}from"./button.js";import{t as u}from"./use-copy-to-clipboard.js";var d=a(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),f=r(),p=e(n(),1),m=t(),h={bin:`text-tactical-cyan font-semibold`,flag:`text-tactical-amber`,value:`text-foreground`,comment:`text-muted-foreground italic`,variable:`text-tactical-green font-semibold`};function g(e,t){return e.length>0?e:`<${t}>`}function _(e,t){return[{type:`flag`,value:` ${e}`},{type:`value`,value:` ${t}`}]}function v(e,t){return t===void 0||t===``||t===!1?[]:t===!0?[{type:`flag`,value:` ${e}`}]:_(e,t)}function y(e){return e.map(e=>e.parts.map(e=>e.value).join(``)).join(` -`)}function b(e){let t=(0,f.c)(18),{commands:n}=e,[r,a]=(0,p.useState)(!1),{copied:h,copy:g}=u();if(n.length===0)return null;let _;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>a(S),t[0]=_):_=t[0];let v,b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,m.jsx)(d,{className:`size-3.5`}),b=(0,m.jsx)(`span`,{children:`AWS CLI`}),t[1]=v,t[2]=b):(v=t[1],b=t[2]);let C=r&&`rotate-180`,w;t[3]===C?w=t[4]:(w=i(`ml-auto size-3.5 transition-transform`,C),t[3]=C,t[4]=w);let T;t[5]===w?T=t[6]:(T=(0,m.jsx)(s,{className:w}),t[5]=w,t[6]=T);let E;t[7]!==r||t[8]!==T?(E=(0,m.jsxs)(`button`,{type:`button`,onClick:_,className:`flex w-full items-center gap-2 px-3 py-2 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,"aria-expanded":r,children:[v,b,T]}),t[7]=r,t[8]=T,t[9]=E):E=t[9];let D;t[10]!==n||t[11]!==h||t[12]!==g||t[13]!==r?(D=r&&(0,m.jsxs)(`div`,{className:`border-t border-border`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-3 py-1.5`,children:[(0,m.jsx)(`span`,{className:`text-[0.625rem] text-muted-foreground`,children:n.length>1?`${n.length} commands`:`command`}),(0,m.jsxs)(l,{type:`button`,variant:`ghost`,size:`xs`,onClick:async()=>await g(y(n)),children:[h?(0,m.jsx)(o,{className:`size-2.5`}):(0,m.jsx)(c,{className:`size-2.5`}),h?`Copied`:`Copy`]})]}),(0,m.jsx)(`div`,{className:`overflow-x-auto p-3`,children:n.map((e,t)=>(0,m.jsxs)(`div`,{children:[n.length>1&&(0,m.jsx)(`div`,{className:`mb-1 text-[0.625rem] font-medium text-muted-foreground`,children:e.label}),(0,m.jsx)(`pre`,{className:`font-mono text-xs/relaxed`,children:(0,m.jsx)(`code`,{children:e.parts.map(x)})}),t{a(S)},t[0]=_):_=t[0];let v,b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,m.jsx)(d,{className:`size-3.5`}),b=(0,m.jsx)(`span`,{children:`AWS CLI`}),t[1]=v,t[2]=b):(v=t[1],b=t[2]);let C=r&&`rotate-180`,w;t[3]===C?w=t[4]:(w=i(`ml-auto size-3.5 transition-transform`,C),t[3]=C,t[4]=w);let T;t[5]===w?T=t[6]:(T=(0,m.jsx)(s,{className:w}),t[5]=w,t[6]=T);let E;t[7]!==r||t[8]!==T?(E=(0,m.jsxs)(`button`,{type:`button`,onClick:_,className:`flex w-full items-center gap-2 px-3 py-2 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,"aria-expanded":r,children:[v,b,T]}),t[7]=r,t[8]=T,t[9]=E):E=t[9];let D;t[10]!==n||t[11]!==h||t[12]!==g||t[13]!==r?(D=r&&(0,m.jsxs)(`div`,{className:`border-t border-border`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-3 py-1.5`,children:[(0,m.jsx)(`span`,{className:`text-[0.625rem] text-muted-foreground`,children:n.length>1?`${n.length} commands`:`command`}),(0,m.jsxs)(l,{type:`button`,variant:`ghost`,size:`xs`,onClick:async()=>{await g(y(n))},children:[h?(0,m.jsx)(o,{className:`size-2.5`}):(0,m.jsx)(c,{className:`size-2.5`}),h?`Copied`:`Copy`]})]}),(0,m.jsx)(`div`,{className:`overflow-x-auto p-3`,children:n.map((e,t)=>(0,m.jsxs)(`div`,{children:[n.length>1&&(0,m.jsx)(`div`,{className:`mb-1 text-[0.625rem] font-medium text-muted-foreground`,children:e.label}),(0,m.jsx)(`pre`,{className:`font-mono text-xs/relaxed`,children:(0,m.jsx)(`code`,{children:e.parts.map(x)})}),t!e.includes(`..`),`Must not contain consecutive periods`).refine(e=>!(e.includes(`.-`)||e.includes(`-.`)),`Must not contain adjacent period and hyphen`)}),b=e();function x(){let e=(0,v.c)(42),t=n(),r=c(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={resolver:d(y)},e[0]=i):i=e[0];let{handleSubmit:x,register:C,control:w,formState:T}=u(i),{errors:E,isSubmitting:D}=T,O;e[1]===w?O=e[2]:(O={control:w},e[1]=w,e[2]=O);let k=l(O),A;e[3]!==r||e[4]!==t?(A=async e=>{await r.mutateAsync(e),t({to:`/s3/ls`})},e[3]=r,e[4]=t,e[5]=A):A=e[5];let j=A,M,N;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,b.jsx)(a,{to:`/s3/ls`,children:`Back to buckets`}),N=(0,b.jsx)(m,{title:`Create Bucket`}),e[6]=M,e[7]=N):(M=e[6],N=e[7]);let P;e[8]===r.error?P=e[9]:(P=r.error&&(0,b.jsx)(f,{error:r.error,msg:`Failed to create bucket`}),e[8]=r.error,e[9]=P);let F;e[10]!==x||e[11]!==j?(F=x(j),e[10]=x,e[11]=j,e[12]=F):F=e[12];let I;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,b.jsx)(h,{children:(0,b.jsx)(`label`,{htmlFor:`bucketName`,children:`Bucket Name`})}),e[13]=I):I=e[13];let L=!!E.bucketName,R;e[14]===C?R=e[15]:(R=C(`bucketName`),e[14]=C,e[15]=R);let z;e[16]!==R||e[17]!==L?(z=(0,b.jsx)(s,{"aria-invalid":L,id:`bucketName`,placeholder:`my-bucket`,type:`text`,...R}),e[16]=R,e[17]=L,e[18]=z):z=e[18];let B;e[19]===E.bucketName?B=e[20]:(B=(0,b.jsx)(g,{errors:[E.bucketName]}),e[19]=E.bucketName,e[20]=B);let V;e[21]!==z||e[22]!==B?(V=(0,b.jsxs)(_,{children:[I,z,B]}),e[21]=z,e[22]=B,e[23]=V):V=e[23];let H;e[24]===k?H=e[25]:(H=S(k),e[24]=k,e[25]=H);let U;e[26]===H?U=e[27]:(U=(0,b.jsx)(o,{commands:H}),e[26]=H,e[27]=U);let W;e[28]===t?W=e[29]:(W=async()=>await t({to:`/s3/ls`}),e[28]=t,e[29]=W);let G;e[30]!==r.isPending||e[31]!==D||e[32]!==W?(G=(0,b.jsx)(p,{isPending:r.isPending,isSubmitting:D,onCancel:W,pendingLabel:`Creating…`,submitLabel:`Create Bucket`}),e[30]=r.isPending,e[31]=D,e[32]=W,e[33]=G):G=e[33];let K;e[34]!==V||e[35]!==U||e[36]!==G||e[37]!==F?(K=(0,b.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[V,U,G]}),e[34]=V,e[35]=U,e[36]=G,e[37]=F,e[38]=K):K=e[38];let q;return e[39]!==K||e[40]!==P?(q=(0,b.jsxs)(b.Fragment,{children:[M,N,P,K]}),e[39]=K,e[40]=P,e[41]=q):q=e[41],q}function S(e){return[{label:`Create Bucket`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws s3api create-bucket`},{type:`flag`,value:` --bucket`},{type:`value`,value:` ${(e.bucketName??``)||``}`}]}]}export{x as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{h as r,p as i}from"./cluster-config.js";import{t as a}from"./back-link.js";import{t as o}from"./cli-command-panel.js";import{t as s}from"./input.js";import{t as c}from"./s3.js";import{a as l,i as u,t as d}from"./zod.js";import{t as f}from"./error-banner.js";import{t as p}from"./form-actions.js";import{t as m}from"./page-heading.js";import{a as h,r as g,t as _}from"./field.js";var v=t(),y=i({bucketName:r().min(3,`Bucket name must be at least 3 characters`).max(63,`Bucket name must be at most 63 characters`).regex(/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/,`Must start and end with a lowercase letter or number`).regex(/^[a-z0-9.-]+$/,`Only lowercase letters, numbers, hyphens, and periods allowed`).refine(e=>!e.includes(`..`),`Must not contain consecutive periods`).refine(e=>!(e.includes(`.-`)||e.includes(`-.`)),`Must not contain adjacent period and hyphen`)}),b=e();function x(){let e=(0,v.c)(42),t=n(),r=c(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={resolver:d(y)},e[0]=i):i=e[0];let{handleSubmit:x,register:C,control:w,formState:T}=u(i),{errors:E,isSubmitting:D}=T,O;e[1]===w?O=e[2]:(O={control:w},e[1]=w,e[2]=O);let k=l(O),A;e[3]!==r||e[4]!==t?(A=async e=>{await r.mutateAsync(e),t({to:`/s3/ls`})},e[3]=r,e[4]=t,e[5]=A):A=e[5];let j=A,M,N;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,b.jsx)(a,{to:`/s3/ls`,children:`Back to buckets`}),N=(0,b.jsx)(m,{title:`Create Bucket`}),e[6]=M,e[7]=N):(M=e[6],N=e[7]);let P;e[8]===r.error?P=e[9]:(P=r.error&&(0,b.jsx)(f,{error:r.error,msg:`Failed to create bucket`}),e[8]=r.error,e[9]=P);let F;e[10]!==x||e[11]!==j?(F=x(j),e[10]=x,e[11]=j,e[12]=F):F=e[12];let I;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,b.jsx)(h,{children:(0,b.jsx)(`label`,{htmlFor:`bucketName`,children:`Bucket Name`})}),e[13]=I):I=e[13];let L=!!E.bucketName,R;e[14]===C?R=e[15]:(R=C(`bucketName`),e[14]=C,e[15]=R);let z;e[16]!==R||e[17]!==L?(z=(0,b.jsx)(s,{"aria-invalid":L,id:`bucketName`,placeholder:`my-bucket`,type:`text`,...R}),e[16]=R,e[17]=L,e[18]=z):z=e[18];let B;e[19]===E.bucketName?B=e[20]:(B=(0,b.jsx)(g,{errors:[E.bucketName]}),e[19]=E.bucketName,e[20]=B);let V;e[21]!==z||e[22]!==B?(V=(0,b.jsxs)(_,{children:[I,z,B]}),e[21]=z,e[22]=B,e[23]=V):V=e[23];let H;e[24]===k?H=e[25]:(H=S(k),e[24]=k,e[25]=H);let U;e[26]===H?U=e[27]:(U=(0,b.jsx)(o,{commands:H}),e[26]=H,e[27]=U);let W;e[28]===t?W=e[29]:(W=async()=>{await t({to:`/s3/ls`})},e[28]=t,e[29]=W);let G;e[30]!==r.isPending||e[31]!==D||e[32]!==W?(G=(0,b.jsx)(p,{isPending:r.isPending,isSubmitting:D,onCancel:W,pendingLabel:`Creating…`,submitLabel:`Create Bucket`}),e[30]=r.isPending,e[31]=D,e[32]=W,e[33]=G):G=e[33];let K;e[34]!==V||e[35]!==U||e[36]!==G||e[37]!==F?(K=(0,b.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[V,U,G]}),e[34]=V,e[35]=U,e[36]=G,e[37]=F,e[38]=K):K=e[38];let q;return e[39]!==K||e[40]!==P?(q=(0,b.jsxs)(b.Fragment,{children:[M,N,P,K]}),e[39]=K,e[40]=P,e[41]=q):q=e[41],q}function S(e){return[{label:`Create Bucket`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws s3api create-bucket`},{type:`flag`,value:` --bucket`},{type:`value`,value:` ${(e.bucketName??``)||``}`}]}]}export{x as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-cluster.js b/spinifex/services/spinifexui/frontend/dist/assets/create-cluster.js index eaa0e2b5d..1368d7284 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-cluster.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-cluster.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{n as i}from"./QueryClientProvider.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./useNavigate.js";import{nn as s}from"./cluster-config.js";import{t as c}from"./back-link.js";import{c as l,i as u,n as d,s as f,t as p}from"./select.js";import{t as m}from"./button.js";import{t as h}from"./input.js";import{M as g,O as _,o as v}from"./ec2.js";import{a as y,d as b,g as x,o as S,t as C}from"./eks.js";import{i as ee,u as te}from"./iam.js";import{y as w}from"./iam2.js";import{a as T,i as E,n as D,t as O}from"./zod.js";import{t as k}from"./error-banner.js";import{t as A}from"./form-actions.js";import{t as j}from"./page-heading.js";import{a as M,r as N,t as P}from"./field.js";import{a as F,i as I,l as ne,n as L,o as R,r as z,s as B,t as V}from"./alert-dialog.js";import{n as H}from"./system-managed.js";import{t as U}from"./system-image-required.js";import{t as W}from"./policy-document-viewer.js";var G=r(),K=e(n(),1),q=t();function J(e){return`${e.trim()||`cluster`}-eks-cluster-role`}function Y(e){let t=(0,G.c)(35),{clusterName:n,open:r,onOpenChange:i,onCreated:a}=e,o=te(),s=ee(),c;t[0]===n?c=t[1]:(c=J(n),t[0]=n,t[1]=c);let[l,u]=(0,K.useState)(c),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(r);r!==p&&(m(r),r&&(u(J(n)),f(null)));let g=o.isPending||s.isPending,_;t[2]===i?_=t[3]:(_=function(e){e||f(null),i(e)},t[2]=i,t[3]=_);let v=_,b;t[4]!==s||t[5]!==o||t[6]!==a||t[7]!==i||t[8]!==l?(b=async function(){f(null);let e=l.trim();try{let t=await o.mutateAsync({roleName:e,assumeRolePolicyDocument:y});await s.mutateAsync({roleName:e,policyArn:C});let n=t.Role?.Arn;if(!n){f(`Role was created but no ARN was returned.`);return}a(n),i(!1)}catch(e){let t=e;f(t instanceof Error?t.message:`Failed to create role.`)}},t[4]=s,t[5]=o,t[6]=a,t[7]=i,t[8]=l,t[9]=b):b=t[9];let x=b,S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,q.jsxs)(B,{children:[(0,q.jsx)(ne,{children:`Create cluster IAM role`}),(0,q.jsx)(F,{children:`Creates an IAM role trusted by the EKS control plane and attaches the AmazonEKSClusterPolicy managed policy.`})]}),t[10]=S):S=t[10];let w;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,q.jsx)(M,{children:(0,q.jsx)(`label`,{htmlFor:`eks-role-name`,children:`Role name`})}),t[11]=w):w=t[11];let T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>u(e.target.value),t[12]=T):T=t[12];let E;t[13]===l?E=t[14]:(E=(0,q.jsxs)(P,{children:[w,(0,q.jsx)(h,{id:`eks-role-name`,onChange:T,placeholder:`my-cluster-eks-cluster-role`,value:l})]}),t[13]=l,t[14]=E);let D;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:`Trust policy (JSON)`}),(0,q.jsx)(W,{document:y})]}),t[15]=D):D=t[15];let O;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:`Attached managed policy`}),(0,q.jsx)(`code`,{className:`block rounded-md border bg-muted p-2 font-mono text-sm break-all`,children:C}),(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Grants the EKS control plane the permissions it needs to manage the cluster.`})]}),t[16]=O):O=t[16];let k;t[17]===d?k=t[18]:(k=d&&(0,q.jsx)(`p`,{className:`text-sm text-destructive`,children:d}),t[17]=d,t[18]=k);let A;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,q.jsx)(z,{children:`Cancel`}),t[19]=A):A=t[19];let j;t[20]!==g||t[21]!==l?(j=g||!l.trim(),t[20]=g,t[21]=l,t[22]=j):j=t[22];let N=g?`Creating…`:`Create role`,H;t[23]!==x||t[24]!==j||t[25]!==N?(H=(0,q.jsxs)(R,{children:[A,(0,q.jsx)(L,{disabled:j,onClick:x,children:N})]}),t[23]=x,t[24]=j,t[25]=N,t[26]=H):H=t[26];let U;t[27]!==k||t[28]!==H||t[29]!==E?(U=(0,q.jsxs)(I,{className:`max-w-lg sm:max-w-lg`,children:[S,E,D,O,k,H]}),t[27]=k,t[28]=H,t[29]=E,t[30]=U):U=t[30];let Y;return t[31]!==v||t[32]!==r||t[33]!==U?(Y=(0,q.jsx)(V,{onOpenChange:v,open:r,children:U}),t[31]=v,t[32]=r,t[33]=U,t[34]=Y):Y=t[34],Y}function re(e){let t=s(e.Tags);return t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`}function X(e){let t=s(e.Tags);return`${t?`${e.SubnetId} (${t})`:e.SubnetId} · ${e.CidrBlock}`}function ie(){let e=o(),t=i(),[n,r]=(0,K.useState)(!1),[s,y]=(0,K.useState)(!1),{data:C}=a(g),{data:ee}=a(_),{data:te}=a(w),{data:F}=a(v),I=x(),ne=(F.Images??[]).some(H),L=async()=>{r(!0);try{await t.invalidateQueries({queryKey:v.queryKey})}finally{r(!1)}},R=C.Vpcs??[],z=ee.Subnets??[],B=te.Roles??[],{control:V,formState:{errors:W,isSubmitting:G},handleSubmit:J,register:ie,setValue:Z}=E({resolver:O(b),defaultValues:{name:``,version:S[0],roleArn:``,vpcId:``,subnetIds:[],bootstrapClusterCreatorAdminPermissions:!0,endpointPublicAccess:!0,endpointPrivateAccess:!1,publicAccessCidrs:[`0.0.0.0/0`]}}),ae=T({control:V,name:`vpcId`}),Q=T({control:V,name:`subnetIds`}),oe=new Set(Q),se=T({control:V,name:`endpointPublicAccess`}),$=T({control:V,name:`publicAccessCidrs`}),ce=z.filter(e=>e.VpcId===ae),le=(e=``)=>{Z(`vpcId`,e??``,{shouldValidate:!0}),Z(`subnetIds`,[])},ue=e=>{let t=Q.includes(e)?Q.filter(t=>t!==e):[...Q,e];Z(`subnetIds`,t,{shouldValidate:!0})},de=(e,t)=>{let n=[...$];n[e]=t,Z(`publicAccessCidrs`,n,{shouldValidate:!0})},fe=()=>Z(`publicAccessCidrs`,[...$,``],{shouldValidate:!0}),pe=e=>Z(`publicAccessCidrs`,$.filter((t,n)=>n!==e),{shouldValidate:!0}),me=T({control:V,name:`name`}),he=async e=>{await t.invalidateQueries({queryKey:w.queryKey}),Z(`roleArn`,e,{shouldValidate:!0})};return ne?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(c,{to:`/eks/list-clusters`,children:`Clusters`}),(0,q.jsx)(j,{subtitle:`EKS`,title:`Create Cluster`}),I.error&&(0,q.jsx)(k,{error:I.error,msg:`Failed to create cluster`}),(0,q.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:J(async t=>{await I.mutateAsync(t),await e({to:`/eks/list-clusters/$clusterName`,params:{clusterName:t.name}})}),children:[(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:(0,q.jsx)(`label`,{htmlFor:`cluster-name`,children:`Name`})}),(0,q.jsx)(h,{"aria-invalid":!!W.name,id:`cluster-name`,placeholder:`my-cluster`,...ie(`name`)}),(0,q.jsx)(N,{errors:[W.name]})]}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:(0,q.jsx)(`label`,{htmlFor:`cluster-version`,children:`Kubernetes version`})}),(0,q.jsx)(D,{control:V,name:`version`,render:({field:e})=>(0,q.jsxs)(p,{onValueChange:e.onChange,value:e.value,children:[(0,q.jsx)(f,{className:`w-full`,id:`cluster-version`,children:(0,q.jsx)(l,{placeholder:`Select version`})}),(0,q.jsx)(d,{children:S.map(e=>(0,q.jsx)(u,{value:e,children:e},e))})]})}),(0,q.jsx)(N,{errors:[W.version]})]}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:(0,q.jsx)(`label`,{htmlFor:`cluster-role`,children:`Cluster IAM role`})}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(D,{control:V,name:`roleArn`,render:({field:e})=>(0,q.jsxs)(p,{onValueChange:e.onChange,value:e.value,children:[(0,q.jsx)(f,{"aria-invalid":!!W.roleArn,className:`w-full`,id:`cluster-role`,children:(0,q.jsx)(l,{placeholder:`Select role`})}),(0,q.jsx)(d,{children:B.map(e=>(0,q.jsx)(u,{value:e.Arn??``,children:e.RoleName},e.Arn))})]})}),(0,q.jsx)(m,{onClick:()=>y(!0),type:`button`,variant:`outline`,children:`Create role`})]}),(0,q.jsx)(N,{errors:[W.roleArn]})]}),(0,q.jsx)(Y,{clusterName:me,onCreated:he,onOpenChange:y,open:s}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:(0,q.jsx)(`label`,{htmlFor:`cluster-vpc`,children:`VPC`})}),(0,q.jsx)(D,{control:V,name:`vpcId`,render:({field:e})=>(0,q.jsxs)(p,{onValueChange:e=>le(e),value:e.value,children:[(0,q.jsx)(f,{"aria-invalid":!!W.vpcId,className:`w-full`,id:`cluster-vpc`,children:(0,q.jsx)(l,{placeholder:`Select VPC`})}),(0,q.jsx)(d,{children:R.map(e=>(0,q.jsx)(u,{value:e.VpcId??``,children:re(e)},e.VpcId))})]})}),(0,q.jsx)(N,{errors:[W.vpcId]})]}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:`Subnets (select at least 1)`}),ce.length===0?(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No subnets in the selected VPC.`}):(0,q.jsx)(`div`,{className:`space-y-1`,children:ce.map(e=>(0,q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`input`,{"aria-label":`Subnet ${X(e)}`,checked:oe.has(e.SubnetId??``),onChange:()=>ue(e.SubnetId??``),type:`checkbox`}),(0,q.jsx)(`span`,{className:`font-mono`,children:X(e)})]},e.SubnetId))}),(0,q.jsx)(N,{errors:[W.subnetIds]})]}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:`Endpoint access`}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Public access exposes the API server on an internet-facing endpoint; private access keeps it reachable only from within the VPC. At least one must be enabled.`}),(0,q.jsx)(D,{control:V,name:`endpointPublicAccess`,render:({field:e})=>(0,q.jsxs)(`label`,{className:`mt-2 flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`input`,{"aria-label":`Enable public access`,checked:e.value,onChange:t=>e.onChange(t.target.checked),type:`checkbox`}),`Public`]})}),(0,q.jsx)(D,{control:V,name:`endpointPrivateAccess`,render:({field:e})=>(0,q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`input`,{"aria-label":`Enable private access`,checked:e.value,onChange:t=>e.onChange(t.target.checked),type:`checkbox`}),`Private`]})}),(0,q.jsx)(N,{errors:[W.endpointPublicAccess]}),se&&(0,q.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Public access source ranges (CIDR). Defaults to`,` `,(0,q.jsx)(`span`,{className:`font-mono`,children:`0.0.0.0/0`}),`.`]}),$.map((e,t)=>(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(h,{"aria-label":`Public access CIDR ${t+1}`,className:`font-mono`,onChange:e=>de(t,e.target.value),placeholder:`203.0.113.0/24`,value:e}),(0,q.jsx)(m,{onClick:()=>pe(t),size:`sm`,type:`button`,variant:`ghost`,children:`Remove`})]},t)),(0,q.jsx)(m,{onClick:fe,size:`sm`,type:`button`,variant:`outline`,children:`Add CIDR`}),(0,q.jsx)(N,{errors:[W.publicAccessCidrs]})]})]}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:`Access`}),(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Authentication mode is `,(0,q.jsx)(`span`,{className:`font-mono`,children:`API`}),` (IAM access entries). The legacy aws-auth ConfigMap is not supported.`]}),(0,q.jsx)(D,{control:V,name:`bootstrapClusterCreatorAdminPermissions`,render:({field:e})=>(0,q.jsxs)(`label`,{className:`mt-2 flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`input`,{"aria-label":`Grant the cluster creator admin permissions`,checked:e.value,onChange:t=>e.onChange(t.target.checked),type:`checkbox`}),`Grant the cluster creator admin permissions`]})})]}),(0,q.jsx)(A,{isPending:I.isPending,isSubmitting:G,onCancel:async()=>await e({to:`/eks/list-clusters`}),pendingLabel:`Creating…`,submitLabel:`Create Cluster`})]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(c,{to:`/eks/list-clusters`,children:`Clusters`}),(0,q.jsx)(j,{subtitle:`EKS`,title:`Create Cluster`}),(0,q.jsx)(U,{description:`EKS clusters boot a Spinifex-managed node image (K3s) that is not shipped with the platform. Import it before creating a cluster.`,importCommand:`spx admin images import --name spinifex-eks-node`,isRechecking:n,onRecheck:L,title:`EKS system image not found`})]})}var Z=ie;export{Z as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{n as i}from"./QueryClientProvider.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./useNavigate.js";import{nn as s}from"./cluster-config.js";import{t as c}from"./back-link.js";import{c as l,i as u,n as d,s as f,t as p}from"./select.js";import{t as m}from"./button.js";import{t as h}from"./input.js";import{M as g,O as _,o as v}from"./ec2.js";import{a as y,d as b,g as x,o as S,t as C}from"./eks.js";import{i as ee,u as te}from"./iam.js";import{y as w}from"./iam2.js";import{a as T,i as E,n as D,t as O}from"./zod.js";import{t as k}from"./error-banner.js";import{t as A}from"./form-actions.js";import{t as j}from"./page-heading.js";import{a as M,r as N,t as P}from"./field.js";import{a as F,i as I,l as ne,n as L,o as R,r as z,s as B,t as V}from"./alert-dialog.js";import{n as H}from"./system-managed.js";import{t as U}from"./system-image-required.js";import{t as W}from"./policy-document-viewer.js";var G=r(),K=e(n(),1),q=t();function J(e){return`${e.trim()||`cluster`}-eks-cluster-role`}function Y(e){let t=(0,G.c)(35),{clusterName:n,open:r,onOpenChange:i,onCreated:a}=e,o=te(),s=ee(),c;t[0]===n?c=t[1]:(c=J(n),t[0]=n,t[1]=c);let[l,u]=(0,K.useState)(c),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(r);r!==p&&(m(r),r&&(u(J(n)),f(null)));let g=o.isPending||s.isPending,_;t[2]===i?_=t[3]:(_=function(e){e||f(null),i(e)},t[2]=i,t[3]=_);let v=_,b;t[4]!==s||t[5]!==o||t[6]!==a||t[7]!==i||t[8]!==l?(b=async function(){f(null);let e=l.trim();try{let t=await o.mutateAsync({roleName:e,assumeRolePolicyDocument:y});await s.mutateAsync({roleName:e,policyArn:C});let n=t.Role?.Arn;if(!n){f(`Role was created but no ARN was returned.`);return}a(n),i(!1)}catch(e){let t=e;f(t instanceof Error?t.message:`Failed to create role.`)}},t[4]=s,t[5]=o,t[6]=a,t[7]=i,t[8]=l,t[9]=b):b=t[9];let x=b,S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,q.jsxs)(B,{children:[(0,q.jsx)(ne,{children:`Create cluster IAM role`}),(0,q.jsx)(F,{children:`Creates an IAM role trusted by the EKS control plane and attaches the AmazonEKSClusterPolicy managed policy.`})]}),t[10]=S):S=t[10];let w;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,q.jsx)(M,{children:(0,q.jsx)(`label`,{htmlFor:`eks-role-name`,children:`Role name`})}),t[11]=w):w=t[11];let T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{u(e.target.value)},t[12]=T):T=t[12];let E;t[13]===l?E=t[14]:(E=(0,q.jsxs)(P,{children:[w,(0,q.jsx)(h,{id:`eks-role-name`,onChange:T,placeholder:`my-cluster-eks-cluster-role`,value:l})]}),t[13]=l,t[14]=E);let D;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:`Trust policy (JSON)`}),(0,q.jsx)(W,{document:y})]}),t[15]=D):D=t[15];let O;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:`Attached managed policy`}),(0,q.jsx)(`code`,{className:`block rounded-md border bg-muted p-2 font-mono text-sm break-all`,children:C}),(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Grants the EKS control plane the permissions it needs to manage the cluster.`})]}),t[16]=O):O=t[16];let k;t[17]===d?k=t[18]:(k=d&&(0,q.jsx)(`p`,{className:`text-sm text-destructive`,children:d}),t[17]=d,t[18]=k);let A;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,q.jsx)(z,{children:`Cancel`}),t[19]=A):A=t[19];let j;t[20]!==g||t[21]!==l?(j=g||!l.trim(),t[20]=g,t[21]=l,t[22]=j):j=t[22];let N=g?`Creating…`:`Create role`,H;t[23]!==x||t[24]!==j||t[25]!==N?(H=(0,q.jsxs)(R,{children:[A,(0,q.jsx)(L,{disabled:j,onClick:x,children:N})]}),t[23]=x,t[24]=j,t[25]=N,t[26]=H):H=t[26];let U;t[27]!==k||t[28]!==H||t[29]!==E?(U=(0,q.jsxs)(I,{className:`max-w-lg sm:max-w-lg`,children:[S,E,D,O,k,H]}),t[27]=k,t[28]=H,t[29]=E,t[30]=U):U=t[30];let Y;return t[31]!==v||t[32]!==r||t[33]!==U?(Y=(0,q.jsx)(V,{onOpenChange:v,open:r,children:U}),t[31]=v,t[32]=r,t[33]=U,t[34]=Y):Y=t[34],Y}function re(e){let t=s(e.Tags);return t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`}function X(e){let t=s(e.Tags);return`${t?`${e.SubnetId} (${t})`:e.SubnetId} · ${e.CidrBlock}`}function ie(){let e=o(),t=i(),[n,r]=(0,K.useState)(!1),[s,y]=(0,K.useState)(!1),{data:C}=a(g),{data:ee}=a(_),{data:te}=a(w),{data:F}=a(v),I=x(),ne=(F.Images??[]).some(H),L=async()=>{r(!0);try{await t.invalidateQueries({queryKey:v.queryKey})}finally{r(!1)}},R=C.Vpcs??[],z=ee.Subnets??[],B=te.Roles??[],{control:V,formState:{errors:W,isSubmitting:G},handleSubmit:J,register:ie,setValue:Z}=E({resolver:O(b),defaultValues:{name:``,version:S[0],roleArn:``,vpcId:``,subnetIds:[],bootstrapClusterCreatorAdminPermissions:!0,endpointPublicAccess:!0,endpointPrivateAccess:!1,publicAccessCidrs:[`0.0.0.0/0`]}}),ae=T({control:V,name:`vpcId`}),Q=T({control:V,name:`subnetIds`}),oe=new Set(Q),se=T({control:V,name:`endpointPublicAccess`}),$=T({control:V,name:`publicAccessCidrs`}),ce=z.filter(e=>e.VpcId===ae),le=(e=``)=>{Z(`vpcId`,e??``,{shouldValidate:!0}),Z(`subnetIds`,[])},ue=e=>{let t=Q.includes(e)?Q.filter(t=>t!==e):[...Q,e];Z(`subnetIds`,t,{shouldValidate:!0})},de=(e,t)=>{let n=[...$];n[e]=t,Z(`publicAccessCidrs`,n,{shouldValidate:!0})},fe=()=>{Z(`publicAccessCidrs`,[...$,``],{shouldValidate:!0})},pe=e=>{Z(`publicAccessCidrs`,$.filter((t,n)=>n!==e),{shouldValidate:!0})},me=T({control:V,name:`name`}),he=async e=>{await t.invalidateQueries({queryKey:w.queryKey}),Z(`roleArn`,e,{shouldValidate:!0})};return ne?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(c,{to:`/eks/list-clusters`,children:`Clusters`}),(0,q.jsx)(j,{subtitle:`EKS`,title:`Create Cluster`}),I.error&&(0,q.jsx)(k,{error:I.error,msg:`Failed to create cluster`}),(0,q.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:J(async t=>{await I.mutateAsync(t),await e({to:`/eks/list-clusters/$clusterName`,params:{clusterName:t.name}})}),children:[(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:(0,q.jsx)(`label`,{htmlFor:`cluster-name`,children:`Name`})}),(0,q.jsx)(h,{"aria-invalid":!!W.name,id:`cluster-name`,placeholder:`my-cluster`,...ie(`name`)}),(0,q.jsx)(N,{errors:[W.name]})]}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:(0,q.jsx)(`label`,{htmlFor:`cluster-version`,children:`Kubernetes version`})}),(0,q.jsx)(D,{control:V,name:`version`,render:({field:e})=>(0,q.jsxs)(p,{onValueChange:e.onChange,value:e.value,children:[(0,q.jsx)(f,{className:`w-full`,id:`cluster-version`,children:(0,q.jsx)(l,{placeholder:`Select version`})}),(0,q.jsx)(d,{children:S.map(e=>(0,q.jsx)(u,{value:e,children:e},e))})]})}),(0,q.jsx)(N,{errors:[W.version]})]}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:(0,q.jsx)(`label`,{htmlFor:`cluster-role`,children:`Cluster IAM role`})}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(D,{control:V,name:`roleArn`,render:({field:e})=>(0,q.jsxs)(p,{onValueChange:e.onChange,value:e.value,children:[(0,q.jsx)(f,{"aria-invalid":!!W.roleArn,className:`w-full`,id:`cluster-role`,children:(0,q.jsx)(l,{placeholder:`Select role`})}),(0,q.jsx)(d,{children:B.map(e=>(0,q.jsx)(u,{value:e.Arn??``,children:e.RoleName},e.Arn))})]})}),(0,q.jsx)(m,{onClick:()=>{y(!0)},type:`button`,variant:`outline`,children:`Create role`})]}),(0,q.jsx)(N,{errors:[W.roleArn]})]}),(0,q.jsx)(Y,{clusterName:me,onCreated:he,onOpenChange:y,open:s}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:(0,q.jsx)(`label`,{htmlFor:`cluster-vpc`,children:`VPC`})}),(0,q.jsx)(D,{control:V,name:`vpcId`,render:({field:e})=>(0,q.jsxs)(p,{onValueChange:e=>{le(e)},value:e.value,children:[(0,q.jsx)(f,{"aria-invalid":!!W.vpcId,className:`w-full`,id:`cluster-vpc`,children:(0,q.jsx)(l,{placeholder:`Select VPC`})}),(0,q.jsx)(d,{children:R.map(e=>(0,q.jsx)(u,{value:e.VpcId??``,children:re(e)},e.VpcId))})]})}),(0,q.jsx)(N,{errors:[W.vpcId]})]}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:`Subnets (select at least 1)`}),ce.length===0?(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No subnets in the selected VPC.`}):(0,q.jsx)(`div`,{className:`space-y-1`,children:ce.map(e=>(0,q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`input`,{"aria-label":`Subnet ${X(e)}`,checked:oe.has(e.SubnetId??``),onChange:()=>{ue(e.SubnetId??``)},type:`checkbox`}),(0,q.jsx)(`span`,{className:`font-mono`,children:X(e)})]},e.SubnetId))}),(0,q.jsx)(N,{errors:[W.subnetIds]})]}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:`Endpoint access`}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Public access exposes the API server on an internet-facing endpoint; private access keeps it reachable only from within the VPC. At least one must be enabled.`}),(0,q.jsx)(D,{control:V,name:`endpointPublicAccess`,render:({field:e})=>(0,q.jsxs)(`label`,{className:`mt-2 flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`input`,{"aria-label":`Enable public access`,checked:e.value,onChange:t=>{e.onChange(t.target.checked)},type:`checkbox`}),`Public`]})}),(0,q.jsx)(D,{control:V,name:`endpointPrivateAccess`,render:({field:e})=>(0,q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`input`,{"aria-label":`Enable private access`,checked:e.value,onChange:t=>{e.onChange(t.target.checked)},type:`checkbox`}),`Private`]})}),(0,q.jsx)(N,{errors:[W.endpointPublicAccess]}),se&&(0,q.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Public access source ranges (CIDR). Defaults to`,` `,(0,q.jsx)(`span`,{className:`font-mono`,children:`0.0.0.0/0`}),`.`]}),$.map((e,t)=>(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(h,{"aria-label":`Public access CIDR ${t+1}`,className:`font-mono`,onChange:e=>{de(t,e.target.value)},placeholder:`203.0.113.0/24`,value:e}),(0,q.jsx)(m,{onClick:()=>{pe(t)},size:`sm`,type:`button`,variant:`ghost`,children:`Remove`})]},t)),(0,q.jsx)(m,{onClick:fe,size:`sm`,type:`button`,variant:`outline`,children:`Add CIDR`}),(0,q.jsx)(N,{errors:[W.publicAccessCidrs]})]})]}),(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{children:`Access`}),(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Authentication mode is `,(0,q.jsx)(`span`,{className:`font-mono`,children:`API`}),` (IAM access entries). The legacy aws-auth ConfigMap is not supported.`]}),(0,q.jsx)(D,{control:V,name:`bootstrapClusterCreatorAdminPermissions`,render:({field:e})=>(0,q.jsxs)(`label`,{className:`mt-2 flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`input`,{"aria-label":`Grant the cluster creator admin permissions`,checked:e.value,onChange:t=>{e.onChange(t.target.checked)},type:`checkbox`}),`Grant the cluster creator admin permissions`]})})]}),(0,q.jsx)(A,{isPending:I.isPending,isSubmitting:G,onCancel:async()=>{await e({to:`/eks/list-clusters`})},pendingLabel:`Creating…`,submitLabel:`Create Cluster`})]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(c,{to:`/eks/list-clusters`,children:`Clusters`}),(0,q.jsx)(j,{subtitle:`EKS`,title:`Create Cluster`}),(0,q.jsx)(U,{description:`EKS clusters boot a Spinifex-managed node image (K3s) that is not shipped with the platform. Import it before creating a cluster.`,importCommand:`spx admin images import --name spinifex-eks-node`,isRechecking:n,onRecheck:L,title:`EKS system image not found`})]})}var Z=ie;export{Z as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-db-instance.js b/spinifex/services/spinifexui/frontend/dist/assets/create-db-instance.js index d6553f425..baee17267 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-db-instance.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-db-instance.js @@ -1 +1 @@ -import{a as e,n as t,r as n}from"./compiler-runtime.js";import{n as ee}from"./QueryClientProvider.js";import{t as te}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{t as ne}from"./useNavigate.js";import{t as i}from"./back-link.js";import{c as a,i as o,n as s,s as c,t as l}from"./select.js";import{i as u,n as d,r as f,t as re}from"./cli-command-panel.js";import{t as p}from"./input.js";import{M as ie,o as m,w as ae}from"./ec2.js";import{h as oe}from"./rds.js";import{t as h}from"./rds2.js";import{d as se,h as ce,l as le,o as ue}from"./rds3.js";import{a as de,i as fe,n as g,t as pe}from"./zod.js";import{t as me}from"./error-banner.js";import{t as he}from"./form-actions.js";import{t as _}from"./page-heading.js";import{a as v,n as y,r as b,t as x}from"./field.js";import{a as S,r as ge}from"./system-managed.js";import{t as _e}from"./tags-field-array.js";import{t as C}from"./system-image-required.js";import{n as ve}from"./picker-notice.js";import{a as ye,i as be,o as w,r as xe,s as Se,t as Ce}from"./security-group-checkboxes.js";var we=e(n(),1),T=t(),E=7,Te=[{id:`multi-az`,label:`Multi-AZ deployment`,note:`Not available on Spinifex — the platform is single-AZ, so a standby would not exist.`},{id:`publicly-accessible`,label:`Public access`,note:`Not available on Spinifex — the endpoint is a private VPC address.`},{id:`storage-autoscaling`,label:`Storage autoscaling`,note:`Not available on Spinifex — allocated storage grows only when you ask it to.`}];function D(){let e=ne(),t=ee(),n=h(),[u,d]=(0,we.useState)(!1),{data:f}=r(ue),{data:D}=r(ce),{data:O}=r(se),{data:De}=r(ae),{data:Oe}=r(ie),{data:ke}=r(m),Ae=ke.Images??[],k=f.DBEngineVersions??[],A=[...new Set(k.map(e=>e.Engine??``).filter(Boolean))],j=(e,t)=>Ae.some(n=>ge(n,e,t)),M=e=>k.find(t=>t.Engine===e&&j(e,t.EngineVersion??``))?.EngineVersion??``,N=e=>M(e).length>0,P=A.filter(N),F=P[0]??``,I=async()=>{d(!0);try{await t.invalidateQueries({queryKey:m.queryKey})}finally{d(!1)}},{control:L,formState:{errors:R,isSubmitting:je},handleSubmit:Me,register:z,setValue:B}=fe({resolver:pe(oe),defaultValues:{dbInstanceIdentifier:``,engine:F,engineVersion:M(F),dbInstanceClass:``,allocatedStorage:20,masterUsername:``,masterUserPassword:``,confirmPassword:``,dbName:``,port:``,dbSubnetGroupName:``,vpcSecurityGroupIds:[],dbParameterGroupName:``,deletionProtection:!1,backupRetentionPeriod:E,preferredBackupWindow:``,preferredMaintenanceWindow:``,tags:[]}}),V=de({control:L}),H=V.engine??``,U=V.dbSubnetGroupName??``,W=V.vpcSecurityGroupIds??[],G=te(le(H)),Ne=k.filter(e=>e.Engine===H),K=G.data?.OrderableDBInstanceOptions??[],q=[...new Set(K.map(e=>e.DBInstanceClass??``).filter(Boolean))],[J]=K,Y=D.DBSubnetGroups??[],Pe=Se(O.DBParameterGroups??[],k,H),Fe=Y.find(e=>e.DBSubnetGroupName===U)?.VpcId,X=Oe.Vpcs?.find(e=>e.IsDefault)?.VpcId,Z=Fe??X,Q=De.SecurityGroups??[],Ie=be(Q,Z),Le=e=>{B(`engine`,e,{shouldValidate:!0}),B(`engineVersion`,M(e)),B(`dbInstanceClass`,``),B(`dbParameterGroupName`,``)},$=e=>B(`vpcSecurityGroupIds`,e,{shouldValidate:!0}),Re=e=>{let t=Y.find(t=>t.DBSubnetGroupName===e)?.VpcId??X;B(`dbSubnetGroupName`,e,{shouldValidate:!0}),$(xe(Q,t,W))},ze=async t=>{await n.mutateAsync(t),await e({to:`/rds/describe-db-instances`})};if(A.length>0&&P.length===0)return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(i,{to:`/rds/describe-db-instances`,children:`Back to databases`}),(0,T.jsx)(_,{title:`Create Database`}),(0,T.jsx)(C,{description:`RDS boots a Spinifex-managed engine image that is not shipped with the platform. Import one before creating a database. Engines offered: ${A.join(`, `)}.`,importCommand:S(A[0]??``),isRechecking:u,onRecheck:I,title:`RDS system image not found`})]});let Be=A.filter(e=>!N(e)),Ve=H===``?{tone:`muted`,text:`Select an engine to see the instance classes this cluster can run.`}:ve(G,q.length===0,{loading:`Loading the instance classes…`,failed:`Could not read the instance classes`,empty:`No instance class this cluster's nodes can run is available for ${H}.`});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(i,{to:`/rds/describe-db-instances`,children:`Back to databases`}),(0,T.jsx)(_,{title:`Create Database`}),n.error&&(0,T.jsx)(me,{error:n.error,msg:`Failed to create the DB instance`}),(0,T.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:Me(ze),children:[(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-identifier`,children:`DB instance identifier`})}),(0,T.jsx)(p,{"aria-invalid":!!R.dbInstanceIdentifier,id:`db-identifier`,placeholder:`orders-db`,...z(`dbInstanceIdentifier`)}),(0,T.jsx)(y,{children:`Lowercase letters, digits and hyphens. This is also the endpoint hostname, so it cannot be changed later.`}),(0,T.jsx)(b,{errors:[R.dbInstanceIdentifier]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-engine`,children:`Engine`})}),(0,T.jsx)(g,{control:L,name:`engine`,render:({field:e})=>(0,T.jsxs)(l,{onValueChange:e=>Le(e??``),value:e.value,children:[(0,T.jsx)(c,{"aria-invalid":!!R.engine,className:`w-full`,id:`db-engine`,children:(0,T.jsx)(a,{placeholder:`Select an engine`})}),(0,T.jsx)(s,{children:A.map(e=>(0,T.jsx)(o,{disabled:!N(e),value:e,children:N(e)?e:`${e} — image not imported`},e))})]})}),(0,T.jsx)(b,{errors:[R.engine]})]}),Be.map(e=>(0,T.jsx)(C,{description:`No ${e} image is imported on this cluster, so a ${e} database cannot launch. The other engines are unaffected.`,importCommand:S(e),isRechecking:u,onRecheck:I,title:`${e} image not found`},e)),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-engine-version`,children:`Engine version`})}),(0,T.jsx)(g,{control:L,name:`engineVersion`,render:({field:e})=>(0,T.jsxs)(l,{onValueChange:e.onChange,value:e.value,children:[(0,T.jsx)(c,{className:`w-full`,id:`db-engine-version`,children:(0,T.jsx)(a,{placeholder:`Engine default`})}),(0,T.jsx)(s,{children:Ne.map(e=>(0,T.jsx)(o,{disabled:!j(H,e.EngineVersion??``),value:e.EngineVersion??``,children:e.DBEngineVersionDescription??e.EngineVersion},e.EngineVersion))})]})}),(0,T.jsx)(y,{children:`There is no in-place version upgrade, so this cannot be changed after the database is created.`}),(0,T.jsx)(b,{errors:[R.engineVersion]})]}),(0,T.jsx)(w,{control:L,id:`db-instance-class`,label:`DB instance class`,name:`dbInstanceClass`,notice:Ve,options:q.map(e=>({value:e,label:e})),placeholder:`Select an instance class`}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-storage`,children:`Allocated storage (GiB)`})}),(0,T.jsx)(p,{"aria-invalid":!!R.allocatedStorage,id:`db-storage`,max:J?.MaxStorageSize,min:J?.MinStorageSize,type:`number`,...z(`allocatedStorage`,{valueAsNumber:!0})}),(0,T.jsxs)(y,{children:[`gp3, encrypted. Storage grows only — it can never be shrunk.`,J?.MinStorageSize!==void 0&&` This engine accepts ${J.MinStorageSize}–${J.MaxStorageSize} GiB.`]}),(0,T.jsx)(b,{errors:[R.allocatedStorage]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:`Storage encryption`}),(0,T.jsx)(`p`,{className:`text-sm`,children:`Encrypted — always on.`}),(0,T.jsx)(y,{children:`Storage is encrypted with the cluster key. Unencrypted storage is not offered and a customer-managed key is not selectable.`})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-master-username`,children:`Master username`})}),(0,T.jsx)(p,{"aria-invalid":!!R.masterUsername,id:`db-master-username`,placeholder:`dbadmin`,...z(`masterUsername`)}),(0,T.jsx)(b,{errors:[R.masterUsername]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-master-password`,children:`Master password`})}),(0,T.jsx)(p,{"aria-invalid":!!R.masterUserPassword,id:`db-master-password`,type:`password`,...z(`masterUserPassword`)}),(0,T.jsx)(y,{children:`8–128 printable ASCII characters, excluding '/', '"', '@' and spaces.`}),(0,T.jsx)(b,{errors:[R.masterUserPassword]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-confirm-password`,children:`Confirm master password`})}),(0,T.jsx)(p,{"aria-invalid":!!R.confirmPassword,id:`db-confirm-password`,type:`password`,...z(`confirmPassword`)}),(0,T.jsx)(b,{errors:[R.confirmPassword]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-name`,children:`Initial database name`})}),(0,T.jsx)(p,{"aria-invalid":!!R.dbName,id:`db-name`,placeholder:`Optional`,...z(`dbName`)}),(0,T.jsx)(y,{children:`Leave blank to create no database. Letters, digits and underscores, starting with a letter.`}),(0,T.jsx)(b,{errors:[R.dbName]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-port`,children:`Port`})}),(0,T.jsx)(p,{"aria-invalid":!!R.port,id:`db-port`,placeholder:`Engine default`,...z(`port`)}),(0,T.jsx)(y,{children:`Leave blank to use the engine's own port. The port is fixed at create and cannot be changed later.`}),(0,T.jsx)(b,{errors:[R.port]})]}),(0,T.jsx)(w,{control:L,description:`Leave unset to place the endpoint in the account's default VPC subnet. The subnet group cannot be changed after create.`,id:`db-subnet-group`,label:`DB subnet group`,name:`dbSubnetGroupName`,onValueChange:Re,options:Y.map(e=>({value:e.DBSubnetGroupName??``,label:`${e.DBSubnetGroupName} (${e.VpcId})`})),placeholder:`Default VPC subnet`}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:`VPC security groups`}),(0,T.jsx)(Ce,{emptyText:Z?`No security groups available in ${Z}.`:`No default VPC is available for security groups.`,groups:Ie,onChange:$,selected:W}),(0,T.jsx)(b,{errors:[R.vpcSecurityGroupIds]})]}),(0,T.jsx)(w,{control:L,id:`db-parameter-group`,label:`DB parameter group`,name:`dbParameterGroupName`,options:Pe.map(e=>({value:e.DBParameterGroupName??``,label:e.DBParameterGroupName??``})),placeholder:`Engine default group`}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-backup-retention`,children:`Backup retention (days)`})}),(0,T.jsx)(p,{"aria-invalid":!!R.backupRetentionPeriod,id:`db-backup-retention`,max:7,min:0,type:`number`,...z(`backupRetentionPeriod`,{valueAsNumber:!0})}),(0,T.jsx)(y,{children:`0 disables automated backups. There is no point-in-time restore; backups are daily snapshots taken in the window below.`}),(0,T.jsx)(b,{errors:[R.backupRetentionPeriod]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-backup-window`,children:`Preferred backup window`})}),(0,T.jsx)(p,{"aria-invalid":!!R.preferredBackupWindow,id:`db-backup-window`,placeholder:`hh24:mi-hh24:mi in UTC`,...z(`preferredBackupWindow`)}),(0,T.jsx)(y,{children:`Leave blank to have one assigned. Minimum 30 minutes.`}),(0,T.jsx)(b,{errors:[R.preferredBackupWindow]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-maintenance-window`,children:`Preferred maintenance window`})}),(0,T.jsx)(p,{"aria-invalid":!!R.preferredMaintenanceWindow,id:`db-maintenance-window`,placeholder:`ddd:hh24:mi-ddd:hh24:mi in UTC`,...z(`preferredMaintenanceWindow`)}),(0,T.jsx)(y,{children:`Leave blank to have one assigned clear of the backup window.`}),(0,T.jsx)(b,{errors:[R.preferredMaintenanceWindow]})]}),(0,T.jsx)(ye,{control:L,name:`deletionProtection`}),(0,T.jsx)(_e,{control:L,name:`tags`}),(0,T.jsxs)(`fieldset`,{className:`space-y-3 rounded-md border border-border p-4`,children:[(0,T.jsx)(`legend`,{className:`px-1 text-sm font-medium`,children:`Not available on Spinifex`}),Te.map(e=>(0,T.jsxs)(`label`,{className:`flex items-start gap-2 text-xs text-muted-foreground`,children:[(0,T.jsx)(`input`,{checked:!1,disabled:!0,readOnly:!0,type:`checkbox`}),(0,T.jsxs)(`span`,{children:[e.label,(0,T.jsx)(`span`,{className:`mt-0.5 block`,children:e.note})]})]},e.id))]}),(0,T.jsx)(re,{commands:Ee({dbInstanceIdentifier:V.dbInstanceIdentifier??``,engine:H,engineVersion:V.engineVersion??``,dbInstanceClass:V.dbInstanceClass??``,allocatedStorage:V.allocatedStorage??20,masterUsername:V.masterUsername??``,dbName:V.dbName??``,port:V.port??``,dbSubnetGroupName:U,vpcSecurityGroupIds:W,dbParameterGroupName:V.dbParameterGroupName??``,deletionProtection:V.deletionProtection??!1,backupRetentionPeriod:V.backupRetentionPeriod??E,preferredBackupWindow:V.preferredBackupWindow??``,preferredMaintenanceWindow:V.preferredMaintenanceWindow??``})}),(0,T.jsx)(he,{isPending:n.isPending,isSubmitting:je,onCancel:async()=>await e({to:`/rds/describe-db-instances`}),pendingLabel:`Creating…`,submitLabel:`Create Database`})]})]})}function Ee(e){return[{label:`Create DB Instance`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws rds create-db-instance`},...f(`--db-instance-identifier`,d(e.dbInstanceIdentifier,`DBInstanceIdentifier`)),...f(`--engine`,d(e.engine,`Engine`)),...f(`--db-instance-class`,d(e.dbInstanceClass,`DBInstanceClass`)),...f(`--allocated-storage`,e.allocatedStorage),...f(`--master-username`,d(e.masterUsername,`MasterUsername`)),{type:`flag`,value:` --master-user-password`},{type:`variable`,value:` $DB_PASSWORD`},...u(`--engine-version`,e.engineVersion),...u(`--db-name`,e.dbName),...u(`--port`,e.port),...u(`--db-subnet-group-name`,e.dbSubnetGroupName),...u(`--vpc-security-group-ids`,e.vpcSecurityGroupIds.join(` `)),...u(`--db-parameter-group-name`,e.dbParameterGroupName),...u(`--deletion-protection`,e.deletionProtection),...f(`--backup-retention-period`,e.backupRetentionPeriod),...u(`--preferred-backup-window`,e.preferredBackupWindow),...u(`--preferred-maintenance-window`,e.preferredMaintenanceWindow)]}]}var O=D;export{O as component}; \ No newline at end of file +import{a as e,n as t,r as n}from"./compiler-runtime.js";import{n as ee}from"./QueryClientProvider.js";import{t as te}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{t as ne}from"./useNavigate.js";import{t as i}from"./back-link.js";import{c as a,i as o,n as s,s as c,t as l}from"./select.js";import{i as u,n as d,r as f,t as re}from"./cli-command-panel.js";import{t as p}from"./input.js";import{M as ie,o as m,w as ae}from"./ec2.js";import{h as oe}from"./rds.js";import{t as h}from"./rds2.js";import{d as se,h as ce,l as le,o as ue}from"./rds3.js";import{a as de,i as fe,n as g,t as pe}from"./zod.js";import{t as me}from"./error-banner.js";import{t as he}from"./form-actions.js";import{t as _}from"./page-heading.js";import{a as v,n as y,r as b,t as x}from"./field.js";import{a as S,r as ge}from"./system-managed.js";import{t as _e}from"./tags-field-array.js";import{t as C}from"./system-image-required.js";import{n as ve}from"./picker-notice.js";import{a as ye,i as be,o as w,r as xe,s as Se,t as Ce}from"./security-group-checkboxes.js";var we=e(n(),1),T=t(),E=7,Te=[{id:`multi-az`,label:`Multi-AZ deployment`,note:`Not available on Spinifex — the platform is single-AZ, so a standby would not exist.`},{id:`publicly-accessible`,label:`Public access`,note:`Not available on Spinifex — the endpoint is a private VPC address.`},{id:`storage-autoscaling`,label:`Storage autoscaling`,note:`Not available on Spinifex — allocated storage grows only when you ask it to.`}];function D(){let e=ne(),t=ee(),n=h(),[u,d]=(0,we.useState)(!1),{data:f}=r(ue),{data:D}=r(ce),{data:O}=r(se),{data:De}=r(ae),{data:Oe}=r(ie),{data:ke}=r(m),Ae=ke.Images??[],k=f.DBEngineVersions??[],A=[...new Set(k.map(e=>e.Engine??``).filter(Boolean))],j=(e,t)=>Ae.some(n=>ge(n,e,t)),M=e=>k.find(t=>t.Engine===e&&j(e,t.EngineVersion??``))?.EngineVersion??``,N=e=>M(e).length>0,P=A.filter(N),F=P[0]??``,I=async()=>{d(!0);try{await t.invalidateQueries({queryKey:m.queryKey})}finally{d(!1)}},{control:L,formState:{errors:R,isSubmitting:je},handleSubmit:Me,register:z,setValue:B}=fe({resolver:pe(oe),defaultValues:{dbInstanceIdentifier:``,engine:F,engineVersion:M(F),dbInstanceClass:``,allocatedStorage:20,masterUsername:``,masterUserPassword:``,confirmPassword:``,dbName:``,port:``,dbSubnetGroupName:``,vpcSecurityGroupIds:[],dbParameterGroupName:``,deletionProtection:!1,backupRetentionPeriod:E,preferredBackupWindow:``,preferredMaintenanceWindow:``,tags:[]}}),V=de({control:L}),H=V.engine??``,U=V.dbSubnetGroupName??``,W=V.vpcSecurityGroupIds??[],G=te(le(H)),Ne=k.filter(e=>e.Engine===H),K=G.data?.OrderableDBInstanceOptions??[],q=[...new Set(K.map(e=>e.DBInstanceClass??``).filter(Boolean))],[J]=K,Y=D.DBSubnetGroups??[],Pe=Se(O.DBParameterGroups??[],k,H),Fe=Y.find(e=>e.DBSubnetGroupName===U)?.VpcId,X=Oe.Vpcs?.find(e=>e.IsDefault)?.VpcId,Z=Fe??X,Q=De.SecurityGroups??[],Ie=be(Q,Z),Le=e=>{B(`engine`,e,{shouldValidate:!0}),B(`engineVersion`,M(e)),B(`dbInstanceClass`,``),B(`dbParameterGroupName`,``)},$=e=>{B(`vpcSecurityGroupIds`,e,{shouldValidate:!0})},Re=e=>{let t=Y.find(t=>t.DBSubnetGroupName===e)?.VpcId??X;B(`dbSubnetGroupName`,e,{shouldValidate:!0}),$(xe(Q,t,W))},ze=async t=>{await n.mutateAsync(t),await e({to:`/rds/describe-db-instances`})};if(A.length>0&&P.length===0)return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(i,{to:`/rds/describe-db-instances`,children:`Back to databases`}),(0,T.jsx)(_,{title:`Create Database`}),(0,T.jsx)(C,{description:`RDS boots a Spinifex-managed engine image that is not shipped with the platform. Import one before creating a database. Engines offered: ${A.join(`, `)}.`,importCommand:S(A[0]??``),isRechecking:u,onRecheck:I,title:`RDS system image not found`})]});let Be=A.filter(e=>!N(e)),Ve=H===``?{tone:`muted`,text:`Select an engine to see the instance classes this cluster can run.`}:ve(G,q.length===0,{loading:`Loading the instance classes…`,failed:`Could not read the instance classes`,empty:`No instance class this cluster's nodes can run is available for ${H}.`});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(i,{to:`/rds/describe-db-instances`,children:`Back to databases`}),(0,T.jsx)(_,{title:`Create Database`}),n.error&&(0,T.jsx)(me,{error:n.error,msg:`Failed to create the DB instance`}),(0,T.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:Me(ze),children:[(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-identifier`,children:`DB instance identifier`})}),(0,T.jsx)(p,{"aria-invalid":!!R.dbInstanceIdentifier,id:`db-identifier`,placeholder:`orders-db`,...z(`dbInstanceIdentifier`)}),(0,T.jsx)(y,{children:`Lowercase letters, digits and hyphens. This is also the endpoint hostname, so it cannot be changed later.`}),(0,T.jsx)(b,{errors:[R.dbInstanceIdentifier]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-engine`,children:`Engine`})}),(0,T.jsx)(g,{control:L,name:`engine`,render:({field:e})=>(0,T.jsxs)(l,{onValueChange:e=>{Le(e??``)},value:e.value,children:[(0,T.jsx)(c,{"aria-invalid":!!R.engine,className:`w-full`,id:`db-engine`,children:(0,T.jsx)(a,{placeholder:`Select an engine`})}),(0,T.jsx)(s,{children:A.map(e=>(0,T.jsx)(o,{disabled:!N(e),value:e,children:N(e)?e:`${e} — image not imported`},e))})]})}),(0,T.jsx)(b,{errors:[R.engine]})]}),Be.map(e=>(0,T.jsx)(C,{description:`No ${e} image is imported on this cluster, so a ${e} database cannot launch. The other engines are unaffected.`,importCommand:S(e),isRechecking:u,onRecheck:I,title:`${e} image not found`},e)),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-engine-version`,children:`Engine version`})}),(0,T.jsx)(g,{control:L,name:`engineVersion`,render:({field:e})=>(0,T.jsxs)(l,{onValueChange:e.onChange,value:e.value,children:[(0,T.jsx)(c,{className:`w-full`,id:`db-engine-version`,children:(0,T.jsx)(a,{placeholder:`Engine default`})}),(0,T.jsx)(s,{children:Ne.map(e=>(0,T.jsx)(o,{disabled:!j(H,e.EngineVersion??``),value:e.EngineVersion??``,children:e.DBEngineVersionDescription??e.EngineVersion},e.EngineVersion))})]})}),(0,T.jsx)(y,{children:`There is no in-place version upgrade, so this cannot be changed after the database is created.`}),(0,T.jsx)(b,{errors:[R.engineVersion]})]}),(0,T.jsx)(w,{control:L,id:`db-instance-class`,label:`DB instance class`,name:`dbInstanceClass`,notice:Ve,options:q.map(e=>({value:e,label:e})),placeholder:`Select an instance class`}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-storage`,children:`Allocated storage (GiB)`})}),(0,T.jsx)(p,{"aria-invalid":!!R.allocatedStorage,id:`db-storage`,max:J?.MaxStorageSize,min:J?.MinStorageSize,type:`number`,...z(`allocatedStorage`,{valueAsNumber:!0})}),(0,T.jsxs)(y,{children:[`gp3, encrypted. Storage grows only — it can never be shrunk.`,J?.MinStorageSize!==void 0&&` This engine accepts ${J.MinStorageSize}–${J.MaxStorageSize} GiB.`]}),(0,T.jsx)(b,{errors:[R.allocatedStorage]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:`Storage encryption`}),(0,T.jsx)(`p`,{className:`text-sm`,children:`Encrypted — always on.`}),(0,T.jsx)(y,{children:`Storage is encrypted with the cluster key. Unencrypted storage is not offered and a customer-managed key is not selectable.`})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-master-username`,children:`Master username`})}),(0,T.jsx)(p,{"aria-invalid":!!R.masterUsername,id:`db-master-username`,placeholder:`dbadmin`,...z(`masterUsername`)}),(0,T.jsx)(b,{errors:[R.masterUsername]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-master-password`,children:`Master password`})}),(0,T.jsx)(p,{"aria-invalid":!!R.masterUserPassword,id:`db-master-password`,type:`password`,...z(`masterUserPassword`)}),(0,T.jsx)(y,{children:`8–128 printable ASCII characters, excluding '/', '"', '@' and spaces.`}),(0,T.jsx)(b,{errors:[R.masterUserPassword]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-confirm-password`,children:`Confirm master password`})}),(0,T.jsx)(p,{"aria-invalid":!!R.confirmPassword,id:`db-confirm-password`,type:`password`,...z(`confirmPassword`)}),(0,T.jsx)(b,{errors:[R.confirmPassword]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-name`,children:`Initial database name`})}),(0,T.jsx)(p,{"aria-invalid":!!R.dbName,id:`db-name`,placeholder:`Optional`,...z(`dbName`)}),(0,T.jsx)(y,{children:`Leave blank to create no database. Letters, digits and underscores, starting with a letter.`}),(0,T.jsx)(b,{errors:[R.dbName]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-port`,children:`Port`})}),(0,T.jsx)(p,{"aria-invalid":!!R.port,id:`db-port`,placeholder:`Engine default`,...z(`port`)}),(0,T.jsx)(y,{children:`Leave blank to use the engine's own port. The port is fixed at create and cannot be changed later.`}),(0,T.jsx)(b,{errors:[R.port]})]}),(0,T.jsx)(w,{control:L,description:`Leave unset to place the endpoint in the account's default VPC subnet. The subnet group cannot be changed after create.`,id:`db-subnet-group`,label:`DB subnet group`,name:`dbSubnetGroupName`,onValueChange:Re,options:Y.map(e=>({value:e.DBSubnetGroupName??``,label:`${e.DBSubnetGroupName} (${e.VpcId})`})),placeholder:`Default VPC subnet`}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:`VPC security groups`}),(0,T.jsx)(Ce,{emptyText:Z?`No security groups available in ${Z}.`:`No default VPC is available for security groups.`,groups:Ie,onChange:$,selected:W}),(0,T.jsx)(b,{errors:[R.vpcSecurityGroupIds]})]}),(0,T.jsx)(w,{control:L,id:`db-parameter-group`,label:`DB parameter group`,name:`dbParameterGroupName`,options:Pe.map(e=>({value:e.DBParameterGroupName??``,label:e.DBParameterGroupName??``})),placeholder:`Engine default group`}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-backup-retention`,children:`Backup retention (days)`})}),(0,T.jsx)(p,{"aria-invalid":!!R.backupRetentionPeriod,id:`db-backup-retention`,max:7,min:0,type:`number`,...z(`backupRetentionPeriod`,{valueAsNumber:!0})}),(0,T.jsx)(y,{children:`0 disables automated backups. There is no point-in-time restore; backups are daily snapshots taken in the window below.`}),(0,T.jsx)(b,{errors:[R.backupRetentionPeriod]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-backup-window`,children:`Preferred backup window`})}),(0,T.jsx)(p,{"aria-invalid":!!R.preferredBackupWindow,id:`db-backup-window`,placeholder:`hh24:mi-hh24:mi in UTC`,...z(`preferredBackupWindow`)}),(0,T.jsx)(y,{children:`Leave blank to have one assigned. Minimum 30 minutes.`}),(0,T.jsx)(b,{errors:[R.preferredBackupWindow]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(v,{children:(0,T.jsx)(`label`,{htmlFor:`db-maintenance-window`,children:`Preferred maintenance window`})}),(0,T.jsx)(p,{"aria-invalid":!!R.preferredMaintenanceWindow,id:`db-maintenance-window`,placeholder:`ddd:hh24:mi-ddd:hh24:mi in UTC`,...z(`preferredMaintenanceWindow`)}),(0,T.jsx)(y,{children:`Leave blank to have one assigned clear of the backup window.`}),(0,T.jsx)(b,{errors:[R.preferredMaintenanceWindow]})]}),(0,T.jsx)(ye,{control:L,name:`deletionProtection`}),(0,T.jsx)(_e,{control:L,name:`tags`}),(0,T.jsxs)(`fieldset`,{className:`space-y-3 rounded-md border border-border p-4`,children:[(0,T.jsx)(`legend`,{className:`px-1 text-sm font-medium`,children:`Not available on Spinifex`}),Te.map(e=>(0,T.jsxs)(`label`,{className:`flex items-start gap-2 text-xs text-muted-foreground`,children:[(0,T.jsx)(`input`,{checked:!1,disabled:!0,readOnly:!0,type:`checkbox`}),(0,T.jsxs)(`span`,{children:[e.label,(0,T.jsx)(`span`,{className:`mt-0.5 block`,children:e.note})]})]},e.id))]}),(0,T.jsx)(re,{commands:Ee({dbInstanceIdentifier:V.dbInstanceIdentifier??``,engine:H,engineVersion:V.engineVersion??``,dbInstanceClass:V.dbInstanceClass??``,allocatedStorage:V.allocatedStorage??20,masterUsername:V.masterUsername??``,dbName:V.dbName??``,port:V.port??``,dbSubnetGroupName:U,vpcSecurityGroupIds:W,dbParameterGroupName:V.dbParameterGroupName??``,deletionProtection:V.deletionProtection??!1,backupRetentionPeriod:V.backupRetentionPeriod??E,preferredBackupWindow:V.preferredBackupWindow??``,preferredMaintenanceWindow:V.preferredMaintenanceWindow??``})}),(0,T.jsx)(he,{isPending:n.isPending,isSubmitting:je,onCancel:async()=>{await e({to:`/rds/describe-db-instances`})},pendingLabel:`Creating…`,submitLabel:`Create Database`})]})]})}function Ee(e){return[{label:`Create DB Instance`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws rds create-db-instance`},...f(`--db-instance-identifier`,d(e.dbInstanceIdentifier,`DBInstanceIdentifier`)),...f(`--engine`,d(e.engine,`Engine`)),...f(`--db-instance-class`,d(e.dbInstanceClass,`DBInstanceClass`)),...f(`--allocated-storage`,e.allocatedStorage),...f(`--master-username`,d(e.masterUsername,`MasterUsername`)),{type:`flag`,value:` --master-user-password`},{type:`variable`,value:` $DB_PASSWORD`},...u(`--engine-version`,e.engineVersion),...u(`--db-name`,e.dbName),...u(`--port`,e.port),...u(`--db-subnet-group-name`,e.dbSubnetGroupName),...u(`--vpc-security-group-ids`,e.vpcSecurityGroupIds.join(` `)),...u(`--db-parameter-group-name`,e.dbParameterGroupName),...u(`--deletion-protection`,e.deletionProtection),...f(`--backup-retention-period`,e.backupRetentionPeriod),...u(`--preferred-backup-window`,e.preferredBackupWindow),...u(`--preferred-maintenance-window`,e.preferredMaintenanceWindow)]}]}var O=D;export{O as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-db-parameter-group.js b/spinifex/services/spinifexui/frontend/dist/assets/create-db-parameter-group.js index c44da3b9f..3b47e8e08 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-db-parameter-group.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-db-parameter-group.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as ee}from"./useSuspenseQuery.js";import{t as te}from"./useNavigate.js";import{t as ne}from"./back-link.js";import{c as re,i as n,n as ie,s as ae,t as oe}from"./select.js";import{n as r,r as i,t as se}from"./cli-command-panel.js";import{t as ce}from"./input.js";import{g as le}from"./rds.js";import{n as ue}from"./rds2.js";import{o as de}from"./rds3.js";import{a as fe,i as pe,n as me,t as he}from"./zod.js";import{t as ge}from"./error-banner.js";import{t as _e}from"./form-actions.js";import{t as ve}from"./page-heading.js";import{a,n as ye,r as o,t as s}from"./field.js";import{t as be}from"./tags-field-array.js";var xe=t(),c=e();function l(){let e=(0,xe.c)(84),t=te(),n=ue(),{data:r}=ee(de),i;e[0]===r.DBEngineVersions?i=e[1]:(i=r.DBEngineVersions??[],e[0]=r.DBEngineVersions,e[1]=i);let l;e[2]===i?l=e[3]:(l=new Map(i.filter(we).map(Ce)),e[2]=i,e[3]=l);let u;e[4]===l?u=e[5]:(u=[...l],e[4]=l,e[5]=u);let d=u,f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=he(le),e[6]=f):f=e[6];let Ee=d[0]?.[0]??``,p;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],e[7]=p):p=e[7];let m;e[8]===Ee?m=e[9]:(m={resolver:f,defaultValues:{dbParameterGroupName:``,dbParameterGroupFamily:Ee,description:``,tags:p}},e[8]=Ee,e[9]=m);let{control:h,formState:De,handleSubmit:Oe,register:g}=pe(m),{errors:_,isSubmitting:v}=De,y;e[10]===h?y=e[11]:(y={control:h},e[10]=h,e[11]=y);let b=fe(y),x;e[12]!==n||e[13]!==t?(x=async e=>{await n.mutateAsync(e),await t({to:`/rds/describe-db-parameter-groups/$name`,params:{name:e.dbParameterGroupName}})},e[12]=n,e[13]=t,e[14]=x):x=e[14];let S=x,C,w;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,c.jsx)(ne,{to:`/rds/describe-db-parameter-groups`,children:`Back to parameter groups`}),w=(0,c.jsx)(ve,{title:`Create DB Parameter Group`}),e[15]=C,e[16]=w):(C=e[15],w=e[16]);let T;e[17]===n.error?T=e[18]:(T=n.error&&(0,c.jsx)(ge,{error:n.error,msg:`Failed to create the DB parameter group`}),e[17]=n.error,e[18]=T);let E;e[19]!==Oe||e[20]!==S?(E=Oe(S),e[19]=Oe,e[20]=S,e[21]=E):E=e[21];let D;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`parameter-group-name`,children:`Name`})}),e[22]=D):D=e[22];let O=!!_.dbParameterGroupName,k;e[23]===g?k=e[24]:(k=g(`dbParameterGroupName`),e[23]=g,e[24]=k);let A;e[25]!==O||e[26]!==k?(A=(0,c.jsx)(ce,{"aria-invalid":O,id:`parameter-group-name`,placeholder:`orders-postgres18`,...k}),e[25]=O,e[26]=k,e[27]=A):A=e[27];let j;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,c.jsx)(ye,{children:`Letters, digits and hyphens, starting with a letter. The service reserves the name "default" and the "default." prefix.`}),e[28]=j):j=e[28];let M;e[29]===_.dbParameterGroupName?M=e[30]:(M=(0,c.jsx)(o,{errors:[_.dbParameterGroupName]}),e[29]=_.dbParameterGroupName,e[30]=M);let N;e[31]!==A||e[32]!==M?(N=(0,c.jsxs)(s,{children:[D,A,j,M]}),e[31]=A,e[32]=M,e[33]=N):N=e[33];let P;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`parameter-group-family`,children:`Family`})}),e[34]=P):P=e[34];let F;e[35]!==_.dbParameterGroupFamily||e[36]!==d?(F=e=>{let{field:t}=e;return(0,c.jsxs)(oe,{onValueChange:t.onChange,value:t.value,children:[(0,c.jsx)(ae,{"aria-invalid":!!_.dbParameterGroupFamily,className:`w-full`,id:`parameter-group-family`,children:(0,c.jsx)(re,{placeholder:`Select a family`})}),(0,c.jsx)(ie,{children:d.map(Se)})]})},e[35]=_.dbParameterGroupFamily,e[36]=d,e[37]=F):F=e[37];let I;e[38]!==h||e[39]!==F?(I=(0,c.jsx)(me,{control:h,name:`dbParameterGroupFamily`,render:F}),e[38]=h,e[39]=F,e[40]=I):I=e[40];let L;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,c.jsx)(ye,{children:`The family fixes which engine can attach the group, and it cannot be changed afterwards. A group of one family is refused by an instance of the other engine.`}),e[41]=L):L=e[41];let R;e[42]===_.dbParameterGroupFamily?R=e[43]:(R=(0,c.jsx)(o,{errors:[_.dbParameterGroupFamily]}),e[42]=_.dbParameterGroupFamily,e[43]=R);let z;e[44]!==I||e[45]!==R?(z=(0,c.jsxs)(s,{children:[P,I,L,R]}),e[44]=I,e[45]=R,e[46]=z):z=e[46];let B;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`parameter-group-description`,children:`Description`})}),e[47]=B):B=e[47];let V=!!_.description,H;e[48]===g?H=e[49]:(H=g(`description`),e[48]=g,e[49]=H);let U;e[50]!==V||e[51]!==H?(U=(0,c.jsx)(ce,{"aria-invalid":V,id:`parameter-group-description`,placeholder:`Tuned settings for the orders database`,...H}),e[50]=V,e[51]=H,e[52]=U):U=e[52];let W;e[53]===_.description?W=e[54]:(W=(0,c.jsx)(o,{errors:[_.description]}),e[53]=_.description,e[54]=W);let G;e[55]!==U||e[56]!==W?(G=(0,c.jsxs)(s,{children:[B,U,W]}),e[55]=U,e[56]=W,e[57]=G):G=e[57];let K;e[58]===h?K=e[59]:(K=(0,c.jsx)(be,{control:h,name:`tags`}),e[58]=h,e[59]=K);let q;e[60]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,c.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A new group starts empty: every value is the engine default until you override one, so a fresh group and the default group behave identically.`}),e[60]=q):q=e[60];let ke=b.dbParameterGroupName??``,Ae=b.dbParameterGroupFamily??``,je=b.description??``,J;e[61]!==ke||e[62]!==Ae||e[63]!==je?(J=Te({dbParameterGroupName:ke,dbParameterGroupFamily:Ae,description:je}),e[61]=ke,e[62]=Ae,e[63]=je,e[64]=J):J=e[64];let Y;e[65]===J?Y=e[66]:(Y=(0,c.jsx)(se,{commands:J}),e[65]=J,e[66]=Y);let X;e[67]===t?X=e[68]:(X=async()=>await t({to:`/rds/describe-db-parameter-groups`}),e[67]=t,e[68]=X);let Z;e[69]!==n.isPending||e[70]!==v||e[71]!==X?(Z=(0,c.jsx)(_e,{isPending:n.isPending,isSubmitting:v,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Parameter Group`}),e[69]=n.isPending,e[70]=v,e[71]=X,e[72]=Z):Z=e[72];let Q;e[73]!==E||e[74]!==N||e[75]!==z||e[76]!==G||e[77]!==K||e[78]!==Y||e[79]!==Z?(Q=(0,c.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:E,children:[N,z,G,K,q,Y,Z]}),e[73]=E,e[74]=N,e[75]=z,e[76]=G,e[77]=K,e[78]=Y,e[79]=Z,e[80]=Q):Q=e[80];let $;return e[81]!==T||e[82]!==Q?($=(0,c.jsxs)(c.Fragment,{children:[C,w,T,Q]}),e[81]=T,e[82]=Q,e[83]=$):$=e[83],$}function Se(e){let[t,ee]=e;return(0,c.jsxs)(n,{value:t,children:[t,` — `,ee]},t)}function Ce(e){return[e.DBParameterGroupFamily??``,e.DBEngineVersionDescription??e.Engine??``]}function we(e){return e.DBParameterGroupFamily}function Te(e){return[{label:`Create DB Parameter Group`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws rds create-db-parameter-group`},...i(`--db-parameter-group-name`,r(e.dbParameterGroupName,`DBParameterGroupName`)),...i(`--db-parameter-group-family`,r(e.dbParameterGroupFamily,`DBParameterGroupFamily`)),...i(`--description`,`"${r(e.description,`Description`)}"`)]}]}var u=l;export{u as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as ee}from"./useSuspenseQuery.js";import{t as te}from"./useNavigate.js";import{t as ne}from"./back-link.js";import{c as re,i as n,n as ie,s as ae,t as oe}from"./select.js";import{n as r,r as i,t as se}from"./cli-command-panel.js";import{t as ce}from"./input.js";import{g as le}from"./rds.js";import{n as ue}from"./rds2.js";import{o as de}from"./rds3.js";import{a as fe,i as pe,n as me,t as he}from"./zod.js";import{t as ge}from"./error-banner.js";import{t as _e}from"./form-actions.js";import{t as ve}from"./page-heading.js";import{a,n as ye,r as o,t as s}from"./field.js";import{t as be}from"./tags-field-array.js";var xe=t(),c=e();function l(){let e=(0,xe.c)(84),t=te(),n=ue(),{data:r}=ee(de),i;e[0]===r.DBEngineVersions?i=e[1]:(i=r.DBEngineVersions??[],e[0]=r.DBEngineVersions,e[1]=i);let l;e[2]===i?l=e[3]:(l=new Map(i.filter(we).map(Ce)),e[2]=i,e[3]=l);let u;e[4]===l?u=e[5]:(u=[...l],e[4]=l,e[5]=u);let d=u,f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=he(le),e[6]=f):f=e[6];let Ee=d[0]?.[0]??``,p;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],e[7]=p):p=e[7];let m;e[8]===Ee?m=e[9]:(m={resolver:f,defaultValues:{dbParameterGroupName:``,dbParameterGroupFamily:Ee,description:``,tags:p}},e[8]=Ee,e[9]=m);let{control:h,formState:De,handleSubmit:Oe,register:g}=pe(m),{errors:_,isSubmitting:v}=De,y;e[10]===h?y=e[11]:(y={control:h},e[10]=h,e[11]=y);let b=fe(y),x;e[12]!==n||e[13]!==t?(x=async e=>{await n.mutateAsync(e),await t({to:`/rds/describe-db-parameter-groups/$name`,params:{name:e.dbParameterGroupName}})},e[12]=n,e[13]=t,e[14]=x):x=e[14];let S=x,C,w;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,c.jsx)(ne,{to:`/rds/describe-db-parameter-groups`,children:`Back to parameter groups`}),w=(0,c.jsx)(ve,{title:`Create DB Parameter Group`}),e[15]=C,e[16]=w):(C=e[15],w=e[16]);let T;e[17]===n.error?T=e[18]:(T=n.error&&(0,c.jsx)(ge,{error:n.error,msg:`Failed to create the DB parameter group`}),e[17]=n.error,e[18]=T);let E;e[19]!==Oe||e[20]!==S?(E=Oe(S),e[19]=Oe,e[20]=S,e[21]=E):E=e[21];let D;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`parameter-group-name`,children:`Name`})}),e[22]=D):D=e[22];let O=!!_.dbParameterGroupName,k;e[23]===g?k=e[24]:(k=g(`dbParameterGroupName`),e[23]=g,e[24]=k);let A;e[25]!==O||e[26]!==k?(A=(0,c.jsx)(ce,{"aria-invalid":O,id:`parameter-group-name`,placeholder:`orders-postgres18`,...k}),e[25]=O,e[26]=k,e[27]=A):A=e[27];let j;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,c.jsx)(ye,{children:`Letters, digits and hyphens, starting with a letter. The service reserves the name "default" and the "default." prefix.`}),e[28]=j):j=e[28];let M;e[29]===_.dbParameterGroupName?M=e[30]:(M=(0,c.jsx)(o,{errors:[_.dbParameterGroupName]}),e[29]=_.dbParameterGroupName,e[30]=M);let N;e[31]!==A||e[32]!==M?(N=(0,c.jsxs)(s,{children:[D,A,j,M]}),e[31]=A,e[32]=M,e[33]=N):N=e[33];let P;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`parameter-group-family`,children:`Family`})}),e[34]=P):P=e[34];let F;e[35]!==_.dbParameterGroupFamily||e[36]!==d?(F=e=>{let{field:t}=e;return(0,c.jsxs)(oe,{onValueChange:t.onChange,value:t.value,children:[(0,c.jsx)(ae,{"aria-invalid":!!_.dbParameterGroupFamily,className:`w-full`,id:`parameter-group-family`,children:(0,c.jsx)(re,{placeholder:`Select a family`})}),(0,c.jsx)(ie,{children:d.map(Se)})]})},e[35]=_.dbParameterGroupFamily,e[36]=d,e[37]=F):F=e[37];let I;e[38]!==h||e[39]!==F?(I=(0,c.jsx)(me,{control:h,name:`dbParameterGroupFamily`,render:F}),e[38]=h,e[39]=F,e[40]=I):I=e[40];let L;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,c.jsx)(ye,{children:`The family fixes which engine can attach the group, and it cannot be changed afterwards. A group of one family is refused by an instance of the other engine.`}),e[41]=L):L=e[41];let R;e[42]===_.dbParameterGroupFamily?R=e[43]:(R=(0,c.jsx)(o,{errors:[_.dbParameterGroupFamily]}),e[42]=_.dbParameterGroupFamily,e[43]=R);let z;e[44]!==I||e[45]!==R?(z=(0,c.jsxs)(s,{children:[P,I,L,R]}),e[44]=I,e[45]=R,e[46]=z):z=e[46];let B;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`parameter-group-description`,children:`Description`})}),e[47]=B):B=e[47];let V=!!_.description,H;e[48]===g?H=e[49]:(H=g(`description`),e[48]=g,e[49]=H);let U;e[50]!==V||e[51]!==H?(U=(0,c.jsx)(ce,{"aria-invalid":V,id:`parameter-group-description`,placeholder:`Tuned settings for the orders database`,...H}),e[50]=V,e[51]=H,e[52]=U):U=e[52];let W;e[53]===_.description?W=e[54]:(W=(0,c.jsx)(o,{errors:[_.description]}),e[53]=_.description,e[54]=W);let G;e[55]!==U||e[56]!==W?(G=(0,c.jsxs)(s,{children:[B,U,W]}),e[55]=U,e[56]=W,e[57]=G):G=e[57];let K;e[58]===h?K=e[59]:(K=(0,c.jsx)(be,{control:h,name:`tags`}),e[58]=h,e[59]=K);let q;e[60]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,c.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A new group starts empty: every value is the engine default until you override one, so a fresh group and the default group behave identically.`}),e[60]=q):q=e[60];let ke=b.dbParameterGroupName??``,Ae=b.dbParameterGroupFamily??``,je=b.description??``,J;e[61]!==ke||e[62]!==Ae||e[63]!==je?(J=Te({dbParameterGroupName:ke,dbParameterGroupFamily:Ae,description:je}),e[61]=ke,e[62]=Ae,e[63]=je,e[64]=J):J=e[64];let Y;e[65]===J?Y=e[66]:(Y=(0,c.jsx)(se,{commands:J}),e[65]=J,e[66]=Y);let X;e[67]===t?X=e[68]:(X=async()=>{await t({to:`/rds/describe-db-parameter-groups`})},e[67]=t,e[68]=X);let Z;e[69]!==n.isPending||e[70]!==v||e[71]!==X?(Z=(0,c.jsx)(_e,{isPending:n.isPending,isSubmitting:v,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Parameter Group`}),e[69]=n.isPending,e[70]=v,e[71]=X,e[72]=Z):Z=e[72];let Q;e[73]!==E||e[74]!==N||e[75]!==z||e[76]!==G||e[77]!==K||e[78]!==Y||e[79]!==Z?(Q=(0,c.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:E,children:[N,z,G,K,q,Y,Z]}),e[73]=E,e[74]=N,e[75]=z,e[76]=G,e[77]=K,e[78]=Y,e[79]=Z,e[80]=Q):Q=e[80];let $;return e[81]!==T||e[82]!==Q?($=(0,c.jsxs)(c.Fragment,{children:[C,w,T,Q]}),e[81]=T,e[82]=Q,e[83]=$):$=e[83],$}function Se(e){let[t,ee]=e;return(0,c.jsxs)(n,{value:t,children:[t,` — `,ee]},t)}function Ce(e){return[e.DBParameterGroupFamily??``,e.DBEngineVersionDescription??e.Engine??``]}function we(e){return e.DBParameterGroupFamily}function Te(e){return[{label:`Create DB Parameter Group`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws rds create-db-parameter-group`},...i(`--db-parameter-group-name`,r(e.dbParameterGroupName,`DBParameterGroupName`)),...i(`--db-parameter-group-family`,r(e.dbParameterGroupFamily,`DBParameterGroupFamily`)),...i(`--description`,`"${r(e.description,`Description`)}"`)]}]}var u=l;export{u as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-db-snapshot-dialog.js b/spinifex/services/spinifexui/frontend/dist/assets/create-db-snapshot-dialog.js index 623087652..0bd2fb5e8 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-db-snapshot-dialog.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-db-snapshot-dialog.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as ee}from"./useQuery.js";import{c as te,i,n as ne,s as re,t as ie}from"./select.js";import{t as a}from"./button.js";import{t as ae}from"./input.js";import{_ as oe,f as o,w as s}from"./rds.js";import{r as se}from"./rds2.js";import{r as ce}from"./rds3.js";import{i as le,t as ue}from"./zod.js";import{a as c,n as de,r as fe,t as l}from"./field.js";import{a as pe,i as me,l as he,s as ge,t as _e}from"./alert-dialog.js";import{t as ve}from"./tags-field-array.js";import{n as ye,t as be}from"./picker-notice.js";var xe=r(),Se=e(n(),1),u=t();function d(e){let t=(0,xe.c)(65),{open:n,onOpenChange:r,dbInstanceIdentifier:i,onCreated:o}=e,d=se(),f=i===void 0,p;t[0]===f?p=t[1]:(p={...ce,enabled:f},t[0]=f,t[1]=p);let m=ee(p),[h,Te]=(0,Se.useState)(i??``),g;t[2]===m.data?.DBInstances?g=t[3]:(g=m.data?.DBInstances??[],t[2]=m.data?.DBInstances,t[3]=g);let Ee=g.filter(we),_=Ee.length===0,v;t[4]!==m||t[5]!==_?(v=ye(m,_,{loading:`Loading the DB instances…`,failed:`Could not read the DB instances`,empty:`No DB instance is available or stopped, which is what a snapshot is taken from.`}),t[4]=m,t[5]=_,t[6]=v):v=t[6];let De=v,y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=ue(oe),t[7]=y):y=t[7];let b;t[8]===i?b=t[9]:(b=i?s(i,`snapshot`):``,t[8]=i,t[9]=b);let x;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],t[10]=x):x=t[10];let S;t[11]===b?S=t[12]:(S={resolver:y,defaultValues:{dbSnapshotIdentifier:b,tags:x}},t[11]=b,t[12]=S);let{control:C,formState:Oe,handleSubmit:w,register:T,setValue:E}=le(S),{errors:D,isSubmitting:ke}=Oe,O;t[13]===E?O=t[14]:(O=function(e){Te(e??``),e&&E(`dbSnapshotIdentifier`,s(e,`snapshot`),{shouldValidate:!0})},t[13]=E,t[14]=O);let Ae=O,k;t[15]!==d||t[16]!==o||t[17]!==r||t[18]!==h?(k=async e=>{try{await d.mutateAsync({...e,dbInstanceIdentifier:h})}catch{return}r(!1),o?.()},t[15]=d,t[16]=o,t[17]=r,t[18]=h,t[19]=k):k=t[19];let A=k,j=_e,M=me,N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,u.jsxs)(ge,{children:[(0,u.jsx)(he,{children:`Take DB Snapshot`}),(0,u.jsx)(pe,{children:`The engine is held at a checkpoint while the snapshot is taken, so the instance reads as backing-up until it finishes.`})]}),t[20]=N):N=t[20];let P;t[21]!==w||t[22]!==A?(P=w(A),t[21]=w,t[22]=A,t[23]=P):P=t[23];let F=i?(0,u.jsxs)(l,{children:[(0,u.jsx)(c,{children:`DB instance`}),(0,u.jsx)(`p`,{className:`font-mono text-sm`,children:i})]}):(0,u.jsxs)(l,{children:[(0,u.jsx)(c,{children:(0,u.jsx)(`label`,{htmlFor:`snapshot-instance`,children:`DB instance`})}),De?(0,u.jsx)(be,{notice:De}):(0,u.jsxs)(ie,{onValueChange:Ae,value:h,children:[(0,u.jsx)(re,{className:`w-full`,id:`snapshot-instance`,children:(0,u.jsx)(te,{placeholder:`Select a DB instance`})}),(0,u.jsx)(ne,{children:Ee.map(Ce)})]})]}),I;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,u.jsx)(c,{children:(0,u.jsx)(`label`,{htmlFor:`snapshot-identifier`,children:`Snapshot identifier`})}),t[24]=I):I=t[24];let L=!!D.dbSnapshotIdentifier,R;t[25]===T?R=t[26]:(R=T(`dbSnapshotIdentifier`),t[25]=T,t[26]=R);let z;t[27]!==L||t[28]!==R?(z=(0,u.jsx)(ae,{"aria-invalid":L,id:`snapshot-identifier`,...R}),t[27]=L,t[28]=R,t[29]=z):z=t[29];let B;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,u.jsx)(de,{children:`Lowercase letters, digits and hyphens. The rds: namespace belongs to automated backups and cannot be used here.`}),t[30]=B):B=t[30];let V;t[31]===D.dbSnapshotIdentifier?V=t[32]:(V=(0,u.jsx)(fe,{errors:[D.dbSnapshotIdentifier]}),t[31]=D.dbSnapshotIdentifier,t[32]=V);let H;t[33]!==z||t[34]!==V?(H=(0,u.jsxs)(l,{children:[I,z,B,V]}),t[33]=z,t[34]=V,t[35]=H):H=t[35];let U;t[36]===C?U=t[37]:(U=(0,u.jsx)(ve,{control:C,name:`tags`}),t[36]=C,t[37]=U);let W;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,u.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A snapshot the engine could not be quiesced for is still taken and reported as crash consistent on the source instance's Backups tab. The snapshot's own events never carry it.`}),t[38]=W):W=t[38];let G;t[39]===d.error?G=t[40]:(G=d.error&&(0,u.jsx)(`p`,{className:`text-sm text-destructive`,children:d.error.message}),t[39]=d.error,t[40]=G);let K;t[41]===r?K=t[42]:(K=(0,u.jsx)(a,{onClick:()=>r(!1),type:`button`,variant:`outline`,children:`Cancel`}),t[41]=r,t[42]=K);let q=ke||d.isPending||h===``,J=d.isPending?`Taking Snapshot…`:`Take Snapshot`,Y;t[43]!==q||t[44]!==J?(Y=(0,u.jsx)(a,{disabled:q,type:`submit`,children:J}),t[43]=q,t[44]=J,t[45]=Y):Y=t[45];let X;t[46]!==K||t[47]!==Y?(X=(0,u.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[K,Y]}),t[46]=K,t[47]=Y,t[48]=X):X=t[48];let Z;t[49]!==P||t[50]!==F||t[51]!==H||t[52]!==U||t[53]!==G||t[54]!==X?(Z=(0,u.jsxs)(`form`,{className:`space-y-4`,onSubmit:P,children:[F,H,U,W,G,X]}),t[49]=P,t[50]=F,t[51]=H,t[52]=U,t[53]=G,t[54]=X,t[55]=Z):Z=t[55];let Q;t[56]!==M||t[57]!==N||t[58]!==Z?(Q=(0,u.jsxs)(M,{className:`max-h-[85vh] overflow-y-auto`,children:[N,Z]}),t[56]=M,t[57]=N,t[58]=Z,t[59]=Q):Q=t[59];let $;return t[60]!==j||t[61]!==r||t[62]!==n||t[63]!==Q?($=(0,u.jsx)(j,{onOpenChange:r,open:n,children:Q}),t[60]=j,t[61]=r,t[62]=n,t[63]=Q,t[64]=$):$=t[64],$}function Ce(e){return(0,u.jsxs)(i,{value:e.DBInstanceIdentifier??``,children:[e.DBInstanceIdentifier,` (`,e.DBInstanceStatus,`)`]},e.DBInstanceIdentifier)}function we(e){return o(e.DBInstanceStatus)}export{d as t}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as ee}from"./useQuery.js";import{c as te,i,n as ne,s as re,t as ie}from"./select.js";import{t as a}from"./button.js";import{t as ae}from"./input.js";import{_ as oe,f as o,w as s}from"./rds.js";import{r as se}from"./rds2.js";import{r as ce}from"./rds3.js";import{i as le,t as ue}from"./zod.js";import{a as c,n as de,r as fe,t as l}from"./field.js";import{a as pe,i as me,l as he,s as ge,t as _e}from"./alert-dialog.js";import{t as ve}from"./tags-field-array.js";import{n as ye,t as be}from"./picker-notice.js";var xe=r(),Se=e(n(),1),u=t();function d(e){let t=(0,xe.c)(65),{open:n,onOpenChange:r,dbInstanceIdentifier:i,onCreated:o}=e,d=se(),f=i===void 0,p;t[0]===f?p=t[1]:(p={...ce,enabled:f},t[0]=f,t[1]=p);let m=ee(p),[h,Te]=(0,Se.useState)(i??``),g;t[2]===m.data?.DBInstances?g=t[3]:(g=m.data?.DBInstances??[],t[2]=m.data?.DBInstances,t[3]=g);let Ee=g.filter(we),_=Ee.length===0,v;t[4]!==m||t[5]!==_?(v=ye(m,_,{loading:`Loading the DB instances…`,failed:`Could not read the DB instances`,empty:`No DB instance is available or stopped, which is what a snapshot is taken from.`}),t[4]=m,t[5]=_,t[6]=v):v=t[6];let De=v,y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=ue(oe),t[7]=y):y=t[7];let b;t[8]===i?b=t[9]:(b=i?s(i,`snapshot`):``,t[8]=i,t[9]=b);let x;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],t[10]=x):x=t[10];let S;t[11]===b?S=t[12]:(S={resolver:y,defaultValues:{dbSnapshotIdentifier:b,tags:x}},t[11]=b,t[12]=S);let{control:C,formState:Oe,handleSubmit:w,register:T,setValue:E}=le(S),{errors:D,isSubmitting:ke}=Oe,O;t[13]===E?O=t[14]:(O=function(e){Te(e??``),e&&E(`dbSnapshotIdentifier`,s(e,`snapshot`),{shouldValidate:!0})},t[13]=E,t[14]=O);let Ae=O,k;t[15]!==d||t[16]!==o||t[17]!==r||t[18]!==h?(k=async e=>{try{await d.mutateAsync({...e,dbInstanceIdentifier:h})}catch{return}r(!1),o?.()},t[15]=d,t[16]=o,t[17]=r,t[18]=h,t[19]=k):k=t[19];let A=k,j=_e,M=me,N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,u.jsxs)(ge,{children:[(0,u.jsx)(he,{children:`Take DB Snapshot`}),(0,u.jsx)(pe,{children:`The engine is held at a checkpoint while the snapshot is taken, so the instance reads as backing-up until it finishes.`})]}),t[20]=N):N=t[20];let P;t[21]!==w||t[22]!==A?(P=w(A),t[21]=w,t[22]=A,t[23]=P):P=t[23];let F=i?(0,u.jsxs)(l,{children:[(0,u.jsx)(c,{children:`DB instance`}),(0,u.jsx)(`p`,{className:`font-mono text-sm`,children:i})]}):(0,u.jsxs)(l,{children:[(0,u.jsx)(c,{children:(0,u.jsx)(`label`,{htmlFor:`snapshot-instance`,children:`DB instance`})}),De?(0,u.jsx)(be,{notice:De}):(0,u.jsxs)(ie,{onValueChange:Ae,value:h,children:[(0,u.jsx)(re,{className:`w-full`,id:`snapshot-instance`,children:(0,u.jsx)(te,{placeholder:`Select a DB instance`})}),(0,u.jsx)(ne,{children:Ee.map(Ce)})]})]}),I;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,u.jsx)(c,{children:(0,u.jsx)(`label`,{htmlFor:`snapshot-identifier`,children:`Snapshot identifier`})}),t[24]=I):I=t[24];let L=!!D.dbSnapshotIdentifier,R;t[25]===T?R=t[26]:(R=T(`dbSnapshotIdentifier`),t[25]=T,t[26]=R);let z;t[27]!==L||t[28]!==R?(z=(0,u.jsx)(ae,{"aria-invalid":L,id:`snapshot-identifier`,...R}),t[27]=L,t[28]=R,t[29]=z):z=t[29];let B;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,u.jsx)(de,{children:`Lowercase letters, digits and hyphens. The rds: namespace belongs to automated backups and cannot be used here.`}),t[30]=B):B=t[30];let V;t[31]===D.dbSnapshotIdentifier?V=t[32]:(V=(0,u.jsx)(fe,{errors:[D.dbSnapshotIdentifier]}),t[31]=D.dbSnapshotIdentifier,t[32]=V);let H;t[33]!==z||t[34]!==V?(H=(0,u.jsxs)(l,{children:[I,z,B,V]}),t[33]=z,t[34]=V,t[35]=H):H=t[35];let U;t[36]===C?U=t[37]:(U=(0,u.jsx)(ve,{control:C,name:`tags`}),t[36]=C,t[37]=U);let W;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,u.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A snapshot the engine could not be quiesced for is still taken and reported as crash consistent on the source instance's Backups tab. The snapshot's own events never carry it.`}),t[38]=W):W=t[38];let G;t[39]===d.error?G=t[40]:(G=d.error&&(0,u.jsx)(`p`,{className:`text-sm text-destructive`,children:d.error.message}),t[39]=d.error,t[40]=G);let K;t[41]===r?K=t[42]:(K=(0,u.jsx)(a,{onClick:()=>{r(!1)},type:`button`,variant:`outline`,children:`Cancel`}),t[41]=r,t[42]=K);let q=ke||d.isPending||h===``,J=d.isPending?`Taking Snapshot…`:`Take Snapshot`,Y;t[43]!==q||t[44]!==J?(Y=(0,u.jsx)(a,{disabled:q,type:`submit`,children:J}),t[43]=q,t[44]=J,t[45]=Y):Y=t[45];let X;t[46]!==K||t[47]!==Y?(X=(0,u.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[K,Y]}),t[46]=K,t[47]=Y,t[48]=X):X=t[48];let Z;t[49]!==P||t[50]!==F||t[51]!==H||t[52]!==U||t[53]!==G||t[54]!==X?(Z=(0,u.jsxs)(`form`,{className:`space-y-4`,onSubmit:P,children:[F,H,U,W,G,X]}),t[49]=P,t[50]=F,t[51]=H,t[52]=U,t[53]=G,t[54]=X,t[55]=Z):Z=t[55];let Q;t[56]!==M||t[57]!==N||t[58]!==Z?(Q=(0,u.jsxs)(M,{className:`max-h-[85vh] overflow-y-auto`,children:[N,Z]}),t[56]=M,t[57]=N,t[58]=Z,t[59]=Q):Q=t[59];let $;return t[60]!==j||t[61]!==r||t[62]!==n||t[63]!==Q?($=(0,u.jsx)(j,{onOpenChange:r,open:n,children:Q}),t[60]=j,t[61]=r,t[62]=n,t[63]=Q,t[64]=$):$=t[64],$}function Ce(e){return(0,u.jsxs)(i,{value:e.DBInstanceIdentifier??``,children:[e.DBInstanceIdentifier,` (`,e.DBInstanceStatus,`)`]},e.DBInstanceIdentifier)}function we(e){return o(e.DBInstanceStatus)}export{d as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-db-subnet-group.js b/spinifex/services/spinifexui/frontend/dist/assets/create-db-subnet-group.js index eae76a8a6..e38b59bf0 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-db-subnet-group.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-db-subnet-group.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{nn as te}from"./cluster-config.js";import{t as ne}from"./back-link.js";import{n as r,r as i,t as re}from"./cli-command-panel.js";import{t as ie}from"./input.js";import{M as ae,O as oe}from"./ec2.js";import{v as se}from"./rds.js";import{i as ce}from"./rds2.js";import{a as le,i as ue,t as de}from"./zod.js";import{t as fe}from"./error-banner.js";import{t as pe}from"./form-actions.js";import{t as me}from"./page-heading.js";import{a as he,n as ge,r as _e,t as ve}from"./field.js";import{t as ye}from"./tags-field-array.js";var be=t(),a=e();function xe(e){let t=te(e.Tags),n=[e.CidrBlock,e.AvailabilityZone,t].filter(Boolean);return`${e.SubnetId} (${n.join(`, `)})`}function o(){let e=(0,be.c)(94),t=ee(),r=ce(),{data:i}=n(oe),{data:o}=n(ae),s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=de(se),e[0]=s):s=e[0];let c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={resolver:s,defaultValues:{dbSubnetGroupName:``,dbSubnetGroupDescription:``,subnetIds:[],tags:[]}},e[1]=c):c=e[1];let{control:l,formState:we,handleSubmit:Te,register:u,setValue:Ee}=ue(c),{errors:d,isSubmitting:De}=we,f;e[2]===l?f=e[3]:(f={control:l},e[2]=l,e[3]=f);let p=le(f),m;e[4]===p.subnetIds?m=e[5]:(m=p.subnetIds??[],e[4]=p.subnetIds,e[5]=m);let h=m,g;e[6]===h?g=e[7]:(g=new Set(h),e[6]=h,e[7]=g);let Oe=g,_;e[8]===i.Subnets?_=e[9]:(_=i.Subnets??[],e[8]=i.Subnets,e[9]=_);let v=_,y;e[10]===o.Vpcs?y=e[11]:(y=o.Vpcs??[],e[10]=o.Vpcs,e[11]=y);let ke=y,b;e[12]!==h||e[13]!==v?(b=v.find(e=>e.SubnetId===h[0])?.VpcId,e[12]=h,e[13]=v,e[14]=b):b=e[14];let x=b,S;e[15]===v?S=e[16]:(S=new Set(v.map(Se).filter(Boolean)),e[15]=v,e[16]=S);let C;e[17]===S?C=e[18]:(C=[...S],e[17]=S,e[18]=C);let Ae=C,w;e[19]!==h||e[20]!==Ee?(w=e=>{let t=h.includes(e)?h.filter(t=>t!==e):[...h,e];Ee(`subnetIds`,t,{shouldValidate:!0})},e[19]=h,e[20]=Ee,e[21]=w):w=e[21];let je=w,T;e[22]!==r||e[23]!==t?(T=async e=>{await r.mutateAsync(e),await t({to:`/rds/describe-db-subnet-groups`})},e[22]=r,e[23]=t,e[24]=T):T=e[24];let E=T,D,O;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,a.jsx)(ne,{to:`/rds/describe-db-subnet-groups`,children:`Back to subnet groups`}),O=(0,a.jsx)(me,{title:`Create DB Subnet Group`}),e[25]=D,e[26]=O):(D=e[25],O=e[26]);let k;e[27]===r.error?k=e[28]:(k=r.error&&(0,a.jsx)(fe,{error:r.error,msg:`Failed to create the DB subnet group`}),e[27]=r.error,e[28]=k);let A;e[29]!==Te||e[30]!==E?(A=Te(E),e[29]=Te,e[30]=E,e[31]=A):A=e[31];let j;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,a.jsx)(he,{children:(0,a.jsx)(`label`,{htmlFor:`subnet-group-name`,children:`Name`})}),e[32]=j):j=e[32];let Me=!!d.dbSubnetGroupName,M;e[33]===u?M=e[34]:(M=u(`dbSubnetGroupName`),e[33]=u,e[34]=M);let N;e[35]!==Me||e[36]!==M?(N=(0,a.jsx)(ie,{"aria-invalid":Me,id:`subnet-group-name`,placeholder:`orders-db-subnets`,...M}),e[35]=Me,e[36]=M,e[37]=N):N=e[37];let P;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,a.jsx)(ge,{children:`Letters, digits and hyphens, starting with a letter. The name cannot be changed later, and there is no ModifyDBSubnetGroup — editing a group means deleting and recreating it.`}),e[38]=P):P=e[38];let F;e[39]===d.dbSubnetGroupName?F=e[40]:(F=(0,a.jsx)(_e,{errors:[d.dbSubnetGroupName]}),e[39]=d.dbSubnetGroupName,e[40]=F);let I;e[41]!==N||e[42]!==F?(I=(0,a.jsxs)(ve,{children:[j,N,P,F]}),e[41]=N,e[42]=F,e[43]=I):I=e[43];let L;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,a.jsx)(he,{children:(0,a.jsx)(`label`,{htmlFor:`subnet-group-description`,children:`Description`})}),e[44]=L):L=e[44];let Ne=!!d.dbSubnetGroupDescription,R;e[45]===u?R=e[46]:(R=u(`dbSubnetGroupDescription`),e[45]=u,e[46]=R);let z;e[47]!==Ne||e[48]!==R?(z=(0,a.jsx)(ie,{"aria-invalid":Ne,id:`subnet-group-description`,placeholder:`Private subnets for the orders database`,...R}),e[47]=Ne,e[48]=R,e[49]=z):z=e[49];let B;e[50]===d.dbSubnetGroupDescription?B=e[51]:(B=(0,a.jsx)(_e,{errors:[d.dbSubnetGroupDescription]}),e[50]=d.dbSubnetGroupDescription,e[51]=B);let V;e[52]!==z||e[53]!==B?(V=(0,a.jsxs)(ve,{children:[L,z,B]}),e[52]=z,e[53]=B,e[54]=V):V=e[54];let H;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,a.jsx)(he,{children:`Subnets`}),e[55]=H):H=e[55];let U;e[56]!==x||e[57]!==Oe||e[58]!==v||e[59]!==je||e[60]!==Ae||e[61]!==ke?(U=v.length===0?(0,a.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No subnets in this account. Create one before creating a subnet group.`}):(0,a.jsx)(`div`,{className:`space-y-4`,children:Ae.map(e=>{let t=te(ke.find(t=>t.VpcId===e)?.Tags),n=x!==void 0&&x!==e;return(0,a.jsxs)(`div`,{children:[(0,a.jsxs)(`p`,{className:`mb-1 font-mono text-xs text-muted-foreground`,children:[e,t&&` (${t})`,n&&` — a subnet group must span one VPC, so this one is out of reach`]}),(0,a.jsx)(`div`,{className:`space-y-1 pl-3`,children:v.filter(t=>t.VpcId===e).map(e=>(0,a.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,a.jsx)(`input`,{"aria-label":`Subnet ${xe(e)}`,checked:Oe.has(e.SubnetId??``),disabled:n,onChange:()=>je(e.SubnetId??``),type:`checkbox`}),(0,a.jsx)(`span`,{className:`font-mono`,children:xe(e)})]},e.SubnetId))})]},e)})}),e[56]=x,e[57]=Oe,e[58]=v,e[59]=je,e[60]=Ae,e[61]=ke,e[62]=U):U=e[62];let W;e[63]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,a.jsxs)(ge,{children:[`At most `,20,` subnets, all in one VPC. This platform is single-AZ, so the two-AZ rule AWS enforces does not apply here.`]}),e[63]=W):W=e[63];let G;e[64]===d.subnetIds?G=e[65]:(G=(0,a.jsx)(_e,{errors:[d.subnetIds]}),e[64]=d.subnetIds,e[65]=G);let K;e[66]!==U||e[67]!==G?(K=(0,a.jsxs)(ve,{children:[H,U,W,G]}),e[66]=U,e[67]=G,e[68]=K):K=e[68];let q;e[69]===l?q=e[70]:(q=(0,a.jsx)(ye,{control:l,name:`tags`}),e[69]=l,e[70]=q);let Pe=p.dbSubnetGroupName??``,Fe=p.dbSubnetGroupDescription??``,J;e[71]!==h||e[72]!==Pe||e[73]!==Fe?(J=Ce({dbSubnetGroupName:Pe,dbSubnetGroupDescription:Fe,subnetIds:h}),e[71]=h,e[72]=Pe,e[73]=Fe,e[74]=J):J=e[74];let Y;e[75]===J?Y=e[76]:(Y=(0,a.jsx)(re,{commands:J}),e[75]=J,e[76]=Y);let X;e[77]===t?X=e[78]:(X=async()=>await t({to:`/rds/describe-db-subnet-groups`}),e[77]=t,e[78]=X);let Z;e[79]!==r.isPending||e[80]!==De||e[81]!==X?(Z=(0,a.jsx)(pe,{isPending:r.isPending,isSubmitting:De,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Subnet Group`}),e[79]=r.isPending,e[80]=De,e[81]=X,e[82]=Z):Z=e[82];let Q;e[83]!==A||e[84]!==I||e[85]!==V||e[86]!==K||e[87]!==q||e[88]!==Y||e[89]!==Z?(Q=(0,a.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,V,K,q,Y,Z]}),e[83]=A,e[84]=I,e[85]=V,e[86]=K,e[87]=q,e[88]=Y,e[89]=Z,e[90]=Q):Q=e[90];let $;return e[91]!==k||e[92]!==Q?($=(0,a.jsxs)(a.Fragment,{children:[D,O,k,Q]}),e[91]=k,e[92]=Q,e[93]=$):$=e[93],$}function Se(e){return e.VpcId??``}function Ce(e){return[{label:`Create DB Subnet Group`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws rds create-db-subnet-group`},...i(`--db-subnet-group-name`,r(e.dbSubnetGroupName,`DBSubnetGroupName`)),...i(`--db-subnet-group-description`,`"${r(e.dbSubnetGroupDescription,`DBSubnetGroupDescription`)}"`),...i(`--subnet-ids`,r(e.subnetIds.join(` `),`SubnetIds`))]}]}var s=o;export{s as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{nn as te}from"./cluster-config.js";import{t as ne}from"./back-link.js";import{n as r,r as i,t as re}from"./cli-command-panel.js";import{t as ie}from"./input.js";import{M as ae,O as oe}from"./ec2.js";import{v as se}from"./rds.js";import{i as ce}from"./rds2.js";import{a as le,i as ue,t as de}from"./zod.js";import{t as fe}from"./error-banner.js";import{t as pe}from"./form-actions.js";import{t as me}from"./page-heading.js";import{a as he,n as ge,r as _e,t as ve}from"./field.js";import{t as ye}from"./tags-field-array.js";var be=t(),a=e();function xe(e){let t=te(e.Tags),n=[e.CidrBlock,e.AvailabilityZone,t].filter(Boolean);return`${e.SubnetId} (${n.join(`, `)})`}function o(){let e=(0,be.c)(94),t=ee(),r=ce(),{data:i}=n(oe),{data:o}=n(ae),s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=de(se),e[0]=s):s=e[0];let c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={resolver:s,defaultValues:{dbSubnetGroupName:``,dbSubnetGroupDescription:``,subnetIds:[],tags:[]}},e[1]=c):c=e[1];let{control:l,formState:we,handleSubmit:Te,register:u,setValue:Ee}=ue(c),{errors:d,isSubmitting:De}=we,f;e[2]===l?f=e[3]:(f={control:l},e[2]=l,e[3]=f);let p=le(f),m;e[4]===p.subnetIds?m=e[5]:(m=p.subnetIds??[],e[4]=p.subnetIds,e[5]=m);let h=m,g;e[6]===h?g=e[7]:(g=new Set(h),e[6]=h,e[7]=g);let Oe=g,_;e[8]===i.Subnets?_=e[9]:(_=i.Subnets??[],e[8]=i.Subnets,e[9]=_);let v=_,y;e[10]===o.Vpcs?y=e[11]:(y=o.Vpcs??[],e[10]=o.Vpcs,e[11]=y);let ke=y,b;e[12]!==h||e[13]!==v?(b=v.find(e=>e.SubnetId===h[0])?.VpcId,e[12]=h,e[13]=v,e[14]=b):b=e[14];let x=b,S;e[15]===v?S=e[16]:(S=new Set(v.map(Se).filter(Boolean)),e[15]=v,e[16]=S);let C;e[17]===S?C=e[18]:(C=[...S],e[17]=S,e[18]=C);let Ae=C,w;e[19]!==h||e[20]!==Ee?(w=e=>{let t=h.includes(e)?h.filter(t=>t!==e):[...h,e];Ee(`subnetIds`,t,{shouldValidate:!0})},e[19]=h,e[20]=Ee,e[21]=w):w=e[21];let je=w,T;e[22]!==r||e[23]!==t?(T=async e=>{await r.mutateAsync(e),await t({to:`/rds/describe-db-subnet-groups`})},e[22]=r,e[23]=t,e[24]=T):T=e[24];let E=T,D,O;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,a.jsx)(ne,{to:`/rds/describe-db-subnet-groups`,children:`Back to subnet groups`}),O=(0,a.jsx)(me,{title:`Create DB Subnet Group`}),e[25]=D,e[26]=O):(D=e[25],O=e[26]);let k;e[27]===r.error?k=e[28]:(k=r.error&&(0,a.jsx)(fe,{error:r.error,msg:`Failed to create the DB subnet group`}),e[27]=r.error,e[28]=k);let A;e[29]!==Te||e[30]!==E?(A=Te(E),e[29]=Te,e[30]=E,e[31]=A):A=e[31];let j;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,a.jsx)(he,{children:(0,a.jsx)(`label`,{htmlFor:`subnet-group-name`,children:`Name`})}),e[32]=j):j=e[32];let Me=!!d.dbSubnetGroupName,M;e[33]===u?M=e[34]:(M=u(`dbSubnetGroupName`),e[33]=u,e[34]=M);let N;e[35]!==Me||e[36]!==M?(N=(0,a.jsx)(ie,{"aria-invalid":Me,id:`subnet-group-name`,placeholder:`orders-db-subnets`,...M}),e[35]=Me,e[36]=M,e[37]=N):N=e[37];let P;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,a.jsx)(ge,{children:`Letters, digits and hyphens, starting with a letter. The name cannot be changed later, and there is no ModifyDBSubnetGroup — editing a group means deleting and recreating it.`}),e[38]=P):P=e[38];let F;e[39]===d.dbSubnetGroupName?F=e[40]:(F=(0,a.jsx)(_e,{errors:[d.dbSubnetGroupName]}),e[39]=d.dbSubnetGroupName,e[40]=F);let I;e[41]!==N||e[42]!==F?(I=(0,a.jsxs)(ve,{children:[j,N,P,F]}),e[41]=N,e[42]=F,e[43]=I):I=e[43];let L;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,a.jsx)(he,{children:(0,a.jsx)(`label`,{htmlFor:`subnet-group-description`,children:`Description`})}),e[44]=L):L=e[44];let Ne=!!d.dbSubnetGroupDescription,R;e[45]===u?R=e[46]:(R=u(`dbSubnetGroupDescription`),e[45]=u,e[46]=R);let z;e[47]!==Ne||e[48]!==R?(z=(0,a.jsx)(ie,{"aria-invalid":Ne,id:`subnet-group-description`,placeholder:`Private subnets for the orders database`,...R}),e[47]=Ne,e[48]=R,e[49]=z):z=e[49];let B;e[50]===d.dbSubnetGroupDescription?B=e[51]:(B=(0,a.jsx)(_e,{errors:[d.dbSubnetGroupDescription]}),e[50]=d.dbSubnetGroupDescription,e[51]=B);let V;e[52]!==z||e[53]!==B?(V=(0,a.jsxs)(ve,{children:[L,z,B]}),e[52]=z,e[53]=B,e[54]=V):V=e[54];let H;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,a.jsx)(he,{children:`Subnets`}),e[55]=H):H=e[55];let U;e[56]!==x||e[57]!==Oe||e[58]!==v||e[59]!==je||e[60]!==Ae||e[61]!==ke?(U=v.length===0?(0,a.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No subnets in this account. Create one before creating a subnet group.`}):(0,a.jsx)(`div`,{className:`space-y-4`,children:Ae.map(e=>{let t=te(ke.find(t=>t.VpcId===e)?.Tags),n=x!==void 0&&x!==e;return(0,a.jsxs)(`div`,{children:[(0,a.jsxs)(`p`,{className:`mb-1 font-mono text-xs text-muted-foreground`,children:[e,t&&` (${t})`,n&&` — a subnet group must span one VPC, so this one is out of reach`]}),(0,a.jsx)(`div`,{className:`space-y-1 pl-3`,children:v.filter(t=>t.VpcId===e).map(e=>(0,a.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,a.jsx)(`input`,{"aria-label":`Subnet ${xe(e)}`,checked:Oe.has(e.SubnetId??``),disabled:n,onChange:()=>{je(e.SubnetId??``)},type:`checkbox`}),(0,a.jsx)(`span`,{className:`font-mono`,children:xe(e)})]},e.SubnetId))})]},e)})}),e[56]=x,e[57]=Oe,e[58]=v,e[59]=je,e[60]=Ae,e[61]=ke,e[62]=U):U=e[62];let W;e[63]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,a.jsxs)(ge,{children:[`At most `,20,` subnets, all in one VPC. This platform is single-AZ, so the two-AZ rule AWS enforces does not apply here.`]}),e[63]=W):W=e[63];let G;e[64]===d.subnetIds?G=e[65]:(G=(0,a.jsx)(_e,{errors:[d.subnetIds]}),e[64]=d.subnetIds,e[65]=G);let K;e[66]!==U||e[67]!==G?(K=(0,a.jsxs)(ve,{children:[H,U,W,G]}),e[66]=U,e[67]=G,e[68]=K):K=e[68];let q;e[69]===l?q=e[70]:(q=(0,a.jsx)(ye,{control:l,name:`tags`}),e[69]=l,e[70]=q);let Pe=p.dbSubnetGroupName??``,Fe=p.dbSubnetGroupDescription??``,J;e[71]!==h||e[72]!==Pe||e[73]!==Fe?(J=Ce({dbSubnetGroupName:Pe,dbSubnetGroupDescription:Fe,subnetIds:h}),e[71]=h,e[72]=Pe,e[73]=Fe,e[74]=J):J=e[74];let Y;e[75]===J?Y=e[76]:(Y=(0,a.jsx)(re,{commands:J}),e[75]=J,e[76]=Y);let X;e[77]===t?X=e[78]:(X=async()=>{await t({to:`/rds/describe-db-subnet-groups`})},e[77]=t,e[78]=X);let Z;e[79]!==r.isPending||e[80]!==De||e[81]!==X?(Z=(0,a.jsx)(pe,{isPending:r.isPending,isSubmitting:De,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Subnet Group`}),e[79]=r.isPending,e[80]=De,e[81]=X,e[82]=Z):Z=e[82];let Q;e[83]!==A||e[84]!==I||e[85]!==V||e[86]!==K||e[87]!==q||e[88]!==Y||e[89]!==Z?(Q=(0,a.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,V,K,q,Y,Z]}),e[83]=A,e[84]=I,e[85]=V,e[86]=K,e[87]=q,e[88]=Y,e[89]=Z,e[90]=Q):Q=e[90];let $;return e[91]!==k||e[92]!==Q?($=(0,a.jsxs)(a.Fragment,{children:[D,O,k,Q]}),e[91]=k,e[92]=Q,e[93]=$):$=e[93],$}function Se(e){return e.VpcId??``}function Ce(e){return[{label:`Create DB Subnet Group`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws rds create-db-subnet-group`},...i(`--db-subnet-group-name`,r(e.dbSubnetGroupName,`DBSubnetGroupName`)),...i(`--db-subnet-group-description`,`"${r(e.dbSubnetGroupDescription,`DBSubnetGroupDescription`)}"`),...i(`--subnet-ids`,r(e.subnetIds.join(` `),`SubnetIds`))]}]}var s=o;export{s as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-group.js b/spinifex/services/spinifexui/frontend/dist/assets/create-group.js index 408db1aa9..dc8085f99 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-group.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-group.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{s as o}from"./iam.js";import{a as s,i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,r as m,t as h}from"./field.js";import{n as g}from"./iam3.js";var _=t(),v=e();function y(){let e=(0,_.c)(53),t=n(),y=o(),x;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(x={resolver:l(g)},e[0]=x):x=e[0];let{handleSubmit:S,register:C,control:w,formState:T}=c(x),{errors:E,isSubmitting:D}=T,O;e[1]===w?O=e[2]:(O={control:w},e[1]=w,e[2]=O);let k=s(O),A;e[3]!==y||e[4]!==t?(A=async e=>{await y.mutateAsync(e),t({to:`/iam/list-groups`})},e[3]=y,e[4]=t,e[5]=A):A=e[5];let j=A,M,N;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,v.jsx)(r,{to:`/iam/list-groups`,children:`Back to groups`}),N=(0,v.jsx)(f,{title:`Create Group`}),e[6]=M,e[7]=N):(M=e[6],N=e[7]);let P;e[8]===y.error?P=e[9]:(P=y.error&&(0,v.jsx)(u,{error:y.error,msg:`Failed to create group`}),e[8]=y.error,e[9]=P);let F;e[10]!==S||e[11]!==j?(F=S(j),e[10]=S,e[11]=j,e[12]=F):F=e[12];let I;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),e[13]=I):I=e[13];let L=!!E.groupName,R;e[14]===C?R=e[15]:(R=C(`groupName`),e[14]=C,e[15]=R);let z;e[16]!==R||e[17]!==L?(z=(0,v.jsx)(a,{"aria-invalid":L,id:`groupName`,placeholder:`my-group...`,...R}),e[16]=R,e[17]=L,e[18]=z):z=e[18];let B;e[19]===E.groupName?B=e[20]:(B=(0,v.jsx)(m,{errors:[E.groupName]}),e[19]=E.groupName,e[20]=B);let V;e[21]!==z||e[22]!==B?(V=(0,v.jsxs)(h,{children:[I,z,B]}),e[21]=z,e[22]=B,e[23]=V):V=e[23];let H;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`path`,children:`Path (optional)`})}),e[24]=H):H=e[24];let U;e[25]===C?U=e[26]:(U=C(`path`),e[25]=C,e[26]=U);let W;e[27]===U?W=e[28]:(W=(0,v.jsx)(a,{id:`path`,placeholder:`/`,...U}),e[27]=U,e[28]=W);let G;e[29]===E.path?G=e[30]:(G=(0,v.jsx)(m,{errors:[E.path]}),e[29]=E.path,e[30]=G);let K;e[31]!==W||e[32]!==G?(K=(0,v.jsxs)(h,{children:[H,W,G]}),e[31]=W,e[32]=G,e[33]=K):K=e[33];let q;e[34]===k?q=e[35]:(q=b(k),e[34]=k,e[35]=q);let J;e[36]===q?J=e[37]:(J=(0,v.jsx)(i,{commands:q}),e[36]=q,e[37]=J);let Y;e[38]===t?Y=e[39]:(Y=async()=>await t({to:`/iam/list-groups`}),e[38]=t,e[39]=Y);let X;e[40]!==y.isPending||e[41]!==D||e[42]!==Y?(X=(0,v.jsx)(d,{isPending:y.isPending,isSubmitting:D,onCancel:Y,pendingLabel:`Creating...`,submitLabel:`Create Group`}),e[40]=y.isPending,e[41]=D,e[42]=Y,e[43]=X):X=e[43];let Z;e[44]!==V||e[45]!==K||e[46]!==J||e[47]!==X||e[48]!==F?(Z=(0,v.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[V,K,J,X]}),e[44]=V,e[45]=K,e[46]=J,e[47]=X,e[48]=F,e[49]=Z):Z=e[49];let Q;return e[50]!==Z||e[51]!==P?(Q=(0,v.jsxs)(v.Fragment,{children:[M,N,P,Z]}),e[50]=Z,e[51]=P,e[52]=Q):Q=e[52],Q}function b(e){let t=e.groupName??``,n=e.path??``,r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-group`},{type:`flag`,value:` --group-name`},{type:`value`,value:` ${t||``}`}];return n&&n!==`/`&&r.push({type:`flag`,value:` --path`},{type:`value`,value:` ${n}`}),[{label:`Create Group`,parts:r}]}export{y as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{s as o}from"./iam.js";import{a as s,i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,r as m,t as h}from"./field.js";import{n as g}from"./iam3.js";var _=t(),v=e();function y(){let e=(0,_.c)(53),t=n(),y=o(),x;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(x={resolver:l(g)},e[0]=x):x=e[0];let{handleSubmit:S,register:C,control:w,formState:T}=c(x),{errors:E,isSubmitting:D}=T,O;e[1]===w?O=e[2]:(O={control:w},e[1]=w,e[2]=O);let k=s(O),A;e[3]!==y||e[4]!==t?(A=async e=>{await y.mutateAsync(e),t({to:`/iam/list-groups`})},e[3]=y,e[4]=t,e[5]=A):A=e[5];let j=A,M,N;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,v.jsx)(r,{to:`/iam/list-groups`,children:`Back to groups`}),N=(0,v.jsx)(f,{title:`Create Group`}),e[6]=M,e[7]=N):(M=e[6],N=e[7]);let P;e[8]===y.error?P=e[9]:(P=y.error&&(0,v.jsx)(u,{error:y.error,msg:`Failed to create group`}),e[8]=y.error,e[9]=P);let F;e[10]!==S||e[11]!==j?(F=S(j),e[10]=S,e[11]=j,e[12]=F):F=e[12];let I;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),e[13]=I):I=e[13];let L=!!E.groupName,R;e[14]===C?R=e[15]:(R=C(`groupName`),e[14]=C,e[15]=R);let z;e[16]!==R||e[17]!==L?(z=(0,v.jsx)(a,{"aria-invalid":L,id:`groupName`,placeholder:`my-group...`,...R}),e[16]=R,e[17]=L,e[18]=z):z=e[18];let B;e[19]===E.groupName?B=e[20]:(B=(0,v.jsx)(m,{errors:[E.groupName]}),e[19]=E.groupName,e[20]=B);let V;e[21]!==z||e[22]!==B?(V=(0,v.jsxs)(h,{children:[I,z,B]}),e[21]=z,e[22]=B,e[23]=V):V=e[23];let H;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`path`,children:`Path (optional)`})}),e[24]=H):H=e[24];let U;e[25]===C?U=e[26]:(U=C(`path`),e[25]=C,e[26]=U);let W;e[27]===U?W=e[28]:(W=(0,v.jsx)(a,{id:`path`,placeholder:`/`,...U}),e[27]=U,e[28]=W);let G;e[29]===E.path?G=e[30]:(G=(0,v.jsx)(m,{errors:[E.path]}),e[29]=E.path,e[30]=G);let K;e[31]!==W||e[32]!==G?(K=(0,v.jsxs)(h,{children:[H,W,G]}),e[31]=W,e[32]=G,e[33]=K):K=e[33];let q;e[34]===k?q=e[35]:(q=b(k),e[34]=k,e[35]=q);let J;e[36]===q?J=e[37]:(J=(0,v.jsx)(i,{commands:q}),e[36]=q,e[37]=J);let Y;e[38]===t?Y=e[39]:(Y=async()=>{await t({to:`/iam/list-groups`})},e[38]=t,e[39]=Y);let X;e[40]!==y.isPending||e[41]!==D||e[42]!==Y?(X=(0,v.jsx)(d,{isPending:y.isPending,isSubmitting:D,onCancel:Y,pendingLabel:`Creating...`,submitLabel:`Create Group`}),e[40]=y.isPending,e[41]=D,e[42]=Y,e[43]=X):X=e[43];let Z;e[44]!==V||e[45]!==K||e[46]!==J||e[47]!==X||e[48]!==F?(Z=(0,v.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[V,K,J,X]}),e[44]=V,e[45]=K,e[46]=J,e[47]=X,e[48]=F,e[49]=Z):Z=e[49];let Q;return e[50]!==Z||e[51]!==P?(Q=(0,v.jsxs)(v.Fragment,{children:[M,N,P,Z]}),e[50]=Z,e[51]=P,e[52]=Q):Q=e[52],Q}function b(e){let t=e.groupName??``,n=e.path??``,r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-group`},{type:`flag`,value:` --group-name`},{type:`value`,value:` ${t||``}`}];return n&&n!==`/`&&r.push({type:`flag`,value:` --path`},{type:`value`,value:` ${n}`}),[{label:`Create Group`,parts:r}]}export{y as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-instance-profile.js b/spinifex/services/spinifexui/frontend/dist/assets/create-instance-profile.js index b5aeaaf5d..b62ef6f4e 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-instance-profile.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-instance-profile.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{c as o}from"./iam.js";import{a as s,i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,r as m,t as h}from"./field.js";import{r as g}from"./iam3.js";var _=t(),v=e();function y(){let e=(0,_.c)(53),t=n(),y=o(),x;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(x={resolver:l(g)},e[0]=x):x=e[0];let{handleSubmit:S,register:C,control:w,formState:T}=c(x),{errors:E,isSubmitting:D}=T,O;e[1]===w?O=e[2]:(O={control:w},e[1]=w,e[2]=O);let k=s(O),A;e[3]!==y||e[4]!==t?(A=async e=>{await y.mutateAsync(e),t({to:`/iam/list-instance-profiles`})},e[3]=y,e[4]=t,e[5]=A):A=e[5];let j=A,M,N;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,v.jsx)(r,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),N=(0,v.jsx)(f,{title:`Create Instance Profile`}),e[6]=M,e[7]=N):(M=e[6],N=e[7]);let P;e[8]===y.error?P=e[9]:(P=y.error&&(0,v.jsx)(u,{error:y.error,msg:`Failed to create instance profile`}),e[8]=y.error,e[9]=P);let F;e[10]!==S||e[11]!==j?(F=S(j),e[10]=S,e[11]=j,e[12]=F):F=e[12];let I;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`instanceProfileName`,children:`Instance Profile Name`})}),e[13]=I):I=e[13];let L=!!E.instanceProfileName,R;e[14]===C?R=e[15]:(R=C(`instanceProfileName`),e[14]=C,e[15]=R);let z;e[16]!==R||e[17]!==L?(z=(0,v.jsx)(a,{"aria-invalid":L,id:`instanceProfileName`,placeholder:`my-instance-profile...`,...R}),e[16]=R,e[17]=L,e[18]=z):z=e[18];let B;e[19]===E.instanceProfileName?B=e[20]:(B=(0,v.jsx)(m,{errors:[E.instanceProfileName]}),e[19]=E.instanceProfileName,e[20]=B);let V;e[21]!==z||e[22]!==B?(V=(0,v.jsxs)(h,{children:[I,z,B]}),e[21]=z,e[22]=B,e[23]=V):V=e[23];let H;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`path`,children:`Path (optional)`})}),e[24]=H):H=e[24];let U;e[25]===C?U=e[26]:(U=C(`path`),e[25]=C,e[26]=U);let W;e[27]===U?W=e[28]:(W=(0,v.jsx)(a,{id:`path`,placeholder:`/`,...U}),e[27]=U,e[28]=W);let G;e[29]===E.path?G=e[30]:(G=(0,v.jsx)(m,{errors:[E.path]}),e[29]=E.path,e[30]=G);let K;e[31]!==W||e[32]!==G?(K=(0,v.jsxs)(h,{children:[H,W,G]}),e[31]=W,e[32]=G,e[33]=K):K=e[33];let q;e[34]===k?q=e[35]:(q=b(k),e[34]=k,e[35]=q);let J;e[36]===q?J=e[37]:(J=(0,v.jsx)(i,{commands:q}),e[36]=q,e[37]=J);let Y;e[38]===t?Y=e[39]:(Y=async()=>await t({to:`/iam/list-instance-profiles`}),e[38]=t,e[39]=Y);let X;e[40]!==y.isPending||e[41]!==D||e[42]!==Y?(X=(0,v.jsx)(d,{isPending:y.isPending,isSubmitting:D,onCancel:Y,pendingLabel:`Creating...`,submitLabel:`Create Instance Profile`}),e[40]=y.isPending,e[41]=D,e[42]=Y,e[43]=X):X=e[43];let Z;e[44]!==V||e[45]!==K||e[46]!==J||e[47]!==X||e[48]!==F?(Z=(0,v.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[V,K,J,X]}),e[44]=V,e[45]=K,e[46]=J,e[47]=X,e[48]=F,e[49]=Z):Z=e[49];let Q;return e[50]!==Z||e[51]!==P?(Q=(0,v.jsxs)(v.Fragment,{children:[M,N,P,Z]}),e[50]=Z,e[51]=P,e[52]=Q):Q=e[52],Q}function b(e){let t=e.instanceProfileName??``,n=e.path??``,r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-instance-profile`},{type:`flag`,value:` --instance-profile-name`},{type:`value`,value:` ${t||``}`}];return n&&n!==`/`&&r.push({type:`flag`,value:` --path`},{type:`value`,value:` ${n}`}),[{label:`Create Instance Profile`,parts:r}]}export{y as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{c as o}from"./iam.js";import{a as s,i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,r as m,t as h}from"./field.js";import{r as g}from"./iam3.js";var _=t(),v=e();function y(){let e=(0,_.c)(53),t=n(),y=o(),x;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(x={resolver:l(g)},e[0]=x):x=e[0];let{handleSubmit:S,register:C,control:w,formState:T}=c(x),{errors:E,isSubmitting:D}=T,O;e[1]===w?O=e[2]:(O={control:w},e[1]=w,e[2]=O);let k=s(O),A;e[3]!==y||e[4]!==t?(A=async e=>{await y.mutateAsync(e),t({to:`/iam/list-instance-profiles`})},e[3]=y,e[4]=t,e[5]=A):A=e[5];let j=A,M,N;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,v.jsx)(r,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),N=(0,v.jsx)(f,{title:`Create Instance Profile`}),e[6]=M,e[7]=N):(M=e[6],N=e[7]);let P;e[8]===y.error?P=e[9]:(P=y.error&&(0,v.jsx)(u,{error:y.error,msg:`Failed to create instance profile`}),e[8]=y.error,e[9]=P);let F;e[10]!==S||e[11]!==j?(F=S(j),e[10]=S,e[11]=j,e[12]=F):F=e[12];let I;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`instanceProfileName`,children:`Instance Profile Name`})}),e[13]=I):I=e[13];let L=!!E.instanceProfileName,R;e[14]===C?R=e[15]:(R=C(`instanceProfileName`),e[14]=C,e[15]=R);let z;e[16]!==R||e[17]!==L?(z=(0,v.jsx)(a,{"aria-invalid":L,id:`instanceProfileName`,placeholder:`my-instance-profile...`,...R}),e[16]=R,e[17]=L,e[18]=z):z=e[18];let B;e[19]===E.instanceProfileName?B=e[20]:(B=(0,v.jsx)(m,{errors:[E.instanceProfileName]}),e[19]=E.instanceProfileName,e[20]=B);let V;e[21]!==z||e[22]!==B?(V=(0,v.jsxs)(h,{children:[I,z,B]}),e[21]=z,e[22]=B,e[23]=V):V=e[23];let H;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`path`,children:`Path (optional)`})}),e[24]=H):H=e[24];let U;e[25]===C?U=e[26]:(U=C(`path`),e[25]=C,e[26]=U);let W;e[27]===U?W=e[28]:(W=(0,v.jsx)(a,{id:`path`,placeholder:`/`,...U}),e[27]=U,e[28]=W);let G;e[29]===E.path?G=e[30]:(G=(0,v.jsx)(m,{errors:[E.path]}),e[29]=E.path,e[30]=G);let K;e[31]!==W||e[32]!==G?(K=(0,v.jsxs)(h,{children:[H,W,G]}),e[31]=W,e[32]=G,e[33]=K):K=e[33];let q;e[34]===k?q=e[35]:(q=b(k),e[34]=k,e[35]=q);let J;e[36]===q?J=e[37]:(J=(0,v.jsx)(i,{commands:q}),e[36]=q,e[37]=J);let Y;e[38]===t?Y=e[39]:(Y=async()=>{await t({to:`/iam/list-instance-profiles`})},e[38]=t,e[39]=Y);let X;e[40]!==y.isPending||e[41]!==D||e[42]!==Y?(X=(0,v.jsx)(d,{isPending:y.isPending,isSubmitting:D,onCancel:Y,pendingLabel:`Creating...`,submitLabel:`Create Instance Profile`}),e[40]=y.isPending,e[41]=D,e[42]=Y,e[43]=X):X=e[43];let Z;e[44]!==V||e[45]!==K||e[46]!==J||e[47]!==X||e[48]!==F?(Z=(0,v.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[V,K,J,X]}),e[44]=V,e[45]=K,e[46]=J,e[47]=X,e[48]=F,e[49]=Z):Z=e[49];let Q;return e[50]!==Z||e[51]!==P?(Q=(0,v.jsxs)(v.Fragment,{children:[M,N,P,Z]}),e[50]=Z,e[51]=P,e[52]=Q):Q=e[52],Q}function b(e){let t=e.instanceProfileName??``,n=e.path??``,r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-instance-profile`},{type:`flag`,value:` --instance-profile-name`},{type:`value`,value:` ${t||``}`}];return n&&n!==`/`&&r.push({type:`flag`,value:` --path`},{type:`value`,value:` ${n}`}),[{label:`Create Instance Profile`,parts:r}]}export{y as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-internet-gateway.js b/spinifex/services/spinifexui/frontend/dist/assets/create-internet-gateway.js index 6784930bf..17f5e75d0 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-internet-gateway.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-internet-gateway.js @@ -1,2 +1,2 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{p as o}from"./ec22.js";import{a as s,i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,t as m}from"./field.js";import{a as h}from"./ec23.js";var g=t(),_=e();function v(){let e=(0,g.c)(36),t=n(),v=o(),b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:l(h),defaultValues:{name:``}},e[0]=b):b=e[0];let{control:x,handleSubmit:S,register:C,formState:w}=c(b),{isSubmitting:T}=w,E;e[1]===x?E=e[2]:(E={control:x},e[1]=x,e[2]=E);let D=s(E),O;e[3]!==v||e[4]!==t?(O=async e=>{let n=(await v.mutateAsync({name:e.name?.trim()??void 0})).InternetGateway?.InternetGatewayId;t(n?{to:`/ec2/describe-internet-gateways/$id`,params:{id:n}}:{to:`/ec2/describe-internet-gateways`})},e[3]=v,e[4]=t,e[5]=O):O=e[5];let k=O,A,j;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,_.jsx)(r,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),j=(0,_.jsx)(f,{title:`Create Internet Gateway`}),e[6]=A,e[7]=j):(A=e[6],j=e[7]);let M;e[8]===v.error?M=e[9]:(M=v.error&&(0,_.jsx)(u,{error:v.error,msg:`Failed to create Internet Gateway`}),e[8]=v.error,e[9]=M);let N;e[10]!==S||e[11]!==k?(N=S(k),e[10]=S,e[11]=k,e[12]=N):N=e[12];let P;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,_.jsx)(p,{children:(0,_.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),e[13]=P):P=e[13];let F;e[14]===C?F=e[15]:(F=C(`name`),e[14]=C,e[15]=F);let I;e[16]===F?I=e[17]:(I=(0,_.jsxs)(m,{children:[P,(0,_.jsx)(a,{id:`name`,placeholder:`my-internet-gateway`,...F})]}),e[16]=F,e[17]=I);let L=D.name??``,R;e[18]===L?R=e[19]:(R=y(L),e[18]=L,e[19]=R);let z;e[20]===R?z=e[21]:(z=(0,_.jsx)(i,{commands:R}),e[20]=R,e[21]=z);let B;e[22]===t?B=e[23]:(B=async()=>await t({to:`/ec2/describe-internet-gateways`}),e[22]=t,e[23]=B);let V;e[24]!==v.isPending||e[25]!==T||e[26]!==B?(V=(0,_.jsx)(d,{isPending:v.isPending,isSubmitting:T,onCancel:B,pendingLabel:`Creating…`,submitLabel:`Create`}),e[24]=v.isPending,e[25]=T,e[26]=B,e[27]=V):V=e[27];let H;e[28]!==I||e[29]!==z||e[30]!==V||e[31]!==N?(H=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:N,children:[I,z,V]}),e[28]=I,e[29]=z,e[30]=V,e[31]=N,e[32]=H):H=e[32];let U;return e[33]!==H||e[34]!==M?(U=(0,_.jsxs)(_.Fragment,{children:[A,j,M,H]}),e[33]=H,e[34]=M,e[35]=U):U=e[35],U}function y(e){let t=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-internet-gateway`}];return e.trim()&&t.push({type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{p as o}from"./ec22.js";import{a as s,i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,t as m}from"./field.js";import{a as h}from"./ec23.js";var g=t(),_=e();function v(){let e=(0,g.c)(36),t=n(),v=o(),b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:l(h),defaultValues:{name:``}},e[0]=b):b=e[0];let{control:x,handleSubmit:S,register:C,formState:w}=c(b),{isSubmitting:T}=w,E;e[1]===x?E=e[2]:(E={control:x},e[1]=x,e[2]=E);let D=s(E),O;e[3]!==v||e[4]!==t?(O=async e=>{let n=(await v.mutateAsync({name:e.name?.trim()??void 0})).InternetGateway?.InternetGatewayId;t(n?{to:`/ec2/describe-internet-gateways/$id`,params:{id:n}}:{to:`/ec2/describe-internet-gateways`})},e[3]=v,e[4]=t,e[5]=O):O=e[5];let k=O,A,j;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,_.jsx)(r,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),j=(0,_.jsx)(f,{title:`Create Internet Gateway`}),e[6]=A,e[7]=j):(A=e[6],j=e[7]);let M;e[8]===v.error?M=e[9]:(M=v.error&&(0,_.jsx)(u,{error:v.error,msg:`Failed to create Internet Gateway`}),e[8]=v.error,e[9]=M);let N;e[10]!==S||e[11]!==k?(N=S(k),e[10]=S,e[11]=k,e[12]=N):N=e[12];let P;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,_.jsx)(p,{children:(0,_.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),e[13]=P):P=e[13];let F;e[14]===C?F=e[15]:(F=C(`name`),e[14]=C,e[15]=F);let I;e[16]===F?I=e[17]:(I=(0,_.jsxs)(m,{children:[P,(0,_.jsx)(a,{id:`name`,placeholder:`my-internet-gateway`,...F})]}),e[16]=F,e[17]=I);let L=D.name??``,R;e[18]===L?R=e[19]:(R=y(L),e[18]=L,e[19]=R);let z;e[20]===R?z=e[21]:(z=(0,_.jsx)(i,{commands:R}),e[20]=R,e[21]=z);let B;e[22]===t?B=e[23]:(B=async()=>{await t({to:`/ec2/describe-internet-gateways`})},e[22]=t,e[23]=B);let V;e[24]!==v.isPending||e[25]!==T||e[26]!==B?(V=(0,_.jsx)(d,{isPending:v.isPending,isSubmitting:T,onCancel:B,pendingLabel:`Creating…`,submitLabel:`Create`}),e[24]=v.isPending,e[25]=T,e[26]=B,e[27]=V):V=e[27];let H;e[28]!==I||e[29]!==z||e[30]!==V||e[31]!==N?(H=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:N,children:[I,z,V]}),e[28]=I,e[29]=z,e[30]=V,e[31]=N,e[32]=H):H=e[32];let U;return e[33]!==H||e[34]!==M?(U=(0,_.jsxs)(_.Fragment,{children:[A,j,M,H]}),e[33]=H,e[34]=M,e[35]=U):U=e[35],U}function y(e){let t=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-internet-gateway`}];return e.trim()&&t.push({type:`flag`,value:` \\ --tag-specifications`},{type:`value`,value:` 'ResourceType=internet-gateway,Tags=[{Key=Name,Value=${e.trim()}}]'`}),[{label:`Create Internet Gateway`,parts:t}]}export{v as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-key-pair.js b/spinifex/services/spinifexui/frontend/dist/assets/create-key-pair.js index 27f8b926b..91e658fd8 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-key-pair.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-key-pair.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as ee}from"./useNavigate.js";import{t as i}from"./back-link.js";import{t as te}from"./check.js";import{c as a,i as o,n as ne,s,t as c}from"./select.js";import{t as l}from"./download.js";import{t as u}from"./cli-command-panel.js";import{t as d}from"./triangle-alert.js";import{t as f}from"./button.js";import{t as re}from"./input.js";import{m as p}from"./ec22.js";import{a as m,i as h,n as g,t as _}from"./zod.js";import{t as ie}from"./use-copy-to-clipboard.js";import{t as v}from"./error-banner.js";import{t as y}from"./form-actions.js";import{t as b}from"./page-heading.js";import{a as x,n as S,r as C,t as w}from"./field.js";import{o as T}from"./ec23.js";import{a as E,c as ae,i as D,l as oe,o as O,r as k,s as A,t as j}from"./alert-dialog.js";var M=e(n(),1),se=r(),N=t();function P(e){let t=(0,se.c)(38),{open:n,keyName:r,keyMaterial:i}=e,a=ee(),{copied:o,copy:ne}=ie(),s;t[0]!==i||t[1]!==r?(s=()=>{let e=new Blob([i],{type:`text/plain`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${r}.pem`,n.click(),URL.revokeObjectURL(t)},t[0]=i,t[1]=r,t[2]=s):s=t[2];let c=s,u;t[3]===a?u=t[4]:(u=()=>{a({to:`/ec2/describe-key-pairs`})},t[3]=a,t[4]=u);let re=u,p,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,N.jsx)(ae,{children:(0,N.jsx)(d,{className:`text-destructive`})}),m=(0,N.jsx)(oe,{children:`Save Your Private Key`}),t[5]=p,t[6]=m):(p=t[5],m=t[6]);let h;t[7]===r?h=t[8]:(h=(0,N.jsxs)(A,{children:[p,m,(0,N.jsxs)(E,{children:[`This is your only chance to save the private key file for`,` `,(0,N.jsx)(`strong`,{children:r}),`. Please download or copy it now. You won't be able to retrieve it again.`]})]}),t[7]=r,t[8]=h);let g=`Private key material for ${r}`,_;t[9]!==i||t[10]!==g?(_=(0,N.jsx)(`textarea`,{"aria-label":g,className:`w-full resize-none overflow-y-auto rounded-md border border-input bg-input/20 px-2 py-2 font-mono text-xs`,readOnly:!0,rows:4,value:i}),t[9]=i,t[10]=g,t[11]=_):_=t[11];let v;t[12]!==ne||t[13]!==i?(v=async()=>await ne(i),t[12]=ne,t[13]=i,t[14]=v):v=t[14];let y;t[15]===o?y=t[16]:(y=o?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(te,{className:`mr-2 size-4`}),`Copied!`]}):`Copy to Clipboard`,t[15]=o,t[16]=y);let b;t[17]!==v||t[18]!==y?(b=(0,N.jsx)(f,{className:`flex-1`,onClick:v,type:`button`,variant:`outline`,children:y}),t[17]=v,t[18]=y,t[19]=b):b=t[19];let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,N.jsx)(l,{className:`mr-2 size-4`}),t[20]=x):x=t[20];let S;t[21]===c?S=t[22]:(S=(0,N.jsxs)(f,{className:`flex-1`,onClick:c,type:`button`,variant:`outline`,children:[x,`Download .pem File`]}),t[21]=c,t[22]=S);let C;t[23]!==b||t[24]!==S?(C=(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[b,S]}),t[23]=b,t[24]=S,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==_?(w=(0,N.jsxs)(`div`,{className:`space-y-3`,children:[_,C]}),t[26]=C,t[27]=_,t[28]=w):w=t[28];let T;t[29]===re?T=t[30]:(T=(0,N.jsx)(O,{children:(0,N.jsx)(k,{onClick:re,children:`Close and Continue`})}),t[29]=re,t[30]=T);let M;t[31]!==w||t[32]!==T||t[33]!==h?(M=(0,N.jsxs)(D,{className:`max-w-2xl`,children:[h,w,T]}),t[31]=w,t[32]=T,t[33]=h,t[34]=M):M=t[34];let P;return t[35]!==n||t[36]!==M?(P=(0,N.jsx)(j,{open:n,children:M}),t[35]=n,t[36]=M,t[37]=P):P=t[37],P}function F(){let e=(0,se.c)(58),t=ee(),n=p(),[r,te]=(0,M.useState)(null),l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=_(T),e[0]=l):l=e[0];let d;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(d={resolver:l,defaultValues:{keyType:`rsa`}},e[1]=d):d=e[1];let{handleSubmit:f,register:ie,control:E,formState:ae}=h(d),{errors:D,isSubmitting:oe}=ae,O;e[2]===E?O=e[3]:(O={control:E},e[2]=E,e[3]=O);let k=m(O),A;e[4]===n?A=e[5]:(A=async e=>{let t=await n.mutateAsync(e);t.KeyMaterial&&te({keyName:e.keyName,material:t.KeyMaterial})},e[4]=n,e[5]=A);let j=A,F,I;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,N.jsx)(i,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),I=(0,N.jsx)(b,{title:`Create Key Pair`}),e[6]=F,e[7]=I):(F=e[6],I=e[7]);let L;e[8]===n.error?L=e[9]:(L=n.error&&(0,N.jsx)(v,{error:n.error,msg:`Failed to create key pair`}),e[8]=n.error,e[9]=L);let R;e[10]!==f||e[11]!==j?(R=f(j),e[10]=f,e[11]=j,e[12]=R):R=e[12];let le;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,N.jsx)(x,{children:(0,N.jsx)(`label`,{htmlFor:`keyName`,children:`Key Pair Name`})}),e[13]=le):le=e[13];let ue=!!D.keyName,z;e[14]===ie?z=e[15]:(z=ie(`keyName`),e[14]=ie,e[15]=z);let B;e[16]!==ue||e[17]!==z?(B=(0,N.jsx)(re,{"aria-invalid":ue,id:`keyName`,placeholder:`my-key-pair…`,...z}),e[16]=ue,e[17]=z,e[18]=B):B=e[18];let V;e[19]===D.keyName?V=e[20]:(V=(0,N.jsx)(C,{errors:[D.keyName]}),e[19]=D.keyName,e[20]=V);let H;e[21]!==B||e[22]!==V?(H=(0,N.jsxs)(w,{children:[le,B,V]}),e[21]=B,e[22]=V,e[23]=H):H=e[23];let U;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,N.jsx)(x,{children:(0,N.jsx)(`label`,{htmlFor:`keyType`,children:`Key Type`})}),e[24]=U):U=e[24];let W;e[25]===D.keyType?W=e[26]:(W=e=>{let{field:t}=e;return(0,N.jsxs)(c,{onValueChange:e=>t.onChange(e),value:t.value,children:[(0,N.jsx)(s,{"aria-invalid":!!D.keyType,className:`w-full`,id:`keyType`,children:(0,N.jsx)(a,{placeholder:`Select a key type`})}),(0,N.jsxs)(ne,{children:[(0,N.jsx)(o,{value:`rsa`,children:`RSA (2048-bit)`}),(0,N.jsx)(o,{value:`ed25519`,children:`ED25519`})]})]})},e[25]=D.keyType,e[26]=W);let G;e[27]!==E||e[28]!==W?(G=(0,N.jsx)(g,{control:E,name:`keyType`,render:W}),e[27]=E,e[28]=W,e[29]=G):G=e[29];let de;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,N.jsx)(S,{children:`RSA is required to retrieve a Windows administrator password. ED25519 works for SSH only.`}),e[30]=de):de=e[30];let K;e[31]===D.keyType?K=e[32]:(K=(0,N.jsx)(C,{errors:[D.keyType]}),e[31]=D.keyType,e[32]=K);let q;e[33]!==G||e[34]!==K?(q=(0,N.jsxs)(w,{children:[U,G,de,K]}),e[33]=G,e[34]=K,e[35]=q):q=e[35];let J;e[36]===k?J=e[37]:(J=ce(k),e[36]=k,e[37]=J);let Y;e[38]===J?Y=e[39]:(Y=(0,N.jsx)(u,{commands:J}),e[38]=J,e[39]=Y);let X;e[40]===t?X=e[41]:(X=async()=>await t({to:`/ec2/describe-key-pairs`}),e[40]=t,e[41]=X);let Z;e[42]!==n.isPending||e[43]!==oe||e[44]!==X?(Z=(0,N.jsx)(y,{isPending:n.isPending,isSubmitting:oe,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Key Pair`}),e[42]=n.isPending,e[43]=oe,e[44]=X,e[45]=Z):Z=e[45];let Q;e[46]!==H||e[47]!==q||e[48]!==Y||e[49]!==Z||e[50]!==R?(Q=(0,N.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:R,children:[H,q,Y,Z]}),e[46]=H,e[47]=q,e[48]=Y,e[49]=Z,e[50]=R,e[51]=Q):Q=e[51];let $;e[52]===r?$=e[53]:($=r&&(0,N.jsx)(P,{keyMaterial:r.material,keyName:r.keyName,open:!!r}),e[52]=r,e[53]=$);let fe;return e[54]!==Q||e[55]!==$||e[56]!==L?(fe=(0,N.jsxs)(N.Fragment,{children:[F,I,L,Q,$]}),e[54]=Q,e[55]=$,e[56]=L,e[57]=fe):fe=e[57],fe}function ce(e){let t=e.keyName??``,n=e.keyType??`rsa`;return[{label:`Create Key Pair`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-key-pair`},{type:`flag`,value:` --key-name`},{type:`value`,value:` ${t||``}`},{type:`flag`,value:` --key-type`},{type:`value`,value:` ${n}`}]}]}var I=F;export{I as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as ee}from"./useNavigate.js";import{t as i}from"./back-link.js";import{t as te}from"./check.js";import{c as a,i as o,n as ne,s,t as c}from"./select.js";import{t as l}from"./download.js";import{t as u}from"./cli-command-panel.js";import{t as d}from"./triangle-alert.js";import{t as f}from"./button.js";import{t as re}from"./input.js";import{m as p}from"./ec22.js";import{a as m,i as h,n as g,t as _}from"./zod.js";import{t as ie}from"./use-copy-to-clipboard.js";import{t as v}from"./error-banner.js";import{t as y}from"./form-actions.js";import{t as b}from"./page-heading.js";import{a as x,n as S,r as C,t as w}from"./field.js";import{o as T}from"./ec23.js";import{a as E,c as ae,i as D,l as oe,o as O,r as k,s as A,t as j}from"./alert-dialog.js";var M=e(n(),1),se=r(),N=t();function P(e){let t=(0,se.c)(38),{open:n,keyName:r,keyMaterial:i}=e,a=ee(),{copied:o,copy:ne}=ie(),s;t[0]!==i||t[1]!==r?(s=()=>{let e=new Blob([i],{type:`text/plain`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${r}.pem`,n.click(),URL.revokeObjectURL(t)},t[0]=i,t[1]=r,t[2]=s):s=t[2];let c=s,u;t[3]===a?u=t[4]:(u=()=>{a({to:`/ec2/describe-key-pairs`})},t[3]=a,t[4]=u);let re=u,p,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,N.jsx)(ae,{children:(0,N.jsx)(d,{className:`text-destructive`})}),m=(0,N.jsx)(oe,{children:`Save Your Private Key`}),t[5]=p,t[6]=m):(p=t[5],m=t[6]);let h;t[7]===r?h=t[8]:(h=(0,N.jsxs)(A,{children:[p,m,(0,N.jsxs)(E,{children:[`This is your only chance to save the private key file for`,` `,(0,N.jsx)(`strong`,{children:r}),`. Please download or copy it now. You won't be able to retrieve it again.`]})]}),t[7]=r,t[8]=h);let g=`Private key material for ${r}`,_;t[9]!==i||t[10]!==g?(_=(0,N.jsx)(`textarea`,{"aria-label":g,className:`w-full resize-none overflow-y-auto rounded-md border border-input bg-input/20 px-2 py-2 font-mono text-xs`,readOnly:!0,rows:4,value:i}),t[9]=i,t[10]=g,t[11]=_):_=t[11];let v;t[12]!==ne||t[13]!==i?(v=async()=>{await ne(i)},t[12]=ne,t[13]=i,t[14]=v):v=t[14];let y;t[15]===o?y=t[16]:(y=o?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(te,{className:`mr-2 size-4`}),`Copied!`]}):`Copy to Clipboard`,t[15]=o,t[16]=y);let b;t[17]!==v||t[18]!==y?(b=(0,N.jsx)(f,{className:`flex-1`,onClick:v,type:`button`,variant:`outline`,children:y}),t[17]=v,t[18]=y,t[19]=b):b=t[19];let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,N.jsx)(l,{className:`mr-2 size-4`}),t[20]=x):x=t[20];let S;t[21]===c?S=t[22]:(S=(0,N.jsxs)(f,{className:`flex-1`,onClick:c,type:`button`,variant:`outline`,children:[x,`Download .pem File`]}),t[21]=c,t[22]=S);let C;t[23]!==b||t[24]!==S?(C=(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[b,S]}),t[23]=b,t[24]=S,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==_?(w=(0,N.jsxs)(`div`,{className:`space-y-3`,children:[_,C]}),t[26]=C,t[27]=_,t[28]=w):w=t[28];let T;t[29]===re?T=t[30]:(T=(0,N.jsx)(O,{children:(0,N.jsx)(k,{onClick:re,children:`Close and Continue`})}),t[29]=re,t[30]=T);let M;t[31]!==w||t[32]!==T||t[33]!==h?(M=(0,N.jsxs)(D,{className:`max-w-2xl`,children:[h,w,T]}),t[31]=w,t[32]=T,t[33]=h,t[34]=M):M=t[34];let P;return t[35]!==n||t[36]!==M?(P=(0,N.jsx)(j,{open:n,children:M}),t[35]=n,t[36]=M,t[37]=P):P=t[37],P}function F(){let e=(0,se.c)(58),t=ee(),n=p(),[r,te]=(0,M.useState)(null),l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=_(T),e[0]=l):l=e[0];let d;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(d={resolver:l,defaultValues:{keyType:`rsa`}},e[1]=d):d=e[1];let{handleSubmit:f,register:ie,control:E,formState:ae}=h(d),{errors:D,isSubmitting:oe}=ae,O;e[2]===E?O=e[3]:(O={control:E},e[2]=E,e[3]=O);let k=m(O),A;e[4]===n?A=e[5]:(A=async e=>{let t=await n.mutateAsync(e);t.KeyMaterial&&te({keyName:e.keyName,material:t.KeyMaterial})},e[4]=n,e[5]=A);let j=A,F,I;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,N.jsx)(i,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),I=(0,N.jsx)(b,{title:`Create Key Pair`}),e[6]=F,e[7]=I):(F=e[6],I=e[7]);let L;e[8]===n.error?L=e[9]:(L=n.error&&(0,N.jsx)(v,{error:n.error,msg:`Failed to create key pair`}),e[8]=n.error,e[9]=L);let R;e[10]!==f||e[11]!==j?(R=f(j),e[10]=f,e[11]=j,e[12]=R):R=e[12];let le;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,N.jsx)(x,{children:(0,N.jsx)(`label`,{htmlFor:`keyName`,children:`Key Pair Name`})}),e[13]=le):le=e[13];let ue=!!D.keyName,z;e[14]===ie?z=e[15]:(z=ie(`keyName`),e[14]=ie,e[15]=z);let B;e[16]!==ue||e[17]!==z?(B=(0,N.jsx)(re,{"aria-invalid":ue,id:`keyName`,placeholder:`my-key-pair…`,...z}),e[16]=ue,e[17]=z,e[18]=B):B=e[18];let V;e[19]===D.keyName?V=e[20]:(V=(0,N.jsx)(C,{errors:[D.keyName]}),e[19]=D.keyName,e[20]=V);let H;e[21]!==B||e[22]!==V?(H=(0,N.jsxs)(w,{children:[le,B,V]}),e[21]=B,e[22]=V,e[23]=H):H=e[23];let U;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,N.jsx)(x,{children:(0,N.jsx)(`label`,{htmlFor:`keyType`,children:`Key Type`})}),e[24]=U):U=e[24];let W;e[25]===D.keyType?W=e[26]:(W=e=>{let{field:t}=e;return(0,N.jsxs)(c,{onValueChange:e=>{t.onChange(e)},value:t.value,children:[(0,N.jsx)(s,{"aria-invalid":!!D.keyType,className:`w-full`,id:`keyType`,children:(0,N.jsx)(a,{placeholder:`Select a key type`})}),(0,N.jsxs)(ne,{children:[(0,N.jsx)(o,{value:`rsa`,children:`RSA (2048-bit)`}),(0,N.jsx)(o,{value:`ed25519`,children:`ED25519`})]})]})},e[25]=D.keyType,e[26]=W);let G;e[27]!==E||e[28]!==W?(G=(0,N.jsx)(g,{control:E,name:`keyType`,render:W}),e[27]=E,e[28]=W,e[29]=G):G=e[29];let de;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,N.jsx)(S,{children:`RSA is required to retrieve a Windows administrator password. ED25519 works for SSH only.`}),e[30]=de):de=e[30];let K;e[31]===D.keyType?K=e[32]:(K=(0,N.jsx)(C,{errors:[D.keyType]}),e[31]=D.keyType,e[32]=K);let q;e[33]!==G||e[34]!==K?(q=(0,N.jsxs)(w,{children:[U,G,de,K]}),e[33]=G,e[34]=K,e[35]=q):q=e[35];let J;e[36]===k?J=e[37]:(J=ce(k),e[36]=k,e[37]=J);let Y;e[38]===J?Y=e[39]:(Y=(0,N.jsx)(u,{commands:J}),e[38]=J,e[39]=Y);let X;e[40]===t?X=e[41]:(X=async()=>{await t({to:`/ec2/describe-key-pairs`})},e[40]=t,e[41]=X);let Z;e[42]!==n.isPending||e[43]!==oe||e[44]!==X?(Z=(0,N.jsx)(y,{isPending:n.isPending,isSubmitting:oe,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Key Pair`}),e[42]=n.isPending,e[43]=oe,e[44]=X,e[45]=Z):Z=e[45];let Q;e[46]!==H||e[47]!==q||e[48]!==Y||e[49]!==Z||e[50]!==R?(Q=(0,N.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:R,children:[H,q,Y,Z]}),e[46]=H,e[47]=q,e[48]=Y,e[49]=Z,e[50]=R,e[51]=Q):Q=e[51];let $;e[52]===r?$=e[53]:($=r&&(0,N.jsx)(P,{keyMaterial:r.material,keyName:r.keyName,open:!!r}),e[52]=r,e[53]=$);let fe;return e[54]!==Q||e[55]!==$||e[56]!==L?(fe=(0,N.jsxs)(N.Fragment,{children:[F,I,L,Q,$]}),e[54]=Q,e[55]=$,e[56]=L,e[57]=fe):fe=e[57],fe}function ce(e){let t=e.keyName??``,n=e.keyType??`rsa`;return[{label:`Create Key Pair`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-key-pair`},{type:`flag`,value:` --key-name`},{type:`value`,value:` ${t||``}`},{type:`flag`,value:` --key-type`},{type:`value`,value:` ${n}`}]}]}var I=F;export{I as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-launch-template.js b/spinifex/services/spinifexui/frontend/dist/assets/create-launch-template.js index 3267dd7cc..7f143c4cb 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-launch-template.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-launch-template.js @@ -1,4 +1,4 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{h as o,t as s}from"./ec22.js";import{a as c,i as l,t as u}from"./zod.js";import{t as ee}from"./error-banner.js";import{t as te}from"./form-actions.js";import{t as ne}from"./page-heading.js";import{a as d,r as f,t as p}from"./field.js";import{s as m}from"./ec23.js";import{t as h}from"./launch-template-data-fields.js";var g=t(),_=e();function v(){let e=(0,g.c)(56),t=n(),v=o(),y;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=u(m),e[0]=y):y=e[0];let x;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(x={resolver:y,defaultValues:{launchTemplateName:``,versionDescription:``,imageId:``,instanceType:``,securityGroupIds:[],userData:``}},e[1]=x):x=e[1];let{control:S,handleSubmit:C,register:w,formState:T}=l(x),{errors:E,isSubmitting:D}=T,O;e[2]===S?O=e[3]:(O={control:S},e[2]=S,e[3]=O);let k=c(O),A;e[4]!==v||e[5]!==t?(A=async e=>{let n=(await v.mutateAsync(e)).LaunchTemplate?.LaunchTemplateId;if(!n){t({to:`/ec2/describe-launch-templates`});return}t({to:`/ec2/describe-launch-templates/$id`,params:{id:n}})},e[4]=v,e[5]=t,e[6]=A):A=e[6];let j=A,M,N;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,_.jsx)(r,{to:`/ec2/describe-launch-templates`,children:`Back to launch templates`}),N=(0,_.jsx)(ne,{title:`Create Launch Template`}),e[7]=M,e[8]=N):(M=e[7],N=e[8]);let P;e[9]===v.error?P=e[10]:(P=v.error&&(0,_.jsx)(ee,{error:v.error,msg:`Failed to create launch template`}),e[9]=v.error,e[10]=P);let F;e[11]!==C||e[12]!==j?(F=C(j),e[11]=C,e[12]=j,e[13]=F):F=e[13];let I;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,_.jsx)(d,{children:(0,_.jsx)(`label`,{htmlFor:`launchTemplateName`,children:`Name`})}),e[14]=I):I=e[14];let L=!!E.launchTemplateName,R;e[15]===w?R=e[16]:(R=w(`launchTemplateName`),e[15]=w,e[16]=R);let z;e[17]!==L||e[18]!==R?(z=(0,_.jsx)(a,{"aria-invalid":L,id:`launchTemplateName`,placeholder:`my-launch-template`,...R}),e[17]=L,e[18]=R,e[19]=z):z=e[19];let B;e[20]===E.launchTemplateName?B=e[21]:(B=(0,_.jsx)(f,{errors:[E.launchTemplateName]}),e[20]=E.launchTemplateName,e[21]=B);let V;e[22]!==z||e[23]!==B?(V=(0,_.jsxs)(p,{children:[I,z,B]}),e[22]=z,e[23]=B,e[24]=V):V=e[24];let H;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,_.jsx)(d,{children:(0,_.jsx)(`label`,{htmlFor:`versionDescription`,children:`Version Description`})}),e[25]=H):H=e[25];let U;e[26]===w?U=e[27]:(U=w(`versionDescription`),e[26]=w,e[27]=U);let W;e[28]===U?W=e[29]:(W=(0,_.jsxs)(p,{children:[H,(0,_.jsx)(a,{id:`versionDescription`,placeholder:`Initial version`,...U})]}),e[28]=U,e[29]=W);let G;e[30]!==S||e[31]!==E||e[32]!==w?(G=(0,_.jsx)(h,{control:S,errors:E,register:w}),e[30]=S,e[31]=E,e[32]=w,e[33]=G):G=e[33];let K=k.launchTemplateName??``,q=k.versionDescription??``,J;e[34]!==K||e[35]!==q||e[36]!==k?(J=b(K,q,s(k)),e[34]=K,e[35]=q,e[36]=k,e[37]=J):J=e[37];let Y;e[38]===J?Y=e[39]:(Y=(0,_.jsx)(i,{commands:J}),e[38]=J,e[39]=Y);let X;e[40]===t?X=e[41]:(X=async()=>await t({to:`/ec2/describe-launch-templates`}),e[40]=t,e[41]=X);let Z;e[42]!==v.isPending||e[43]!==D||e[44]!==X?(Z=(0,_.jsx)(te,{isPending:v.isPending,isSubmitting:D,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Launch Template`}),e[42]=v.isPending,e[43]=D,e[44]=X,e[45]=Z):Z=e[45];let Q;e[46]!==V||e[47]!==W||e[48]!==G||e[49]!==Y||e[50]!==Z||e[51]!==F?(Q=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[V,W,G,Y,Z]}),e[46]=V,e[47]=W,e[48]=G,e[49]=Y,e[50]=Z,e[51]=F,e[52]=Q):Q=e[52];let $;return e[53]!==Q||e[54]!==P?($=(0,_.jsxs)(_.Fragment,{children:[M,N,P,Q]}),e[53]=Q,e[54]=P,e[55]=$):$=e[55],$}function y(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function b(e,t,n){let r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-launch-template`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{h as o,t as s}from"./ec22.js";import{a as c,i as l,t as u}from"./zod.js";import{t as ee}from"./error-banner.js";import{t as te}from"./form-actions.js";import{t as ne}from"./page-heading.js";import{a as d,r as f,t as p}from"./field.js";import{s as m}from"./ec23.js";import{t as h}from"./launch-template-data-fields.js";var g=t(),_=e();function v(){let e=(0,g.c)(56),t=n(),v=o(),y;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=u(m),e[0]=y):y=e[0];let x;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(x={resolver:y,defaultValues:{launchTemplateName:``,versionDescription:``,imageId:``,instanceType:``,securityGroupIds:[],userData:``}},e[1]=x):x=e[1];let{control:S,handleSubmit:C,register:w,formState:T}=l(x),{errors:E,isSubmitting:D}=T,O;e[2]===S?O=e[3]:(O={control:S},e[2]=S,e[3]=O);let k=c(O),A;e[4]!==v||e[5]!==t?(A=async e=>{let n=(await v.mutateAsync(e)).LaunchTemplate?.LaunchTemplateId;if(!n){t({to:`/ec2/describe-launch-templates`});return}t({to:`/ec2/describe-launch-templates/$id`,params:{id:n}})},e[4]=v,e[5]=t,e[6]=A):A=e[6];let j=A,M,N;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,_.jsx)(r,{to:`/ec2/describe-launch-templates`,children:`Back to launch templates`}),N=(0,_.jsx)(ne,{title:`Create Launch Template`}),e[7]=M,e[8]=N):(M=e[7],N=e[8]);let P;e[9]===v.error?P=e[10]:(P=v.error&&(0,_.jsx)(ee,{error:v.error,msg:`Failed to create launch template`}),e[9]=v.error,e[10]=P);let F;e[11]!==C||e[12]!==j?(F=C(j),e[11]=C,e[12]=j,e[13]=F):F=e[13];let I;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,_.jsx)(d,{children:(0,_.jsx)(`label`,{htmlFor:`launchTemplateName`,children:`Name`})}),e[14]=I):I=e[14];let L=!!E.launchTemplateName,R;e[15]===w?R=e[16]:(R=w(`launchTemplateName`),e[15]=w,e[16]=R);let z;e[17]!==L||e[18]!==R?(z=(0,_.jsx)(a,{"aria-invalid":L,id:`launchTemplateName`,placeholder:`my-launch-template`,...R}),e[17]=L,e[18]=R,e[19]=z):z=e[19];let B;e[20]===E.launchTemplateName?B=e[21]:(B=(0,_.jsx)(f,{errors:[E.launchTemplateName]}),e[20]=E.launchTemplateName,e[21]=B);let V;e[22]!==z||e[23]!==B?(V=(0,_.jsxs)(p,{children:[I,z,B]}),e[22]=z,e[23]=B,e[24]=V):V=e[24];let H;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,_.jsx)(d,{children:(0,_.jsx)(`label`,{htmlFor:`versionDescription`,children:`Version Description`})}),e[25]=H):H=e[25];let U;e[26]===w?U=e[27]:(U=w(`versionDescription`),e[26]=w,e[27]=U);let W;e[28]===U?W=e[29]:(W=(0,_.jsxs)(p,{children:[H,(0,_.jsx)(a,{id:`versionDescription`,placeholder:`Initial version`,...U})]}),e[28]=U,e[29]=W);let G;e[30]!==S||e[31]!==E||e[32]!==w?(G=(0,_.jsx)(h,{control:S,errors:E,register:w}),e[30]=S,e[31]=E,e[32]=w,e[33]=G):G=e[33];let K=k.launchTemplateName??``,q=k.versionDescription??``,J;e[34]!==K||e[35]!==q||e[36]!==k?(J=b(K,q,s(k)),e[34]=K,e[35]=q,e[36]=k,e[37]=J):J=e[37];let Y;e[38]===J?Y=e[39]:(Y=(0,_.jsx)(i,{commands:J}),e[38]=J,e[39]=Y);let X;e[40]===t?X=e[41]:(X=async()=>{await t({to:`/ec2/describe-launch-templates`})},e[40]=t,e[41]=X);let Z;e[42]!==v.isPending||e[43]!==D||e[44]!==X?(Z=(0,_.jsx)(te,{isPending:v.isPending,isSubmitting:D,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Launch Template`}),e[42]=v.isPending,e[43]=D,e[44]=X,e[45]=Z):Z=e[45];let Q;e[46]!==V||e[47]!==W||e[48]!==G||e[49]!==Y||e[50]!==Z||e[51]!==F?(Q=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[V,W,G,Y,Z]}),e[46]=V,e[47]=W,e[48]=G,e[49]=Y,e[50]=Z,e[51]=F,e[52]=Q):Q=e[52];let $;return e[53]!==Q||e[54]!==P?($=(0,_.jsxs)(_.Fragment,{children:[M,N,P,Q]}),e[53]=Q,e[54]=P,e[55]=$):$=e[55],$}function y(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function b(e,t,n){let r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-launch-template`},{type:`flag`,value:` \\ --launch-template-name`},{type:`value`,value:` ${e?y(e):``}`}];return t&&r.push({type:`flag`,value:` \\ --version-description`},{type:`value`,value:` ${y(t)}`}),r.push({type:`flag`,value:` \\ --launch-template-data`},{type:`value`,value:` ${y(JSON.stringify(n))}`}),[{label:`Create Launch Template`,parts:r}]}export{v as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-load-balancer.js b/spinifex/services/spinifexui/frontend/dist/assets/create-load-balancer.js index fbd54dfc1..223cdfb75 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-load-balancer.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-load-balancer.js @@ -1,4 +1,4 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{nn as a}from"./cluster-config.js";import{t as te}from"./back-link.js";import{c as o,i as s,n as c,s as l,t as u}from"./select.js";import{t as d}from"./cli-command-panel.js";import{t as f}from"./button.js";import{t as ne}from"./input.js";import{t as p}from"./acm.js";import{t as re}from"./certificate-import-dialog.js";import{M as ie,O as ae,w as oe}from"./ec2.js";import{n as se}from"./elbv2.js";import{o as ce,u as le}from"./elbv22.js";import{a as m,i as ue,n as h,t as de}from"./zod.js";import{t as fe}from"./error-banner.js";import{t as pe}from"./form-actions.js";import{t as me}from"./page-heading.js";import{a as g,r as _,t as v}from"./field.js";import{t as he}from"./tags-field-array.js";import{t as y}from"./target-group-form.js";import{a as b,c as x,o as ge,r as _e,s as ve,t as ye}from"./elbv23.js";var S=r(),be=e(n(),1),C=t();function w(e){let t=a(e.Tags);return t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`}function xe(e){let t=a(e.Tags);return`${t?`${e.SubnetId} (${t})`:e.SubnetId} · ${e.CidrBlock}`}function Se(e){return e===`TLS`||e===`TCP`?`TCP`:e===`UDP`?`UDP`:e===`TCP_UDP`?`TCP_UDP`:`HTTP`}function Ce(e){let t=new Map;for(let n of e){let e=n.AvailabilityZone??`unknown`,r=t.get(e)??[];r.push(n),t.set(e,r)}return[...t.entries()].toSorted((e,t)=>e[0].localeCompare(t[0])).map(([e,t])=>({az:e,subnets:t}))}function T(){let e=(0,S.c)(243),t=ee(),{data:n}=i(ie),{data:r}=i(ae),{data:a}=i(oe),{data:s}=i(le),{data:w}=i(p),{data:T}=i(ce),k=se(),[A,Ae]=(0,be.useState)(null),[je,Me]=(0,be.useState)(!1),Ne;e[0]===n.Vpcs?Ne=e[1]:(Ne=n.Vpcs??[],e[0]=n.Vpcs,e[1]=Ne);let j=Ne,Pe;e[2]===r.Subnets?Pe=e[3]:(Pe=r.Subnets??[],e[2]=r.Subnets,e[3]=Pe);let Fe=Pe,Ie;e[4]===a.SecurityGroups?Ie=e[5]:(Ie=a.SecurityGroups??[],e[4]=a.SecurityGroups,e[5]=Ie);let Le=Ie,Re;e[6]===s.TargetGroups?Re=e[7]:(Re=s.TargetGroups??[],e[6]=s.TargetGroups,e[7]=Re);let ze=Re,Be;e[8]===w.CertificateSummaryList?Be=e[9]:(Be=w.CertificateSummaryList??[],e[8]=w.CertificateSummaryList,e[9]=Be);let Ve=Be,He;e[10]===T.SslPolicies?He=e[11]:(He=T.SslPolicies??[],e[10]=T.SslPolicies,e[11]=He);let Ue=He,We;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(We=de(_e),e[12]=We):We=e[12];let Ge=j[0]?.VpcId??``,Ke,qe,Je,Ye;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(Je=[],Ye=[],Ke=[],qe={protocol:`HTTP`,port:80,targetGroupMode:`new`,existingTargetGroupArn:``,certificateArn:void 0,sslPolicy:void 0},e[13]=Ke,e[14]=qe,e[15]=Je,e[16]=Ye):(Ke=e[13],qe=e[14],Je=e[15],Ye=e[16]);let Xe;e[17]===Ge?Xe=e[18]:(Xe={resolver:We,defaultValues:{name:``,type:`application`,scheme:`internet-facing`,vpcId:Ge,subnetIds:Je,securityGroupIds:Ye,tags:Ke,listener:qe}},e[17]=Ge,e[18]=Xe);let Ze=ue(Xe),Qe;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=de(b),e[19]=Qe):Qe=e[19];let $e=j[0]?.VpcId??``,et,tt;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(et={protocol:`HTTP`,path:`/`,port:`traffic-port`,intervalSeconds:30,timeoutSeconds:5,healthyThresholdCount:5,unhealthyThresholdCount:2,matcher:`200`},tt=[],e[20]=et,e[21]=tt):(et=e[20],tt=e[21]);let nt;e[22]===$e?nt=e[23]:(nt={resolver:Qe,defaultValues:{name:``,protocol:`HTTP`,port:80,vpcId:$e,healthCheck:et,tags:tt}},e[22]=$e,e[23]=nt);let M=ue(nt),{handleSubmit:rt,register:N,watch:it,control:P,setValue:F,getValues:I,formState:at}=Ze,{errors:L,isSubmitting:ot}=at,st;e[24]===P?st=e[25]:(st={control:P,name:`vpcId`},e[24]=P,e[25]=st);let R=m(st),ct;e[26]===P?ct=e[27]:(ct={control:P,name:`subnetIds`},e[26]=P,e[27]=ct);let lt=m(ct),ut;e[28]===P?ut=e[29]:(ut={control:P,name:`securityGroupIds`},e[28]=P,e[29]=ut);let dt=m(ut),ft;e[30]===lt?ft=e[31]:(ft=new Set(lt),e[30]=lt,e[31]=ft);let pt=ft,mt;e[32]===dt?mt=e[33]:(mt=new Set(dt),e[32]=dt,e[33]=mt);let ht=mt,gt;e[34]===P?gt=e[35]:(gt={control:P,name:`type`},e[34]=P,e[35]=gt);let _t=m(gt),vt;e[36]===P?vt=e[37]:(vt={control:P,name:`listener.protocol`},e[36]=P,e[37]=vt);let z=m(vt),yt;e[38]===P?yt=e[39]:(yt={control:P,name:`listener.targetGroupMode`},e[38]=P,e[39]=yt);let B=m(yt),bt=_t===`network`,xt;e[40]===z?xt=e[41]:(xt=ve(z),e[40]=z,e[41]=xt);let St=xt,Ct;e[42]===_t?Ct=e[43]:(Ct=x(_t),e[42]=_t,e[43]=Ct);let wt=Ct,Tt;e[44]===bt?Tt=e[45]:(Tt=bt?[`TCP`,`UDP`,`TLS`,`TCP_UDP`]:[`HTTP`,`HTTPS`],e[44]=bt,e[45]=Tt);let Et=Tt,Dt,Ot,V,H,U,W,G,K,kt,q,J,Y,X,Z;if(e[46]!==Le||e[47]!==Fe||e[48]!==ze||e[49]!==P||e[50]!==L.name||e[51]!==L.subnetIds||e[52]!==L.vpcId||e[53]!==I||e[54]!==rt||e[55]!==bt||e[56]!==t||e[57]!==N||e[58]!==ht||e[59]!==pt||e[60]!==R||e[61]!==F||e[62]!==M||e[63]!==j||e[64]!==k||e[65]!==A){let n;e[80]===R?n=e[81]:(n=e=>e.VpcId===R,e[80]=R,e[81]=n);let r=Fe.filter(n),i;e[82]===R?i=e[83]:(i=e=>e.VpcId===R,e[82]=R,e[83]=i);let ee=Le.filter(i),a;if(e[84]!==ze||e[85]!==R){let t;e[87]===R?t=e[88]:(t=e=>e.VpcId===R,e[87]=R,e[88]=t),a=ze.filter(t),e[84]=ze,e[85]=R,e[86]=a}else a=e[86];Z=a;let s;e[89]===M?s=e[90]:(s=e=>{let t=Se(e);M.setValue(`protocol`,t),M.setValue(`healthCheck.protocol`,t===`HTTP`?`HTTP`:`TCP`)},e[89]=M,e[90]=s);let d=s,f;e[91]!==F||e[92]!==d?(f=e=>{F(`type`,e);let t=ge(e);F(`listener.protocol`,t),F(`listener.port`,80),F(`listener.certificateArn`,void 0),F(`listener.sslPolicy`,void 0),e===`network`&&F(`securityGroupIds`,[]),d(t)},e[91]=F,e[92]=d,e[93]=f):f=e[93];let p=f,re;e[94]!==I||e[95]!==F||e[96]!==d?(re=e=>{F(`listener.protocol`,e);let t=I(`listener.port`);ve(e)?(t===80&&F(`listener.port`,443),e===`HTTPS`&&!I(`listener.sslPolicy`)&&F(`listener.sslPolicy`,ye)):(t===443&&F(`listener.port`,80),F(`listener.certificateArn`,void 0),F(`listener.sslPolicy`,void 0)),d(e)},e[94]=I,e[95]=F,e[96]=d,e[97]=re):re=e[97],Dt=re;let ie;e[98]!==F||e[99]!==M?(ie=e=>{let t=(e===void 0?``:e)??``;F(`vpcId`,t,{shouldValidate:!0}),F(`subnetIds`,[],{shouldValidate:!0}),F(`securityGroupIds`,[]),F(`listener.existingTargetGroupArn`,``),M.setValue(`vpcId`,t)},e[98]=F,e[99]=M,e[100]=ie):ie=e[100];let ae=ie,oe;e[101]!==I||e[102]!==F?(oe=e=>{let t=I(`subnetIds`),n=t.includes(e)?t.filter(t=>t!==e):[...t,e];F(`subnetIds`,n,{shouldValidate:!0})},e[101]=I,e[102]=F,e[103]=oe):oe=e[103];let se=oe,ce;e[104]!==I||e[105]!==F?(ce=e=>{let t=I(`securityGroupIds`),n=t.includes(e)?t.filter(t=>t!==e):[...t,e];F(`securityGroupIds`,n)},e[104]=I,e[105]=F,e[106]=ce):ce=e[106];let le=ce,m;e[107]!==t||e[108]!==M||e[109]!==k?(m=async e=>{Ae(null);let n;if(e.listener.targetGroupMode===`new`){if(!await M.trigger())return;n=M.getValues()}let r=await k.mutateAsync({lb:{name:e.name,type:e.type,scheme:e.scheme,vpcId:e.vpcId,subnetIds:e.subnetIds,securityGroupIds:e.securityGroupIds,tags:e.tags},listener:{protocol:e.listener.protocol,port:e.listener.port,targetGroupMode:e.listener.targetGroupMode,existingTargetGroupArn:e.listener.existingTargetGroupArn,certificateArn:e.listener.certificateArn,sslPolicy:e.listener.sslPolicy,newTargetGroup:n}});Ae(r),!r.error&&r.loadBalancerArn&&t({to:`/ec2/describe-load-balancers/$id`,params:{id:encodeURIComponent(r.loadBalancerArn)}})},e[107]=t,e[108]=M,e[109]=k,e[110]=m):m=e[110];let ue=m,de=Ce(r);e[111]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,C.jsx)(te,{to:`/ec2/describe-load-balancers`,children:`Back to load balancers`}),J=(0,C.jsx)(me,{title:`Create Load Balancer`}),e[111]=q,e[112]=J):(q=e[111],J=e[112]),e[113]===k.error?Y=e[114]:(Y=k.error&&(0,C.jsx)(fe,{error:k.error,msg:`Failed to create load balancer`}),e[113]=k.error,e[114]=Y),e[115]===A?X=e[116]:(X=A?.error&&(0,C.jsxs)(`div`,{className:`mb-6 max-w-4xl rounded-md border border-destructive bg-destructive/10 p-4`,children:[(0,C.jsxs)(`h2`,{className:`text-sm font-medium text-destructive`,children:[`Wizard failed: `,A.failedStep]}),(0,C.jsx)(`p`,{className:`mt-1 text-sm text-destructive`,children:A.error.message}),A.created.length>0&&(0,C.jsxs)(`div`,{className:`mt-3`,children:[(0,C.jsx)(`p`,{className:`text-xs font-medium text-destructive`,children:`Successfully created resources (clean up manually if needed):`}),(0,C.jsx)(`ul`,{className:`mt-1 list-inside list-disc text-xs text-destructive`,children:A.created.map(Oe)})]})]}),e[115]=A,e[116]=X),Ot=`max-w-4xl space-y-6`,e[117]!==rt||e[118]!==ue?(V=rt(ue),e[117]=rt,e[118]=ue,e[119]=V):V=e[119];let pe;e[120]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`lb-name`,children:`Name`})}),e[120]=pe):pe=e[120];let he=!!L.name,y;e[121]===N?y=e[122]:(y=N(`name`),e[121]=N,e[122]=y);let b;e[123]!==he||e[124]!==y?(b=(0,C.jsx)(ne,{"aria-invalid":he,id:`lb-name`,placeholder:`my-load-balancer`,...y}),e[123]=he,e[124]=y,e[125]=b):b=e[125];let x;e[126]===L.name?x=e[127]:(x=(0,C.jsx)(_,{errors:[L.name]}),e[126]=L.name,e[127]=x),e[128]!==b||e[129]!==x?(H=(0,C.jsxs)(v,{children:[pe,b,x]}),e[128]=b,e[129]=x,e[130]=H):H=e[130];let _e;e[131]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,C.jsx)(g,{children:`Type`}),e[131]=_e):_e=e[131];let S;e[132]===p?S=e[133]:(S=e=>{let{field:t}=e;return(0,C.jsxs)(`div`,{className:`flex gap-4`,children:[(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Application Load Balancer`,checked:t.value===`application`,name:`lb-type`,onChange:()=>p(`application`),type:`radio`}),`Application (ALB)`]}),(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Network Load Balancer`,checked:t.value===`network`,name:`lb-type`,onChange:()=>p(`network`),type:`radio`}),`Network (NLB)`]})]})},e[132]=p,e[133]=S),e[134]!==P||e[135]!==S?(U=(0,C.jsxs)(v,{children:[_e,(0,C.jsx)(h,{control:P,name:`type`,render:S})]}),e[134]=P,e[135]=S,e[136]=U):U=e[136];let be;e[137]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,C.jsx)(g,{children:`Scheme`}),e[137]=be):be=e[137],e[138]===P?W=e[139]:(W=(0,C.jsxs)(v,{children:[be,(0,C.jsx)(h,{control:P,name:`scheme`,render:De})]}),e[138]=P,e[139]=W);let w;e[140]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`lb-vpc`,children:`VPC`})}),e[140]=w):w=e[140];let T;e[141]!==L.vpcId||e[142]!==ae||e[143]!==j?(T=e=>{let{field:t}=e;return(0,C.jsxs)(u,{onValueChange:e=>ae(e),value:t.value??``,children:[(0,C.jsx)(l,{"aria-invalid":!!L.vpcId,className:`w-full`,id:`lb-vpc`,children:(0,C.jsx)(o,{placeholder:`Select VPC`})}),(0,C.jsx)(c,{children:j.map(Ee)})]})},e[141]=L.vpcId,e[142]=ae,e[143]=j,e[144]=T):T=e[144];let E;e[145]!==P||e[146]!==T?(E=(0,C.jsx)(h,{control:P,name:`vpcId`,render:T}),e[145]=P,e[146]=T,e[147]=E):E=e[147];let D;e[148]===L.vpcId?D=e[149]:(D=(0,C.jsx)(_,{errors:[L.vpcId]}),e[148]=L.vpcId,e[149]=D),e[150]!==E||e[151]!==D?(G=(0,C.jsxs)(v,{children:[w,E,D]}),e[150]=E,e[151]=D,e[152]=G):G=e[152];let we;e[153]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,C.jsx)(g,{children:`Subnets (select at least 1)`}),e[153]=we):we=e[153];let Te=de.length===0?(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No subnets in the selected VPC.`}):(0,C.jsx)(`div`,{className:`space-y-3`,children:de.map(e=>(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:e.az}),(0,C.jsx)(`div`,{className:`space-y-1`,children:e.subnets.map(e=>(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Subnet ${xe(e)}`,checked:pt.has(e.SubnetId??``),onChange:()=>se(e.SubnetId??``),type:`checkbox`}),(0,C.jsx)(`span`,{className:`font-mono`,children:xe(e)})]},e.SubnetId))})]},e.az))}),O;e[154]===L.subnetIds?O=e[155]:(O=(0,C.jsx)(_,{errors:[L.subnetIds]}),e[154]=L.subnetIds,e[155]=O),e[156]!==Te||e[157]!==O?(K=(0,C.jsxs)(v,{children:[we,Te,O]}),e[156]=Te,e[157]=O,e[158]=K):K=e[158],kt=!bt&&(0,C.jsxs)(v,{children:[(0,C.jsx)(g,{children:`Security groups`}),ee.length===0?(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No security groups in the selected VPC.`}):(0,C.jsx)(`div`,{className:`space-y-1`,children:ee.map(e=>(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Security group ${e.GroupId} (${e.GroupName})`,checked:ht.has(e.GroupId??``),onChange:()=>le(e.GroupId??``),type:`checkbox`}),(0,C.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})]}),e[46]=Le,e[47]=Fe,e[48]=ze,e[49]=P,e[50]=L.name,e[51]=L.subnetIds,e[52]=L.vpcId,e[53]=I,e[54]=rt,e[55]=bt,e[56]=t,e[57]=N,e[58]=ht,e[59]=pt,e[60]=R,e[61]=F,e[62]=M,e[63]=j,e[64]=k,e[65]=A,e[66]=Dt,e[67]=Ot,e[68]=V,e[69]=H,e[70]=U,e[71]=W,e[72]=G,e[73]=K,e[74]=kt,e[75]=q,e[76]=J,e[77]=Y,e[78]=X,e[79]=Z}else Dt=e[66],Ot=e[67],V=e[68],H=e[69],U=e[70],W=e[71],G=e[72],K=e[73],kt=e[74],q=e[75],J=e[76],Y=e[77],X=e[78],Z=e[79];let At;e[159]===P?At=e[160]:(At=(0,C.jsx)(he,{control:P,name:`tags`}),e[159]=P,e[160]=At);let jt;e[161]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,C.jsx)(`h2`,{className:`text-sm font-semibold`,children:`First listener & default target group`}),e[161]=jt):jt=e[161];let Mt;e[162]===Symbol.for(`react.memo_cache_sentinel`)?(Mt=(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`listener-protocol`,children:`Protocol`})}),e[162]=Mt):Mt=e[162];let Nt;e[163]!==Dt||e[164]!==wt?(Nt=e=>{let{field:t}=e;return(0,C.jsxs)(u,{onValueChange:e=>{e&&Dt(e)},value:t.value,children:[(0,C.jsx)(l,{className:`w-full`,id:`listener-protocol`,children:(0,C.jsx)(o,{})}),(0,C.jsx)(c,{children:wt.map(O)})]})},e[163]=Dt,e[164]=wt,e[165]=Nt):Nt=e[165];let Pt;e[166]!==P||e[167]!==Nt?(Pt=(0,C.jsxs)(v,{children:[Mt,(0,C.jsx)(h,{control:P,name:`listener.protocol`,render:Nt})]}),e[166]=P,e[167]=Nt,e[168]=Pt):Pt=e[168];let Ft;e[169]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`listener-port`,children:`Port`})}),e[169]=Ft):Ft=e[169];let It=!!L.listener?.port,Lt;e[170]===N?Lt=e[171]:(Lt=N(`listener.port`,{valueAsNumber:!0}),e[170]=N,e[171]=Lt);let Rt;e[172]!==It||e[173]!==Lt?(Rt=(0,C.jsx)(ne,{"aria-invalid":It,id:`listener-port`,inputMode:`numeric`,type:`number`,...Lt}),e[172]=It,e[173]=Lt,e[174]=Rt):Rt=e[174];let zt=L.listener?.port,Bt;e[175]===zt?Bt=e[176]:(Bt=(0,C.jsx)(_,{errors:[zt]}),e[175]=zt,e[176]=Bt);let Vt;e[177]!==Rt||e[178]!==Bt?(Vt=(0,C.jsxs)(v,{children:[Ft,Rt,Bt]}),e[177]=Rt,e[178]=Bt,e[179]=Vt):Vt=e[179];let Q;e[180]!==Ve||e[181]!==P||e[182]!==L.listener?.certificateArn||e[183]!==St||e[184]!==z||e[185]!==Ue?(Q=St&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(v,{children:[(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`listener-certificate`,children:`Certificate`})}),(0,C.jsx)(h,{control:P,name:`listener.certificateArn`,render:e=>{let{field:t}=e;return(0,C.jsxs)(u,{onValueChange:t.onChange,value:t.value??``,children:[(0,C.jsx)(l,{"aria-invalid":!!L.listener?.certificateArn,className:`w-full`,id:`listener-certificate`,children:(0,C.jsx)(o,{placeholder:`Select certificate`})}),(0,C.jsx)(c,{children:Ve.map(Te)})]})}}),(0,C.jsx)(_,{errors:[L.listener?.certificateArn]}),(0,C.jsxs)(`div`,{className:`mt-1 flex items-center justify-between`,children:[Ve.length===0&&(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No certificates imported yet.`}),(0,C.jsx)(f,{className:`ml-auto`,onClick:()=>Me(!0),size:`sm`,type:`button`,variant:`ghost`,children:`Import certificate…`})]})]}),z===`HTTPS`&&(0,C.jsxs)(v,{children:[(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`listener-ssl-policy`,children:`Security policy`})}),(0,C.jsx)(h,{control:P,name:`listener.sslPolicy`,render:e=>{let{field:t}=e;return(0,C.jsxs)(u,{onValueChange:t.onChange,value:t.value??`ELBSecurityPolicy-2016-08`,children:[(0,C.jsx)(l,{className:`w-full`,id:`listener-ssl-policy`,children:(0,C.jsx)(o,{})}),(0,C.jsx)(c,{children:Ue.map(we)})]})}})]})]}),e[180]=Ve,e[181]=P,e[182]=L.listener?.certificateArn,e[183]=St,e[184]=z,e[185]=Ue,e[186]=Q):Q=e[186];let Ht;e[187]===Symbol.for(`react.memo_cache_sentinel`)?(Ht=(0,C.jsx)(g,{children:`Default target group`}),e[187]=Ht):Ht=e[187];let Ut;e[188]===P?Ut=e[189]:(Ut=(0,C.jsxs)(v,{children:[Ht,(0,C.jsx)(h,{control:P,name:`listener.targetGroupMode`,render:D})]}),e[188]=P,e[189]=Ut);let Wt;e[190]!==P||e[191]!==L.listener?.existingTargetGroupArn||e[192]!==B||e[193]!==Z?(Wt=B===`existing`&&(0,C.jsxs)(v,{children:[(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`tg-existing`,children:`Target group`})}),(0,C.jsx)(h,{control:P,name:`listener.existingTargetGroupArn`,render:e=>{let{field:t}=e;return(0,C.jsxs)(u,{onValueChange:t.onChange,value:t.value??``,children:[(0,C.jsx)(l,{"aria-invalid":!!L.listener?.existingTargetGroupArn,className:`w-full`,id:`tg-existing`,children:(0,C.jsx)(o,{placeholder:`Select target group`})}),(0,C.jsx)(c,{children:Z.map(E)})]})}}),(0,C.jsx)(_,{errors:[L.listener?.existingTargetGroupArn]}),Z.length===0&&(0,C.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No target groups in this VPC. Choose “Create new” instead.`})]}),e[190]=P,e[191]=L.listener?.existingTargetGroupArn,e[192]=B,e[193]=Z,e[194]=Wt):Wt=e[194];let Gt;e[195]!==Et||e[196]!==M||e[197]!==B||e[198]!==j?(Gt=B===`new`&&(0,C.jsx)(`div`,{className:`space-y-4 border-l-2 border-muted pl-4`,children:(0,C.jsx)(y,{allowedProtocols:Et,form:M,vpcs:j})}),e[195]=Et,e[196]=M,e[197]=B,e[198]=j,e[199]=Gt):Gt=e[199];let Kt;e[200]!==Pt||e[201]!==Vt||e[202]!==Q||e[203]!==Ut||e[204]!==Wt||e[205]!==Gt?(Kt=(0,C.jsxs)(`div`,{className:`space-y-4 rounded-md border bg-card p-4`,children:[jt,Pt,Vt,Q,Ut,Wt,Gt]}),e[200]=Pt,e[201]=Vt,e[202]=Q,e[203]=Ut,e[204]=Wt,e[205]=Gt,e[206]=Kt):Kt=e[206];let qt;e[207]===F?qt=e[208]:(qt=e=>F(`listener.certificateArn`,e,{shouldValidate:!0}),e[207]=F,e[208]=qt);let Jt;e[209]!==je||e[210]!==qt?(Jt=(0,C.jsx)(re,{onImported:qt,onOpenChange:Me,open:je}),e[209]=je,e[210]=qt,e[211]=Jt):Jt=e[211];let Yt;e[212]!==M.watch||e[213]!==it?(Yt=ke(it,M.watch),e[212]=M.watch,e[213]=it,e[214]=Yt):Yt=e[214];let Xt;e[215]===Yt?Xt=e[216]:(Xt=(0,C.jsx)(d,{commands:Yt}),e[215]=Yt,e[216]=Xt);let Zt;e[217]===t?Zt=e[218]:(Zt=async()=>await t({to:`/ec2/describe-load-balancers`}),e[217]=t,e[218]=Zt);let $;e[219]!==ot||e[220]!==Zt||e[221]!==k.isPending?($=(0,C.jsx)(pe,{isPending:k.isPending,isSubmitting:ot,onCancel:Zt,pendingLabel:`Creating…`,submitLabel:`Create Load Balancer`}),e[219]=ot,e[220]=Zt,e[221]=k.isPending,e[222]=$):$=e[222];let Qt;e[223]!==Ot||e[224]!==V||e[225]!==H||e[226]!==U||e[227]!==W||e[228]!==G||e[229]!==K||e[230]!==kt||e[231]!==At||e[232]!==Kt||e[233]!==Jt||e[234]!==Xt||e[235]!==$?(Qt=(0,C.jsxs)(`form`,{className:Ot,onSubmit:V,children:[H,U,W,G,K,kt,At,Kt,Jt,Xt,$]}),e[223]=Ot,e[224]=V,e[225]=H,e[226]=U,e[227]=W,e[228]=G,e[229]=K,e[230]=kt,e[231]=At,e[232]=Kt,e[233]=Jt,e[234]=Xt,e[235]=$,e[236]=Qt):Qt=e[236];let $t;return e[237]!==q||e[238]!==J||e[239]!==Y||e[240]!==X||e[241]!==Qt?($t=(0,C.jsxs)(C.Fragment,{children:[q,J,Y,X,Qt]}),e[237]=q,e[238]=J,e[239]=Y,e[240]=X,e[241]=Qt,e[242]=$t):$t=e[242],$t}function E(e){return(0,C.jsxs)(s,{value:e.TargetGroupArn??``,children:[e.TargetGroupName,` · `,e.Protocol,`:`,e.Port]},e.TargetGroupArn)}function D(e){let{field:t}=e;return(0,C.jsxs)(`div`,{className:`flex gap-4`,children:[(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Create new target group`,checked:t.value===`new`,name:`tg-mode`,onChange:()=>t.onChange(`new`),type:`radio`}),`Create new`]}),(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Use existing target group`,checked:t.value===`existing`,name:`tg-mode`,onChange:()=>t.onChange(`existing`),type:`radio`}),`Use existing`]})]})}function we(e){return(0,C.jsx)(s,{value:e.Name??``,children:e.Name},e.Name)}function Te(e){return(0,C.jsx)(s,{value:e.CertificateArn??``,children:e.DomainName??e.CertificateArn?.split(`/`).pop()},e.CertificateArn)}function O(e){return(0,C.jsx)(s,{value:e,children:e},e)}function Ee(e){return(0,C.jsx)(s,{value:e.VpcId??``,children:w(e)},e.VpcId)}function De(e){let{field:t}=e;return(0,C.jsxs)(`div`,{className:`flex gap-4`,children:[(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Internet-facing`,checked:t.value===`internet-facing`,name:`scheme`,onChange:()=>t.onChange(`internet-facing`),type:`radio`}),`Internet-facing`]}),(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Internal`,checked:t.value===`internal`,name:`scheme`,onChange:()=>t.onChange(`internal`),type:`radio`}),`Internal`]})]})}function Oe(e,t){return(0,C.jsxs)(`li`,{children:[e.type,`: `,e.id??`(created)`]},t)}function ke(e,t){let n=e(`name`)||``,r=e(`type`)||`application`,i=e(`scheme`)||`internet-facing`,ee=e(`subnetIds`),a=e(`securityGroupIds`),te=e(`listener.protocol`)||`HTTP`,o=e(`listener.port`)??80,s=e(`listener.certificateArn`),c=e(`listener.sslPolicy`),l=e(`listener.targetGroupMode`),u=e(`listener.existingTargetGroupArn`),d=[],f={type:`comment`,value:r===`network`?`# Create NLB with listener and default target group +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{nn as a}from"./cluster-config.js";import{t as te}from"./back-link.js";import{c as o,i as s,n as c,s as l,t as u}from"./select.js";import{t as d}from"./cli-command-panel.js";import{t as f}from"./button.js";import{t as ne}from"./input.js";import{t as p}from"./acm.js";import{t as re}from"./certificate-import-dialog.js";import{M as ie,O as ae,w as oe}from"./ec2.js";import{n as se}from"./elbv2.js";import{o as ce,u as le}from"./elbv22.js";import{a as m,i as ue,n as h,t as de}from"./zod.js";import{t as fe}from"./error-banner.js";import{t as pe}from"./form-actions.js";import{t as me}from"./page-heading.js";import{a as g,r as _,t as v}from"./field.js";import{t as he}from"./tags-field-array.js";import{t as y}from"./target-group-form.js";import{a as b,c as x,o as ge,r as _e,s as ve,t as ye}from"./elbv23.js";var S=r(),be=e(n(),1),C=t();function w(e){let t=a(e.Tags);return t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`}function xe(e){let t=a(e.Tags);return`${t?`${e.SubnetId} (${t})`:e.SubnetId} · ${e.CidrBlock}`}function Se(e){return e===`TLS`||e===`TCP`?`TCP`:e===`UDP`?`UDP`:e===`TCP_UDP`?`TCP_UDP`:`HTTP`}function Ce(e){let t=new Map;for(let n of e){let e=n.AvailabilityZone??`unknown`,r=t.get(e)??[];r.push(n),t.set(e,r)}return[...t.entries()].toSorted((e,t)=>e[0].localeCompare(t[0])).map(([e,t])=>({az:e,subnets:t}))}function T(){let e=(0,S.c)(243),t=ee(),{data:n}=i(ie),{data:r}=i(ae),{data:a}=i(oe),{data:s}=i(le),{data:w}=i(p),{data:T}=i(ce),k=se(),[A,Ae]=(0,be.useState)(null),[je,Me]=(0,be.useState)(!1),Ne;e[0]===n.Vpcs?Ne=e[1]:(Ne=n.Vpcs??[],e[0]=n.Vpcs,e[1]=Ne);let j=Ne,Pe;e[2]===r.Subnets?Pe=e[3]:(Pe=r.Subnets??[],e[2]=r.Subnets,e[3]=Pe);let Fe=Pe,Ie;e[4]===a.SecurityGroups?Ie=e[5]:(Ie=a.SecurityGroups??[],e[4]=a.SecurityGroups,e[5]=Ie);let Le=Ie,Re;e[6]===s.TargetGroups?Re=e[7]:(Re=s.TargetGroups??[],e[6]=s.TargetGroups,e[7]=Re);let ze=Re,Be;e[8]===w.CertificateSummaryList?Be=e[9]:(Be=w.CertificateSummaryList??[],e[8]=w.CertificateSummaryList,e[9]=Be);let Ve=Be,He;e[10]===T.SslPolicies?He=e[11]:(He=T.SslPolicies??[],e[10]=T.SslPolicies,e[11]=He);let Ue=He,We;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(We=de(_e),e[12]=We):We=e[12];let Ge=j[0]?.VpcId??``,Ke,qe,Je,Ye;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(Je=[],Ye=[],Ke=[],qe={protocol:`HTTP`,port:80,targetGroupMode:`new`,existingTargetGroupArn:``,certificateArn:void 0,sslPolicy:void 0},e[13]=Ke,e[14]=qe,e[15]=Je,e[16]=Ye):(Ke=e[13],qe=e[14],Je=e[15],Ye=e[16]);let Xe;e[17]===Ge?Xe=e[18]:(Xe={resolver:We,defaultValues:{name:``,type:`application`,scheme:`internet-facing`,vpcId:Ge,subnetIds:Je,securityGroupIds:Ye,tags:Ke,listener:qe}},e[17]=Ge,e[18]=Xe);let Ze=ue(Xe),Qe;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=de(b),e[19]=Qe):Qe=e[19];let $e=j[0]?.VpcId??``,et,tt;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(et={protocol:`HTTP`,path:`/`,port:`traffic-port`,intervalSeconds:30,timeoutSeconds:5,healthyThresholdCount:5,unhealthyThresholdCount:2,matcher:`200`},tt=[],e[20]=et,e[21]=tt):(et=e[20],tt=e[21]);let nt;e[22]===$e?nt=e[23]:(nt={resolver:Qe,defaultValues:{name:``,protocol:`HTTP`,port:80,vpcId:$e,healthCheck:et,tags:tt}},e[22]=$e,e[23]=nt);let M=ue(nt),{handleSubmit:rt,register:N,watch:it,control:P,setValue:F,getValues:I,formState:at}=Ze,{errors:L,isSubmitting:ot}=at,st;e[24]===P?st=e[25]:(st={control:P,name:`vpcId`},e[24]=P,e[25]=st);let R=m(st),ct;e[26]===P?ct=e[27]:(ct={control:P,name:`subnetIds`},e[26]=P,e[27]=ct);let lt=m(ct),ut;e[28]===P?ut=e[29]:(ut={control:P,name:`securityGroupIds`},e[28]=P,e[29]=ut);let dt=m(ut),ft;e[30]===lt?ft=e[31]:(ft=new Set(lt),e[30]=lt,e[31]=ft);let pt=ft,mt;e[32]===dt?mt=e[33]:(mt=new Set(dt),e[32]=dt,e[33]=mt);let ht=mt,gt;e[34]===P?gt=e[35]:(gt={control:P,name:`type`},e[34]=P,e[35]=gt);let _t=m(gt),vt;e[36]===P?vt=e[37]:(vt={control:P,name:`listener.protocol`},e[36]=P,e[37]=vt);let z=m(vt),yt;e[38]===P?yt=e[39]:(yt={control:P,name:`listener.targetGroupMode`},e[38]=P,e[39]=yt);let B=m(yt),bt=_t===`network`,xt;e[40]===z?xt=e[41]:(xt=ve(z),e[40]=z,e[41]=xt);let St=xt,Ct;e[42]===_t?Ct=e[43]:(Ct=x(_t),e[42]=_t,e[43]=Ct);let wt=Ct,Tt;e[44]===bt?Tt=e[45]:(Tt=bt?[`TCP`,`UDP`,`TLS`,`TCP_UDP`]:[`HTTP`,`HTTPS`],e[44]=bt,e[45]=Tt);let Et=Tt,Dt,Ot,V,H,U,W,G,K,kt,q,J,Y,X,Z;if(e[46]!==Le||e[47]!==Fe||e[48]!==ze||e[49]!==P||e[50]!==L.name||e[51]!==L.subnetIds||e[52]!==L.vpcId||e[53]!==I||e[54]!==rt||e[55]!==bt||e[56]!==t||e[57]!==N||e[58]!==ht||e[59]!==pt||e[60]!==R||e[61]!==F||e[62]!==M||e[63]!==j||e[64]!==k||e[65]!==A){let n;e[80]===R?n=e[81]:(n=e=>e.VpcId===R,e[80]=R,e[81]=n);let r=Fe.filter(n),i;e[82]===R?i=e[83]:(i=e=>e.VpcId===R,e[82]=R,e[83]=i);let ee=Le.filter(i),a;if(e[84]!==ze||e[85]!==R){let t;e[87]===R?t=e[88]:(t=e=>e.VpcId===R,e[87]=R,e[88]=t),a=ze.filter(t),e[84]=ze,e[85]=R,e[86]=a}else a=e[86];Z=a;let s;e[89]===M?s=e[90]:(s=e=>{let t=Se(e);M.setValue(`protocol`,t),M.setValue(`healthCheck.protocol`,t===`HTTP`?`HTTP`:`TCP`)},e[89]=M,e[90]=s);let d=s,f;e[91]!==F||e[92]!==d?(f=e=>{F(`type`,e);let t=ge(e);F(`listener.protocol`,t),F(`listener.port`,80),F(`listener.certificateArn`,void 0),F(`listener.sslPolicy`,void 0),e===`network`&&F(`securityGroupIds`,[]),d(t)},e[91]=F,e[92]=d,e[93]=f):f=e[93];let p=f,re;e[94]!==I||e[95]!==F||e[96]!==d?(re=e=>{F(`listener.protocol`,e);let t=I(`listener.port`);ve(e)?(t===80&&F(`listener.port`,443),e===`HTTPS`&&!I(`listener.sslPolicy`)&&F(`listener.sslPolicy`,ye)):(t===443&&F(`listener.port`,80),F(`listener.certificateArn`,void 0),F(`listener.sslPolicy`,void 0)),d(e)},e[94]=I,e[95]=F,e[96]=d,e[97]=re):re=e[97],Dt=re;let ie;e[98]!==F||e[99]!==M?(ie=e=>{let t=(e===void 0?``:e)??``;F(`vpcId`,t,{shouldValidate:!0}),F(`subnetIds`,[],{shouldValidate:!0}),F(`securityGroupIds`,[]),F(`listener.existingTargetGroupArn`,``),M.setValue(`vpcId`,t)},e[98]=F,e[99]=M,e[100]=ie):ie=e[100];let ae=ie,oe;e[101]!==I||e[102]!==F?(oe=e=>{let t=I(`subnetIds`),n=t.includes(e)?t.filter(t=>t!==e):[...t,e];F(`subnetIds`,n,{shouldValidate:!0})},e[101]=I,e[102]=F,e[103]=oe):oe=e[103];let se=oe,ce;e[104]!==I||e[105]!==F?(ce=e=>{let t=I(`securityGroupIds`),n=t.includes(e)?t.filter(t=>t!==e):[...t,e];F(`securityGroupIds`,n)},e[104]=I,e[105]=F,e[106]=ce):ce=e[106];let le=ce,m;e[107]!==t||e[108]!==M||e[109]!==k?(m=async e=>{Ae(null);let n;if(e.listener.targetGroupMode===`new`){if(!await M.trigger())return;n=M.getValues()}let r=await k.mutateAsync({lb:{name:e.name,type:e.type,scheme:e.scheme,vpcId:e.vpcId,subnetIds:e.subnetIds,securityGroupIds:e.securityGroupIds,tags:e.tags},listener:{protocol:e.listener.protocol,port:e.listener.port,targetGroupMode:e.listener.targetGroupMode,existingTargetGroupArn:e.listener.existingTargetGroupArn,certificateArn:e.listener.certificateArn,sslPolicy:e.listener.sslPolicy,newTargetGroup:n}});Ae(r),!r.error&&r.loadBalancerArn&&t({to:`/ec2/describe-load-balancers/$id`,params:{id:encodeURIComponent(r.loadBalancerArn)}})},e[107]=t,e[108]=M,e[109]=k,e[110]=m):m=e[110];let ue=m,de=Ce(r);e[111]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,C.jsx)(te,{to:`/ec2/describe-load-balancers`,children:`Back to load balancers`}),J=(0,C.jsx)(me,{title:`Create Load Balancer`}),e[111]=q,e[112]=J):(q=e[111],J=e[112]),e[113]===k.error?Y=e[114]:(Y=k.error&&(0,C.jsx)(fe,{error:k.error,msg:`Failed to create load balancer`}),e[113]=k.error,e[114]=Y),e[115]===A?X=e[116]:(X=A?.error&&(0,C.jsxs)(`div`,{className:`mb-6 max-w-4xl rounded-md border border-destructive bg-destructive/10 p-4`,children:[(0,C.jsxs)(`h2`,{className:`text-sm font-medium text-destructive`,children:[`Wizard failed: `,A.failedStep]}),(0,C.jsx)(`p`,{className:`mt-1 text-sm text-destructive`,children:A.error.message}),A.created.length>0&&(0,C.jsxs)(`div`,{className:`mt-3`,children:[(0,C.jsx)(`p`,{className:`text-xs font-medium text-destructive`,children:`Successfully created resources (clean up manually if needed):`}),(0,C.jsx)(`ul`,{className:`mt-1 list-inside list-disc text-xs text-destructive`,children:A.created.map(Oe)})]})]}),e[115]=A,e[116]=X),Ot=`max-w-4xl space-y-6`,e[117]!==rt||e[118]!==ue?(V=rt(ue),e[117]=rt,e[118]=ue,e[119]=V):V=e[119];let pe;e[120]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`lb-name`,children:`Name`})}),e[120]=pe):pe=e[120];let he=!!L.name,y;e[121]===N?y=e[122]:(y=N(`name`),e[121]=N,e[122]=y);let b;e[123]!==he||e[124]!==y?(b=(0,C.jsx)(ne,{"aria-invalid":he,id:`lb-name`,placeholder:`my-load-balancer`,...y}),e[123]=he,e[124]=y,e[125]=b):b=e[125];let x;e[126]===L.name?x=e[127]:(x=(0,C.jsx)(_,{errors:[L.name]}),e[126]=L.name,e[127]=x),e[128]!==b||e[129]!==x?(H=(0,C.jsxs)(v,{children:[pe,b,x]}),e[128]=b,e[129]=x,e[130]=H):H=e[130];let _e;e[131]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,C.jsx)(g,{children:`Type`}),e[131]=_e):_e=e[131];let S;e[132]===p?S=e[133]:(S=e=>{let{field:t}=e;return(0,C.jsxs)(`div`,{className:`flex gap-4`,children:[(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Application Load Balancer`,checked:t.value===`application`,name:`lb-type`,onChange:()=>{p(`application`)},type:`radio`}),`Application (ALB)`]}),(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Network Load Balancer`,checked:t.value===`network`,name:`lb-type`,onChange:()=>{p(`network`)},type:`radio`}),`Network (NLB)`]})]})},e[132]=p,e[133]=S),e[134]!==P||e[135]!==S?(U=(0,C.jsxs)(v,{children:[_e,(0,C.jsx)(h,{control:P,name:`type`,render:S})]}),e[134]=P,e[135]=S,e[136]=U):U=e[136];let be;e[137]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,C.jsx)(g,{children:`Scheme`}),e[137]=be):be=e[137],e[138]===P?W=e[139]:(W=(0,C.jsxs)(v,{children:[be,(0,C.jsx)(h,{control:P,name:`scheme`,render:De})]}),e[138]=P,e[139]=W);let w;e[140]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`lb-vpc`,children:`VPC`})}),e[140]=w):w=e[140];let T;e[141]!==L.vpcId||e[142]!==ae||e[143]!==j?(T=e=>{let{field:t}=e;return(0,C.jsxs)(u,{onValueChange:e=>{ae(e)},value:t.value??``,children:[(0,C.jsx)(l,{"aria-invalid":!!L.vpcId,className:`w-full`,id:`lb-vpc`,children:(0,C.jsx)(o,{placeholder:`Select VPC`})}),(0,C.jsx)(c,{children:j.map(Ee)})]})},e[141]=L.vpcId,e[142]=ae,e[143]=j,e[144]=T):T=e[144];let E;e[145]!==P||e[146]!==T?(E=(0,C.jsx)(h,{control:P,name:`vpcId`,render:T}),e[145]=P,e[146]=T,e[147]=E):E=e[147];let D;e[148]===L.vpcId?D=e[149]:(D=(0,C.jsx)(_,{errors:[L.vpcId]}),e[148]=L.vpcId,e[149]=D),e[150]!==E||e[151]!==D?(G=(0,C.jsxs)(v,{children:[w,E,D]}),e[150]=E,e[151]=D,e[152]=G):G=e[152];let we;e[153]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,C.jsx)(g,{children:`Subnets (select at least 1)`}),e[153]=we):we=e[153];let Te=de.length===0?(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No subnets in the selected VPC.`}):(0,C.jsx)(`div`,{className:`space-y-3`,children:de.map(e=>(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:e.az}),(0,C.jsx)(`div`,{className:`space-y-1`,children:e.subnets.map(e=>(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Subnet ${xe(e)}`,checked:pt.has(e.SubnetId??``),onChange:()=>{se(e.SubnetId??``)},type:`checkbox`}),(0,C.jsx)(`span`,{className:`font-mono`,children:xe(e)})]},e.SubnetId))})]},e.az))}),O;e[154]===L.subnetIds?O=e[155]:(O=(0,C.jsx)(_,{errors:[L.subnetIds]}),e[154]=L.subnetIds,e[155]=O),e[156]!==Te||e[157]!==O?(K=(0,C.jsxs)(v,{children:[we,Te,O]}),e[156]=Te,e[157]=O,e[158]=K):K=e[158],kt=!bt&&(0,C.jsxs)(v,{children:[(0,C.jsx)(g,{children:`Security groups`}),ee.length===0?(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No security groups in the selected VPC.`}):(0,C.jsx)(`div`,{className:`space-y-1`,children:ee.map(e=>(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Security group ${e.GroupId} (${e.GroupName})`,checked:ht.has(e.GroupId??``),onChange:()=>{le(e.GroupId??``)},type:`checkbox`}),(0,C.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})]}),e[46]=Le,e[47]=Fe,e[48]=ze,e[49]=P,e[50]=L.name,e[51]=L.subnetIds,e[52]=L.vpcId,e[53]=I,e[54]=rt,e[55]=bt,e[56]=t,e[57]=N,e[58]=ht,e[59]=pt,e[60]=R,e[61]=F,e[62]=M,e[63]=j,e[64]=k,e[65]=A,e[66]=Dt,e[67]=Ot,e[68]=V,e[69]=H,e[70]=U,e[71]=W,e[72]=G,e[73]=K,e[74]=kt,e[75]=q,e[76]=J,e[77]=Y,e[78]=X,e[79]=Z}else Dt=e[66],Ot=e[67],V=e[68],H=e[69],U=e[70],W=e[71],G=e[72],K=e[73],kt=e[74],q=e[75],J=e[76],Y=e[77],X=e[78],Z=e[79];let At;e[159]===P?At=e[160]:(At=(0,C.jsx)(he,{control:P,name:`tags`}),e[159]=P,e[160]=At);let jt;e[161]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,C.jsx)(`h2`,{className:`text-sm font-semibold`,children:`First listener & default target group`}),e[161]=jt):jt=e[161];let Mt;e[162]===Symbol.for(`react.memo_cache_sentinel`)?(Mt=(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`listener-protocol`,children:`Protocol`})}),e[162]=Mt):Mt=e[162];let Nt;e[163]!==Dt||e[164]!==wt?(Nt=e=>{let{field:t}=e;return(0,C.jsxs)(u,{onValueChange:e=>{e&&Dt(e)},value:t.value,children:[(0,C.jsx)(l,{className:`w-full`,id:`listener-protocol`,children:(0,C.jsx)(o,{})}),(0,C.jsx)(c,{children:wt.map(O)})]})},e[163]=Dt,e[164]=wt,e[165]=Nt):Nt=e[165];let Pt;e[166]!==P||e[167]!==Nt?(Pt=(0,C.jsxs)(v,{children:[Mt,(0,C.jsx)(h,{control:P,name:`listener.protocol`,render:Nt})]}),e[166]=P,e[167]=Nt,e[168]=Pt):Pt=e[168];let Ft;e[169]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`listener-port`,children:`Port`})}),e[169]=Ft):Ft=e[169];let It=!!L.listener?.port,Lt;e[170]===N?Lt=e[171]:(Lt=N(`listener.port`,{valueAsNumber:!0}),e[170]=N,e[171]=Lt);let Rt;e[172]!==It||e[173]!==Lt?(Rt=(0,C.jsx)(ne,{"aria-invalid":It,id:`listener-port`,inputMode:`numeric`,type:`number`,...Lt}),e[172]=It,e[173]=Lt,e[174]=Rt):Rt=e[174];let zt=L.listener?.port,Bt;e[175]===zt?Bt=e[176]:(Bt=(0,C.jsx)(_,{errors:[zt]}),e[175]=zt,e[176]=Bt);let Vt;e[177]!==Rt||e[178]!==Bt?(Vt=(0,C.jsxs)(v,{children:[Ft,Rt,Bt]}),e[177]=Rt,e[178]=Bt,e[179]=Vt):Vt=e[179];let Q;e[180]!==Ve||e[181]!==P||e[182]!==L.listener?.certificateArn||e[183]!==St||e[184]!==z||e[185]!==Ue?(Q=St&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(v,{children:[(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`listener-certificate`,children:`Certificate`})}),(0,C.jsx)(h,{control:P,name:`listener.certificateArn`,render:e=>{let{field:t}=e;return(0,C.jsxs)(u,{onValueChange:t.onChange,value:t.value??``,children:[(0,C.jsx)(l,{"aria-invalid":!!L.listener?.certificateArn,className:`w-full`,id:`listener-certificate`,children:(0,C.jsx)(o,{placeholder:`Select certificate`})}),(0,C.jsx)(c,{children:Ve.map(Te)})]})}}),(0,C.jsx)(_,{errors:[L.listener?.certificateArn]}),(0,C.jsxs)(`div`,{className:`mt-1 flex items-center justify-between`,children:[Ve.length===0&&(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No certificates imported yet.`}),(0,C.jsx)(f,{className:`ml-auto`,onClick:()=>{Me(!0)},size:`sm`,type:`button`,variant:`ghost`,children:`Import certificate…`})]})]}),z===`HTTPS`&&(0,C.jsxs)(v,{children:[(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`listener-ssl-policy`,children:`Security policy`})}),(0,C.jsx)(h,{control:P,name:`listener.sslPolicy`,render:e=>{let{field:t}=e;return(0,C.jsxs)(u,{onValueChange:t.onChange,value:t.value??`ELBSecurityPolicy-2016-08`,children:[(0,C.jsx)(l,{className:`w-full`,id:`listener-ssl-policy`,children:(0,C.jsx)(o,{})}),(0,C.jsx)(c,{children:Ue.map(we)})]})}})]})]}),e[180]=Ve,e[181]=P,e[182]=L.listener?.certificateArn,e[183]=St,e[184]=z,e[185]=Ue,e[186]=Q):Q=e[186];let Ht;e[187]===Symbol.for(`react.memo_cache_sentinel`)?(Ht=(0,C.jsx)(g,{children:`Default target group`}),e[187]=Ht):Ht=e[187];let Ut;e[188]===P?Ut=e[189]:(Ut=(0,C.jsxs)(v,{children:[Ht,(0,C.jsx)(h,{control:P,name:`listener.targetGroupMode`,render:D})]}),e[188]=P,e[189]=Ut);let Wt;e[190]!==P||e[191]!==L.listener?.existingTargetGroupArn||e[192]!==B||e[193]!==Z?(Wt=B===`existing`&&(0,C.jsxs)(v,{children:[(0,C.jsx)(g,{children:(0,C.jsx)(`label`,{htmlFor:`tg-existing`,children:`Target group`})}),(0,C.jsx)(h,{control:P,name:`listener.existingTargetGroupArn`,render:e=>{let{field:t}=e;return(0,C.jsxs)(u,{onValueChange:t.onChange,value:t.value??``,children:[(0,C.jsx)(l,{"aria-invalid":!!L.listener?.existingTargetGroupArn,className:`w-full`,id:`tg-existing`,children:(0,C.jsx)(o,{placeholder:`Select target group`})}),(0,C.jsx)(c,{children:Z.map(E)})]})}}),(0,C.jsx)(_,{errors:[L.listener?.existingTargetGroupArn]}),Z.length===0&&(0,C.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No target groups in this VPC. Choose “Create new” instead.`})]}),e[190]=P,e[191]=L.listener?.existingTargetGroupArn,e[192]=B,e[193]=Z,e[194]=Wt):Wt=e[194];let Gt;e[195]!==Et||e[196]!==M||e[197]!==B||e[198]!==j?(Gt=B===`new`&&(0,C.jsx)(`div`,{className:`space-y-4 border-l-2 border-muted pl-4`,children:(0,C.jsx)(y,{allowedProtocols:Et,form:M,vpcs:j})}),e[195]=Et,e[196]=M,e[197]=B,e[198]=j,e[199]=Gt):Gt=e[199];let Kt;e[200]!==Pt||e[201]!==Vt||e[202]!==Q||e[203]!==Ut||e[204]!==Wt||e[205]!==Gt?(Kt=(0,C.jsxs)(`div`,{className:`space-y-4 rounded-md border bg-card p-4`,children:[jt,Pt,Vt,Q,Ut,Wt,Gt]}),e[200]=Pt,e[201]=Vt,e[202]=Q,e[203]=Ut,e[204]=Wt,e[205]=Gt,e[206]=Kt):Kt=e[206];let qt;e[207]===F?qt=e[208]:(qt=e=>{F(`listener.certificateArn`,e,{shouldValidate:!0})},e[207]=F,e[208]=qt);let Jt;e[209]!==je||e[210]!==qt?(Jt=(0,C.jsx)(re,{onImported:qt,onOpenChange:Me,open:je}),e[209]=je,e[210]=qt,e[211]=Jt):Jt=e[211];let Yt;e[212]!==M.watch||e[213]!==it?(Yt=ke(it,M.watch),e[212]=M.watch,e[213]=it,e[214]=Yt):Yt=e[214];let Xt;e[215]===Yt?Xt=e[216]:(Xt=(0,C.jsx)(d,{commands:Yt}),e[215]=Yt,e[216]=Xt);let Zt;e[217]===t?Zt=e[218]:(Zt=async()=>{await t({to:`/ec2/describe-load-balancers`})},e[217]=t,e[218]=Zt);let $;e[219]!==ot||e[220]!==Zt||e[221]!==k.isPending?($=(0,C.jsx)(pe,{isPending:k.isPending,isSubmitting:ot,onCancel:Zt,pendingLabel:`Creating…`,submitLabel:`Create Load Balancer`}),e[219]=ot,e[220]=Zt,e[221]=k.isPending,e[222]=$):$=e[222];let Qt;e[223]!==Ot||e[224]!==V||e[225]!==H||e[226]!==U||e[227]!==W||e[228]!==G||e[229]!==K||e[230]!==kt||e[231]!==At||e[232]!==Kt||e[233]!==Jt||e[234]!==Xt||e[235]!==$?(Qt=(0,C.jsxs)(`form`,{className:Ot,onSubmit:V,children:[H,U,W,G,K,kt,At,Kt,Jt,Xt,$]}),e[223]=Ot,e[224]=V,e[225]=H,e[226]=U,e[227]=W,e[228]=G,e[229]=K,e[230]=kt,e[231]=At,e[232]=Kt,e[233]=Jt,e[234]=Xt,e[235]=$,e[236]=Qt):Qt=e[236];let $t;return e[237]!==q||e[238]!==J||e[239]!==Y||e[240]!==X||e[241]!==Qt?($t=(0,C.jsxs)(C.Fragment,{children:[q,J,Y,X,Qt]}),e[237]=q,e[238]=J,e[239]=Y,e[240]=X,e[241]=Qt,e[242]=$t):$t=e[242],$t}function E(e){return(0,C.jsxs)(s,{value:e.TargetGroupArn??``,children:[e.TargetGroupName,` · `,e.Protocol,`:`,e.Port]},e.TargetGroupArn)}function D(e){let{field:t}=e;return(0,C.jsxs)(`div`,{className:`flex gap-4`,children:[(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Create new target group`,checked:t.value===`new`,name:`tg-mode`,onChange:()=>{t.onChange(`new`)},type:`radio`}),`Create new`]}),(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Use existing target group`,checked:t.value===`existing`,name:`tg-mode`,onChange:()=>{t.onChange(`existing`)},type:`radio`}),`Use existing`]})]})}function we(e){return(0,C.jsx)(s,{value:e.Name??``,children:e.Name},e.Name)}function Te(e){return(0,C.jsx)(s,{value:e.CertificateArn??``,children:e.DomainName??e.CertificateArn?.split(`/`).pop()},e.CertificateArn)}function O(e){return(0,C.jsx)(s,{value:e,children:e},e)}function Ee(e){return(0,C.jsx)(s,{value:e.VpcId??``,children:w(e)},e.VpcId)}function De(e){let{field:t}=e;return(0,C.jsxs)(`div`,{className:`flex gap-4`,children:[(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Internet-facing`,checked:t.value===`internet-facing`,name:`scheme`,onChange:()=>{t.onChange(`internet-facing`)},type:`radio`}),`Internet-facing`]}),(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsx)(`input`,{"aria-label":`Internal`,checked:t.value===`internal`,name:`scheme`,onChange:()=>{t.onChange(`internal`)},type:`radio`}),`Internal`]})]})}function Oe(e,t){return(0,C.jsxs)(`li`,{children:[e.type,`: `,e.id??`(created)`]},t)}function ke(e,t){let n=e(`name`)||``,r=e(`type`)||`application`,i=e(`scheme`)||`internet-facing`,ee=e(`subnetIds`),a=e(`securityGroupIds`),te=e(`listener.protocol`)||`HTTP`,o=e(`listener.port`)??80,s=e(`listener.certificateArn`),c=e(`listener.sslPolicy`),l=e(`listener.targetGroupMode`),u=e(`listener.existingTargetGroupArn`),d=[],f={type:`comment`,value:r===`network`?`# Create NLB with listener and default target group `:`# Create ALB with listener and default target group diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-nat-gateway.js b/spinifex/services/spinifexui/frontend/dist/assets/create-nat-gateway.js index 771df9d16..c3c0087fd 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-nat-gateway.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-nat-gateway.js @@ -1,4 +1,4 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./link.js";import{t as i}from"./useNavigate.js";import{nn as a}from"./cluster-config.js";import{t as ee}from"./back-link.js";import{c as te,i as o,n as s,s as c,t as l}from"./select.js";import{t as ne}from"./cli-command-panel.js";import{t as re}from"./input.js";import{O as ie,n as ae}from"./ec2.js";import{_ as oe}from"./ec22.js";import{a as se,i as ce,n as le,t as ue}from"./zod.js";import{t as de}from"./error-banner.js";import{t as fe}from"./form-actions.js";import{t as pe}from"./page-heading.js";import{a as u,r as me,t as d}from"./field.js";import{l as he}from"./ec23.js";var ge=t(),f=e();function p(){let e=(0,ge.c)(68),t=i(),{data:a}=n(ie),{data:o}=n(ae),p=oe(),m;e[0]===a.Subnets?m=e[1]:(m=a.Subnets??[],e[0]=a.Subnets,e[1]=m);let h=m,g;e[2]===h?g=e[3]:(g=h.filter(be),e[2]=h,e[3]=g);let _=g,v=_.length>0?_:h,y;e[4]===o.Addresses?y=e[5]:(y=o.Addresses??[],e[4]=o.Addresses,e[5]=y);let b;e[6]===y?b=e[7]:(b=y.filter(ye),e[6]=y,e[7]=b);let x=b,S;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(S={resolver:ue(he),defaultValues:{subnetId:``,allocationId:``,name:``}},e[8]=S):S=e[8];let{control:C,handleSubmit:w,register:T,formState:Se}=ce(S),{errors:E,isSubmitting:D}=Se,O;e[9]===C?O=e[10]:(O={control:C},e[9]=C,e[10]=O);let k=se(O),A;e[11]!==p||e[12]!==t?(A=async e=>{let n=(await p.mutateAsync({subnetId:e.subnetId,allocationId:e.allocationId,name:e.name?.trim()??void 0})).NatGateway?.NatGatewayId;t(n?{to:`/ec2/describe-nat-gateways/$id`,params:{id:n}}:{to:`/ec2/describe-nat-gateways`})},e[11]=p,e[12]=t,e[13]=A):A=e[13];let j=A,M,N;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,f.jsx)(ee,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),N=(0,f.jsx)(pe,{title:`Create NAT Gateway`}),e[14]=M,e[15]=N):(M=e[14],N=e[15]);let P;e[16]===p.error?P=e[17]:(P=p.error&&(0,f.jsx)(de,{error:p.error,msg:`Failed to create NAT Gateway`}),e[16]=p.error,e[17]=P);let F;e[18]!==w||e[19]!==j?(F=w(j),e[18]=w,e[19]=j,e[20]=F):F=e[20];let I;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,f.jsx)(u,{children:(0,f.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),e[21]=I):I=e[21];let L;e[22]===T?L=e[23]:(L=T(`name`),e[22]=T,e[23]=L);let R;e[24]===L?R=e[25]:(R=(0,f.jsxs)(d,{children:[I,(0,f.jsx)(re,{id:`name`,placeholder:`my-nat-gateway`,...L})]}),e[24]=L,e[25]=R);let z;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,f.jsx)(u,{children:(0,f.jsx)(`label`,{htmlFor:`subnetId`,children:`Public subnet`})}),e[26]=z):z=e[26];let B;e[27]!==E.subnetId||e[28]!==v?(B=e=>{let{field:t}=e;return(0,f.jsxs)(l,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,f.jsx)(c,{"aria-invalid":!!E.subnetId,className:`w-full`,id:`subnetId`,children:(0,f.jsx)(te,{placeholder:`Select a public subnet`})}),(0,f.jsx)(s,{children:v.map(ve)})]})},e[27]=E.subnetId,e[28]=v,e[29]=B):B=e[29];let V;e[30]!==C||e[31]!==B?(V=(0,f.jsx)(le,{control:C,name:`subnetId`,render:B}),e[30]=C,e[31]=B,e[32]=V):V=e[32];let H;e[33]===E.subnetId?H=e[34]:(H=(0,f.jsx)(me,{errors:[E.subnetId]}),e[33]=E.subnetId,e[34]=H);let U;e[35]!==V||e[36]!==H?(U=(0,f.jsxs)(d,{children:[z,V,H]}),e[35]=V,e[36]=H,e[37]=U):U=e[37];let W;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,f.jsx)(u,{children:(0,f.jsx)(`label`,{htmlFor:`allocationId`,children:`Elastic IP`})}),e[38]=W):W=e[38];let G;e[39]!==x||e[40]!==C||e[41]!==E.allocationId?(G=x.length>0?(0,f.jsx)(le,{control:C,name:`allocationId`,render:e=>{let{field:t}=e;return(0,f.jsxs)(l,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,f.jsx)(c,{"aria-invalid":!!E.allocationId,className:`w-full`,id:`allocationId`,children:(0,f.jsx)(te,{placeholder:`Select an Elastic IP`})}),(0,f.jsx)(s,{children:x.map(_e)})]})}}):(0,f.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No available Elastic IPs.`,` `,(0,f.jsx)(r,{className:`text-primary hover:underline`,to:`/ec2/allocate-address`,children:`Allocate one`}),` `,`first.`]}),e[39]=x,e[40]=C,e[41]=E.allocationId,e[42]=G):G=e[42];let K;e[43]===E.allocationId?K=e[44]:(K=(0,f.jsx)(me,{errors:[E.allocationId]}),e[43]=E.allocationId,e[44]=K);let q;e[45]!==G||e[46]!==K?(q=(0,f.jsxs)(d,{children:[W,G,K]}),e[45]=G,e[46]=K,e[47]=q):q=e[47];let J;e[48]===k?J=e[49]:(J=xe(k),e[48]=k,e[49]=J);let Y;e[50]===J?Y=e[51]:(Y=(0,f.jsx)(ne,{commands:J}),e[50]=J,e[51]=Y);let X;e[52]===t?X=e[53]:(X=async()=>await t({to:`/ec2/describe-nat-gateways`}),e[52]=t,e[53]=X);let Z;e[54]!==p.isPending||e[55]!==D||e[56]!==X?(Z=(0,f.jsx)(fe,{isPending:p.isPending,isSubmitting:D,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create NAT Gateway`}),e[54]=p.isPending,e[55]=D,e[56]=X,e[57]=Z):Z=e[57];let Q;e[58]!==F||e[59]!==R||e[60]!==U||e[61]!==q||e[62]!==Y||e[63]!==Z?(Q=(0,f.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[R,U,q,Y,Z]}),e[58]=F,e[59]=R,e[60]=U,e[61]=q,e[62]=Y,e[63]=Z,e[64]=Q):Q=e[64];let $;return e[65]!==P||e[66]!==Q?($=(0,f.jsxs)(f.Fragment,{children:[M,N,P,Q]}),e[65]=P,e[66]=Q,e[67]=$):$=e[67],$}function _e(e){return(0,f.jsx)(o,{value:e.AllocationId??``,children:`${e.AllocationId} (${e.PublicIp})`},e.AllocationId)}function ve(e){let t=a(e.Tags);return(0,f.jsx)(o,{value:e.SubnetId??``,children:t?`${e.SubnetId} (${t})`:`${e.SubnetId} (${e.CidrBlock})`},e.SubnetId)}function ye(e){return!e.AssociationId}function be(e){return e.MapPublicIpOnLaunch}function xe(e){let t=e.subnetId??``,n=e.allocationId??``,r=e.name??``,i=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-nat-gateway`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./link.js";import{t as i}from"./useNavigate.js";import{nn as a}from"./cluster-config.js";import{t as ee}from"./back-link.js";import{c as te,i as o,n as s,s as c,t as l}from"./select.js";import{t as ne}from"./cli-command-panel.js";import{t as re}from"./input.js";import{O as ie,n as ae}from"./ec2.js";import{_ as oe}from"./ec22.js";import{a as se,i as ce,n as le,t as ue}from"./zod.js";import{t as de}from"./error-banner.js";import{t as fe}from"./form-actions.js";import{t as pe}from"./page-heading.js";import{a as u,r as me,t as d}from"./field.js";import{l as he}from"./ec23.js";var ge=t(),f=e();function p(){let e=(0,ge.c)(68),t=i(),{data:a}=n(ie),{data:o}=n(ae),p=oe(),m;e[0]===a.Subnets?m=e[1]:(m=a.Subnets??[],e[0]=a.Subnets,e[1]=m);let h=m,g;e[2]===h?g=e[3]:(g=h.filter(be),e[2]=h,e[3]=g);let _=g,v=_.length>0?_:h,y;e[4]===o.Addresses?y=e[5]:(y=o.Addresses??[],e[4]=o.Addresses,e[5]=y);let b;e[6]===y?b=e[7]:(b=y.filter(ye),e[6]=y,e[7]=b);let x=b,S;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(S={resolver:ue(he),defaultValues:{subnetId:``,allocationId:``,name:``}},e[8]=S):S=e[8];let{control:C,handleSubmit:w,register:T,formState:Se}=ce(S),{errors:E,isSubmitting:D}=Se,O;e[9]===C?O=e[10]:(O={control:C},e[9]=C,e[10]=O);let k=se(O),A;e[11]!==p||e[12]!==t?(A=async e=>{let n=(await p.mutateAsync({subnetId:e.subnetId,allocationId:e.allocationId,name:e.name?.trim()??void 0})).NatGateway?.NatGatewayId;t(n?{to:`/ec2/describe-nat-gateways/$id`,params:{id:n}}:{to:`/ec2/describe-nat-gateways`})},e[11]=p,e[12]=t,e[13]=A):A=e[13];let j=A,M,N;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,f.jsx)(ee,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),N=(0,f.jsx)(pe,{title:`Create NAT Gateway`}),e[14]=M,e[15]=N):(M=e[14],N=e[15]);let P;e[16]===p.error?P=e[17]:(P=p.error&&(0,f.jsx)(de,{error:p.error,msg:`Failed to create NAT Gateway`}),e[16]=p.error,e[17]=P);let F;e[18]!==w||e[19]!==j?(F=w(j),e[18]=w,e[19]=j,e[20]=F):F=e[20];let I;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,f.jsx)(u,{children:(0,f.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),e[21]=I):I=e[21];let L;e[22]===T?L=e[23]:(L=T(`name`),e[22]=T,e[23]=L);let R;e[24]===L?R=e[25]:(R=(0,f.jsxs)(d,{children:[I,(0,f.jsx)(re,{id:`name`,placeholder:`my-nat-gateway`,...L})]}),e[24]=L,e[25]=R);let z;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,f.jsx)(u,{children:(0,f.jsx)(`label`,{htmlFor:`subnetId`,children:`Public subnet`})}),e[26]=z):z=e[26];let B;e[27]!==E.subnetId||e[28]!==v?(B=e=>{let{field:t}=e;return(0,f.jsxs)(l,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,f.jsx)(c,{"aria-invalid":!!E.subnetId,className:`w-full`,id:`subnetId`,children:(0,f.jsx)(te,{placeholder:`Select a public subnet`})}),(0,f.jsx)(s,{children:v.map(ve)})]})},e[27]=E.subnetId,e[28]=v,e[29]=B):B=e[29];let V;e[30]!==C||e[31]!==B?(V=(0,f.jsx)(le,{control:C,name:`subnetId`,render:B}),e[30]=C,e[31]=B,e[32]=V):V=e[32];let H;e[33]===E.subnetId?H=e[34]:(H=(0,f.jsx)(me,{errors:[E.subnetId]}),e[33]=E.subnetId,e[34]=H);let U;e[35]!==V||e[36]!==H?(U=(0,f.jsxs)(d,{children:[z,V,H]}),e[35]=V,e[36]=H,e[37]=U):U=e[37];let W;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,f.jsx)(u,{children:(0,f.jsx)(`label`,{htmlFor:`allocationId`,children:`Elastic IP`})}),e[38]=W):W=e[38];let G;e[39]!==x||e[40]!==C||e[41]!==E.allocationId?(G=x.length>0?(0,f.jsx)(le,{control:C,name:`allocationId`,render:e=>{let{field:t}=e;return(0,f.jsxs)(l,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,f.jsx)(c,{"aria-invalid":!!E.allocationId,className:`w-full`,id:`allocationId`,children:(0,f.jsx)(te,{placeholder:`Select an Elastic IP`})}),(0,f.jsx)(s,{children:x.map(_e)})]})}}):(0,f.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No available Elastic IPs.`,` `,(0,f.jsx)(r,{className:`text-primary hover:underline`,to:`/ec2/allocate-address`,children:`Allocate one`}),` `,`first.`]}),e[39]=x,e[40]=C,e[41]=E.allocationId,e[42]=G):G=e[42];let K;e[43]===E.allocationId?K=e[44]:(K=(0,f.jsx)(me,{errors:[E.allocationId]}),e[43]=E.allocationId,e[44]=K);let q;e[45]!==G||e[46]!==K?(q=(0,f.jsxs)(d,{children:[W,G,K]}),e[45]=G,e[46]=K,e[47]=q):q=e[47];let J;e[48]===k?J=e[49]:(J=xe(k),e[48]=k,e[49]=J);let Y;e[50]===J?Y=e[51]:(Y=(0,f.jsx)(ne,{commands:J}),e[50]=J,e[51]=Y);let X;e[52]===t?X=e[53]:(X=async()=>{await t({to:`/ec2/describe-nat-gateways`})},e[52]=t,e[53]=X);let Z;e[54]!==p.isPending||e[55]!==D||e[56]!==X?(Z=(0,f.jsx)(fe,{isPending:p.isPending,isSubmitting:D,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create NAT Gateway`}),e[54]=p.isPending,e[55]=D,e[56]=X,e[57]=Z):Z=e[57];let Q;e[58]!==F||e[59]!==R||e[60]!==U||e[61]!==q||e[62]!==Y||e[63]!==Z?(Q=(0,f.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[R,U,q,Y,Z]}),e[58]=F,e[59]=R,e[60]=U,e[61]=q,e[62]=Y,e[63]=Z,e[64]=Q):Q=e[64];let $;return e[65]!==P||e[66]!==Q?($=(0,f.jsxs)(f.Fragment,{children:[M,N,P,Q]}),e[65]=P,e[66]=Q,e[67]=$):$=e[67],$}function _e(e){return(0,f.jsx)(o,{value:e.AllocationId??``,children:`${e.AllocationId} (${e.PublicIp})`},e.AllocationId)}function ve(e){let t=a(e.Tags);return(0,f.jsx)(o,{value:e.SubnetId??``,children:t?`${e.SubnetId} (${t})`:`${e.SubnetId} (${e.CidrBlock})`},e.SubnetId)}function ye(e){return!e.AssociationId}function be(e){return e.MapPublicIpOnLaunch}function xe(e){let t=e.subnetId??``,n=e.allocationId??``,r=e.name??``,i=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-nat-gateway`},{type:`flag`,value:` \\ --subnet-id`},{type:`value`,value:` ${t||``}`},{type:`flag`,value:` \\ --allocation-id`},{type:`value`,value:` ${n||``}`}];return r.trim()&&i.push({type:`flag`,value:` \\ --tag-specifications`},{type:`value`,value:` 'ResourceType=natgateway,Tags=[{Key=Name,Value=${r.trim()}}]'`}),[{label:`Create NAT Gateway`,parts:i}]}export{p as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-placement-group.js b/spinifex/services/spinifexui/frontend/dist/assets/create-placement-group.js index 10de69745..32935facc 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-placement-group.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-placement-group.js @@ -1,3 +1,3 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as ee}from"./back-link.js";import{c as r,i,n as te,s as a,t as ne}from"./select.js";import{t as re}from"./cli-command-panel.js";import{t as o}from"./input.js";import{v as s}from"./ec22.js";import{a as c,i as l,n as u,t as d}from"./zod.js";import{t as f}from"./error-banner.js";import{t as p}from"./form-actions.js";import{t as m}from"./page-heading.js";import{a as h,r as g,t as _}from"./field.js";import{u as v}from"./ec23.js";var y=t(),b=e();function x(){let e=(0,y.c)(54),t=n(),x=s(),S;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(S={resolver:d(v),defaultValues:{groupName:``,strategy:`spread`}},e[0]=S):S=e[0];let{control:C,handleSubmit:w,register:T,formState:E}=l(S),{errors:D,isSubmitting:O}=E,k;e[1]===C?k=e[2]:(k={control:C},e[1]=C,e[2]=k);let A=c(k),j;e[3]!==x||e[4]!==t?(j=async e=>{let n=await x.mutateAsync(e);t({to:`/ec2/describe-placement-groups/$id`,params:{id:n.PlacementGroup?.GroupId??``}})},e[3]=x,e[4]=t,e[5]=j):j=e[5];let M=j,N,P;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,b.jsx)(ee,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),P=(0,b.jsx)(m,{title:`Create Placement Group`}),e[6]=N,e[7]=P):(N=e[6],P=e[7]);let F;e[8]===x.error?F=e[9]:(F=x.error&&(0,b.jsx)(f,{error:x.error,msg:`Failed to create placement group`}),e[8]=x.error,e[9]=F);let I;e[10]!==w||e[11]!==M?(I=w(M),e[10]=w,e[11]=M,e[12]=I):I=e[12];let L;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,b.jsx)(h,{children:(0,b.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),e[13]=L):L=e[13];let R=!!D.groupName,z;e[14]===T?z=e[15]:(z=T(`groupName`),e[14]=T,e[15]=z);let B;e[16]!==z||e[17]!==R?(B=(0,b.jsx)(o,{"aria-invalid":R,id:`groupName`,placeholder:`my-placement-group`,...z}),e[16]=z,e[17]=R,e[18]=B):B=e[18];let V;e[19]===D.groupName?V=e[20]:(V=(0,b.jsx)(g,{errors:[D.groupName]}),e[19]=D.groupName,e[20]=V);let H;e[21]!==B||e[22]!==V?(H=(0,b.jsxs)(_,{children:[L,B,V]}),e[21]=B,e[22]=V,e[23]=H):H=e[23];let U;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,b.jsx)(h,{children:(0,b.jsx)(`label`,{htmlFor:`strategy`,children:`Strategy`})}),e[24]=U):U=e[24];let W;e[25]===D.strategy?W=e[26]:(W=e=>{let{field:t}=e;return(0,b.jsxs)(ne,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,b.jsx)(a,{"aria-invalid":!!D.strategy,className:`w-full`,id:`strategy`,children:(0,b.jsx)(r,{})}),(0,b.jsxs)(te,{children:[(0,b.jsx)(i,{value:`spread`,children:`spread`}),(0,b.jsx)(i,{value:`cluster`,children:`cluster`})]})]})},e[25]=D.strategy,e[26]=W);let G;e[27]!==C||e[28]!==W?(G=(0,b.jsx)(u,{control:C,name:`strategy`,render:W}),e[27]=C,e[28]=W,e[29]=G):G=e[29];let K;e[30]===D.strategy?K=e[31]:(K=(0,b.jsx)(g,{errors:[D.strategy]}),e[30]=D.strategy,e[31]=K);let q;e[32]!==G||e[33]!==K?(q=(0,b.jsxs)(_,{children:[U,G,K]}),e[32]=G,e[33]=K,e[34]=q):q=e[34];let J;e[35]===A?J=e[36]:(J=ie(A),e[35]=A,e[36]=J);let Y;e[37]===J?Y=e[38]:(Y=(0,b.jsx)(re,{commands:J}),e[37]=J,e[38]=Y);let X;e[39]===t?X=e[40]:(X=async()=>await t({to:`/ec2/describe-placement-groups`}),e[39]=t,e[40]=X);let Z;e[41]!==x.isPending||e[42]!==O||e[43]!==X?(Z=(0,b.jsx)(p,{isPending:x.isPending,isSubmitting:O,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Placement Group`}),e[41]=x.isPending,e[42]=O,e[43]=X,e[44]=Z):Z=e[44];let Q;e[45]!==H||e[46]!==q||e[47]!==Y||e[48]!==Z||e[49]!==I?(Q=(0,b.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),e[45]=H,e[46]=q,e[47]=Y,e[48]=Z,e[49]=I,e[50]=Q):Q=e[50];let $;return e[51]!==Q||e[52]!==F?($=(0,b.jsxs)(b.Fragment,{children:[N,P,F,Q]}),e[51]=Q,e[52]=F,e[53]=$):$=e[53],$}function S(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function ie(e){let t=e.groupName??``,n=e.strategy??``;return[{label:`Create Placement Group`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-placement-group`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as ee}from"./back-link.js";import{c as r,i,n as te,s as a,t as ne}from"./select.js";import{t as re}from"./cli-command-panel.js";import{t as o}from"./input.js";import{v as s}from"./ec22.js";import{a as c,i as l,n as u,t as d}from"./zod.js";import{t as f}from"./error-banner.js";import{t as p}from"./form-actions.js";import{t as m}from"./page-heading.js";import{a as h,r as g,t as _}from"./field.js";import{u as v}from"./ec23.js";var y=t(),b=e();function x(){let e=(0,y.c)(54),t=n(),x=s(),S;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(S={resolver:d(v),defaultValues:{groupName:``,strategy:`spread`}},e[0]=S):S=e[0];let{control:C,handleSubmit:w,register:T,formState:E}=l(S),{errors:D,isSubmitting:O}=E,k;e[1]===C?k=e[2]:(k={control:C},e[1]=C,e[2]=k);let A=c(k),j;e[3]!==x||e[4]!==t?(j=async e=>{let n=await x.mutateAsync(e);t({to:`/ec2/describe-placement-groups/$id`,params:{id:n.PlacementGroup?.GroupId??``}})},e[3]=x,e[4]=t,e[5]=j):j=e[5];let M=j,N,P;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,b.jsx)(ee,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),P=(0,b.jsx)(m,{title:`Create Placement Group`}),e[6]=N,e[7]=P):(N=e[6],P=e[7]);let F;e[8]===x.error?F=e[9]:(F=x.error&&(0,b.jsx)(f,{error:x.error,msg:`Failed to create placement group`}),e[8]=x.error,e[9]=F);let I;e[10]!==w||e[11]!==M?(I=w(M),e[10]=w,e[11]=M,e[12]=I):I=e[12];let L;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,b.jsx)(h,{children:(0,b.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),e[13]=L):L=e[13];let R=!!D.groupName,z;e[14]===T?z=e[15]:(z=T(`groupName`),e[14]=T,e[15]=z);let B;e[16]!==z||e[17]!==R?(B=(0,b.jsx)(o,{"aria-invalid":R,id:`groupName`,placeholder:`my-placement-group`,...z}),e[16]=z,e[17]=R,e[18]=B):B=e[18];let V;e[19]===D.groupName?V=e[20]:(V=(0,b.jsx)(g,{errors:[D.groupName]}),e[19]=D.groupName,e[20]=V);let H;e[21]!==B||e[22]!==V?(H=(0,b.jsxs)(_,{children:[L,B,V]}),e[21]=B,e[22]=V,e[23]=H):H=e[23];let U;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,b.jsx)(h,{children:(0,b.jsx)(`label`,{htmlFor:`strategy`,children:`Strategy`})}),e[24]=U):U=e[24];let W;e[25]===D.strategy?W=e[26]:(W=e=>{let{field:t}=e;return(0,b.jsxs)(ne,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,b.jsx)(a,{"aria-invalid":!!D.strategy,className:`w-full`,id:`strategy`,children:(0,b.jsx)(r,{})}),(0,b.jsxs)(te,{children:[(0,b.jsx)(i,{value:`spread`,children:`spread`}),(0,b.jsx)(i,{value:`cluster`,children:`cluster`})]})]})},e[25]=D.strategy,e[26]=W);let G;e[27]!==C||e[28]!==W?(G=(0,b.jsx)(u,{control:C,name:`strategy`,render:W}),e[27]=C,e[28]=W,e[29]=G):G=e[29];let K;e[30]===D.strategy?K=e[31]:(K=(0,b.jsx)(g,{errors:[D.strategy]}),e[30]=D.strategy,e[31]=K);let q;e[32]!==G||e[33]!==K?(q=(0,b.jsxs)(_,{children:[U,G,K]}),e[32]=G,e[33]=K,e[34]=q):q=e[34];let J;e[35]===A?J=e[36]:(J=ie(A),e[35]=A,e[36]=J);let Y;e[37]===J?Y=e[38]:(Y=(0,b.jsx)(re,{commands:J}),e[37]=J,e[38]=Y);let X;e[39]===t?X=e[40]:(X=async()=>{await t({to:`/ec2/describe-placement-groups`})},e[39]=t,e[40]=X);let Z;e[41]!==x.isPending||e[42]!==O||e[43]!==X?(Z=(0,b.jsx)(p,{isPending:x.isPending,isSubmitting:O,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Placement Group`}),e[41]=x.isPending,e[42]=O,e[43]=X,e[44]=Z):Z=e[44];let Q;e[45]!==H||e[46]!==q||e[47]!==Y||e[48]!==Z||e[49]!==I?(Q=(0,b.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),e[45]=H,e[46]=q,e[47]=Y,e[48]=Z,e[49]=I,e[50]=Q):Q=e[50];let $;return e[51]!==Q||e[52]!==F?($=(0,b.jsxs)(b.Fragment,{children:[N,P,F,Q]}),e[51]=Q,e[52]=F,e[53]=$):$=e[53],$}function S(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function ie(e){let t=e.groupName??``,n=e.strategy??``;return[{label:`Create Placement Group`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-placement-group`},{type:`flag`,value:` \\ --group-name`},{type:`value`,value:` ${t?S(t):``}`},{type:`flag`,value:` \\ --strategy`},{type:`value`,value:` ${n||`spread`}`}]}]}export{x as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-policy.js b/spinifex/services/spinifexui/frontend/dist/assets/create-policy.js index 544e0252e..d065d005d 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-policy.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-policy.js @@ -1,4 +1,4 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{l as ee}from"./iam.js";import{a as o,i as s,n as c,t as l}from"./zod.js";import{t as te}from"./error-banner.js";import{t as ne}from"./form-actions.js";import{t as re}from"./page-heading.js";import{a as u,r as d,t as f}from"./field.js";import{t as ie}from"./json-editor.js";import{i as ae}from"./iam3.js";var p=t(),m=e(),h=JSON.stringify({Version:`2012-10-17`,Statement:[{Effect:`Allow`,Action:`*`,Resource:`*`}]},null,2);function g(){let e=(0,p.c)(65),t=n(),g=ee(),v;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={resolver:l(ae),defaultValues:{policyDocument:h}},e[0]=v):v=e[0];let{handleSubmit:y,register:b,control:x,formState:oe}=s(v),{errors:S,isSubmitting:C}=oe,w;e[1]===x?w=e[2]:(w={control:x},e[1]=x,e[2]=w);let T=o(w),E;e[3]!==g||e[4]!==t?(E=async e=>{await g.mutateAsync(e),t({to:`/iam/list-policies`})},e[3]=g,e[4]=t,e[5]=E):E=e[5];let D=E,O,k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,m.jsx)(r,{to:`/iam/list-policies`,children:`Back to policies`}),k=(0,m.jsx)(re,{title:`Create Policy`}),e[6]=O,e[7]=k):(O=e[6],k=e[7]);let A;e[8]===g.error?A=e[9]:(A=g.error&&(0,m.jsx)(te,{error:g.error,msg:`Failed to create policy`}),e[8]=g.error,e[9]=A);let j;e[10]!==y||e[11]!==D?(j=y(D),e[10]=y,e[11]=D,e[12]=j):j=e[12];let M;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,m.jsx)(u,{children:(0,m.jsx)(`label`,{htmlFor:`policyName`,children:`Policy Name`})}),e[13]=M):M=e[13];let N=!!S.policyName,P;e[14]===b?P=e[15]:(P=b(`policyName`),e[14]=b,e[15]=P);let F;e[16]!==P||e[17]!==N?(F=(0,m.jsx)(a,{"aria-invalid":N,id:`policyName`,placeholder:`my-policy...`,...P}),e[16]=P,e[17]=N,e[18]=F):F=e[18];let I;e[19]===S.policyName?I=e[20]:(I=(0,m.jsx)(d,{errors:[S.policyName]}),e[19]=S.policyName,e[20]=I);let L;e[21]!==F||e[22]!==I?(L=(0,m.jsxs)(f,{children:[M,F,I]}),e[21]=F,e[22]=I,e[23]=L):L=e[23];let R;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,m.jsx)(u,{children:(0,m.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),e[24]=R):R=e[24];let z;e[25]===b?z=e[26]:(z=b(`description`),e[25]=b,e[26]=z);let B;e[27]===z?B=e[28]:(B=(0,m.jsx)(a,{id:`description`,placeholder:`A brief description of this policy...`,...z}),e[27]=z,e[28]=B);let V;e[29]===S.description?V=e[30]:(V=(0,m.jsx)(d,{errors:[S.description]}),e[29]=S.description,e[30]=V);let H;e[31]!==B||e[32]!==V?(H=(0,m.jsxs)(f,{children:[R,B,V]}),e[31]=B,e[32]=V,e[33]=H):H=e[33];let U;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,m.jsx)(u,{children:(0,m.jsx)(`label`,{htmlFor:`policyDocument`,children:`Policy Document (JSON)`})}),e[34]=U):U=e[34];let W;e[35]===S.policyDocument?W=e[36]:(W=e=>{let{field:t}=e,{onBlur:n,onChange:r,ref:i,value:a}=t;return(0,m.jsx)(ie,{error:!!S.policyDocument,id:`policyDocument`,onBlur:n,onChange:r,ref:i,rows:15,value:a})},e[35]=S.policyDocument,e[36]=W);let G;e[37]!==x||e[38]!==W?(G=(0,m.jsx)(c,{control:x,name:`policyDocument`,render:W}),e[37]=x,e[38]=W,e[39]=G):G=e[39];let K;e[40]===S.policyDocument?K=e[41]:(K=(0,m.jsx)(d,{errors:[S.policyDocument]}),e[40]=S.policyDocument,e[41]=K);let q;e[42]!==G||e[43]!==K?(q=(0,m.jsxs)(f,{children:[U,G,K]}),e[42]=G,e[43]=K,e[44]=q):q=e[44];let J;e[45]===T?J=e[46]:(J=_(T),e[45]=T,e[46]=J);let Y;e[47]===J?Y=e[48]:(Y=(0,m.jsx)(i,{commands:J}),e[47]=J,e[48]=Y);let X;e[49]===t?X=e[50]:(X=async()=>await t({to:`/iam/list-policies`}),e[49]=t,e[50]=X);let Z;e[51]!==g.isPending||e[52]!==C||e[53]!==X?(Z=(0,m.jsx)(ne,{isPending:g.isPending,isSubmitting:C,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create Policy`}),e[51]=g.isPending,e[52]=C,e[53]=X,e[54]=Z):Z=e[54];let Q;e[55]!==L||e[56]!==H||e[57]!==q||e[58]!==Y||e[59]!==Z||e[60]!==j?(Q=(0,m.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:j,children:[L,H,q,Y,Z]}),e[55]=L,e[56]=H,e[57]=q,e[58]=Y,e[59]=Z,e[60]=j,e[61]=Q):Q=e[61];let $;return e[62]!==Q||e[63]!==A?($=(0,m.jsxs)(m.Fragment,{children:[O,k,A,Q]}),e[62]=Q,e[63]=A,e[64]=$):$=e[64],$}function _(e){let t=e.policyName??``,n=e.description??``,r=e.policyDocument??``,i=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-policy`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{l as ee}from"./iam.js";import{a as o,i as s,n as c,t as l}from"./zod.js";import{t as te}from"./error-banner.js";import{t as ne}from"./form-actions.js";import{t as re}from"./page-heading.js";import{a as u,r as d,t as f}from"./field.js";import{t as ie}from"./json-editor.js";import{i as ae}from"./iam3.js";var p=t(),m=e(),h=JSON.stringify({Version:`2012-10-17`,Statement:[{Effect:`Allow`,Action:`*`,Resource:`*`}]},null,2);function g(){let e=(0,p.c)(65),t=n(),g=ee(),v;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={resolver:l(ae),defaultValues:{policyDocument:h}},e[0]=v):v=e[0];let{handleSubmit:y,register:b,control:x,formState:oe}=s(v),{errors:S,isSubmitting:C}=oe,w;e[1]===x?w=e[2]:(w={control:x},e[1]=x,e[2]=w);let T=o(w),E;e[3]!==g||e[4]!==t?(E=async e=>{await g.mutateAsync(e),t({to:`/iam/list-policies`})},e[3]=g,e[4]=t,e[5]=E):E=e[5];let D=E,O,k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,m.jsx)(r,{to:`/iam/list-policies`,children:`Back to policies`}),k=(0,m.jsx)(re,{title:`Create Policy`}),e[6]=O,e[7]=k):(O=e[6],k=e[7]);let A;e[8]===g.error?A=e[9]:(A=g.error&&(0,m.jsx)(te,{error:g.error,msg:`Failed to create policy`}),e[8]=g.error,e[9]=A);let j;e[10]!==y||e[11]!==D?(j=y(D),e[10]=y,e[11]=D,e[12]=j):j=e[12];let M;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,m.jsx)(u,{children:(0,m.jsx)(`label`,{htmlFor:`policyName`,children:`Policy Name`})}),e[13]=M):M=e[13];let N=!!S.policyName,P;e[14]===b?P=e[15]:(P=b(`policyName`),e[14]=b,e[15]=P);let F;e[16]!==P||e[17]!==N?(F=(0,m.jsx)(a,{"aria-invalid":N,id:`policyName`,placeholder:`my-policy...`,...P}),e[16]=P,e[17]=N,e[18]=F):F=e[18];let I;e[19]===S.policyName?I=e[20]:(I=(0,m.jsx)(d,{errors:[S.policyName]}),e[19]=S.policyName,e[20]=I);let L;e[21]!==F||e[22]!==I?(L=(0,m.jsxs)(f,{children:[M,F,I]}),e[21]=F,e[22]=I,e[23]=L):L=e[23];let R;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,m.jsx)(u,{children:(0,m.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),e[24]=R):R=e[24];let z;e[25]===b?z=e[26]:(z=b(`description`),e[25]=b,e[26]=z);let B;e[27]===z?B=e[28]:(B=(0,m.jsx)(a,{id:`description`,placeholder:`A brief description of this policy...`,...z}),e[27]=z,e[28]=B);let V;e[29]===S.description?V=e[30]:(V=(0,m.jsx)(d,{errors:[S.description]}),e[29]=S.description,e[30]=V);let H;e[31]!==B||e[32]!==V?(H=(0,m.jsxs)(f,{children:[R,B,V]}),e[31]=B,e[32]=V,e[33]=H):H=e[33];let U;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,m.jsx)(u,{children:(0,m.jsx)(`label`,{htmlFor:`policyDocument`,children:`Policy Document (JSON)`})}),e[34]=U):U=e[34];let W;e[35]===S.policyDocument?W=e[36]:(W=e=>{let{field:t}=e,{onBlur:n,onChange:r,ref:i,value:a}=t;return(0,m.jsx)(ie,{error:!!S.policyDocument,id:`policyDocument`,onBlur:n,onChange:r,ref:i,rows:15,value:a})},e[35]=S.policyDocument,e[36]=W);let G;e[37]!==x||e[38]!==W?(G=(0,m.jsx)(c,{control:x,name:`policyDocument`,render:W}),e[37]=x,e[38]=W,e[39]=G):G=e[39];let K;e[40]===S.policyDocument?K=e[41]:(K=(0,m.jsx)(d,{errors:[S.policyDocument]}),e[40]=S.policyDocument,e[41]=K);let q;e[42]!==G||e[43]!==K?(q=(0,m.jsxs)(f,{children:[U,G,K]}),e[42]=G,e[43]=K,e[44]=q):q=e[44];let J;e[45]===T?J=e[46]:(J=_(T),e[45]=T,e[46]=J);let Y;e[47]===J?Y=e[48]:(Y=(0,m.jsx)(i,{commands:J}),e[47]=J,e[48]=Y);let X;e[49]===t?X=e[50]:(X=async()=>{await t({to:`/iam/list-policies`})},e[49]=t,e[50]=X);let Z;e[51]!==g.isPending||e[52]!==C||e[53]!==X?(Z=(0,m.jsx)(ne,{isPending:g.isPending,isSubmitting:C,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create Policy`}),e[51]=g.isPending,e[52]=C,e[53]=X,e[54]=Z):Z=e[54];let Q;e[55]!==L||e[56]!==H||e[57]!==q||e[58]!==Y||e[59]!==Z||e[60]!==j?(Q=(0,m.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:j,children:[L,H,q,Y,Z]}),e[55]=L,e[56]=H,e[57]=q,e[58]=Y,e[59]=Z,e[60]=j,e[61]=Q):Q=e[61];let $;return e[62]!==Q||e[63]!==A?($=(0,m.jsxs)(m.Fragment,{children:[O,k,A,Q]}),e[62]=Q,e[63]=A,e[64]=$):$=e[64],$}function _(e){let t=e.policyName??``,n=e.description??``,r=e.policyDocument??``,i=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-policy`},{type:`flag`,value:` \\ --policy-name`},{type:`value`,value:` ${t||``}`}];return n&&i.push({type:`flag`,value:` \\ --description`},{type:`value`,value:` "${n}"`}),i.push({type:`flag`,value:` \\ --policy-document`},{type:`value`,value:` '${r||``}'`}),[{label:`Create Policy`,parts:i}]}export{g as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-role.js b/spinifex/services/spinifexui/frontend/dist/assets/create-role.js index 9475395a1..77bd5365a 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-role.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-role.js @@ -1,4 +1,4 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{u as ee}from"./iam.js";import{a as o,i as s,n as c,t as l}from"./zod.js";import{t as te}from"./error-banner.js";import{t as ne}from"./form-actions.js";import{t as re}from"./page-heading.js";import{a as u,r as d,t as f}from"./field.js";import{t as ie}from"./json-editor.js";import{a as ae,t as p}from"./iam3.js";var m=t(),h=e();function g(){let e=(0,m.c)(65),t=n(),g=ee(),v;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={resolver:l(ae),defaultValues:{assumeRolePolicyDocument:p}},e[0]=v):v=e[0];let{handleSubmit:y,register:b,control:x,formState:oe}=s(v),{errors:S,isSubmitting:C}=oe,w;e[1]===x?w=e[2]:(w={control:x},e[1]=x,e[2]=w);let T=o(w),E;e[3]!==g||e[4]!==t?(E=async e=>{await g.mutateAsync(e),t({to:`/iam/list-roles`})},e[3]=g,e[4]=t,e[5]=E):E=e[5];let D=E,O,k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,h.jsx)(r,{to:`/iam/list-roles`,children:`Back to roles`}),k=(0,h.jsx)(re,{title:`Create Role`}),e[6]=O,e[7]=k):(O=e[6],k=e[7]);let A;e[8]===g.error?A=e[9]:(A=g.error&&(0,h.jsx)(te,{error:g.error,msg:`Failed to create role`}),e[8]=g.error,e[9]=A);let j;e[10]!==y||e[11]!==D?(j=y(D),e[10]=y,e[11]=D,e[12]=j):j=e[12];let M;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,h.jsx)(u,{children:(0,h.jsx)(`label`,{htmlFor:`roleName`,children:`Role Name`})}),e[13]=M):M=e[13];let N=!!S.roleName,P;e[14]===b?P=e[15]:(P=b(`roleName`),e[14]=b,e[15]=P);let F;e[16]!==P||e[17]!==N?(F=(0,h.jsx)(a,{"aria-invalid":N,id:`roleName`,placeholder:`my-role...`,...P}),e[16]=P,e[17]=N,e[18]=F):F=e[18];let I;e[19]===S.roleName?I=e[20]:(I=(0,h.jsx)(d,{errors:[S.roleName]}),e[19]=S.roleName,e[20]=I);let L;e[21]!==F||e[22]!==I?(L=(0,h.jsxs)(f,{children:[M,F,I]}),e[21]=F,e[22]=I,e[23]=L):L=e[23];let R;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,h.jsx)(u,{children:(0,h.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),e[24]=R):R=e[24];let z;e[25]===b?z=e[26]:(z=b(`description`),e[25]=b,e[26]=z);let B;e[27]===z?B=e[28]:(B=(0,h.jsx)(a,{id:`description`,placeholder:`A brief description of this role...`,...z}),e[27]=z,e[28]=B);let V;e[29]===S.description?V=e[30]:(V=(0,h.jsx)(d,{errors:[S.description]}),e[29]=S.description,e[30]=V);let H;e[31]!==B||e[32]!==V?(H=(0,h.jsxs)(f,{children:[R,B,V]}),e[31]=B,e[32]=V,e[33]=H):H=e[33];let U;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,h.jsx)(u,{children:(0,h.jsx)(`label`,{htmlFor:`assumeRolePolicyDocument`,children:`Trust Policy (JSON)`})}),e[34]=U):U=e[34];let W;e[35]===S.assumeRolePolicyDocument?W=e[36]:(W=e=>{let{field:t}=e,{onBlur:n,onChange:r,ref:i,value:a}=t;return(0,h.jsx)(ie,{error:!!S.assumeRolePolicyDocument,id:`assumeRolePolicyDocument`,onBlur:n,onChange:r,ref:i,rows:15,value:a})},e[35]=S.assumeRolePolicyDocument,e[36]=W);let G;e[37]!==x||e[38]!==W?(G=(0,h.jsx)(c,{control:x,name:`assumeRolePolicyDocument`,render:W}),e[37]=x,e[38]=W,e[39]=G):G=e[39];let K;e[40]===S.assumeRolePolicyDocument?K=e[41]:(K=(0,h.jsx)(d,{errors:[S.assumeRolePolicyDocument]}),e[40]=S.assumeRolePolicyDocument,e[41]=K);let q;e[42]!==G||e[43]!==K?(q=(0,h.jsxs)(f,{children:[U,G,K]}),e[42]=G,e[43]=K,e[44]=q):q=e[44];let J;e[45]===T?J=e[46]:(J=_(T),e[45]=T,e[46]=J);let Y;e[47]===J?Y=e[48]:(Y=(0,h.jsx)(i,{commands:J}),e[47]=J,e[48]=Y);let X;e[49]===t?X=e[50]:(X=async()=>await t({to:`/iam/list-roles`}),e[49]=t,e[50]=X);let Z;e[51]!==g.isPending||e[52]!==C||e[53]!==X?(Z=(0,h.jsx)(ne,{isPending:g.isPending,isSubmitting:C,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create Role`}),e[51]=g.isPending,e[52]=C,e[53]=X,e[54]=Z):Z=e[54];let Q;e[55]!==L||e[56]!==H||e[57]!==q||e[58]!==Y||e[59]!==Z||e[60]!==j?(Q=(0,h.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:j,children:[L,H,q,Y,Z]}),e[55]=L,e[56]=H,e[57]=q,e[58]=Y,e[59]=Z,e[60]=j,e[61]=Q):Q=e[61];let $;return e[62]!==Q||e[63]!==A?($=(0,h.jsxs)(h.Fragment,{children:[O,k,A,Q]}),e[62]=Q,e[63]=A,e[64]=$):$=e[64],$}function _(e){let t=e.roleName??``,n=e.description??``,r=e.assumeRolePolicyDocument??``,i=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-role`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{u as ee}from"./iam.js";import{a as o,i as s,n as c,t as l}from"./zod.js";import{t as te}from"./error-banner.js";import{t as ne}from"./form-actions.js";import{t as re}from"./page-heading.js";import{a as u,r as d,t as f}from"./field.js";import{t as ie}from"./json-editor.js";import{a as ae,t as p}from"./iam3.js";var m=t(),h=e();function g(){let e=(0,m.c)(65),t=n(),g=ee(),v;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={resolver:l(ae),defaultValues:{assumeRolePolicyDocument:p}},e[0]=v):v=e[0];let{handleSubmit:y,register:b,control:x,formState:oe}=s(v),{errors:S,isSubmitting:C}=oe,w;e[1]===x?w=e[2]:(w={control:x},e[1]=x,e[2]=w);let T=o(w),E;e[3]!==g||e[4]!==t?(E=async e=>{await g.mutateAsync(e),t({to:`/iam/list-roles`})},e[3]=g,e[4]=t,e[5]=E):E=e[5];let D=E,O,k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,h.jsx)(r,{to:`/iam/list-roles`,children:`Back to roles`}),k=(0,h.jsx)(re,{title:`Create Role`}),e[6]=O,e[7]=k):(O=e[6],k=e[7]);let A;e[8]===g.error?A=e[9]:(A=g.error&&(0,h.jsx)(te,{error:g.error,msg:`Failed to create role`}),e[8]=g.error,e[9]=A);let j;e[10]!==y||e[11]!==D?(j=y(D),e[10]=y,e[11]=D,e[12]=j):j=e[12];let M;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,h.jsx)(u,{children:(0,h.jsx)(`label`,{htmlFor:`roleName`,children:`Role Name`})}),e[13]=M):M=e[13];let N=!!S.roleName,P;e[14]===b?P=e[15]:(P=b(`roleName`),e[14]=b,e[15]=P);let F;e[16]!==P||e[17]!==N?(F=(0,h.jsx)(a,{"aria-invalid":N,id:`roleName`,placeholder:`my-role...`,...P}),e[16]=P,e[17]=N,e[18]=F):F=e[18];let I;e[19]===S.roleName?I=e[20]:(I=(0,h.jsx)(d,{errors:[S.roleName]}),e[19]=S.roleName,e[20]=I);let L;e[21]!==F||e[22]!==I?(L=(0,h.jsxs)(f,{children:[M,F,I]}),e[21]=F,e[22]=I,e[23]=L):L=e[23];let R;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,h.jsx)(u,{children:(0,h.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),e[24]=R):R=e[24];let z;e[25]===b?z=e[26]:(z=b(`description`),e[25]=b,e[26]=z);let B;e[27]===z?B=e[28]:(B=(0,h.jsx)(a,{id:`description`,placeholder:`A brief description of this role...`,...z}),e[27]=z,e[28]=B);let V;e[29]===S.description?V=e[30]:(V=(0,h.jsx)(d,{errors:[S.description]}),e[29]=S.description,e[30]=V);let H;e[31]!==B||e[32]!==V?(H=(0,h.jsxs)(f,{children:[R,B,V]}),e[31]=B,e[32]=V,e[33]=H):H=e[33];let U;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,h.jsx)(u,{children:(0,h.jsx)(`label`,{htmlFor:`assumeRolePolicyDocument`,children:`Trust Policy (JSON)`})}),e[34]=U):U=e[34];let W;e[35]===S.assumeRolePolicyDocument?W=e[36]:(W=e=>{let{field:t}=e,{onBlur:n,onChange:r,ref:i,value:a}=t;return(0,h.jsx)(ie,{error:!!S.assumeRolePolicyDocument,id:`assumeRolePolicyDocument`,onBlur:n,onChange:r,ref:i,rows:15,value:a})},e[35]=S.assumeRolePolicyDocument,e[36]=W);let G;e[37]!==x||e[38]!==W?(G=(0,h.jsx)(c,{control:x,name:`assumeRolePolicyDocument`,render:W}),e[37]=x,e[38]=W,e[39]=G):G=e[39];let K;e[40]===S.assumeRolePolicyDocument?K=e[41]:(K=(0,h.jsx)(d,{errors:[S.assumeRolePolicyDocument]}),e[40]=S.assumeRolePolicyDocument,e[41]=K);let q;e[42]!==G||e[43]!==K?(q=(0,h.jsxs)(f,{children:[U,G,K]}),e[42]=G,e[43]=K,e[44]=q):q=e[44];let J;e[45]===T?J=e[46]:(J=_(T),e[45]=T,e[46]=J);let Y;e[47]===J?Y=e[48]:(Y=(0,h.jsx)(i,{commands:J}),e[47]=J,e[48]=Y);let X;e[49]===t?X=e[50]:(X=async()=>{await t({to:`/iam/list-roles`})},e[49]=t,e[50]=X);let Z;e[51]!==g.isPending||e[52]!==C||e[53]!==X?(Z=(0,h.jsx)(ne,{isPending:g.isPending,isSubmitting:C,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create Role`}),e[51]=g.isPending,e[52]=C,e[53]=X,e[54]=Z):Z=e[54];let Q;e[55]!==L||e[56]!==H||e[57]!==q||e[58]!==Y||e[59]!==Z||e[60]!==j?(Q=(0,h.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:j,children:[L,H,q,Y,Z]}),e[55]=L,e[56]=H,e[57]=q,e[58]=Y,e[59]=Z,e[60]=j,e[61]=Q):Q=e[61];let $;return e[62]!==Q||e[63]!==A?($=(0,h.jsxs)(h.Fragment,{children:[O,k,A,Q]}),e[62]=Q,e[63]=A,e[64]=$):$=e[64],$}function _(e){let t=e.roleName??``,n=e.description??``,r=e.assumeRolePolicyDocument??``,i=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-role`},{type:`flag`,value:` \\ --role-name`},{type:`value`,value:` ${t||``}`}];return n&&i.push({type:`flag`,value:` \\ --description`},{type:`value`,value:` "${n}"`}),i.push({type:`flag`,value:` \\ --assume-role-policy-document`},{type:`value`,value:` '${r||``}'`}),[{label:`Create Role`,parts:i}]}export{g as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-route-table.js b/spinifex/services/spinifexui/frontend/dist/assets/create-route-table.js index 6ddee783b..bf3acb18d 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-route-table.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-route-table.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{nn as i}from"./cluster-config.js";import{t as a}from"./back-link.js";import{c as o,i as s,n as c,s as l,t as u}from"./select.js";import{t as d}from"./input.js";import{M as f}from"./ec2.js";import{b as p}from"./ec22.js";import{i as m,n as h,t as g}from"./zod.js";import{t as _}from"./error-banner.js";import{t as v}from"./form-actions.js";import{t as y}from"./page-heading.js";import{a as b,r as x,t as S}from"./field.js";import{f as C}from"./ec23.js";var w=t(),T=e();function E(){let e=(0,w.c)(44),t=r(),{data:i}=n(f),s=p(),E;e[0]===i.Vpcs?E=e[1]:(E=i.Vpcs??[],e[0]=i.Vpcs,e[1]=E);let O=E,k;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(k={resolver:g(C),defaultValues:{vpcId:``,name:``}},e[2]=k):k=e[2];let{control:A,handleSubmit:j,register:M,formState:N}=m(k),{errors:P,isSubmitting:F}=N,I;e[3]!==s||e[4]!==t?(I=async e=>{let n=(await s.mutateAsync({vpcId:e.vpcId,name:e.name?.trim()?e.name.trim():void 0})).RouteTable?.RouteTableId;t(n?{to:`/ec2/describe-route-tables/$id`,params:{id:n}}:{to:`/ec2/describe-route-tables`})},e[3]=s,e[4]=t,e[5]=I):I=e[5];let L=I,R,z;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,T.jsx)(a,{to:`/ec2/describe-route-tables`,children:`Back to Route Tables`}),z=(0,T.jsx)(y,{title:`Create Route Table`}),e[6]=R,e[7]=z):(R=e[6],z=e[7]);let B;e[8]===s.error?B=e[9]:(B=s.error&&(0,T.jsx)(_,{error:s.error,msg:`Failed to create Route Table`}),e[8]=s.error,e[9]=B);let V;e[10]!==j||e[11]!==L?(V=j(L),e[10]=j,e[11]=L,e[12]=V):V=e[12];let H;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),e[13]=H):H=e[13];let U;e[14]===M?U=e[15]:(U=M(`name`),e[14]=M,e[15]=U);let W;e[16]===U?W=e[17]:(W=(0,T.jsxs)(S,{children:[H,(0,T.jsx)(d,{id:`name`,placeholder:`my-route-table`,...U})]}),e[16]=U,e[17]=W);let G;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),e[18]=G):G=e[18];let K;e[19]!==P.vpcId||e[20]!==O?(K=e=>{let{field:t}=e;return(0,T.jsxs)(u,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,T.jsx)(l,{"aria-invalid":!!P.vpcId,className:`w-full`,id:`vpcId`,children:(0,T.jsx)(o,{placeholder:`Select a VPC`})}),(0,T.jsx)(c,{children:O.map(D)})]})},e[19]=P.vpcId,e[20]=O,e[21]=K):K=e[21];let q;e[22]!==A||e[23]!==K?(q=(0,T.jsx)(h,{control:A,name:`vpcId`,render:K}),e[22]=A,e[23]=K,e[24]=q):q=e[24];let J;e[25]===P.vpcId?J=e[26]:(J=(0,T.jsx)(x,{errors:[P.vpcId]}),e[25]=P.vpcId,e[26]=J);let Y;e[27]!==q||e[28]!==J?(Y=(0,T.jsxs)(S,{children:[G,q,J]}),e[27]=q,e[28]=J,e[29]=Y):Y=e[29];let X;e[30]===t?X=e[31]:(X=async()=>await t({to:`/ec2/describe-route-tables`}),e[30]=t,e[31]=X);let Z;e[32]!==s.isPending||e[33]!==F||e[34]!==X?(Z=(0,T.jsx)(v,{isPending:s.isPending,isSubmitting:F,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Route Table`}),e[32]=s.isPending,e[33]=F,e[34]=X,e[35]=Z):Z=e[35];let Q;e[36]!==W||e[37]!==Y||e[38]!==Z||e[39]!==V?(Q=(0,T.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:V,children:[W,Y,Z]}),e[36]=W,e[37]=Y,e[38]=Z,e[39]=V,e[40]=Q):Q=e[40];let $;return e[41]!==Q||e[42]!==B?($=(0,T.jsxs)(T.Fragment,{children:[R,z,B,Q]}),e[41]=Q,e[42]=B,e[43]=$):$=e[43],$}function D(e){let t=i(e.Tags);return(0,T.jsx)(s,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}export{E as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{nn as i}from"./cluster-config.js";import{t as a}from"./back-link.js";import{c as o,i as s,n as c,s as l,t as u}from"./select.js";import{t as d}from"./input.js";import{M as f}from"./ec2.js";import{b as p}from"./ec22.js";import{i as m,n as h,t as g}from"./zod.js";import{t as _}from"./error-banner.js";import{t as v}from"./form-actions.js";import{t as y}from"./page-heading.js";import{a as b,r as x,t as S}from"./field.js";import{f as C}from"./ec23.js";var w=t(),T=e();function E(){let e=(0,w.c)(44),t=r(),{data:i}=n(f),s=p(),E;e[0]===i.Vpcs?E=e[1]:(E=i.Vpcs??[],e[0]=i.Vpcs,e[1]=E);let O=E,k;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(k={resolver:g(C),defaultValues:{vpcId:``,name:``}},e[2]=k):k=e[2];let{control:A,handleSubmit:j,register:M,formState:N}=m(k),{errors:P,isSubmitting:F}=N,I;e[3]!==s||e[4]!==t?(I=async e=>{let n=(await s.mutateAsync({vpcId:e.vpcId,name:e.name?.trim()?e.name.trim():void 0})).RouteTable?.RouteTableId;t(n?{to:`/ec2/describe-route-tables/$id`,params:{id:n}}:{to:`/ec2/describe-route-tables`})},e[3]=s,e[4]=t,e[5]=I):I=e[5];let L=I,R,z;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,T.jsx)(a,{to:`/ec2/describe-route-tables`,children:`Back to Route Tables`}),z=(0,T.jsx)(y,{title:`Create Route Table`}),e[6]=R,e[7]=z):(R=e[6],z=e[7]);let B;e[8]===s.error?B=e[9]:(B=s.error&&(0,T.jsx)(_,{error:s.error,msg:`Failed to create Route Table`}),e[8]=s.error,e[9]=B);let V;e[10]!==j||e[11]!==L?(V=j(L),e[10]=j,e[11]=L,e[12]=V):V=e[12];let H;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),e[13]=H):H=e[13];let U;e[14]===M?U=e[15]:(U=M(`name`),e[14]=M,e[15]=U);let W;e[16]===U?W=e[17]:(W=(0,T.jsxs)(S,{children:[H,(0,T.jsx)(d,{id:`name`,placeholder:`my-route-table`,...U})]}),e[16]=U,e[17]=W);let G;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),e[18]=G):G=e[18];let K;e[19]!==P.vpcId||e[20]!==O?(K=e=>{let{field:t}=e;return(0,T.jsxs)(u,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,T.jsx)(l,{"aria-invalid":!!P.vpcId,className:`w-full`,id:`vpcId`,children:(0,T.jsx)(o,{placeholder:`Select a VPC`})}),(0,T.jsx)(c,{children:O.map(D)})]})},e[19]=P.vpcId,e[20]=O,e[21]=K):K=e[21];let q;e[22]!==A||e[23]!==K?(q=(0,T.jsx)(h,{control:A,name:`vpcId`,render:K}),e[22]=A,e[23]=K,e[24]=q):q=e[24];let J;e[25]===P.vpcId?J=e[26]:(J=(0,T.jsx)(x,{errors:[P.vpcId]}),e[25]=P.vpcId,e[26]=J);let Y;e[27]!==q||e[28]!==J?(Y=(0,T.jsxs)(S,{children:[G,q,J]}),e[27]=q,e[28]=J,e[29]=Y):Y=e[29];let X;e[30]===t?X=e[31]:(X=async()=>{await t({to:`/ec2/describe-route-tables`})},e[30]=t,e[31]=X);let Z;e[32]!==s.isPending||e[33]!==F||e[34]!==X?(Z=(0,T.jsx)(v,{isPending:s.isPending,isSubmitting:F,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Route Table`}),e[32]=s.isPending,e[33]=F,e[34]=X,e[35]=Z):Z=e[35];let Q;e[36]!==W||e[37]!==Y||e[38]!==Z||e[39]!==V?(Q=(0,T.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:V,children:[W,Y,Z]}),e[36]=W,e[37]=Y,e[38]=Z,e[39]=V,e[40]=Q):Q=e[40];let $;return e[41]!==Q||e[42]!==B?($=(0,T.jsxs)(T.Fragment,{children:[R,z,B,Q]}),e[41]=Q,e[42]=B,e[43]=$):$=e[43],$}function D(e){let t=i(e.Tags);return(0,T.jsx)(s,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}export{E as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-security-group.js b/spinifex/services/spinifexui/frontend/dist/assets/create-security-group.js index cf33c2404..53c6861b0 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-security-group.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-security-group.js @@ -1,4 +1,4 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{nn as i}from"./cluster-config.js";import{t as ee}from"./back-link.js";import{c as a,i as o,n as te,s as ne,t as re}from"./select.js";import{t as ie}from"./cli-command-panel.js";import{t as s}from"./input.js";import{M as ae}from"./ec2.js";import{x as oe}from"./ec22.js";import{a as c,i as se,n as ce,t as le}from"./zod.js";import{t as ue}from"./error-banner.js";import{t as de}from"./form-actions.js";import{t as fe}from"./page-heading.js";import{a as l,r as u,t as d}from"./field.js";import{p as pe}from"./ec23.js";var me=t(),f=e();function p(){let e=(0,me.c)(71),t=r(),{data:i}=n(ae),o=oe(),p;e[0]===i.Vpcs?p=e[1]:(p=i.Vpcs??[],e[0]=i.Vpcs,e[1]=p);let m=p,h;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=le(pe),e[2]=h):h=e[2];let g=m[0]?.VpcId??``,_;e[3]===g?_=e[4]:(_={resolver:h,defaultValues:{groupName:``,description:``,vpcId:g}},e[3]=g,e[4]=_);let{control:v,handleSubmit:y,register:b,formState:_e}=se(_),{errors:x,isSubmitting:S}=_e,C;e[5]===v?C=e[6]:(C={control:v},e[5]=v,e[6]=C);let w=c(C),T;e[7]!==o||e[8]!==t?(T=async e=>{let n=(await o.mutateAsync(e)).GroupId;t(n?{to:`/ec2/describe-security-groups/$id`,params:{id:n}}:{to:`/ec2/describe-security-groups`})},e[7]=o,e[8]=t,e[9]=T):T=e[9];let E=T,D,O;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,f.jsx)(ee,{to:`/ec2/describe-security-groups`,children:`Back to Security Groups`}),O=(0,f.jsx)(fe,{title:`Create Security Group`}),e[10]=D,e[11]=O):(D=e[10],O=e[11]);let k;e[12]===o.error?k=e[13]:(k=o.error&&(0,f.jsx)(ue,{error:o.error,msg:`Failed to create security group`}),e[12]=o.error,e[13]=k);let A;e[14]!==y||e[15]!==E?(A=y(E),e[14]=y,e[15]=E,e[16]=A):A=e[16];let j;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),e[17]=j):j=e[17];let M=!!x.groupName,N;e[18]===b?N=e[19]:(N=b(`groupName`),e[18]=b,e[19]=N);let P;e[20]!==M||e[21]!==N?(P=(0,f.jsx)(s,{"aria-invalid":M,id:`groupName`,placeholder:`my-security-group`,...N}),e[20]=M,e[21]=N,e[22]=P):P=e[22];let F;e[23]===x.groupName?F=e[24]:(F=(0,f.jsx)(u,{errors:[x.groupName]}),e[23]=x.groupName,e[24]=F);let I;e[25]!==P||e[26]!==F?(I=(0,f.jsxs)(d,{children:[j,P,F]}),e[25]=P,e[26]=F,e[27]=I):I=e[27];let L;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`description`,children:`Description`})}),e[28]=L):L=e[28];let R=!!x.description,z;e[29]===b?z=e[30]:(z=b(`description`),e[29]=b,e[30]=z);let B;e[31]!==R||e[32]!==z?(B=(0,f.jsx)(s,{"aria-invalid":R,id:`description`,placeholder:`My security group description`,...z}),e[31]=R,e[32]=z,e[33]=B):B=e[33];let V;e[34]===x.description?V=e[35]:(V=(0,f.jsx)(u,{errors:[x.description]}),e[34]=x.description,e[35]=V);let H;e[36]!==B||e[37]!==V?(H=(0,f.jsxs)(d,{children:[L,B,V]}),e[36]=B,e[37]=V,e[38]=H):H=e[38];let U;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),e[39]=U):U=e[39];let W;e[40]!==x.vpcId||e[41]!==m?(W=e=>{let{field:t}=e;return(0,f.jsxs)(re,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,f.jsx)(ne,{"aria-invalid":!!x.vpcId,className:`w-full`,id:`vpcId`,children:(0,f.jsx)(a,{})}),(0,f.jsx)(te,{children:m.map(he)})]})},e[40]=x.vpcId,e[41]=m,e[42]=W):W=e[42];let G;e[43]!==v||e[44]!==W?(G=(0,f.jsx)(ce,{control:v,name:`vpcId`,render:W}),e[43]=v,e[44]=W,e[45]=G):G=e[45];let K;e[46]===x.vpcId?K=e[47]:(K=(0,f.jsx)(u,{errors:[x.vpcId]}),e[46]=x.vpcId,e[47]=K);let q;e[48]!==G||e[49]!==K?(q=(0,f.jsxs)(d,{children:[U,G,K]}),e[48]=G,e[49]=K,e[50]=q):q=e[50];let J;e[51]===w?J=e[52]:(J=ge(w),e[51]=w,e[52]=J);let Y;e[53]===J?Y=e[54]:(Y=(0,f.jsx)(ie,{commands:J}),e[53]=J,e[54]=Y);let X;e[55]===t?X=e[56]:(X=async()=>await t({to:`/ec2/describe-security-groups`}),e[55]=t,e[56]=X);let Z;e[57]!==o.isPending||e[58]!==S||e[59]!==X?(Z=(0,f.jsx)(de,{isPending:o.isPending,isSubmitting:S,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Security Group`}),e[57]=o.isPending,e[58]=S,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==A||e[62]!==I||e[63]!==H||e[64]!==q||e[65]!==Y||e[66]!==Z?(Q=(0,f.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,H,q,Y,Z]}),e[61]=A,e[62]=I,e[63]=H,e[64]=q,e[65]=Y,e[66]=Z,e[67]=Q):Q=e[67];let $;return e[68]!==Q||e[69]!==k?($=(0,f.jsxs)(f.Fragment,{children:[D,O,k,Q]}),e[68]=Q,e[69]=k,e[70]=$):$=e[70],$}function he(e){let t=i(e.Tags);return(0,f.jsx)(o,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function ge(e){let t=e.groupName??``,n=e.description??``,r=e.vpcId??``,i=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-security-group`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{nn as i}from"./cluster-config.js";import{t as ee}from"./back-link.js";import{c as a,i as o,n as te,s as ne,t as re}from"./select.js";import{t as ie}from"./cli-command-panel.js";import{t as s}from"./input.js";import{M as ae}from"./ec2.js";import{x as oe}from"./ec22.js";import{a as c,i as se,n as ce,t as le}from"./zod.js";import{t as ue}from"./error-banner.js";import{t as de}from"./form-actions.js";import{t as fe}from"./page-heading.js";import{a as l,r as u,t as d}from"./field.js";import{p as pe}from"./ec23.js";var me=t(),f=e();function p(){let e=(0,me.c)(71),t=r(),{data:i}=n(ae),o=oe(),p;e[0]===i.Vpcs?p=e[1]:(p=i.Vpcs??[],e[0]=i.Vpcs,e[1]=p);let m=p,h;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=le(pe),e[2]=h):h=e[2];let g=m[0]?.VpcId??``,_;e[3]===g?_=e[4]:(_={resolver:h,defaultValues:{groupName:``,description:``,vpcId:g}},e[3]=g,e[4]=_);let{control:v,handleSubmit:y,register:b,formState:_e}=se(_),{errors:x,isSubmitting:S}=_e,C;e[5]===v?C=e[6]:(C={control:v},e[5]=v,e[6]=C);let w=c(C),T;e[7]!==o||e[8]!==t?(T=async e=>{let n=(await o.mutateAsync(e)).GroupId;t(n?{to:`/ec2/describe-security-groups/$id`,params:{id:n}}:{to:`/ec2/describe-security-groups`})},e[7]=o,e[8]=t,e[9]=T):T=e[9];let E=T,D,O;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,f.jsx)(ee,{to:`/ec2/describe-security-groups`,children:`Back to Security Groups`}),O=(0,f.jsx)(fe,{title:`Create Security Group`}),e[10]=D,e[11]=O):(D=e[10],O=e[11]);let k;e[12]===o.error?k=e[13]:(k=o.error&&(0,f.jsx)(ue,{error:o.error,msg:`Failed to create security group`}),e[12]=o.error,e[13]=k);let A;e[14]!==y||e[15]!==E?(A=y(E),e[14]=y,e[15]=E,e[16]=A):A=e[16];let j;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),e[17]=j):j=e[17];let M=!!x.groupName,N;e[18]===b?N=e[19]:(N=b(`groupName`),e[18]=b,e[19]=N);let P;e[20]!==M||e[21]!==N?(P=(0,f.jsx)(s,{"aria-invalid":M,id:`groupName`,placeholder:`my-security-group`,...N}),e[20]=M,e[21]=N,e[22]=P):P=e[22];let F;e[23]===x.groupName?F=e[24]:(F=(0,f.jsx)(u,{errors:[x.groupName]}),e[23]=x.groupName,e[24]=F);let I;e[25]!==P||e[26]!==F?(I=(0,f.jsxs)(d,{children:[j,P,F]}),e[25]=P,e[26]=F,e[27]=I):I=e[27];let L;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`description`,children:`Description`})}),e[28]=L):L=e[28];let R=!!x.description,z;e[29]===b?z=e[30]:(z=b(`description`),e[29]=b,e[30]=z);let B;e[31]!==R||e[32]!==z?(B=(0,f.jsx)(s,{"aria-invalid":R,id:`description`,placeholder:`My security group description`,...z}),e[31]=R,e[32]=z,e[33]=B):B=e[33];let V;e[34]===x.description?V=e[35]:(V=(0,f.jsx)(u,{errors:[x.description]}),e[34]=x.description,e[35]=V);let H;e[36]!==B||e[37]!==V?(H=(0,f.jsxs)(d,{children:[L,B,V]}),e[36]=B,e[37]=V,e[38]=H):H=e[38];let U;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),e[39]=U):U=e[39];let W;e[40]!==x.vpcId||e[41]!==m?(W=e=>{let{field:t}=e;return(0,f.jsxs)(re,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,f.jsx)(ne,{"aria-invalid":!!x.vpcId,className:`w-full`,id:`vpcId`,children:(0,f.jsx)(a,{})}),(0,f.jsx)(te,{children:m.map(he)})]})},e[40]=x.vpcId,e[41]=m,e[42]=W):W=e[42];let G;e[43]!==v||e[44]!==W?(G=(0,f.jsx)(ce,{control:v,name:`vpcId`,render:W}),e[43]=v,e[44]=W,e[45]=G):G=e[45];let K;e[46]===x.vpcId?K=e[47]:(K=(0,f.jsx)(u,{errors:[x.vpcId]}),e[46]=x.vpcId,e[47]=K);let q;e[48]!==G||e[49]!==K?(q=(0,f.jsxs)(d,{children:[U,G,K]}),e[48]=G,e[49]=K,e[50]=q):q=e[50];let J;e[51]===w?J=e[52]:(J=ge(w),e[51]=w,e[52]=J);let Y;e[53]===J?Y=e[54]:(Y=(0,f.jsx)(ie,{commands:J}),e[53]=J,e[54]=Y);let X;e[55]===t?X=e[56]:(X=async()=>{await t({to:`/ec2/describe-security-groups`})},e[55]=t,e[56]=X);let Z;e[57]!==o.isPending||e[58]!==S||e[59]!==X?(Z=(0,f.jsx)(de,{isPending:o.isPending,isSubmitting:S,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Security Group`}),e[57]=o.isPending,e[58]=S,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==A||e[62]!==I||e[63]!==H||e[64]!==q||e[65]!==Y||e[66]!==Z?(Q=(0,f.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,H,q,Y,Z]}),e[61]=A,e[62]=I,e[63]=H,e[64]=q,e[65]=Y,e[66]=Z,e[67]=Q):Q=e[67];let $;return e[68]!==Q||e[69]!==k?($=(0,f.jsxs)(f.Fragment,{children:[D,O,k,Q]}),e[68]=Q,e[69]=k,e[70]=$):$=e[70],$}function he(e){let t=i(e.Tags);return(0,f.jsx)(o,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function ge(e){let t=e.groupName??``,n=e.description??``,r=e.vpcId??``,i=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-security-group`},{type:`flag`,value:` \\ --group-name`},{type:`value`,value:` ${t||``}`},{type:`flag`,value:` \\ --description`},{type:`value`,value:` "${n||``}"`}];return r&&i.push({type:`flag`,value:` \\ --vpc-id`},{type:`value`,value:` ${r}`}),[{label:`Create Security Group`,parts:i}]}export{p as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-service2.js b/spinifex/services/spinifexui/frontend/dist/assets/create-service2.js index fa715eae9..16f3493de 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-service2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-service2.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as ee}from"./useSuspenseQuery.js";import{t as te}from"./useNavigate.js";import{t as ne}from"./back-link.js";import{c as re,i as ie,n as ae,s as oe,t as se}from"./select.js";import{t as r}from"./input.js";import{O as ce,w as le}from"./ec2.js";import{a as ue,o as de}from"./ecs.js";import{n as fe}from"./ecs2.js";import{u as pe}from"./elbv22.js";import{t as i}from"./create-service.js";import{a as me,i as he,n as ge,t as _e}from"./zod.js";import{t as ve}from"./error-banner.js";import{t as ye}from"./form-actions.js";import{t as be}from"./page-heading.js";import{a,r as xe,t as o}from"./field.js";import{n as Se}from"./ecs3.js";var Ce=t(),s=e();function we(e){return e.split(`/`).at(-1)??e}function c(e){let t=(0,Ce.c)(125),{cluster:i}=e,we=te(),c=fe(),{data:De}=ee(de),{data:Oe}=ee(ce),{data:ke}=ee(le),{data:Ae}=ee(pe),je;t[0]===Oe.Subnets?je=t[1]:(je=Oe.Subnets??[],t[0]=Oe.Subnets,t[1]=je);let Me=je,Ne;t[2]===ke.SecurityGroups?Ne=t[3]:(Ne=ke.SecurityGroups??[],t[2]=ke.SecurityGroups,t[3]=Ne);let Pe=Ne,l;t[4]===Ae.TargetGroups?l=t[5]:(l=Ae.TargetGroups??[],t[4]=Ae.TargetGroups,t[5]=l);let Fe=l,u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=_e(Se),t[6]=u):u=t[6];let d,f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],f=[],t[7]=d,t[8]=f):(d=t[7],f=t[8]);let p;t[9]===i?p=t[10]:(p={resolver:u,defaultValues:{cluster:i,serviceName:``,taskDefinition:``,desiredCount:1,subnets:d,securityGroups:f,assignPublicIp:!1,targetGroupArn:``,loadBalancerContainerName:``,loadBalancerContainerPort:``}},t[9]=i,t[10]=p);let{control:m,handleSubmit:Ie,register:h,setValue:Le,getValues:Re,formState:ze}=he(p),{errors:g,isSubmitting:Be}=ze,_;t[11]===m?_=t[12]:(_={control:m,name:`taskDefinition`},t[11]=m,t[12]=_);let Ve=me(_),v;t[13]===Ve?v=t[14]:(v=ue(Ve),t[13]=Ve,t[14]=v);let{data:He}=n(v),y=He?.networkMode===`awsvpc`,b;t[15]===m?b=t[16]:(b={control:m,name:`subnets`},t[15]=m,t[16]=b);let x=me(b),S;t[17]===m?S=t[18]:(S={control:m,name:`securityGroups`},t[17]=m,t[18]=S);let Ue=me(S),C;t[19]===x?C=t[20]:(C=new Set(x),t[19]=x,t[20]=C);let We=C,Ge;t[21]===Ue?Ge=t[22]:(Ge=new Set(Ue),t[21]=Ue,t[22]=Ge);let Ke=Ge,qe;t[23]!==Re||t[24]!==Le?(qe=(e,t)=>{let n=Re(e);Le(e,n.includes(t)?n.filter(e=>e!==t):[...n,t],{shouldValidate:!0})},t[23]=Re,t[24]=Le,t[25]=qe):qe=t[25];let Je=qe,Ye;t[26]!==i||t[27]!==we?(Ye=function(){we({to:`/ecs/list-clusters/$clusterName`,params:{clusterName:i}})},t[26]=i,t[27]=we,t[28]=Ye):Ye=t[28];let w=Ye,Xe;t[29]!==y||t[30]!==c||t[31]!==w?(Xe=async function(e){await c.mutateAsync({...e,awsvpc:y}),w()},t[29]=y,t[30]=c,t[31]=w,t[32]=Xe):Xe=t[32];let Ze=Xe,Qe=y&&x.length===0,T;t[33]===i?T=t[34]:(T={clusterName:i},t[33]=i,t[34]=T);let E;t[35]!==i||t[36]!==T?(E=(0,s.jsx)(ne,{params:T,to:`/ecs/list-clusters/$clusterName`,children:i}),t[35]=i,t[36]=T,t[37]=E):E=t[37];let $e=`Cluster: ${i}`,D;t[38]===$e?D=t[39]:(D=(0,s.jsx)(be,{subtitle:$e,title:`Create Service`}),t[38]=$e,t[39]=D);let O;t[40]!==c.error||t[41]!==c.isError?(O=c.isError&&(0,s.jsx)(ve,{error:c.error instanceof Error?c.error:void 0,msg:`Failed to create service.`}),t[40]=c.error,t[41]=c.isError,t[42]=O):O=t[42];let k;t[43]!==Ie||t[44]!==Ze?(k=Ie(Ze),t[43]=Ie,t[44]=Ze,t[45]=k):k=t[45];let et;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`serviceName`,children:`Service name`})}),t[46]=et):et=t[46];let A;t[47]===h?A=t[48]:(A=h(`serviceName`),t[47]=h,t[48]=A);let j;t[49]===A?j=t[50]:(j=(0,s.jsx)(r,{id:`serviceName`,placeholder:`api`,...A}),t[49]=A,t[50]=j);let M;t[51]===g.serviceName?M=t[52]:(M=(0,s.jsx)(xe,{errors:[g.serviceName]}),t[51]=g.serviceName,t[52]=M);let N;t[53]!==j||t[54]!==M?(N=(0,s.jsxs)(o,{children:[et,j,M]}),t[53]=j,t[54]=M,t[55]=N):N=t[55];let tt;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`taskDefinition`,children:`Task definition`})}),t[56]=tt):tt=t[56];let P;t[57]===De?P=t[58]:(P=e=>{let{field:t}=e;return(0,s.jsxs)(se,{onValueChange:t.onChange,value:t.value,children:[(0,s.jsx)(oe,{className:`w-full`,id:`taskDefinition`,children:(0,s.jsx)(re,{placeholder:`Select a task definition`})}),(0,s.jsx)(ae,{children:De.map(Ee)})]})},t[57]=De,t[58]=P);let F;t[59]!==m||t[60]!==P?(F=(0,s.jsx)(ge,{control:m,name:`taskDefinition`,render:P}),t[59]=m,t[60]=P,t[61]=F):F=t[61];let I;t[62]===g.taskDefinition?I=t[63]:(I=(0,s.jsx)(xe,{errors:[g.taskDefinition]}),t[62]=g.taskDefinition,t[63]=I);let L;t[64]!==F||t[65]!==I?(L=(0,s.jsxs)(o,{children:[tt,F,I]}),t[64]=F,t[65]=I,t[66]=L):L=t[66];let nt;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`desiredCount`,children:`Desired count`})}),t[67]=nt):nt=t[67];let R;t[68]===h?R=t[69]:(R=h(`desiredCount`,{valueAsNumber:!0}),t[68]=h,t[69]=R);let z;t[70]===R?z=t[71]:(z=(0,s.jsx)(r,{id:`desiredCount`,type:`number`,...R}),t[70]=R,t[71]=z);let B;t[72]===g.desiredCount?B=t[73]:(B=(0,s.jsx)(xe,{errors:[g.desiredCount]}),t[72]=g.desiredCount,t[73]=B);let V;t[74]!==z||t[75]!==B?(V=(0,s.jsxs)(o,{children:[nt,z,B]}),t[74]=z,t[75]=B,t[76]=V):V=t[76];let H;t[77]!==y||t[78]!==h||t[79]!==Pe||t[80]!==Ke||t[81]!==We||t[82]!==Me||t[83]!==Je?(H=y&&(0,s.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This task definition uses awsvpc networking. Select at least one subnet.`}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`span`,{className:`text-sm font-medium`,children:`Subnets`}),(0,s.jsx)(`div`,{className:`mt-2 space-y-1`,children:Me.map(e=>(0,s.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,s.jsx)(`input`,{checked:We.has(e.SubnetId??``),onChange:()=>Je(`subnets`,e.SubnetId??``),type:`checkbox`}),(0,s.jsxs)(`span`,{className:`font-mono`,children:[e.SubnetId,` (`,e.CidrBlock,`)`]})]},e.SubnetId))})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`span`,{className:`text-sm font-medium`,children:`Security groups`}),(0,s.jsx)(`div`,{className:`mt-2 space-y-1`,children:Pe.map(e=>(0,s.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,s.jsx)(`input`,{checked:Ke.has(e.GroupId??``),onChange:()=>Je(`securityGroups`,e.GroupId??``),type:`checkbox`}),(0,s.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})]}),(0,s.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,s.jsx)(`input`,{type:`checkbox`,...h(`assignPublicIp`)}),(0,s.jsx)(`span`,{children:`Assign public IP`})]})]}),t[77]=y,t[78]=h,t[79]=Pe,t[80]=Ke,t[81]=We,t[82]=Me,t[83]=Je,t[84]=H):H=t[84];let rt;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,s.jsx)(`h2`,{className:`font-semibold`,children:`Load balancer (optional)`}),t[85]=rt):rt=t[85];let it;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`targetGroupArn`,children:`Target group`})}),t[86]=it):it=t[86];let U;t[87]===Fe?U=t[88]:(U=e=>{let{field:t}=e;return(0,s.jsxs)(se,{onValueChange:e=>t.onChange(e===`none`?``:e),value:t.value===``?`none`:t.value,children:[(0,s.jsx)(oe,{className:`w-full`,id:`targetGroupArn`,children:(0,s.jsx)(re,{})}),(0,s.jsxs)(ae,{children:[(0,s.jsx)(ie,{value:`none`,children:`none`}),Fe.map(Te)]})]})},t[87]=Fe,t[88]=U);let W;t[89]!==m||t[90]!==U?(W=(0,s.jsxs)(o,{children:[it,(0,s.jsx)(ge,{control:m,name:`targetGroupArn`,render:U})]}),t[89]=m,t[90]=U,t[91]=W):W=t[91];let at;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`lbContainerName`,children:`Container name`})}),t[92]=at):at=t[92];let G;t[93]===h?G=t[94]:(G=h(`loadBalancerContainerName`),t[93]=h,t[94]=G);let K;t[95]===G?K=t[96]:(K=(0,s.jsxs)(o,{children:[at,(0,s.jsx)(r,{id:`lbContainerName`,placeholder:`app`,...G})]}),t[95]=G,t[96]=K);let ot;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`lbContainerPort`,children:`Container port`})}),t[97]=ot):ot=t[97];let q;t[98]===h?q=t[99]:(q=h(`loadBalancerContainerPort`),t[98]=h,t[99]=q);let J;t[100]===q?J=t[101]:(J=(0,s.jsxs)(o,{children:[ot,(0,s.jsx)(r,{id:`lbContainerPort`,placeholder:`80`,type:`number`,...q})]}),t[100]=q,t[101]=J);let Y;t[102]!==K||t[103]!==J?(Y=(0,s.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[K,J]}),t[102]=K,t[103]=J,t[104]=Y):Y=t[104];let X;t[105]!==W||t[106]!==Y?(X=(0,s.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[rt,W,Y]}),t[105]=W,t[106]=Y,t[107]=X):X=t[107];let st=c.isPending||Qe,Z;t[108]!==w||t[109]!==Be||t[110]!==st?(Z=(0,s.jsx)(ye,{isPending:st,isSubmitting:Be,onCancel:w,pendingLabel:`Creating…`,submitLabel:`Create Service`}),t[108]=w,t[109]=Be,t[110]=st,t[111]=Z):Z=t[111];let Q;t[112]!==k||t[113]!==N||t[114]!==L||t[115]!==V||t[116]!==H||t[117]!==X||t[118]!==Z?(Q=(0,s.jsxs)(`form`,{className:`max-w-2xl space-y-6`,onSubmit:k,children:[N,L,V,H,X,Z]}),t[112]=k,t[113]=N,t[114]=L,t[115]=V,t[116]=H,t[117]=X,t[118]=Z,t[119]=Q):Q=t[119];let $;return t[120]!==E||t[121]!==D||t[122]!==O||t[123]!==Q?($=(0,s.jsxs)(s.Fragment,{children:[E,D,O,Q]}),t[120]=E,t[121]=D,t[122]=O,t[123]=Q,t[124]=$):$=t[124],$}function Te(e){return(0,s.jsx)(ie,{value:e.TargetGroupArn??``,children:e.TargetGroupName},e.TargetGroupArn)}function Ee(e){let t=we(e);return(0,s.jsx)(ie,{value:t,children:t},e)}function De(){let e=(0,Ce.c)(2),{cluster:t}=i.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,s.jsx)(c,{cluster:t}),e[0]=t,e[1]=n),n}export{De as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as ee}from"./useSuspenseQuery.js";import{t as te}from"./useNavigate.js";import{t as ne}from"./back-link.js";import{c as re,i as ie,n as ae,s as oe,t as se}from"./select.js";import{t as r}from"./input.js";import{O as ce,w as le}from"./ec2.js";import{a as ue,o as de}from"./ecs.js";import{n as fe}from"./ecs2.js";import{u as pe}from"./elbv22.js";import{t as i}from"./create-service.js";import{a as me,i as he,n as ge,t as _e}from"./zod.js";import{t as ve}from"./error-banner.js";import{t as ye}from"./form-actions.js";import{t as be}from"./page-heading.js";import{a,r as xe,t as o}from"./field.js";import{n as Se}from"./ecs3.js";var Ce=t(),s=e();function we(e){return e.split(`/`).at(-1)??e}function c(e){let t=(0,Ce.c)(125),{cluster:i}=e,we=te(),c=fe(),{data:De}=ee(de),{data:Oe}=ee(ce),{data:ke}=ee(le),{data:Ae}=ee(pe),je;t[0]===Oe.Subnets?je=t[1]:(je=Oe.Subnets??[],t[0]=Oe.Subnets,t[1]=je);let Me=je,Ne;t[2]===ke.SecurityGroups?Ne=t[3]:(Ne=ke.SecurityGroups??[],t[2]=ke.SecurityGroups,t[3]=Ne);let Pe=Ne,l;t[4]===Ae.TargetGroups?l=t[5]:(l=Ae.TargetGroups??[],t[4]=Ae.TargetGroups,t[5]=l);let Fe=l,u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=_e(Se),t[6]=u):u=t[6];let d,f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],f=[],t[7]=d,t[8]=f):(d=t[7],f=t[8]);let p;t[9]===i?p=t[10]:(p={resolver:u,defaultValues:{cluster:i,serviceName:``,taskDefinition:``,desiredCount:1,subnets:d,securityGroups:f,assignPublicIp:!1,targetGroupArn:``,loadBalancerContainerName:``,loadBalancerContainerPort:``}},t[9]=i,t[10]=p);let{control:m,handleSubmit:Ie,register:h,setValue:Le,getValues:Re,formState:ze}=he(p),{errors:g,isSubmitting:Be}=ze,_;t[11]===m?_=t[12]:(_={control:m,name:`taskDefinition`},t[11]=m,t[12]=_);let Ve=me(_),v;t[13]===Ve?v=t[14]:(v=ue(Ve),t[13]=Ve,t[14]=v);let{data:He}=n(v),y=He?.networkMode===`awsvpc`,b;t[15]===m?b=t[16]:(b={control:m,name:`subnets`},t[15]=m,t[16]=b);let x=me(b),S;t[17]===m?S=t[18]:(S={control:m,name:`securityGroups`},t[17]=m,t[18]=S);let Ue=me(S),C;t[19]===x?C=t[20]:(C=new Set(x),t[19]=x,t[20]=C);let We=C,Ge;t[21]===Ue?Ge=t[22]:(Ge=new Set(Ue),t[21]=Ue,t[22]=Ge);let Ke=Ge,qe;t[23]!==Re||t[24]!==Le?(qe=(e,t)=>{let n=Re(e);Le(e,n.includes(t)?n.filter(e=>e!==t):[...n,t],{shouldValidate:!0})},t[23]=Re,t[24]=Le,t[25]=qe):qe=t[25];let Je=qe,Ye;t[26]!==i||t[27]!==we?(Ye=function(){we({to:`/ecs/list-clusters/$clusterName`,params:{clusterName:i}})},t[26]=i,t[27]=we,t[28]=Ye):Ye=t[28];let w=Ye,Xe;t[29]!==y||t[30]!==c||t[31]!==w?(Xe=async function(e){await c.mutateAsync({...e,awsvpc:y}),w()},t[29]=y,t[30]=c,t[31]=w,t[32]=Xe):Xe=t[32];let Ze=Xe,Qe=y&&x.length===0,T;t[33]===i?T=t[34]:(T={clusterName:i},t[33]=i,t[34]=T);let E;t[35]!==i||t[36]!==T?(E=(0,s.jsx)(ne,{params:T,to:`/ecs/list-clusters/$clusterName`,children:i}),t[35]=i,t[36]=T,t[37]=E):E=t[37];let $e=`Cluster: ${i}`,D;t[38]===$e?D=t[39]:(D=(0,s.jsx)(be,{subtitle:$e,title:`Create Service`}),t[38]=$e,t[39]=D);let O;t[40]!==c.error||t[41]!==c.isError?(O=c.isError&&(0,s.jsx)(ve,{error:c.error instanceof Error?c.error:void 0,msg:`Failed to create service.`}),t[40]=c.error,t[41]=c.isError,t[42]=O):O=t[42];let k;t[43]!==Ie||t[44]!==Ze?(k=Ie(Ze),t[43]=Ie,t[44]=Ze,t[45]=k):k=t[45];let et;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`serviceName`,children:`Service name`})}),t[46]=et):et=t[46];let A;t[47]===h?A=t[48]:(A=h(`serviceName`),t[47]=h,t[48]=A);let j;t[49]===A?j=t[50]:(j=(0,s.jsx)(r,{id:`serviceName`,placeholder:`api`,...A}),t[49]=A,t[50]=j);let M;t[51]===g.serviceName?M=t[52]:(M=(0,s.jsx)(xe,{errors:[g.serviceName]}),t[51]=g.serviceName,t[52]=M);let N;t[53]!==j||t[54]!==M?(N=(0,s.jsxs)(o,{children:[et,j,M]}),t[53]=j,t[54]=M,t[55]=N):N=t[55];let tt;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`taskDefinition`,children:`Task definition`})}),t[56]=tt):tt=t[56];let P;t[57]===De?P=t[58]:(P=e=>{let{field:t}=e;return(0,s.jsxs)(se,{onValueChange:t.onChange,value:t.value,children:[(0,s.jsx)(oe,{className:`w-full`,id:`taskDefinition`,children:(0,s.jsx)(re,{placeholder:`Select a task definition`})}),(0,s.jsx)(ae,{children:De.map(Ee)})]})},t[57]=De,t[58]=P);let F;t[59]!==m||t[60]!==P?(F=(0,s.jsx)(ge,{control:m,name:`taskDefinition`,render:P}),t[59]=m,t[60]=P,t[61]=F):F=t[61];let I;t[62]===g.taskDefinition?I=t[63]:(I=(0,s.jsx)(xe,{errors:[g.taskDefinition]}),t[62]=g.taskDefinition,t[63]=I);let L;t[64]!==F||t[65]!==I?(L=(0,s.jsxs)(o,{children:[tt,F,I]}),t[64]=F,t[65]=I,t[66]=L):L=t[66];let nt;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`desiredCount`,children:`Desired count`})}),t[67]=nt):nt=t[67];let R;t[68]===h?R=t[69]:(R=h(`desiredCount`,{valueAsNumber:!0}),t[68]=h,t[69]=R);let z;t[70]===R?z=t[71]:(z=(0,s.jsx)(r,{id:`desiredCount`,type:`number`,...R}),t[70]=R,t[71]=z);let B;t[72]===g.desiredCount?B=t[73]:(B=(0,s.jsx)(xe,{errors:[g.desiredCount]}),t[72]=g.desiredCount,t[73]=B);let V;t[74]!==z||t[75]!==B?(V=(0,s.jsxs)(o,{children:[nt,z,B]}),t[74]=z,t[75]=B,t[76]=V):V=t[76];let H;t[77]!==y||t[78]!==h||t[79]!==Pe||t[80]!==Ke||t[81]!==We||t[82]!==Me||t[83]!==Je?(H=y&&(0,s.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This task definition uses awsvpc networking. Select at least one subnet.`}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`span`,{className:`text-sm font-medium`,children:`Subnets`}),(0,s.jsx)(`div`,{className:`mt-2 space-y-1`,children:Me.map(e=>(0,s.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,s.jsx)(`input`,{checked:We.has(e.SubnetId??``),onChange:()=>{Je(`subnets`,e.SubnetId??``)},type:`checkbox`}),(0,s.jsxs)(`span`,{className:`font-mono`,children:[e.SubnetId,` (`,e.CidrBlock,`)`]})]},e.SubnetId))})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`span`,{className:`text-sm font-medium`,children:`Security groups`}),(0,s.jsx)(`div`,{className:`mt-2 space-y-1`,children:Pe.map(e=>(0,s.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,s.jsx)(`input`,{checked:Ke.has(e.GroupId??``),onChange:()=>{Je(`securityGroups`,e.GroupId??``)},type:`checkbox`}),(0,s.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})]}),(0,s.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,s.jsx)(`input`,{type:`checkbox`,...h(`assignPublicIp`)}),(0,s.jsx)(`span`,{children:`Assign public IP`})]})]}),t[77]=y,t[78]=h,t[79]=Pe,t[80]=Ke,t[81]=We,t[82]=Me,t[83]=Je,t[84]=H):H=t[84];let rt;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,s.jsx)(`h2`,{className:`font-semibold`,children:`Load balancer (optional)`}),t[85]=rt):rt=t[85];let it;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`targetGroupArn`,children:`Target group`})}),t[86]=it):it=t[86];let U;t[87]===Fe?U=t[88]:(U=e=>{let{field:t}=e;return(0,s.jsxs)(se,{onValueChange:e=>{t.onChange(e===`none`?``:e)},value:t.value===``?`none`:t.value,children:[(0,s.jsx)(oe,{className:`w-full`,id:`targetGroupArn`,children:(0,s.jsx)(re,{})}),(0,s.jsxs)(ae,{children:[(0,s.jsx)(ie,{value:`none`,children:`none`}),Fe.map(Te)]})]})},t[87]=Fe,t[88]=U);let W;t[89]!==m||t[90]!==U?(W=(0,s.jsxs)(o,{children:[it,(0,s.jsx)(ge,{control:m,name:`targetGroupArn`,render:U})]}),t[89]=m,t[90]=U,t[91]=W):W=t[91];let at;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`lbContainerName`,children:`Container name`})}),t[92]=at):at=t[92];let G;t[93]===h?G=t[94]:(G=h(`loadBalancerContainerName`),t[93]=h,t[94]=G);let K;t[95]===G?K=t[96]:(K=(0,s.jsxs)(o,{children:[at,(0,s.jsx)(r,{id:`lbContainerName`,placeholder:`app`,...G})]}),t[95]=G,t[96]=K);let ot;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,s.jsx)(a,{children:(0,s.jsx)(`label`,{htmlFor:`lbContainerPort`,children:`Container port`})}),t[97]=ot):ot=t[97];let q;t[98]===h?q=t[99]:(q=h(`loadBalancerContainerPort`),t[98]=h,t[99]=q);let J;t[100]===q?J=t[101]:(J=(0,s.jsxs)(o,{children:[ot,(0,s.jsx)(r,{id:`lbContainerPort`,placeholder:`80`,type:`number`,...q})]}),t[100]=q,t[101]=J);let Y;t[102]!==K||t[103]!==J?(Y=(0,s.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[K,J]}),t[102]=K,t[103]=J,t[104]=Y):Y=t[104];let X;t[105]!==W||t[106]!==Y?(X=(0,s.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[rt,W,Y]}),t[105]=W,t[106]=Y,t[107]=X):X=t[107];let st=c.isPending||Qe,Z;t[108]!==w||t[109]!==Be||t[110]!==st?(Z=(0,s.jsx)(ye,{isPending:st,isSubmitting:Be,onCancel:w,pendingLabel:`Creating…`,submitLabel:`Create Service`}),t[108]=w,t[109]=Be,t[110]=st,t[111]=Z):Z=t[111];let Q;t[112]!==k||t[113]!==N||t[114]!==L||t[115]!==V||t[116]!==H||t[117]!==X||t[118]!==Z?(Q=(0,s.jsxs)(`form`,{className:`max-w-2xl space-y-6`,onSubmit:k,children:[N,L,V,H,X,Z]}),t[112]=k,t[113]=N,t[114]=L,t[115]=V,t[116]=H,t[117]=X,t[118]=Z,t[119]=Q):Q=t[119];let $;return t[120]!==E||t[121]!==D||t[122]!==O||t[123]!==Q?($=(0,s.jsxs)(s.Fragment,{children:[E,D,O,Q]}),t[120]=E,t[121]=D,t[122]=O,t[123]=Q,t[124]=$):$=t[124],$}function Te(e){return(0,s.jsx)(ie,{value:e.TargetGroupArn??``,children:e.TargetGroupName},e.TargetGroupArn)}function Ee(e){let t=we(e);return(0,s.jsx)(ie,{value:t,children:t},e)}function De(){let e=(0,Ce.c)(2),{cluster:t}=i.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,s.jsx)(c,{cluster:t}),e[0]=t,e[1]=n),n}export{De as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-snapshot2.js b/spinifex/services/spinifexui/frontend/dist/assets/create-snapshot2.js index 79bf1a91c..bb8334978 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-snapshot2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-snapshot2.js @@ -1,3 +1,3 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{t as i}from"./back-link.js";import{c as a,i as o,n as s,s as c,t as l}from"./select.js";import{t as u}from"./cli-command-panel.js";import{A as ee}from"./ec2.js";import{S as te}from"./ec22.js";import{t as ne}from"./create-snapshot.js";import{a as re,i as ie,n as ae,t as oe}from"./zod.js";import{t as se}from"./error-banner.js";import{t as ce}from"./form-actions.js";import{t as le}from"./page-heading.js";import{a as d,r as f,t as p}from"./field.js";import{m}from"./ec23.js";import{t as ue}from"./textarea.js";var h=t(),g=e();function _(){let e=(0,h.c)(53),t=r(),{data:o}=n(ee),_=te(),b;e[0]===o.Volumes?b=e[1]:(b=o.Volumes??[],e[0]=o.Volumes,e[1]=b);let x=b,{volumeId:S}=ne.useSearch(),C=S??x[0]?.VolumeId??``,w;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(w=oe(m),e[2]=w):w=e[2];let T;e[3]===C?T=e[4]:(T={resolver:w,defaultValues:{volumeId:C,description:``}},e[3]=C,e[4]=T);let{control:E,handleSubmit:D,register:O,formState:k}=ie(T),{errors:A,isSubmitting:j}=k,M;e[5]===E?M=e[6]:(M={control:E},e[5]=E,e[6]=M);let N=re(M),P;e[7]!==_||e[8]!==t?(P=async e=>{await _.mutateAsync(e),t({to:`/ec2/describe-snapshots`})},e[7]=_,e[8]=t,e[9]=P):P=e[9];let F=P,I,L;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,g.jsx)(i,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),L=(0,g.jsx)(le,{title:`Create Snapshot`}),e[10]=I,e[11]=L):(I=e[10],L=e[11]);let R;e[12]===_.error?R=e[13]:(R=_.error&&(0,g.jsx)(se,{error:_.error,msg:`Failed to create snapshot`}),e[12]=_.error,e[13]=R);let z;e[14]!==D||e[15]!==F?(z=D(F),e[14]=D,e[15]=F,e[16]=z):z=e[16];let B;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,g.jsx)(d,{children:(0,g.jsx)(`label`,{htmlFor:`volumeId`,children:`Volume`})}),e[17]=B):B=e[17];let V;e[18]!==A.volumeId||e[19]!==x?(V=e=>{let{field:t}=e;return(0,g.jsxs)(l,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,g.jsx)(c,{"aria-invalid":!!A.volumeId,className:`w-full`,id:`volumeId`,children:(0,g.jsx)(a,{})}),(0,g.jsx)(s,{children:x.map(v)})]})},e[18]=A.volumeId,e[19]=x,e[20]=V):V=e[20];let H;e[21]!==E||e[22]!==V?(H=(0,g.jsx)(ae,{control:E,name:`volumeId`,render:V}),e[21]=E,e[22]=V,e[23]=H):H=e[23];let U;e[24]===A.volumeId?U=e[25]:(U=(0,g.jsx)(f,{errors:[A.volumeId]}),e[24]=A.volumeId,e[25]=U);let W;e[26]!==H||e[27]!==U?(W=(0,g.jsxs)(p,{children:[B,H,U]}),e[26]=H,e[27]=U,e[28]=W):W=e[28];let G;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,g.jsx)(d,{children:(0,g.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),e[29]=G):G=e[29];let K;e[30]===O?K=e[31]:(K=O(`description`),e[30]=O,e[31]=K);let q;e[32]===K?q=e[33]:(q=(0,g.jsxs)(p,{children:[G,(0,g.jsx)(ue,{id:`description`,placeholder:`Snapshot description`,...K})]}),e[32]=K,e[33]=q);let J;e[34]===N?J=e[35]:(J=y(N),e[34]=N,e[35]=J);let Y;e[36]===J?Y=e[37]:(Y=(0,g.jsx)(u,{commands:J}),e[36]=J,e[37]=Y);let X;e[38]===t?X=e[39]:(X=async()=>await t({to:`/ec2/describe-snapshots`}),e[38]=t,e[39]=X);let Z;e[40]!==_.isPending||e[41]!==j||e[42]!==X?(Z=(0,g.jsx)(ce,{isPending:_.isPending,isSubmitting:j,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Snapshot`}),e[40]=_.isPending,e[41]=j,e[42]=X,e[43]=Z):Z=e[43];let Q;e[44]!==W||e[45]!==q||e[46]!==Y||e[47]!==Z||e[48]!==z?(Q=(0,g.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:z,children:[W,q,Y,Z]}),e[44]=W,e[45]=q,e[46]=Y,e[47]=Z,e[48]=z,e[49]=Q):Q=e[49];let $;return e[50]!==Q||e[51]!==R?($=(0,g.jsxs)(g.Fragment,{children:[I,L,R,Q]}),e[50]=Q,e[51]=R,e[52]=$):$=e[52],$}function v(e){return(0,g.jsxs)(o,{value:e.VolumeId??``,children:[e.VolumeId,` (`,e.Size,` GiB)`]},e.VolumeId)}function y(e){let t=e.volumeId??``,n=e.description??``,r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-snapshot`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{t as i}from"./back-link.js";import{c as a,i as o,n as s,s as c,t as l}from"./select.js";import{t as u}from"./cli-command-panel.js";import{A as ee}from"./ec2.js";import{S as te}from"./ec22.js";import{t as ne}from"./create-snapshot.js";import{a as re,i as ie,n as ae,t as oe}from"./zod.js";import{t as se}from"./error-banner.js";import{t as ce}from"./form-actions.js";import{t as le}from"./page-heading.js";import{a as d,r as f,t as p}from"./field.js";import{m}from"./ec23.js";import{t as ue}from"./textarea.js";var h=t(),g=e();function _(){let e=(0,h.c)(53),t=r(),{data:o}=n(ee),_=te(),b;e[0]===o.Volumes?b=e[1]:(b=o.Volumes??[],e[0]=o.Volumes,e[1]=b);let x=b,{volumeId:S}=ne.useSearch(),C=S??x[0]?.VolumeId??``,w;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(w=oe(m),e[2]=w):w=e[2];let T;e[3]===C?T=e[4]:(T={resolver:w,defaultValues:{volumeId:C,description:``}},e[3]=C,e[4]=T);let{control:E,handleSubmit:D,register:O,formState:k}=ie(T),{errors:A,isSubmitting:j}=k,M;e[5]===E?M=e[6]:(M={control:E},e[5]=E,e[6]=M);let N=re(M),P;e[7]!==_||e[8]!==t?(P=async e=>{await _.mutateAsync(e),t({to:`/ec2/describe-snapshots`})},e[7]=_,e[8]=t,e[9]=P):P=e[9];let F=P,I,L;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,g.jsx)(i,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),L=(0,g.jsx)(le,{title:`Create Snapshot`}),e[10]=I,e[11]=L):(I=e[10],L=e[11]);let R;e[12]===_.error?R=e[13]:(R=_.error&&(0,g.jsx)(se,{error:_.error,msg:`Failed to create snapshot`}),e[12]=_.error,e[13]=R);let z;e[14]!==D||e[15]!==F?(z=D(F),e[14]=D,e[15]=F,e[16]=z):z=e[16];let B;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,g.jsx)(d,{children:(0,g.jsx)(`label`,{htmlFor:`volumeId`,children:`Volume`})}),e[17]=B):B=e[17];let V;e[18]!==A.volumeId||e[19]!==x?(V=e=>{let{field:t}=e;return(0,g.jsxs)(l,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,g.jsx)(c,{"aria-invalid":!!A.volumeId,className:`w-full`,id:`volumeId`,children:(0,g.jsx)(a,{})}),(0,g.jsx)(s,{children:x.map(v)})]})},e[18]=A.volumeId,e[19]=x,e[20]=V):V=e[20];let H;e[21]!==E||e[22]!==V?(H=(0,g.jsx)(ae,{control:E,name:`volumeId`,render:V}),e[21]=E,e[22]=V,e[23]=H):H=e[23];let U;e[24]===A.volumeId?U=e[25]:(U=(0,g.jsx)(f,{errors:[A.volumeId]}),e[24]=A.volumeId,e[25]=U);let W;e[26]!==H||e[27]!==U?(W=(0,g.jsxs)(p,{children:[B,H,U]}),e[26]=H,e[27]=U,e[28]=W):W=e[28];let G;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,g.jsx)(d,{children:(0,g.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),e[29]=G):G=e[29];let K;e[30]===O?K=e[31]:(K=O(`description`),e[30]=O,e[31]=K);let q;e[32]===K?q=e[33]:(q=(0,g.jsxs)(p,{children:[G,(0,g.jsx)(ue,{id:`description`,placeholder:`Snapshot description`,...K})]}),e[32]=K,e[33]=q);let J;e[34]===N?J=e[35]:(J=y(N),e[34]=N,e[35]=J);let Y;e[36]===J?Y=e[37]:(Y=(0,g.jsx)(u,{commands:J}),e[36]=J,e[37]=Y);let X;e[38]===t?X=e[39]:(X=async()=>{await t({to:`/ec2/describe-snapshots`})},e[38]=t,e[39]=X);let Z;e[40]!==_.isPending||e[41]!==j||e[42]!==X?(Z=(0,g.jsx)(ce,{isPending:_.isPending,isSubmitting:j,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Snapshot`}),e[40]=_.isPending,e[41]=j,e[42]=X,e[43]=Z):Z=e[43];let Q;e[44]!==W||e[45]!==q||e[46]!==Y||e[47]!==Z||e[48]!==z?(Q=(0,g.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:z,children:[W,q,Y,Z]}),e[44]=W,e[45]=q,e[46]=Y,e[47]=Z,e[48]=z,e[49]=Q):Q=e[49];let $;return e[50]!==Q||e[51]!==R?($=(0,g.jsxs)(g.Fragment,{children:[I,L,R,Q]}),e[50]=Q,e[51]=R,e[52]=$):$=e[52],$}function v(e){return(0,g.jsxs)(o,{value:e.VolumeId??``,children:[e.VolumeId,` (`,e.Size,` GiB)`]},e.VolumeId)}function y(e){let t=e.volumeId??``,n=e.description??``,r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-snapshot`},{type:`flag`,value:` \\ --volume-id`},{type:`value`,value:` ${t||``}`}];return n&&r.push({type:`flag`,value:` \\ --description`},{type:`value`,value:` "${n}"`}),[{label:`Create Snapshot`,parts:r}]}export{_ as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-subnet.js b/spinifex/services/spinifexui/frontend/dist/assets/create-subnet.js index bbd29653f..ee00c2288 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-subnet.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-subnet.js @@ -1,4 +1,4 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{nn as r}from"./cluster-config.js";import{t as i}from"./back-link.js";import{c as te,i as a,n as ne,s as re,t as ie}from"./select.js";import{t as ae}from"./cli-command-panel.js";import{t as oe}from"./input.js";import{M as se,r as ce}from"./ec2.js";import{C as le}from"./ec22.js";import{a as ue,i as de,n as o,t as fe}from"./zod.js";import{t as pe}from"./error-banner.js";import{t as me}from"./form-actions.js";import{t as he}from"./page-heading.js";import{a as s,r as ge,t as c}from"./field.js";import{h as _e}from"./ec23.js";var ve=t(),l=e();function u(){let e=(0,ve.c)(72),t=ee(),{data:r}=n(se),{data:u}=n(ce),d=le(),f;e[0]===r.Vpcs?f=e[1]:(f=r.Vpcs??[],e[0]=r.Vpcs,e[1]=f);let p=f,m;e[2]===u.AvailabilityZones?m=e[3]:(m=u.AvailabilityZones??[],e[2]=u.AvailabilityZones,e[3]=m);let h=m,g;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=fe(_e),e[4]=g):g=e[4];let _=p[0]?.VpcId??``,v;e[5]===_?v=e[6]:(v={resolver:g,defaultValues:{vpcId:_,cidrBlock:`10.0.1.0/24`,availabilityZone:void 0,mapPublicIpOnLaunch:!1}},e[5]=_,e[6]=v);let{control:y,handleSubmit:b,register:x,formState:Ce}=de(v),{errors:S,isSubmitting:C}=Ce,w;e[7]===y?w=e[8]:(w={control:y},e[7]=y,e[8]=w);let T=ue(w),E;e[9]!==d||e[10]!==t?(E=async e=>{let n=(await d.mutateAsync(e)).Subnet?.SubnetId;t(n?{to:`/ec2/describe-subnets/$id`,params:{id:n}}:{to:`/ec2/describe-subnets`})},e[9]=d,e[10]=t,e[11]=E):E=e[11];let D=E,O,k;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,l.jsx)(i,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),k=(0,l.jsx)(he,{title:`Create Subnet`}),e[12]=O,e[13]=k):(O=e[12],k=e[13]);let A;e[14]===d.error?A=e[15]:(A=d.error&&(0,l.jsx)(pe,{error:d.error,msg:`Failed to create subnet`}),e[14]=d.error,e[15]=A);let j;e[16]!==b||e[17]!==D?(j=b(D),e[16]=b,e[17]=D,e[18]=j):j=e[18];let M;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,l.jsx)(s,{children:(0,l.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),e[19]=M):M=e[19];let N;e[20]!==S.vpcId||e[21]!==p?(N=e=>{let{field:t}=e;return(0,l.jsxs)(ie,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,l.jsx)(re,{"aria-invalid":!!S.vpcId,className:`w-full`,id:`vpcId`,children:(0,l.jsx)(te,{})}),(0,l.jsx)(ne,{children:p.map(xe)})]})},e[20]=S.vpcId,e[21]=p,e[22]=N):N=e[22];let P;e[23]!==y||e[24]!==N?(P=(0,l.jsx)(o,{control:y,name:`vpcId`,render:N}),e[23]=y,e[24]=N,e[25]=P):P=e[25];let F;e[26]===S.vpcId?F=e[27]:(F=(0,l.jsx)(ge,{errors:[S.vpcId]}),e[26]=S.vpcId,e[27]=F);let I;e[28]!==P||e[29]!==F?(I=(0,l.jsxs)(c,{children:[M,P,F]}),e[28]=P,e[29]=F,e[30]=I):I=e[30];let L;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,l.jsx)(s,{children:(0,l.jsx)(`label`,{htmlFor:`cidrBlock`,children:`CIDR Block`})}),e[31]=L):L=e[31];let R=!!S.cidrBlock,z;e[32]===x?z=e[33]:(z=x(`cidrBlock`),e[32]=x,e[33]=z);let B;e[34]!==R||e[35]!==z?(B=(0,l.jsx)(oe,{"aria-invalid":R,id:`cidrBlock`,placeholder:`10.0.1.0/24`,...z}),e[34]=R,e[35]=z,e[36]=B):B=e[36];let V;e[37]===S.cidrBlock?V=e[38]:(V=(0,l.jsx)(ge,{errors:[S.cidrBlock]}),e[37]=S.cidrBlock,e[38]=V);let H;e[39]!==B||e[40]!==V?(H=(0,l.jsxs)(c,{children:[L,B,V]}),e[39]=B,e[40]=V,e[41]=H):H=e[41];let U;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,l.jsx)(s,{children:(0,l.jsx)(`label`,{htmlFor:`availabilityZone`,children:`Availability Zone (optional)`})}),e[42]=U):U=e[42];let W;e[43]===h?W=e[44]:(W=e=>{let{field:t}=e;return(0,l.jsxs)(ie,{onValueChange:e=>t.onChange(e===`none`?void 0:e),value:t.value??`none`,children:[(0,l.jsx)(re,{className:`w-full`,id:`availabilityZone`,children:(0,l.jsx)(te,{})}),(0,l.jsxs)(ne,{children:[(0,l.jsx)(a,{value:`none`,children:`none`}),h.map(be)]})]})},e[43]=h,e[44]=W);let G;e[45]!==y||e[46]!==W?(G=(0,l.jsxs)(c,{children:[U,(0,l.jsx)(o,{control:y,name:`availabilityZone`,render:W})]}),e[45]=y,e[46]=W,e[47]=G):G=e[47];let K;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,l.jsx)(s,{children:`Auto-assign public IPv4`}),e[48]=K):K=e[48];let q;e[49]===y?q=e[50]:(q=(0,l.jsxs)(c,{children:[K,(0,l.jsx)(o,{control:y,name:`mapPublicIpOnLaunch`,render:ye})]}),e[49]=y,e[50]=q);let J;e[51]===T?J=e[52]:(J=Se(T),e[51]=T,e[52]=J);let Y;e[53]===J?Y=e[54]:(Y=(0,l.jsx)(ae,{commands:J}),e[53]=J,e[54]=Y);let X;e[55]===t?X=e[56]:(X=async()=>await t({to:`/ec2/describe-subnets`}),e[55]=t,e[56]=X);let Z;e[57]!==d.isPending||e[58]!==C||e[59]!==X?(Z=(0,l.jsx)(me,{isPending:d.isPending,isSubmitting:C,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Subnet`}),e[57]=d.isPending,e[58]=C,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==j||e[62]!==I||e[63]!==H||e[64]!==G||e[65]!==q||e[66]!==Y||e[67]!==Z?(Q=(0,l.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:j,children:[I,H,G,q,Y,Z]}),e[61]=j,e[62]=I,e[63]=H,e[64]=G,e[65]=q,e[66]=Y,e[67]=Z,e[68]=Q):Q=e[68];let $;return e[69]!==A||e[70]!==Q?($=(0,l.jsxs)(l.Fragment,{children:[O,k,A,Q]}),e[69]=A,e[70]=Q,e[71]=$):$=e[71],$}function ye(e){let{field:t}=e;return(0,l.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,l.jsx)(`input`,{"aria-label":`Enable auto-assign public IPv4 address`,checked:t.value??!1,onChange:e=>t.onChange(e.target.checked),type:`checkbox`}),`Enable auto-assign public IPv4 address`]})}function be(e){return(0,l.jsx)(a,{value:e.ZoneName??``,children:e.ZoneName},e.ZoneName)}function xe(e){let t=r(e.Tags);return(0,l.jsx)(a,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function Se(e){let t=e.vpcId??``,n=e.cidrBlock??``,ee=e.availabilityZone??``,r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-subnet`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{nn as r}from"./cluster-config.js";import{t as i}from"./back-link.js";import{c as te,i as a,n as ne,s as re,t as ie}from"./select.js";import{t as ae}from"./cli-command-panel.js";import{t as oe}from"./input.js";import{M as se,r as ce}from"./ec2.js";import{C as le}from"./ec22.js";import{a as ue,i as de,n as o,t as fe}from"./zod.js";import{t as pe}from"./error-banner.js";import{t as me}from"./form-actions.js";import{t as he}from"./page-heading.js";import{a as s,r as ge,t as c}from"./field.js";import{h as _e}from"./ec23.js";var ve=t(),l=e();function u(){let e=(0,ve.c)(72),t=ee(),{data:r}=n(se),{data:u}=n(ce),d=le(),f;e[0]===r.Vpcs?f=e[1]:(f=r.Vpcs??[],e[0]=r.Vpcs,e[1]=f);let p=f,m;e[2]===u.AvailabilityZones?m=e[3]:(m=u.AvailabilityZones??[],e[2]=u.AvailabilityZones,e[3]=m);let h=m,g;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=fe(_e),e[4]=g):g=e[4];let _=p[0]?.VpcId??``,v;e[5]===_?v=e[6]:(v={resolver:g,defaultValues:{vpcId:_,cidrBlock:`10.0.1.0/24`,availabilityZone:void 0,mapPublicIpOnLaunch:!1}},e[5]=_,e[6]=v);let{control:y,handleSubmit:b,register:x,formState:Ce}=de(v),{errors:S,isSubmitting:C}=Ce,w;e[7]===y?w=e[8]:(w={control:y},e[7]=y,e[8]=w);let T=ue(w),E;e[9]!==d||e[10]!==t?(E=async e=>{let n=(await d.mutateAsync(e)).Subnet?.SubnetId;t(n?{to:`/ec2/describe-subnets/$id`,params:{id:n}}:{to:`/ec2/describe-subnets`})},e[9]=d,e[10]=t,e[11]=E):E=e[11];let D=E,O,k;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,l.jsx)(i,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),k=(0,l.jsx)(he,{title:`Create Subnet`}),e[12]=O,e[13]=k):(O=e[12],k=e[13]);let A;e[14]===d.error?A=e[15]:(A=d.error&&(0,l.jsx)(pe,{error:d.error,msg:`Failed to create subnet`}),e[14]=d.error,e[15]=A);let j;e[16]!==b||e[17]!==D?(j=b(D),e[16]=b,e[17]=D,e[18]=j):j=e[18];let M;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,l.jsx)(s,{children:(0,l.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),e[19]=M):M=e[19];let N;e[20]!==S.vpcId||e[21]!==p?(N=e=>{let{field:t}=e;return(0,l.jsxs)(ie,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,l.jsx)(re,{"aria-invalid":!!S.vpcId,className:`w-full`,id:`vpcId`,children:(0,l.jsx)(te,{})}),(0,l.jsx)(ne,{children:p.map(xe)})]})},e[20]=S.vpcId,e[21]=p,e[22]=N):N=e[22];let P;e[23]!==y||e[24]!==N?(P=(0,l.jsx)(o,{control:y,name:`vpcId`,render:N}),e[23]=y,e[24]=N,e[25]=P):P=e[25];let F;e[26]===S.vpcId?F=e[27]:(F=(0,l.jsx)(ge,{errors:[S.vpcId]}),e[26]=S.vpcId,e[27]=F);let I;e[28]!==P||e[29]!==F?(I=(0,l.jsxs)(c,{children:[M,P,F]}),e[28]=P,e[29]=F,e[30]=I):I=e[30];let L;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,l.jsx)(s,{children:(0,l.jsx)(`label`,{htmlFor:`cidrBlock`,children:`CIDR Block`})}),e[31]=L):L=e[31];let R=!!S.cidrBlock,z;e[32]===x?z=e[33]:(z=x(`cidrBlock`),e[32]=x,e[33]=z);let B;e[34]!==R||e[35]!==z?(B=(0,l.jsx)(oe,{"aria-invalid":R,id:`cidrBlock`,placeholder:`10.0.1.0/24`,...z}),e[34]=R,e[35]=z,e[36]=B):B=e[36];let V;e[37]===S.cidrBlock?V=e[38]:(V=(0,l.jsx)(ge,{errors:[S.cidrBlock]}),e[37]=S.cidrBlock,e[38]=V);let H;e[39]!==B||e[40]!==V?(H=(0,l.jsxs)(c,{children:[L,B,V]}),e[39]=B,e[40]=V,e[41]=H):H=e[41];let U;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,l.jsx)(s,{children:(0,l.jsx)(`label`,{htmlFor:`availabilityZone`,children:`Availability Zone (optional)`})}),e[42]=U):U=e[42];let W;e[43]===h?W=e[44]:(W=e=>{let{field:t}=e;return(0,l.jsxs)(ie,{onValueChange:e=>{t.onChange(e===`none`?void 0:e)},value:t.value??`none`,children:[(0,l.jsx)(re,{className:`w-full`,id:`availabilityZone`,children:(0,l.jsx)(te,{})}),(0,l.jsxs)(ne,{children:[(0,l.jsx)(a,{value:`none`,children:`none`}),h.map(be)]})]})},e[43]=h,e[44]=W);let G;e[45]!==y||e[46]!==W?(G=(0,l.jsxs)(c,{children:[U,(0,l.jsx)(o,{control:y,name:`availabilityZone`,render:W})]}),e[45]=y,e[46]=W,e[47]=G):G=e[47];let K;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,l.jsx)(s,{children:`Auto-assign public IPv4`}),e[48]=K):K=e[48];let q;e[49]===y?q=e[50]:(q=(0,l.jsxs)(c,{children:[K,(0,l.jsx)(o,{control:y,name:`mapPublicIpOnLaunch`,render:ye})]}),e[49]=y,e[50]=q);let J;e[51]===T?J=e[52]:(J=Se(T),e[51]=T,e[52]=J);let Y;e[53]===J?Y=e[54]:(Y=(0,l.jsx)(ae,{commands:J}),e[53]=J,e[54]=Y);let X;e[55]===t?X=e[56]:(X=async()=>{await t({to:`/ec2/describe-subnets`})},e[55]=t,e[56]=X);let Z;e[57]!==d.isPending||e[58]!==C||e[59]!==X?(Z=(0,l.jsx)(me,{isPending:d.isPending,isSubmitting:C,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Subnet`}),e[57]=d.isPending,e[58]=C,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==j||e[62]!==I||e[63]!==H||e[64]!==G||e[65]!==q||e[66]!==Y||e[67]!==Z?(Q=(0,l.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:j,children:[I,H,G,q,Y,Z]}),e[61]=j,e[62]=I,e[63]=H,e[64]=G,e[65]=q,e[66]=Y,e[67]=Z,e[68]=Q):Q=e[68];let $;return e[69]!==A||e[70]!==Q?($=(0,l.jsxs)(l.Fragment,{children:[O,k,A,Q]}),e[69]=A,e[70]=Q,e[71]=$):$=e[71],$}function ye(e){let{field:t}=e;return(0,l.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,l.jsx)(`input`,{"aria-label":`Enable auto-assign public IPv4 address`,checked:t.value??!1,onChange:e=>{t.onChange(e.target.checked)},type:`checkbox`}),`Enable auto-assign public IPv4 address`]})}function be(e){return(0,l.jsx)(a,{value:e.ZoneName??``,children:e.ZoneName},e.ZoneName)}function xe(e){let t=r(e.Tags);return(0,l.jsx)(a,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function Se(e){let t=e.vpcId??``,n=e.cidrBlock??``,ee=e.availabilityZone??``,r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-subnet`},{type:`flag`,value:` \\ --vpc-id`},{type:`value`,value:` ${t||``}`},{type:`flag`,value:` \\ --cidr-block`},{type:`value`,value:` ${n||``}`}];ee&&r.push({type:`flag`,value:` \\ --availability-zone`},{type:`value`,value:` ${ee}`});let i=[{label:`Create Subnet`,parts:r}];return e.mapPublicIpOnLaunch===!0&&i.push({label:`Enable auto-assign public IPv4`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 modify-subnet-attribute`},{type:`flag`,value:` \\ diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-target-group.js b/spinifex/services/spinifexui/frontend/dist/assets/create-target-group.js index 9f805592e..7a920c206 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-target-group.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-target-group.js @@ -1,4 +1,4 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{t as i}from"./back-link.js";import{t as a}from"./cli-command-panel.js";import{M as o}from"./ec2.js";import{i as s}from"./elbv2.js";import{i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{t as p}from"./target-group-form.js";import{a as m}from"./elbv23.js";var h=t(),g=e();function _(){let e=(0,h.c)(38),t=r(),{data:_}=n(o),y=s(),b;e[0]===_.Vpcs?b=e[1]:(b=_.Vpcs??[],e[0]=_.Vpcs,e[1]=b);let x=b,S;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=l(m),e[2]=S):S=e[2];let C=x[0]?.VpcId??``,w,T;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(w={protocol:`HTTP`,path:`/`,port:`traffic-port`,intervalSeconds:30,timeoutSeconds:5,healthyThresholdCount:5,unhealthyThresholdCount:2,matcher:`200`},T=[],e[3]=w,e[4]=T):(w=e[3],T=e[4]);let E;e[5]===C?E=e[6]:(E={resolver:S,defaultValues:{name:``,protocol:`HTTP`,port:80,vpcId:C,healthCheck:w,tags:T}},e[5]=C,e[6]=E);let D=c(E),{handleSubmit:O,watch:k,formState:A}=D,{isSubmitting:j}=A,M;e[7]!==y||e[8]!==t?(M=async e=>{try{let n=(await y.mutateAsync(e)).TargetGroups?.[0]?.TargetGroupArn;t(n?{to:`/ec2/describe-target-groups/$id`,params:{id:encodeURIComponent(n)}}:{to:`/ec2/describe-target-groups`})}catch{}},e[7]=y,e[8]=t,e[9]=M):M=e[9];let N=M,P,F;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,g.jsx)(i,{to:`/ec2/describe-target-groups`,children:`Back to target groups`}),F=(0,g.jsx)(f,{title:`Create Target Group`}),e[10]=P,e[11]=F):(P=e[10],F=e[11]);let I;e[12]===y.error?I=e[13]:(I=y.error&&(0,g.jsx)(u,{error:y.error,msg:`Failed to create target group`}),e[12]=y.error,e[13]=I);let L;e[14]!==O||e[15]!==N?(L=O(N),e[14]=O,e[15]=N,e[16]=L):L=e[16];let R;e[17]!==D||e[18]!==x?(R=(0,g.jsx)(p,{form:D,vpcs:x}),e[17]=D,e[18]=x,e[19]=R):R=e[19];let z;e[20]===k?z=e[21]:(z=v(k),e[20]=k,e[21]=z);let B;e[22]===z?B=e[23]:(B=(0,g.jsx)(a,{commands:z}),e[22]=z,e[23]=B);let V;e[24]===t?V=e[25]:(V=async()=>await t({to:`/ec2/describe-target-groups`}),e[24]=t,e[25]=V);let H;e[26]!==y.isPending||e[27]!==j||e[28]!==V?(H=(0,g.jsx)(d,{isPending:y.isPending,isSubmitting:j,onCancel:V,pendingLabel:`Creating…`,submitLabel:`Create Target Group`}),e[26]=y.isPending,e[27]=j,e[28]=V,e[29]=H):H=e[29];let U;e[30]!==L||e[31]!==R||e[32]!==B||e[33]!==H?(U=(0,g.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:L,children:[R,B,H]}),e[30]=L,e[31]=R,e[32]=B,e[33]=H,e[34]=U):U=e[34];let W;return e[35]!==I||e[36]!==U?(W=(0,g.jsxs)(g.Fragment,{children:[P,F,I,U]}),e[35]=I,e[36]=U,e[37]=W):W=e[37],W}function v(e){let t=e(`name`),n=e(`protocol`)||`HTTP`,r=e(`port`),i=e(`vpcId`),a=e(`healthCheck.protocol`)||`HTTP`,o=e(`healthCheck.path`)||`/`,s=e(`healthCheck.port`)||`traffic-port`,c=e(`healthCheck.intervalSeconds`),l=e(`healthCheck.timeoutSeconds`),u=e(`healthCheck.healthyThresholdCount`),d=e(`healthCheck.unhealthyThresholdCount`),f=e(`healthCheck.matcher`)||`200`,p=[{type:`bin`,value:`AWS_PROFILE=spinifex aws elbv2 create-target-group`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{t as i}from"./back-link.js";import{t as a}from"./cli-command-panel.js";import{M as o}from"./ec2.js";import{i as s}from"./elbv2.js";import{i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{t as p}from"./target-group-form.js";import{a as m}from"./elbv23.js";var h=t(),g=e();function _(){let e=(0,h.c)(38),t=r(),{data:_}=n(o),y=s(),b;e[0]===_.Vpcs?b=e[1]:(b=_.Vpcs??[],e[0]=_.Vpcs,e[1]=b);let x=b,S;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=l(m),e[2]=S):S=e[2];let C=x[0]?.VpcId??``,w,T;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(w={protocol:`HTTP`,path:`/`,port:`traffic-port`,intervalSeconds:30,timeoutSeconds:5,healthyThresholdCount:5,unhealthyThresholdCount:2,matcher:`200`},T=[],e[3]=w,e[4]=T):(w=e[3],T=e[4]);let E;e[5]===C?E=e[6]:(E={resolver:S,defaultValues:{name:``,protocol:`HTTP`,port:80,vpcId:C,healthCheck:w,tags:T}},e[5]=C,e[6]=E);let D=c(E),{handleSubmit:O,watch:k,formState:A}=D,{isSubmitting:j}=A,M;e[7]!==y||e[8]!==t?(M=async e=>{try{let n=(await y.mutateAsync(e)).TargetGroups?.[0]?.TargetGroupArn;t(n?{to:`/ec2/describe-target-groups/$id`,params:{id:encodeURIComponent(n)}}:{to:`/ec2/describe-target-groups`})}catch{}},e[7]=y,e[8]=t,e[9]=M):M=e[9];let N=M,P,F;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,g.jsx)(i,{to:`/ec2/describe-target-groups`,children:`Back to target groups`}),F=(0,g.jsx)(f,{title:`Create Target Group`}),e[10]=P,e[11]=F):(P=e[10],F=e[11]);let I;e[12]===y.error?I=e[13]:(I=y.error&&(0,g.jsx)(u,{error:y.error,msg:`Failed to create target group`}),e[12]=y.error,e[13]=I);let L;e[14]!==O||e[15]!==N?(L=O(N),e[14]=O,e[15]=N,e[16]=L):L=e[16];let R;e[17]!==D||e[18]!==x?(R=(0,g.jsx)(p,{form:D,vpcs:x}),e[17]=D,e[18]=x,e[19]=R):R=e[19];let z;e[20]===k?z=e[21]:(z=v(k),e[20]=k,e[21]=z);let B;e[22]===z?B=e[23]:(B=(0,g.jsx)(a,{commands:z}),e[22]=z,e[23]=B);let V;e[24]===t?V=e[25]:(V=async()=>{await t({to:`/ec2/describe-target-groups`})},e[24]=t,e[25]=V);let H;e[26]!==y.isPending||e[27]!==j||e[28]!==V?(H=(0,g.jsx)(d,{isPending:y.isPending,isSubmitting:j,onCancel:V,pendingLabel:`Creating…`,submitLabel:`Create Target Group`}),e[26]=y.isPending,e[27]=j,e[28]=V,e[29]=H):H=e[29];let U;e[30]!==L||e[31]!==R||e[32]!==B||e[33]!==H?(U=(0,g.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:L,children:[R,B,H]}),e[30]=L,e[31]=R,e[32]=B,e[33]=H,e[34]=U):U=e[34];let W;return e[35]!==I||e[36]!==U?(W=(0,g.jsxs)(g.Fragment,{children:[P,F,I,U]}),e[35]=I,e[36]=U,e[37]=W):W=e[37],W}function v(e){let t=e(`name`),n=e(`protocol`)||`HTTP`,r=e(`port`),i=e(`vpcId`),a=e(`healthCheck.protocol`)||`HTTP`,o=e(`healthCheck.path`)||`/`,s=e(`healthCheck.port`)||`traffic-port`,c=e(`healthCheck.intervalSeconds`),l=e(`healthCheck.timeoutSeconds`),u=e(`healthCheck.healthyThresholdCount`),d=e(`healthCheck.unhealthyThresholdCount`),f=e(`healthCheck.matcher`)||`200`,p=[{type:`bin`,value:`AWS_PROFILE=spinifex aws elbv2 create-target-group`},{type:`flag`,value:` \\ --name`},{type:`value`,value:` ${t||``}`},{type:`flag`,value:` \\ --protocol`},{type:`value`,value:` ${n}`},{type:`flag`,value:` \\ --port`},{type:`value`,value:` ${r??80}`},{type:`flag`,value:` \\ diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-user.js b/spinifex/services/spinifexui/frontend/dist/assets/create-user.js index 5f4734da5..03dcea51c 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-user.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-user.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{d as o}from"./iam.js";import{a as s,i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,r as m,t as h}from"./field.js";import{o as g}from"./iam3.js";var _=t(),v=e();function y(){let e=(0,_.c)(53),t=n(),y=o(),x;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(x={resolver:l(g)},e[0]=x):x=e[0];let{handleSubmit:S,register:C,control:w,formState:T}=c(x),{errors:E,isSubmitting:D}=T,O;e[1]===w?O=e[2]:(O={control:w},e[1]=w,e[2]=O);let k=s(O),A;e[3]!==y||e[4]!==t?(A=async e=>{await y.mutateAsync(e),t({to:`/iam/list-users`})},e[3]=y,e[4]=t,e[5]=A):A=e[5];let j=A,M,N;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,v.jsx)(r,{to:`/iam/list-users`,children:`Back to users`}),N=(0,v.jsx)(f,{title:`Create User`}),e[6]=M,e[7]=N):(M=e[6],N=e[7]);let P;e[8]===y.error?P=e[9]:(P=y.error&&(0,v.jsx)(u,{error:y.error,msg:`Failed to create user`}),e[8]=y.error,e[9]=P);let F;e[10]!==S||e[11]!==j?(F=S(j),e[10]=S,e[11]=j,e[12]=F):F=e[12];let I;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`userName`,children:`User Name`})}),e[13]=I):I=e[13];let L=!!E.userName,R;e[14]===C?R=e[15]:(R=C(`userName`),e[14]=C,e[15]=R);let z;e[16]!==R||e[17]!==L?(z=(0,v.jsx)(a,{"aria-invalid":L,id:`userName`,placeholder:`my-user...`,...R}),e[16]=R,e[17]=L,e[18]=z):z=e[18];let B;e[19]===E.userName?B=e[20]:(B=(0,v.jsx)(m,{errors:[E.userName]}),e[19]=E.userName,e[20]=B);let V;e[21]!==z||e[22]!==B?(V=(0,v.jsxs)(h,{children:[I,z,B]}),e[21]=z,e[22]=B,e[23]=V):V=e[23];let H;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`path`,children:`Path (optional)`})}),e[24]=H):H=e[24];let U;e[25]===C?U=e[26]:(U=C(`path`),e[25]=C,e[26]=U);let W;e[27]===U?W=e[28]:(W=(0,v.jsx)(a,{id:`path`,placeholder:`/`,...U}),e[27]=U,e[28]=W);let G;e[29]===E.path?G=e[30]:(G=(0,v.jsx)(m,{errors:[E.path]}),e[29]=E.path,e[30]=G);let K;e[31]!==W||e[32]!==G?(K=(0,v.jsxs)(h,{children:[H,W,G]}),e[31]=W,e[32]=G,e[33]=K):K=e[33];let q;e[34]===k?q=e[35]:(q=b(k),e[34]=k,e[35]=q);let J;e[36]===q?J=e[37]:(J=(0,v.jsx)(i,{commands:q}),e[36]=q,e[37]=J);let Y;e[38]===t?Y=e[39]:(Y=async()=>await t({to:`/iam/list-users`}),e[38]=t,e[39]=Y);let X;e[40]!==y.isPending||e[41]!==D||e[42]!==Y?(X=(0,v.jsx)(d,{isPending:y.isPending,isSubmitting:D,onCancel:Y,pendingLabel:`Creating...`,submitLabel:`Create User`}),e[40]=y.isPending,e[41]=D,e[42]=Y,e[43]=X):X=e[43];let Z;e[44]!==V||e[45]!==K||e[46]!==J||e[47]!==X||e[48]!==F?(Z=(0,v.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[V,K,J,X]}),e[44]=V,e[45]=K,e[46]=J,e[47]=X,e[48]=F,e[49]=Z):Z=e[49];let Q;return e[50]!==Z||e[51]!==P?(Q=(0,v.jsxs)(v.Fragment,{children:[M,N,P,Z]}),e[50]=Z,e[51]=P,e[52]=Q):Q=e[52],Q}function b(e){let t=e.userName??``,n=e.path??``,r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-user`},{type:`flag`,value:` --user-name`},{type:`value`,value:` ${t||``}`}];return n&&n!==`/`&&r.push({type:`flag`,value:` --path`},{type:`value`,value:` ${n}`}),[{label:`Create User`,parts:r}]}export{y as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{d as o}from"./iam.js";import{a as s,i as c,t as l}from"./zod.js";import{t as u}from"./error-banner.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,r as m,t as h}from"./field.js";import{o as g}from"./iam3.js";var _=t(),v=e();function y(){let e=(0,_.c)(53),t=n(),y=o(),x;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(x={resolver:l(g)},e[0]=x):x=e[0];let{handleSubmit:S,register:C,control:w,formState:T}=c(x),{errors:E,isSubmitting:D}=T,O;e[1]===w?O=e[2]:(O={control:w},e[1]=w,e[2]=O);let k=s(O),A;e[3]!==y||e[4]!==t?(A=async e=>{await y.mutateAsync(e),t({to:`/iam/list-users`})},e[3]=y,e[4]=t,e[5]=A):A=e[5];let j=A,M,N;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,v.jsx)(r,{to:`/iam/list-users`,children:`Back to users`}),N=(0,v.jsx)(f,{title:`Create User`}),e[6]=M,e[7]=N):(M=e[6],N=e[7]);let P;e[8]===y.error?P=e[9]:(P=y.error&&(0,v.jsx)(u,{error:y.error,msg:`Failed to create user`}),e[8]=y.error,e[9]=P);let F;e[10]!==S||e[11]!==j?(F=S(j),e[10]=S,e[11]=j,e[12]=F):F=e[12];let I;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`userName`,children:`User Name`})}),e[13]=I):I=e[13];let L=!!E.userName,R;e[14]===C?R=e[15]:(R=C(`userName`),e[14]=C,e[15]=R);let z;e[16]!==R||e[17]!==L?(z=(0,v.jsx)(a,{"aria-invalid":L,id:`userName`,placeholder:`my-user...`,...R}),e[16]=R,e[17]=L,e[18]=z):z=e[18];let B;e[19]===E.userName?B=e[20]:(B=(0,v.jsx)(m,{errors:[E.userName]}),e[19]=E.userName,e[20]=B);let V;e[21]!==z||e[22]!==B?(V=(0,v.jsxs)(h,{children:[I,z,B]}),e[21]=z,e[22]=B,e[23]=V):V=e[23];let H;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,v.jsx)(p,{children:(0,v.jsx)(`label`,{htmlFor:`path`,children:`Path (optional)`})}),e[24]=H):H=e[24];let U;e[25]===C?U=e[26]:(U=C(`path`),e[25]=C,e[26]=U);let W;e[27]===U?W=e[28]:(W=(0,v.jsx)(a,{id:`path`,placeholder:`/`,...U}),e[27]=U,e[28]=W);let G;e[29]===E.path?G=e[30]:(G=(0,v.jsx)(m,{errors:[E.path]}),e[29]=E.path,e[30]=G);let K;e[31]!==W||e[32]!==G?(K=(0,v.jsxs)(h,{children:[H,W,G]}),e[31]=W,e[32]=G,e[33]=K):K=e[33];let q;e[34]===k?q=e[35]:(q=b(k),e[34]=k,e[35]=q);let J;e[36]===q?J=e[37]:(J=(0,v.jsx)(i,{commands:q}),e[36]=q,e[37]=J);let Y;e[38]===t?Y=e[39]:(Y=async()=>{await t({to:`/iam/list-users`})},e[38]=t,e[39]=Y);let X;e[40]!==y.isPending||e[41]!==D||e[42]!==Y?(X=(0,v.jsx)(d,{isPending:y.isPending,isSubmitting:D,onCancel:Y,pendingLabel:`Creating...`,submitLabel:`Create User`}),e[40]=y.isPending,e[41]=D,e[42]=Y,e[43]=X):X=e[43];let Z;e[44]!==V||e[45]!==K||e[46]!==J||e[47]!==X||e[48]!==F?(Z=(0,v.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:F,children:[V,K,J,X]}),e[44]=V,e[45]=K,e[46]=J,e[47]=X,e[48]=F,e[49]=Z):Z=e[49];let Q;return e[50]!==Z||e[51]!==P?(Q=(0,v.jsxs)(v.Fragment,{children:[M,N,P,Z]}),e[50]=Z,e[51]=P,e[52]=Q):Q=e[52],Q}function b(e){let t=e.userName??``,n=e.path??``,r=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-user`},{type:`flag`,value:` --user-name`},{type:`value`,value:` ${t||``}`}];return n&&n!==`/`&&r.push({type:`flag`,value:` --path`},{type:`value`,value:` ${n}`}),[{label:`Create User`,parts:r}]}export{y as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-volume.js b/spinifex/services/spinifexui/frontend/dist/assets/create-volume.js index d7f451ac7..d1b2e41e8 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-volume.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-volume.js @@ -1,3 +1,3 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{t as i}from"./back-link.js";import{c as ee,i as a,n as o,s,t as c}from"./select.js";import{t as l}from"./cli-command-panel.js";import{t as te}from"./input.js";import{r as ne}from"./ec2.js";import{w as re}from"./ec22.js";import{i as ie,n as ae,t as oe}from"./zod.js";import{t as se}from"./error-banner.js";import{t as ce}from"./form-actions.js";import{t as le}from"./page-heading.js";import{a as u,r as d,t as f}from"./field.js";import{g as p}from"./ec23.js";var m=t(),h=e();function g(){let e=(0,m.c)(57),t=r(),{data:a}=n(ne),g=re(),y;e[0]===a.AvailabilityZones?y=e[1]:(y=a.AvailabilityZones??[],e[0]=a.AvailabilityZones,e[1]=y);let b=y,x=b[0]?.ZoneName??``,S;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=oe(p),e[2]=S):S=e[2];let C;e[3]===x?C=e[4]:(C={resolver:S,defaultValues:{size:1,availabilityZone:x}},e[3]=x,e[4]=C);let{control:w,handleSubmit:T,register:E,watch:D,formState:O}=ie(C),{errors:k,isSubmitting:A}=O,j;e[5]!==g||e[6]!==t?(j=async e=>{await g.mutateAsync(e),t({to:`/ec2/describe-volumes`})},e[5]=g,e[6]=t,e[7]=j):j=e[7];let M=j,N,P;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,h.jsx)(i,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),P=(0,h.jsx)(le,{title:`Create Volume`}),e[8]=N,e[9]=P):(N=e[8],P=e[9]);let F;e[10]===g.error?F=e[11]:(F=g.error&&(0,h.jsx)(se,{error:g.error,msg:`Failed to create volume`}),e[10]=g.error,e[11]=F);let I;e[12]!==T||e[13]!==M?(I=T(M),e[12]=T,e[13]=M,e[14]=I):I=e[14];let L;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,h.jsx)(u,{children:(0,h.jsx)(`label`,{htmlFor:`size`,children:`Size (GiB)`})}),e[15]=L):L=e[15];let R=!!k.size,z;e[16]===E?z=e[17]:(z=E(`size`,{valueAsNumber:!0}),e[16]=E,e[17]=z);let B;e[18]!==R||e[19]!==z?(B=(0,h.jsx)(te,{"aria-invalid":R,id:`size`,max:16384,min:1,type:`number`,...z}),e[18]=R,e[19]=z,e[20]=B):B=e[20];let V;e[21]===k.size?V=e[22]:(V=(0,h.jsx)(d,{errors:[k.size]}),e[21]=k.size,e[22]=V);let H;e[23]!==B||e[24]!==V?(H=(0,h.jsxs)(f,{children:[L,B,V]}),e[23]=B,e[24]=V,e[25]=H):H=e[25];let U;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,h.jsx)(u,{children:(0,h.jsx)(`label`,{htmlFor:`availabilityZone`,children:`Availability Zone`})}),e[26]=U):U=e[26];let W;e[27]!==b||e[28]!==k.availabilityZone?(W=e=>{let{field:t}=e;return(0,h.jsxs)(c,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,h.jsx)(s,{"aria-invalid":!!k.availabilityZone,className:`w-full`,id:`availabilityZone`,children:(0,h.jsx)(ee,{})}),(0,h.jsx)(o,{children:b.map(_)})]})},e[27]=b,e[28]=k.availabilityZone,e[29]=W):W=e[29];let G;e[30]!==w||e[31]!==W?(G=(0,h.jsx)(ae,{control:w,name:`availabilityZone`,render:W}),e[30]=w,e[31]=W,e[32]=G):G=e[32];let K;e[33]===k.availabilityZone?K=e[34]:(K=(0,h.jsx)(d,{errors:[k.availabilityZone]}),e[33]=k.availabilityZone,e[34]=K);let q;e[35]!==G||e[36]!==K?(q=(0,h.jsxs)(f,{children:[U,G,K]}),e[35]=G,e[36]=K,e[37]=q):q=e[37];let J;e[38]===D?J=e[39]:(J=v(D),e[38]=D,e[39]=J);let Y;e[40]===J?Y=e[41]:(Y=(0,h.jsx)(l,{commands:J}),e[40]=J,e[41]=Y);let X;e[42]===t?X=e[43]:(X=async()=>await t({to:`/ec2/describe-volumes`}),e[42]=t,e[43]=X);let Z;e[44]!==g.isPending||e[45]!==A||e[46]!==X?(Z=(0,h.jsx)(ce,{isPending:g.isPending,isSubmitting:A,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Volume`}),e[44]=g.isPending,e[45]=A,e[46]=X,e[47]=Z):Z=e[47];let Q;e[48]!==H||e[49]!==q||e[50]!==Y||e[51]!==Z||e[52]!==I?(Q=(0,h.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),e[48]=H,e[49]=q,e[50]=Y,e[51]=Z,e[52]=I,e[53]=Q):Q=e[53];let $;return e[54]!==Q||e[55]!==F?($=(0,h.jsxs)(h.Fragment,{children:[N,P,F,Q]}),e[54]=Q,e[55]=F,e[56]=$):$=e[56],$}function _(e){return(0,h.jsx)(a,{value:e.ZoneName??``,children:e.ZoneName},e.ZoneName)}function v(e){let t=e(`size`),n=e(`availabilityZone`);return[{label:`Create Volume`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-volume`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./useNavigate.js";import{t as i}from"./back-link.js";import{c as ee,i as a,n as o,s,t as c}from"./select.js";import{t as l}from"./cli-command-panel.js";import{t as te}from"./input.js";import{r as ne}from"./ec2.js";import{w as re}from"./ec22.js";import{i as ie,n as ae,t as oe}from"./zod.js";import{t as se}from"./error-banner.js";import{t as ce}from"./form-actions.js";import{t as le}from"./page-heading.js";import{a as u,r as d,t as f}from"./field.js";import{g as p}from"./ec23.js";var m=t(),h=e();function g(){let e=(0,m.c)(57),t=r(),{data:a}=n(ne),g=re(),y;e[0]===a.AvailabilityZones?y=e[1]:(y=a.AvailabilityZones??[],e[0]=a.AvailabilityZones,e[1]=y);let b=y,x=b[0]?.ZoneName??``,S;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=oe(p),e[2]=S):S=e[2];let C;e[3]===x?C=e[4]:(C={resolver:S,defaultValues:{size:1,availabilityZone:x}},e[3]=x,e[4]=C);let{control:w,handleSubmit:T,register:E,watch:D,formState:O}=ie(C),{errors:k,isSubmitting:A}=O,j;e[5]!==g||e[6]!==t?(j=async e=>{await g.mutateAsync(e),t({to:`/ec2/describe-volumes`})},e[5]=g,e[6]=t,e[7]=j):j=e[7];let M=j,N,P;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,h.jsx)(i,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),P=(0,h.jsx)(le,{title:`Create Volume`}),e[8]=N,e[9]=P):(N=e[8],P=e[9]);let F;e[10]===g.error?F=e[11]:(F=g.error&&(0,h.jsx)(se,{error:g.error,msg:`Failed to create volume`}),e[10]=g.error,e[11]=F);let I;e[12]!==T||e[13]!==M?(I=T(M),e[12]=T,e[13]=M,e[14]=I):I=e[14];let L;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,h.jsx)(u,{children:(0,h.jsx)(`label`,{htmlFor:`size`,children:`Size (GiB)`})}),e[15]=L):L=e[15];let R=!!k.size,z;e[16]===E?z=e[17]:(z=E(`size`,{valueAsNumber:!0}),e[16]=E,e[17]=z);let B;e[18]!==R||e[19]!==z?(B=(0,h.jsx)(te,{"aria-invalid":R,id:`size`,max:16384,min:1,type:`number`,...z}),e[18]=R,e[19]=z,e[20]=B):B=e[20];let V;e[21]===k.size?V=e[22]:(V=(0,h.jsx)(d,{errors:[k.size]}),e[21]=k.size,e[22]=V);let H;e[23]!==B||e[24]!==V?(H=(0,h.jsxs)(f,{children:[L,B,V]}),e[23]=B,e[24]=V,e[25]=H):H=e[25];let U;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,h.jsx)(u,{children:(0,h.jsx)(`label`,{htmlFor:`availabilityZone`,children:`Availability Zone`})}),e[26]=U):U=e[26];let W;e[27]!==b||e[28]!==k.availabilityZone?(W=e=>{let{field:t}=e;return(0,h.jsxs)(c,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,h.jsx)(s,{"aria-invalid":!!k.availabilityZone,className:`w-full`,id:`availabilityZone`,children:(0,h.jsx)(ee,{})}),(0,h.jsx)(o,{children:b.map(_)})]})},e[27]=b,e[28]=k.availabilityZone,e[29]=W):W=e[29];let G;e[30]!==w||e[31]!==W?(G=(0,h.jsx)(ae,{control:w,name:`availabilityZone`,render:W}),e[30]=w,e[31]=W,e[32]=G):G=e[32];let K;e[33]===k.availabilityZone?K=e[34]:(K=(0,h.jsx)(d,{errors:[k.availabilityZone]}),e[33]=k.availabilityZone,e[34]=K);let q;e[35]!==G||e[36]!==K?(q=(0,h.jsxs)(f,{children:[U,G,K]}),e[35]=G,e[36]=K,e[37]=q):q=e[37];let J;e[38]===D?J=e[39]:(J=v(D),e[38]=D,e[39]=J);let Y;e[40]===J?Y=e[41]:(Y=(0,h.jsx)(l,{commands:J}),e[40]=J,e[41]=Y);let X;e[42]===t?X=e[43]:(X=async()=>{await t({to:`/ec2/describe-volumes`})},e[42]=t,e[43]=X);let Z;e[44]!==g.isPending||e[45]!==A||e[46]!==X?(Z=(0,h.jsx)(ce,{isPending:g.isPending,isSubmitting:A,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Volume`}),e[44]=g.isPending,e[45]=A,e[46]=X,e[47]=Z):Z=e[47];let Q;e[48]!==H||e[49]!==q||e[50]!==Y||e[51]!==Z||e[52]!==I?(Q=(0,h.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),e[48]=H,e[49]=q,e[50]=Y,e[51]=Z,e[52]=I,e[53]=Q):Q=e[53];let $;return e[54]!==Q||e[55]!==F?($=(0,h.jsxs)(h.Fragment,{children:[N,P,F,Q]}),e[54]=Q,e[55]=F,e[56]=$):$=e[56],$}function _(e){return(0,h.jsx)(a,{value:e.ZoneName??``,children:e.ZoneName},e.ZoneName)}function v(e){let t=e(`size`),n=e(`availabilityZone`);return[{label:`Create Volume`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-volume`},{type:`flag`,value:` \\ --size`},{type:`value`,value:` ${t||1}`},{type:`flag`,value:` \\ --availability-zone`},{type:`value`,value:` ${n||``}`}]}]}export{g as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-vpc.js b/spinifex/services/spinifexui/frontend/dist/assets/create-vpc.js index 27c39dfe1..7f46b496f 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-vpc.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-vpc.js @@ -1,4 +1,4 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useNavigate.js";import{t as a}from"./back-link.js";import{t as o}from"./chevron-down.js";import{t as s}from"./chevron-right.js";import{c,i as l,n as u,s as d,t as f}from"./select.js";import{t as p}from"./cli-command-panel.js";import{t as m}from"./button.js";import{t as ee}from"./input.js";import{E as h,T as g}from"./ec22.js";import{a as te,i as ne,n as _,t as re}from"./zod.js";import{t as ie}from"./error-banner.js";import{t as ae}from"./form-actions.js";import{t as oe}from"./page-heading.js";import{a as v,r as se,t as y}from"./field.js";import{t as ce}from"./subnet-calculator.js";import{_ as le}from"./ec23.js";var b=r(),ue=e(n(),1),x=t();function de(e){let t=(0,b.c)(18),{form:n,type:r,count:i,defaults:a}=e,[c,l]=(0,ue.useState)(!1),u=r===`public`?`publicSubnetCidrs`:`privateSubnetCidrs`;if(i===0)return null;let d;t[0]===c?d=t[1]:(d=()=>l(!c),t[0]=c,t[1]=d);let f;t[2]===c?f=t[3]:(f=c?(0,x.jsx)(o,{className:`size-3`}):(0,x.jsx)(s,{className:`size-3`}),t[2]=c,t[3]=f);let p;t[4]!==d||t[5]!==f||t[6]!==r?(p=(0,x.jsxs)(m,{className:`gap-1 px-0 text-xs text-muted-foreground`,onClick:d,type:`button`,variant:`link`,children:[f,`Customize `,r,` subnet CIDR blocks`]}),t[4]=d,t[5]=f,t[6]=r,t[7]=p):p=t[7];let h;t[8]!==i||t[9]!==a||t[10]!==c||t[11]!==u||t[12]!==n||t[13]!==r?(h=c&&(0,x.jsx)(`div`,{className:`mt-2 space-y-2`,children:Array.from({length:i},(e,t)=>(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(`span`,{className:`w-32 text-xs text-muted-foreground`,children:[r===`public`?`Public`:`Private`,` subnet `,t+1]}),(0,x.jsx)(ee,{defaultValue:a[t],placeholder:a[t],...n.register(`${u}.${t}`)})]},t))}),t[8]=i,t[9]=a,t[10]=c,t[11]=u,t[12]=n,t[13]=r,t[14]=h):h=t[14];let g;return t[15]!==p||t[16]!==h?(g=(0,x.jsxs)(`div`,{className:`mt-2`,children:[p,h]}),t[15]=p,t[16]=h,t[17]=g):g=t[17],g}function S(e){let t=(0,b.c)(8),{label:n,cidr:r,variant:i}=e,a=`rounded-md border px-3 py-2 text-xs ${i===`public`?`border-emerald-500/30 bg-emerald-500/10`:`border-blue-500/30 bg-blue-500/10`}`,o;t[0]===n?o=t[1]:(o=(0,x.jsx)(`div`,{className:`font-medium`,children:n}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,x.jsx)(`div`,{className:`text-muted-foreground`,children:r}),t[2]=r,t[3]=s);let c;return t[4]!==a||t[5]!==o||t[6]!==s?(c=(0,x.jsxs)(`div`,{className:a,children:[o,s]}),t[4]=a,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function fe(e){let t=(0,b.c)(14),{mode:n,vpcCidr:r,publicSubnets:i,privateSubnets:a,hasIgw:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,x.jsx)(`h3`,{className:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`,children:`Preview`}),t[0]=s):s=t[0];let c;t[1]===r?c=t[2]:(c=(0,x.jsxs)(`div`,{className:`mb-3 text-xs font-medium`,children:[`VPC `,(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,r,`)`]})]}),t[1]=r,t[2]=c);let l;t[3]!==o||t[4]!==n||t[5]!==a||t[6]!==i?(l=n===`vpc-and-more`&&(0,x.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Subnets`}),i.map(C),a.map(pe),i.length===0&&a.length===0&&(0,x.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No subnets`})]}),(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Route Tables`}),i.length>0&&(0,x.jsxs)(`div`,{className:`rounded-md border border-foreground/10 bg-background px-3 py-2 text-xs`,children:[(0,x.jsx)(`div`,{className:`font-medium`,children:`Public Route Table`}),(0,x.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:`0.0.0.0/0 → IGW`}),(0,x.jsx)(`div`,{className:`text-muted-foreground`,children:`local`})]}),a.length>0&&(0,x.jsxs)(`div`,{className:`rounded-md border border-foreground/10 bg-background px-3 py-2 text-xs`,children:[(0,x.jsx)(`div`,{className:`font-medium`,children:`Private Route Table`}),(0,x.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:`local`})]})]}),(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Network Connections`}),o&&(0,x.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs`,children:[(0,x.jsx)(`div`,{className:`font-medium`,children:`Internet Gateway`}),(0,x.jsx)(`div`,{className:`text-muted-foreground`,children:`Attached to VPC`})]}),!o&&(0,x.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No internet gateway`})]})]}),t[3]=o,t[4]=n,t[5]=a,t[6]=i,t[7]=l):l=t[7];let u;t[8]===n?u=t[9]:(u=n===`vpc-only`&&(0,x.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`VPC only — no additional resources will be created.`}),t[8]=n,t[9]=u);let d;return t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,x.jsxs)(`div`,{className:`rounded-lg border bg-muted/30 p-4`,children:[s,(0,x.jsxs)(`div`,{className:`rounded-lg border-2 border-dashed border-foreground/20 p-4`,children:[c,l,u]})]}),t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function pe(e){return(0,x.jsx)(S,{cidr:e.cidr,label:e.label,variant:`private`},e.cidr)}function C(e){return(0,x.jsx)(S,{cidr:e.cidr,label:e.label,variant:`public`},e.cidr)}var me=[0,1],w=[0,1,2];function T(){let e=(0,b.c)(86),t=i(),n=g(),r=h(),[o,s]=(0,ue.useState)(null),c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=re(le),e[0]=c):c=e[0];let l;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={resolver:c,defaultValues:{mode:`vpc-only`,namePrefix:``,autoGenerateNames:!0,cidrBlock:`10.0.0.0/16`,tenancy:`default`,natGateway:`none`,publicSubnetCount:1,privateSubnetCount:1,publicSubnetCidrs:[],privateSubnetCidrs:[],tags:[]}},e[1]=l):l=e[1];let u=ne(l),{handleSubmit:d,register:f,watch:m,control:S,formState:pe}=u,{errors:C,isSubmitting:me}=pe,w;e[2]===S?w=e[3]:(w={control:S,name:`mode`},e[2]=S,e[3]=w);let T=te(w),E;e[4]===S?E=e[5]:(E={control:S,name:`cidrBlock`},e[4]=S,e[5]=E);let Te=te(E),D;e[6]===S?D=e[7]:(D={control:S,name:`publicSubnetCount`},e[6]=S,e[7]=D);let O=te(D),k;e[8]===S?k=e[9]:(k={control:S,name:`privateSubnetCount`},e[8]=S,e[9]=k);let Ee=te(k),A=ce(Te||`10.0.0.0/16`,T===`vpc-and-more`?O:0,T===`vpc-and-more`?Ee:0),[De,Oe]=(0,ue.useState)(``),ke;e[10]!==n||e[11]!==t||e[12]!==r?(ke=async e=>{if(s(null),e.mode===`vpc-only`){let r=e.autoGenerateNames&&e.namePrefix?`${e.namePrefix}-vpc`:e.namePrefix,i=(await n.mutateAsync({cidrBlock:e.cidrBlock,name:r||void 0})).Vpc?.VpcId;t(i?{to:`/ec2/describe-vpcs/$id`,params:{id:i}}:{to:`/ec2/describe-vpcs`});return}Oe(`Creating VPC and resources...`);let i=await r.mutateAsync(e);s(i),!i.error&&i.vpcId&&t({to:`/ec2/describe-vpcs/$id`,params:{id:i.vpcId}}),Oe(``)},e[10]=n,e[11]=t,e[12]=r,e[13]=ke):ke=e[13];let Ae=ke,je=n.error??r.error,Me=n.isPending||r.isPending,j,M;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,x.jsx)(a,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),M=(0,x.jsx)(oe,{title:`Create VPC`}),e[14]=j,e[15]=M):(j=e[14],M=e[15]);let N;e[16]===je?N=e[17]:(N=je&&(0,x.jsx)(ie,{error:je,msg:`Failed to create VPC`}),e[16]=je,e[17]=N);let P;e[18]===o?P=e[19]:(P=o?.error&&(0,x.jsxs)(`div`,{className:`mb-6 max-w-4xl rounded-md border border-destructive bg-destructive/10 p-4`,children:[(0,x.jsxs)(`h2`,{className:`text-sm font-medium text-destructive`,children:[`Wizard failed: `,o.failedStep]}),(0,x.jsx)(`p`,{className:`mt-1 text-sm text-destructive`,children:o.error.message}),o.created.length>0&&(0,x.jsxs)(`div`,{className:`mt-3`,children:[(0,x.jsx)(`p`,{className:`text-xs font-medium text-destructive`,children:`Successfully created resources:`}),(0,x.jsx)(`ul`,{className:`mt-1 list-inside list-disc text-xs text-destructive`,children:o.created.map(Ce)})]})]}),e[18]=o,e[19]=P);let F;e[20]===De?F=e[21]:(F=De&&(0,x.jsx)(`div`,{className:`mb-4 max-w-4xl text-sm text-muted-foreground`,children:De}),e[20]=De,e[21]=F);let I;e[22]!==d||e[23]!==Ae?(I=d(Ae),e[22]=d,e[23]=Ae,e[24]=I):I=e[24];let Ne;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,x.jsx)(v,{children:`Resources to create`}),e[25]=Ne):Ne=e[25];let L;e[26]===S?L=e[27]:(L=(0,x.jsxs)(y,{children:[Ne,(0,x.jsx)(_,{control:S,name:`mode`,render:Se})]}),e[26]=S,e[27]=L);let R;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,x.jsx)(v,{children:(0,x.jsx)(`label`,{htmlFor:`namePrefix`,children:`Name tag auto-generation`})}),e[28]=R):R=e[28];let z;e[29]===f?z=e[30]:(z=f(`namePrefix`),e[29]=f,e[30]=z);let B;e[31]===z?B=e[32]:(B=(0,x.jsx)(ee,{id:`namePrefix`,placeholder:`project`,...z}),e[31]=z,e[32]=B);let V;e[33]===S?V=e[34]:(V=(0,x.jsx)(_,{control:S,name:`autoGenerateNames`,render:xe}),e[33]=S,e[34]=V);let H;e[35]!==B||e[36]!==V?(H=(0,x.jsxs)(y,{children:[R,(0,x.jsxs)(`div`,{className:`flex items-center gap-3`,children:[B,V]})]}),e[35]=B,e[36]=V,e[37]=H):H=e[37];let Pe;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,x.jsx)(v,{children:(0,x.jsx)(`label`,{htmlFor:`cidrBlock`,children:`IPv4 CIDR block`})}),e[38]=Pe):Pe=e[38];let Fe=!!C.cidrBlock,U;e[39]===f?U=e[40]:(U=f(`cidrBlock`),e[39]=f,e[40]=U);let W;e[41]!==Fe||e[42]!==U?(W=(0,x.jsx)(ee,{"aria-invalid":Fe,id:`cidrBlock`,placeholder:`10.0.0.0/16`,...U}),e[41]=Fe,e[42]=U,e[43]=W):W=e[43];let G;e[44]===C.cidrBlock?G=e[45]:(G=(0,x.jsx)(se,{errors:[C.cidrBlock]}),e[44]=C.cidrBlock,e[45]=G);let K;e[46]!==W||e[47]!==G?(K=(0,x.jsxs)(y,{children:[Pe,W,G]}),e[46]=W,e[47]=G,e[48]=K):K=e[48];let Ie;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,x.jsx)(v,{children:`Tenancy`}),e[49]=Ie):Ie=e[49];let q;e[50]===S?q=e[51]:(q=(0,x.jsxs)(y,{children:[Ie,(0,x.jsx)(_,{control:S,name:`tenancy`,render:be})]}),e[50]=S,e[51]=q);let Le=T===`vpc-and-more`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{children:`Number of public subnets`}),(0,x.jsx)(_,{control:S,name:`publicSubnetCount`,render:ye}),(0,x.jsx)(de,{count:O,defaults:A.publicSubnets.map(ve),form:u,type:`public`})]}),(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{children:`Number of private subnets`}),(0,x.jsx)(_,{control:S,name:`privateSubnetCount`,render:_e}),(0,x.jsx)(de,{count:Ee,defaults:A.privateSubnets.map(ge),form:u,type:`private`})]}),O>0&&Ee>0&&(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{children:`NAT gateways`}),(0,x.jsx)(_,{control:S,name:`natGateway`,render:he}),(0,x.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Creates an Elastic IP + NAT gateway in the public subnet and routes private subnet egress (0.0.0.0/0) through it.`})]})]}),Re=p,ze=we(m,A),J;e[52]!==Re||e[53]!==ze?(J=(0,x.jsx)(Re,{commands:ze}),e[52]=Re,e[53]=ze,e[54]=J):J=e[54];let Y;e[55]===t?Y=e[56]:(Y=async()=>await t({to:`/ec2/describe-vpcs`}),e[55]=t,e[56]=Y);let X;e[57]!==Me||e[58]!==me||e[59]!==Y?(X=(0,x.jsx)(ae,{isPending:Me,isSubmitting:me,onCancel:Y,pendingLabel:`Creating…`,submitLabel:`Create VPC`}),e[57]=Me,e[58]=me,e[59]=Y,e[60]=X):X=e[60];let Z;e[61]!==I||e[62]!==L||e[63]!==H||e[64]!==K||e[65]!==q||e[66]!==Le||e[67]!==J||e[68]!==X?(Z=(0,x.jsxs)(`form`,{className:`min-w-0 flex-1 space-y-6`,onSubmit:I,children:[L,H,K,q,Le,J,X]}),e[61]=I,e[62]=L,e[63]=H,e[64]=K,e[65]=q,e[66]=Le,e[67]=J,e[68]=X,e[69]=Z):Z=e[69];let Be=T===`vpc-and-more`&&O>0,Ve=Te||`10.0.0.0/16`,Q;e[70]!==T||e[71]!==A.privateSubnets||e[72]!==A.publicSubnets||e[73]!==Be||e[74]!==Ve?(Q=(0,x.jsx)(`div`,{className:`hidden min-w-0 flex-1 lg:block`,children:(0,x.jsx)(fe,{hasIgw:Be,mode:T,privateSubnets:A.privateSubnets,publicSubnets:A.publicSubnets,vpcCidr:Ve})}),e[70]=T,e[71]=A.privateSubnets,e[72]=A.publicSubnets,e[73]=Be,e[74]=Ve,e[75]=Q):Q=e[75];let $;e[76]!==Z||e[77]!==Q?($=(0,x.jsxs)(`div`,{className:`flex max-w-6xl gap-8`,children:[Z,Q]}),e[76]=Z,e[77]=Q,e[78]=$):$=e[78];let He;return e[79]!==N||e[80]!==P||e[81]!==F||e[82]!==$||e[83]!==j||e[84]!==M?(He=(0,x.jsxs)(x.Fragment,{children:[j,M,N,P,F,$]}),e[79]=N,e[80]=P,e[81]=F,e[82]=$,e[83]=j,e[84]=M,e[85]=He):He=e[85],He}function he(e){let{field:t}=e;return(0,x.jsxs)(f,{onValueChange:t.onChange,value:t.value??`none`,children:[(0,x.jsx)(d,{id:`natGateway`,children:(0,x.jsx)(c,{})}),(0,x.jsxs)(u,{children:[(0,x.jsx)(l,{value:`none`,children:`None`}),(0,x.jsx)(l,{value:`single`,children:`In 1 AZ`})]})]})}function ge(e){return e.cidr}function _e(e){let{field:t}=e;return(0,x.jsx)(`div`,{className:`flex gap-1`,children:w.map(e=>(0,x.jsx)(m,{onClick:()=>t.onChange(e),size:`sm`,type:`button`,variant:t.value===e?`default`:`outline`,children:e},e))})}function ve(e){return e.cidr}function ye(e){let{field:t}=e;return(0,x.jsx)(`div`,{className:`flex gap-1`,children:me.map(e=>(0,x.jsx)(m,{onClick:()=>t.onChange(e),size:`sm`,type:`button`,variant:t.value===e?`default`:`outline`,children:e},e))})}function be(e){let{field:t}=e;return(0,x.jsxs)(f,{onValueChange:t.onChange,value:t.value,children:[(0,x.jsx)(d,{id:`tenancy`,children:(0,x.jsx)(c,{})}),(0,x.jsxs)(u,{children:[(0,x.jsx)(l,{value:`default`,children:`default`}),(0,x.jsx)(l,{value:`dedicated`,children:`dedicated`})]})]})}function xe(e){let{field:t}=e;return(0,x.jsxs)(`label`,{className:`flex shrink-0 items-center gap-2 text-xs`,children:[(0,x.jsx)(`input`,{"aria-label":`Auto-generate name tags`,checked:t.value,onChange:e=>t.onChange(e.target.checked),type:`checkbox`}),`Auto-generate`]})}function Se(e){let{field:t}=e;return(0,x.jsxs)(`div`,{className:`flex gap-4`,children:[(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,x.jsx)(`input`,{"aria-label":`VPC only`,checked:t.value===`vpc-only`,name:`mode`,onChange:()=>t.onChange(`vpc-only`),type:`radio`}),`VPC only`]}),(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,x.jsx)(`input`,{"aria-label":`VPC and more`,checked:t.value===`vpc-and-more`,name:`mode`,onChange:()=>t.onChange(`vpc-and-more`),type:`radio`}),`VPC and more`]})]})}function Ce(e,t){return(0,x.jsxs)(`li`,{children:[e.type,`: `,e.id]},t)}function we(e,t){let n=e(`mode`),r=e(`cidrBlock`),i=e(`tenancy`),a=e(`natGateway`);if(n===`vpc-only`){let e=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-vpc`},{type:`flag`,value:` \\ +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useNavigate.js";import{t as a}from"./back-link.js";import{t as o}from"./chevron-down.js";import{t as s}from"./chevron-right.js";import{c,i as l,n as u,s as d,t as f}from"./select.js";import{t as p}from"./cli-command-panel.js";import{t as m}from"./button.js";import{t as ee}from"./input.js";import{E as h,T as g}from"./ec22.js";import{a as te,i as ne,n as _,t as re}from"./zod.js";import{t as ie}from"./error-banner.js";import{t as ae}from"./form-actions.js";import{t as oe}from"./page-heading.js";import{a as v,r as se,t as y}from"./field.js";import{t as ce}from"./subnet-calculator.js";import{_ as le}from"./ec23.js";var b=r(),ue=e(n(),1),x=t();function de(e){let t=(0,b.c)(18),{form:n,type:r,count:i,defaults:a}=e,[c,l]=(0,ue.useState)(!1),u=r===`public`?`publicSubnetCidrs`:`privateSubnetCidrs`;if(i===0)return null;let d;t[0]===c?d=t[1]:(d=()=>{l(!c)},t[0]=c,t[1]=d);let f;t[2]===c?f=t[3]:(f=c?(0,x.jsx)(o,{className:`size-3`}):(0,x.jsx)(s,{className:`size-3`}),t[2]=c,t[3]=f);let p;t[4]!==d||t[5]!==f||t[6]!==r?(p=(0,x.jsxs)(m,{className:`gap-1 px-0 text-xs text-muted-foreground`,onClick:d,type:`button`,variant:`link`,children:[f,`Customize `,r,` subnet CIDR blocks`]}),t[4]=d,t[5]=f,t[6]=r,t[7]=p):p=t[7];let h;t[8]!==i||t[9]!==a||t[10]!==c||t[11]!==u||t[12]!==n||t[13]!==r?(h=c&&(0,x.jsx)(`div`,{className:`mt-2 space-y-2`,children:Array.from({length:i},(e,t)=>(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(`span`,{className:`w-32 text-xs text-muted-foreground`,children:[r===`public`?`Public`:`Private`,` subnet `,t+1]}),(0,x.jsx)(ee,{defaultValue:a[t],placeholder:a[t],...n.register(`${u}.${t}`)})]},t))}),t[8]=i,t[9]=a,t[10]=c,t[11]=u,t[12]=n,t[13]=r,t[14]=h):h=t[14];let g;return t[15]!==p||t[16]!==h?(g=(0,x.jsxs)(`div`,{className:`mt-2`,children:[p,h]}),t[15]=p,t[16]=h,t[17]=g):g=t[17],g}function S(e){let t=(0,b.c)(8),{label:n,cidr:r,variant:i}=e,a=`rounded-md border px-3 py-2 text-xs ${i===`public`?`border-emerald-500/30 bg-emerald-500/10`:`border-blue-500/30 bg-blue-500/10`}`,o;t[0]===n?o=t[1]:(o=(0,x.jsx)(`div`,{className:`font-medium`,children:n}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,x.jsx)(`div`,{className:`text-muted-foreground`,children:r}),t[2]=r,t[3]=s);let c;return t[4]!==a||t[5]!==o||t[6]!==s?(c=(0,x.jsxs)(`div`,{className:a,children:[o,s]}),t[4]=a,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function fe(e){let t=(0,b.c)(14),{mode:n,vpcCidr:r,publicSubnets:i,privateSubnets:a,hasIgw:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,x.jsx)(`h3`,{className:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`,children:`Preview`}),t[0]=s):s=t[0];let c;t[1]===r?c=t[2]:(c=(0,x.jsxs)(`div`,{className:`mb-3 text-xs font-medium`,children:[`VPC `,(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,r,`)`]})]}),t[1]=r,t[2]=c);let l;t[3]!==o||t[4]!==n||t[5]!==a||t[6]!==i?(l=n===`vpc-and-more`&&(0,x.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Subnets`}),i.map(C),a.map(pe),i.length===0&&a.length===0&&(0,x.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No subnets`})]}),(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Route Tables`}),i.length>0&&(0,x.jsxs)(`div`,{className:`rounded-md border border-foreground/10 bg-background px-3 py-2 text-xs`,children:[(0,x.jsx)(`div`,{className:`font-medium`,children:`Public Route Table`}),(0,x.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:`0.0.0.0/0 → IGW`}),(0,x.jsx)(`div`,{className:`text-muted-foreground`,children:`local`})]}),a.length>0&&(0,x.jsxs)(`div`,{className:`rounded-md border border-foreground/10 bg-background px-3 py-2 text-xs`,children:[(0,x.jsx)(`div`,{className:`font-medium`,children:`Private Route Table`}),(0,x.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:`local`})]})]}),(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Network Connections`}),o&&(0,x.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs`,children:[(0,x.jsx)(`div`,{className:`font-medium`,children:`Internet Gateway`}),(0,x.jsx)(`div`,{className:`text-muted-foreground`,children:`Attached to VPC`})]}),!o&&(0,x.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No internet gateway`})]})]}),t[3]=o,t[4]=n,t[5]=a,t[6]=i,t[7]=l):l=t[7];let u;t[8]===n?u=t[9]:(u=n===`vpc-only`&&(0,x.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`VPC only — no additional resources will be created.`}),t[8]=n,t[9]=u);let d;return t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,x.jsxs)(`div`,{className:`rounded-lg border bg-muted/30 p-4`,children:[s,(0,x.jsxs)(`div`,{className:`rounded-lg border-2 border-dashed border-foreground/20 p-4`,children:[c,l,u]})]}),t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function pe(e){return(0,x.jsx)(S,{cidr:e.cidr,label:e.label,variant:`private`},e.cidr)}function C(e){return(0,x.jsx)(S,{cidr:e.cidr,label:e.label,variant:`public`},e.cidr)}var me=[0,1],w=[0,1,2];function T(){let e=(0,b.c)(86),t=i(),n=g(),r=h(),[o,s]=(0,ue.useState)(null),c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=re(le),e[0]=c):c=e[0];let l;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={resolver:c,defaultValues:{mode:`vpc-only`,namePrefix:``,autoGenerateNames:!0,cidrBlock:`10.0.0.0/16`,tenancy:`default`,natGateway:`none`,publicSubnetCount:1,privateSubnetCount:1,publicSubnetCidrs:[],privateSubnetCidrs:[],tags:[]}},e[1]=l):l=e[1];let u=ne(l),{handleSubmit:d,register:f,watch:m,control:S,formState:pe}=u,{errors:C,isSubmitting:me}=pe,w;e[2]===S?w=e[3]:(w={control:S,name:`mode`},e[2]=S,e[3]=w);let T=te(w),E;e[4]===S?E=e[5]:(E={control:S,name:`cidrBlock`},e[4]=S,e[5]=E);let Te=te(E),D;e[6]===S?D=e[7]:(D={control:S,name:`publicSubnetCount`},e[6]=S,e[7]=D);let O=te(D),k;e[8]===S?k=e[9]:(k={control:S,name:`privateSubnetCount`},e[8]=S,e[9]=k);let Ee=te(k),A=ce(Te||`10.0.0.0/16`,T===`vpc-and-more`?O:0,T===`vpc-and-more`?Ee:0),[De,Oe]=(0,ue.useState)(``),ke;e[10]!==n||e[11]!==t||e[12]!==r?(ke=async e=>{if(s(null),e.mode===`vpc-only`){let r=e.autoGenerateNames&&e.namePrefix?`${e.namePrefix}-vpc`:e.namePrefix,i=(await n.mutateAsync({cidrBlock:e.cidrBlock,name:r||void 0})).Vpc?.VpcId;t(i?{to:`/ec2/describe-vpcs/$id`,params:{id:i}}:{to:`/ec2/describe-vpcs`});return}Oe(`Creating VPC and resources...`);let i=await r.mutateAsync(e);s(i),!i.error&&i.vpcId&&t({to:`/ec2/describe-vpcs/$id`,params:{id:i.vpcId}}),Oe(``)},e[10]=n,e[11]=t,e[12]=r,e[13]=ke):ke=e[13];let Ae=ke,je=n.error??r.error,Me=n.isPending||r.isPending,j,M;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,x.jsx)(a,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),M=(0,x.jsx)(oe,{title:`Create VPC`}),e[14]=j,e[15]=M):(j=e[14],M=e[15]);let N;e[16]===je?N=e[17]:(N=je&&(0,x.jsx)(ie,{error:je,msg:`Failed to create VPC`}),e[16]=je,e[17]=N);let P;e[18]===o?P=e[19]:(P=o?.error&&(0,x.jsxs)(`div`,{className:`mb-6 max-w-4xl rounded-md border border-destructive bg-destructive/10 p-4`,children:[(0,x.jsxs)(`h2`,{className:`text-sm font-medium text-destructive`,children:[`Wizard failed: `,o.failedStep]}),(0,x.jsx)(`p`,{className:`mt-1 text-sm text-destructive`,children:o.error.message}),o.created.length>0&&(0,x.jsxs)(`div`,{className:`mt-3`,children:[(0,x.jsx)(`p`,{className:`text-xs font-medium text-destructive`,children:`Successfully created resources:`}),(0,x.jsx)(`ul`,{className:`mt-1 list-inside list-disc text-xs text-destructive`,children:o.created.map(Ce)})]})]}),e[18]=o,e[19]=P);let F;e[20]===De?F=e[21]:(F=De&&(0,x.jsx)(`div`,{className:`mb-4 max-w-4xl text-sm text-muted-foreground`,children:De}),e[20]=De,e[21]=F);let I;e[22]!==d||e[23]!==Ae?(I=d(Ae),e[22]=d,e[23]=Ae,e[24]=I):I=e[24];let Ne;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,x.jsx)(v,{children:`Resources to create`}),e[25]=Ne):Ne=e[25];let L;e[26]===S?L=e[27]:(L=(0,x.jsxs)(y,{children:[Ne,(0,x.jsx)(_,{control:S,name:`mode`,render:Se})]}),e[26]=S,e[27]=L);let R;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,x.jsx)(v,{children:(0,x.jsx)(`label`,{htmlFor:`namePrefix`,children:`Name tag auto-generation`})}),e[28]=R):R=e[28];let z;e[29]===f?z=e[30]:(z=f(`namePrefix`),e[29]=f,e[30]=z);let B;e[31]===z?B=e[32]:(B=(0,x.jsx)(ee,{id:`namePrefix`,placeholder:`project`,...z}),e[31]=z,e[32]=B);let V;e[33]===S?V=e[34]:(V=(0,x.jsx)(_,{control:S,name:`autoGenerateNames`,render:xe}),e[33]=S,e[34]=V);let H;e[35]!==B||e[36]!==V?(H=(0,x.jsxs)(y,{children:[R,(0,x.jsxs)(`div`,{className:`flex items-center gap-3`,children:[B,V]})]}),e[35]=B,e[36]=V,e[37]=H):H=e[37];let Pe;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,x.jsx)(v,{children:(0,x.jsx)(`label`,{htmlFor:`cidrBlock`,children:`IPv4 CIDR block`})}),e[38]=Pe):Pe=e[38];let Fe=!!C.cidrBlock,U;e[39]===f?U=e[40]:(U=f(`cidrBlock`),e[39]=f,e[40]=U);let W;e[41]!==Fe||e[42]!==U?(W=(0,x.jsx)(ee,{"aria-invalid":Fe,id:`cidrBlock`,placeholder:`10.0.0.0/16`,...U}),e[41]=Fe,e[42]=U,e[43]=W):W=e[43];let G;e[44]===C.cidrBlock?G=e[45]:(G=(0,x.jsx)(se,{errors:[C.cidrBlock]}),e[44]=C.cidrBlock,e[45]=G);let K;e[46]!==W||e[47]!==G?(K=(0,x.jsxs)(y,{children:[Pe,W,G]}),e[46]=W,e[47]=G,e[48]=K):K=e[48];let Ie;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,x.jsx)(v,{children:`Tenancy`}),e[49]=Ie):Ie=e[49];let q;e[50]===S?q=e[51]:(q=(0,x.jsxs)(y,{children:[Ie,(0,x.jsx)(_,{control:S,name:`tenancy`,render:be})]}),e[50]=S,e[51]=q);let Le=T===`vpc-and-more`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{children:`Number of public subnets`}),(0,x.jsx)(_,{control:S,name:`publicSubnetCount`,render:ye}),(0,x.jsx)(de,{count:O,defaults:A.publicSubnets.map(ve),form:u,type:`public`})]}),(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{children:`Number of private subnets`}),(0,x.jsx)(_,{control:S,name:`privateSubnetCount`,render:_e}),(0,x.jsx)(de,{count:Ee,defaults:A.privateSubnets.map(ge),form:u,type:`private`})]}),O>0&&Ee>0&&(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{children:`NAT gateways`}),(0,x.jsx)(_,{control:S,name:`natGateway`,render:he}),(0,x.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Creates an Elastic IP + NAT gateway in the public subnet and routes private subnet egress (0.0.0.0/0) through it.`})]})]}),Re=p,ze=we(m,A),J;e[52]!==Re||e[53]!==ze?(J=(0,x.jsx)(Re,{commands:ze}),e[52]=Re,e[53]=ze,e[54]=J):J=e[54];let Y;e[55]===t?Y=e[56]:(Y=async()=>{await t({to:`/ec2/describe-vpcs`})},e[55]=t,e[56]=Y);let X;e[57]!==Me||e[58]!==me||e[59]!==Y?(X=(0,x.jsx)(ae,{isPending:Me,isSubmitting:me,onCancel:Y,pendingLabel:`Creating…`,submitLabel:`Create VPC`}),e[57]=Me,e[58]=me,e[59]=Y,e[60]=X):X=e[60];let Z;e[61]!==I||e[62]!==L||e[63]!==H||e[64]!==K||e[65]!==q||e[66]!==Le||e[67]!==J||e[68]!==X?(Z=(0,x.jsxs)(`form`,{className:`min-w-0 flex-1 space-y-6`,onSubmit:I,children:[L,H,K,q,Le,J,X]}),e[61]=I,e[62]=L,e[63]=H,e[64]=K,e[65]=q,e[66]=Le,e[67]=J,e[68]=X,e[69]=Z):Z=e[69];let Be=T===`vpc-and-more`&&O>0,Ve=Te||`10.0.0.0/16`,Q;e[70]!==T||e[71]!==A.privateSubnets||e[72]!==A.publicSubnets||e[73]!==Be||e[74]!==Ve?(Q=(0,x.jsx)(`div`,{className:`hidden min-w-0 flex-1 lg:block`,children:(0,x.jsx)(fe,{hasIgw:Be,mode:T,privateSubnets:A.privateSubnets,publicSubnets:A.publicSubnets,vpcCidr:Ve})}),e[70]=T,e[71]=A.privateSubnets,e[72]=A.publicSubnets,e[73]=Be,e[74]=Ve,e[75]=Q):Q=e[75];let $;e[76]!==Z||e[77]!==Q?($=(0,x.jsxs)(`div`,{className:`flex max-w-6xl gap-8`,children:[Z,Q]}),e[76]=Z,e[77]=Q,e[78]=$):$=e[78];let He;return e[79]!==N||e[80]!==P||e[81]!==F||e[82]!==$||e[83]!==j||e[84]!==M?(He=(0,x.jsxs)(x.Fragment,{children:[j,M,N,P,F,$]}),e[79]=N,e[80]=P,e[81]=F,e[82]=$,e[83]=j,e[84]=M,e[85]=He):He=e[85],He}function he(e){let{field:t}=e;return(0,x.jsxs)(f,{onValueChange:t.onChange,value:t.value??`none`,children:[(0,x.jsx)(d,{id:`natGateway`,children:(0,x.jsx)(c,{})}),(0,x.jsxs)(u,{children:[(0,x.jsx)(l,{value:`none`,children:`None`}),(0,x.jsx)(l,{value:`single`,children:`In 1 AZ`})]})]})}function ge(e){return e.cidr}function _e(e){let{field:t}=e;return(0,x.jsx)(`div`,{className:`flex gap-1`,children:w.map(e=>(0,x.jsx)(m,{onClick:()=>{t.onChange(e)},size:`sm`,type:`button`,variant:t.value===e?`default`:`outline`,children:e},e))})}function ve(e){return e.cidr}function ye(e){let{field:t}=e;return(0,x.jsx)(`div`,{className:`flex gap-1`,children:me.map(e=>(0,x.jsx)(m,{onClick:()=>{t.onChange(e)},size:`sm`,type:`button`,variant:t.value===e?`default`:`outline`,children:e},e))})}function be(e){let{field:t}=e;return(0,x.jsxs)(f,{onValueChange:t.onChange,value:t.value,children:[(0,x.jsx)(d,{id:`tenancy`,children:(0,x.jsx)(c,{})}),(0,x.jsxs)(u,{children:[(0,x.jsx)(l,{value:`default`,children:`default`}),(0,x.jsx)(l,{value:`dedicated`,children:`dedicated`})]})]})}function xe(e){let{field:t}=e;return(0,x.jsxs)(`label`,{className:`flex shrink-0 items-center gap-2 text-xs`,children:[(0,x.jsx)(`input`,{"aria-label":`Auto-generate name tags`,checked:t.value,onChange:e=>{t.onChange(e.target.checked)},type:`checkbox`}),`Auto-generate`]})}function Se(e){let{field:t}=e;return(0,x.jsxs)(`div`,{className:`flex gap-4`,children:[(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,x.jsx)(`input`,{"aria-label":`VPC only`,checked:t.value===`vpc-only`,name:`mode`,onChange:()=>{t.onChange(`vpc-only`)},type:`radio`}),`VPC only`]}),(0,x.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,x.jsx)(`input`,{"aria-label":`VPC and more`,checked:t.value===`vpc-and-more`,name:`mode`,onChange:()=>{t.onChange(`vpc-and-more`)},type:`radio`}),`VPC and more`]})]})}function Ce(e,t){return(0,x.jsxs)(`li`,{children:[e.type,`: `,e.id]},t)}function we(e,t){let n=e(`mode`),r=e(`cidrBlock`),i=e(`tenancy`),a=e(`natGateway`);if(n===`vpc-only`){let e=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-vpc`},{type:`flag`,value:` \\ --cidr-block`},{type:`value`,value:` ${r||`10.0.0.0/16`}`}];return i&&i!=="default"&&e.push({type:`flag`,value:` \\ --instance-tenancy`},{type:`value`,value:` ${i}`}),[{label:`Create VPC`,parts:e}]}let o=[],s=[...t.publicSubnets.map((e,t)=>({...e,name:`PUBLIC_SUBNET_${t+1}`})),...t.privateSubnets.map((e,t)=>({...e,name:`PRIVATE_SUBNET_${t+1}`}))];o.push({label:`Create VPC`,parts:[{type:`comment`,value:`# Create VPC with subnets, internet gateway, and routing @@ -8,23 +8,23 @@ import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}fro --vpc-id`},{type:`variable`,value:` "$VPC_ID"`},{type:`flag`,value:` \\ --cidr-block`},{type:`value`,value:` ${e.cidr}`},{type:`flag`,value:` \\ --query`},{type:`value`,value:` 'Subnet.SubnetId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]});if(t.publicSubnets.length>0){o.push({label:`Create Internet Gateway`,parts:[{type:`variable`,value:`IGW_ID=`},{type:`bin`,value:`$(AWS_PROFILE=spinifex aws ec2 create-internet-gateway`},{type:`flag`,value:` \\ - --query`},{type:`value`,value:` 'InternetGateway.InternetGatewayId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]}),o.push({label:`Attach Internet Gateway`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 attach-internet-gateway`},{type:`flag`,value:` \\ + --query`},{type:`value`,value:` 'InternetGateway.InternetGatewayId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]},{label:`Attach Internet Gateway`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 attach-internet-gateway`},{type:`flag`,value:` \\ --internet-gateway-id`},{type:`variable`,value:` "$IGW_ID"`},{type:`flag`,value:` \\ - --vpc-id`},{type:`variable`,value:` "$VPC_ID"`}]}),o.push({label:`Create Route Table`,parts:[{type:`variable`,value:`RT_ID=`},{type:`bin`,value:`$(AWS_PROFILE=spinifex aws ec2 create-route-table`},{type:`flag`,value:` \\ + --vpc-id`},{type:`variable`,value:` "$VPC_ID"`}]},{label:`Create Route Table`,parts:[{type:`variable`,value:`RT_ID=`},{type:`bin`,value:`$(AWS_PROFILE=spinifex aws ec2 create-route-table`},{type:`flag`,value:` \\ --vpc-id`},{type:`variable`,value:` "$VPC_ID"`},{type:`flag`,value:` \\ - --query`},{type:`value`,value:` 'RouteTable.RouteTableId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]}),o.push({label:`Create Default Route`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-route`},{type:`flag`,value:` \\ + --query`},{type:`value`,value:` 'RouteTable.RouteTableId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]},{label:`Create Default Route`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-route`},{type:`flag`,value:` \\ --route-table-id`},{type:`variable`,value:` "$RT_ID"`},{type:`flag`,value:` \\ --destination-cidr-block`},{type:`value`,value:` 0.0.0.0/0`},{type:`flag`,value:` \\ --gateway-id`},{type:`variable`,value:` "$IGW_ID"`}]});for(let e=0;e0&&t.privateSubnets.length>0){o.push({label:`Allocate Elastic IP`,parts:[{type:`variable`,value:`EIP_ALLOC_ID=`},{type:`bin`,value:`$(AWS_PROFILE=spinifex aws ec2 allocate-address`},{type:`flag`,value:` \\ --domain`},{type:`value`,value:` vpc`},{type:`flag`,value:` \\ - --query`},{type:`value`,value:` 'AllocationId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]}),o.push({label:`Create NAT Gateway`,parts:[{type:`variable`,value:`NAT_ID=`},{type:`bin`,value:`$(AWS_PROFILE=spinifex aws ec2 create-nat-gateway`},{type:`flag`,value:` \\ + --query`},{type:`value`,value:` 'AllocationId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]},{label:`Create NAT Gateway`,parts:[{type:`variable`,value:`NAT_ID=`},{type:`bin`,value:`$(AWS_PROFILE=spinifex aws ec2 create-nat-gateway`},{type:`flag`,value:` \\ --subnet-id`},{type:`variable`,value:` "$PUBLIC_SUBNET_1_ID"`},{type:`flag`,value:` \\ --allocation-id`},{type:`variable`,value:` "$EIP_ALLOC_ID"`},{type:`flag`,value:` \\ - --query`},{type:`value`,value:` 'NatGateway.NatGatewayId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]}),o.push({label:`Create Private Route Table`,parts:[{type:`variable`,value:`PRIV_RT_ID=`},{type:`bin`,value:`$(AWS_PROFILE=spinifex aws ec2 create-route-table`},{type:`flag`,value:` \\ + --query`},{type:`value`,value:` 'NatGateway.NatGatewayId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]},{label:`Create Private Route Table`,parts:[{type:`variable`,value:`PRIV_RT_ID=`},{type:`bin`,value:`$(AWS_PROFILE=spinifex aws ec2 create-route-table`},{type:`flag`,value:` \\ --vpc-id`},{type:`variable`,value:` "$VPC_ID"`},{type:`flag`,value:` \\ - --query`},{type:`value`,value:` 'RouteTable.RouteTableId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]}),o.push({label:`Create Private Default Route`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-route`},{type:`flag`,value:` \\ + --query`},{type:`value`,value:` 'RouteTable.RouteTableId'`},{type:`flag`,value:` --output`},{type:`value`,value:` text)`}]},{label:`Create Private Default Route`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-route`},{type:`flag`,value:` \\ --route-table-id`},{type:`variable`,value:` "$PRIV_RT_ID"`},{type:`flag`,value:` \\ --destination-cidr-block`},{type:`value`,value:` 0.0.0.0/0`},{type:`flag`,value:` \\ --nat-gateway-id`},{type:`variable`,value:` "$NAT_ID"`}]});for(let e=0;ew(s),t[0]=s,t[1]=j);let[M,N]=(0,S.useState)(j),[P,F]=(0,S.useState)(``),I;t[2]!==s||t[3]!==O||t[4]!==r?(I=function(e){e||(A(!1),N(w(s)),F(``),O.reset()),r(e)},t[2]=s,t[3]=O,t[4]=r,t[5]=I):I=t[5];let L=I,R;t[6]!==k||t[7]!==M?(R=k?void 0:c.safeParse(M).error?.issues[0]?.message,t[6]=k,t[7]=M,t[8]=R):R=t[8];let z=R,B=!(k&&P!==s)&&!z,V;t[9]!==s||t[10]!==O||t[11]!==L||t[12]!==E||t[13]!==k||t[14]!==M?(V=async function(){try{await O.mutateAsync({dbInstanceIdentifier:s,skipFinalSnapshot:k,finalSnapshotIdentifier:M}),L(!1),E?.()}catch{}},t[9]=s,t[10]=O,t[11]=L,t[12]=E,t[13]=k,t[14]=M,t[15]=V):V=t[15];let H=V,U;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,C.jsx)(h,{children:`Delete DB Instance`}),t[16]=U):U=t[16];let W=T?`"${s}" has deletion protection enabled and cannot be deleted while it is on.`:`This tears down "${s}". It cannot be undone.`,G;t[17]===W?G=t[18]:(G=(0,C.jsxs)(y,{children:[U,(0,C.jsx)(p,{children:W})]}),t[17]=W,t[18]=G);let K;t[19]!==s||t[20]!==T||t[21]!==D||t[22]!==k||t[23]!==M||t[24]!==z||t[25]!==P?(K=T?(0,C.jsxs)(`div`,{className:`space-y-3`,children:[(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Turn deletion protection off first, then delete the instance.`}),D?(0,C.jsx)(a,{onClick:D,size:`sm`,variant:`outline`,children:`Modify Instance`}):(0,C.jsxs)(i,{className:`text-sm text-primary hover:underline`,params:{id:s},to:`/rds/describe-db-instances/$id`,children:[`Open `,s,` to modify it`]})]}):(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,children:[(0,C.jsx)(`input`,{checked:!k,onChange:e=>A(!e.target.checked),type:`checkbox`}),(0,C.jsxs)(`span`,{children:[`Take a final snapshot before deleting`,(0,C.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:`A final snapshot retains the underlying data volume until that snapshot is itself deleted.`})]})]}),k?(0,C.jsxs)(f,{children:[(0,C.jsx)(u,{children:(0,C.jsxs)(`label`,{htmlFor:`confirmIdentifier`,children:[`Type `,s,` to confirm`]})}),(0,C.jsx)(o,{id:`confirmIdentifier`,onChange:e=>F(e.target.value),placeholder:s,value:P}),(0,C.jsx)(d,{children:`Deleting without a final snapshot destroys the data volume. There is no way back.`})]}):(0,C.jsxs)(f,{children:[(0,C.jsx)(u,{children:(0,C.jsx)(`label`,{htmlFor:`finalSnapshotIdentifier`,children:`Final snapshot name`})}),(0,C.jsx)(o,{"aria-invalid":!!z,id:`finalSnapshotIdentifier`,onChange:e=>N(e.target.value),value:M}),z&&(0,C.jsx)(`p`,{className:`text-xs text-destructive`,children:z})]})]}),t[19]=s,t[20]=T,t[21]=D,t[22]=k,t[23]=M,t[24]=z,t[25]=P,t[26]=K):K=t[26];let q;t[27]===O.error?q=t[28]:(q=O.error&&(0,C.jsx)(`p`,{className:`text-sm text-destructive`,children:O.error.message}),t[27]=O.error,t[28]=q);let J;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,C.jsx)(v,{children:`Cancel`}),t[29]=J):J=t[29];let Y;t[30]!==B||t[31]!==O.isPending||t[32]!==T||t[33]!==H?(Y=!T&&(0,C.jsx)(g,{disabled:O.isPending||!B,onClick:e=>{e.preventDefault(),H()},children:O.isPending?`Deleting…`:`Delete`}),t[30]=B,t[31]=O.isPending,t[32]=T,t[33]=H,t[34]=Y):Y=t[34];let X;t[35]===Y?X=t[36]:(X=(0,C.jsxs)(_,{children:[J,Y]}),t[35]=Y,t[36]=X);let Z;t[37]!==X||t[38]!==G||t[39]!==K||t[40]!==q?(Z=(0,C.jsxs)(m,{children:[G,K,q,X]}),t[37]=X,t[38]=G,t[39]=K,t[40]=q,t[41]=Z):Z=t[41];let Q;return t[42]!==L||t[43]!==n||t[44]!==Z?(Q=(0,C.jsx)(b,{onOpenChange:L,open:n,children:Z}),t[42]=L,t[43]=n,t[44]=Z,t[45]=Q):Q=t[45],Q}export{T as t}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./link.js";import{t as a}from"./button.js";import{t as o}from"./input.js";import{w as s,y as c}from"./rds.js";import{a as l}from"./rds2.js";import{a as u,n as d,t as f}from"./field.js";import{a as p,i as m,l as h,n as g,o as _,r as v,s as y,t as b}from"./alert-dialog.js";var x=r(),S=e(n(),1),C=t();function w(e,t=new Date){return s(e,`final`,t)}function T(e){let t=(0,x.c)(46),{open:n,onOpenChange:r,dbInstanceIdentifier:s,deletionProtection:T,onDeleted:E,onModify:D}=e,O=l(),[k,A]=(0,S.useState)(!1),j;t[0]===s?j=t[1]:(j=()=>w(s),t[0]=s,t[1]=j);let[M,N]=(0,S.useState)(j),[P,F]=(0,S.useState)(``),I;t[2]!==s||t[3]!==O||t[4]!==r?(I=function(e){e||(A(!1),N(w(s)),F(``),O.reset()),r(e)},t[2]=s,t[3]=O,t[4]=r,t[5]=I):I=t[5];let L=I,R;t[6]!==k||t[7]!==M?(R=k?void 0:c.safeParse(M).error?.issues[0]?.message,t[6]=k,t[7]=M,t[8]=R):R=t[8];let z=R,B=!(k&&P!==s)&&!z,V;t[9]!==s||t[10]!==O||t[11]!==L||t[12]!==E||t[13]!==k||t[14]!==M?(V=async function(){try{await O.mutateAsync({dbInstanceIdentifier:s,skipFinalSnapshot:k,finalSnapshotIdentifier:M}),L(!1),E?.()}catch{}},t[9]=s,t[10]=O,t[11]=L,t[12]=E,t[13]=k,t[14]=M,t[15]=V):V=t[15];let H=V,U;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,C.jsx)(h,{children:`Delete DB Instance`}),t[16]=U):U=t[16];let W=T?`"${s}" has deletion protection enabled and cannot be deleted while it is on.`:`This tears down "${s}". It cannot be undone.`,G;t[17]===W?G=t[18]:(G=(0,C.jsxs)(y,{children:[U,(0,C.jsx)(p,{children:W})]}),t[17]=W,t[18]=G);let K;t[19]!==s||t[20]!==T||t[21]!==D||t[22]!==k||t[23]!==M||t[24]!==z||t[25]!==P?(K=T?(0,C.jsxs)(`div`,{className:`space-y-3`,children:[(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Turn deletion protection off first, then delete the instance.`}),D?(0,C.jsx)(a,{onClick:D,size:`sm`,variant:`outline`,children:`Modify Instance`}):(0,C.jsxs)(i,{className:`text-sm text-primary hover:underline`,params:{id:s},to:`/rds/describe-db-instances/$id`,children:[`Open `,s,` to modify it`]})]}):(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,children:[(0,C.jsx)(`input`,{checked:!k,onChange:e=>{A(!e.target.checked)},type:`checkbox`}),(0,C.jsxs)(`span`,{children:[`Take a final snapshot before deleting`,(0,C.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:`A final snapshot retains the underlying data volume until that snapshot is itself deleted.`})]})]}),k?(0,C.jsxs)(f,{children:[(0,C.jsx)(u,{children:(0,C.jsxs)(`label`,{htmlFor:`confirmIdentifier`,children:[`Type `,s,` to confirm`]})}),(0,C.jsx)(o,{id:`confirmIdentifier`,onChange:e=>{F(e.target.value)},placeholder:s,value:P}),(0,C.jsx)(d,{children:`Deleting without a final snapshot destroys the data volume. There is no way back.`})]}):(0,C.jsxs)(f,{children:[(0,C.jsx)(u,{children:(0,C.jsx)(`label`,{htmlFor:`finalSnapshotIdentifier`,children:`Final snapshot name`})}),(0,C.jsx)(o,{"aria-invalid":!!z,id:`finalSnapshotIdentifier`,onChange:e=>{N(e.target.value)},value:M}),z&&(0,C.jsx)(`p`,{className:`text-xs text-destructive`,children:z})]})]}),t[19]=s,t[20]=T,t[21]=D,t[22]=k,t[23]=M,t[24]=z,t[25]=P,t[26]=K):K=t[26];let q;t[27]===O.error?q=t[28]:(q=O.error&&(0,C.jsx)(`p`,{className:`text-sm text-destructive`,children:O.error.message}),t[27]=O.error,t[28]=q);let J;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,C.jsx)(v,{children:`Cancel`}),t[29]=J):J=t[29];let Y;t[30]!==B||t[31]!==O.isPending||t[32]!==T||t[33]!==H?(Y=!T&&(0,C.jsx)(g,{disabled:O.isPending||!B,onClick:e=>{e.preventDefault(),H()},children:O.isPending?`Deleting…`:`Delete`}),t[30]=B,t[31]=O.isPending,t[32]=T,t[33]=H,t[34]=Y):Y=t[34];let X;t[35]===Y?X=t[36]:(X=(0,C.jsxs)(_,{children:[J,Y]}),t[35]=Y,t[36]=X);let Z;t[37]!==X||t[38]!==G||t[39]!==K||t[40]!==q?(Z=(0,C.jsxs)(m,{children:[G,K,q,X]}),t[37]=X,t[38]=G,t[39]=K,t[40]=q,t[41]=Z):Z=t[41];let Q;return t[42]!==L||t[43]!==n||t[44]!==Z?(Q=(0,C.jsx)(b,{onOpenChange:L,open:n,children:Z}),t[42]=L,t[43]=n,t[44]=Z,t[45]=Q):Q=t[45],Q}export{T as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/describe-db-instances.js b/spinifex/services/spinifexui/frontend/dist/assets/describe-db-instances.js index 12294b787..ca6cf3604 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/describe-db-instances.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/describe-db-instances.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{t as s}from"./button.js";import{c,m as l,p as u,u as d}from"./rds.js";import{d as f,m as p,p as m}from"./rds2.js";import{r as h}from"./rds3.js";import{t as g}from"./error-banner.js";import{t as _}from"./page-heading.js";import{t as v}from"./state-badge.js";import{t as y}from"./delete-db-instance-dialog.js";var b=r(),x=e(n(),1),S=t();function C(e){return[e.Engine,e.EngineVersion].filter(Boolean).join(` `)}function w(){let e=(0,b.c)(19),t=o(),{data:n}=i(h),r=m(),w=p(),E=f(),[D,O]=(0,x.useState)(null),k;e[0]===n.DBInstances?k=e[1]:(k=n.DBInstances??[],e[0]=n.DBInstances,e[1]=k);let A=k,j=r.error??w.error??E.error,M;e[2]===t?M=e[3]:(M=(0,S.jsx)(_,{actions:(0,S.jsx)(s,{onClick:async()=>await t({to:`/rds/create-db-instance`}),children:`Create Database`}),title:`Databases`}),e[2]=t,e[3]=M);let N;e[4]===j?N=e[5]:(N=j&&(0,S.jsx)(g,{error:j,msg:`Failed to change the DB instance state.`}),e[4]=j,e[5]=N);let P;e[6]!==A||e[7]!==t||e[8]!==E||e[9]!==r||e[10]!==w?(P=A.length>0?(0,S.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,S.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,S.jsx)(`thead`,{children:(0,S.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Identifier`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Engine`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Class`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Endpoint`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Storage`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,S.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,S.jsx)(`tbody`,{children:A.map(e=>{let n=e.DBInstanceIdentifier;if(!n)return null;let i=e.DBInstanceStatus;return(0,S.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await t({to:`/rds/describe-db-instances/$id`,params:{id:n}}),children:[(0,S.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,S.jsx)(a,{className:`text-primary hover:underline`,onClick:T,params:{id:n},to:`/rds/describe-db-instances/$id`,children:n})}),(0,S.jsx)(`td`,{className:`px-4 py-2`,children:C(e)}),(0,S.jsx)(`td`,{className:`px-4 py-2`,children:e.DBInstanceClass}),(0,S.jsx)(`td`,{className:`px-4 py-2`,children:(0,S.jsx)(v,{state:i})}),(0,S.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.Endpoint?.Address??`—`}),(0,S.jsx)(`td`,{className:`px-4 py-2`,children:e.AllocatedStorage?`${e.AllocatedStorage} GiB`:`—`}),(0,S.jsxs)(`td`,{className:`space-x-2 px-4 py-2 text-right`,children:[(0,S.jsx)(s,{disabled:!u(i)||r.isPending,onClick:e=>{e.stopPropagation(),r.mutate(n)},size:`sm`,variant:`outline`,children:`Start`}),(0,S.jsx)(s,{disabled:!l(i)||w.isPending,onClick:e=>{e.stopPropagation(),w.mutate(n)},size:`sm`,variant:`outline`,children:`Stop`}),(0,S.jsx)(s,{disabled:!d(i)||E.isPending,onClick:e=>{e.stopPropagation(),E.mutate(n)},size:`sm`,variant:`outline`,children:`Reboot`}),(0,S.jsx)(s,{disabled:!c(i),onClick:t=>{t.stopPropagation(),O({identifier:n,deletionProtection:e.DeletionProtection??!1})},size:`sm`,variant:`destructive`,children:`Delete`})]})]},n)})})]})}):(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:`No DB instances found.`}),e[6]=A,e[7]=t,e[8]=E,e[9]=r,e[10]=w,e[11]=P):P=e[11];let F;e[12]===D?F=e[13]:(F=D&&(0,S.jsx)(y,{dbInstanceIdentifier:D.identifier,deletionProtection:D.deletionProtection,onOpenChange:e=>!e&&O(null),open:!0}),e[12]=D,e[13]=F);let I;return e[14]!==M||e[15]!==N||e[16]!==P||e[17]!==F?(I=(0,S.jsxs)(S.Fragment,{children:[M,N,P,F]}),e[14]=M,e[15]=N,e[16]=P,e[17]=F,e[18]=I):I=e[18],I}function T(e){return e.stopPropagation()}var E=w;export{E as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{t as s}from"./button.js";import{c,m as l,p as u,u as d}from"./rds.js";import{d as f,m as p,p as m}from"./rds2.js";import{r as h}from"./rds3.js";import{t as g}from"./error-banner.js";import{t as _}from"./page-heading.js";import{t as v}from"./state-badge.js";import{t as y}from"./delete-db-instance-dialog.js";var b=r(),x=e(n(),1),S=t();function C(e){return[e.Engine,e.EngineVersion].filter(Boolean).join(` `)}function w(){let e=(0,b.c)(19),t=o(),{data:n}=i(h),r=m(),w=p(),E=f(),[D,O]=(0,x.useState)(null),k;e[0]===n.DBInstances?k=e[1]:(k=n.DBInstances??[],e[0]=n.DBInstances,e[1]=k);let A=k,j=r.error??w.error??E.error,M;e[2]===t?M=e[3]:(M=(0,S.jsx)(_,{actions:(0,S.jsx)(s,{onClick:async()=>{await t({to:`/rds/create-db-instance`})},children:`Create Database`}),title:`Databases`}),e[2]=t,e[3]=M);let N;e[4]===j?N=e[5]:(N=j&&(0,S.jsx)(g,{error:j,msg:`Failed to change the DB instance state.`}),e[4]=j,e[5]=N);let P;e[6]!==A||e[7]!==t||e[8]!==E||e[9]!==r||e[10]!==w?(P=A.length>0?(0,S.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,S.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,S.jsx)(`thead`,{children:(0,S.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Identifier`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Engine`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Class`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Endpoint`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Storage`}),(0,S.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,S.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,S.jsx)(`tbody`,{children:A.map(e=>{let n=e.DBInstanceIdentifier;if(!n)return null;let i=e.DBInstanceStatus;return(0,S.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>{await t({to:`/rds/describe-db-instances/$id`,params:{id:n}})},children:[(0,S.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,S.jsx)(a,{className:`text-primary hover:underline`,onClick:T,params:{id:n},to:`/rds/describe-db-instances/$id`,children:n})}),(0,S.jsx)(`td`,{className:`px-4 py-2`,children:C(e)}),(0,S.jsx)(`td`,{className:`px-4 py-2`,children:e.DBInstanceClass}),(0,S.jsx)(`td`,{className:`px-4 py-2`,children:(0,S.jsx)(v,{state:i})}),(0,S.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.Endpoint?.Address??`—`}),(0,S.jsx)(`td`,{className:`px-4 py-2`,children:e.AllocatedStorage?`${e.AllocatedStorage} GiB`:`—`}),(0,S.jsxs)(`td`,{className:`space-x-2 px-4 py-2 text-right`,children:[(0,S.jsx)(s,{disabled:!u(i)||r.isPending,onClick:e=>{e.stopPropagation(),r.mutate(n)},size:`sm`,variant:`outline`,children:`Start`}),(0,S.jsx)(s,{disabled:!l(i)||w.isPending,onClick:e=>{e.stopPropagation(),w.mutate(n)},size:`sm`,variant:`outline`,children:`Stop`}),(0,S.jsx)(s,{disabled:!d(i)||E.isPending,onClick:e=>{e.stopPropagation(),E.mutate(n)},size:`sm`,variant:`outline`,children:`Reboot`}),(0,S.jsx)(s,{disabled:!c(i),onClick:t=>{t.stopPropagation(),O({identifier:n,deletionProtection:e.DeletionProtection??!1})},size:`sm`,variant:`destructive`,children:`Delete`})]})]},n)})})]})}):(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:`No DB instances found.`}),e[6]=A,e[7]=t,e[8]=E,e[9]=r,e[10]=w,e[11]=P):P=e[11];let F;e[12]===D?F=e[13]:(F=D&&(0,S.jsx)(y,{dbInstanceIdentifier:D.identifier,deletionProtection:D.deletionProtection,onOpenChange:e=>{e||O(null)},open:!0}),e[12]=D,e[13]=F);let I;return e[14]!==M||e[15]!==N||e[16]!==P||e[17]!==F?(I=(0,S.jsxs)(S.Fragment,{children:[M,N,P,F]}),e[14]=M,e[15]=N,e[16]=P,e[17]=F,e[18]=I):I=e[18],I}function T(e){e.stopPropagation()}var E=w;export{E as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/describe-db-parameter-groups.js b/spinifex/services/spinifexui/frontend/dist/assets/describe-db-parameter-groups.js index 34209a9fc..4955edde5 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/describe-db-parameter-groups.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/describe-db-parameter-groups.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{t as s}from"./button.js";import{b as c}from"./rds.js";import{d as l}from"./rds3.js";import{t as u}from"./page-heading.js";import{t as d}from"./delete-db-parameter-group-dialog.js";var f=r(),p=e(n(),1),m=t();function h(){let e=(0,f.c)(14),t=o(),{data:n}=i(l),[r,h]=(0,p.useState)(null),_;e[0]===n.DBParameterGroups?_=e[1]:(_=n.DBParameterGroups??[],e[0]=n.DBParameterGroups,e[1]=_);let v=_,y;e[2]===t?y=e[3]:(y=(0,m.jsx)(u,{actions:(0,m.jsx)(s,{onClick:async()=>await t({to:`/rds/create-db-parameter-group`}),children:`Create Parameter Group`}),title:`DB Parameter Groups`}),e[2]=t,e[3]=y);let b;e[4]!==v||e[5]!==t?(b=v.length>0?(0,m.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,m.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Family`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Type`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Description`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,m.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,m.jsx)(`tbody`,{children:v.map(e=>{let n=e.DBParameterGroupName;if(!n)return null;let r=c(n);return(0,m.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await t({to:`/rds/describe-db-parameter-groups/$name`,params:{name:n}}),children:[(0,m.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,m.jsx)(a,{className:`text-primary hover:underline`,onClick:g,params:{name:n},to:`/rds/describe-db-parameter-groups/$name`,children:n})}),(0,m.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.DBParameterGroupFamily}),(0,m.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:r?`Default`:`Customer`}),(0,m.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:e.Description}),(0,m.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,m.jsx)(s,{disabled:r,onClick:e=>{e.stopPropagation(),h(n)},size:`sm`,variant:`destructive`,children:`Delete`})})]},n)})})]})}):(0,m.jsx)(`p`,{className:`text-muted-foreground`,children:`No DB parameter groups found.`}),e[4]=v,e[5]=t,e[6]=b):b=e[6];let x;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,m.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`A default group is owned by the service. It is readable and attachable but cannot be modified, deleted or tagged — create your own group to change a value.`}),e[7]=x):x=e[7];let S;e[8]===r?S=e[9]:(S=r&&(0,m.jsx)(d,{dbParameterGroupName:r,onOpenChange:e=>!e&&h(null),open:!0}),e[8]=r,e[9]=S);let C;return e[10]!==y||e[11]!==b||e[12]!==S?(C=(0,m.jsxs)(m.Fragment,{children:[y,b,x,S]}),e[10]=y,e[11]=b,e[12]=S,e[13]=C):C=e[13],C}function g(e){return e.stopPropagation()}var _=h;export{_ as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{t as s}from"./button.js";import{b as c}from"./rds.js";import{d as l}from"./rds3.js";import{t as u}from"./page-heading.js";import{t as d}from"./delete-db-parameter-group-dialog.js";var f=r(),p=e(n(),1),m=t();function h(){let e=(0,f.c)(14),t=o(),{data:n}=i(l),[r,h]=(0,p.useState)(null),_;e[0]===n.DBParameterGroups?_=e[1]:(_=n.DBParameterGroups??[],e[0]=n.DBParameterGroups,e[1]=_);let v=_,y;e[2]===t?y=e[3]:(y=(0,m.jsx)(u,{actions:(0,m.jsx)(s,{onClick:async()=>{await t({to:`/rds/create-db-parameter-group`})},children:`Create Parameter Group`}),title:`DB Parameter Groups`}),e[2]=t,e[3]=y);let b;e[4]!==v||e[5]!==t?(b=v.length>0?(0,m.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,m.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Family`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Type`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Description`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,m.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,m.jsx)(`tbody`,{children:v.map(e=>{let n=e.DBParameterGroupName;if(!n)return null;let r=c(n);return(0,m.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>{await t({to:`/rds/describe-db-parameter-groups/$name`,params:{name:n}})},children:[(0,m.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,m.jsx)(a,{className:`text-primary hover:underline`,onClick:g,params:{name:n},to:`/rds/describe-db-parameter-groups/$name`,children:n})}),(0,m.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.DBParameterGroupFamily}),(0,m.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:r?`Default`:`Customer`}),(0,m.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:e.Description}),(0,m.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,m.jsx)(s,{disabled:r,onClick:e=>{e.stopPropagation(),h(n)},size:`sm`,variant:`destructive`,children:`Delete`})})]},n)})})]})}):(0,m.jsx)(`p`,{className:`text-muted-foreground`,children:`No DB parameter groups found.`}),e[4]=v,e[5]=t,e[6]=b):b=e[6];let x;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,m.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`A default group is owned by the service. It is readable and attachable but cannot be modified, deleted or tagged — create your own group to change a value.`}),e[7]=x):x=e[7];let S;e[8]===r?S=e[9]:(S=r&&(0,m.jsx)(d,{dbParameterGroupName:r,onOpenChange:e=>{e||h(null)},open:!0}),e[8]=r,e[9]=S);let C;return e[10]!==y||e[11]!==b||e[12]!==S?(C=(0,m.jsxs)(m.Fragment,{children:[y,b,x,S]}),e[10]=y,e[11]=b,e[12]=S,e[13]=C):C=e[13],C}function g(e){e.stopPropagation()}var _=h;export{_ as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/describe-db-snapshots.js b/spinifex/services/spinifexui/frontend/dist/assets/describe-db-snapshots.js index 79927a6ff..294598b95 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/describe-db-snapshots.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/describe-db-snapshots.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{$t as s}from"./cluster-config.js";import{t as c}from"./button.js";import{a as l,d as u,l as d,o as f}from"./rds.js";import{a as p}from"./rds3.js";import{t as m}from"./page-heading.js";import{t as h}from"./state-badge.js";import{t as g}from"./create-db-snapshot-dialog.js";import{t as _}from"./delete-db-snapshot-dialog.js";var v=r(),y=e(n(),1),b=t(),x=[{value:``,label:`All types`},{value:f,label:`Manual`},{value:l,label:`Automated`}];function S(){let e=(0,v.c)(26),t=o(),{data:n}=i(p),[r,l]=(0,y.useState)(``),[f,S]=(0,y.useState)(!1),[C,w]=(0,y.useState)(null),T;e[0]===n.DBSnapshots?T=e[1]:(T=n.DBSnapshots??[],e[0]=n.DBSnapshots,e[1]=T);let E,D,O;if(e[2]!==t||e[3]!==T||e[4]!==r){let n;e[8]===r?n=e[9]:(n=e=>r===``||e.SnapshotType===r,e[8]=r,e[9]=n);let i=T.filter(n);e[10]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,b.jsx)(m,{actions:(0,b.jsx)(c,{onClick:()=>S(!0),children:`Take Snapshot`}),title:`Snapshots`}),e[10]=E):E=e[10];let o;e[11]===r?o=e[12]:(o=x.map(e=>(0,b.jsx)(c,{onClick:()=>l(e.value),size:`sm`,variant:r===e.value?`default`:`outline`,children:e.label},e.value)),e[11]=r,e[12]=o),e[13]===o?D=e[14]:(D=(0,b.jsx)(`div`,{className:`mb-4 flex items-center gap-2`,children:o}),e[13]=o,e[14]=D),O=i.length>0?(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Identifier`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`DB instance`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Type`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Engine`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Storage`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Created`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,b.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,b.jsx)(`tbody`,{children:i.map(e=>{let n=e.DBSnapshotIdentifier;if(!n)return null;let r=e.DBInstanceIdentifier??``;return(0,b.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,b.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:n},to:`/rds/describe-db-snapshots/$id`,children:n})}),(0,b.jsx)(`td`,{className:`px-4 py-2`,children:r===``?`—`:(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:r},to:`/rds/describe-db-instances/$id`,children:r})}),(0,b.jsx)(`td`,{className:`px-4 py-2`,children:e.SnapshotType}),(0,b.jsx)(`td`,{className:`px-4 py-2`,children:[e.Engine,e.EngineVersion].filter(Boolean).join(` `)}),(0,b.jsx)(`td`,{className:`px-4 py-2`,children:e.AllocatedStorage?`${e.AllocatedStorage} GiB`:`—`}),(0,b.jsx)(`td`,{className:`px-4 py-2`,children:(0,b.jsx)(h,{state:e.Status})}),(0,b.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:s(e.SnapshotCreateTime)}),(0,b.jsxs)(`td`,{className:`space-x-2 px-4 py-2 text-right`,children:[(0,b.jsx)(c,{disabled:!u(e.Status),onClick:async()=>await t({to:`/rds/restore-db-instance-from-db-snapshot/$id`,params:{id:n}}),size:`sm`,variant:`outline`,children:`Restore`}),(0,b.jsx)(c,{disabled:!d(e.Status,e.SnapshotType),onClick:()=>w(n),size:`sm`,variant:`destructive`,children:`Delete`})]})]},n)})})]})}):(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`No DB snapshots found.`}),e[2]=t,e[3]=T,e[4]=r,e[5]=E,e[6]=D,e[7]=O}else E=e[5],D=e[6],O=e[7];let k;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,b.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Automated backups live in the reserved rds: namespace and cannot be deleted by hand — the instance's backup retention is what removes them.`}),e[15]=k):k=e[15];let A;e[16]===f?A=e[17]:(A=f&&(0,b.jsx)(g,{onOpenChange:S,open:!0}),e[16]=f,e[17]=A);let j;e[18]===C?j=e[19]:(j=C&&(0,b.jsx)(_,{dbSnapshotIdentifier:C,onOpenChange:e=>!e&&w(null),open:!0}),e[18]=C,e[19]=j);let M;return e[20]!==E||e[21]!==D||e[22]!==O||e[23]!==A||e[24]!==j?(M=(0,b.jsxs)(b.Fragment,{children:[E,D,O,k,A,j]}),e[20]=E,e[21]=D,e[22]=O,e[23]=A,e[24]=j,e[25]=M):M=e[25],M}var C=S;export{C as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{$t as s}from"./cluster-config.js";import{t as c}from"./button.js";import{a as l,d as u,l as d,o as f}from"./rds.js";import{a as p}from"./rds3.js";import{t as m}from"./page-heading.js";import{t as h}from"./state-badge.js";import{t as g}from"./create-db-snapshot-dialog.js";import{t as _}from"./delete-db-snapshot-dialog.js";var v=r(),y=e(n(),1),b=t(),x=[{value:``,label:`All types`},{value:f,label:`Manual`},{value:l,label:`Automated`}];function S(){let e=(0,v.c)(26),t=o(),{data:n}=i(p),[r,l]=(0,y.useState)(``),[f,S]=(0,y.useState)(!1),[C,w]=(0,y.useState)(null),T;e[0]===n.DBSnapshots?T=e[1]:(T=n.DBSnapshots??[],e[0]=n.DBSnapshots,e[1]=T);let E,D,O;if(e[2]!==t||e[3]!==T||e[4]!==r){let n;e[8]===r?n=e[9]:(n=e=>r===``||e.SnapshotType===r,e[8]=r,e[9]=n);let i=T.filter(n);e[10]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,b.jsx)(m,{actions:(0,b.jsx)(c,{onClick:()=>{S(!0)},children:`Take Snapshot`}),title:`Snapshots`}),e[10]=E):E=e[10];let o;e[11]===r?o=e[12]:(o=x.map(e=>(0,b.jsx)(c,{onClick:()=>{l(e.value)},size:`sm`,variant:r===e.value?`default`:`outline`,children:e.label},e.value)),e[11]=r,e[12]=o),e[13]===o?D=e[14]:(D=(0,b.jsx)(`div`,{className:`mb-4 flex items-center gap-2`,children:o}),e[13]=o,e[14]=D),O=i.length>0?(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Identifier`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`DB instance`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Type`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Engine`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Storage`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Created`}),(0,b.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,b.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,b.jsx)(`tbody`,{children:i.map(e=>{let n=e.DBSnapshotIdentifier;if(!n)return null;let r=e.DBInstanceIdentifier??``;return(0,b.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,b.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:n},to:`/rds/describe-db-snapshots/$id`,children:n})}),(0,b.jsx)(`td`,{className:`px-4 py-2`,children:r===``?`—`:(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:r},to:`/rds/describe-db-instances/$id`,children:r})}),(0,b.jsx)(`td`,{className:`px-4 py-2`,children:e.SnapshotType}),(0,b.jsx)(`td`,{className:`px-4 py-2`,children:[e.Engine,e.EngineVersion].filter(Boolean).join(` `)}),(0,b.jsx)(`td`,{className:`px-4 py-2`,children:e.AllocatedStorage?`${e.AllocatedStorage} GiB`:`—`}),(0,b.jsx)(`td`,{className:`px-4 py-2`,children:(0,b.jsx)(h,{state:e.Status})}),(0,b.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:s(e.SnapshotCreateTime)}),(0,b.jsxs)(`td`,{className:`space-x-2 px-4 py-2 text-right`,children:[(0,b.jsx)(c,{disabled:!u(e.Status),onClick:async()=>{await t({to:`/rds/restore-db-instance-from-db-snapshot/$id`,params:{id:n}})},size:`sm`,variant:`outline`,children:`Restore`}),(0,b.jsx)(c,{disabled:!d(e.Status,e.SnapshotType),onClick:()=>{w(n)},size:`sm`,variant:`destructive`,children:`Delete`})]})]},n)})})]})}):(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`No DB snapshots found.`}),e[2]=t,e[3]=T,e[4]=r,e[5]=E,e[6]=D,e[7]=O}else E=e[5],D=e[6],O=e[7];let k;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,b.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Automated backups live in the reserved rds: namespace and cannot be deleted by hand — the instance's backup retention is what removes them.`}),e[15]=k):k=e[15];let A;e[16]===f?A=e[17]:(A=f&&(0,b.jsx)(g,{onOpenChange:S,open:!0}),e[16]=f,e[17]=A);let j;e[18]===C?j=e[19]:(j=C&&(0,b.jsx)(_,{dbSnapshotIdentifier:C,onOpenChange:e=>{e||w(null)},open:!0}),e[18]=C,e[19]=j);let M;return e[20]!==E||e[21]!==D||e[22]!==O||e[23]!==A||e[24]!==j?(M=(0,b.jsxs)(b.Fragment,{children:[E,D,O,k,A,j]}),e[20]=E,e[21]=D,e[22]=O,e[23]=A,e[24]=j,e[25]=M):M=e[25],M}var C=S;export{C as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/describe-db-subnet-groups.js b/spinifex/services/spinifexui/frontend/dist/assets/describe-db-subnet-groups.js index d7b2a524e..40f780e9d 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/describe-db-subnet-groups.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/describe-db-subnet-groups.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{t as s}from"./button.js";import{h as c}from"./rds3.js";import{t as l}from"./page-heading.js";import{t as u}from"./state-badge.js";import{t as d}from"./delete-db-subnet-group-dialog.js";var f=r(),p=e(n(),1),m=t();function h(){let e=(0,f.c)(13),t=o(),{data:n}=i(c),[r,h]=(0,p.useState)(null),_;e[0]===n.DBSubnetGroups?_=e[1]:(_=n.DBSubnetGroups??[],e[0]=n.DBSubnetGroups,e[1]=_);let v=_,y;e[2]===t?y=e[3]:(y=(0,m.jsx)(l,{actions:(0,m.jsx)(s,{onClick:async()=>await t({to:`/rds/create-db-subnet-group`}),children:`Create Subnet Group`}),title:`DB Subnet Groups`}),e[2]=t,e[3]=y);let b;e[4]!==v||e[5]!==t?(b=v.length>0?(0,m.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,m.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`VPC`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Subnets`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Description`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,m.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,m.jsx)(`tbody`,{children:v.map(e=>{let n=e.DBSubnetGroupName;return n?(0,m.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await t({to:`/rds/describe-db-subnet-groups/$name`,params:{name:n}}),children:[(0,m.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,m.jsx)(a,{className:`text-primary hover:underline`,onClick:g,params:{name:n},to:`/rds/describe-db-subnet-groups/$name`,children:n})}),(0,m.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.VpcId??`—`}),(0,m.jsx)(`td`,{className:`px-4 py-2`,children:e.Subnets?.length??0}),(0,m.jsx)(`td`,{className:`px-4 py-2`,children:(0,m.jsx)(u,{state:e.SubnetGroupStatus})}),(0,m.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:e.DBSubnetGroupDescription}),(0,m.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,m.jsx)(s,{onClick:e=>{e.stopPropagation(),h(n)},size:`sm`,variant:`destructive`,children:`Delete`})})]},n):null})})]})}):(0,m.jsx)(`p`,{className:`text-muted-foreground`,children:`No DB subnet groups found. Without one, a database is placed in the account's default VPC subnet.`}),e[4]=v,e[5]=t,e[6]=b):b=e[6];let x;e[7]===r?x=e[8]:(x=r&&(0,m.jsx)(d,{dbSubnetGroupName:r,onOpenChange:e=>!e&&h(null),open:!0}),e[7]=r,e[8]=x);let S;return e[9]!==y||e[10]!==b||e[11]!==x?(S=(0,m.jsxs)(m.Fragment,{children:[y,b,x]}),e[9]=y,e[10]=b,e[11]=x,e[12]=S):S=e[12],S}function g(e){return e.stopPropagation()}var _=h;export{_ as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{t as s}from"./button.js";import{h as c}from"./rds3.js";import{t as l}from"./page-heading.js";import{t as u}from"./state-badge.js";import{t as d}from"./delete-db-subnet-group-dialog.js";var f=r(),p=e(n(),1),m=t();function h(){let e=(0,f.c)(13),t=o(),{data:n}=i(c),[r,h]=(0,p.useState)(null),_;e[0]===n.DBSubnetGroups?_=e[1]:(_=n.DBSubnetGroups??[],e[0]=n.DBSubnetGroups,e[1]=_);let v=_,y;e[2]===t?y=e[3]:(y=(0,m.jsx)(l,{actions:(0,m.jsx)(s,{onClick:async()=>{await t({to:`/rds/create-db-subnet-group`})},children:`Create Subnet Group`}),title:`DB Subnet Groups`}),e[2]=t,e[3]=y);let b;e[4]!==v||e[5]!==t?(b=v.length>0?(0,m.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,m.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`VPC`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Subnets`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Description`}),(0,m.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,m.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,m.jsx)(`tbody`,{children:v.map(e=>{let n=e.DBSubnetGroupName;return n?(0,m.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>{await t({to:`/rds/describe-db-subnet-groups/$name`,params:{name:n}})},children:[(0,m.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,m.jsx)(a,{className:`text-primary hover:underline`,onClick:g,params:{name:n},to:`/rds/describe-db-subnet-groups/$name`,children:n})}),(0,m.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.VpcId??`—`}),(0,m.jsx)(`td`,{className:`px-4 py-2`,children:e.Subnets?.length??0}),(0,m.jsx)(`td`,{className:`px-4 py-2`,children:(0,m.jsx)(u,{state:e.SubnetGroupStatus})}),(0,m.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:e.DBSubnetGroupDescription}),(0,m.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,m.jsx)(s,{onClick:e=>{e.stopPropagation(),h(n)},size:`sm`,variant:`destructive`,children:`Delete`})})]},n):null})})]})}):(0,m.jsx)(`p`,{className:`text-muted-foreground`,children:`No DB subnet groups found. Without one, a database is placed in the account's default VPC subnet.`}),e[4]=v,e[5]=t,e[6]=b):b=e[6];let x;e[7]===r?x=e[8]:(x=r&&(0,m.jsx)(d,{dbSubnetGroupName:r,onOpenChange:e=>{e||h(null)},open:!0}),e[7]=r,e[8]=x);let S;return e[9]!==y||e[10]!==b||e[11]!==x?(S=(0,m.jsxs)(m.Fragment,{children:[y,b,x]}),e[9]=y,e[10]=b,e[11]=x,e[12]=S):S=e[12],S}function g(e){e.stopPropagation()}var _=h;export{_ as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/describe-load-balancers.js b/spinifex/services/spinifexui/frontend/dist/assets/describe-load-balancers.js index 045caa5d0..42bd2e819 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/describe-load-balancers.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/describe-load-balancers.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./link.js";import{t as i}from"./useNavigate.js";import{$t as a}from"./cluster-config.js";import{t as o}from"./button.js";import{a as s}from"./elbv22.js";import{t as c}from"./page-heading.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(10),t=i(),{data:f}=n(s),m;e[0]===f.LoadBalancers?m=e[1]:(m=f.LoadBalancers??[],e[0]=f.LoadBalancers,e[1]=m);let h=m,g;e[2]===t?g=e[3]:(g=(0,d.jsx)(c,{actions:(0,d.jsx)(o,{onClick:async()=>await t({to:`/ec2/create-load-balancer`}),children:`Create Load Balancer`}),title:`Load Balancers`}),e[2]=t,e[3]=g);let _;e[4]!==h||e[5]!==t?(_=h.length>0?(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`DNS Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`State`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Type`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Scheme`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`VPC`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Created`})]})}),(0,d.jsx)(`tbody`,{children:h.map(e=>{if(!e.LoadBalancerArn)return null;let n=e.LoadBalancerArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await t({to:`/ec2/describe-load-balancers/$id`,params:{id:encodeURIComponent(n)}}),children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(r,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(n)},to:`/ec2/describe-load-balancers/$id`,children:e.LoadBalancerName??n})}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.DNSName??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:(0,d.jsx)(l,{state:e.State?.Code})}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Type??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Scheme??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.VpcId??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:a(e.CreatedTime)})]},n)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No load balancers found.`}),e[4]=h,e[5]=t,e[6]=_):_=e[6];let v;return e[7]!==g||e[8]!==_?(v=(0,d.jsxs)(d.Fragment,{children:[g,_]}),e[7]=g,e[8]=_,e[9]=v):v=e[9],v}function p(e){return e.stopPropagation()}var m=f;export{m as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./link.js";import{t as i}from"./useNavigate.js";import{$t as a}from"./cluster-config.js";import{t as o}from"./button.js";import{a as s}from"./elbv22.js";import{t as c}from"./page-heading.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(10),t=i(),{data:f}=n(s),m;e[0]===f.LoadBalancers?m=e[1]:(m=f.LoadBalancers??[],e[0]=f.LoadBalancers,e[1]=m);let h=m,g;e[2]===t?g=e[3]:(g=(0,d.jsx)(c,{actions:(0,d.jsx)(o,{onClick:async()=>{await t({to:`/ec2/create-load-balancer`})},children:`Create Load Balancer`}),title:`Load Balancers`}),e[2]=t,e[3]=g);let _;e[4]!==h||e[5]!==t?(_=h.length>0?(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`DNS Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`State`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Type`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Scheme`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`VPC`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Created`})]})}),(0,d.jsx)(`tbody`,{children:h.map(e=>{if(!e.LoadBalancerArn)return null;let n=e.LoadBalancerArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>{await t({to:`/ec2/describe-load-balancers/$id`,params:{id:encodeURIComponent(n)}})},children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(r,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(n)},to:`/ec2/describe-load-balancers/$id`,children:e.LoadBalancerName??n})}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.DNSName??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:(0,d.jsx)(l,{state:e.State?.Code})}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Type??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Scheme??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.VpcId??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:a(e.CreatedTime)})]},n)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No load balancers found.`}),e[4]=h,e[5]=t,e[6]=_):_=e[6];let v;return e[7]!==g||e[8]!==_?(v=(0,d.jsxs)(d.Fragment,{children:[g,_]}),e[7]=g,e[8]=_,e[9]=v):v=e[9],v}function p(e){e.stopPropagation()}var m=f;export{m as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/describe-target-groups.js b/spinifex/services/spinifexui/frontend/dist/assets/describe-target-groups.js index 94af67550..81e44e479 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/describe-target-groups.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/describe-target-groups.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{t as o}from"./button.js";import{d as s,u as c}from"./elbv22.js";import{t as l}from"./page-heading.js";var u=t(),d=e();function f(){let e=(0,u.c)(6),t=a(),{data:n}=r(c),s;e[0]===n.TargetGroups?s=e[1]:(s=n.TargetGroups??[],e[0]=n.TargetGroups,e[1]=s);let f=s,h;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(l,{actions:(0,d.jsx)(i,{to:`/ec2/create-target-group`,children:(0,d.jsx)(o,{children:`Create Target Group`})}),title:`Target Groups`}),e[2]=h):h=e[2];let g;return e[3]!==t||e[4]!==f?(g=(0,d.jsxs)(d.Fragment,{children:[h,f.length>0?(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Protocol`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Port`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`VPC`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Target Type`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Targets`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Health`})]})}),(0,d.jsx)(`tbody`,{children:f.map(e=>{if(!e.TargetGroupArn)return null;let n=e.TargetGroupArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await t({to:`/ec2/describe-target-groups/$id`,params:{id:encodeURIComponent(n)}}),children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(i,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(n)},to:`/ec2/describe-target-groups/$id`,children:e.TargetGroupName??n})}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Protocol??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Port??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.VpcId??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.TargetType??``}),(0,d.jsx)(m,{arn:n})]},n)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No target groups found.`})]}),e[3]=t,e[4]=f,e[5]=g):g=e[5],g}function p(e){return e.stopPropagation()}function m(e){let t=(0,u.c)(14),{arn:r}=e,i;t[0]===r?i=t[1]:(i=s(r),t[0]=r,t[1]=i);let{data:a,isLoading:o}=n(i);if(o){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:`…`}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:`…`})]}),t[2]=e):e=t[2],e}let c;t[3]===a?.TargetHealthDescriptions?c=t[4]:(c=a?.TargetHealthDescriptions??[],t[3]=a?.TargetHealthDescriptions,t[4]=c);let l=c,f;if(t[5]!==l){let e={};for(let t of l){let n=t.TargetHealth?.State??`unknown`;e[n]=(e[n]??0)+1}f=Object.entries(e).map(h).join(`, `)||`—`,t[5]=l,t[6]=f}else f=t[6];let p=f,m;t[7]===l.length?m=t[8]:(m=(0,d.jsx)(`td`,{className:`px-4 py-2`,children:l.length}),t[7]=l.length,t[8]=m);let g;t[9]===p?g=t[10]:(g=(0,d.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:p}),t[9]=p,t[10]=g);let _;return t[11]!==m||t[12]!==g?(_=(0,d.jsxs)(d.Fragment,{children:[m,g]}),t[11]=m,t[12]=g,t[13]=_):_=t[13],_}function h(e){let[t,n]=e;return`${n} ${t}`}var g=f;export{g as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{t as i}from"./link.js";import{t as a}from"./useNavigate.js";import{t as o}from"./button.js";import{d as s,u as c}from"./elbv22.js";import{t as l}from"./page-heading.js";var u=t(),d=e();function f(){let e=(0,u.c)(6),t=a(),{data:n}=r(c),s;e[0]===n.TargetGroups?s=e[1]:(s=n.TargetGroups??[],e[0]=n.TargetGroups,e[1]=s);let f=s,h;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(l,{actions:(0,d.jsx)(i,{to:`/ec2/create-target-group`,children:(0,d.jsx)(o,{children:`Create Target Group`})}),title:`Target Groups`}),e[2]=h):h=e[2];let g;return e[3]!==t||e[4]!==f?(g=(0,d.jsxs)(d.Fragment,{children:[h,f.length>0?(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Protocol`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Port`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`VPC`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Target Type`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Targets`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Health`})]})}),(0,d.jsx)(`tbody`,{children:f.map(e=>{if(!e.TargetGroupArn)return null;let n=e.TargetGroupArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>{await t({to:`/ec2/describe-target-groups/$id`,params:{id:encodeURIComponent(n)}})},children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(i,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(n)},to:`/ec2/describe-target-groups/$id`,children:e.TargetGroupName??n})}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Protocol??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Port??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.VpcId??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.TargetType??``}),(0,d.jsx)(m,{arn:n})]},n)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No target groups found.`})]}),e[3]=t,e[4]=f,e[5]=g):g=e[5],g}function p(e){e.stopPropagation()}function m(e){let t=(0,u.c)(14),{arn:r}=e,i;t[0]===r?i=t[1]:(i=s(r),t[0]=r,t[1]=i);let{data:a,isLoading:o}=n(i);if(o){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:`…`}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:`…`})]}),t[2]=e):e=t[2],e}let c;t[3]===a?.TargetHealthDescriptions?c=t[4]:(c=a?.TargetHealthDescriptions??[],t[3]=a?.TargetHealthDescriptions,t[4]=c);let l=c,f;if(t[5]!==l){let e={};for(let t of l){let n=t.TargetHealth?.State??`unknown`;e[n]=(e[n]??0)+1}f=Object.entries(e).map(h).join(`, `)||`—`,t[5]=l,t[6]=f}else f=t[6];let p=f,m;t[7]===l.length?m=t[8]:(m=(0,d.jsx)(`td`,{className:`px-4 py-2`,children:l.length}),t[7]=l.length,t[8]=m);let g;t[9]===p?g=t[10]:(g=(0,d.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:p}),t[9]=p,t[10]=g);let _;return t[11]!==m||t[12]!==g?(_=(0,d.jsxs)(d.Fragment,{children:[m,g]}),t[11]=m,t[12]=g,t[13]=_):_=t[13],_}function h(e){let[t,n]=e;return`${n} ${t}`}var g=f;export{g as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/gpu-instance-type-select.js b/spinifex/services/spinifexui/frontend/dist/assets/gpu-instance-type-select.js index 3c72cb64f..9f60ece8d 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/gpu-instance-type-select.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/gpu-instance-type-select.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{tn as n}from"./cluster-config.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./select.js";var d=t(),f=e();function p(e){return(e.GpuInfo?.Gpus?.length??0)>0}function m(e){let t=new Map;for(let n of e){let e=n.InstanceType;!e||t.has(e)||t.set(e,{name:e,gpu:n.GpuInfo?.Gpus?.[0]})}return[...t.values()].toSorted((e,t)=>e.name.localeCompare(t.name))}function h(e){let t=(0,d.c)(6),{entry:r,availability:i}=e,a=r.gpu?.MemoryInfo?.SizeInMiB,o;t[0]===a?o=t[1]:(o=a!==void 0&&` — ${n(a)} GPU`,t[0]=a,t[1]=o);let s=i!==void 0&&` (${i} available)`,c;return t[2]!==r.name||t[3]!==o||t[4]!==s?(c=(0,f.jsxs)(f.Fragment,{children:[r.name,o,s]}),t[2]=r.name,t[3]=o,t[4]=s,t[5]=c):c=t[5],c}function g(e){let t=(0,d.c)(33),{instanceTypes:n,value:p,onValueChange:g,availabilityByType:y,disabled:b,id:x,className:S,"aria-invalid":C}=e,w,T;if(t[0]!==n){let e=m(n);w=e.filter(v),T=e.filter(_),t[0]=n,t[1]=w,t[2]=T}else w=t[1],T=t[2];let E;t[3]!==w||t[4]!==T?(E={standardEntries:w,gpuEntries:T},t[3]=w,t[4]=T,t[5]=E):E=t[5];let{standardEntries:D,gpuEntries:O}=E,k=D.length>0&&O.length>0,A;t[6]===g?A=t[7]:(A=e=>g(e??``),t[6]=g,t[7]=A);let j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,f.jsx)(i,{}),t[8]=j):j=t[8];let M;t[9]!==C||t[10]!==S||t[11]!==x?(M=(0,f.jsx)(l,{"aria-invalid":C,className:S,id:x,children:j}),t[9]=C,t[10]=S,t[11]=x,t[12]=M):M=t[12];let N;t[13]!==y||t[14]!==k||t[15]!==D?(N=D.length>0&&(0,f.jsxs)(c,{children:[k&&(0,f.jsx)(r,{children:`Standard`}),D.map(e=>(0,f.jsx)(a,{value:e.name,children:(0,f.jsx)(h,{availability:y?.[e.name],entry:e})},e.name))]}),t[13]=y,t[14]=k,t[15]=D,t[16]=N):N=t[16];let P;t[17]===k?P=t[18]:(P=k&&(0,f.jsx)(s,{}),t[17]=k,t[18]=P);let F;t[19]!==y||t[20]!==O||t[21]!==k?(F=O.length>0&&(0,f.jsxs)(c,{children:[k&&(0,f.jsx)(r,{children:`GPU-Accelerated`}),O.map(e=>(0,f.jsx)(a,{value:e.name,children:(0,f.jsx)(h,{availability:y?.[e.name],entry:e})},e.name))]}),t[19]=y,t[20]=O,t[21]=k,t[22]=F):F=t[22];let I;t[23]!==N||t[24]!==P||t[25]!==F?(I=(0,f.jsxs)(o,{children:[N,P,F]}),t[23]=N,t[24]=P,t[25]=F,t[26]=I):I=t[26];let L;return t[27]!==b||t[28]!==I||t[29]!==A||t[30]!==M||t[31]!==p?(L=(0,f.jsxs)(u,{disabled:b,onValueChange:A,value:p,children:[M,I]}),t[27]=b,t[28]=I,t[29]=A,t[30]=M,t[31]=p,t[32]=L):L=t[32],L}function _(e){return e.gpu}function v(e){return!e.gpu}export{p as n,g as t}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{tn as n}from"./cluster-config.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./select.js";var d=t(),f=e();function p(e){return(e.GpuInfo?.Gpus?.length??0)>0}function m(e){let t=new Map;for(let n of e){let e=n.InstanceType;!e||t.has(e)||t.set(e,{name:e,gpu:n.GpuInfo?.Gpus?.[0]})}return[...t.values()].toSorted((e,t)=>e.name.localeCompare(t.name))}function h(e){let t=(0,d.c)(6),{entry:r,availability:i}=e,a=r.gpu?.MemoryInfo?.SizeInMiB,o;t[0]===a?o=t[1]:(o=a!==void 0&&` — ${n(a)} GPU`,t[0]=a,t[1]=o);let s=i!==void 0&&` (${i} available)`,c;return t[2]!==r.name||t[3]!==o||t[4]!==s?(c=(0,f.jsxs)(f.Fragment,{children:[r.name,o,s]}),t[2]=r.name,t[3]=o,t[4]=s,t[5]=c):c=t[5],c}function g(e){let t=(0,d.c)(33),{instanceTypes:n,value:p,onValueChange:g,availabilityByType:y,disabled:b,id:x,className:S,"aria-invalid":C}=e,w,T;if(t[0]!==n){let e=m(n);w=e.filter(v),T=e.filter(_),t[0]=n,t[1]=w,t[2]=T}else w=t[1],T=t[2];let E;t[3]!==w||t[4]!==T?(E={standardEntries:w,gpuEntries:T},t[3]=w,t[4]=T,t[5]=E):E=t[5];let{standardEntries:D,gpuEntries:O}=E,k=D.length>0&&O.length>0,A;t[6]===g?A=t[7]:(A=e=>{g(e??``)},t[6]=g,t[7]=A);let j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,f.jsx)(i,{}),t[8]=j):j=t[8];let M;t[9]!==C||t[10]!==S||t[11]!==x?(M=(0,f.jsx)(l,{"aria-invalid":C,className:S,id:x,children:j}),t[9]=C,t[10]=S,t[11]=x,t[12]=M):M=t[12];let N;t[13]!==y||t[14]!==k||t[15]!==D?(N=D.length>0&&(0,f.jsxs)(c,{children:[k&&(0,f.jsx)(r,{children:`Standard`}),D.map(e=>(0,f.jsx)(a,{value:e.name,children:(0,f.jsx)(h,{availability:y?.[e.name],entry:e})},e.name))]}),t[13]=y,t[14]=k,t[15]=D,t[16]=N):N=t[16];let P;t[17]===k?P=t[18]:(P=k&&(0,f.jsx)(s,{}),t[17]=k,t[18]=P);let F;t[19]!==y||t[20]!==O||t[21]!==k?(F=O.length>0&&(0,f.jsxs)(c,{children:[k&&(0,f.jsx)(r,{children:`GPU-Accelerated`}),O.map(e=>(0,f.jsx)(a,{value:e.name,children:(0,f.jsx)(h,{availability:y?.[e.name],entry:e})},e.name))]}),t[19]=y,t[20]=O,t[21]=k,t[22]=F):F=t[22];let I;t[23]!==N||t[24]!==P||t[25]!==F?(I=(0,f.jsxs)(o,{children:[N,P,F]}),t[23]=N,t[24]=P,t[25]=F,t[26]=I):I=t[26];let L;return t[27]!==b||t[28]!==I||t[29]!==A||t[30]!==M||t[31]!==p?(L=(0,f.jsxs)(u,{disabled:b,onValueChange:A,value:p,children:[M,I]}),t[27]=b,t[28]=I,t[29]=A,t[30]=M,t[31]=p,t[32]=L):L=t[32],L}function _(e){return e.gpu}function v(e){return!e.gpu}export{p as n,g as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/import-key-pair.js b/spinifex/services/spinifexui/frontend/dist/assets/import-key-pair.js index aca5d9eae..863ea379b 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/import-key-pair.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/import-key-pair.js @@ -1,3 +1,3 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{q as ee}from"./ec22.js";import{a as o,i as s,t as c}from"./zod.js";import{t as l}from"./error-banner.js";import{t as te}from"./form-actions.js";import{t as u}from"./page-heading.js";import{a as d,r as f,t as p}from"./field.js";import{v as m}from"./ec23.js";import{t as h}from"./textarea.js";var g=t(),_=e();function v(){let e=(0,g.c)(55),t=n(),v=ee(),b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:c(m)},e[0]=b):b=e[0];let{handleSubmit:x,register:S,control:C,formState:w}=s(b),{errors:T,isSubmitting:E}=w,D;e[1]===C?D=e[2]:(D={control:C},e[1]=C,e[2]=D);let O=o(D),k;e[3]!==v||e[4]!==t?(k=async e=>{await v.mutateAsync(e),t({to:`/ec2/describe-key-pairs`})},e[3]=v,e[4]=t,e[5]=k):k=e[5];let A=k,j,M;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,_.jsx)(r,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),M=(0,_.jsx)(u,{title:`Import Key Pair`}),e[6]=j,e[7]=M):(j=e[6],M=e[7]);let N;e[8]===v.error?N=e[9]:(N=v.error&&(0,_.jsx)(l,{error:v.error,msg:`Failed to import key pair`}),e[8]=v.error,e[9]=N);let P;e[10]!==x||e[11]!==A?(P=x(A),e[10]=x,e[11]=A,e[12]=P):P=e[12];let F;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,_.jsx)(d,{children:(0,_.jsx)(`label`,{htmlFor:`keyName`,children:`Key Pair Name`})}),e[13]=F):F=e[13];let I=!!T.keyName,L;e[14]===S?L=e[15]:(L=S(`keyName`),e[14]=S,e[15]=L);let R;e[16]!==L||e[17]!==I?(R=(0,_.jsx)(a,{"aria-invalid":I,id:`keyName`,placeholder:`my-key-pair…`,...L}),e[16]=L,e[17]=I,e[18]=R):R=e[18];let z;e[19]===T.keyName?z=e[20]:(z=(0,_.jsx)(f,{errors:[T.keyName]}),e[19]=T.keyName,e[20]=z);let B;e[21]!==R||e[22]!==z?(B=(0,_.jsxs)(p,{children:[F,R,z]}),e[21]=R,e[22]=z,e[23]=B):B=e[23];let V,H;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,_.jsx)(d,{children:(0,_.jsx)(`label`,{htmlFor:`publicKeyMaterial`,children:`Public Key`})}),H=(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,id:`publicKey-description`,children:`Paste your OpenSSH public key (e.g. the contents of id_rsa.pub)`}),e[24]=V,e[25]=H):(V=e[24],H=e[25]);let U=!!T.publicKeyMaterial,W;e[26]===S?W=e[27]:(W=S(`publicKeyMaterial`),e[26]=S,e[27]=W);let G;e[28]!==U||e[29]!==W?(G=(0,_.jsx)(h,{"aria-invalid":U,id:`publicKeyMaterial`,placeholder:`ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC…`,rows:8,...W}),e[28]=U,e[29]=W,e[30]=G):G=e[30];let K;e[31]===T.publicKeyMaterial?K=e[32]:(K=(0,_.jsx)(f,{errors:[T.publicKeyMaterial]}),e[31]=T.publicKeyMaterial,e[32]=K);let q;e[33]!==G||e[34]!==K?(q=(0,_.jsxs)(p,{children:[V,H,G,K]}),e[33]=G,e[34]=K,e[35]=q):q=e[35];let J;e[36]===O?J=e[37]:(J=y(O),e[36]=O,e[37]=J);let Y;e[38]===J?Y=e[39]:(Y=(0,_.jsx)(i,{commands:J}),e[38]=J,e[39]=Y);let X;e[40]===t?X=e[41]:(X=async()=>await t({to:`/ec2/describe-key-pairs`}),e[40]=t,e[41]=X);let Z;e[42]!==v.isPending||e[43]!==E||e[44]!==X?(Z=(0,_.jsx)(te,{isPending:v.isPending,isSubmitting:E,onCancel:X,pendingLabel:`Importing…`,submitLabel:`Import Key Pair`}),e[42]=v.isPending,e[43]=E,e[44]=X,e[45]=Z):Z=e[45];let Q;e[46]!==B||e[47]!==q||e[48]!==Y||e[49]!==Z||e[50]!==P?(Q=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:P,children:[B,q,Y,Z]}),e[46]=B,e[47]=q,e[48]=Y,e[49]=Z,e[50]=P,e[51]=Q):Q=e[51];let $;return e[52]!==Q||e[53]!==N?($=(0,_.jsxs)(_.Fragment,{children:[j,M,N,Q]}),e[52]=Q,e[53]=N,e[54]=$):$=e[54],$}function y(e){return[{label:`Import Key Pair`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 import-key-pair`},{type:`flag`,value:` \\ +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useNavigate.js";import{t as r}from"./back-link.js";import{t as i}from"./cli-command-panel.js";import{t as a}from"./input.js";import{q as ee}from"./ec22.js";import{a as o,i as s,t as c}from"./zod.js";import{t as l}from"./error-banner.js";import{t as te}from"./form-actions.js";import{t as u}from"./page-heading.js";import{a as d,r as f,t as p}from"./field.js";import{v as m}from"./ec23.js";import{t as h}from"./textarea.js";var g=t(),_=e();function v(){let e=(0,g.c)(55),t=n(),v=ee(),b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:c(m)},e[0]=b):b=e[0];let{handleSubmit:x,register:S,control:C,formState:w}=s(b),{errors:T,isSubmitting:E}=w,D;e[1]===C?D=e[2]:(D={control:C},e[1]=C,e[2]=D);let O=o(D),k;e[3]!==v||e[4]!==t?(k=async e=>{await v.mutateAsync(e),t({to:`/ec2/describe-key-pairs`})},e[3]=v,e[4]=t,e[5]=k):k=e[5];let A=k,j,M;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,_.jsx)(r,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),M=(0,_.jsx)(u,{title:`Import Key Pair`}),e[6]=j,e[7]=M):(j=e[6],M=e[7]);let N;e[8]===v.error?N=e[9]:(N=v.error&&(0,_.jsx)(l,{error:v.error,msg:`Failed to import key pair`}),e[8]=v.error,e[9]=N);let P;e[10]!==x||e[11]!==A?(P=x(A),e[10]=x,e[11]=A,e[12]=P):P=e[12];let F;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,_.jsx)(d,{children:(0,_.jsx)(`label`,{htmlFor:`keyName`,children:`Key Pair Name`})}),e[13]=F):F=e[13];let I=!!T.keyName,L;e[14]===S?L=e[15]:(L=S(`keyName`),e[14]=S,e[15]=L);let R;e[16]!==L||e[17]!==I?(R=(0,_.jsx)(a,{"aria-invalid":I,id:`keyName`,placeholder:`my-key-pair…`,...L}),e[16]=L,e[17]=I,e[18]=R):R=e[18];let z;e[19]===T.keyName?z=e[20]:(z=(0,_.jsx)(f,{errors:[T.keyName]}),e[19]=T.keyName,e[20]=z);let B;e[21]!==R||e[22]!==z?(B=(0,_.jsxs)(p,{children:[F,R,z]}),e[21]=R,e[22]=z,e[23]=B):B=e[23];let V,H;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,_.jsx)(d,{children:(0,_.jsx)(`label`,{htmlFor:`publicKeyMaterial`,children:`Public Key`})}),H=(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,id:`publicKey-description`,children:`Paste your OpenSSH public key (e.g. the contents of id_rsa.pub)`}),e[24]=V,e[25]=H):(V=e[24],H=e[25]);let U=!!T.publicKeyMaterial,W;e[26]===S?W=e[27]:(W=S(`publicKeyMaterial`),e[26]=S,e[27]=W);let G;e[28]!==U||e[29]!==W?(G=(0,_.jsx)(h,{"aria-invalid":U,id:`publicKeyMaterial`,placeholder:`ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC…`,rows:8,...W}),e[28]=U,e[29]=W,e[30]=G):G=e[30];let K;e[31]===T.publicKeyMaterial?K=e[32]:(K=(0,_.jsx)(f,{errors:[T.publicKeyMaterial]}),e[31]=T.publicKeyMaterial,e[32]=K);let q;e[33]!==G||e[34]!==K?(q=(0,_.jsxs)(p,{children:[V,H,G,K]}),e[33]=G,e[34]=K,e[35]=q):q=e[35];let J;e[36]===O?J=e[37]:(J=y(O),e[36]=O,e[37]=J);let Y;e[38]===J?Y=e[39]:(Y=(0,_.jsx)(i,{commands:J}),e[38]=J,e[39]=Y);let X;e[40]===t?X=e[41]:(X=async()=>{await t({to:`/ec2/describe-key-pairs`})},e[40]=t,e[41]=X);let Z;e[42]!==v.isPending||e[43]!==E||e[44]!==X?(Z=(0,_.jsx)(te,{isPending:v.isPending,isSubmitting:E,onCancel:X,pendingLabel:`Importing…`,submitLabel:`Import Key Pair`}),e[42]=v.isPending,e[43]=E,e[44]=X,e[45]=Z):Z=e[45];let Q;e[46]!==B||e[47]!==q||e[48]!==Y||e[49]!==Z||e[50]!==P?(Q=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:P,children:[B,q,Y,Z]}),e[46]=B,e[47]=q,e[48]=Y,e[49]=Z,e[50]=P,e[51]=Q):Q=e[51];let $;return e[52]!==Q||e[53]!==N?($=(0,_.jsxs)(_.Fragment,{children:[j,M,N,Q]}),e[52]=Q,e[53]=N,e[54]=$):$=e[54],$}function y(e){return[{label:`Import Key Pair`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 import-key-pair`},{type:`flag`,value:` \\ --key-name`},{type:`value`,value:` ${(e.keyName??``)||``}`},{type:`flag`,value:` \\ --public-key-material`},{type:`value`,value:` fileb://path/to/key.pub`}]}]}export{v as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/index.js b/spinifex/services/spinifexui/frontend/dist/assets/index.js index d5562ee51..3b6ac35de 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/index.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/index.js @@ -7,4 +7,4 @@ import{a as e,i as t,n,r,t as i}from"./compiler-runtime.js";import{M as a,O as o `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ye(n):``}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return ye(e.type);case 16:return ye(`Lazy`);case 13:return e.child!==t&&t!==null?ye(`Suspense Fallback`):ye(`Suspense`);case 19:return ye(`SuspenseList`);case 0:case 15:return xe(e.type,!1);case 11:return xe(e.type.render,!1);case 1:return xe(e.type,!0);case 31:return ye(`Activity`);default:return``}}function Ce(e){try{var t=``,n=null;do t+=Se(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` `+e.stack}}var we=Object.prototype.hasOwnProperty,Te=t.unstable_scheduleCallback,Ee=t.unstable_cancelCallback,N=t.unstable_shouldYield,De=t.unstable_requestPaint,P=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Pe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function F(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=F(n))):i=F(o):i=F(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=F(n))):i=F(o)):i=F(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function I(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ye(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function L(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),ln=!1;if(cn)try{var un={};Object.defineProperty(un,"passive",{get:function(){ln=!0}}),window.addEventListener(`test`,un,un),window.removeEventListener(`test`,un,un)}catch{ln=!1}var dn=null,fn=null,pn=null;function mn(){if(pn)return pn;var e,t=fn,n=t.length,r,i=`value`in dn?dn.value:dn.textContent,a=i.length;for(e=0;e=Kn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Gn&&Zn(e,t)?(e=mn(),pn=fn=dn=null,$n=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ft(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ft(e.document)}return t}function Dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Or=cn&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==Ft(r)||(r=kr,`selectionStart`in r&&Dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&Sr(jr,r)||(jr=r,r=Td(Ar,`onSelect`),0>=o,i-=o,Ti=1<<32-Be(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&Di(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),z&&Di(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&Di(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),z&&Di(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Da(l)===r.type){n(e,r.sibling),c=i(r,o.props),Pa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===_?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Pa(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Da(o),b(e,r,o,c)}if(ie(o))return v(e,r,o,c);if(O(o)){if(l=O(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Na(o),c);if(o.$$typeof===x)return b(e,r,ta(e,o),c);Fa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ma=0;var i=b(e,t,n,r);return ja=null,i}catch(t){if(t===xa||t===Ca)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var La=Ia(!0),Ra=Ia(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Wa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function Ga(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ka=!1;function qa(){if(Ka){var e=fa;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(Y&f)===f:(r&f)===f){f!==0&&f===da&&(Ka=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:za=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=k.T,s={};k.T=s,Ns(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ms(e,t,ha(c,r),fu(e)):Ms(e,t,r,fu(e))}catch(n){Ms(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function Ss(){}function Cs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=ws(e).queue;xs(e,i,t,ae,n===null?Ss:function(){return Ts(e),n(r)})}function ws(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ts(e){var t=ws(e);t.next===null&&(t=e.alternate.memoizedState),Ms(e,t.next.queue,{},fu())}function Es(){return ea(Qf)}function Ds(){return ko().memoizedState}function Os(){return ko().memoizedState}function ks(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Ha(n);var r=Ua(t,e,n);r!==null&&(mu(r,t,n),Wa(r,t,n)),t={cache:sa()},e.payload=t;return}t=t.return}}function As(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ps(e)?Fs(t,n):(n=ti(e,t,n,r),n!==null&&(mu(n,e,r),Is(n,t,r)))}function js(e,t,n){Ms(e,t,n,fu())}function Ms(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ps(e))Fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,xr(s,o))return ei(e,t,i,0),Rl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return mu(n,e,r),Is(n,t,r),!0}return!1}function Ns(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(a(479))}else t=ti(e,n,r,2),t!==null&&mu(t,e,2)}function Ps(e){var t=e.alternate;return e===H||t!==null&&t===H}function Fs(e,t){po=fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Is(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Ls={readContext:ea,use:Mo,useCallback:bo,useContext:bo,useEffect:bo,useImperativeHandle:bo,useLayoutEffect:bo,useInsertionEffect:bo,useMemo:bo,useReducer:bo,useRef:bo,useState:bo,useDebugValue:bo,useDeferredValue:bo,useTransition:bo,useSyncExternalStore:bo,useId:bo,useHostTransitionStatus:bo,useFormState:bo,useActionState:bo,useOptimistic:bo,useMemoCache:bo,useCacheRefresh:bo};Ls.useEffectEvent=bo;var Rs={readContext:ea,use:Mo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:ea,useEffect:cs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),os(4194308,4,ms.bind(null,t,e),n)},useLayoutEffect:function(e,t){return os(4194308,4,e,t)},useInsertionEffect:function(e,t){os(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=t===void 0?null:t;var r=e();if(mo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(n!==void 0){var i=n(t);if(mo){ze(!0);try{n(t)}finally{ze(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=As.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:function(e){e=Wo(e);var t=e.queue,n=js.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(e,t){return ys(Oo(),e,t)},useTransition:function(){var e=Wo(!1);return e=xs.bind(null,H,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=H,i=Oo();if(z){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Rl===null)throw Error(a(349));Y&127||zo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,cs(Vo.bind(null,r,o,e),[e]),r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=Rl.identifierPrefix;if(z){var n=Ei,r=Ti;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ho++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[ot]=t,o[st]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return K(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=de.current,Bi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Mi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Li(t,!0)}else e=Bd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return K(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Bi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[ot]=t}else Vi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;K(t),e=!1}else n=Hi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(oo(t),t):(oo(t),null);if(t.flags&128)throw Error(a(558))}return K(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Bi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[ot]=t}else Vi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;K(t),i=!1}else i=Hi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(oo(t),t):(oo(t),null)}return oo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),G(t,t.updateQueue),K(t),null);case 4:return me(),e===null&&xd(t.stateNode.containerInfo),K(t),null;case 10:return Ji(t.type),K(t),null;case 19:if(le(so),r=t.memoizedState,r===null)return K(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)Fc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=co(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,G(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return j(so,so.current&1|2),z&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&P()>eu&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304)}}else{if(!i){if(e=co(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,G(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!z)return K(t),null}else 2*P()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(K(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=P(),e.sibling=null,n=so.current,j(so,i?n&1|2:n&1),z&&Di(t,r.treeForkCount),e);case 22:case 23:return oo(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(K(t),t.subtreeFlags&6&&(t.flags|=8192)):K(t),n=t.updateQueue,n!==null&&G(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&le(_a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ji(oa),K(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Lc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ji(oa),me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ge(t),null;case 31:if(t.memoizedState!==null){if(oo(t),t.alternate===null)throw Error(a(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(so),null;case 4:return me(),null;case 10:return Ji(t.type),null;case 22:case 23:return oo(t),to(),e!==null&&le(_a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ji(oa),null;case 25:return null;default:return null}}function Rc(e,t){switch(Ai(t),t.tag){case 3:Ji(oa),me();break;case 26:case 27:case 5:ge(t);break;case 4:me();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:le(so);break;case 10:Ji(t.type);break;case 22:case 23:oo(t),to(),e!==null&&le(_a);break;case 24:Ji(oa)}}function zc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Q(t,t.return,e)}}function Bc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){Q(e,e.return,t)}}}function Hc(e,t,n){n.props=Gs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function Uc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Q(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Q(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Q(e,t,n)}else n.current=null}}function Gc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Q(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[st]=t}catch(t){Q(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[ot]=e,t[st]=n}catch(t){Q(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Rd=sp,e=Er(e),Dr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[ot]=e,R(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=wr(s,h),v=wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,k.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,q&6)throw Error(a(331));var c=q;if(q|=4,Nl(o.current),Tl(o,o.current,s,n),q=c,rd(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,o)}catch{}return!0}finally{A.p=i,k.T=r,Bu(e,t)}}function Uu(e,t,n){t=_i(n,t),t=Zs(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Xe(e,2),nd(e))}function Q(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=_i(n,e),n=Qs(2),r=Ua(t,n,2),r!==null&&($s(n,r,t,e),Xe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>P()-Ql?!(q&2)&&xu(e,0):ql|=n,Yl===Y&&(Yl=0)),nd(e)}function Ku(e,t){t===0&&(t=Ye()),e=ni(e,t),e!==null&&(Xe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return Te(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Y,a=qe(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,cd(r,a))}r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=P(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}ru!==0&&ru!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Lt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),R(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),R(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Lt(r)+`"][href="`+Lt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),R(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=vt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);R(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),R(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),R(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=de.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=vt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=vt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=vt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Lt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),R(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Lt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Lt(n.href)+`"]`);if(r)return t.instance=r,R(r),r;var i=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),R(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,R(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),R(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,R(i),i):(r=n,(i=mf.get(o))&&(r=p({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),R(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,R(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),R(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=bo()}))(),1),W=i(),So=(0,B.createContext)(void 0);function Co(e,t){try{let t=localStorage.getItem(e);if(t===`light`||t===`dark`||t===`system`)return t}catch{}return t}function wo(e){let t=(0,W.c)(14),{children:n,defaultTheme:r,storageKey:i}=e,a=r===void 0?`dark`:r,o=i===void 0?`ui-theme`:i,s;t[0]!==a||t[1]!==o?(s=()=>Co(o,a),t[0]=a,t[1]=o,t[2]=s):s=t[2];let[c,l]=(0,B.useState)(s),u,d;t[3]===c?(u=t[4],d=t[5]):(u=()=>{let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),c===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(c)},d=[c],t[3]=c,t[4]=u,t[5]=d),(0,B.useEffect)(u,d);let f;t[6]===o?f=t[7]:(f=e=>{try{localStorage.setItem(o,e)}catch{}l(e)},t[6]=o,t[7]=f);let p;t[8]!==f||t[9]!==c?(p={theme:c,setTheme:f},t[8]=f,t[9]=c,t[10]=p):p=t[10];let m=p,h;return t[11]!==n||t[12]!==m?(h=(0,V.jsx)(So.Provider,{value:m,children:n}),t[11]=n,t[12]=m,t[13]=h):h=t[13],h}function To(){let e=(0,B.useContext)(So);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}var Eo=L(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Do=L(`book-open`,[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]),Oo=L(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),ko=L(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Ao=L(`container`,[[`path`,{d:`M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z`,key:`1t2lqe`}],[`path`,{d:`M10 21.9V14L2.1 9.1`,key:`o7czzq`}],[`path`,{d:`m10 14 11.9-6.9`,key:`zm5e20`}],[`path`,{d:`M14 19.8v-8.1`,key:`159ecu`}],[`path`,{d:`M18 17.5V9.4`,key:`11uown`}]]),jo=L(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),Mo=L(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),No=L(`file-stack`,[[`path`,{d:`M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1`,key:`likhh7`}],[`path`,{d:`M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1`,key:`17ky3x`}],[`path`,{d:`M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z`,key:`1hyeo0`}]]),Po=L(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Fo=L(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Io=L(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Lo=L(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Ro=L(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),zo=L(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),Bo=L(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Vo=L(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),Ho=L(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Uo=L(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),Wo=L(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Go=L(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Ko=L(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),qo=L(`users-round`,[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]]),Jo=L(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);function Yo(e,t){return t!=null&&!$t(t)?0:typeof e==`function`?e():e}function Xo(e,t,n){let r=Yo(e,n);return typeof r==`number`?r:r?.[t]}function Zo(e){return typeof e==`function`?e():e}function Qo(e,t){return t||e===`click`||e===`mousedown`}function $o(e){return e?.includes(`mouse`)&&e!==`mousedown`}var es=B.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Pt,currentIdRef:{current:null},currentContextRef:{current:null}});function ts(e,t){e.current=t.current}function ns(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=B.useRef(n),a=B.useRef(n),o=B.useRef(null),s=B.useRef(null),c=Ht();return mt(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:Xo(i.current,`open`),close:Xo(n,`close`)}},[n,o,i,a]),(0,V.jsx)(es.Provider,{value:B.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function rs(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=B.useContext(es),[f,p]=B.useState(!1),m=B.useRef(n);return mt(()=>{m.current=n},[n]),mt(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),mt(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Xo(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Tt(yt))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),mt(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,ts(o,c),d.clear()}},[l,a,o,i,c,d]),B.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function is(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function as(e){return e!=null&&e.clientX!=null}function os(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=B.useRef(!1),u=B.useRef(null),[d,f]=B.useState(),[p,m]=B.useState([]),h=ht(e=>{i.set(`positionReference`,e)}),g=ht((e,t,n)=>{l.current||c.current.openEvent&&!as(c.current.openEvent)||i.set(`positionReference`,is(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=ht(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=$t(d)?o:a;B.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=dt(o);function r(t){let n=R(t);Ot(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||as(c.current.openEvent)?u.current=Ie(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),B.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),B.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),B.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=B.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return B.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}var ss=Ae();function cs(e){let t=B.useCallback(t=>e===void 0?Ue:e.subscribeStore(t),[e]),n=B.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,ss.useSyncExternalStore)(t,n,()=>e?.serverStore)}var ls=Wt&&rn;function us(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=B.useRef(!1),c=B.useRef(null),l=B.useRef(!0),u=Ht();B.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=dt(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&ft(e)&&e===Et(vt(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return Bt(Ie(t,`blur`,r),ls&&Ie(t,`keydown`,a,!0),ls&&Ie(t,`pointerdown`,o,!0))},[i,n]),B.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);_t(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=B.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=R(t.nativeEvent);if(_t(a)){if(ls&&!t.relatedTarget){if(!l.current&&!Kt(a))return}else if(!qt(a))return}let o=Zt(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,Tt(Ct,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,Tt(Ct,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=_t(n)&&n.hasAttribute(At(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=Et(vt(e));!n&&t===e||Ot(o.current.floatingContext?.refs.floating.current,t)||Ot(e,t)||a||Zt(n??t,i.context.triggerElements)||i.setOpen(!1,Tt(Ct,r))})}}},[o,r,i,u]);return B.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var ds=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Pt,this.restTimeout=new Pt,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},fs=new WeakMap;function ps(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&fs.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),fs.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function ms(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=fs.get(n);a&&a!==e&&ps(a),ps(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,fs.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function hs(e){let t=e.context.dataRef.current,n=Ve(()=>t.hoverInteractionState??ds.create()).current;return t.hoverInteractionState||=n,Pe(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function gs(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=It(),d=Ft(),f=hs(a),p=Ht(),m=ht(()=>Qo(l.current.openEvent?.type,f.interactedInside)),h=ht(()=>$o(l.current.openEvent?.type)),g=ht(()=>{ps(f)});mt(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),B.useEffect(()=>g,[g]),mt(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&_t(c)&&s){let e=c,t=s,n=vt(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return ms(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),B.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&en(u.nodesRef.current,d).length>0)}function t(e){let t=Xo(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,Tt(xt,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=R(e);if(!Gt(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Zt(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&_t(o)&&en(u.nodesRef.current,r,!1).some(e=>Ot(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,Tt(xt,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Bt(y&&Ie(y,`mouseenter`,c),y&&Ie(y,`mouseleave`,_),y&&Ie(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var _s=e(Fe(),1),vs={current:null};function ys(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=vs,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=It(l),y=hs(h),b=B.useRef(!1),x=Re(i),S=Re(r),C=Re(o),w=Re(n),T=Re(p),E=Re(f),ee=ht(()=>Qo(g.current.openEvent?.type,y.interactedInside)),D=ht(()=>T.current?.()!==!1),te=ht((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!Ot(e,t);if(!_t(n))return!1;let i=n;return r.hasMatchingElement(e=>Ot(e,i))&&(!e||!Ot(e,i))}),O=ht(()=>{y.handler&&=(vt(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),ne=ht(()=>{ps(y)});return u&&(y.handleCloseOptions=x.current?.__options),B.useEffect(()=>O,[O]),B.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===xt,O(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,O]),B.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Xo(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,Tt(xt,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,Tt(xt,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!_t(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!$t(y.pointerType))return;let t=Zo(C.current),n=Xo(S.current,`open`,y.pointerType),r=R(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(_t(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(Ot(e,r)){s=e;break}}_t(i)&&_t(o)&&!h.context.triggerElements.hasElement(i)&&Ot(i,o)&&(s=o);let c=s!=null&&te(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&_t(s)&&_t(o)&&Ot(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){D()&&h.setOpen(!0,Tt(xt,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&D()&&h.setOpen(!0,Tt(xt,e,s))}):g&&D()&&h.setOpen(!0,Tt(xt,e,s)))}function i(t){if(ee()){ne();return}O();let n=h.select(`domReferenceElement`),r=vt(n);y.restTimeout.clear(),y.restTimeoutPending=!1;let i=g.current.floatingContext??d?.();if(!Zt(t.relatedTarget,h.context.triggerElements)){if(x.current&&i){h.select(`open`)||y.openChangeTimeout.clear();let n=c.current;y.handler=x.current({...i,tree:v,x:t.clientX,y:t.clientY,onClose(){ne(),O(),w.current&&!ee()&&n===h.select(`domReferenceElement`)&&e(t,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!Ot(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){Ot(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?Ie(t,`mouseout`,o):void 0;return s?Bt(Ie(t,`mousemove`,r,{once:!0}),Ie(t,`mouseenter`,r),Ie(t,`mouseleave`,i),l):Bt(Ie(t,`mouseenter`,r),Ie(t,`mouseleave`,i),l)},[O,ne,g,S,h,n,x,y,u,te,ee,a,s,C,c,v,w,d,E,D,m]),B.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=te(r,n,e.target);if(a&&!$t(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;ms(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Zo(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,ee())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&D()&&h.setOpen(!0,Tt(xt,t,n))}y.pointerType===`touch`?_s.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,ee,te,a,h,C,D])}var bs=.1,xs=bs*bs,Ss=.5;function Cs(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function ws(e,t,n,r,i,a,o,s,c,l){let u=!1;return Cs(e,t,n,r,i,a)&&(u=!u),Cs(e,t,i,a,o,s)&&(u=!u),Cs(e,t,o,s,c,l)&&(u=!u),Cs(e,t,c,l,n,r)&&(u=!u),u}function Ts(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Es(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Ds(e={}){let{blockPointerEvents:t=!1}=e,n=new Pt,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*xs;return u=e,d=t,f=n,o0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,ee=(T?x:S).left,D=(T?x:S).right,te=(E?x:S).top,O=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let ne=!1;switch(c){case`top`:ne=Es(d,f,ee,x.top+1,D,S.bottom-1);break;case`bottom`:ne=Es(d,f,ee,S.top+1,D,x.bottom-1);break;case`left`:ne=Es(d,f,S.right-1,O,x.left+1,te);break;case`right`:ne=Es(d,f,x.right-1,O,S.left+1,te)}if(ne)return;if(l&&!Ts(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let re=!1;switch(c){case`top`:{let n=T?Ss/2:Ss*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Ss+1,o=C||T?S.bottom-Ss:S.top,s=C?T?S.bottom-Ss:S.top:S.bottom-Ss;re=ws(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Ss/2:Ss*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Ss,o=C||T?S.top+Ss:S.bottom,s=C?T?S.top+Ss:S.bottom:S.top+Ss;re=ws(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Ss/2:Ss*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Ss+1,o=w||E?S.right-Ss:S.left,s=w?E?S.right-Ss:S.left:S.right-Ss;re=ws(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Ss/2:Ss*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Ss,o=w||E?S.left+Ss:S.right,s=w?E?S.left+Ss:S.right:S.left+Ss;re=ws(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}re?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Os(e){return gn(`dialog`,e)}function ks(e){let t=(0,W.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,V.jsx)(Os,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function As(e){let t=(0,W.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,V.jsx)(vn,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function js(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`data-closed:fade-out-0 data-open:fade-in-0 data-closed:animate-out data-open:animate-in fixed inset-0 z-50 bg-black/80 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(xn,{className:i,"data-slot":`sheet-overlay`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ms(e){let t=(0,W.c)(17),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,side:a,showCloseButton:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`right`:a,c=o===void 0||o,l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(js,{}),t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=F(`data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-closed:animate-out data-open:animate-in fixed z-50 flex flex-col bg-background bg-clip-padding text-xs/relaxed shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,r),t[7]=r,t[8]=u);let d;t[9]===c?d=t[10]:(d=c&&(0,V.jsxs)(hn,{"data-slot":`sheet-close`,render:(0,V.jsx)(gt,{className:`absolute top-4 right-4`,size:`icon-sm`,variant:`ghost`}),children:[(0,V.jsx)(lt,{}),(0,V.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[9]=c,t[10]=d);let f;return t[11]!==n||t[12]!==i||t[13]!==s||t[14]!==u||t[15]!==d?(f=(0,V.jsxs)(As,{children:[l,(0,V.jsxs)(mn,{className:u,"data-side":s,"data-slot":`sheet-content`,...i,children:[n,d]})]}),t[11]=n,t[12]=i,t[13]=s,t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function Ns(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex flex-col gap-1.5 p-6`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`div`,{className:i,"data-slot":`sheet-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ps(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`text-sm font-medium text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(bn,{className:i,"data-slot":`sheet-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Fs(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`text-xs/relaxed text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(pn,{className:i,"data-slot":`sheet-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Is=B.createContext(void 0);function Ls(e){let t=B.useContext(Is);if(t===void 0&&!e)throw Error(Ge(72));return t}var Rs={...yn,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},zs=class extends jt{constructor(e,t,n){let r=new tn;super(Bs(e,r,t,n),Vs(r),Rs)}setOpen=(e,t)=>{Jt(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Tt(bt,e))}};function Bs(e,t,n,r=!1){let i={...fn(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return i.floatingRootContext=_n(t,n,r),i}function Vs(e){return{popupRef:B.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Hs=Lt(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=zt((e,t)=>new zs({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),sn(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=Ut(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=B.useRef(null);mt(()=>{m&&t&&p.setOpen(!1,Tt(St))},[m,t,p]),mt(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),mt(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),B.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,Tt(wt))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,V.jsxs)(Is.Provider,{value:p,children:[l&&(0,V.jsx)(Yt,{handle:l,store:p}),T&&(0,V.jsx)(Us,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function Us({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=kt(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=os(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=B.useMemo(()=>Be(a.reference,i.reference),[a.reference,i.reference]);return on(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??ze}),null}var Ws=B.createContext(void 0);function Gs(){return B.useContext(Ws)}var Ks=`data-base-ui-tooltip-trigger`;function qs(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;em.select(`transitionStatus`)===`ending`,shouldOpen(){return!k.current}}),j=us(v,{enabled:!O}).reference,ue=e=>{let t=k.current,n=qs(e),r=ce(n),i=y.current,a=i&&n&&Ot(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,Tt(xt,e));return}if(t&&!r&&a&&!ne.current&&!m.select(`open`)&&i&&$t(ae.current)){let t=()=>{!k.current&&!ne.current&&!m.select(`open`)&&m.setOpen(!0,Tt(xt,e,i))},n=oe();n===0?(A.clear(),t()):A.start(n,t)}},M=m.useState(`triggerProps`,C);return He(`button`,e,{state:{open:_},ref:[t,S,y],props:[le,j,C||re!==`none`?M:void 0,{onMouseOver(e){ue(e.nativeEvent)},onFocus(e){se(qs(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){k.current=!1,A.clear(),ae.current=void 0},onPointerEnter(e){ae.current=e.pointerType},onPointerDown(e){ae.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,"data-trigger-disabled":O?``:void 0,[Ks]:O?void 0:``},f],stateAttributesMapping:nn})}),Xs=B.createContext(void 0);function Zs(){let e=B.useContext(Xs);if(e===void 0)throw Error(Ge(70));return e}var Qs=B.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Mt({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,V.jsxs)(B.Fragment,{children:[l,c&&_s.createPortal(n,c)]})}),$s=B.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Ls().useState(`mounted`)||n?(0,V.jsx)(Xs.Provider,{value:n,children:(0,V.jsx)(Qs,{ref:t,...r})}):null}),ec=B.createContext(void 0);function tc(){let e=B.useContext(ec);if(e===void 0)throw Error(Ge(71));return e}var nc=B.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Rt,style:g,..._}=e,v=Ls(),y=Zs(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),ee=v.useState(`adaptiveOrigin`),D=ln({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:ee}),te=B.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),O=un(e,te,{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,V.jsx)(ec.Provider,{value:D,children:O})}),rc=B.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Ls(),{side:s,align:c}=tc(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Le({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),gs(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return He(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Qt,f,cn(d),a],stateAttributesMapping:Nt})}),ic=B.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Ls(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=tc(),f={open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)};return He(`div`,e,{state:f,ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Vt})}),ac=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=B.useMemo(()=>({open:t,close:n}),[t,n]);return(0,V.jsx)(Ws.Provider,{value:t,children:(0,V.jsx)(ns,{delay:i,timeoutMs:r,children:e.children})})};function oc(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delay:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,V.jsx)(ac,{"data-slot":`tooltip-provider`,delay:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function sc(e){let t=(0,W.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,V.jsx)(oc,{children:(0,V.jsx)(Hs,{"data-slot":`tooltip`,...n})}),t[2]=n,t[3]=r),r}function cc(e){let t=(0,W.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,V.jsx)(Ys,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function lc(e){let t=(0,W.c)(21),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,side:a,sideOffset:o,align:s,alignOffset:c,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`top`:a,u=o===void 0?4:o,d=s===void 0?`center`:s,f=c===void 0?0:c,p;t[8]===r?p=t[9]:(p=F(`data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-closed:animate-out data-open:animate-in z-50 w-fit max-w-xs origin-(--transform-origin) rounded-md bg-foreground px-3 py-1.5 text-xs text-background **:data-[slot=kbd]:rounded-md`,r),t[8]=r,t[9]=p);let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,V.jsx)(ic,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`}),t[10]=m):m=t[10];let h;t[11]!==n||t[12]!==i||t[13]!==p?(h=(0,V.jsxs)(rc,{className:p,"data-slot":`tooltip-content`,...i,children:[n,m]}),t[11]=n,t[12]=i,t[13]=p,t[14]=h):h=t[14];let g;return t[15]!==d||t[16]!==f||t[17]!==l||t[18]!==u||t[19]!==h?(g=(0,V.jsx)($s,{children:(0,V.jsx)(nc,{align:d,alignOffset:f,className:`isolate z-50`,side:l,sideOffset:u,children:h})}),t[15]=d,t[16]=f,t[17]=l,t[18]=u,t[19]=h,t[20]=g):g=t[20],g}var uc=window.matchMedia(`(max-width: 767px)`);function dc(e){return uc.addEventListener(`change`,e),()=>uc.removeEventListener(`change`,e)}function fc(){return uc.matches}function pc(){return(0,B.useSyncExternalStore)(dc,fc)}var mc=`sidebar_state`,hc=604800,gc=`12rem`,_c=`16rem`,vc=`3rem`,yc=`b`,bc=B.createContext(null);function xc(){let e=B.useContext(bc);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Sc(e){let t=(0,W.c)(36),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0||c,u=pc(),[d,f]=B.useState(!1),[p,m]=B.useState(l),h=i??p,g;t[8]!==h||t[9]!==o?(g=e=>{let t=typeof e==`function`?e(h):e;o?o(t):m(t),document.cookie=`${mc}=${t}; path=/; max-age=${hc}`},t[8]=h,t[9]=o,t[10]=g):g=t[10];let _=g,v;t[11]!==u||t[12]!==_?(v=()=>u?f(wc):_(Cc),t[11]=u,t[12]=_,t[13]=v):v=t[13];let y=v,b,x;t[14]===y?(b=t[15],x=t[16]):(b=()=>{let e=e=>{e.key===yc&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),y())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},x=[y],t[14]=y,t[15]=b,t[16]=x),B.useEffect(b,x);let S=h?`expanded`:`collapsed`,C;t[17]!==u||t[18]!==h||t[19]!==d||t[20]!==_||t[21]!==S||t[22]!==y?(C={state:S,open:h,setOpen:_,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:y},t[17]=u,t[18]=h,t[19]=d,t[20]=_,t[21]=S,t[22]=y,t[23]=C):C=t[23];let w=C,T;t[24]===s?T=t[25]:(T={"--sidebar-width":gc,"--sidebar-width-icon":vc,...s},t[24]=s,t[25]=T);let E=T,ee;t[26]===r?ee=t[27]:(ee=F(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[26]=r,t[27]=ee);let D;t[28]!==n||t[29]!==a||t[30]!==ee||t[31]!==E?(D=(0,V.jsx)(`div`,{className:ee,"data-slot":`sidebar-wrapper`,style:E,...a,children:n}),t[28]=n,t[29]=a,t[30]=ee,t[31]=E,t[32]=D):D=t[32];let te;return t[33]!==w||t[34]!==D?(te=(0,V.jsx)(bc.Provider,{value:w,children:D}),t[33]=w,t[34]=D,t[35]=te):te=t[35],te}function Cc(e){return!e}function wc(e){return!e}function Tc(e){let t=(0,W.c)(46),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({side:a,variant:o,collapsible:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`left`:a,l=o===void 0?`sidebar`:o,u=s===void 0?`offExamples`:s,{isMobile:d,state:f,openMobile:p,setOpenMobile:m}=xc();if(u===`none`){let e;t[7]===r?e=t[8]:(e=F(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[7]=r,t[8]=e);let a;return t[9]!==n||t[10]!==i||t[11]!==e?(a=(0,V.jsx)(`div`,{className:e,"data-slot":`sidebar`,...i,children:n}),t[9]=n,t[10]=i,t[11]=e,t[12]=a):a=t[12],a}if(d){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e={"--sidebar-width":_c},t[13]=e):e=t[13];let r=e,a;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsxs)(Ns,{className:`sr-only`,children:[(0,V.jsx)(Ps,{children:`Sidebar`}),(0,V.jsx)(Fs,{children:`Displays the mobile sidebar.`})]}),t[14]=a):a=t[14];let o;t[15]===n?o=t[16]:(o=(0,V.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:n}),t[15]=n,t[16]=o);let s;t[17]!==c||t[18]!==o?(s=(0,V.jsxs)(Ms,{className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,"data-mobile":`true`,"data-sidebar":`sidebar`,"data-slot":`sidebar`,side:c,style:r,children:[a,o]}),t[17]=c,t[18]=o,t[19]=s):s=t[19];let l;return t[20]!==p||t[21]!==i||t[22]!==m||t[23]!==s?(l=(0,V.jsx)(ks,{onOpenChange:m,open:p,...i,children:s}),t[20]=p,t[21]=i,t[22]=m,t[23]=s,t[24]=l):l=t[24],l}let h=f===`collapsed`?u:``,g=l===`floating`||l===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,_;t[25]===g?_=t[26]:(_=F(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offExamples]:w-0`,`group-data-[side=right]:rotate-180`,g),t[25]=g,t[26]=_);let v;t[27]===_?v=t[28]:(v=(0,V.jsx)(`div`,{className:_,"data-slot":`sidebar-gap`}),t[27]=_,t[28]=v);let y=c===`left`?`left-0 group-data-[collapsible=offExamples]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offExamples]:right-[calc(var(--sidebar-width)*-1)]`,b=l===`floating`||l===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,x;t[29]!==r||t[30]!==y||t[31]!==b?(x=F(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,y,b,r),t[29]=r,t[30]=y,t[31]=b,t[32]=x):x=t[32];let S;t[33]===n?S=t[34]:(S=(0,V.jsx)(`div`,{className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,children:n}),t[33]=n,t[34]=S);let C;t[35]!==i||t[36]!==x||t[37]!==S?(C=(0,V.jsx)(`div`,{className:x,"data-slot":`sidebar-container`,...i,children:S}),t[35]=i,t[36]=x,t[37]=S,t[38]=C):C=t[38];let w;return t[39]!==c||t[40]!==f||t[41]!==C||t[42]!==h||t[43]!==v||t[44]!==l?(w=(0,V.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-collapsible":h,"data-side":c,"data-slot":`sidebar`,"data-state":f,"data-variant":l,children:[v,C]}),t[39]=c,t[40]=f,t[41]=C,t[42]=h,t[43]=v,t[44]=l,t[45]=w):w=t[45],w}function Ec(e){let t=(0,W.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a}=xc(),o;t[4]===n?o=t[5]:(o=F(n),t[4]=n,t[5]=o);let s;t[6]!==r||t[7]!==a?(s=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=s):s=t[8];let c,l;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(Ho,{}),l=(0,V.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),t[9]=c,t[10]=l):(c=t[9],l=t[10]);let u;return t[11]!==i||t[12]!==o||t[13]!==s?(u=(0,V.jsxs)(gt,{className:o,"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,onClick:s,size:`icon-lg`,variant:`ghost`,...i,children:[c,l]}),t[11]=i,t[12]=o,t[13]=s,t[14]=u):u=t[14],u}function Dc(e){let t=(0,W.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{toggleSidebar:i}=xc(),a;t[3]===n?a=t[4]:(a=F(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offExamples]:translate-x-0 group-data-[collapsible=offExamples]:after:left-full hover:group-data-[collapsible=offExamples]:bg-sidebar`,`[[data-side=left][data-collapsible=offExamples]_&]:-right-2`,`[[data-side=right][data-collapsible=offExamples]_&]:-left-2`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a||t[7]!==i?(o=(0,V.jsx)(`button`,{"aria-label":`Toggle Sidebar`,className:a,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,onClick:i,tabIndex:-1,title:`Toggle Sidebar`,type:`button`,...r}),t[5]=r,t[6]=a,t[7]=i,t[8]=o):o=t[8],o}function Oc(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`div`,{className:i,"data-sidebar":`header`,"data-slot":`sidebar-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function kc(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`div`,{className:i,"data-sidebar":`footer`,"data-slot":`sidebar-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ac(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`mx-2 w-auto bg-sidebar-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(dn,{className:i,"data-sidebar":`separator`,"data-slot":`sidebar-separator`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function jc(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto`,`group-data-[collapsible=icon]:[scrollbar-width:none] group-data-[collapsible=icon]:[&::-webkit-scrollbar]:hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`div`,{className:i,"data-sidebar":`content`,"data-slot":`sidebar-content`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Mc(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`relative flex w-full min-w-0 flex-col px-2 py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`div`,{className:i,"data-sidebar":`group`,"data-slot":`sidebar-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nc(e){let t=(0,W.c)(10),n,r,i,a;if(t[0]!==e){let{className:o,render:s,...c}=e;n=s,a=Ke,r=`div`,i=Be({className:F(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,o)},c),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a}else n=t[1],r=t[2],i=t[3],a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o={slot:`sidebar-group-label`,sidebar:`group-label`},t[5]=o):o=t[5];let s;return t[6]!==n||t[7]!==r||t[8]!==i?(s={defaultTagName:r,props:i,render:n,state:o},t[6]=n,t[7]=r,t[8]=i,t[9]=s):s=t[9],a(s)}function Pc(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex w-full min-w-0 flex-col gap-px`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`ul`,{className:i,"data-sidebar":`menu`,"data-slot":`sidebar-menu`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function G(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`li`,{className:i,"data-sidebar":`menu-item`,"data-slot":`sidebar-menu-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Fc=We(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-xs`,sm:`h-7 text-xs`,lg:`h-12 text-xs group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function K(e){let t=(0,W.c)(15),{render:n,isActive:r,variant:i,size:a,tooltip:o,className:s,...c}=e,l=r!==void 0&&r,u=i===void 0?`default`:i,d=a===void 0?`default`:a,{isMobile:f,state:p}=xc(),m=Be({className:F(Fc({variant:u,size:d}),s)},c),h=o?cc:n,g;t[0]!==l||t[1]!==d?(g={slot:`sidebar-menu-button`,sidebar:`menu-button`,size:d,active:l},t[0]=l,t[1]=d,t[2]=g):g=t[2];let _;t[3]!==m||t[4]!==h||t[5]!==g?(_={defaultTagName:`button`,props:m,render:h,state:g},t[3]=m,t[4]=h,t[5]=g,t[6]=_):_=t[6];let v=Ke(_);if(!o)return v;let y;t[7]===o?y=t[8]:(y=typeof o==`string`?{children:o}:o,t[7]=o,t[8]=y);let b=y,x=p!==`collapsed`||f,S;t[9]!==x||t[10]!==b?(S=(0,V.jsx)(lc,{align:`center`,hidden:x,side:`right`,...b}),t[9]=x,t[10]=b,t[11]=S):S=t[11];let C;return t[12]!==v||t[13]!==S?(C=(0,V.jsxs)(sc,{children:[v,S]}),t[12]=v,t[13]=S,t[14]=C):C=t[14],C}var Ic=new Set([`InvalidClientTokenId`,`SignatureDoesNotMatch`,`AuthFailure`,`MissingAuthenticationToken`,`IncompleteSignature`,`UnrecognizedClientException`,`ExpiredToken`,`ExpiredTokenException`,`InvalidAccessKeyId`]);function Lc(e){return typeof e==`object`&&!!e&&`name`in e&&typeof e.name==`string`}function Rc(e){return Lc(e)&&Ic.has(e.name)}var zc=!1;function Bc(e,t){zc||!Rc(e)||(zc=!0,Je(),Sn(),t.clear(),window.location.pathname!==`/login`&&(window.location.href=`/login?reason=expired`))}function Vc(){let e=new Kr({queryCache:new Gr({onError:t=>Bc(t,e)}),mutationCache:new Ur({onError:t=>Bc(t,e)}),defaultOptions:{queries:{staleTime:5e3,refetchIntervalInBackground:!1}}});return e}function Hc(){let e=(0,W.c)(8),{theme:t,setTheme:n}=To(),r;e[0]!==n||e[1]!==t?(r=()=>{n(t===`light`?`dark`:t===`dark`?`light`:`dark`)},e[0]=n,e[1]=t,e[2]=r):r=e[2];let i=r,a,o,s;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(Go,{className:`size-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90`}),o=(0,V.jsx)(Bo,{className:`absolute size-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0`}),s=(0,V.jsx)(`span`,{className:`sr-only`,children:`Toggle theme`}),e[3]=a,e[4]=o,e[5]=s):(a=e[3],o=e[4],s=e[5]);let c;return e[6]===i?c=e[7]:(c=(0,V.jsxs)(gt,{className:`rounded-full`,onClick:i,size:`icon-sm`,variant:`ghost`,children:[a,o,s]}),e[6]=i,e[7]=c),c}function Uc(){let e=(0,W.c)(7),{isAdmin:t,license:n}=Cn(),r=t&&n===`open-source`,i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=F(`z-50 flex h-10 shrink-0 items-center gap-2 border-b border-sidebar-border bg-sidebar px-4 text-sidebar-foreground`,`sticky top-0`),a=(0,V.jsx)(Ec,{className:`-ml-1`}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let o;e[2]===r?o=e[3]:(o=r&&(0,V.jsx)(`a`,{href:`https://mulgadc.com/purchase`,target:`_blank`,rel:`noopener noreferrer`,className:F(pt({variant:`outline`,size:`sm`})),children:`Upgrade`}),e[2]=r,e[3]=o);let s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(Hc,{}),e[4]=s):s=e[4];let c;return e[5]===o?c=e[6]:(c=(0,V.jsxs)(`header`,{className:i,children:[a,(0,V.jsxs)(`div`,{className:`flex w-full items-center justify-end gap-2`,children:[o,s]})]}),e[5]=o,e[6]=c),c}function Wc(){let e=(0,W.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`h1`,{className:`text-4xl font-bold`,children:`404`}),n=(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:`Page not found`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,V.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-4`,children:[t,n,(0,V.jsx)(M,{to:`/`,children:(0,V.jsx)(gt,{variant:`outline`,children:`Go back home`})})]}),e[2]=r):r=e[2],r}function Gc(){let e=(0,W.c)(255),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={select:Kc},e[0]=t):t=e[0];let n=uo(t),r=Ne(),i=h(),{isAdmin:a}=Cn(),o;e[1]!==r||e[2]!==i?(o=function(){Je(),Sn(),i.clear(),r({to:`/login`})},e[1]=r,e[2]=i,e[3]=o):o=e[3];let s=o,c;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsxs)(Oc,{className:`flex flex-row items-center gap-2 px-4 py-3`,children:[(0,V.jsx)(`img`,{src:`/mulga-logo.svg`,alt:`Mulga`,className:`size-6 shrink-0 dark:invert`}),(0,V.jsx)(`span`,{className:`truncate text-sm font-semibold group-data-[collapsible=icon]:hidden`,children:`Spinifex`})]}),e[4]=c):c=e[4];let l;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(Nc,{children:`General`}),e[5]=l):l=e[5];let u=n===`/`,d,f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,V.jsx)(Po,{className:`size-4`}),f=(0,V.jsx)(`span`,{children:`Dashboard`}),e[6]=d,e[7]=f):(d=e[6],f=e[7]);let p;e[8]===u?p=e[9]:(p=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/`,children:(0,V.jsxs)(K,{isActive:u,tooltip:`Dashboard`,children:[d,f]})})}),e[8]=u,e[9]=p);let m;e[10]!==a||e[11]!==n?(m=a&&(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/nodes`,children:(0,V.jsxs)(K,{isActive:n.startsWith(`/nodes`),tooltip:`Nodes`,children:[(0,V.jsx)(nt,{className:`size-4`}),(0,V.jsx)(`span`,{children:`Nodes`})]})})}),e[10]=a,e[11]=n,e[12]=m):m=e[12];let g;e[13]!==p||e[14]!==m?(g=(0,V.jsxs)(Mc,{children:[l,(0,V.jsxs)(Pc,{children:[p,m]})]}),e[13]=p,e[14]=m,e[15]=g):g=e[15];let _;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,V.jsx)(Nc,{children:`EC2`}),e[16]=_):_=e[16];let v;e[17]===n?v=e[18]:(v=n.startsWith(`/ec2/describe-instances`)||n.startsWith(`/ec2/run-instances`),e[17]=n,e[18]=v);let y,b;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,V.jsx)(nt,{className:`size-4`}),b=(0,V.jsx)(`span`,{children:`Instances`}),e[19]=y,e[20]=b):(y=e[19],b=e[20]);let x;e[21]===v?x=e[22]:(x=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-instances`,children:(0,V.jsxs)(K,{isActive:v,tooltip:`Instances`,children:[y,b]})})}),e[21]=v,e[22]=x);let S;e[23]===n?S=e[24]:(S=n.startsWith(`/ec2/describe-launch-templates`)||n.startsWith(`/ec2/create-launch-template`),e[23]=n,e[24]=S);let C,w;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,V.jsx)(No,{className:`size-4`}),w=(0,V.jsx)(`span`,{children:`Launch Templates`}),e[25]=C,e[26]=w):(C=e[25],w=e[26]);let T;e[27]===S?T=e[28]:(T=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-launch-templates`,children:(0,V.jsxs)(K,{isActive:S,tooltip:`Launch Templates`,children:[C,w]})})}),e[27]=S,e[28]=T);let E;e[29]===n?E=e[30]:(E=n.startsWith(`/ec2/describe-images`),e[29]=n,e[30]=E);let ee,D;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,V.jsx)(at,{className:`size-4`}),D=(0,V.jsx)(`span`,{children:`Images`}),e[31]=ee,e[32]=D):(ee=e[31],D=e[32]);let te;e[33]===E?te=e[34]:(te=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-images`,children:(0,V.jsxs)(K,{isActive:E,tooltip:`Images`,children:[ee,D]})})}),e[33]=E,e[34]=te);let O;e[35]===n?O=e[36]:(O=n.startsWith(`/ec2/describe-key-pairs`),e[35]=n,e[36]=O);let ne,re;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,V.jsx)(tt,{className:`size-4`}),re=(0,V.jsx)(`span`,{children:`Key Pairs`}),e[37]=ne,e[38]=re):(ne=e[37],re=e[38]);let ie;e[39]===O?ie=e[40]:(ie=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-key-pairs`,children:(0,V.jsxs)(K,{isActive:O,tooltip:`Key Pairs`,children:[ne,re]})})}),e[39]=O,e[40]=ie);let k;e[41]===n?k=e[42]:(k=n.startsWith(`/ec2/describe-addresses`)||n.startsWith(`/ec2/allocate-address`),e[41]=n,e[42]=k);let A,ae;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,V.jsx)(zo,{className:`size-4`}),ae=(0,V.jsx)(`span`,{children:`Elastic IPs`}),e[43]=A,e[44]=ae):(A=e[43],ae=e[44]);let oe;e[45]===k?oe=e[46]:(oe=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-addresses`,children:(0,V.jsxs)(K,{isActive:k,tooltip:`Elastic IPs`,children:[A,ae]})})}),e[45]=k,e[46]=oe);let se;e[47]===n?se=e[48]:(se=n.startsWith(`/ec2/describe-volumes`)||n.startsWith(`/ec2/create-volume`)||n.startsWith(`/ec2/modify-volume`),e[47]=n,e[48]=se);let ce,le;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,V.jsx)(rt,{className:`size-4`}),le=(0,V.jsx)(`span`,{children:`Volumes`}),e[49]=ce,e[50]=le):(ce=e[49],le=e[50]);let j;e[51]===se?j=e[52]:(j=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-volumes`,children:(0,V.jsxs)(K,{isActive:se,tooltip:`Volumes`,children:[ce,le]})})}),e[51]=se,e[52]=j);let ue;e[53]===n?ue=e[54]:(ue=n.startsWith(`/ec2/describe-snapshots`)||n.startsWith(`/ec2/create-snapshot`),e[53]=n,e[54]=ue);let de,fe;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,V.jsx)(Xe,{className:`size-4`}),fe=(0,V.jsx)(`span`,{children:`Snapshots`}),e[55]=de,e[56]=fe):(de=e[55],fe=e[56]);let pe;e[57]===ue?pe=e[58]:(pe=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-snapshots`,children:(0,V.jsxs)(K,{isActive:ue,tooltip:`Snapshots`,children:[de,fe]})})}),e[57]=ue,e[58]=pe);let me;e[59]===n?me=e[60]:(me=n.startsWith(`/ec2/describe-placement-groups`)||n.startsWith(`/ec2/create-placement-group`),e[59]=n,e[60]=me);let he,ge;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,V.jsx)(Io,{className:`size-4`}),ge=(0,V.jsx)(`span`,{children:`Placement Groups`}),e[61]=he,e[62]=ge):(he=e[61],ge=e[62]);let _e;e[63]===me?_e=e[64]:(_e=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-placement-groups`,children:(0,V.jsxs)(K,{isActive:me,tooltip:`Placement Groups`,children:[he,ge]})})}),e[63]=me,e[64]=_e);let ve;e[65]===n?ve=e[66]:(ve=n.startsWith(`/ec2/describe-load-balancers`)||n.startsWith(`/ec2/create-load-balancer`),e[65]=n,e[66]=ve);let ye,be;e[67]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,V.jsx)(it,{className:`size-4`}),be=(0,V.jsx)(`span`,{children:`Load Balancers`}),e[67]=ye,e[68]=be):(ye=e[67],be=e[68]);let xe;e[69]===ve?xe=e[70]:(xe=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-load-balancers`,children:(0,V.jsxs)(K,{isActive:ve,tooltip:`Load Balancers`,children:[ye,be]})})}),e[69]=ve,e[70]=xe);let Se;e[71]===n?Se=e[72]:(Se=n.startsWith(`/ec2/describe-target-groups`)||n.startsWith(`/ec2/create-target-group`),e[71]=n,e[72]=Se);let Ce,we;e[73]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,V.jsx)(jo,{className:`size-4`}),we=(0,V.jsx)(`span`,{children:`Target Groups`}),e[73]=Ce,e[74]=we):(Ce=e[73],we=e[74]);let Te;e[75]===Se?Te=e[76]:(Te=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-target-groups`,children:(0,V.jsxs)(K,{isActive:Se,tooltip:`Target Groups`,children:[Ce,we]})})}),e[75]=Se,e[76]=Te);let Ee;e[77]!==x||e[78]!==T||e[79]!==te||e[80]!==ie||e[81]!==oe||e[82]!==j||e[83]!==pe||e[84]!==_e||e[85]!==xe||e[86]!==Te?(Ee=(0,V.jsxs)(Mc,{children:[_,(0,V.jsxs)(Pc,{children:[x,T,te,ie,oe,j,pe,_e,xe,Te]})]}),e[77]=x,e[78]=T,e[79]=te,e[80]=ie,e[81]=oe,e[82]=j,e[83]=pe,e[84]=_e,e[85]=xe,e[86]=Te,e[87]=Ee):Ee=e[87];let N;e[88]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,V.jsx)(Nc,{children:`Networking`}),e[88]=N):N=e[88];let De;e[89]===n?De=e[90]:(De=n.startsWith(`/ec2/describe-vpcs`)||n.startsWith(`/ec2/create-vpc`),e[89]=n,e[90]=De);let P,Oe;e[91]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,V.jsx)(Ze,{className:`size-4`}),Oe=(0,V.jsx)(`span`,{children:`VPCs`}),e[91]=P,e[92]=Oe):(P=e[91],Oe=e[92]);let ke;e[93]===De?ke=e[94]:(ke=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-vpcs`,children:(0,V.jsxs)(K,{isActive:De,tooltip:`VPCs`,children:[P,Oe]})})}),e[93]=De,e[94]=ke);let Ae;e[95]===n?Ae=e[96]:(Ae=n.startsWith(`/ec2/describe-subnets`)||n.startsWith(`/ec2/create-subnet`),e[95]=n,e[96]=Ae);let je,Me;e[97]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,V.jsx)(Lo,{className:`size-4`}),Me=(0,V.jsx)(`span`,{children:`Subnets`}),e[97]=je,e[98]=Me):(je=e[97],Me=e[98]);let Pe;e[99]===Ae?Pe=e[100]:(Pe=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-subnets`,children:(0,V.jsxs)(K,{isActive:Ae,tooltip:`Subnets`,children:[je,Me]})})}),e[99]=Ae,e[100]=Pe);let Fe;e[101]===n?Fe=e[102]:(Fe=n.startsWith(`/ec2/describe-security-groups`)||n.startsWith(`/ec2/create-security-group`),e[101]=n,e[102]=Fe);let Ie,Le;e[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,V.jsx)(Wo,{className:`size-4`}),Le=(0,V.jsx)(`span`,{children:`Security Groups`}),e[103]=Ie,e[104]=Le):(Ie=e[103],Le=e[104]);let Re;e[105]===Fe?Re=e[106]:(Re=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-security-groups`,children:(0,V.jsxs)(K,{isActive:Fe,tooltip:`Security Groups`,children:[Ie,Le]})})}),e[105]=Fe,e[106]=Re);let ze;e[107]===n?ze=e[108]:(ze=n.startsWith(`/ec2/describe-route-tables`)||n.startsWith(`/ec2/create-route-table`),e[107]=n,e[108]=ze);let Be,Ve;e[109]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,V.jsx)(Uo,{className:`size-4`}),Ve=(0,V.jsx)(`span`,{children:`Route Tables`}),e[109]=Be,e[110]=Ve):(Be=e[109],Ve=e[110]);let He;e[111]===ze?He=e[112]:(He=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-route-tables`,children:(0,V.jsxs)(K,{isActive:ze,tooltip:`Route Tables`,children:[Be,Ve]})})}),e[111]=ze,e[112]=He);let Ue;e[113]===n?Ue=e[114]:(Ue=n.startsWith(`/ec2/describe-internet-gateways`),e[113]=n,e[114]=Ue);let We,Ge;e[115]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,V.jsx)(Qe,{className:`size-4`}),Ge=(0,V.jsx)(`span`,{children:`Internet Gateways`}),e[115]=We,e[116]=Ge):(We=e[115],Ge=e[116]);let Ke;e[117]===Ue?Ke=e[118]:(Ke=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-internet-gateways`,children:(0,V.jsxs)(K,{isActive:Ue,tooltip:`Internet Gateways`,children:[We,Ge]})})}),e[117]=Ue,e[118]=Ke);let F;e[119]===n?F=e[120]:(F=n.startsWith(`/ec2/describe-nat-gateways`)||n.startsWith(`/ec2/create-nat-gateway`),e[119]=n,e[120]=F);let qe,I;e[121]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,V.jsx)($e,{className:`size-4`}),I=(0,V.jsx)(`span`,{children:`NAT Gateways`}),e[121]=qe,e[122]=I):(qe=e[121],I=e[122]);let Ye;e[123]===F?Ye=e[124]:(Ye=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-nat-gateways`,children:(0,V.jsxs)(K,{isActive:F,tooltip:`NAT Gateways`,children:[qe,I]})})}),e[123]=F,e[124]=Ye);let L;e[125]!==ke||e[126]!==Pe||e[127]!==Re||e[128]!==He||e[129]!==Ke||e[130]!==Ye?(L=(0,V.jsxs)(Mc,{children:[N,(0,V.jsxs)(Pc,{children:[ke,Pe,Re,He,Ke,Ye]})]}),e[125]=ke,e[126]=Pe,e[127]=Re,e[128]=He,e[129]=Ke,e[130]=Ye,e[131]=L):L=e[131];let ot;e[132]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,V.jsx)(Nc,{children:`Containers`}),e[132]=ot):ot=e[132];let ct;e[133]===n?ct=e[134]:(ct=n.startsWith(`/eks/list-clusters`)||n.startsWith(`/eks/create-cluster`),e[133]=n,e[134]=ct);let lt,ut;e[135]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,V.jsx)(Oo,{className:`size-4`}),ut=(0,V.jsx)(`span`,{children:`EKS`}),e[135]=lt,e[136]=ut):(lt=e[135],ut=e[136]);let dt;e[137]===ct?dt=e[138]:(dt=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/eks/list-clusters`,children:(0,V.jsxs)(K,{isActive:ct,tooltip:`EKS clusters`,children:[lt,ut]})})}),e[137]=ct,e[138]=dt);let ft;e[139]===n?ft=e[140]:(ft=n.startsWith(`/ecr/list-repositories`),e[139]=n,e[140]=ft);let pt,mt;e[141]===Symbol.for(`react.memo_cache_sentinel`)?(pt=(0,V.jsx)(Vo,{className:`size-4`}),mt=(0,V.jsx)(`span`,{children:`ECR`}),e[141]=pt,e[142]=mt):(pt=e[141],mt=e[142]);let ht;e[143]===ft?ht=e[144]:(ht=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ecr/list-repositories`,children:(0,V.jsxs)(K,{isActive:ft,tooltip:`ECR repositories`,children:[pt,mt]})})}),e[143]=ft,e[144]=ht);let gt;e[145]===n?gt=e[146]:(gt=n.startsWith(`/ecs/`),e[145]=n,e[146]=gt);let _t,vt;e[147]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,V.jsx)(Ao,{className:`size-4`}),vt=(0,V.jsx)(`span`,{children:`ECS`}),e[147]=_t,e[148]=vt):(_t=e[147],vt=e[148]);let R;e[149]===gt?R=e[150]:(R=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ecs/list-clusters`,children:(0,V.jsxs)(K,{isActive:gt,tooltip:`ECS clusters`,children:[_t,vt]})})}),e[149]=gt,e[150]=R);let yt;e[151]!==dt||e[152]!==ht||e[153]!==R?(yt=(0,V.jsxs)(Mc,{children:[ot,(0,V.jsxs)(Pc,{children:[dt,ht,R]})]}),e[151]=dt,e[152]=ht,e[153]=R,e[154]=yt):yt=e[154];let bt;e[155]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,V.jsx)(Nc,{children:`RDS`}),e[155]=bt):bt=e[155];let xt;e[156]===n?xt=e[157]:(xt=n.startsWith(`/rds/describe-db-instances`)||n.startsWith(`/rds/create-db-instance`),e[156]=n,e[157]=xt);let St,Ct;e[158]===Symbol.for(`react.memo_cache_sentinel`)?(St=(0,V.jsx)(Mo,{className:`size-4`}),Ct=(0,V.jsx)(`span`,{children:`Databases`}),e[158]=St,e[159]=Ct):(St=e[158],Ct=e[159]);let wt;e[160]===xt?wt=e[161]:(wt=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/rds/describe-db-instances`,children:(0,V.jsxs)(K,{isActive:xt,tooltip:`Databases`,children:[St,Ct]})})}),e[160]=xt,e[161]=wt);let Tt;e[162]===n?Tt=e[163]:(Tt=n.startsWith(`/rds/describe-db-snapshots`)||n.startsWith(`/rds/restore-db-instance-from-db-snapshot`),e[162]=n,e[163]=Tt);let Et,Dt;e[164]===Symbol.for(`react.memo_cache_sentinel`)?(Et=(0,V.jsx)(Xe,{className:`size-4`}),Dt=(0,V.jsx)(`span`,{children:`Snapshots`}),e[164]=Et,e[165]=Dt):(Et=e[164],Dt=e[165]);let Ot;e[166]===Tt?Ot=e[167]:(Ot=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/rds/describe-db-snapshots`,children:(0,V.jsxs)(K,{isActive:Tt,tooltip:`DB Snapshots`,children:[Et,Dt]})})}),e[166]=Tt,e[167]=Ot);let kt;e[168]===n?kt=e[169]:(kt=n.startsWith(`/rds/describe-db-subnet-groups`)||n.startsWith(`/rds/create-db-subnet-group`),e[168]=n,e[169]=kt);let At,jt;e[170]===Symbol.for(`react.memo_cache_sentinel`)?(At=(0,V.jsx)(Lo,{className:`size-4`}),jt=(0,V.jsx)(`span`,{children:`Subnet Groups`}),e[170]=At,e[171]=jt):(At=e[170],jt=e[171]);let Mt;e[172]===kt?Mt=e[173]:(Mt=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/rds/describe-db-subnet-groups`,children:(0,V.jsxs)(K,{isActive:kt,tooltip:`DB Subnet Groups`,children:[At,jt]})})}),e[172]=kt,e[173]=Mt);let Nt;e[174]===n?Nt=e[175]:(Nt=n.startsWith(`/rds/describe-db-parameter-groups`)||n.startsWith(`/rds/create-db-parameter-group`),e[174]=n,e[175]=Nt);let Pt,Ft;e[176]===Symbol.for(`react.memo_cache_sentinel`)?(Pt=(0,V.jsx)(st,{className:`size-4`}),Ft=(0,V.jsx)(`span`,{children:`Parameter Groups`}),e[176]=Pt,e[177]=Ft):(Pt=e[176],Ft=e[177]);let It;e[178]===Nt?It=e[179]:(It=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/rds/describe-db-parameter-groups`,children:(0,V.jsxs)(K,{isActive:Nt,tooltip:`DB Parameter Groups`,children:[Pt,Ft]})})}),e[178]=Nt,e[179]=It);let Lt;e[180]!==Ot||e[181]!==Mt||e[182]!==It||e[183]!==wt?(Lt=(0,V.jsxs)(Mc,{children:[bt,(0,V.jsxs)(Pc,{children:[wt,Ot,Mt,It]})]}),e[180]=Ot,e[181]=Mt,e[182]=It,e[183]=wt,e[184]=Lt):Lt=e[184];let Rt;e[185]===Symbol.for(`react.memo_cache_sentinel`)?(Rt=(0,V.jsx)(Nc,{children:`IAM`}),e[185]=Rt):Rt=e[185];let zt;e[186]===n?zt=e[187]:(zt=n.startsWith(`/iam/list-users`)||n.startsWith(`/iam/create-user`),e[186]=n,e[187]=zt);let Bt,Vt;e[188]===Symbol.for(`react.memo_cache_sentinel`)?(Bt=(0,V.jsx)(Jo,{className:`size-4`}),Vt=(0,V.jsx)(`span`,{children:`Users`}),e[188]=Bt,e[189]=Vt):(Bt=e[188],Vt=e[189]);let Ht;e[190]===zt?Ht=e[191]:(Ht=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/iam/list-users`,children:(0,V.jsxs)(K,{isActive:zt,tooltip:`Users`,children:[Bt,Vt]})})}),e[190]=zt,e[191]=Ht);let Ut;e[192]===n?Ut=e[193]:(Ut=n.startsWith(`/iam/list-groups`)||n.startsWith(`/iam/create-group`),e[192]=n,e[193]=Ut);let Wt,Gt;e[194]===Symbol.for(`react.memo_cache_sentinel`)?(Wt=(0,V.jsx)(qo,{className:`size-4`}),Gt=(0,V.jsx)(`span`,{children:`Groups`}),e[194]=Wt,e[195]=Gt):(Wt=e[194],Gt=e[195]);let Kt;e[196]===Ut?Kt=e[197]:(Kt=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/iam/list-groups`,children:(0,V.jsxs)(K,{isActive:Ut,tooltip:`Groups`,children:[Wt,Gt]})})}),e[196]=Ut,e[197]=Kt);let qt;e[198]===n?qt=e[199]:(qt=n.startsWith(`/iam/list-policies`)||n.startsWith(`/iam/create-policy`),e[198]=n,e[199]=qt);let Jt,Yt;e[200]===Symbol.for(`react.memo_cache_sentinel`)?(Jt=(0,V.jsx)(et,{className:`size-4`}),Yt=(0,V.jsx)(`span`,{children:`Policies`}),e[200]=Jt,e[201]=Yt):(Jt=e[200],Yt=e[201]);let Xt;e[202]===qt?Xt=e[203]:(Xt=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/iam/list-policies`,children:(0,V.jsxs)(K,{isActive:qt,tooltip:`Policies`,children:[Jt,Yt]})})}),e[202]=qt,e[203]=Xt);let Zt;e[204]===n?Zt=e[205]:(Zt=n.startsWith(`/iam/list-roles`)||n.startsWith(`/iam/create-role`),e[204]=n,e[205]=Zt);let Qt,$t;e[206]===Symbol.for(`react.memo_cache_sentinel`)?(Qt=(0,V.jsx)(Ko,{className:`size-4`}),$t=(0,V.jsx)(`span`,{children:`Roles`}),e[206]=Qt,e[207]=$t):(Qt=e[206],$t=e[207]);let en;e[208]===Zt?en=e[209]:(en=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/iam/list-roles`,children:(0,V.jsxs)(K,{isActive:Zt,tooltip:`Roles`,children:[Qt,$t]})})}),e[208]=Zt,e[209]=en);let tn;e[210]===n?tn=e[211]:(tn=n.startsWith(`/iam/list-instance-profiles`)||n.startsWith(`/iam/create-instance-profile`),e[210]=n,e[211]=tn);let nn,rn;e[212]===Symbol.for(`react.memo_cache_sentinel`)?(nn=(0,V.jsx)(Fo,{className:`size-4`}),rn=(0,V.jsx)(`span`,{children:`Instance Profiles`}),e[212]=nn,e[213]=rn):(nn=e[212],rn=e[213]);let an;e[214]===tn?an=e[215]:(an=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/iam/list-instance-profiles`,children:(0,V.jsxs)(K,{isActive:tn,tooltip:`Instance Profiles`,children:[nn,rn]})})}),e[214]=tn,e[215]=an);let on;e[216]!==Ht||e[217]!==Kt||e[218]!==Xt||e[219]!==en||e[220]!==an?(on=(0,V.jsxs)(Mc,{children:[Rt,(0,V.jsxs)(Pc,{children:[Ht,Kt,Xt,en,an]})]}),e[216]=Ht,e[217]=Kt,e[218]=Xt,e[219]=en,e[220]=an,e[221]=on):on=e[221];let sn;e[222]===Symbol.for(`react.memo_cache_sentinel`)?(sn=(0,V.jsx)(Nc,{children:`S3`}),e[222]=sn):sn=e[222];let cn;e[223]===n?cn=e[224]:(cn=n.startsWith(`/s3/ls`),e[223]=n,e[224]=cn);let ln,un;e[225]===Symbol.for(`react.memo_cache_sentinel`)?(ln=(0,V.jsx)(nt,{className:`size-4`}),un=(0,V.jsx)(`span`,{children:`Buckets`}),e[225]=ln,e[226]=un):(ln=e[225],un=e[226]);let dn;e[227]===cn?dn=e[228]:(dn=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/s3/ls`,children:(0,V.jsxs)(K,{isActive:cn,tooltip:`Buckets`,children:[ln,un]})})}),e[227]=cn,e[228]=dn);let fn;e[229]!==a||e[230]!==n?(fn=a&&(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/s3/service-metrics`,children:(0,V.jsxs)(K,{isActive:n.startsWith(`/s3/service-metrics`),tooltip:`Service Metrics`,children:[(0,V.jsx)(Eo,{className:`size-4`}),(0,V.jsx)(`span`,{children:`Service Metrics`})]})})}),e[229]=a,e[230]=n,e[231]=fn):fn=e[231];let pn;e[232]!==dn||e[233]!==fn?(pn=(0,V.jsxs)(Mc,{children:[sn,(0,V.jsxs)(Pc,{children:[dn,fn]})]}),e[232]=dn,e[233]=fn,e[234]=pn):pn=e[234];let mn;e[235]===a?mn=e[236]:(mn=a&&(0,V.jsxs)(Mc,{children:[(0,V.jsx)(Nc,{children:`Documentation`}),(0,V.jsx)(Pc,{children:(0,V.jsx)(G,{children:(0,V.jsx)(`a`,{href:`https://docs.mulgadc.com`,target:`_blank`,rel:`noopener noreferrer`,children:(0,V.jsxs)(K,{tooltip:`Documentation`,children:[(0,V.jsx)(Do,{className:`size-4`}),(0,V.jsx)(`span`,{children:`Docs`})]})})})})]}),e[235]=a,e[236]=mn);let hn;e[237]!==Lt||e[238]!==on||e[239]!==pn||e[240]!==mn||e[241]!==Ee||e[242]!==L||e[243]!==g||e[244]!==yt?(hn=(0,V.jsxs)(jc,{children:[g,Ee,L,yt,Lt,on,pn,mn]}),e[237]=Lt,e[238]=on,e[239]=pn,e[240]=mn,e[241]=Ee,e[242]=L,e[243]=g,e[244]=yt,e[245]=hn):hn=e[245];let gn;e[246]===Symbol.for(`react.memo_cache_sentinel`)?(gn=(0,V.jsx)(Ac,{className:`mx-0 w-full`}),e[246]=gn):gn=e[246];let _n,vn;e[247]===Symbol.for(`react.memo_cache_sentinel`)?(_n=(0,V.jsx)(Ro,{className:`size-4`}),vn=(0,V.jsx)(`span`,{children:`Sign out`}),e[247]=_n,e[248]=vn):(_n=e[247],vn=e[248]);let yn;e[249]===s?yn=e[250]:(yn=(0,V.jsxs)(kc,{children:[gn,(0,V.jsx)(Pc,{children:(0,V.jsx)(G,{children:(0,V.jsxs)(K,{onClick:s,tooltip:`Sign out`,children:[_n,vn]})})})]}),e[249]=s,e[250]=yn);let bn;e[251]===Symbol.for(`react.memo_cache_sentinel`)?(bn=(0,V.jsx)(Dc,{}),e[251]=bn):bn=e[251];let xn;return e[252]!==hn||e[253]!==yn?(xn=(0,V.jsxs)(Tc,{collapsible:`icon`,children:[c,hn,yn,bn]}),e[252]=hn,e[253]=yn,e[254]=xn):xn=e[254],xn}function Kc(e){return e.pathname}function qc(e){let t=(0,W.c)(18),{error:n,reset:r}=e,i=ke(),a=h(),o;t[0]!==a||t[1]!==r||t[2]!==i?(o=function(){a.invalidateQueries(),r(),i.invalidate()},t[0]=a,t[1]=r,t[2]=i,t[3]=o):o=t[3];let s=o,c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(Gc,{}),t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(Uc,{}),t[5]=l):l=t[5];let u,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,V.jsx)(`div`,{className:`flex justify-center`,children:(0,V.jsx)(ko,{className:`size-12 text-destructive`})}),d=(0,V.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Something went wrong`}),t[6]=u,t[7]=d):(u=t[6],d=t[7]);let f=n.message||`An unexpected error occurred`,p;t[8]===f?p=t[9]:(p=(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:f}),t[8]=f,t[9]=p);let m;t[10]===s?m=t[11]:(m=(0,V.jsx)(gt,{onClick:s,variant:`default`,children:`Try Again`}),t[10]=s,t[11]=m);let g;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,V.jsx)(M,{to:`/`,children:(0,V.jsx)(gt,{variant:`outline`,children:`Go Home`})}),t[12]=g):g=t[12];let _;t[13]===m?_=t[14]:(_=(0,V.jsxs)(`div`,{className:`flex justify-center gap-2`,children:[m,g]}),t[13]=m,t[14]=_);let v;return t[15]!==_||t[16]!==p?(v=(0,V.jsxs)(V.Fragment,{children:[c,(0,V.jsxs)(`main`,{className:`flex flex-1 flex-col`,children:[l,(0,V.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 pt-0`,children:(0,V.jsxs)(`div`,{className:`max-w-md space-y-4 text-center`,children:[u,d,p,_]})})]})]}),t[15]=_,t[16]=p,t[17]=v):v=t[17],v}var Jc=De()({head:()=>({meta:[{title:`Mulga`}]}),component:()=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_o,{}),(0,V.jsx)(Gc,{}),(0,V.jsxs)(`main`,{className:`flex flex-1 flex-col`,children:[(0,V.jsx)(Uc,{}),(0,V.jsx)(`div`,{className:`flex flex-1 flex-col p-8`,children:(0,V.jsx)(ve,{})})]})]}),errorComponent:qc,notFoundComponent:Wc}),Yc=N(`/_auth`)({beforeLoad:()=>{if(!qe())throw we({to:`/login`})},component:P(()=>I(()=>import(`./route.js`),__vite__mapDeps([0,1,2,3,4])),`component`)}),Xc=N(`/_auth/`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(Fn),e.queryClient.ensureQueryData(En),e.queryClient.ensureQueryData(On),e.queryClient.ensureQueryData(Rn),e.queryClient.ensureQueryData(ar),e.queryClient.ensureQueryData(Bn),e.queryClient.ensureQueryData(jn),e.queryClient.ensureQueryData(In),e.queryClient.ensureQueryData(Nn)])},head:()=>({meta:[{title:`Dashboard | Mulga`}]}),component:P(()=>I(()=>import(`./_auth.js`),__vite__mapDeps([5,1,6,7,8,9,10,4,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37])),`component`)}),Zc=N(`/_auth/nodes`)({head:()=>({meta:[{title:`Nodes | Mulga`}]}),component:P(()=>I(()=>import(`./nodes.js`),__vite__mapDeps([38,1,6,7,8,9,10,4,39,11,12,14,13,15,17,18,19,25,34,21,35,28,36,37])),`component`)}),Qc=N(`/_auth/s3/service-metrics`)({head:()=>({meta:[{title:`Service Metrics | S3 | Mulga`}]}),component:P(()=>I(()=>import(`./service-metrics.js`),__vite__mapDeps([40,1,6,7,8,9,39,17,11,12,18,19,25,34,21,35,28,36,37])),`component`)}),$c=N(`/_auth/ec2/(elastic-ips)/allocate-address`)({head:()=>({meta:[{title:`Allocate Elastic IP | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./allocate-address.js`),__vite__mapDeps([41,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60])),`component`)}),el=N(`/_auth/ec2/(internet-gateways)/create-internet-gateway`)({head:()=>({meta:[{title:`Create Internet Gateway | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-internet-gateway.js`),__vite__mapDeps([61,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60])),`component`)}),tl=N(`/_auth/ec2/(key)/create-key-pair`)({head:()=>({meta:[{title:`Create Key Pair | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-key-pair.js`),__vite__mapDeps([62,1,42,4,43,10,13,45,63,30,28,11,12,27,14,31,49,32,64,65,50,66,67,44,46,47,68,48,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60,26,29])),`component`)}),nl=N(`/_auth/ec2/(key)/import-key-pair`)({head:()=>({meta:[{title:`Import Key Pair | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./import-key-pair.js`),__vite__mapDeps([69,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60,70])),`component`)}),rl=N(`/_auth/ec2/(launch-templates)/create-launch-template`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(Ln),e.queryClient.ensureQueryData(Mn),e.queryClient.ensureQueryData(Rn),e.queryClient.ensureQueryData(kn),e.queryClient.ensureQueryData(Bn)])},head:()=>({meta:[{title:`Create Launch Template | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-launch-template.js`),__vite__mapDeps([71,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60,72,73,7,9,63,30,32,64,65,66,70,74])),`component`)}),il=N(`/_auth/ec2/(load-balancers)/create-load-balancer`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(On),e.queryClient.ensureQueryData(kn),e.queryClient.ensureQueryData(Bn),e.queryClient.ensureQueryData(Jn),e.queryClient.ensureQueryData(Tn),e.queryClient.ensureQueryData(qn)])},head:()=>({meta:[{title:`Create Load Balancer | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-load-balancer.js`),__vite__mapDeps([75,1,73,7,8,9,42,4,11,12,43,10,13,63,30,28,27,45,14,31,49,32,64,65,50,66,44,46,47,48,76,21,22,23,77,52,53,56,58,59,26,29,70,20,78,79,80,55,57,25,81,82,83,84,74,85])),`component`)}),al=N(`/_auth/ec2/(nat-gateways)/create-nat-gateway`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(kn),e.queryClient.ensureQueryData(In)])},head:()=>({meta:[{title:`Create NAT Gateway | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-nat-gateway.js`),__vite__mapDeps([86,1,73,7,8,9,10,4,42,11,12,43,13,63,30,28,27,45,14,31,49,32,64,65,50,66,44,46,47,48,20,21,22,23,51,52,53,54,55,56,57,25,58,59,60])),`component`)}),ol=N(`/_auth/ec2/(placement-groups)/create-placement-group`)({head:()=>({meta:[{title:`Create Placement Group | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-placement-group.js`),__vite__mapDeps([87,1,42,4,43,10,13,63,30,28,11,12,27,45,14,31,49,32,64,65,50,66,44,46,47,48,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60])),`component`)}),sl=N(`/_auth/ec2/(route-tables)/create-route-table`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(On)},head:()=>({meta:[{title:`Create Route Table | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-route-table.js`),__vite__mapDeps([88,1,73,7,8,9,42,4,11,12,43,10,13,63,30,28,27,45,14,31,49,32,64,65,50,66,48,20,21,22,23,51,52,53,54,55,56,57,25,58,59,60])),`component`)}),cl=N(`/_auth/ec2/(security-groups)/create-security-group`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(On)},head:()=>({meta:[{title:`Create Security Group | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-security-group.js`),__vite__mapDeps([89,1,73,7,8,9,42,4,11,12,43,10,13,63,30,28,27,45,14,31,49,32,64,65,50,66,44,46,47,48,20,21,22,23,51,52,53,54,55,56,57,25,58,59,60])),`component`)}),ll=N(`/_auth/ec2/(subnet)/create-subnet`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(On),e.queryClient.ensureQueryData(zn)])},head:()=>({meta:[{title:`Create Subnet | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-subnet.js`),__vite__mapDeps([90,1,73,7,8,9,42,4,11,12,43,10,13,63,30,28,27,45,14,31,49,32,64,65,50,66,44,46,47,48,20,21,22,23,51,52,53,54,55,56,57,25,58,59,60])),`component`)}),ul=N(`/_auth/ec2/(target-groups)/create-target-group`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(On)},head:()=>({meta:[{title:`Create Target Group | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-target-group.js`),__vite__mapDeps([91,1,73,7,8,9,42,4,43,10,13,44,11,12,45,14,46,27,28,47,20,21,22,23,78,52,53,79,55,56,57,25,84,63,30,31,49,32,64,65,50,66,48,58,59,74,81,82,83,85])),`component`)}),dl=N(`/_auth/ec2/(volumes)/create-volume`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(zn)},head:()=>({meta:[{title:`Create Volume | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-volume.js`),__vite__mapDeps([92,1,73,7,8,9,42,4,43,10,13,63,30,28,11,12,27,45,14,31,49,32,64,65,50,66,44,46,47,48,20,21,22,23,51,52,53,54,55,56,57,25,58,59,60])),`component`)}),fl=N(`/_auth/ec2/(vpc)/create-vpc`)({head:()=>({meta:[{title:`Create VPC | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-vpc.js`),__vite__mapDeps([93,1,42,4,43,10,13,14,15,63,30,28,11,12,27,45,31,49,32,64,65,50,66,44,46,47,48,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60])),`component`)}),pl=N(`/_auth/ecs/(clusters)/task-definitions`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Wn)},head:()=>({meta:[{title:`Task Definitions | ECS | Mulga`}]}),component:P(()=>I(()=>import(`./task-definitions.js`),__vite__mapDeps([94,1,73,7,8,9,10,4,27,28,11,12,95,21,22,23,96,52,53,19,56,25,97,26,29,30,31,32,98])),`component`)}),ml=N(`/_auth/eks/(clusters)/create-cluster`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(On),e.queryClient.ensureQueryData(kn),e.queryClient.ensureQueryData($n),e.queryClient.ensureQueryData(Ln)])},head:()=>({meta:[{title:`Create Cluster | EKS | Mulga`}]}),component:P(()=>I(()=>import(`./create-cluster.js`),__vite__mapDeps([99,1,8,73,7,9,42,4,11,12,43,10,13,63,30,28,27,45,14,31,49,32,64,65,50,66,48,20,21,22,23,100,52,53,101,102,54,103,104,105,55,56,57,25,58,59,26,29,106,107,46,108,68,47,109])),`component`)}),hl=N(`/_auth/iam/(groups)/create-group`)({head:()=>({meta:[{title:`Create Group | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./create-group.js`),__vite__mapDeps([110,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,103,8,52,53,22,23,104,55,56,57,25,58,59,111,102])),`component`)}),gl=N(`/_auth/iam/(instance-profiles)/create-instance-profile`)({head:()=>({meta:[{title:`Create Instance Profile | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./create-instance-profile.js`),__vite__mapDeps([112,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,103,8,52,53,22,23,104,55,56,57,25,58,59,111,102])),`component`)}),_l=N(`/_auth/iam/(policies)/create-policy`)({head:()=>({meta:[{title:`Create Policy | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./create-policy.js`),__vite__mapDeps([113,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,103,8,52,53,22,23,104,55,56,57,25,58,59,114,102,70,111])),`component`)}),vl=N(`/_auth/iam/(roles)/create-role`)({head:()=>({meta:[{title:`Create Role | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./create-role.js`),__vite__mapDeps([115,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,103,8,52,53,22,23,104,55,56,57,25,58,59,114,102,70,111])),`component`)}),yl=N(`/_auth/iam/(users)/create-user`)({head:()=>({meta:[{title:`Create User | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./create-user.js`),__vite__mapDeps([116,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,103,8,52,53,22,23,104,55,56,57,25,58,59,111,102])),`component`)}),bl=N(`/_auth/rds/(db-instances)/create-db-instance`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(rr),e.queryClient.ensureQueryData(nr),e.queryClient.ensureQueryData(tr),e.queryClient.ensureQueryData(Bn),e.queryClient.ensureQueryData(On),e.queryClient.ensureQueryData(Ln)])},head:()=>({meta:[{title:`Create Database | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./create-db-instance.js`),__vite__mapDeps([117,1,8,6,7,9,73,42,4,43,10,13,63,30,28,11,12,27,45,14,31,49,32,64,65,50,66,44,46,47,48,20,21,22,23,118,119,52,53,120,55,56,57,25,58,59,106,81,82,83,107,108,68,121,122])),`component`)}),xl=N(`/_auth/rds/(parameter-groups)/create-db-parameter-group`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(rr)},head:()=>({meta:[{title:`Create Parameter Group | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./create-db-parameter-group.js`),__vite__mapDeps([123,1,73,7,8,9,42,4,43,10,13,63,30,28,11,12,27,45,14,31,49,32,64,65,50,66,44,46,47,48,118,22,23,119,52,53,120,21,55,56,57,25,58,59,81,82,83])),`component`)}),Sl=N(`/_auth/rds/(subnet-groups)/create-db-subnet-group`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(kn),e.queryClient.ensureQueryData(On)])},head:()=>({meta:[{title:`Create Subnet Group | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./create-db-subnet-group.js`),__vite__mapDeps([124,1,73,7,8,9,42,4,11,12,43,10,13,44,45,14,46,27,28,47,48,31,49,50,20,21,22,23,118,119,52,53,55,56,57,25,58,59,81,82,83])),`component`)}),Cl=N(`/_auth/s3/(buckets)/create-bucket`)({head:()=>({meta:[{title:`Create Bucket | S3 | Mulga`}]}),component:P(()=>I(()=>import(`./create-bucket.js`),__vite__mapDeps([125,1,42,4,11,12,43,10,13,44,45,14,46,27,28,47,48,31,49,50,126,8,52,53,22,23,55,56,57,25,58,59])),`component`)}),wl=N(`/_auth/s3/ls/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(ar)},head:()=>({meta:[{title:`Buckets | S3 | Mulga`}]}),component:P(()=>I(()=>import(`./ls.js`),__vite__mapDeps([127,1,73,7,8,9,10,4,11,12,27,28,24,21,22,23,25,128])),`component`)}),Tl=N(`/_auth/s3/ls/$bucket`)({component:P(()=>I(()=>import(`./route2.js`),__vite__mapDeps([129,1,2,3,4])),`component`)}),El=N(`/_auth/ec2/(elastic-ips)/describe-addresses/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(In)},head:()=>({meta:[{title:`Elastic IPs | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-addresses.js`),__vite__mapDeps([130,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128])),`component`)}),Dl=N(`/_auth/ec2/(images)/describe-images/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Ln)},head:()=>({meta:[{title:`Images | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-images.js`),__vite__mapDeps([131,1,73,7,8,9,20,21,11,12,22,23,25,128,10,4,33,106])),`component`)}),Ol=N(`/_auth/ec2/(instances)/describe-instances/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Fn)},head:()=>({meta:[{title:`Instances | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-instances.js`),__vite__mapDeps([132,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128,33])),`component`)}),kl=N(`/_auth/ec2/(internet-gateways)/describe-internet-gateways/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Nn)},head:()=>({meta:[{title:`Internet Gateways | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-internet-gateways.js`),__vite__mapDeps([133,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128])),`component`)}),Al=N(`/_auth/ec2/(key)/describe-key-pairs/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Rn)},head:()=>({meta:[{title:`Key Pairs | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-key-pairs.js`),__vite__mapDeps([134,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128])),`component`)}),jl=N(`/_auth/ec2/(launch-templates)/describe-launch-templates/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Pn)},head:()=>({meta:[{title:`Launch Templates | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-launch-templates.js`),__vite__mapDeps([135,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128,35,36])),`component`)}),Ml=N(`/_auth/ec2/(load-balancers)/describe-load-balancers/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Kn)},head:()=>({meta:[{title:`Load Balancers | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-load-balancers.js`),__vite__mapDeps([136,1,73,7,8,9,10,4,42,11,12,27,28,80,21,22,23,79,25,33])),`component`)}),Nl=N(`/_auth/ec2/(nat-gateways)/describe-nat-gateways/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(jn)},head:()=>({meta:[{title:`NAT Gateways | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-nat-gateways.js`),__vite__mapDeps([137,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128,33])),`component`)}),Pl=N(`/_auth/ec2/(placement-groups)/describe-placement-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Vn)},head:()=>({meta:[{title:`Placement Groups | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-placement-groups.js`),__vite__mapDeps([138,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128,33])),`component`)}),Fl=N(`/_auth/ec2/(route-tables)/describe-route-tables/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(An)},head:()=>({meta:[{title:`Route Tables | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-route-tables.js`),__vite__mapDeps([139,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128,35,36])),`component`)}),Il=N(`/_auth/ec2/(security-groups)/describe-security-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Bn)},head:()=>({meta:[{title:`Security Groups | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-security-groups.js`),__vite__mapDeps([140,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128])),`component`)}),Ll=N(`/_auth/ec2/(snapshots)/describe-snapshots/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Dn)},head:()=>({meta:[{title:`Snapshots | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-snapshots.js`),__vite__mapDeps([141,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128,33])),`component`)}),q=N(`/_auth/ec2/(subnet)/describe-subnets/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(kn)},head:()=>({meta:[{title:`Subnets | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-subnets.js`),__vite__mapDeps([142,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128,33])),`component`)}),Rl=N(`/_auth/ec2/(target-groups)/describe-target-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Jn)},head:()=>({meta:[{title:`Target Groups | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-target-groups.js`),__vite__mapDeps([143,1,6,7,8,9,73,10,4,42,27,28,11,12,80,21,22,23,79,25])),`component`)}),J=N(`/_auth/ec2/(volumes)/describe-volumes/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(En)},head:()=>({meta:[{title:`Volumes | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-volumes.js`),__vite__mapDeps([144,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128,33])),`component`)}),Y=N(`/_auth/ec2/(vpc)/describe-vpcs/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(On)},head:()=>({meta:[{title:`VPCs | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-vpcs.js`),__vite__mapDeps([145,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128,33])),`component`)}),X=N(`/_auth/ecr/(repositories)/list-repositories/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Hn)},head:()=>({meta:[{title:`Repositories | ECR | Mulga`}]}),component:P(()=>I(()=>import(`./list-repositories.js`),__vite__mapDeps([146,1,73,7,8,9,10,4,42,11,12,27,28,48,31,49,50,147,21,22,23,148,52,53,25,58,59,26,29,30,32])),`component`)}),zl=N(`/_auth/ecs/(clusters)/list-clusters/`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(Un),e.queryClient.ensureQueryData(Ln)])},head:()=>({meta:[{title:`Clusters | ECS | Mulga`}]}),component:P(()=>I(()=>import(`./list-clusters.js`),__vite__mapDeps([149,1,8,73,7,9,10,4,42,27,28,11,12,48,31,49,50,20,21,22,23,95,96,52,53,19,56,25,58,59,26,29,30,32,97,33,106,107,45,13,46,108,68,47,98])),`component`)}),Bl=N(`/_auth/eks/(clusters)/list-clusters/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Gn)},head:()=>({meta:[{title:`Clusters | EKS | Mulga`}]}),component:P(()=>I(()=>import(`./list-clusters2.js`),__vite__mapDeps([150,1,73,7,8,9,10,4,27,28,11,12,151,21,22,23,101,25,128])),`component`)}),Vl=N(`/_auth/iam/(groups)/list-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Zn)},head:()=>({meta:[{title:`Groups | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./list-groups.js`),__vite__mapDeps([152,1,73,7,8,9,10,4,27,28,11,12,105,21,22,23,104,102,25,128])),`component`)}),Hl=N(`/_auth/iam/(instance-profiles)/list-instance-profiles/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Xn)},head:()=>({meta:[{title:`Instance Profiles | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./list-instance-profiles.js`),__vite__mapDeps([153,1,73,7,8,9,10,4,27,28,11,12,105,21,22,23,104,102,25,128])),`component`)}),Ul=N(`/_auth/iam/(policies)/list-policies/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Qn)},head:()=>({meta:[{title:`Policies | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./list-policies.js`),__vite__mapDeps([154,1,73,7,8,9,10,4,27,28,11,12,105,21,22,23,104,102,25,128])),`component`)}),Wl=N(`/_auth/iam/(roles)/list-roles/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData($n)},head:()=>({meta:[{title:`Roles | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./list-roles.js`),__vite__mapDeps([155,1,73,7,8,9,10,4,27,28,11,12,105,21,22,23,104,102,25,128])),`component`)}),Gl=N(`/_auth/iam/(users)/list-users/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Yn)},head:()=>({meta:[{title:`Users | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./list-users.js`),__vite__mapDeps([156,1,73,7,8,9,10,4,27,28,11,12,105,21,22,23,104,102,25,128])),`component`)}),Kl=N(`/_auth/rds/(db-instances)/describe-db-instances/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(ir)},head:()=>({meta:[{title:`Databases | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./describe-db-instances.js`),__vite__mapDeps([157,1,73,7,8,9,10,4,42,27,28,11,12,118,22,23,119,52,53,120,21,56,25,33,158,48,31,49,50,58,59,26,29,30,32])),`component`)}),ql=N(`/_auth/rds/(parameter-groups)/describe-db-parameter-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(tr)},head:()=>({meta:[{title:`Parameter Groups | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./describe-db-parameter-groups.js`),__vite__mapDeps([159,1,73,7,8,9,10,4,42,27,28,11,12,118,22,23,120,21,25,160,119,52,53,161,97,26,29,30,31,32])),`component`)}),Jl=N(`/_auth/rds/(snapshots)/describe-db-snapshots/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(er)},head:()=>({meta:[{title:`Snapshots | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./describe-db-snapshots.js`),__vite__mapDeps([162,1,73,7,8,9,10,4,42,11,12,27,28,118,22,23,120,21,25,33,163,6,63,30,13,45,14,31,49,32,64,65,50,66,48,119,52,53,55,58,59,26,29,81,82,83,121,164,161,97])),`component`)}),Yl=N(`/_auth/rds/(subnet-groups)/describe-db-subnet-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(nr)},head:()=>({meta:[{title:`Subnet Groups | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./describe-db-subnet-groups.js`),__vite__mapDeps([165,1,73,7,8,9,10,4,42,27,28,11,12,120,21,22,23,118,25,33,166,119,52,53,161,97,26,29,30,31,32])),`component`)}),Z=Yc.update({id:`/_auth`,getParentRoute:()=>Jc}),Xl=or.update({id:`/login`,path:`/login`,getParentRoute:()=>Jc}),Zl=Xc.update({id:`/`,path:`/`,getParentRoute:()=>Z}),Ql=Zc.update({id:`/nodes`,path:`/nodes`,getParentRoute:()=>Z}),$l=Qc.update({id:`/s3/service-metrics`,path:`/s3/service-metrics`,getParentRoute:()=>Z}),eu=$c.update({id:`/ec2/(elastic-ips)/allocate-address`,path:`/ec2/allocate-address`,getParentRoute:()=>Z}),tu=sr.update({id:`/ec2/(instances)/run-instances`,path:`/ec2/run-instances`,getParentRoute:()=>Z}),nu=el.update({id:`/ec2/(internet-gateways)/create-internet-gateway`,path:`/ec2/create-internet-gateway`,getParentRoute:()=>Z}),ru=tl.update({id:`/ec2/(key)/create-key-pair`,path:`/ec2/create-key-pair`,getParentRoute:()=>Z}),iu=nl.update({id:`/ec2/(key)/import-key-pair`,path:`/ec2/import-key-pair`,getParentRoute:()=>Z}),au=rl.update({id:`/ec2/(launch-templates)/create-launch-template`,path:`/ec2/create-launch-template`,getParentRoute:()=>Z}),ou=il.update({id:`/ec2/(load-balancers)/create-load-balancer`,path:`/ec2/create-load-balancer`,getParentRoute:()=>Z}),su=al.update({id:`/ec2/(nat-gateways)/create-nat-gateway`,path:`/ec2/create-nat-gateway`,getParentRoute:()=>Z}),cu=ol.update({id:`/ec2/(placement-groups)/create-placement-group`,path:`/ec2/create-placement-group`,getParentRoute:()=>Z}),lu=sl.update({id:`/ec2/(route-tables)/create-route-table`,path:`/ec2/create-route-table`,getParentRoute:()=>Z}),uu=cl.update({id:`/ec2/(security-groups)/create-security-group`,path:`/ec2/create-security-group`,getParentRoute:()=>Z}),du=cr.update({id:`/ec2/(snapshots)/create-snapshot`,path:`/ec2/create-snapshot`,getParentRoute:()=>Z}),fu=ll.update({id:`/ec2/(subnet)/create-subnet`,path:`/ec2/create-subnet`,getParentRoute:()=>Z}),pu=ul.update({id:`/ec2/(target-groups)/create-target-group`,path:`/ec2/create-target-group`,getParentRoute:()=>Z}),mu=dl.update({id:`/ec2/(volumes)/create-volume`,path:`/ec2/create-volume`,getParentRoute:()=>Z}),hu=fl.update({id:`/ec2/(vpc)/create-vpc`,path:`/ec2/create-vpc`,getParentRoute:()=>Z}),gu=lr.update({id:`/ecs/(clusters)/create-service`,path:`/ecs/create-service`,getParentRoute:()=>Z}),_u=ur.update({id:`/ecs/(clusters)/register-task-definition`,path:`/ecs/register-task-definition`,getParentRoute:()=>Z}),vu=dr.update({id:`/ecs/(clusters)/run-task`,path:`/ecs/run-task`,getParentRoute:()=>Z}),yu=pl.update({id:`/ecs/(clusters)/task-definitions`,path:`/ecs/task-definitions`,getParentRoute:()=>Z}),bu=ml.update({id:`/eks/(clusters)/create-cluster`,path:`/eks/create-cluster`,getParentRoute:()=>Z}),xu=hl.update({id:`/iam/(groups)/create-group`,path:`/iam/create-group`,getParentRoute:()=>Z}),Su=gl.update({id:`/iam/(instance-profiles)/create-instance-profile`,path:`/iam/create-instance-profile`,getParentRoute:()=>Z}),Cu=_l.update({id:`/iam/(policies)/create-policy`,path:`/iam/create-policy`,getParentRoute:()=>Z}),wu=vl.update({id:`/iam/(roles)/create-role`,path:`/iam/create-role`,getParentRoute:()=>Z}),Tu=yl.update({id:`/iam/(users)/create-user`,path:`/iam/create-user`,getParentRoute:()=>Z}),Eu=bl.update({id:`/rds/(db-instances)/create-db-instance`,path:`/rds/create-db-instance`,getParentRoute:()=>Z}),Du=xl.update({id:`/rds/(parameter-groups)/create-db-parameter-group`,path:`/rds/create-db-parameter-group`,getParentRoute:()=>Z}),Ou=Sl.update({id:`/rds/(subnet-groups)/create-db-subnet-group`,path:`/rds/create-db-subnet-group`,getParentRoute:()=>Z}),ku=Cl.update({id:`/s3/(buckets)/create-bucket`,path:`/s3/create-bucket`,getParentRoute:()=>Z}),Au=wl.update({id:`/s3/ls/`,path:`/s3/ls/`,getParentRoute:()=>Z}),ju=Tl.update({id:`/s3/ls/$bucket`,path:`/s3/ls/$bucket`,getParentRoute:()=>Z}),Mu=El.update({id:`/ec2/(elastic-ips)/describe-addresses/`,path:`/ec2/describe-addresses/`,getParentRoute:()=>Z}),Nu=fr.update({id:`/ec2/(elastic-ips)/describe-addresses/$id`,path:`/ec2/describe-addresses/$id`,getParentRoute:()=>Z}),Pu=Dl.update({id:`/ec2/(images)/describe-images/`,path:`/ec2/describe-images/`,getParentRoute:()=>Z}),Fu=pr.update({id:`/ec2/(images)/describe-images/$id`,path:`/ec2/describe-images/$id`,getParentRoute:()=>Z}),Iu=Ol.update({id:`/ec2/(instances)/describe-instances/`,path:`/ec2/describe-instances/`,getParentRoute:()=>Z}),Lu=mr.update({id:`/ec2/(instances)/describe-instances/$id`,path:`/ec2/describe-instances/$id`,getParentRoute:()=>Z}),Ru=kl.update({id:`/ec2/(internet-gateways)/describe-internet-gateways/`,path:`/ec2/describe-internet-gateways/`,getParentRoute:()=>Z}),zu=hr.update({id:`/ec2/(internet-gateways)/describe-internet-gateways/$id`,path:`/ec2/describe-internet-gateways/$id`,getParentRoute:()=>Z}),Bu=Al.update({id:`/ec2/(key)/describe-key-pairs/`,path:`/ec2/describe-key-pairs/`,getParentRoute:()=>Z}),Vu=gr.update({id:`/ec2/(key)/describe-key-pairs/$id`,path:`/ec2/describe-key-pairs/$id`,getParentRoute:()=>Z}),Hu=jl.update({id:`/ec2/(launch-templates)/describe-launch-templates/`,path:`/ec2/describe-launch-templates/`,getParentRoute:()=>Z}),Uu=_r.update({id:`/ec2/(launch-templates)/describe-launch-templates/$id`,path:`/ec2/describe-launch-templates/$id`,getParentRoute:()=>Z}),Q=Ml.update({id:`/ec2/(load-balancers)/describe-load-balancers/`,path:`/ec2/describe-load-balancers/`,getParentRoute:()=>Z}),Wu=vr.update({id:`/ec2/(load-balancers)/describe-load-balancers/$id`,path:`/ec2/describe-load-balancers/$id`,getParentRoute:()=>Z}),Gu=Nl.update({id:`/ec2/(nat-gateways)/describe-nat-gateways/`,path:`/ec2/describe-nat-gateways/`,getParentRoute:()=>Z}),Ku=yr.update({id:`/ec2/(nat-gateways)/describe-nat-gateways/$id`,path:`/ec2/describe-nat-gateways/$id`,getParentRoute:()=>Z}),qu=Pl.update({id:`/ec2/(placement-groups)/describe-placement-groups/`,path:`/ec2/describe-placement-groups/`,getParentRoute:()=>Z}),Ju=br.update({id:`/ec2/(placement-groups)/describe-placement-groups/$id`,path:`/ec2/describe-placement-groups/$id`,getParentRoute:()=>Z}),Yu=Fl.update({id:`/ec2/(route-tables)/describe-route-tables/`,path:`/ec2/describe-route-tables/`,getParentRoute:()=>Z}),Xu=xr.update({id:`/ec2/(route-tables)/describe-route-tables/$id`,path:`/ec2/describe-route-tables/$id`,getParentRoute:()=>Z}),Zu=Il.update({id:`/ec2/(security-groups)/describe-security-groups/`,path:`/ec2/describe-security-groups/`,getParentRoute:()=>Z}),Qu=ut.update({id:`/ec2/(security-groups)/describe-security-groups/$id`,path:`/ec2/describe-security-groups/$id`,getParentRoute:()=>Z}),$u=Ll.update({id:`/ec2/(snapshots)/describe-snapshots/`,path:`/ec2/describe-snapshots/`,getParentRoute:()=>Z}),ed=ot.update({id:`/ec2/(snapshots)/describe-snapshots/$id`,path:`/ec2/describe-snapshots/$id`,getParentRoute:()=>Z}),td=q.update({id:`/ec2/(subnet)/describe-subnets/`,path:`/ec2/describe-subnets/`,getParentRoute:()=>Z}),nd=Sr.update({id:`/ec2/(subnet)/describe-subnets/$id`,path:`/ec2/describe-subnets/$id`,getParentRoute:()=>Z}),rd=Rl.update({id:`/ec2/(target-groups)/describe-target-groups/`,path:`/ec2/describe-target-groups/`,getParentRoute:()=>Z}),id=Cr.update({id:`/ec2/(target-groups)/describe-target-groups/$id`,path:`/ec2/describe-target-groups/$id`,getParentRoute:()=>Z}),ad=J.update({id:`/ec2/(volumes)/describe-volumes/`,path:`/ec2/describe-volumes/`,getParentRoute:()=>Z}),od=wr.update({id:`/ec2/(volumes)/describe-volumes/$id`,path:`/ec2/describe-volumes/$id`,getParentRoute:()=>Z}),sd=Tr.update({id:`/ec2/(volumes)/modify-volume/$id`,path:`/ec2/modify-volume/$id`,getParentRoute:()=>Z}),cd=Y.update({id:`/ec2/(vpc)/describe-vpcs/`,path:`/ec2/describe-vpcs/`,getParentRoute:()=>Z}),ld=Er.update({id:`/ec2/(vpc)/describe-vpcs/$id`,path:`/ec2/describe-vpcs/$id`,getParentRoute:()=>Z}),ud=X.update({id:`/ecr/(repositories)/list-repositories/`,path:`/ecr/list-repositories/`,getParentRoute:()=>Z}),dd=Dr.update({id:`/ecr/(repositories)/list-repositories/$id`,path:`/ecr/list-repositories/$id`,getParentRoute:()=>Z}),fd=zl.update({id:`/ecs/(clusters)/list-clusters/`,path:`/ecs/list-clusters/`,getParentRoute:()=>Z}),pd=Or.update({id:`/ecs/(clusters)/list-clusters/$clusterName`,path:`/ecs/list-clusters/$clusterName`,getParentRoute:()=>Z}),md=Bl.update({id:`/eks/(clusters)/list-clusters/`,path:`/eks/list-clusters/`,getParentRoute:()=>Z}),hd=ct.update({id:`/eks/(clusters)/list-clusters/$clusterName`,path:`/eks/list-clusters/$clusterName`,getParentRoute:()=>Z}),gd=Vl.update({id:`/iam/(groups)/list-groups/`,path:`/iam/list-groups/`,getParentRoute:()=>Z}),_d=kr.update({id:`/iam/(groups)/list-groups/$groupName`,path:`/iam/list-groups/$groupName`,getParentRoute:()=>Z}),vd=Hl.update({id:`/iam/(instance-profiles)/list-instance-profiles/`,path:`/iam/list-instance-profiles/`,getParentRoute:()=>Z}),$=Ar.update({id:`/iam/(instance-profiles)/list-instance-profiles/$instanceProfileName`,path:`/iam/list-instance-profiles/$instanceProfileName`,getParentRoute:()=>Z}),yd=Ul.update({id:`/iam/(policies)/list-policies/`,path:`/iam/list-policies/`,getParentRoute:()=>Z}),bd=jr.update({id:`/iam/(policies)/list-policies/$policyArn`,path:`/iam/list-policies/$policyArn`,getParentRoute:()=>Z}),xd=Wl.update({id:`/iam/(roles)/list-roles/`,path:`/iam/list-roles/`,getParentRoute:()=>Z}),Sd=Mr.update({id:`/iam/(roles)/list-roles/$roleName`,path:`/iam/list-roles/$roleName`,getParentRoute:()=>Z}),Cd=Gl.update({id:`/iam/(users)/list-users/`,path:`/iam/list-users/`,getParentRoute:()=>Z}),wd=Nr.update({id:`/iam/(users)/list-users/$userName`,path:`/iam/list-users/$userName`,getParentRoute:()=>Z}),Td=Kl.update({id:`/rds/(db-instances)/describe-db-instances/`,path:`/rds/describe-db-instances/`,getParentRoute:()=>Z}),Ed=Pr.update({id:`/rds/(db-instances)/describe-db-instances/$id`,path:`/rds/describe-db-instances/$id`,getParentRoute:()=>Z}),Dd=ql.update({id:`/rds/(parameter-groups)/describe-db-parameter-groups/`,path:`/rds/describe-db-parameter-groups/`,getParentRoute:()=>Z}),Od=Fr.update({id:`/rds/(parameter-groups)/describe-db-parameter-groups/$name`,path:`/rds/describe-db-parameter-groups/$name`,getParentRoute:()=>Z}),kd=Jl.update({id:`/rds/(snapshots)/describe-db-snapshots/`,path:`/rds/describe-db-snapshots/`,getParentRoute:()=>Z}),Ad=Ir.update({id:`/rds/(snapshots)/describe-db-snapshots/$id`,path:`/rds/describe-db-snapshots/$id`,getParentRoute:()=>Z}),jd=Lr.update({id:`/rds/(snapshots)/restore-db-instance-from-db-snapshot/$id`,path:`/rds/restore-db-instance-from-db-snapshot/$id`,getParentRoute:()=>Z}),Md=Yl.update({id:`/rds/(subnet-groups)/describe-db-subnet-groups/`,path:`/rds/describe-db-subnet-groups/`,getParentRoute:()=>Z}),Nd=Rr.update({id:`/rds/(subnet-groups)/describe-db-subnet-groups/$name`,path:`/rds/describe-db-subnet-groups/$name`,getParentRoute:()=>Z}),Pd=zr.update({id:`/`,path:`/`,getParentRoute:()=>ju}),Fd=Br.update({id:`/$`,path:`/$`,getParentRoute:()=>ju}),Id=Vr.update({id:`/ecs/(clusters)/list-clusters/$clusterName_/services/$serviceName`,path:`/ecs/list-clusters/$clusterName/services/$serviceName`,getParentRoute:()=>Z}),Ld=Hr.update({id:`/ecs/(clusters)/list-clusters/$clusterName_/tasks/$taskId`,path:`/ecs/list-clusters/$clusterName/tasks/$taskId`,getParentRoute:()=>Z}),Rd={AuthS3LsBucketSplatRoute:Fd,AuthS3LsBucketIndexRoute:Pd},zd={AuthNodesRoute:Ql,AuthIndexRoute:Zl,AuthS3ServiceMetricsRoute:$l,AuthS3LsBucketRouteRoute:ju._addFileChildren(Rd),AuthEc2elasticIpsAllocateAddressRoute:eu,AuthEc2instancesRunInstancesRoute:tu,AuthEc2internetGatewaysCreateInternetGatewayRoute:nu,AuthEc2keyCreateKeyPairRoute:ru,AuthEc2keyImportKeyPairRoute:iu,AuthEc2launchTemplatesCreateLaunchTemplateRoute:au,AuthEc2loadBalancersCreateLoadBalancerRoute:ou,AuthEc2natGatewaysCreateNatGatewayRoute:su,AuthEc2placementGroupsCreatePlacementGroupRoute:cu,AuthEc2routeTablesCreateRouteTableRoute:lu,AuthEc2securityGroupsCreateSecurityGroupRoute:uu,AuthEc2snapshotsCreateSnapshotRoute:du,AuthEc2subnetCreateSubnetRoute:fu,AuthEc2targetGroupsCreateTargetGroupRoute:pu,AuthEc2volumesCreateVolumeRoute:mu,AuthEc2vpcCreateVpcRoute:hu,AuthEcsclustersCreateServiceRoute:gu,AuthEcsclustersRegisterTaskDefinitionRoute:_u,AuthEcsclustersRunTaskRoute:vu,AuthEcsclustersTaskDefinitionsRoute:yu,AuthEksclustersCreateClusterRoute:bu,AuthIamgroupsCreateGroupRoute:xu,AuthIaminstanceProfilesCreateInstanceProfileRoute:Su,AuthIampoliciesCreatePolicyRoute:Cu,AuthIamrolesCreateRoleRoute:wu,AuthIamusersCreateUserRoute:Tu,AuthRdsdbInstancesCreateDbInstanceRoute:Eu,AuthRdsparameterGroupsCreateDbParameterGroupRoute:Du,AuthRdssubnetGroupsCreateDbSubnetGroupRoute:Ou,AuthS3bucketsCreateBucketRoute:ku,AuthS3LsIndexRoute:Au,AuthEc2elasticIpsDescribeAddressesIdRoute:Nu,AuthEc2imagesDescribeImagesIdRoute:Fu,AuthEc2instancesDescribeInstancesIdRoute:Lu,AuthEc2internetGatewaysDescribeInternetGatewaysIdRoute:zu,AuthEc2keyDescribeKeyPairsIdRoute:Vu,AuthEc2launchTemplatesDescribeLaunchTemplatesIdRoute:Uu,AuthEc2loadBalancersDescribeLoadBalancersIdRoute:Wu,AuthEc2natGatewaysDescribeNatGatewaysIdRoute:Ku,AuthEc2placementGroupsDescribePlacementGroupsIdRoute:Ju,AuthEc2routeTablesDescribeRouteTablesIdRoute:Xu,AuthEc2securityGroupsDescribeSecurityGroupsIdRoute:Qu,AuthEc2snapshotsDescribeSnapshotsIdRoute:ed,AuthEc2subnetDescribeSubnetsIdRoute:nd,AuthEc2targetGroupsDescribeTargetGroupsIdRoute:id,AuthEc2volumesDescribeVolumesIdRoute:od,AuthEc2volumesModifyVolumeIdRoute:sd,AuthEc2vpcDescribeVpcsIdRoute:ld,AuthEcrrepositoriesListRepositoriesIdRoute:dd,AuthEcsclustersListClustersClusterNameRoute:pd,AuthEksclustersListClustersClusterNameRoute:hd,AuthIamgroupsListGroupsGroupNameRoute:_d,AuthIaminstanceProfilesListInstanceProfilesInstanceProfileNameRoute:$,AuthIampoliciesListPoliciesPolicyArnRoute:bd,AuthIamrolesListRolesRoleNameRoute:Sd,AuthIamusersListUsersUserNameRoute:wd,AuthRdsdbInstancesDescribeDbInstancesIdRoute:Ed,AuthRdsparameterGroupsDescribeDbParameterGroupsNameRoute:Od,AuthRdssnapshotsDescribeDbSnapshotsIdRoute:Ad,AuthRdssnapshotsRestoreDbInstanceFromDbSnapshotIdRoute:jd,AuthRdssubnetGroupsDescribeDbSubnetGroupsNameRoute:Nd,AuthEc2elasticIpsDescribeAddressesIndexRoute:Mu,AuthEc2imagesDescribeImagesIndexRoute:Pu,AuthEc2instancesDescribeInstancesIndexRoute:Iu,AuthEc2internetGatewaysDescribeInternetGatewaysIndexRoute:Ru,AuthEc2keyDescribeKeyPairsIndexRoute:Bu,AuthEc2launchTemplatesDescribeLaunchTemplatesIndexRoute:Hu,AuthEc2loadBalancersDescribeLoadBalancersIndexRoute:Q,AuthEc2natGatewaysDescribeNatGatewaysIndexRoute:Gu,AuthEc2placementGroupsDescribePlacementGroupsIndexRoute:qu,AuthEc2routeTablesDescribeRouteTablesIndexRoute:Yu,AuthEc2securityGroupsDescribeSecurityGroupsIndexRoute:Zu,AuthEc2snapshotsDescribeSnapshotsIndexRoute:$u,AuthEc2subnetDescribeSubnetsIndexRoute:td,AuthEc2targetGroupsDescribeTargetGroupsIndexRoute:rd,AuthEc2volumesDescribeVolumesIndexRoute:ad,AuthEc2vpcDescribeVpcsIndexRoute:cd,AuthEcrrepositoriesListRepositoriesIndexRoute:ud,AuthEcsclustersListClustersIndexRoute:fd,AuthEksclustersListClustersIndexRoute:md,AuthIamgroupsListGroupsIndexRoute:gd,AuthIaminstanceProfilesListInstanceProfilesIndexRoute:vd,AuthIampoliciesListPoliciesIndexRoute:yd,AuthIamrolesListRolesIndexRoute:xd,AuthIamusersListUsersIndexRoute:Cd,AuthRdsdbInstancesDescribeDbInstancesIndexRoute:Td,AuthRdsparameterGroupsDescribeDbParameterGroupsIndexRoute:Dd,AuthRdssnapshotsDescribeDbSnapshotsIndexRoute:kd,AuthRdssubnetGroupsDescribeDbSubnetGroupsIndexRoute:Md,AuthEcsclustersListClustersClusterNameServicesServiceNameRoute:Id,AuthEcsclustersListClustersClusterNameTasksTaskIdRoute:Ld},Bd={AuthRouteRoute:Z._addFileChildren(zd),LoginRoute:Xl},Vd=Jc._addFileChildren(Bd)._addFileTypes(),Hd=Vc(),Ud=co({routeTree:Vd,context:{queryClient:Hd},defaultPreload:`intent`,scrollRestoration:!0,defaultStructuralSharing:!0,defaultPreloadStaleTime:0});async function Wd(e){try{await Ye()}catch(t){e.render((0,V.jsxs)(`div`,{style:{fontFamily:`sans-serif`,margin:`4rem auto`,maxWidth:`40rem`},children:[(0,V.jsx)(`h1`,{children:`Console unavailable`}),(0,V.jsx)(`p`,{children:`This cluster did not report its region, so the console cannot sign requests. Check that the serving node has a region set in its configuration.`}),(0,V.jsx)(`pre`,{children:t instanceof Error?t.message:String(t)})]}));return}e.render((0,V.jsx)(B.StrictMode,{children:(0,V.jsx)(wo,{defaultTheme:`dark`,storageKey:`spinifex-ui-theme`,children:(0,V.jsx)(_,{client:Hd,children:(0,V.jsx)(wn,{children:(0,V.jsx)(Sc,{children:(0,V.jsx)(U,{router:Ud})})})})})}))}var Gd=document.querySelector(`#app`);Gd&&!Gd.innerHTML&&await Wd(xo.createRoot(Gd)); \ No newline at end of file +`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Wt(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:qt(e,r,o);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,i.name,i,null),Md(e,t,`formEncType`,i.formEncType,i,null),Md(e,t,`formMethod`,i.formMethod,i,null),Md(e,t,`formTarget`,i.formTarget,i,null)):(Md(e,t,`encType`,i.encType,i,null),Md(e,t,`method`,i.method,i,null),Md(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Zt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Lt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),R(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),R(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Lt(r)+`"][href="`+Lt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),R(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=vt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);R(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),R(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),R(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=de.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=vt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=vt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=vt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Lt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),R(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Lt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Lt(n.href)+`"]`);if(r)return t.instance=r,R(r),r;var i=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),R(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,R(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),R(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,R(i),i):(r=n,(i=mf.get(o))&&(r=p({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),R(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,R(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),R(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=bo()}))(),1),W=i(),So=(0,B.createContext)(void 0);function Co(e,t){try{let t=localStorage.getItem(e);if(t===`light`||t===`dark`||t===`system`)return t}catch{}return t}function wo(e){let t=(0,W.c)(14),{children:n,defaultTheme:r,storageKey:i}=e,a=r===void 0?`dark`:r,o=i===void 0?`ui-theme`:i,s;t[0]!==a||t[1]!==o?(s=()=>Co(o,a),t[0]=a,t[1]=o,t[2]=s):s=t[2];let[c,l]=(0,B.useState)(s),u,d;t[3]===c?(u=t[4],d=t[5]):(u=()=>{let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),c===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(c)},d=[c],t[3]=c,t[4]=u,t[5]=d),(0,B.useEffect)(u,d);let f;t[6]===o?f=t[7]:(f=e=>{try{localStorage.setItem(o,e)}catch{}l(e)},t[6]=o,t[7]=f);let p;t[8]!==f||t[9]!==c?(p={theme:c,setTheme:f},t[8]=f,t[9]=c,t[10]=p):p=t[10];let m=p,h;return t[11]!==n||t[12]!==m?(h=(0,V.jsx)(So.Provider,{value:m,children:n}),t[11]=n,t[12]=m,t[13]=h):h=t[13],h}function To(){let e=(0,B.useContext)(So);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}var Eo=L(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Do=L(`book-open`,[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]),Oo=L(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),ko=L(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Ao=L(`container`,[[`path`,{d:`M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z`,key:`1t2lqe`}],[`path`,{d:`M10 21.9V14L2.1 9.1`,key:`o7czzq`}],[`path`,{d:`m10 14 11.9-6.9`,key:`zm5e20`}],[`path`,{d:`M14 19.8v-8.1`,key:`159ecu`}],[`path`,{d:`M18 17.5V9.4`,key:`11uown`}]]),jo=L(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),Mo=L(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),No=L(`file-stack`,[[`path`,{d:`M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1`,key:`likhh7`}],[`path`,{d:`M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1`,key:`17ky3x`}],[`path`,{d:`M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z`,key:`1hyeo0`}]]),Po=L(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Fo=L(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Io=L(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Lo=L(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Ro=L(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),zo=L(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),Bo=L(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Vo=L(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),Ho=L(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Uo=L(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),Wo=L(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Go=L(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Ko=L(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),qo=L(`users-round`,[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]]),Jo=L(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);function Yo(e,t){return t!=null&&!$t(t)?0:typeof e==`function`?e():e}function Xo(e,t,n){let r=Yo(e,n);return typeof r==`number`?r:r?.[t]}function Zo(e){return typeof e==`function`?e():e}function Qo(e,t){return t||e===`click`||e===`mousedown`}function $o(e){return e?.includes(`mouse`)&&e!==`mousedown`}var es=B.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Pt,currentIdRef:{current:null},currentContextRef:{current:null}});function ts(e,t){e.current=t.current}function ns(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=B.useRef(n),a=B.useRef(n),o=B.useRef(null),s=B.useRef(null),c=Ht();return mt(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:Xo(i.current,`open`),close:Xo(n,`close`)}},[n,o,i,a]),(0,V.jsx)(es.Provider,{value:B.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function rs(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=B.useContext(es),[f,p]=B.useState(!1),m=B.useRef(n);return mt(()=>{m.current=n},[n]),mt(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),mt(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Xo(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Tt(yt))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),mt(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,ts(o,c),d.clear()}},[l,a,o,i,c,d]),B.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function is(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function as(e){return e!=null&&e.clientX!=null}function os(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=B.useRef(!1),u=B.useRef(null),[d,f]=B.useState(),[p,m]=B.useState([]),h=ht(e=>{i.set(`positionReference`,e)}),g=ht((e,t,n)=>{l.current||c.current.openEvent&&!as(c.current.openEvent)||i.set(`positionReference`,is(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=ht(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=$t(d)?o:a;B.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=dt(o);function r(t){let n=R(t);Ot(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||as(c.current.openEvent)?u.current=Ie(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),B.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),B.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),B.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=B.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return B.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}var ss=Ae();function cs(e){let t=B.useCallback(t=>e===void 0?Ue:e.subscribeStore(t),[e]),n=B.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,ss.useSyncExternalStore)(t,n,()=>e?.serverStore)}var ls=Wt&&rn;function us(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=B.useRef(!1),c=B.useRef(null),l=B.useRef(!0),u=Ht();B.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=dt(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&ft(e)&&e===Et(vt(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return Bt(Ie(t,`blur`,r),ls&&Ie(t,`keydown`,a,!0),ls&&Ie(t,`pointerdown`,o,!0))},[i,n]),B.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);_t(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=B.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=R(t.nativeEvent);if(_t(a)){if(ls&&!t.relatedTarget){if(!l.current&&!Kt(a))return}else if(!qt(a))return}let o=Zt(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,Tt(Ct,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,Tt(Ct,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=_t(n)&&n.hasAttribute(At(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=Et(vt(e));!n&&t===e||Ot(o.current.floatingContext?.refs.floating.current,t)||Ot(e,t)||a||Zt(n??t,i.context.triggerElements)||i.setOpen(!1,Tt(Ct,r))})}}},[o,r,i,u]);return B.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var ds=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Pt,this.restTimeout=new Pt,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},fs=new WeakMap;function ps(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&fs.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),fs.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function ms(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=fs.get(n);a&&a!==e&&ps(a),ps(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,fs.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function hs(e){let t=e.context.dataRef.current,n=Ve(()=>t.hoverInteractionState??ds.create()).current;return t.hoverInteractionState||=n,Pe(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function gs(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=It(),d=Ft(),f=hs(a),p=Ht(),m=ht(()=>Qo(l.current.openEvent?.type,f.interactedInside)),h=ht(()=>$o(l.current.openEvent?.type)),g=ht(()=>{ps(f)});mt(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),B.useEffect(()=>g,[g]),mt(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&_t(c)&&s){let e=c,t=s,n=vt(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return ms(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),B.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&en(u.nodesRef.current,d).length>0)}function t(e){let t=Xo(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,Tt(xt,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=R(e);if(!Gt(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Zt(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&_t(o)&&en(u.nodesRef.current,r,!1).some(e=>Ot(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,Tt(xt,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Bt(y&&Ie(y,`mouseenter`,c),y&&Ie(y,`mouseleave`,_),y&&Ie(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var _s=e(Fe(),1),vs={current:null};function ys(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=vs,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=It(l),y=hs(h),b=B.useRef(!1),x=Re(i),S=Re(r),C=Re(o),w=Re(n),T=Re(p),E=Re(f),ee=ht(()=>Qo(g.current.openEvent?.type,y.interactedInside)),D=ht(()=>T.current?.()!==!1),te=ht((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!Ot(e,t);if(!_t(n))return!1;let i=n;return r.hasMatchingElement(e=>Ot(e,i))&&(!e||!Ot(e,i))}),O=ht(()=>{y.handler&&=(vt(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),ne=ht(()=>{ps(y)});return u&&(y.handleCloseOptions=x.current?.__options),B.useEffect(()=>O,[O]),B.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===xt,O(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,O]),B.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Xo(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,Tt(xt,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,Tt(xt,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!_t(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!$t(y.pointerType))return;let t=Zo(C.current),n=Xo(S.current,`open`,y.pointerType),r=R(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(_t(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(Ot(e,r)){s=e;break}}_t(i)&&_t(o)&&!h.context.triggerElements.hasElement(i)&&Ot(i,o)&&(s=o);let c=s!=null&&te(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&_t(s)&&_t(o)&&Ot(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){D()&&h.setOpen(!0,Tt(xt,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&D()&&h.setOpen(!0,Tt(xt,e,s))}):g&&D()&&h.setOpen(!0,Tt(xt,e,s)))}function i(t){if(ee()){ne();return}O();let n=h.select(`domReferenceElement`),r=vt(n);y.restTimeout.clear(),y.restTimeoutPending=!1;let i=g.current.floatingContext??d?.();if(!Zt(t.relatedTarget,h.context.triggerElements)){if(x.current&&i){h.select(`open`)||y.openChangeTimeout.clear();let n=c.current;y.handler=x.current({...i,tree:v,x:t.clientX,y:t.clientY,onClose(){ne(),O(),w.current&&!ee()&&n===h.select(`domReferenceElement`)&&e(t,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!Ot(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){Ot(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?Ie(t,`mouseout`,o):void 0;return s?Bt(Ie(t,`mousemove`,r,{once:!0}),Ie(t,`mouseenter`,r),Ie(t,`mouseleave`,i),l):Bt(Ie(t,`mouseenter`,r),Ie(t,`mouseleave`,i),l)},[O,ne,g,S,h,n,x,y,u,te,ee,a,s,C,c,v,w,d,E,D,m]),B.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=te(r,n,e.target);if(a&&!$t(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;ms(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Zo(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,ee())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&D()&&h.setOpen(!0,Tt(xt,t,n))}y.pointerType===`touch`?_s.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,ee,te,a,h,C,D])}var bs=.1,xs=bs*bs,Ss=.5;function Cs(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function ws(e,t,n,r,i,a,o,s,c,l){let u=!1;return Cs(e,t,n,r,i,a)&&(u=!u),Cs(e,t,i,a,o,s)&&(u=!u),Cs(e,t,o,s,c,l)&&(u=!u),Cs(e,t,c,l,n,r)&&(u=!u),u}function Ts(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Es(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Ds(e={}){let{blockPointerEvents:t=!1}=e,n=new Pt,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*xs;return u=e,d=t,f=n,o0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,ee=(T?x:S).left,D=(T?x:S).right,te=(E?x:S).top,O=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let ne=!1;switch(c){case`top`:ne=Es(d,f,ee,x.top+1,D,S.bottom-1);break;case`bottom`:ne=Es(d,f,ee,S.top+1,D,x.bottom-1);break;case`left`:ne=Es(d,f,S.right-1,O,x.left+1,te);break;case`right`:ne=Es(d,f,x.right-1,O,S.left+1,te)}if(ne)return;if(l&&!Ts(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let re=!1;switch(c){case`top`:{let n=T?Ss/2:Ss*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Ss+1,o=C||T?S.bottom-Ss:S.top,s=C?T?S.bottom-Ss:S.top:S.bottom-Ss;re=ws(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Ss/2:Ss*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Ss,o=C||T?S.top+Ss:S.bottom,s=C?T?S.top+Ss:S.bottom:S.top+Ss;re=ws(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Ss/2:Ss*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Ss+1,o=w||E?S.right-Ss:S.left,s=w?E?S.right-Ss:S.left:S.right-Ss;re=ws(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Ss/2:Ss*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Ss,o=w||E?S.left+Ss:S.right,s=w?E?S.left+Ss:S.right:S.left+Ss;re=ws(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}re?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Os(e){return gn(`dialog`,e)}function ks(e){let t=(0,W.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,V.jsx)(Os,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function As(e){let t=(0,W.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,V.jsx)(vn,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function js(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`data-closed:fade-out-0 data-open:fade-in-0 data-closed:animate-out data-open:animate-in fixed inset-0 z-50 bg-black/80 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(xn,{className:i,"data-slot":`sheet-overlay`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ms(e){let t=(0,W.c)(17),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,side:a,showCloseButton:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`right`:a,c=o===void 0||o,l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(js,{}),t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=F(`data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-closed:animate-out data-open:animate-in fixed z-50 flex flex-col bg-background bg-clip-padding text-xs/relaxed shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,r),t[7]=r,t[8]=u);let d;t[9]===c?d=t[10]:(d=c&&(0,V.jsxs)(hn,{"data-slot":`sheet-close`,render:(0,V.jsx)(gt,{className:`absolute top-4 right-4`,size:`icon-sm`,variant:`ghost`}),children:[(0,V.jsx)(lt,{}),(0,V.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[9]=c,t[10]=d);let f;return t[11]!==n||t[12]!==i||t[13]!==s||t[14]!==u||t[15]!==d?(f=(0,V.jsxs)(As,{children:[l,(0,V.jsxs)(mn,{className:u,"data-side":s,"data-slot":`sheet-content`,...i,children:[n,d]})]}),t[11]=n,t[12]=i,t[13]=s,t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function Ns(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex flex-col gap-1.5 p-6`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`div`,{className:i,"data-slot":`sheet-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ps(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`text-sm font-medium text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(bn,{className:i,"data-slot":`sheet-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Fs(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`text-xs/relaxed text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(pn,{className:i,"data-slot":`sheet-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Is=B.createContext(void 0);function Ls(e){let t=B.useContext(Is);if(t===void 0&&!e)throw Error(Ge(72));return t}var Rs={...yn,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},zs=class extends jt{constructor(e,t,n){let r=new tn;super(Bs(e,r,t,n),Vs(r),Rs)}setOpen=(e,t)=>{Jt(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Tt(bt,e))}};function Bs(e,t,n,r=!1){let i={...fn(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return i.floatingRootContext=_n(t,n,r),i}function Vs(e){return{popupRef:B.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Hs=Lt(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=zt((e,t)=>new zs({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),sn(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=Ut(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=B.useRef(null);mt(()=>{m&&t&&p.setOpen(!1,Tt(St))},[m,t,p]),mt(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),mt(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),B.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,Tt(wt))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,V.jsxs)(Is.Provider,{value:p,children:[l&&(0,V.jsx)(Yt,{handle:l,store:p}),T&&(0,V.jsx)(Us,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function Us({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=kt(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=os(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=B.useMemo(()=>Be(a.reference,i.reference),[a.reference,i.reference]);return on(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??ze}),null}var Ws=B.createContext(void 0);function Gs(){return B.useContext(Ws)}var Ks=`data-base-ui-tooltip-trigger`;function qs(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;em.select(`transitionStatus`)===`ending`,shouldOpen(){return!k.current}}),j=us(v,{enabled:!O}).reference,ue=e=>{let t=k.current,n=qs(e),r=ce(n),i=y.current,a=i&&n&&Ot(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,Tt(xt,e));return}if(t&&!r&&a&&!ne.current&&!m.select(`open`)&&i&&$t(ae.current)){let t=()=>{!k.current&&!ne.current&&!m.select(`open`)&&m.setOpen(!0,Tt(xt,e,i))},n=oe();n===0?(A.clear(),t()):A.start(n,t)}},M=m.useState(`triggerProps`,C);return He(`button`,e,{state:{open:_},ref:[t,S,y],props:[le,j,C||re!==`none`?M:void 0,{onMouseOver(e){ue(e.nativeEvent)},onFocus(e){se(qs(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){k.current=!1,A.clear(),ae.current=void 0},onPointerEnter(e){ae.current=e.pointerType},onPointerDown(e){ae.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,"data-trigger-disabled":O?``:void 0,[Ks]:O?void 0:``},f],stateAttributesMapping:nn})}),Xs=B.createContext(void 0);function Zs(){let e=B.useContext(Xs);if(e===void 0)throw Error(Ge(70));return e}var Qs=B.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Mt({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,V.jsxs)(B.Fragment,{children:[l,c&&_s.createPortal(n,c)]})}),$s=B.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Ls().useState(`mounted`)||n?(0,V.jsx)(Xs.Provider,{value:n,children:(0,V.jsx)(Qs,{ref:t,...r})}):null}),ec=B.createContext(void 0);function tc(){let e=B.useContext(ec);if(e===void 0)throw Error(Ge(71));return e}var nc=B.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Rt,style:g,..._}=e,v=Ls(),y=Zs(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),ee=v.useState(`adaptiveOrigin`),D=ln({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:ee}),te=B.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),O=un(e,te,{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,V.jsx)(ec.Provider,{value:D,children:O})}),rc=B.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Ls(),{side:s,align:c}=tc(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Le({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),gs(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return He(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Qt,f,cn(d),a],stateAttributesMapping:Nt})}),ic=B.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Ls(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=tc(),f={open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)};return He(`div`,e,{state:f,ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Vt})}),ac=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=B.useMemo(()=>({open:t,close:n}),[t,n]);return(0,V.jsx)(Ws.Provider,{value:t,children:(0,V.jsx)(ns,{delay:i,timeoutMs:r,children:e.children})})};function oc(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delay:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,V.jsx)(ac,{"data-slot":`tooltip-provider`,delay:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function sc(e){let t=(0,W.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,V.jsx)(oc,{children:(0,V.jsx)(Hs,{"data-slot":`tooltip`,...n})}),t[2]=n,t[3]=r),r}function cc(e){let t=(0,W.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,V.jsx)(Ys,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function lc(e){let t=(0,W.c)(21),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,side:a,sideOffset:o,align:s,alignOffset:c,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`top`:a,u=o===void 0?4:o,d=s===void 0?`center`:s,f=c===void 0?0:c,p;t[8]===r?p=t[9]:(p=F(`data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-closed:animate-out data-open:animate-in z-50 w-fit max-w-xs origin-(--transform-origin) rounded-md bg-foreground px-3 py-1.5 text-xs text-background **:data-[slot=kbd]:rounded-md`,r),t[8]=r,t[9]=p);let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,V.jsx)(ic,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`}),t[10]=m):m=t[10];let h;t[11]!==n||t[12]!==i||t[13]!==p?(h=(0,V.jsxs)(rc,{className:p,"data-slot":`tooltip-content`,...i,children:[n,m]}),t[11]=n,t[12]=i,t[13]=p,t[14]=h):h=t[14];let g;return t[15]!==d||t[16]!==f||t[17]!==l||t[18]!==u||t[19]!==h?(g=(0,V.jsx)($s,{children:(0,V.jsx)(nc,{align:d,alignOffset:f,className:`isolate z-50`,side:l,sideOffset:u,children:h})}),t[15]=d,t[16]=f,t[17]=l,t[18]=u,t[19]=h,t[20]=g):g=t[20],g}var uc=window.matchMedia(`(max-width: 767px)`);function dc(e){return uc.addEventListener(`change`,e),()=>{uc.removeEventListener(`change`,e)}}function fc(){return uc.matches}function pc(){return(0,B.useSyncExternalStore)(dc,fc)}var mc=`sidebar_state`,hc=604800,gc=`12rem`,_c=`16rem`,vc=`3rem`,yc=`b`,bc=B.createContext(null);function xc(){let e=B.useContext(bc);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Sc(e){let t=(0,W.c)(36),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0||c,u=pc(),[d,f]=B.useState(!1),[p,m]=B.useState(l),h=i??p,g;t[8]!==h||t[9]!==o?(g=e=>{let t=typeof e==`function`?e(h):e;o?o(t):m(t),document.cookie=`${mc}=${t}; path=/; max-age=${hc}`},t[8]=h,t[9]=o,t[10]=g):g=t[10];let _=g,v;t[11]!==u||t[12]!==_?(v=()=>{u?f(wc):_(Cc)},t[11]=u,t[12]=_,t[13]=v):v=t[13];let y=v,b,x;t[14]===y?(b=t[15],x=t[16]):(b=()=>{let e=e=>{e.key===yc&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),y())};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},x=[y],t[14]=y,t[15]=b,t[16]=x),B.useEffect(b,x);let S=h?`expanded`:`collapsed`,C;t[17]!==u||t[18]!==h||t[19]!==d||t[20]!==_||t[21]!==S||t[22]!==y?(C={state:S,open:h,setOpen:_,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:y},t[17]=u,t[18]=h,t[19]=d,t[20]=_,t[21]=S,t[22]=y,t[23]=C):C=t[23];let w=C,T;t[24]===s?T=t[25]:(T={"--sidebar-width":gc,"--sidebar-width-icon":vc,...s},t[24]=s,t[25]=T);let E=T,ee;t[26]===r?ee=t[27]:(ee=F(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[26]=r,t[27]=ee);let D;t[28]!==n||t[29]!==a||t[30]!==ee||t[31]!==E?(D=(0,V.jsx)(`div`,{className:ee,"data-slot":`sidebar-wrapper`,style:E,...a,children:n}),t[28]=n,t[29]=a,t[30]=ee,t[31]=E,t[32]=D):D=t[32];let te;return t[33]!==w||t[34]!==D?(te=(0,V.jsx)(bc.Provider,{value:w,children:D}),t[33]=w,t[34]=D,t[35]=te):te=t[35],te}function Cc(e){return!e}function wc(e){return!e}function Tc(e){let t=(0,W.c)(46),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({side:a,variant:o,collapsible:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`left`:a,l=o===void 0?`sidebar`:o,u=s===void 0?`offExamples`:s,{isMobile:d,state:f,openMobile:p,setOpenMobile:m}=xc();if(u===`none`){let e;t[7]===r?e=t[8]:(e=F(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[7]=r,t[8]=e);let a;return t[9]!==n||t[10]!==i||t[11]!==e?(a=(0,V.jsx)(`div`,{className:e,"data-slot":`sidebar`,...i,children:n}),t[9]=n,t[10]=i,t[11]=e,t[12]=a):a=t[12],a}if(d){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e={"--sidebar-width":_c},t[13]=e):e=t[13];let r=e,a;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsxs)(Ns,{className:`sr-only`,children:[(0,V.jsx)(Ps,{children:`Sidebar`}),(0,V.jsx)(Fs,{children:`Displays the mobile sidebar.`})]}),t[14]=a):a=t[14];let o;t[15]===n?o=t[16]:(o=(0,V.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:n}),t[15]=n,t[16]=o);let s;t[17]!==c||t[18]!==o?(s=(0,V.jsxs)(Ms,{className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,"data-mobile":`true`,"data-sidebar":`sidebar`,"data-slot":`sidebar`,side:c,style:r,children:[a,o]}),t[17]=c,t[18]=o,t[19]=s):s=t[19];let l;return t[20]!==p||t[21]!==i||t[22]!==m||t[23]!==s?(l=(0,V.jsx)(ks,{onOpenChange:m,open:p,...i,children:s}),t[20]=p,t[21]=i,t[22]=m,t[23]=s,t[24]=l):l=t[24],l}let h=f===`collapsed`?u:``,g=l===`floating`||l===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,_;t[25]===g?_=t[26]:(_=F(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offExamples]:w-0`,`group-data-[side=right]:rotate-180`,g),t[25]=g,t[26]=_);let v;t[27]===_?v=t[28]:(v=(0,V.jsx)(`div`,{className:_,"data-slot":`sidebar-gap`}),t[27]=_,t[28]=v);let y=c===`left`?`left-0 group-data-[collapsible=offExamples]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offExamples]:right-[calc(var(--sidebar-width)*-1)]`,b=l===`floating`||l===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,x;t[29]!==r||t[30]!==y||t[31]!==b?(x=F(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,y,b,r),t[29]=r,t[30]=y,t[31]=b,t[32]=x):x=t[32];let S;t[33]===n?S=t[34]:(S=(0,V.jsx)(`div`,{className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,children:n}),t[33]=n,t[34]=S);let C;t[35]!==i||t[36]!==x||t[37]!==S?(C=(0,V.jsx)(`div`,{className:x,"data-slot":`sidebar-container`,...i,children:S}),t[35]=i,t[36]=x,t[37]=S,t[38]=C):C=t[38];let w;return t[39]!==c||t[40]!==f||t[41]!==C||t[42]!==h||t[43]!==v||t[44]!==l?(w=(0,V.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-collapsible":h,"data-side":c,"data-slot":`sidebar`,"data-state":f,"data-variant":l,children:[v,C]}),t[39]=c,t[40]=f,t[41]=C,t[42]=h,t[43]=v,t[44]=l,t[45]=w):w=t[45],w}function Ec(e){let t=(0,W.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a}=xc(),o;t[4]===n?o=t[5]:(o=F(n),t[4]=n,t[5]=o);let s;t[6]!==r||t[7]!==a?(s=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=s):s=t[8];let c,l;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(Ho,{}),l=(0,V.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),t[9]=c,t[10]=l):(c=t[9],l=t[10]);let u;return t[11]!==i||t[12]!==o||t[13]!==s?(u=(0,V.jsxs)(gt,{className:o,"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,onClick:s,size:`icon-lg`,variant:`ghost`,...i,children:[c,l]}),t[11]=i,t[12]=o,t[13]=s,t[14]=u):u=t[14],u}function Dc(e){let t=(0,W.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{toggleSidebar:i}=xc(),a;t[3]===n?a=t[4]:(a=F(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offExamples]:translate-x-0 group-data-[collapsible=offExamples]:after:left-full hover:group-data-[collapsible=offExamples]:bg-sidebar`,`[[data-side=left][data-collapsible=offExamples]_&]:-right-2`,`[[data-side=right][data-collapsible=offExamples]_&]:-left-2`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a||t[7]!==i?(o=(0,V.jsx)(`button`,{"aria-label":`Toggle Sidebar`,className:a,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,onClick:i,tabIndex:-1,title:`Toggle Sidebar`,type:`button`,...r}),t[5]=r,t[6]=a,t[7]=i,t[8]=o):o=t[8],o}function Oc(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`div`,{className:i,"data-sidebar":`header`,"data-slot":`sidebar-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function kc(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`div`,{className:i,"data-sidebar":`footer`,"data-slot":`sidebar-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ac(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`mx-2 w-auto bg-sidebar-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(dn,{className:i,"data-sidebar":`separator`,"data-slot":`sidebar-separator`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function jc(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto`,`group-data-[collapsible=icon]:[scrollbar-width:none] group-data-[collapsible=icon]:[&::-webkit-scrollbar]:hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`div`,{className:i,"data-sidebar":`content`,"data-slot":`sidebar-content`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Mc(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`relative flex w-full min-w-0 flex-col px-2 py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`div`,{className:i,"data-sidebar":`group`,"data-slot":`sidebar-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nc(e){let t=(0,W.c)(10),n,r,i,a;if(t[0]!==e){let{className:o,render:s,...c}=e;n=s,a=Ke,r=`div`,i=Be({className:F(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,o)},c),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a}else n=t[1],r=t[2],i=t[3],a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o={slot:`sidebar-group-label`,sidebar:`group-label`},t[5]=o):o=t[5];let s;return t[6]!==n||t[7]!==r||t[8]!==i?(s={defaultTagName:r,props:i,render:n,state:o},t[6]=n,t[7]=r,t[8]=i,t[9]=s):s=t[9],a(s)}function Pc(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`flex w-full min-w-0 flex-col gap-px`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`ul`,{className:i,"data-sidebar":`menu`,"data-slot":`sidebar-menu`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function G(e){let t=(0,W.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`li`,{className:i,"data-sidebar":`menu-item`,"data-slot":`sidebar-menu-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Fc=We(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-xs`,sm:`h-7 text-xs`,lg:`h-12 text-xs group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function K(e){let t=(0,W.c)(15),{render:n,isActive:r,variant:i,size:a,tooltip:o,className:s,...c}=e,l=r!==void 0&&r,u=i===void 0?`default`:i,d=a===void 0?`default`:a,{isMobile:f,state:p}=xc(),m=Be({className:F(Fc({variant:u,size:d}),s)},c),h=o?cc:n,g;t[0]!==l||t[1]!==d?(g={slot:`sidebar-menu-button`,sidebar:`menu-button`,size:d,active:l},t[0]=l,t[1]=d,t[2]=g):g=t[2];let _;t[3]!==m||t[4]!==h||t[5]!==g?(_={defaultTagName:`button`,props:m,render:h,state:g},t[3]=m,t[4]=h,t[5]=g,t[6]=_):_=t[6];let v=Ke(_);if(!o)return v;let y;t[7]===o?y=t[8]:(y=typeof o==`string`?{children:o}:o,t[7]=o,t[8]=y);let b=y,x=p!==`collapsed`||f,S;t[9]!==x||t[10]!==b?(S=(0,V.jsx)(lc,{align:`center`,hidden:x,side:`right`,...b}),t[9]=x,t[10]=b,t[11]=S):S=t[11];let C;return t[12]!==v||t[13]!==S?(C=(0,V.jsxs)(sc,{children:[v,S]}),t[12]=v,t[13]=S,t[14]=C):C=t[14],C}var Ic=new Set([`InvalidClientTokenId`,`SignatureDoesNotMatch`,`AuthFailure`,`MissingAuthenticationToken`,`IncompleteSignature`,`UnrecognizedClientException`,`ExpiredToken`,`ExpiredTokenException`,`InvalidAccessKeyId`]);function Lc(e){return typeof e==`object`&&!!e&&`name`in e&&typeof e.name==`string`}function Rc(e){return Lc(e)&&Ic.has(e.name)}var zc=!1;function Bc(e,t){zc||!Rc(e)||(zc=!0,Je(),Sn(),t.clear(),window.location.pathname!==`/login`&&(window.location.href=`/login?reason=expired`))}function Vc(){let e=new Kr({queryCache:new Gr({onError:t=>{Bc(t,e)}}),mutationCache:new Ur({onError:t=>{Bc(t,e)}}),defaultOptions:{queries:{staleTime:5e3,refetchIntervalInBackground:!1}}});return e}function Hc(){let e=(0,W.c)(8),{theme:t,setTheme:n}=To(),r;e[0]!==n||e[1]!==t?(r=()=>{n(t===`light`?`dark`:t===`dark`?`light`:`dark`)},e[0]=n,e[1]=t,e[2]=r):r=e[2];let i=r,a,o,s;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(Go,{className:`size-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90`}),o=(0,V.jsx)(Bo,{className:`absolute size-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0`}),s=(0,V.jsx)(`span`,{className:`sr-only`,children:`Toggle theme`}),e[3]=a,e[4]=o,e[5]=s):(a=e[3],o=e[4],s=e[5]);let c;return e[6]===i?c=e[7]:(c=(0,V.jsxs)(gt,{className:`rounded-full`,onClick:i,size:`icon-sm`,variant:`ghost`,children:[a,o,s]}),e[6]=i,e[7]=c),c}function Uc(){let e=(0,W.c)(7),{isAdmin:t,license:n}=Cn(),r=t&&n===`open-source`,i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=F(`z-50 flex h-10 shrink-0 items-center gap-2 border-b border-sidebar-border bg-sidebar px-4 text-sidebar-foreground`,`sticky top-0`),a=(0,V.jsx)(Ec,{className:`-ml-1`}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let o;e[2]===r?o=e[3]:(o=r&&(0,V.jsx)(`a`,{href:`https://mulgadc.com/purchase`,target:`_blank`,rel:`noopener noreferrer`,className:F(pt({variant:`outline`,size:`sm`})),children:`Upgrade`}),e[2]=r,e[3]=o);let s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(Hc,{}),e[4]=s):s=e[4];let c;return e[5]===o?c=e[6]:(c=(0,V.jsxs)(`header`,{className:i,children:[a,(0,V.jsxs)(`div`,{className:`flex w-full items-center justify-end gap-2`,children:[o,s]})]}),e[5]=o,e[6]=c),c}function Wc(){let e=(0,W.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`h1`,{className:`text-4xl font-bold`,children:`404`}),n=(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:`Page not found`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,V.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-4`,children:[t,n,(0,V.jsx)(M,{to:`/`,children:(0,V.jsx)(gt,{variant:`outline`,children:`Go back home`})})]}),e[2]=r):r=e[2],r}function Gc(){let e=(0,W.c)(255),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={select:Kc},e[0]=t):t=e[0];let n=uo(t),r=Ne(),i=h(),{isAdmin:a}=Cn(),o;e[1]!==r||e[2]!==i?(o=function(){Je(),Sn(),i.clear(),r({to:`/login`})},e[1]=r,e[2]=i,e[3]=o):o=e[3];let s=o,c;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsxs)(Oc,{className:`flex flex-row items-center gap-2 px-4 py-3`,children:[(0,V.jsx)(`img`,{src:`/mulga-logo.svg`,alt:`Mulga`,className:`size-6 shrink-0 dark:invert`}),(0,V.jsx)(`span`,{className:`truncate text-sm font-semibold group-data-[collapsible=icon]:hidden`,children:`Spinifex`})]}),e[4]=c):c=e[4];let l;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(Nc,{children:`General`}),e[5]=l):l=e[5];let u=n===`/`,d,f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,V.jsx)(Po,{className:`size-4`}),f=(0,V.jsx)(`span`,{children:`Dashboard`}),e[6]=d,e[7]=f):(d=e[6],f=e[7]);let p;e[8]===u?p=e[9]:(p=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/`,children:(0,V.jsxs)(K,{isActive:u,tooltip:`Dashboard`,children:[d,f]})})}),e[8]=u,e[9]=p);let m;e[10]!==a||e[11]!==n?(m=a&&(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/nodes`,children:(0,V.jsxs)(K,{isActive:n.startsWith(`/nodes`),tooltip:`Nodes`,children:[(0,V.jsx)(nt,{className:`size-4`}),(0,V.jsx)(`span`,{children:`Nodes`})]})})}),e[10]=a,e[11]=n,e[12]=m):m=e[12];let g;e[13]!==p||e[14]!==m?(g=(0,V.jsxs)(Mc,{children:[l,(0,V.jsxs)(Pc,{children:[p,m]})]}),e[13]=p,e[14]=m,e[15]=g):g=e[15];let _;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,V.jsx)(Nc,{children:`EC2`}),e[16]=_):_=e[16];let v;e[17]===n?v=e[18]:(v=n.startsWith(`/ec2/describe-instances`)||n.startsWith(`/ec2/run-instances`),e[17]=n,e[18]=v);let y,b;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,V.jsx)(nt,{className:`size-4`}),b=(0,V.jsx)(`span`,{children:`Instances`}),e[19]=y,e[20]=b):(y=e[19],b=e[20]);let x;e[21]===v?x=e[22]:(x=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-instances`,children:(0,V.jsxs)(K,{isActive:v,tooltip:`Instances`,children:[y,b]})})}),e[21]=v,e[22]=x);let S;e[23]===n?S=e[24]:(S=n.startsWith(`/ec2/describe-launch-templates`)||n.startsWith(`/ec2/create-launch-template`),e[23]=n,e[24]=S);let C,w;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,V.jsx)(No,{className:`size-4`}),w=(0,V.jsx)(`span`,{children:`Launch Templates`}),e[25]=C,e[26]=w):(C=e[25],w=e[26]);let T;e[27]===S?T=e[28]:(T=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-launch-templates`,children:(0,V.jsxs)(K,{isActive:S,tooltip:`Launch Templates`,children:[C,w]})})}),e[27]=S,e[28]=T);let E;e[29]===n?E=e[30]:(E=n.startsWith(`/ec2/describe-images`),e[29]=n,e[30]=E);let ee,D;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,V.jsx)(at,{className:`size-4`}),D=(0,V.jsx)(`span`,{children:`Images`}),e[31]=ee,e[32]=D):(ee=e[31],D=e[32]);let te;e[33]===E?te=e[34]:(te=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-images`,children:(0,V.jsxs)(K,{isActive:E,tooltip:`Images`,children:[ee,D]})})}),e[33]=E,e[34]=te);let O;e[35]===n?O=e[36]:(O=n.startsWith(`/ec2/describe-key-pairs`),e[35]=n,e[36]=O);let ne,re;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,V.jsx)(tt,{className:`size-4`}),re=(0,V.jsx)(`span`,{children:`Key Pairs`}),e[37]=ne,e[38]=re):(ne=e[37],re=e[38]);let ie;e[39]===O?ie=e[40]:(ie=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-key-pairs`,children:(0,V.jsxs)(K,{isActive:O,tooltip:`Key Pairs`,children:[ne,re]})})}),e[39]=O,e[40]=ie);let k;e[41]===n?k=e[42]:(k=n.startsWith(`/ec2/describe-addresses`)||n.startsWith(`/ec2/allocate-address`),e[41]=n,e[42]=k);let A,ae;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,V.jsx)(zo,{className:`size-4`}),ae=(0,V.jsx)(`span`,{children:`Elastic IPs`}),e[43]=A,e[44]=ae):(A=e[43],ae=e[44]);let oe;e[45]===k?oe=e[46]:(oe=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-addresses`,children:(0,V.jsxs)(K,{isActive:k,tooltip:`Elastic IPs`,children:[A,ae]})})}),e[45]=k,e[46]=oe);let se;e[47]===n?se=e[48]:(se=n.startsWith(`/ec2/describe-volumes`)||n.startsWith(`/ec2/create-volume`)||n.startsWith(`/ec2/modify-volume`),e[47]=n,e[48]=se);let ce,le;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,V.jsx)(rt,{className:`size-4`}),le=(0,V.jsx)(`span`,{children:`Volumes`}),e[49]=ce,e[50]=le):(ce=e[49],le=e[50]);let j;e[51]===se?j=e[52]:(j=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-volumes`,children:(0,V.jsxs)(K,{isActive:se,tooltip:`Volumes`,children:[ce,le]})})}),e[51]=se,e[52]=j);let ue;e[53]===n?ue=e[54]:(ue=n.startsWith(`/ec2/describe-snapshots`)||n.startsWith(`/ec2/create-snapshot`),e[53]=n,e[54]=ue);let de,fe;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,V.jsx)(Xe,{className:`size-4`}),fe=(0,V.jsx)(`span`,{children:`Snapshots`}),e[55]=de,e[56]=fe):(de=e[55],fe=e[56]);let pe;e[57]===ue?pe=e[58]:(pe=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-snapshots`,children:(0,V.jsxs)(K,{isActive:ue,tooltip:`Snapshots`,children:[de,fe]})})}),e[57]=ue,e[58]=pe);let me;e[59]===n?me=e[60]:(me=n.startsWith(`/ec2/describe-placement-groups`)||n.startsWith(`/ec2/create-placement-group`),e[59]=n,e[60]=me);let he,ge;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,V.jsx)(Io,{className:`size-4`}),ge=(0,V.jsx)(`span`,{children:`Placement Groups`}),e[61]=he,e[62]=ge):(he=e[61],ge=e[62]);let _e;e[63]===me?_e=e[64]:(_e=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-placement-groups`,children:(0,V.jsxs)(K,{isActive:me,tooltip:`Placement Groups`,children:[he,ge]})})}),e[63]=me,e[64]=_e);let ve;e[65]===n?ve=e[66]:(ve=n.startsWith(`/ec2/describe-load-balancers`)||n.startsWith(`/ec2/create-load-balancer`),e[65]=n,e[66]=ve);let ye,be;e[67]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,V.jsx)(it,{className:`size-4`}),be=(0,V.jsx)(`span`,{children:`Load Balancers`}),e[67]=ye,e[68]=be):(ye=e[67],be=e[68]);let xe;e[69]===ve?xe=e[70]:(xe=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-load-balancers`,children:(0,V.jsxs)(K,{isActive:ve,tooltip:`Load Balancers`,children:[ye,be]})})}),e[69]=ve,e[70]=xe);let Se;e[71]===n?Se=e[72]:(Se=n.startsWith(`/ec2/describe-target-groups`)||n.startsWith(`/ec2/create-target-group`),e[71]=n,e[72]=Se);let Ce,we;e[73]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,V.jsx)(jo,{className:`size-4`}),we=(0,V.jsx)(`span`,{children:`Target Groups`}),e[73]=Ce,e[74]=we):(Ce=e[73],we=e[74]);let Te;e[75]===Se?Te=e[76]:(Te=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-target-groups`,children:(0,V.jsxs)(K,{isActive:Se,tooltip:`Target Groups`,children:[Ce,we]})})}),e[75]=Se,e[76]=Te);let Ee;e[77]!==x||e[78]!==T||e[79]!==te||e[80]!==ie||e[81]!==oe||e[82]!==j||e[83]!==pe||e[84]!==_e||e[85]!==xe||e[86]!==Te?(Ee=(0,V.jsxs)(Mc,{children:[_,(0,V.jsxs)(Pc,{children:[x,T,te,ie,oe,j,pe,_e,xe,Te]})]}),e[77]=x,e[78]=T,e[79]=te,e[80]=ie,e[81]=oe,e[82]=j,e[83]=pe,e[84]=_e,e[85]=xe,e[86]=Te,e[87]=Ee):Ee=e[87];let N;e[88]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,V.jsx)(Nc,{children:`Networking`}),e[88]=N):N=e[88];let De;e[89]===n?De=e[90]:(De=n.startsWith(`/ec2/describe-vpcs`)||n.startsWith(`/ec2/create-vpc`),e[89]=n,e[90]=De);let P,Oe;e[91]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,V.jsx)(Ze,{className:`size-4`}),Oe=(0,V.jsx)(`span`,{children:`VPCs`}),e[91]=P,e[92]=Oe):(P=e[91],Oe=e[92]);let ke;e[93]===De?ke=e[94]:(ke=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-vpcs`,children:(0,V.jsxs)(K,{isActive:De,tooltip:`VPCs`,children:[P,Oe]})})}),e[93]=De,e[94]=ke);let Ae;e[95]===n?Ae=e[96]:(Ae=n.startsWith(`/ec2/describe-subnets`)||n.startsWith(`/ec2/create-subnet`),e[95]=n,e[96]=Ae);let je,Me;e[97]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,V.jsx)(Lo,{className:`size-4`}),Me=(0,V.jsx)(`span`,{children:`Subnets`}),e[97]=je,e[98]=Me):(je=e[97],Me=e[98]);let Pe;e[99]===Ae?Pe=e[100]:(Pe=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-subnets`,children:(0,V.jsxs)(K,{isActive:Ae,tooltip:`Subnets`,children:[je,Me]})})}),e[99]=Ae,e[100]=Pe);let Fe;e[101]===n?Fe=e[102]:(Fe=n.startsWith(`/ec2/describe-security-groups`)||n.startsWith(`/ec2/create-security-group`),e[101]=n,e[102]=Fe);let Ie,Le;e[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,V.jsx)(Wo,{className:`size-4`}),Le=(0,V.jsx)(`span`,{children:`Security Groups`}),e[103]=Ie,e[104]=Le):(Ie=e[103],Le=e[104]);let Re;e[105]===Fe?Re=e[106]:(Re=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-security-groups`,children:(0,V.jsxs)(K,{isActive:Fe,tooltip:`Security Groups`,children:[Ie,Le]})})}),e[105]=Fe,e[106]=Re);let ze;e[107]===n?ze=e[108]:(ze=n.startsWith(`/ec2/describe-route-tables`)||n.startsWith(`/ec2/create-route-table`),e[107]=n,e[108]=ze);let Be,Ve;e[109]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,V.jsx)(Uo,{className:`size-4`}),Ve=(0,V.jsx)(`span`,{children:`Route Tables`}),e[109]=Be,e[110]=Ve):(Be=e[109],Ve=e[110]);let He;e[111]===ze?He=e[112]:(He=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-route-tables`,children:(0,V.jsxs)(K,{isActive:ze,tooltip:`Route Tables`,children:[Be,Ve]})})}),e[111]=ze,e[112]=He);let Ue;e[113]===n?Ue=e[114]:(Ue=n.startsWith(`/ec2/describe-internet-gateways`),e[113]=n,e[114]=Ue);let We,Ge;e[115]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,V.jsx)(Qe,{className:`size-4`}),Ge=(0,V.jsx)(`span`,{children:`Internet Gateways`}),e[115]=We,e[116]=Ge):(We=e[115],Ge=e[116]);let Ke;e[117]===Ue?Ke=e[118]:(Ke=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-internet-gateways`,children:(0,V.jsxs)(K,{isActive:Ue,tooltip:`Internet Gateways`,children:[We,Ge]})})}),e[117]=Ue,e[118]=Ke);let F;e[119]===n?F=e[120]:(F=n.startsWith(`/ec2/describe-nat-gateways`)||n.startsWith(`/ec2/create-nat-gateway`),e[119]=n,e[120]=F);let qe,I;e[121]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,V.jsx)($e,{className:`size-4`}),I=(0,V.jsx)(`span`,{children:`NAT Gateways`}),e[121]=qe,e[122]=I):(qe=e[121],I=e[122]);let Ye;e[123]===F?Ye=e[124]:(Ye=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ec2/describe-nat-gateways`,children:(0,V.jsxs)(K,{isActive:F,tooltip:`NAT Gateways`,children:[qe,I]})})}),e[123]=F,e[124]=Ye);let L;e[125]!==ke||e[126]!==Pe||e[127]!==Re||e[128]!==He||e[129]!==Ke||e[130]!==Ye?(L=(0,V.jsxs)(Mc,{children:[N,(0,V.jsxs)(Pc,{children:[ke,Pe,Re,He,Ke,Ye]})]}),e[125]=ke,e[126]=Pe,e[127]=Re,e[128]=He,e[129]=Ke,e[130]=Ye,e[131]=L):L=e[131];let ot;e[132]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,V.jsx)(Nc,{children:`Containers`}),e[132]=ot):ot=e[132];let ct;e[133]===n?ct=e[134]:(ct=n.startsWith(`/eks/list-clusters`)||n.startsWith(`/eks/create-cluster`),e[133]=n,e[134]=ct);let lt,ut;e[135]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,V.jsx)(Oo,{className:`size-4`}),ut=(0,V.jsx)(`span`,{children:`EKS`}),e[135]=lt,e[136]=ut):(lt=e[135],ut=e[136]);let dt;e[137]===ct?dt=e[138]:(dt=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/eks/list-clusters`,children:(0,V.jsxs)(K,{isActive:ct,tooltip:`EKS clusters`,children:[lt,ut]})})}),e[137]=ct,e[138]=dt);let ft;e[139]===n?ft=e[140]:(ft=n.startsWith(`/ecr/list-repositories`),e[139]=n,e[140]=ft);let pt,mt;e[141]===Symbol.for(`react.memo_cache_sentinel`)?(pt=(0,V.jsx)(Vo,{className:`size-4`}),mt=(0,V.jsx)(`span`,{children:`ECR`}),e[141]=pt,e[142]=mt):(pt=e[141],mt=e[142]);let ht;e[143]===ft?ht=e[144]:(ht=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ecr/list-repositories`,children:(0,V.jsxs)(K,{isActive:ft,tooltip:`ECR repositories`,children:[pt,mt]})})}),e[143]=ft,e[144]=ht);let gt;e[145]===n?gt=e[146]:(gt=n.startsWith(`/ecs/`),e[145]=n,e[146]=gt);let _t,vt;e[147]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,V.jsx)(Ao,{className:`size-4`}),vt=(0,V.jsx)(`span`,{children:`ECS`}),e[147]=_t,e[148]=vt):(_t=e[147],vt=e[148]);let R;e[149]===gt?R=e[150]:(R=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/ecs/list-clusters`,children:(0,V.jsxs)(K,{isActive:gt,tooltip:`ECS clusters`,children:[_t,vt]})})}),e[149]=gt,e[150]=R);let yt;e[151]!==dt||e[152]!==ht||e[153]!==R?(yt=(0,V.jsxs)(Mc,{children:[ot,(0,V.jsxs)(Pc,{children:[dt,ht,R]})]}),e[151]=dt,e[152]=ht,e[153]=R,e[154]=yt):yt=e[154];let bt;e[155]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,V.jsx)(Nc,{children:`RDS`}),e[155]=bt):bt=e[155];let xt;e[156]===n?xt=e[157]:(xt=n.startsWith(`/rds/describe-db-instances`)||n.startsWith(`/rds/create-db-instance`),e[156]=n,e[157]=xt);let St,Ct;e[158]===Symbol.for(`react.memo_cache_sentinel`)?(St=(0,V.jsx)(Mo,{className:`size-4`}),Ct=(0,V.jsx)(`span`,{children:`Databases`}),e[158]=St,e[159]=Ct):(St=e[158],Ct=e[159]);let wt;e[160]===xt?wt=e[161]:(wt=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/rds/describe-db-instances`,children:(0,V.jsxs)(K,{isActive:xt,tooltip:`Databases`,children:[St,Ct]})})}),e[160]=xt,e[161]=wt);let Tt;e[162]===n?Tt=e[163]:(Tt=n.startsWith(`/rds/describe-db-snapshots`)||n.startsWith(`/rds/restore-db-instance-from-db-snapshot`),e[162]=n,e[163]=Tt);let Et,Dt;e[164]===Symbol.for(`react.memo_cache_sentinel`)?(Et=(0,V.jsx)(Xe,{className:`size-4`}),Dt=(0,V.jsx)(`span`,{children:`Snapshots`}),e[164]=Et,e[165]=Dt):(Et=e[164],Dt=e[165]);let Ot;e[166]===Tt?Ot=e[167]:(Ot=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/rds/describe-db-snapshots`,children:(0,V.jsxs)(K,{isActive:Tt,tooltip:`DB Snapshots`,children:[Et,Dt]})})}),e[166]=Tt,e[167]=Ot);let kt;e[168]===n?kt=e[169]:(kt=n.startsWith(`/rds/describe-db-subnet-groups`)||n.startsWith(`/rds/create-db-subnet-group`),e[168]=n,e[169]=kt);let At,jt;e[170]===Symbol.for(`react.memo_cache_sentinel`)?(At=(0,V.jsx)(Lo,{className:`size-4`}),jt=(0,V.jsx)(`span`,{children:`Subnet Groups`}),e[170]=At,e[171]=jt):(At=e[170],jt=e[171]);let Mt;e[172]===kt?Mt=e[173]:(Mt=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/rds/describe-db-subnet-groups`,children:(0,V.jsxs)(K,{isActive:kt,tooltip:`DB Subnet Groups`,children:[At,jt]})})}),e[172]=kt,e[173]=Mt);let Nt;e[174]===n?Nt=e[175]:(Nt=n.startsWith(`/rds/describe-db-parameter-groups`)||n.startsWith(`/rds/create-db-parameter-group`),e[174]=n,e[175]=Nt);let Pt,Ft;e[176]===Symbol.for(`react.memo_cache_sentinel`)?(Pt=(0,V.jsx)(st,{className:`size-4`}),Ft=(0,V.jsx)(`span`,{children:`Parameter Groups`}),e[176]=Pt,e[177]=Ft):(Pt=e[176],Ft=e[177]);let It;e[178]===Nt?It=e[179]:(It=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/rds/describe-db-parameter-groups`,children:(0,V.jsxs)(K,{isActive:Nt,tooltip:`DB Parameter Groups`,children:[Pt,Ft]})})}),e[178]=Nt,e[179]=It);let Lt;e[180]!==Ot||e[181]!==Mt||e[182]!==It||e[183]!==wt?(Lt=(0,V.jsxs)(Mc,{children:[bt,(0,V.jsxs)(Pc,{children:[wt,Ot,Mt,It]})]}),e[180]=Ot,e[181]=Mt,e[182]=It,e[183]=wt,e[184]=Lt):Lt=e[184];let Rt;e[185]===Symbol.for(`react.memo_cache_sentinel`)?(Rt=(0,V.jsx)(Nc,{children:`IAM`}),e[185]=Rt):Rt=e[185];let zt;e[186]===n?zt=e[187]:(zt=n.startsWith(`/iam/list-users`)||n.startsWith(`/iam/create-user`),e[186]=n,e[187]=zt);let Bt,Vt;e[188]===Symbol.for(`react.memo_cache_sentinel`)?(Bt=(0,V.jsx)(Jo,{className:`size-4`}),Vt=(0,V.jsx)(`span`,{children:`Users`}),e[188]=Bt,e[189]=Vt):(Bt=e[188],Vt=e[189]);let Ht;e[190]===zt?Ht=e[191]:(Ht=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/iam/list-users`,children:(0,V.jsxs)(K,{isActive:zt,tooltip:`Users`,children:[Bt,Vt]})})}),e[190]=zt,e[191]=Ht);let Ut;e[192]===n?Ut=e[193]:(Ut=n.startsWith(`/iam/list-groups`)||n.startsWith(`/iam/create-group`),e[192]=n,e[193]=Ut);let Wt,Gt;e[194]===Symbol.for(`react.memo_cache_sentinel`)?(Wt=(0,V.jsx)(qo,{className:`size-4`}),Gt=(0,V.jsx)(`span`,{children:`Groups`}),e[194]=Wt,e[195]=Gt):(Wt=e[194],Gt=e[195]);let Kt;e[196]===Ut?Kt=e[197]:(Kt=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/iam/list-groups`,children:(0,V.jsxs)(K,{isActive:Ut,tooltip:`Groups`,children:[Wt,Gt]})})}),e[196]=Ut,e[197]=Kt);let qt;e[198]===n?qt=e[199]:(qt=n.startsWith(`/iam/list-policies`)||n.startsWith(`/iam/create-policy`),e[198]=n,e[199]=qt);let Jt,Yt;e[200]===Symbol.for(`react.memo_cache_sentinel`)?(Jt=(0,V.jsx)(et,{className:`size-4`}),Yt=(0,V.jsx)(`span`,{children:`Policies`}),e[200]=Jt,e[201]=Yt):(Jt=e[200],Yt=e[201]);let Xt;e[202]===qt?Xt=e[203]:(Xt=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/iam/list-policies`,children:(0,V.jsxs)(K,{isActive:qt,tooltip:`Policies`,children:[Jt,Yt]})})}),e[202]=qt,e[203]=Xt);let Zt;e[204]===n?Zt=e[205]:(Zt=n.startsWith(`/iam/list-roles`)||n.startsWith(`/iam/create-role`),e[204]=n,e[205]=Zt);let Qt,$t;e[206]===Symbol.for(`react.memo_cache_sentinel`)?(Qt=(0,V.jsx)(Ko,{className:`size-4`}),$t=(0,V.jsx)(`span`,{children:`Roles`}),e[206]=Qt,e[207]=$t):(Qt=e[206],$t=e[207]);let en;e[208]===Zt?en=e[209]:(en=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/iam/list-roles`,children:(0,V.jsxs)(K,{isActive:Zt,tooltip:`Roles`,children:[Qt,$t]})})}),e[208]=Zt,e[209]=en);let tn;e[210]===n?tn=e[211]:(tn=n.startsWith(`/iam/list-instance-profiles`)||n.startsWith(`/iam/create-instance-profile`),e[210]=n,e[211]=tn);let nn,rn;e[212]===Symbol.for(`react.memo_cache_sentinel`)?(nn=(0,V.jsx)(Fo,{className:`size-4`}),rn=(0,V.jsx)(`span`,{children:`Instance Profiles`}),e[212]=nn,e[213]=rn):(nn=e[212],rn=e[213]);let an;e[214]===tn?an=e[215]:(an=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/iam/list-instance-profiles`,children:(0,V.jsxs)(K,{isActive:tn,tooltip:`Instance Profiles`,children:[nn,rn]})})}),e[214]=tn,e[215]=an);let on;e[216]!==Ht||e[217]!==Kt||e[218]!==Xt||e[219]!==en||e[220]!==an?(on=(0,V.jsxs)(Mc,{children:[Rt,(0,V.jsxs)(Pc,{children:[Ht,Kt,Xt,en,an]})]}),e[216]=Ht,e[217]=Kt,e[218]=Xt,e[219]=en,e[220]=an,e[221]=on):on=e[221];let sn;e[222]===Symbol.for(`react.memo_cache_sentinel`)?(sn=(0,V.jsx)(Nc,{children:`S3`}),e[222]=sn):sn=e[222];let cn;e[223]===n?cn=e[224]:(cn=n.startsWith(`/s3/ls`),e[223]=n,e[224]=cn);let ln,un;e[225]===Symbol.for(`react.memo_cache_sentinel`)?(ln=(0,V.jsx)(nt,{className:`size-4`}),un=(0,V.jsx)(`span`,{children:`Buckets`}),e[225]=ln,e[226]=un):(ln=e[225],un=e[226]);let dn;e[227]===cn?dn=e[228]:(dn=(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/s3/ls`,children:(0,V.jsxs)(K,{isActive:cn,tooltip:`Buckets`,children:[ln,un]})})}),e[227]=cn,e[228]=dn);let fn;e[229]!==a||e[230]!==n?(fn=a&&(0,V.jsx)(G,{children:(0,V.jsx)(M,{to:`/s3/service-metrics`,children:(0,V.jsxs)(K,{isActive:n.startsWith(`/s3/service-metrics`),tooltip:`Service Metrics`,children:[(0,V.jsx)(Eo,{className:`size-4`}),(0,V.jsx)(`span`,{children:`Service Metrics`})]})})}),e[229]=a,e[230]=n,e[231]=fn):fn=e[231];let pn;e[232]!==dn||e[233]!==fn?(pn=(0,V.jsxs)(Mc,{children:[sn,(0,V.jsxs)(Pc,{children:[dn,fn]})]}),e[232]=dn,e[233]=fn,e[234]=pn):pn=e[234];let mn;e[235]===a?mn=e[236]:(mn=a&&(0,V.jsxs)(Mc,{children:[(0,V.jsx)(Nc,{children:`Documentation`}),(0,V.jsx)(Pc,{children:(0,V.jsx)(G,{children:(0,V.jsx)(`a`,{href:`https://docs.mulgadc.com`,target:`_blank`,rel:`noopener noreferrer`,children:(0,V.jsxs)(K,{tooltip:`Documentation`,children:[(0,V.jsx)(Do,{className:`size-4`}),(0,V.jsx)(`span`,{children:`Docs`})]})})})})]}),e[235]=a,e[236]=mn);let hn;e[237]!==Lt||e[238]!==on||e[239]!==pn||e[240]!==mn||e[241]!==Ee||e[242]!==L||e[243]!==g||e[244]!==yt?(hn=(0,V.jsxs)(jc,{children:[g,Ee,L,yt,Lt,on,pn,mn]}),e[237]=Lt,e[238]=on,e[239]=pn,e[240]=mn,e[241]=Ee,e[242]=L,e[243]=g,e[244]=yt,e[245]=hn):hn=e[245];let gn;e[246]===Symbol.for(`react.memo_cache_sentinel`)?(gn=(0,V.jsx)(Ac,{className:`mx-0 w-full`}),e[246]=gn):gn=e[246];let _n,vn;e[247]===Symbol.for(`react.memo_cache_sentinel`)?(_n=(0,V.jsx)(Ro,{className:`size-4`}),vn=(0,V.jsx)(`span`,{children:`Sign out`}),e[247]=_n,e[248]=vn):(_n=e[247],vn=e[248]);let yn;e[249]===s?yn=e[250]:(yn=(0,V.jsxs)(kc,{children:[gn,(0,V.jsx)(Pc,{children:(0,V.jsx)(G,{children:(0,V.jsxs)(K,{onClick:s,tooltip:`Sign out`,children:[_n,vn]})})})]}),e[249]=s,e[250]=yn);let bn;e[251]===Symbol.for(`react.memo_cache_sentinel`)?(bn=(0,V.jsx)(Dc,{}),e[251]=bn):bn=e[251];let xn;return e[252]!==hn||e[253]!==yn?(xn=(0,V.jsxs)(Tc,{collapsible:`icon`,children:[c,hn,yn,bn]}),e[252]=hn,e[253]=yn,e[254]=xn):xn=e[254],xn}function Kc(e){return e.pathname}function qc(e){let t=(0,W.c)(18),{error:n,reset:r}=e,i=ke(),a=h(),o;t[0]!==a||t[1]!==r||t[2]!==i?(o=function(){a.invalidateQueries(),r(),i.invalidate()},t[0]=a,t[1]=r,t[2]=i,t[3]=o):o=t[3];let s=o,c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(Gc,{}),t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(Uc,{}),t[5]=l):l=t[5];let u,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,V.jsx)(`div`,{className:`flex justify-center`,children:(0,V.jsx)(ko,{className:`size-12 text-destructive`})}),d=(0,V.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Something went wrong`}),t[6]=u,t[7]=d):(u=t[6],d=t[7]);let f=n.message||`An unexpected error occurred`,p;t[8]===f?p=t[9]:(p=(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:f}),t[8]=f,t[9]=p);let m;t[10]===s?m=t[11]:(m=(0,V.jsx)(gt,{onClick:s,variant:`default`,children:`Try Again`}),t[10]=s,t[11]=m);let g;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,V.jsx)(M,{to:`/`,children:(0,V.jsx)(gt,{variant:`outline`,children:`Go Home`})}),t[12]=g):g=t[12];let _;t[13]===m?_=t[14]:(_=(0,V.jsxs)(`div`,{className:`flex justify-center gap-2`,children:[m,g]}),t[13]=m,t[14]=_);let v;return t[15]!==_||t[16]!==p?(v=(0,V.jsxs)(V.Fragment,{children:[c,(0,V.jsxs)(`main`,{className:`flex flex-1 flex-col`,children:[l,(0,V.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 pt-0`,children:(0,V.jsxs)(`div`,{className:`max-w-md space-y-4 text-center`,children:[u,d,p,_]})})]})]}),t[15]=_,t[16]=p,t[17]=v):v=t[17],v}var Jc=De()({head:()=>({meta:[{title:`Mulga`}]}),component:()=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_o,{}),(0,V.jsx)(Gc,{}),(0,V.jsxs)(`main`,{className:`flex flex-1 flex-col`,children:[(0,V.jsx)(Uc,{}),(0,V.jsx)(`div`,{className:`flex flex-1 flex-col p-8`,children:(0,V.jsx)(ve,{})})]})]}),errorComponent:qc,notFoundComponent:Wc}),Yc=N(`/_auth`)({beforeLoad:()=>{if(!qe())throw we({to:`/login`})},component:P(()=>I(()=>import(`./route.js`),__vite__mapDeps([0,1,2,3,4])),`component`)}),Xc=N(`/_auth/`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(Fn),e.queryClient.ensureQueryData(En),e.queryClient.ensureQueryData(On),e.queryClient.ensureQueryData(Rn),e.queryClient.ensureQueryData(ar),e.queryClient.ensureQueryData(Bn),e.queryClient.ensureQueryData(jn),e.queryClient.ensureQueryData(In),e.queryClient.ensureQueryData(Nn)])},head:()=>({meta:[{title:`Dashboard | Mulga`}]}),component:P(()=>I(()=>import(`./_auth.js`),__vite__mapDeps([5,1,6,7,8,9,10,4,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37])),`component`)}),Zc=N(`/_auth/nodes`)({head:()=>({meta:[{title:`Nodes | Mulga`}]}),component:P(()=>I(()=>import(`./nodes.js`),__vite__mapDeps([38,1,6,7,8,9,10,4,39,11,12,14,13,15,17,18,19,25,34,21,35,28,36,37])),`component`)}),Qc=N(`/_auth/s3/service-metrics`)({head:()=>({meta:[{title:`Service Metrics | S3 | Mulga`}]}),component:P(()=>I(()=>import(`./service-metrics.js`),__vite__mapDeps([40,1,6,7,8,9,39,17,11,12,18,19,25,34,21,35,28,36,37])),`component`)}),$c=N(`/_auth/ec2/(elastic-ips)/allocate-address`)({head:()=>({meta:[{title:`Allocate Elastic IP | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./allocate-address.js`),__vite__mapDeps([41,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60])),`component`)}),el=N(`/_auth/ec2/(internet-gateways)/create-internet-gateway`)({head:()=>({meta:[{title:`Create Internet Gateway | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-internet-gateway.js`),__vite__mapDeps([61,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60])),`component`)}),tl=N(`/_auth/ec2/(key)/create-key-pair`)({head:()=>({meta:[{title:`Create Key Pair | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-key-pair.js`),__vite__mapDeps([62,1,42,4,43,10,13,45,63,30,28,11,12,27,14,31,49,32,64,65,50,66,67,44,46,47,68,48,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60,26,29])),`component`)}),nl=N(`/_auth/ec2/(key)/import-key-pair`)({head:()=>({meta:[{title:`Import Key Pair | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./import-key-pair.js`),__vite__mapDeps([69,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60,70])),`component`)}),rl=N(`/_auth/ec2/(launch-templates)/create-launch-template`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(Ln),e.queryClient.ensureQueryData(Mn),e.queryClient.ensureQueryData(Rn),e.queryClient.ensureQueryData(kn),e.queryClient.ensureQueryData(Bn)])},head:()=>({meta:[{title:`Create Launch Template | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-launch-template.js`),__vite__mapDeps([71,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60,72,73,7,9,63,30,32,64,65,66,70,74])),`component`)}),il=N(`/_auth/ec2/(load-balancers)/create-load-balancer`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(On),e.queryClient.ensureQueryData(kn),e.queryClient.ensureQueryData(Bn),e.queryClient.ensureQueryData(Jn),e.queryClient.ensureQueryData(Tn),e.queryClient.ensureQueryData(qn)])},head:()=>({meta:[{title:`Create Load Balancer | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-load-balancer.js`),__vite__mapDeps([75,1,73,7,8,9,42,4,11,12,43,10,13,63,30,28,27,45,14,31,49,32,64,65,50,66,44,46,47,48,76,21,22,23,77,52,53,56,58,59,26,29,70,20,78,79,80,55,57,25,81,82,83,84,74,85])),`component`)}),al=N(`/_auth/ec2/(nat-gateways)/create-nat-gateway`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(kn),e.queryClient.ensureQueryData(In)])},head:()=>({meta:[{title:`Create NAT Gateway | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-nat-gateway.js`),__vite__mapDeps([86,1,73,7,8,9,10,4,42,11,12,43,13,63,30,28,27,45,14,31,49,32,64,65,50,66,44,46,47,48,20,21,22,23,51,52,53,54,55,56,57,25,58,59,60])),`component`)}),ol=N(`/_auth/ec2/(placement-groups)/create-placement-group`)({head:()=>({meta:[{title:`Create Placement Group | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-placement-group.js`),__vite__mapDeps([87,1,42,4,43,10,13,63,30,28,11,12,27,45,14,31,49,32,64,65,50,66,44,46,47,48,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60])),`component`)}),sl=N(`/_auth/ec2/(route-tables)/create-route-table`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(On)},head:()=>({meta:[{title:`Create Route Table | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-route-table.js`),__vite__mapDeps([88,1,73,7,8,9,42,4,11,12,43,10,13,63,30,28,27,45,14,31,49,32,64,65,50,66,48,20,21,22,23,51,52,53,54,55,56,57,25,58,59,60])),`component`)}),cl=N(`/_auth/ec2/(security-groups)/create-security-group`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(On)},head:()=>({meta:[{title:`Create Security Group | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-security-group.js`),__vite__mapDeps([89,1,73,7,8,9,42,4,11,12,43,10,13,63,30,28,27,45,14,31,49,32,64,65,50,66,44,46,47,48,20,21,22,23,51,52,53,54,55,56,57,25,58,59,60])),`component`)}),ll=N(`/_auth/ec2/(subnet)/create-subnet`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(On),e.queryClient.ensureQueryData(zn)])},head:()=>({meta:[{title:`Create Subnet | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-subnet.js`),__vite__mapDeps([90,1,73,7,8,9,42,4,11,12,43,10,13,63,30,28,27,45,14,31,49,32,64,65,50,66,44,46,47,48,20,21,22,23,51,52,53,54,55,56,57,25,58,59,60])),`component`)}),ul=N(`/_auth/ec2/(target-groups)/create-target-group`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(On)},head:()=>({meta:[{title:`Create Target Group | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-target-group.js`),__vite__mapDeps([91,1,73,7,8,9,42,4,43,10,13,44,11,12,45,14,46,27,28,47,20,21,22,23,78,52,53,79,55,56,57,25,84,63,30,31,49,32,64,65,50,66,48,58,59,74,81,82,83,85])),`component`)}),dl=N(`/_auth/ec2/(volumes)/create-volume`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(zn)},head:()=>({meta:[{title:`Create Volume | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-volume.js`),__vite__mapDeps([92,1,73,7,8,9,42,4,43,10,13,63,30,28,11,12,27,45,14,31,49,32,64,65,50,66,44,46,47,48,20,21,22,23,51,52,53,54,55,56,57,25,58,59,60])),`component`)}),fl=N(`/_auth/ec2/(vpc)/create-vpc`)({head:()=>({meta:[{title:`Create VPC | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./create-vpc.js`),__vite__mapDeps([93,1,42,4,43,10,13,14,15,63,30,28,11,12,27,45,31,49,32,64,65,50,66,44,46,47,48,51,8,52,53,22,23,20,21,54,55,56,57,25,58,59,60])),`component`)}),pl=N(`/_auth/ecs/(clusters)/task-definitions`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Wn)},head:()=>({meta:[{title:`Task Definitions | ECS | Mulga`}]}),component:P(()=>I(()=>import(`./task-definitions.js`),__vite__mapDeps([94,1,73,7,8,9,10,4,27,28,11,12,95,21,22,23,96,52,53,19,56,25,97,26,29,30,31,32,98])),`component`)}),ml=N(`/_auth/eks/(clusters)/create-cluster`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(On),e.queryClient.ensureQueryData(kn),e.queryClient.ensureQueryData($n),e.queryClient.ensureQueryData(Ln)])},head:()=>({meta:[{title:`Create Cluster | EKS | Mulga`}]}),component:P(()=>I(()=>import(`./create-cluster.js`),__vite__mapDeps([99,1,8,73,7,9,42,4,11,12,43,10,13,63,30,28,27,45,14,31,49,32,64,65,50,66,48,20,21,22,23,100,52,53,101,102,54,103,104,105,55,56,57,25,58,59,26,29,106,107,46,108,68,47,109])),`component`)}),hl=N(`/_auth/iam/(groups)/create-group`)({head:()=>({meta:[{title:`Create Group | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./create-group.js`),__vite__mapDeps([110,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,103,8,52,53,22,23,104,55,56,57,25,58,59,111,102])),`component`)}),gl=N(`/_auth/iam/(instance-profiles)/create-instance-profile`)({head:()=>({meta:[{title:`Create Instance Profile | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./create-instance-profile.js`),__vite__mapDeps([112,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,103,8,52,53,22,23,104,55,56,57,25,58,59,111,102])),`component`)}),_l=N(`/_auth/iam/(policies)/create-policy`)({head:()=>({meta:[{title:`Create Policy | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./create-policy.js`),__vite__mapDeps([113,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,103,8,52,53,22,23,104,55,56,57,25,58,59,114,102,70,111])),`component`)}),vl=N(`/_auth/iam/(roles)/create-role`)({head:()=>({meta:[{title:`Create Role | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./create-role.js`),__vite__mapDeps([115,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,103,8,52,53,22,23,104,55,56,57,25,58,59,114,102,70,111])),`component`)}),yl=N(`/_auth/iam/(users)/create-user`)({head:()=>({meta:[{title:`Create User | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./create-user.js`),__vite__mapDeps([116,1,42,4,43,10,13,44,11,12,45,14,46,27,28,47,48,31,49,50,103,8,52,53,22,23,104,55,56,57,25,58,59,111,102])),`component`)}),bl=N(`/_auth/rds/(db-instances)/create-db-instance`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(rr),e.queryClient.ensureQueryData(nr),e.queryClient.ensureQueryData(tr),e.queryClient.ensureQueryData(Bn),e.queryClient.ensureQueryData(On),e.queryClient.ensureQueryData(Ln)])},head:()=>({meta:[{title:`Create Database | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./create-db-instance.js`),__vite__mapDeps([117,1,8,6,7,9,73,42,4,43,10,13,63,30,28,11,12,27,45,14,31,49,32,64,65,50,66,44,46,47,48,20,21,22,23,118,119,52,53,120,55,56,57,25,58,59,106,81,82,83,107,108,68,121,122])),`component`)}),xl=N(`/_auth/rds/(parameter-groups)/create-db-parameter-group`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(rr)},head:()=>({meta:[{title:`Create Parameter Group | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./create-db-parameter-group.js`),__vite__mapDeps([123,1,73,7,8,9,42,4,43,10,13,63,30,28,11,12,27,45,14,31,49,32,64,65,50,66,44,46,47,48,118,22,23,119,52,53,120,21,55,56,57,25,58,59,81,82,83])),`component`)}),Sl=N(`/_auth/rds/(subnet-groups)/create-db-subnet-group`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(kn),e.queryClient.ensureQueryData(On)])},head:()=>({meta:[{title:`Create Subnet Group | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./create-db-subnet-group.js`),__vite__mapDeps([124,1,73,7,8,9,42,4,11,12,43,10,13,44,45,14,46,27,28,47,48,31,49,50,20,21,22,23,118,119,52,53,55,56,57,25,58,59,81,82,83])),`component`)}),Cl=N(`/_auth/s3/(buckets)/create-bucket`)({head:()=>({meta:[{title:`Create Bucket | S3 | Mulga`}]}),component:P(()=>I(()=>import(`./create-bucket.js`),__vite__mapDeps([125,1,42,4,11,12,43,10,13,44,45,14,46,27,28,47,48,31,49,50,126,8,52,53,22,23,55,56,57,25,58,59])),`component`)}),wl=N(`/_auth/s3/ls/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(ar)},head:()=>({meta:[{title:`Buckets | S3 | Mulga`}]}),component:P(()=>I(()=>import(`./ls.js`),__vite__mapDeps([127,1,73,7,8,9,10,4,11,12,27,28,24,21,22,23,25,128])),`component`)}),Tl=N(`/_auth/s3/ls/$bucket`)({component:P(()=>I(()=>import(`./route2.js`),__vite__mapDeps([129,1,2,3,4])),`component`)}),El=N(`/_auth/ec2/(elastic-ips)/describe-addresses/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(In)},head:()=>({meta:[{title:`Elastic IPs | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-addresses.js`),__vite__mapDeps([130,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128])),`component`)}),Dl=N(`/_auth/ec2/(images)/describe-images/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Ln)},head:()=>({meta:[{title:`Images | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-images.js`),__vite__mapDeps([131,1,73,7,8,9,20,21,11,12,22,23,25,128,10,4,33,106])),`component`)}),Ol=N(`/_auth/ec2/(instances)/describe-instances/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Fn)},head:()=>({meta:[{title:`Instances | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-instances.js`),__vite__mapDeps([132,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128,33])),`component`)}),kl=N(`/_auth/ec2/(internet-gateways)/describe-internet-gateways/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Nn)},head:()=>({meta:[{title:`Internet Gateways | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-internet-gateways.js`),__vite__mapDeps([133,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128])),`component`)}),Al=N(`/_auth/ec2/(key)/describe-key-pairs/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Rn)},head:()=>({meta:[{title:`Key Pairs | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-key-pairs.js`),__vite__mapDeps([134,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128])),`component`)}),jl=N(`/_auth/ec2/(launch-templates)/describe-launch-templates/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Pn)},head:()=>({meta:[{title:`Launch Templates | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-launch-templates.js`),__vite__mapDeps([135,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128,35,36])),`component`)}),Ml=N(`/_auth/ec2/(load-balancers)/describe-load-balancers/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Kn)},head:()=>({meta:[{title:`Load Balancers | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-load-balancers.js`),__vite__mapDeps([136,1,73,7,8,9,10,4,42,11,12,27,28,80,21,22,23,79,25,33])),`component`)}),Nl=N(`/_auth/ec2/(nat-gateways)/describe-nat-gateways/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(jn)},head:()=>({meta:[{title:`NAT Gateways | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-nat-gateways.js`),__vite__mapDeps([137,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128,33])),`component`)}),Pl=N(`/_auth/ec2/(placement-groups)/describe-placement-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Vn)},head:()=>({meta:[{title:`Placement Groups | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-placement-groups.js`),__vite__mapDeps([138,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128,33])),`component`)}),Fl=N(`/_auth/ec2/(route-tables)/describe-route-tables/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(An)},head:()=>({meta:[{title:`Route Tables | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-route-tables.js`),__vite__mapDeps([139,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128,35,36])),`component`)}),Il=N(`/_auth/ec2/(security-groups)/describe-security-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Bn)},head:()=>({meta:[{title:`Security Groups | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-security-groups.js`),__vite__mapDeps([140,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128])),`component`)}),Ll=N(`/_auth/ec2/(snapshots)/describe-snapshots/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Dn)},head:()=>({meta:[{title:`Snapshots | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-snapshots.js`),__vite__mapDeps([141,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128,33])),`component`)}),q=N(`/_auth/ec2/(subnet)/describe-subnets/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(kn)},head:()=>({meta:[{title:`Subnets | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-subnets.js`),__vite__mapDeps([142,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128,33])),`component`)}),Rl=N(`/_auth/ec2/(target-groups)/describe-target-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Jn)},head:()=>({meta:[{title:`Target Groups | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-target-groups.js`),__vite__mapDeps([143,1,6,7,8,9,73,10,4,42,27,28,11,12,80,21,22,23,79,25])),`component`)}),J=N(`/_auth/ec2/(volumes)/describe-volumes/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(En)},head:()=>({meta:[{title:`Volumes | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-volumes.js`),__vite__mapDeps([144,1,73,7,8,9,10,4,27,28,11,12,20,21,22,23,25,128,33])),`component`)}),Y=N(`/_auth/ec2/(vpc)/describe-vpcs/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(On)},head:()=>({meta:[{title:`VPCs | EC2 | Mulga`}]}),component:P(()=>I(()=>import(`./describe-vpcs.js`),__vite__mapDeps([145,1,73,7,8,9,10,4,11,12,27,28,20,21,22,23,25,128,33])),`component`)}),X=N(`/_auth/ecr/(repositories)/list-repositories/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Hn)},head:()=>({meta:[{title:`Repositories | ECR | Mulga`}]}),component:P(()=>I(()=>import(`./list-repositories.js`),__vite__mapDeps([146,1,73,7,8,9,10,4,42,11,12,27,28,48,31,49,50,147,21,22,23,148,52,53,25,58,59,26,29,30,32])),`component`)}),zl=N(`/_auth/ecs/(clusters)/list-clusters/`)({loader:async({context:e})=>{await Promise.all([e.queryClient.ensureQueryData(Un),e.queryClient.ensureQueryData(Ln)])},head:()=>({meta:[{title:`Clusters | ECS | Mulga`}]}),component:P(()=>I(()=>import(`./list-clusters.js`),__vite__mapDeps([149,1,8,73,7,9,10,4,42,27,28,11,12,48,31,49,50,20,21,22,23,95,96,52,53,19,56,25,58,59,26,29,30,32,97,33,106,107,45,13,46,108,68,47,98])),`component`)}),Bl=N(`/_auth/eks/(clusters)/list-clusters/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Gn)},head:()=>({meta:[{title:`Clusters | EKS | Mulga`}]}),component:P(()=>I(()=>import(`./list-clusters2.js`),__vite__mapDeps([150,1,73,7,8,9,10,4,27,28,11,12,151,21,22,23,101,25,128])),`component`)}),Vl=N(`/_auth/iam/(groups)/list-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Zn)},head:()=>({meta:[{title:`Groups | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./list-groups.js`),__vite__mapDeps([152,1,73,7,8,9,10,4,27,28,11,12,105,21,22,23,104,102,25,128])),`component`)}),Hl=N(`/_auth/iam/(instance-profiles)/list-instance-profiles/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Xn)},head:()=>({meta:[{title:`Instance Profiles | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./list-instance-profiles.js`),__vite__mapDeps([153,1,73,7,8,9,10,4,27,28,11,12,105,21,22,23,104,102,25,128])),`component`)}),Ul=N(`/_auth/iam/(policies)/list-policies/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Qn)},head:()=>({meta:[{title:`Policies | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./list-policies.js`),__vite__mapDeps([154,1,73,7,8,9,10,4,27,28,11,12,105,21,22,23,104,102,25,128])),`component`)}),Wl=N(`/_auth/iam/(roles)/list-roles/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData($n)},head:()=>({meta:[{title:`Roles | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./list-roles.js`),__vite__mapDeps([155,1,73,7,8,9,10,4,27,28,11,12,105,21,22,23,104,102,25,128])),`component`)}),Gl=N(`/_auth/iam/(users)/list-users/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(Yn)},head:()=>({meta:[{title:`Users | IAM | Mulga`}]}),component:P(()=>I(()=>import(`./list-users.js`),__vite__mapDeps([156,1,73,7,8,9,10,4,27,28,11,12,105,21,22,23,104,102,25,128])),`component`)}),Kl=N(`/_auth/rds/(db-instances)/describe-db-instances/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(ir)},head:()=>({meta:[{title:`Databases | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./describe-db-instances.js`),__vite__mapDeps([157,1,73,7,8,9,10,4,42,27,28,11,12,118,22,23,119,52,53,120,21,56,25,33,158,48,31,49,50,58,59,26,29,30,32])),`component`)}),ql=N(`/_auth/rds/(parameter-groups)/describe-db-parameter-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(tr)},head:()=>({meta:[{title:`Parameter Groups | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./describe-db-parameter-groups.js`),__vite__mapDeps([159,1,73,7,8,9,10,4,42,27,28,11,12,118,22,23,120,21,25,160,119,52,53,161,97,26,29,30,31,32])),`component`)}),Jl=N(`/_auth/rds/(snapshots)/describe-db-snapshots/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(er)},head:()=>({meta:[{title:`Snapshots | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./describe-db-snapshots.js`),__vite__mapDeps([162,1,73,7,8,9,10,4,42,11,12,27,28,118,22,23,120,21,25,33,163,6,63,30,13,45,14,31,49,32,64,65,50,66,48,119,52,53,55,58,59,26,29,81,82,83,121,164,161,97])),`component`)}),Yl=N(`/_auth/rds/(subnet-groups)/describe-db-subnet-groups/`)({loader:async({context:e})=>{await e.queryClient.ensureQueryData(nr)},head:()=>({meta:[{title:`Subnet Groups | RDS | Mulga`}]}),component:P(()=>I(()=>import(`./describe-db-subnet-groups.js`),__vite__mapDeps([165,1,73,7,8,9,10,4,42,27,28,11,12,120,21,22,23,118,25,33,166,119,52,53,161,97,26,29,30,31,32])),`component`)}),Z=Yc.update({id:`/_auth`,getParentRoute:()=>Jc}),Xl=or.update({id:`/login`,path:`/login`,getParentRoute:()=>Jc}),Zl=Xc.update({id:`/`,path:`/`,getParentRoute:()=>Z}),Ql=Zc.update({id:`/nodes`,path:`/nodes`,getParentRoute:()=>Z}),$l=Qc.update({id:`/s3/service-metrics`,path:`/s3/service-metrics`,getParentRoute:()=>Z}),eu=$c.update({id:`/ec2/(elastic-ips)/allocate-address`,path:`/ec2/allocate-address`,getParentRoute:()=>Z}),tu=sr.update({id:`/ec2/(instances)/run-instances`,path:`/ec2/run-instances`,getParentRoute:()=>Z}),nu=el.update({id:`/ec2/(internet-gateways)/create-internet-gateway`,path:`/ec2/create-internet-gateway`,getParentRoute:()=>Z}),ru=tl.update({id:`/ec2/(key)/create-key-pair`,path:`/ec2/create-key-pair`,getParentRoute:()=>Z}),iu=nl.update({id:`/ec2/(key)/import-key-pair`,path:`/ec2/import-key-pair`,getParentRoute:()=>Z}),au=rl.update({id:`/ec2/(launch-templates)/create-launch-template`,path:`/ec2/create-launch-template`,getParentRoute:()=>Z}),ou=il.update({id:`/ec2/(load-balancers)/create-load-balancer`,path:`/ec2/create-load-balancer`,getParentRoute:()=>Z}),su=al.update({id:`/ec2/(nat-gateways)/create-nat-gateway`,path:`/ec2/create-nat-gateway`,getParentRoute:()=>Z}),cu=ol.update({id:`/ec2/(placement-groups)/create-placement-group`,path:`/ec2/create-placement-group`,getParentRoute:()=>Z}),lu=sl.update({id:`/ec2/(route-tables)/create-route-table`,path:`/ec2/create-route-table`,getParentRoute:()=>Z}),uu=cl.update({id:`/ec2/(security-groups)/create-security-group`,path:`/ec2/create-security-group`,getParentRoute:()=>Z}),du=cr.update({id:`/ec2/(snapshots)/create-snapshot`,path:`/ec2/create-snapshot`,getParentRoute:()=>Z}),fu=ll.update({id:`/ec2/(subnet)/create-subnet`,path:`/ec2/create-subnet`,getParentRoute:()=>Z}),pu=ul.update({id:`/ec2/(target-groups)/create-target-group`,path:`/ec2/create-target-group`,getParentRoute:()=>Z}),mu=dl.update({id:`/ec2/(volumes)/create-volume`,path:`/ec2/create-volume`,getParentRoute:()=>Z}),hu=fl.update({id:`/ec2/(vpc)/create-vpc`,path:`/ec2/create-vpc`,getParentRoute:()=>Z}),gu=lr.update({id:`/ecs/(clusters)/create-service`,path:`/ecs/create-service`,getParentRoute:()=>Z}),_u=ur.update({id:`/ecs/(clusters)/register-task-definition`,path:`/ecs/register-task-definition`,getParentRoute:()=>Z}),vu=dr.update({id:`/ecs/(clusters)/run-task`,path:`/ecs/run-task`,getParentRoute:()=>Z}),yu=pl.update({id:`/ecs/(clusters)/task-definitions`,path:`/ecs/task-definitions`,getParentRoute:()=>Z}),bu=ml.update({id:`/eks/(clusters)/create-cluster`,path:`/eks/create-cluster`,getParentRoute:()=>Z}),xu=hl.update({id:`/iam/(groups)/create-group`,path:`/iam/create-group`,getParentRoute:()=>Z}),Su=gl.update({id:`/iam/(instance-profiles)/create-instance-profile`,path:`/iam/create-instance-profile`,getParentRoute:()=>Z}),Cu=_l.update({id:`/iam/(policies)/create-policy`,path:`/iam/create-policy`,getParentRoute:()=>Z}),wu=vl.update({id:`/iam/(roles)/create-role`,path:`/iam/create-role`,getParentRoute:()=>Z}),Tu=yl.update({id:`/iam/(users)/create-user`,path:`/iam/create-user`,getParentRoute:()=>Z}),Eu=bl.update({id:`/rds/(db-instances)/create-db-instance`,path:`/rds/create-db-instance`,getParentRoute:()=>Z}),Du=xl.update({id:`/rds/(parameter-groups)/create-db-parameter-group`,path:`/rds/create-db-parameter-group`,getParentRoute:()=>Z}),Ou=Sl.update({id:`/rds/(subnet-groups)/create-db-subnet-group`,path:`/rds/create-db-subnet-group`,getParentRoute:()=>Z}),ku=Cl.update({id:`/s3/(buckets)/create-bucket`,path:`/s3/create-bucket`,getParentRoute:()=>Z}),Au=wl.update({id:`/s3/ls/`,path:`/s3/ls/`,getParentRoute:()=>Z}),ju=Tl.update({id:`/s3/ls/$bucket`,path:`/s3/ls/$bucket`,getParentRoute:()=>Z}),Mu=El.update({id:`/ec2/(elastic-ips)/describe-addresses/`,path:`/ec2/describe-addresses/`,getParentRoute:()=>Z}),Nu=fr.update({id:`/ec2/(elastic-ips)/describe-addresses/$id`,path:`/ec2/describe-addresses/$id`,getParentRoute:()=>Z}),Pu=Dl.update({id:`/ec2/(images)/describe-images/`,path:`/ec2/describe-images/`,getParentRoute:()=>Z}),Fu=pr.update({id:`/ec2/(images)/describe-images/$id`,path:`/ec2/describe-images/$id`,getParentRoute:()=>Z}),Iu=Ol.update({id:`/ec2/(instances)/describe-instances/`,path:`/ec2/describe-instances/`,getParentRoute:()=>Z}),Lu=mr.update({id:`/ec2/(instances)/describe-instances/$id`,path:`/ec2/describe-instances/$id`,getParentRoute:()=>Z}),Ru=kl.update({id:`/ec2/(internet-gateways)/describe-internet-gateways/`,path:`/ec2/describe-internet-gateways/`,getParentRoute:()=>Z}),zu=hr.update({id:`/ec2/(internet-gateways)/describe-internet-gateways/$id`,path:`/ec2/describe-internet-gateways/$id`,getParentRoute:()=>Z}),Bu=Al.update({id:`/ec2/(key)/describe-key-pairs/`,path:`/ec2/describe-key-pairs/`,getParentRoute:()=>Z}),Vu=gr.update({id:`/ec2/(key)/describe-key-pairs/$id`,path:`/ec2/describe-key-pairs/$id`,getParentRoute:()=>Z}),Hu=jl.update({id:`/ec2/(launch-templates)/describe-launch-templates/`,path:`/ec2/describe-launch-templates/`,getParentRoute:()=>Z}),Uu=_r.update({id:`/ec2/(launch-templates)/describe-launch-templates/$id`,path:`/ec2/describe-launch-templates/$id`,getParentRoute:()=>Z}),Q=Ml.update({id:`/ec2/(load-balancers)/describe-load-balancers/`,path:`/ec2/describe-load-balancers/`,getParentRoute:()=>Z}),Wu=vr.update({id:`/ec2/(load-balancers)/describe-load-balancers/$id`,path:`/ec2/describe-load-balancers/$id`,getParentRoute:()=>Z}),Gu=Nl.update({id:`/ec2/(nat-gateways)/describe-nat-gateways/`,path:`/ec2/describe-nat-gateways/`,getParentRoute:()=>Z}),Ku=yr.update({id:`/ec2/(nat-gateways)/describe-nat-gateways/$id`,path:`/ec2/describe-nat-gateways/$id`,getParentRoute:()=>Z}),qu=Pl.update({id:`/ec2/(placement-groups)/describe-placement-groups/`,path:`/ec2/describe-placement-groups/`,getParentRoute:()=>Z}),Ju=br.update({id:`/ec2/(placement-groups)/describe-placement-groups/$id`,path:`/ec2/describe-placement-groups/$id`,getParentRoute:()=>Z}),Yu=Fl.update({id:`/ec2/(route-tables)/describe-route-tables/`,path:`/ec2/describe-route-tables/`,getParentRoute:()=>Z}),Xu=xr.update({id:`/ec2/(route-tables)/describe-route-tables/$id`,path:`/ec2/describe-route-tables/$id`,getParentRoute:()=>Z}),Zu=Il.update({id:`/ec2/(security-groups)/describe-security-groups/`,path:`/ec2/describe-security-groups/`,getParentRoute:()=>Z}),Qu=ut.update({id:`/ec2/(security-groups)/describe-security-groups/$id`,path:`/ec2/describe-security-groups/$id`,getParentRoute:()=>Z}),$u=Ll.update({id:`/ec2/(snapshots)/describe-snapshots/`,path:`/ec2/describe-snapshots/`,getParentRoute:()=>Z}),ed=ot.update({id:`/ec2/(snapshots)/describe-snapshots/$id`,path:`/ec2/describe-snapshots/$id`,getParentRoute:()=>Z}),td=q.update({id:`/ec2/(subnet)/describe-subnets/`,path:`/ec2/describe-subnets/`,getParentRoute:()=>Z}),nd=Sr.update({id:`/ec2/(subnet)/describe-subnets/$id`,path:`/ec2/describe-subnets/$id`,getParentRoute:()=>Z}),rd=Rl.update({id:`/ec2/(target-groups)/describe-target-groups/`,path:`/ec2/describe-target-groups/`,getParentRoute:()=>Z}),id=Cr.update({id:`/ec2/(target-groups)/describe-target-groups/$id`,path:`/ec2/describe-target-groups/$id`,getParentRoute:()=>Z}),ad=J.update({id:`/ec2/(volumes)/describe-volumes/`,path:`/ec2/describe-volumes/`,getParentRoute:()=>Z}),od=wr.update({id:`/ec2/(volumes)/describe-volumes/$id`,path:`/ec2/describe-volumes/$id`,getParentRoute:()=>Z}),sd=Tr.update({id:`/ec2/(volumes)/modify-volume/$id`,path:`/ec2/modify-volume/$id`,getParentRoute:()=>Z}),cd=Y.update({id:`/ec2/(vpc)/describe-vpcs/`,path:`/ec2/describe-vpcs/`,getParentRoute:()=>Z}),ld=Er.update({id:`/ec2/(vpc)/describe-vpcs/$id`,path:`/ec2/describe-vpcs/$id`,getParentRoute:()=>Z}),ud=X.update({id:`/ecr/(repositories)/list-repositories/`,path:`/ecr/list-repositories/`,getParentRoute:()=>Z}),dd=Dr.update({id:`/ecr/(repositories)/list-repositories/$id`,path:`/ecr/list-repositories/$id`,getParentRoute:()=>Z}),fd=zl.update({id:`/ecs/(clusters)/list-clusters/`,path:`/ecs/list-clusters/`,getParentRoute:()=>Z}),pd=Or.update({id:`/ecs/(clusters)/list-clusters/$clusterName`,path:`/ecs/list-clusters/$clusterName`,getParentRoute:()=>Z}),md=Bl.update({id:`/eks/(clusters)/list-clusters/`,path:`/eks/list-clusters/`,getParentRoute:()=>Z}),hd=ct.update({id:`/eks/(clusters)/list-clusters/$clusterName`,path:`/eks/list-clusters/$clusterName`,getParentRoute:()=>Z}),gd=Vl.update({id:`/iam/(groups)/list-groups/`,path:`/iam/list-groups/`,getParentRoute:()=>Z}),_d=kr.update({id:`/iam/(groups)/list-groups/$groupName`,path:`/iam/list-groups/$groupName`,getParentRoute:()=>Z}),vd=Hl.update({id:`/iam/(instance-profiles)/list-instance-profiles/`,path:`/iam/list-instance-profiles/`,getParentRoute:()=>Z}),$=Ar.update({id:`/iam/(instance-profiles)/list-instance-profiles/$instanceProfileName`,path:`/iam/list-instance-profiles/$instanceProfileName`,getParentRoute:()=>Z}),yd=Ul.update({id:`/iam/(policies)/list-policies/`,path:`/iam/list-policies/`,getParentRoute:()=>Z}),bd=jr.update({id:`/iam/(policies)/list-policies/$policyArn`,path:`/iam/list-policies/$policyArn`,getParentRoute:()=>Z}),xd=Wl.update({id:`/iam/(roles)/list-roles/`,path:`/iam/list-roles/`,getParentRoute:()=>Z}),Sd=Mr.update({id:`/iam/(roles)/list-roles/$roleName`,path:`/iam/list-roles/$roleName`,getParentRoute:()=>Z}),Cd=Gl.update({id:`/iam/(users)/list-users/`,path:`/iam/list-users/`,getParentRoute:()=>Z}),wd=Nr.update({id:`/iam/(users)/list-users/$userName`,path:`/iam/list-users/$userName`,getParentRoute:()=>Z}),Td=Kl.update({id:`/rds/(db-instances)/describe-db-instances/`,path:`/rds/describe-db-instances/`,getParentRoute:()=>Z}),Ed=Pr.update({id:`/rds/(db-instances)/describe-db-instances/$id`,path:`/rds/describe-db-instances/$id`,getParentRoute:()=>Z}),Dd=ql.update({id:`/rds/(parameter-groups)/describe-db-parameter-groups/`,path:`/rds/describe-db-parameter-groups/`,getParentRoute:()=>Z}),Od=Fr.update({id:`/rds/(parameter-groups)/describe-db-parameter-groups/$name`,path:`/rds/describe-db-parameter-groups/$name`,getParentRoute:()=>Z}),kd=Jl.update({id:`/rds/(snapshots)/describe-db-snapshots/`,path:`/rds/describe-db-snapshots/`,getParentRoute:()=>Z}),Ad=Ir.update({id:`/rds/(snapshots)/describe-db-snapshots/$id`,path:`/rds/describe-db-snapshots/$id`,getParentRoute:()=>Z}),jd=Lr.update({id:`/rds/(snapshots)/restore-db-instance-from-db-snapshot/$id`,path:`/rds/restore-db-instance-from-db-snapshot/$id`,getParentRoute:()=>Z}),Md=Yl.update({id:`/rds/(subnet-groups)/describe-db-subnet-groups/`,path:`/rds/describe-db-subnet-groups/`,getParentRoute:()=>Z}),Nd=Rr.update({id:`/rds/(subnet-groups)/describe-db-subnet-groups/$name`,path:`/rds/describe-db-subnet-groups/$name`,getParentRoute:()=>Z}),Pd=zr.update({id:`/`,path:`/`,getParentRoute:()=>ju}),Fd=Br.update({id:`/$`,path:`/$`,getParentRoute:()=>ju}),Id=Vr.update({id:`/ecs/(clusters)/list-clusters/$clusterName_/services/$serviceName`,path:`/ecs/list-clusters/$clusterName/services/$serviceName`,getParentRoute:()=>Z}),Ld=Hr.update({id:`/ecs/(clusters)/list-clusters/$clusterName_/tasks/$taskId`,path:`/ecs/list-clusters/$clusterName/tasks/$taskId`,getParentRoute:()=>Z}),Rd={AuthS3LsBucketSplatRoute:Fd,AuthS3LsBucketIndexRoute:Pd},zd={AuthNodesRoute:Ql,AuthIndexRoute:Zl,AuthS3ServiceMetricsRoute:$l,AuthS3LsBucketRouteRoute:ju._addFileChildren(Rd),AuthEc2elasticIpsAllocateAddressRoute:eu,AuthEc2instancesRunInstancesRoute:tu,AuthEc2internetGatewaysCreateInternetGatewayRoute:nu,AuthEc2keyCreateKeyPairRoute:ru,AuthEc2keyImportKeyPairRoute:iu,AuthEc2launchTemplatesCreateLaunchTemplateRoute:au,AuthEc2loadBalancersCreateLoadBalancerRoute:ou,AuthEc2natGatewaysCreateNatGatewayRoute:su,AuthEc2placementGroupsCreatePlacementGroupRoute:cu,AuthEc2routeTablesCreateRouteTableRoute:lu,AuthEc2securityGroupsCreateSecurityGroupRoute:uu,AuthEc2snapshotsCreateSnapshotRoute:du,AuthEc2subnetCreateSubnetRoute:fu,AuthEc2targetGroupsCreateTargetGroupRoute:pu,AuthEc2volumesCreateVolumeRoute:mu,AuthEc2vpcCreateVpcRoute:hu,AuthEcsclustersCreateServiceRoute:gu,AuthEcsclustersRegisterTaskDefinitionRoute:_u,AuthEcsclustersRunTaskRoute:vu,AuthEcsclustersTaskDefinitionsRoute:yu,AuthEksclustersCreateClusterRoute:bu,AuthIamgroupsCreateGroupRoute:xu,AuthIaminstanceProfilesCreateInstanceProfileRoute:Su,AuthIampoliciesCreatePolicyRoute:Cu,AuthIamrolesCreateRoleRoute:wu,AuthIamusersCreateUserRoute:Tu,AuthRdsdbInstancesCreateDbInstanceRoute:Eu,AuthRdsparameterGroupsCreateDbParameterGroupRoute:Du,AuthRdssubnetGroupsCreateDbSubnetGroupRoute:Ou,AuthS3bucketsCreateBucketRoute:ku,AuthS3LsIndexRoute:Au,AuthEc2elasticIpsDescribeAddressesIdRoute:Nu,AuthEc2imagesDescribeImagesIdRoute:Fu,AuthEc2instancesDescribeInstancesIdRoute:Lu,AuthEc2internetGatewaysDescribeInternetGatewaysIdRoute:zu,AuthEc2keyDescribeKeyPairsIdRoute:Vu,AuthEc2launchTemplatesDescribeLaunchTemplatesIdRoute:Uu,AuthEc2loadBalancersDescribeLoadBalancersIdRoute:Wu,AuthEc2natGatewaysDescribeNatGatewaysIdRoute:Ku,AuthEc2placementGroupsDescribePlacementGroupsIdRoute:Ju,AuthEc2routeTablesDescribeRouteTablesIdRoute:Xu,AuthEc2securityGroupsDescribeSecurityGroupsIdRoute:Qu,AuthEc2snapshotsDescribeSnapshotsIdRoute:ed,AuthEc2subnetDescribeSubnetsIdRoute:nd,AuthEc2targetGroupsDescribeTargetGroupsIdRoute:id,AuthEc2volumesDescribeVolumesIdRoute:od,AuthEc2volumesModifyVolumeIdRoute:sd,AuthEc2vpcDescribeVpcsIdRoute:ld,AuthEcrrepositoriesListRepositoriesIdRoute:dd,AuthEcsclustersListClustersClusterNameRoute:pd,AuthEksclustersListClustersClusterNameRoute:hd,AuthIamgroupsListGroupsGroupNameRoute:_d,AuthIaminstanceProfilesListInstanceProfilesInstanceProfileNameRoute:$,AuthIampoliciesListPoliciesPolicyArnRoute:bd,AuthIamrolesListRolesRoleNameRoute:Sd,AuthIamusersListUsersUserNameRoute:wd,AuthRdsdbInstancesDescribeDbInstancesIdRoute:Ed,AuthRdsparameterGroupsDescribeDbParameterGroupsNameRoute:Od,AuthRdssnapshotsDescribeDbSnapshotsIdRoute:Ad,AuthRdssnapshotsRestoreDbInstanceFromDbSnapshotIdRoute:jd,AuthRdssubnetGroupsDescribeDbSubnetGroupsNameRoute:Nd,AuthEc2elasticIpsDescribeAddressesIndexRoute:Mu,AuthEc2imagesDescribeImagesIndexRoute:Pu,AuthEc2instancesDescribeInstancesIndexRoute:Iu,AuthEc2internetGatewaysDescribeInternetGatewaysIndexRoute:Ru,AuthEc2keyDescribeKeyPairsIndexRoute:Bu,AuthEc2launchTemplatesDescribeLaunchTemplatesIndexRoute:Hu,AuthEc2loadBalancersDescribeLoadBalancersIndexRoute:Q,AuthEc2natGatewaysDescribeNatGatewaysIndexRoute:Gu,AuthEc2placementGroupsDescribePlacementGroupsIndexRoute:qu,AuthEc2routeTablesDescribeRouteTablesIndexRoute:Yu,AuthEc2securityGroupsDescribeSecurityGroupsIndexRoute:Zu,AuthEc2snapshotsDescribeSnapshotsIndexRoute:$u,AuthEc2subnetDescribeSubnetsIndexRoute:td,AuthEc2targetGroupsDescribeTargetGroupsIndexRoute:rd,AuthEc2volumesDescribeVolumesIndexRoute:ad,AuthEc2vpcDescribeVpcsIndexRoute:cd,AuthEcrrepositoriesListRepositoriesIndexRoute:ud,AuthEcsclustersListClustersIndexRoute:fd,AuthEksclustersListClustersIndexRoute:md,AuthIamgroupsListGroupsIndexRoute:gd,AuthIaminstanceProfilesListInstanceProfilesIndexRoute:vd,AuthIampoliciesListPoliciesIndexRoute:yd,AuthIamrolesListRolesIndexRoute:xd,AuthIamusersListUsersIndexRoute:Cd,AuthRdsdbInstancesDescribeDbInstancesIndexRoute:Td,AuthRdsparameterGroupsDescribeDbParameterGroupsIndexRoute:Dd,AuthRdssnapshotsDescribeDbSnapshotsIndexRoute:kd,AuthRdssubnetGroupsDescribeDbSubnetGroupsIndexRoute:Md,AuthEcsclustersListClustersClusterNameServicesServiceNameRoute:Id,AuthEcsclustersListClustersClusterNameTasksTaskIdRoute:Ld},Bd={AuthRouteRoute:Z._addFileChildren(zd),LoginRoute:Xl},Vd=Jc._addFileChildren(Bd)._addFileTypes(),Hd=Vc(),Ud=co({routeTree:Vd,context:{queryClient:Hd},defaultPreload:`intent`,scrollRestoration:!0,defaultStructuralSharing:!0,defaultPreloadStaleTime:0});async function Wd(e){try{await Ye()}catch(t){e.render((0,V.jsxs)(`div`,{style:{fontFamily:`sans-serif`,margin:`4rem auto`,maxWidth:`40rem`},children:[(0,V.jsx)(`h1`,{children:`Console unavailable`}),(0,V.jsx)(`p`,{children:`This cluster did not report its region, so the console cannot sign requests. Check that the serving node has a region set in its configuration.`}),(0,V.jsx)(`pre`,{children:t instanceof Error?t.message:String(t)})]}));return}e.render((0,V.jsx)(B.StrictMode,{children:(0,V.jsx)(wo,{defaultTheme:`dark`,storageKey:`spinifex-ui-theme`,children:(0,V.jsx)(_,{client:Hd,children:(0,V.jsx)(wn,{children:(0,V.jsx)(Sc,{children:(0,V.jsx)(U,{router:Ud})})})})})}))}var Gd=document.querySelector(`#app`);Gd&&!Gd.innerHTML&&await Wd(xo.createRoot(Gd)); \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/inline-policies-panel.js b/spinifex/services/spinifexui/frontend/dist/assets/inline-policies-panel.js index 277e5e625..fa9480675 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/inline-policies-panel.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/inline-policies-panel.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./button.js";import{t as s}from"./input.js";import{C as c,E as l,S as u,T as d,a as f,b as p,i as m,m as h,r as g,v as _,w as v,x as y}from"./iam.js";import{_ as b,a as x,b as S,g as C,i as w,n as T,o as E,p as D,r as O,x as k}from"./iam2.js";import{r as A}from"./json.js";import{t as j}from"./error-banner.js";import{a as M,r as N,t as P}from"./field.js";import{t as F}from"./delete-confirmation-dialog.js";import{n as I}from"./detail-row.js";import{t as L}from"./json-editor.js";import{s as R}from"./iam3.js";var z=e(n(),1),B=t();function V(e,t){return{run:async n=>await e.mutateAsync(t(n)),error:e.error}}function H({kind:e,name:t}){let n=f(),r=m(),i=g(),s=c(),l=u(),d=y(),{listQuery:p,attach:h,detach:_}={user:{listQuery:w,attach:V(n,e=>({userName:t,policyArn:e})),detach:V(s,e=>({userName:t,policyArn:e}))},role:{listQuery:O,attach:V(r,e=>({roleName:t,policyArn:e})),detach:V(l,e=>({roleName:t,policyArn:e}))},group:{listQuery:T,attach:V(i,e=>({groupName:t,policyArn:e})),detach:V(d,e=>({groupName:t,policyArn:e}))}}[e],{data:v}=a(p(t)),{data:b}=a(D),[x,S]=(0,z.useState)(!1),[C,E]=(0,z.useState)(null),k=v.AttachedPolicies??[],A=b.Policies??[],M=new Set(k.map(e=>e.PolicyArn)),N=A.filter(e=>e.Arn&&!M.has(e.Arn)),P=async e=>{E(e);try{await h.run(e),S(!1)}catch{}finally{E(null)}},F=async e=>{E(e);try{await _.run(e)}catch{}finally{E(null)}};return(0,B.jsxs)(I,{children:[(0,B.jsx)(I.Header,{children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`span`,{children:`Attached Policies`}),(0,B.jsx)(o,{onClick:()=>S(!x),size:`sm`,children:`Attach Policy`})]})}),(0,B.jsxs)(I.Content,{children:[h.error&&(0,B.jsx)(`div`,{className:`col-span-2`,children:(0,B.jsx)(j,{error:h.error,msg:`Failed to attach policy`})}),_.error&&(0,B.jsx)(`div`,{className:`col-span-2`,children:(0,B.jsx)(j,{error:_.error,msg:`Failed to detach policy`})}),x&&N.length>0&&(0,B.jsxs)(`div`,{className:`col-span-2 space-y-2 rounded-md border p-3`,children:[(0,B.jsx)(`p`,{className:`text-sm font-medium`,children:`Select a policy to attach:`}),(0,B.jsx)(`div`,{className:`space-y-1`,children:N.map(e=>(0,B.jsxs)(`button`,{className:`flex w-full items-center justify-between rounded-md p-2 text-left text-sm hover:bg-accent`,disabled:C===e.Arn,onClick:()=>{e.Arn&&P(e.Arn)},type:`button`,children:[(0,B.jsx)(`span`,{children:e.PolicyName}),(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.Arn})]},e.Arn))})]}),x&&N.length===0&&(0,B.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No policies available to attach.`}),k.length>0?(0,B.jsx)(`div`,{className:`col-span-2 space-y-3`,children:k.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`p`,{className:`text-sm font-medium`,children:e.PolicyName}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.PolicyArn})]}),(0,B.jsx)(o,{disabled:C===e.PolicyArn,onClick:()=>{e.PolicyArn&&F(e.PolicyArn)},size:`sm`,variant:`outline`,children:`Detach`})]},e.PolicyArn))}):(0,B.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No attached policies.`})]})]})}var U=r(),W=JSON.stringify({Version:`2012-10-17`,Statement:[{Effect:`Allow`,Action:`*`,Resource:`*`}]},null,2);function G({kind:e,name:t}){let n=l(),r=d(),i=v(),s=p(),c=_(),u=h(),{listQuery:f,policyQuery:m,put:g,remove:y}={user:{listQuery:S,policyQuery:k,put:n,remove:s},role:{listQuery:C,policyQuery:b,put:r,remove:c},group:{listQuery:x,policyQuery:E,put:i,remove:u}}[e],{data:w}=a(f(t)),T=w.PolicyNames??[],[D,O]=(0,z.useState)(!1),[A,M]=(0,z.useState)(null),[N,P]=(0,z.useState)(null),L=async()=>{if(!N)return;let e=N;try{await y.mutateAsync({name:t,policyName:e}),A===e&&M(null)}finally{P(null)}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(I,{children:[(0,B.jsx)(I.Header,{children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`span`,{children:`Inline Policies`}),(0,B.jsx)(o,{onClick:()=>{O(e=>!e),M(null)},size:`sm`,children:`Add Inline Policy`})]})}),(0,B.jsxs)(I.Content,{children:[y.error&&(0,B.jsx)(`div`,{className:`col-span-2`,children:(0,B.jsx)(j,{error:y.error,msg:`Failed to delete inline policy`})}),D&&(0,B.jsx)(`div`,{className:`col-span-2`,children:(0,B.jsx)(K,{name:t,onClose:()=>O(!1),put:g})}),T.length>0?(0,B.jsx)(`div`,{className:`col-span-2 space-y-3`,children:T.map(e=>(0,B.jsxs)(`div`,{className:`rounded-md border`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between p-3`,children:[(0,B.jsx)(`p`,{className:`text-sm font-medium`,children:e}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(o,{onClick:()=>M(t=>t===e?null:e),size:`sm`,variant:`outline`,children:A===e?`Close`:`Edit`}),(0,B.jsx)(o,{onClick:()=>P(e),size:`sm`,variant:`destructive`,children:`Delete`})]})]}),A===e&&(0,B.jsx)(`div`,{className:`border-t p-3`,children:(0,B.jsx)(J,{name:t,onClose:()=>M(null),policyName:e,put:g,queryOptions:m(t,e)})})]},e))}):!D&&(0,B.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No inline policies.`})]})]}),(0,B.jsx)(F,{description:`Are you sure you want to delete the inline policy "${N??``}"? This action cannot be undone.`,isPending:y.isPending,onConfirm:()=>{L()},onOpenChange:e=>{e||P(null)},open:N!==null,title:`Delete Inline Policy`})]})}function K(e){let t=(0,U.c)(50),{name:n,put:r,onClose:i}=e,[a,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(W),d,f;t[0]!==l||t[1]!==a?(d=R.safeParse({policyName:a,policyDocument:l}),f=d.success?void 0:d.error.issues.find(q),t[0]=l,t[1]=a,t[2]=d,t[3]=f):(d=t[2],f=t[3]);let p=f,m;t[4]!==p||t[5]!==a?(m=a.trim().length>0&&!!p,t[4]=p,t[5]=a,t[6]=m):m=t[6];let h=m,g;t[7]===l?g=t[8]:(g=l.trim().length>0&&!A(l),t[7]=l,t[8]=g);let _=g,v;t[9]!==l||t[10]!==n||t[11]!==i||t[12]!==a||t[13]!==r?(v=async()=>{try{await r.mutateAsync({name:n,policyName:a,policyDocument:l}),i()}catch{}},t[9]=l,t[10]=n,t[11]=i,t[12]=a,t[13]=r,t[14]=v):v=t[14];let y=v,b;t[15]===r.error?b=t[16]:(b=r.error&&(0,B.jsx)(j,{error:r.error,msg:`Failed to add inline policy`}),t[15]=r.error,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,B.jsx)(M,{children:(0,B.jsx)(`label`,{htmlFor:`inline-policy-name`,children:`Policy name`})}),t[17]=x):x=t[17];let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>c(e.target.value),t[18]=S):S=t[18];let C;t[19]!==a||t[20]!==h?(C=(0,B.jsx)(s,{"aria-invalid":h,id:`inline-policy-name`,onChange:S,placeholder:`my-inline-policy`,value:a}),t[19]=a,t[20]=h,t[21]=C):C=t[21];let w;t[22]!==p?.message||t[23]!==h?(w=h&&(0,B.jsx)(N,{errors:[{message:p?.message}]}),t[22]=p?.message,t[23]=h,t[24]=w):w=t[24];let T;t[25]!==C||t[26]!==w?(T=(0,B.jsxs)(P,{children:[x,C,w]}),t[25]=C,t[26]=w,t[27]=T):T=t[27];let E;t[28]!==l||t[29]!==_?(E=(0,B.jsx)(L,{className:`text-xs`,error:_,onChange:u,rows:12,value:l}),t[28]=l,t[29]=_,t[30]=E):E=t[30];let D;t[31]===_?D=t[32]:(D=_&&(0,B.jsx)(`p`,{className:`text-sm text-destructive`,children:`Policy must be valid JSON.`}),t[31]=_,t[32]=D);let O;t[33]===i?O=t[34]:(O=(0,B.jsx)(o,{onClick:i,size:`sm`,variant:`outline`,children:`Cancel`}),t[33]=i,t[34]=O);let k=!d.success||r.isPending,F;t[35]===y?F=t[36]:(F=()=>{y()},t[35]=y,t[36]=F);let I=r.isPending?`Saving…`:`Save`,V;t[37]!==k||t[38]!==F||t[39]!==I?(V=(0,B.jsx)(o,{disabled:k,onClick:F,size:`sm`,children:I}),t[37]=k,t[38]=F,t[39]=I,t[40]=V):V=t[40];let H;t[41]!==O||t[42]!==V?(H=(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[O,V]}),t[41]=O,t[42]=V,t[43]=H):H=t[43];let G;return t[44]!==T||t[45]!==E||t[46]!==D||t[47]!==H||t[48]!==b?(G=(0,B.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[b,T,E,D,H]}),t[44]=T,t[45]=E,t[46]=D,t[47]=H,t[48]=b,t[49]=G):G=t[49],G}function q(e){return e.path[0]===`policyName`}function J(e){let t=(0,U.c)(37),{name:n,policyName:r,queryOptions:a,put:s,onClose:c}=e,{data:l,isLoading:u,error:d}=i(a),[f,p]=(0,z.useState)(l??``),[m,h]=(0,z.useState)(l);l!==m&&(h(l),p(l??``));let g;t[0]===f?g=t[1]:(g=f.trim(),t[0]=f,t[1]=g);let _=g,v;t[2]!==f||t[3]!==_.length?(v=_.length>0&&!A(f),t[2]=f,t[3]=_.length,t[4]=v):v=t[4];let y=v,b;t[5]!==f||t[6]!==n||t[7]!==c||t[8]!==r||t[9]!==s?(b=async()=>{try{await s.mutateAsync({name:n,policyName:r,policyDocument:f}),c()}catch{}},t[5]=f,t[6]=n,t[7]=c,t[8]=r,t[9]=s,t[10]=b):b=t[10];let x=b;if(u){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading…`}),t[11]=e):e=t[11],e}if(d){let e;return t[12]===d?e=t[13]:(e=(0,B.jsx)(j,{error:d,msg:`Failed to load inline policy`}),t[12]=d,t[13]=e),e}let S;t[14]===s.error?S=t[15]:(S=s.error&&(0,B.jsx)(j,{error:s.error,msg:`Failed to update inline policy`}),t[14]=s.error,t[15]=S);let C;t[16]!==f||t[17]!==y?(C=(0,B.jsx)(L,{className:`text-xs`,error:y,onChange:p,rows:12,value:f}),t[16]=f,t[17]=y,t[18]=C):C=t[18];let w;t[19]===y?w=t[20]:(w=y&&(0,B.jsx)(`p`,{className:`text-sm text-destructive`,children:`Policy must be valid JSON.`}),t[19]=y,t[20]=w);let T;t[21]===c?T=t[22]:(T=(0,B.jsx)(o,{onClick:c,size:`sm`,variant:`outline`,children:`Cancel`}),t[21]=c,t[22]=T);let E=s.isPending||_.length===0||y,D;t[23]===x?D=t[24]:(D=()=>{x()},t[23]=x,t[24]=D);let O=s.isPending?`Saving…`:`Save`,k;t[25]!==O||t[26]!==E||t[27]!==D?(k=(0,B.jsx)(o,{disabled:E,onClick:D,size:`sm`,children:O}),t[25]=O,t[26]=E,t[27]=D,t[28]=k):k=t[28];let M;t[29]!==k||t[30]!==T?(M=(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[T,k]}),t[29]=k,t[30]=T,t[31]=M):M=t[31];let N;return t[32]!==M||t[33]!==S||t[34]!==C||t[35]!==w?(N=(0,B.jsxs)(`div`,{className:`space-y-3`,children:[S,C,w,M]}),t[32]=M,t[33]=S,t[34]=C,t[35]=w,t[36]=N):N=t[36],N}export{H as n,G as t}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./button.js";import{t as s}from"./input.js";import{C as c,E as l,S as u,T as d,a as f,b as p,i as m,m as h,r as g,v as _,w as v,x as y}from"./iam.js";import{_ as b,a as x,b as S,g as C,i as w,n as T,o as E,p as D,r as O,x as k}from"./iam2.js";import{r as A}from"./json.js";import{t as j}from"./error-banner.js";import{a as M,r as N,t as P}from"./field.js";import{t as F}from"./delete-confirmation-dialog.js";import{n as I}from"./detail-row.js";import{t as L}from"./json-editor.js";import{s as R}from"./iam3.js";var z=e(n(),1),B=t();function V(e,t){return{run:async n=>await e.mutateAsync(t(n)),error:e.error}}function H({kind:e,name:t}){let n=f(),r=m(),i=g(),s=c(),l=u(),d=y(),{listQuery:p,attach:h,detach:_}={user:{listQuery:w,attach:V(n,e=>({userName:t,policyArn:e})),detach:V(s,e=>({userName:t,policyArn:e}))},role:{listQuery:O,attach:V(r,e=>({roleName:t,policyArn:e})),detach:V(l,e=>({roleName:t,policyArn:e}))},group:{listQuery:T,attach:V(i,e=>({groupName:t,policyArn:e})),detach:V(d,e=>({groupName:t,policyArn:e}))}}[e],{data:v}=a(p(t)),{data:b}=a(D),[x,S]=(0,z.useState)(!1),[C,E]=(0,z.useState)(null),k=v.AttachedPolicies??[],A=b.Policies??[],M=new Set(k.map(e=>e.PolicyArn)),N=A.filter(e=>e.Arn&&!M.has(e.Arn)),P=async e=>{E(e);try{await h.run(e),S(!1)}catch{}finally{E(null)}},F=async e=>{E(e);try{await _.run(e)}catch{}finally{E(null)}};return(0,B.jsxs)(I,{children:[(0,B.jsx)(I.Header,{children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`span`,{children:`Attached Policies`}),(0,B.jsx)(o,{onClick:()=>{S(!x)},size:`sm`,children:`Attach Policy`})]})}),(0,B.jsxs)(I.Content,{children:[h.error&&(0,B.jsx)(`div`,{className:`col-span-2`,children:(0,B.jsx)(j,{error:h.error,msg:`Failed to attach policy`})}),_.error&&(0,B.jsx)(`div`,{className:`col-span-2`,children:(0,B.jsx)(j,{error:_.error,msg:`Failed to detach policy`})}),x&&N.length>0&&(0,B.jsxs)(`div`,{className:`col-span-2 space-y-2 rounded-md border p-3`,children:[(0,B.jsx)(`p`,{className:`text-sm font-medium`,children:`Select a policy to attach:`}),(0,B.jsx)(`div`,{className:`space-y-1`,children:N.map(e=>(0,B.jsxs)(`button`,{className:`flex w-full items-center justify-between rounded-md p-2 text-left text-sm hover:bg-accent`,disabled:C===e.Arn,onClick:()=>{e.Arn&&P(e.Arn)},type:`button`,children:[(0,B.jsx)(`span`,{children:e.PolicyName}),(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.Arn})]},e.Arn))})]}),x&&N.length===0&&(0,B.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No policies available to attach.`}),k.length>0?(0,B.jsx)(`div`,{className:`col-span-2 space-y-3`,children:k.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`p`,{className:`text-sm font-medium`,children:e.PolicyName}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.PolicyArn})]}),(0,B.jsx)(o,{disabled:C===e.PolicyArn,onClick:()=>{e.PolicyArn&&F(e.PolicyArn)},size:`sm`,variant:`outline`,children:`Detach`})]},e.PolicyArn))}):(0,B.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No attached policies.`})]})]})}var U=r(),W=JSON.stringify({Version:`2012-10-17`,Statement:[{Effect:`Allow`,Action:`*`,Resource:`*`}]},null,2);function G({kind:e,name:t}){let n=l(),r=d(),i=v(),s=p(),c=_(),u=h(),{listQuery:f,policyQuery:m,put:g,remove:y}={user:{listQuery:S,policyQuery:k,put:n,remove:s},role:{listQuery:C,policyQuery:b,put:r,remove:c},group:{listQuery:x,policyQuery:E,put:i,remove:u}}[e],{data:w}=a(f(t)),T=w.PolicyNames??[],[D,O]=(0,z.useState)(!1),[A,M]=(0,z.useState)(null),[N,P]=(0,z.useState)(null),L=async()=>{if(!N)return;let e=N;try{await y.mutateAsync({name:t,policyName:e}),A===e&&M(null)}finally{P(null)}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(I,{children:[(0,B.jsx)(I.Header,{children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`span`,{children:`Inline Policies`}),(0,B.jsx)(o,{onClick:()=>{O(e=>!e),M(null)},size:`sm`,children:`Add Inline Policy`})]})}),(0,B.jsxs)(I.Content,{children:[y.error&&(0,B.jsx)(`div`,{className:`col-span-2`,children:(0,B.jsx)(j,{error:y.error,msg:`Failed to delete inline policy`})}),D&&(0,B.jsx)(`div`,{className:`col-span-2`,children:(0,B.jsx)(K,{name:t,onClose:()=>{O(!1)},put:g})}),T.length>0?(0,B.jsx)(`div`,{className:`col-span-2 space-y-3`,children:T.map(e=>(0,B.jsxs)(`div`,{className:`rounded-md border`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between p-3`,children:[(0,B.jsx)(`p`,{className:`text-sm font-medium`,children:e}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(o,{onClick:()=>{M(t=>t===e?null:e)},size:`sm`,variant:`outline`,children:A===e?`Close`:`Edit`}),(0,B.jsx)(o,{onClick:()=>{P(e)},size:`sm`,variant:`destructive`,children:`Delete`})]})]}),A===e&&(0,B.jsx)(`div`,{className:`border-t p-3`,children:(0,B.jsx)(J,{name:t,onClose:()=>{M(null)},policyName:e,put:g,queryOptions:m(t,e)})})]},e))}):!D&&(0,B.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No inline policies.`})]})]}),(0,B.jsx)(F,{description:`Are you sure you want to delete the inline policy "${N??``}"? This action cannot be undone.`,isPending:y.isPending,onConfirm:()=>{L()},onOpenChange:e=>{e||P(null)},open:N!==null,title:`Delete Inline Policy`})]})}function K(e){let t=(0,U.c)(50),{name:n,put:r,onClose:i}=e,[a,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(W),d,f;t[0]!==l||t[1]!==a?(d=R.safeParse({policyName:a,policyDocument:l}),f=d.success?void 0:d.error.issues.find(q),t[0]=l,t[1]=a,t[2]=d,t[3]=f):(d=t[2],f=t[3]);let p=f,m;t[4]!==p||t[5]!==a?(m=a.trim().length>0&&!!p,t[4]=p,t[5]=a,t[6]=m):m=t[6];let h=m,g;t[7]===l?g=t[8]:(g=l.trim().length>0&&!A(l),t[7]=l,t[8]=g);let _=g,v;t[9]!==l||t[10]!==n||t[11]!==i||t[12]!==a||t[13]!==r?(v=async()=>{try{await r.mutateAsync({name:n,policyName:a,policyDocument:l}),i()}catch{}},t[9]=l,t[10]=n,t[11]=i,t[12]=a,t[13]=r,t[14]=v):v=t[14];let y=v,b;t[15]===r.error?b=t[16]:(b=r.error&&(0,B.jsx)(j,{error:r.error,msg:`Failed to add inline policy`}),t[15]=r.error,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,B.jsx)(M,{children:(0,B.jsx)(`label`,{htmlFor:`inline-policy-name`,children:`Policy name`})}),t[17]=x):x=t[17];let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{c(e.target.value)},t[18]=S):S=t[18];let C;t[19]!==a||t[20]!==h?(C=(0,B.jsx)(s,{"aria-invalid":h,id:`inline-policy-name`,onChange:S,placeholder:`my-inline-policy`,value:a}),t[19]=a,t[20]=h,t[21]=C):C=t[21];let w;t[22]!==p?.message||t[23]!==h?(w=h&&(0,B.jsx)(N,{errors:[{message:p?.message}]}),t[22]=p?.message,t[23]=h,t[24]=w):w=t[24];let T;t[25]!==C||t[26]!==w?(T=(0,B.jsxs)(P,{children:[x,C,w]}),t[25]=C,t[26]=w,t[27]=T):T=t[27];let E;t[28]!==l||t[29]!==_?(E=(0,B.jsx)(L,{className:`text-xs`,error:_,onChange:u,rows:12,value:l}),t[28]=l,t[29]=_,t[30]=E):E=t[30];let D;t[31]===_?D=t[32]:(D=_&&(0,B.jsx)(`p`,{className:`text-sm text-destructive`,children:`Policy must be valid JSON.`}),t[31]=_,t[32]=D);let O;t[33]===i?O=t[34]:(O=(0,B.jsx)(o,{onClick:i,size:`sm`,variant:`outline`,children:`Cancel`}),t[33]=i,t[34]=O);let k=!d.success||r.isPending,F;t[35]===y?F=t[36]:(F=()=>{y()},t[35]=y,t[36]=F);let I=r.isPending?`Saving…`:`Save`,V;t[37]!==k||t[38]!==F||t[39]!==I?(V=(0,B.jsx)(o,{disabled:k,onClick:F,size:`sm`,children:I}),t[37]=k,t[38]=F,t[39]=I,t[40]=V):V=t[40];let H;t[41]!==O||t[42]!==V?(H=(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[O,V]}),t[41]=O,t[42]=V,t[43]=H):H=t[43];let G;return t[44]!==T||t[45]!==E||t[46]!==D||t[47]!==H||t[48]!==b?(G=(0,B.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[b,T,E,D,H]}),t[44]=T,t[45]=E,t[46]=D,t[47]=H,t[48]=b,t[49]=G):G=t[49],G}function q(e){return e.path[0]===`policyName`}function J(e){let t=(0,U.c)(37),{name:n,policyName:r,queryOptions:a,put:s,onClose:c}=e,{data:l,isLoading:u,error:d}=i(a),[f,p]=(0,z.useState)(l??``),[m,h]=(0,z.useState)(l);l!==m&&(h(l),p(l??``));let g;t[0]===f?g=t[1]:(g=f.trim(),t[0]=f,t[1]=g);let _=g,v;t[2]!==f||t[3]!==_.length?(v=_.length>0&&!A(f),t[2]=f,t[3]=_.length,t[4]=v):v=t[4];let y=v,b;t[5]!==f||t[6]!==n||t[7]!==c||t[8]!==r||t[9]!==s?(b=async()=>{try{await s.mutateAsync({name:n,policyName:r,policyDocument:f}),c()}catch{}},t[5]=f,t[6]=n,t[7]=c,t[8]=r,t[9]=s,t[10]=b):b=t[10];let x=b;if(u){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading…`}),t[11]=e):e=t[11],e}if(d){let e;return t[12]===d?e=t[13]:(e=(0,B.jsx)(j,{error:d,msg:`Failed to load inline policy`}),t[12]=d,t[13]=e),e}let S;t[14]===s.error?S=t[15]:(S=s.error&&(0,B.jsx)(j,{error:s.error,msg:`Failed to update inline policy`}),t[14]=s.error,t[15]=S);let C;t[16]!==f||t[17]!==y?(C=(0,B.jsx)(L,{className:`text-xs`,error:y,onChange:p,rows:12,value:f}),t[16]=f,t[17]=y,t[18]=C):C=t[18];let w;t[19]===y?w=t[20]:(w=y&&(0,B.jsx)(`p`,{className:`text-sm text-destructive`,children:`Policy must be valid JSON.`}),t[19]=y,t[20]=w);let T;t[21]===c?T=t[22]:(T=(0,B.jsx)(o,{onClick:c,size:`sm`,variant:`outline`,children:`Cancel`}),t[21]=c,t[22]=T);let E=s.isPending||_.length===0||y,D;t[23]===x?D=t[24]:(D=()=>{x()},t[23]=x,t[24]=D);let O=s.isPending?`Saving…`:`Save`,k;t[25]!==O||t[26]!==E||t[27]!==D?(k=(0,B.jsx)(o,{disabled:E,onClick:D,size:`sm`,children:O}),t[25]=O,t[26]=E,t[27]=D,t[28]=k):k=t[28];let M;t[29]!==k||t[30]!==T?(M=(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[T,k]}),t[29]=k,t[30]=T,t[31]=M):M=t[31];let N;return t[32]!==M||t[33]!==S||t[34]!==C||t[35]!==w?(N=(0,B.jsxs)(`div`,{className:`space-y-3`,children:[S,C,w,M]}),t[32]=M,t[33]=S,t[34]=C,t[35]=w,t[36]=N):N=t[36],N}export{H as n,G as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/json-editor.js b/spinifex/services/spinifexui/frontend/dist/assets/json-editor.js index 2ca92ce06..3a60c1521 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/json-editor.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/json-editor.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{Xt as n}from"./cluster-config.js";import{n as r}from"./json.js";import{t as i}from"./textarea.js";var a=t(),o=e();function s(e){let t=(0,a.c)(22),s,c,l,u,d,f;t[0]===e?(s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6]):({value:f,onChange:u,error:c,onBlur:l,className:s,...d}=e,t[0]=e,t[1]=s,t[2]=c,t[3]=l,t[4]=u,t[5]=d,t[6]=f);let p;t[7]!==l||t[8]!==u||t[9]!==f?(p=e=>{let t=r(f);t!==null&&t!==f&&u(t),l?.(e)},t[7]=l,t[8]=u,t[9]=f,t[10]=p):p=t[10];let m=p,h;t[11]===s?h=t[12]:(h=n(`font-mono text-sm`,s),t[11]=s,t[12]=h);let g;t[13]===u?g=t[14]:(g=e=>u(e.target.value),t[13]=u,t[14]=g);let _;return t[15]!==c||t[16]!==m||t[17]!==d||t[18]!==h||t[19]!==g||t[20]!==f?(_=(0,o.jsx)(i,{"aria-invalid":c,className:h,onBlur:m,onChange:g,value:f,...d}),t[15]=c,t[16]=m,t[17]=d,t[18]=h,t[19]=g,t[20]=f,t[21]=_):_=t[21],_}export{s as t}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{Xt as n}from"./cluster-config.js";import{n as r}from"./json.js";import{t as i}from"./textarea.js";var a=t(),o=e();function s(e){let t=(0,a.c)(22),s,c,l,u,d,f;t[0]===e?(s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6]):({value:f,onChange:u,error:c,onBlur:l,className:s,...d}=e,t[0]=e,t[1]=s,t[2]=c,t[3]=l,t[4]=u,t[5]=d,t[6]=f);let p;t[7]!==l||t[8]!==u||t[9]!==f?(p=e=>{let t=r(f);t!==null&&t!==f&&u(t),l?.(e)},t[7]=l,t[8]=u,t[9]=f,t[10]=p):p=t[10];let m=p,h;t[11]===s?h=t[12]:(h=n(`font-mono text-sm`,s),t[11]=s,t[12]=h);let g;t[13]===u?g=t[14]:(g=e=>{u(e.target.value)},t[13]=u,t[14]=g);let _;return t[15]!==c||t[16]!==m||t[17]!==d||t[18]!==h||t[19]!==g||t[20]!==f?(_=(0,o.jsx)(i,{"aria-invalid":c,className:h,onBlur:m,onChange:g,value:f,...d}),t[15]=c,t[16]=m,t[17]=d,t[18]=h,t[19]=g,t[20]=f,t[21]=_):_=t[21],_}export{s as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/launch-template-data-fields.js b/spinifex/services/spinifexui/frontend/dist/assets/launch-template-data-fields.js index 8252581e6..6c6551a85 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/launch-template-data-fields.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/launch-template-data-fields.js @@ -1,2 +1,2 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as ee}from"./chevron-down.js";import{c as r,i,n as a,s as o,t as s}from"./select.js";import{t as te}from"./input.js";import{O as ne,c as re,o as ie,p as ae,w as oe}from"./ec2.js";import{a as se,n as c}from"./zod.js";import{a as l,n as ce,r as u,t as d}from"./field.js";import{t as le}from"./ec23.js";import{t as ue}from"./textarea.js";import{n as de,r as fe,t as pe}from"./collapsible.js";var me=t(),f=e(),he=`gp3`,ge=1,_e=16384;function p(e){let t=(0,me.c)(107),{control:p,register:m,errors:h}=e,{data:Ee}=n(ie),{data:De}=n(re),{data:Oe}=n(ae),{data:ke}=n(ne),{data:Ae}=n(oe),je;t[0]===Ee.Images?je=t[1]:(je=Ee.Images??[],t[0]=Ee.Images,t[1]=je);let g=je,_;t[2]===Oe.KeyPairs?_=t[3]:(_=Oe.KeyPairs??[],t[2]=Oe.KeyPairs,t[3]=_);let Me=_,v;t[4]===ke.Subnets?v=t[5]:(v=ke.Subnets??[],t[4]=ke.Subnets,t[5]=v);let y=v,b;t[6]===Ae.SecurityGroups?b=t[7]:(b=Ae.SecurityGroups??[],t[6]=Ae.SecurityGroups,t[7]=b);let x=b,S;t[8]===De.InstanceTypes?S=t[9]:(S=De.InstanceTypes??[],t[8]=De.InstanceTypes,t[9]=S);let C;t[10]===S?C=t[11]:(C=[...new Set(S.map(Te).filter(we))].toSorted(),t[10]=S,t[11]=C);let Ne=C,w;t[12]===p?w=t[13]:(w={control:p,name:`subnetId`},t[12]=p,t[13]=w);let Pe=se(w),T;t[14]!==Pe||t[15]!==y?(T=y.find(e=>e.SubnetId===Pe)?.VpcId,t[14]=Pe,t[15]=y,t[16]=T):T=t[16];let E=T,Fe;t[17]!==E||t[18]!==x?(Fe=E?x.filter(e=>e.VpcId===E):x,t[17]=E,t[18]=x,t[19]=Fe):Fe=t[19];let Ie=Fe,Le;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`imageId`,children:`Image`})}),t[20]=Le):Le=t[20];let D;t[21]!==h.imageId||t[22]!==g?(D=e=>{let{field:t}=e,n=g.find(e=>e.ImageId===t.value);return(0,f.jsxs)(s,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,f.jsx)(o,{"aria-invalid":!!h.imageId,className:`w-full`,id:`imageId`,children:(0,f.jsx)(r,{children:n?`${n.Name??`Unnamed`} (${n.Architecture})`:``})}),(0,f.jsx)(a,{children:g.map(Ce)})]})},t[21]=h.imageId,t[22]=g,t[23]=D):D=t[23];let O;t[24]!==p||t[25]!==D?(O=(0,f.jsx)(c,{control:p,name:`imageId`,render:D}),t[24]=p,t[25]=D,t[26]=O):O=t[26];let k;t[27]===h.imageId?k=t[28]:(k=(0,f.jsx)(u,{errors:[h.imageId]}),t[27]=h.imageId,t[28]=k);let A;t[29]!==O||t[30]!==k?(A=(0,f.jsxs)(d,{children:[Le,O,k]}),t[29]=O,t[30]=k,t[31]=A):A=t[31];let Re;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`instanceType`,children:`Instance Type`})}),t[32]=Re):Re=t[32];let j;t[33]!==h.instanceType||t[34]!==Ne?(j=e=>{let{field:t}=e;return(0,f.jsxs)(s,{onValueChange:e=>t.onChange(e),value:t.value||``,children:[(0,f.jsx)(o,{"aria-invalid":!!h.instanceType,className:`w-full`,id:`instanceType`,children:(0,f.jsx)(r,{})}),(0,f.jsx)(a,{children:Ne.map(Se)})]})},t[33]=h.instanceType,t[34]=Ne,t[35]=j):j=t[35];let M;t[36]!==p||t[37]!==j?(M=(0,f.jsx)(c,{control:p,name:`instanceType`,render:j}),t[36]=p,t[37]=j,t[38]=M):M=t[38];let N;t[39]===h.instanceType?N=t[40]:(N=(0,f.jsx)(u,{errors:[h.instanceType]}),t[39]=h.instanceType,t[40]=N);let P;t[41]!==M||t[42]!==N?(P=(0,f.jsxs)(d,{children:[Re,M,N]}),t[41]=M,t[42]=N,t[43]=P):P=t[43];let ze;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`keyName`,children:`Key Pair`})}),t[44]=ze):ze=t[44];let F;t[45]===Me?F=t[46]:(F=e=>{let{field:t}=e;return(0,f.jsxs)(s,{onValueChange:e=>t.onChange(e===`none`?void 0:e),value:t.value??`none`,children:[(0,f.jsx)(o,{className:`w-full`,id:`keyName`,children:(0,f.jsx)(r,{})}),(0,f.jsxs)(a,{children:[(0,f.jsx)(i,{value:`none`,children:`none`}),Me.map(xe)]})]})},t[45]=Me,t[46]=F);let I;t[47]!==p||t[48]!==F?(I=(0,f.jsxs)(d,{children:[ze,(0,f.jsx)(c,{control:p,name:`keyName`,render:F})]}),t[47]=p,t[48]=F,t[49]=I):I=t[49];let Be;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`subnetId`,children:`Subnet`})}),t[50]=Be):Be=t[50];let L;t[51]===y?L=t[52]:(L=e=>{let{field:t}=e;return(0,f.jsxs)(s,{onValueChange:e=>t.onChange(e===`none`?void 0:e),value:t.value??`none`,children:[(0,f.jsx)(o,{className:`w-full`,id:`subnetId`,children:(0,f.jsx)(r,{})}),(0,f.jsxs)(a,{children:[(0,f.jsx)(i,{value:`none`,children:`none`}),y.map(be)]})]})},t[51]=y,t[52]=L);let R;t[53]!==p||t[54]!==L?(R=(0,f.jsxs)(d,{children:[Be,(0,f.jsx)(c,{control:p,name:`subnetId`,render:L})]}),t[53]=p,t[54]=L,t[55]=R):R=t[55];let Ve;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,f.jsx)(l,{children:`Security Groups`}),t[56]=Ve):Ve=t[56];let He=E?`Applies to VPC ${E}`:`Showing all security groups — select a subnet to filter by VPC`,z;t[57]===He?z=t[58]:(z=(0,f.jsx)(ce,{children:He}),t[57]=He,t[58]=z);let B;t[59]===Ie?B=t[60]:(B=e=>{let{field:t}=e,n=t.value??[],ee=new Set(n),r=e=>{t.onChange(n.includes(e)?n.filter(t=>t!==e):[...n,e])};return Ie.length===0?(0,f.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No security groups available.`}):(0,f.jsx)(`div`,{className:`space-y-1`,children:Ie.map(e=>(0,f.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,f.jsx)(`input`,{"aria-label":`Security group ${e.GroupId} (${e.GroupName})`,checked:ee.has(e.GroupId??``),onChange:()=>r(e.GroupId??``),type:`checkbox`}),(0,f.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})},t[59]=Ie,t[60]=B);let V;t[61]!==p||t[62]!==B?(V=(0,f.jsx)(c,{control:p,name:`securityGroupIds`,render:B}),t[61]=p,t[62]=B,t[63]=V):V=t[63];let H;t[64]!==z||t[65]!==V?(H=(0,f.jsxs)(d,{children:[Ve,z,V]}),t[64]=z,t[65]=V,t[66]=H):H=t[66];let Ue,We;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`userData`,children:`User Data`})}),We=(0,f.jsx)(ce,{children:`Cloud-init or shell script run at first boot.`}),t[67]=Ue,t[68]=We):(Ue=t[67],We=t[68]);let U;t[69]===m?U=t[70]:(U=m(`userData`),t[69]=m,t[70]=U);let W;t[71]===U?W=t[72]:(W=(0,f.jsxs)(d,{children:[Ue,We,(0,f.jsx)(ue,{className:`min-h-32 font-mono`,id:`userData`,placeholder:`#!/bin/bash -echo hello`,...U})]}),t[71]=U,t[72]=W);let Ge;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,f.jsxs)(fe,{className:`group flex h-7 w-full items-center justify-between rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm transition-colors outline-none hover:bg-input/40 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 md:text-xs/relaxed dark:bg-input/30 dark:hover:bg-input/50`,render:(0,f.jsx)(`button`,{"aria-label":`Block Device Mappings (root volume)`,type:`button`}),children:[(0,f.jsx)(`span`,{children:`Block Device Mappings (root volume)`}),(0,f.jsx)(ee,{className:`size-3.5 text-muted-foreground transition-transform group-data-[panel-open]:rotate-180`})]}),t[73]=Ge):Ge=t[73];let Ke;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`rootVolumeSize`,children:`Volume Size (GiB)`})}),t[74]=Ke):Ke=t[74];let qe=!!h.rootVolumeSize,G;t[75]===m?G=t[76]:(G=m(`rootVolumeSize`,{setValueAs:ye}),t[75]=m,t[76]=G);let K;t[77]!==qe||t[78]!==G?(K=(0,f.jsx)(te,{"aria-invalid":qe,id:`rootVolumeSize`,max:_e,min:ge,placeholder:`use AMI default`,type:`number`,...G}),t[77]=qe,t[78]=G,t[79]=K):K=t[79];let q;t[80]===h.rootVolumeSize?q=t[81]:(q=(0,f.jsx)(u,{errors:[h.rootVolumeSize]}),t[80]=h.rootVolumeSize,t[81]=q);let J;t[82]!==K||t[83]!==q?(J=(0,f.jsxs)(d,{children:[Ke,K,q]}),t[82]=K,t[83]=q,t[84]=J):J=t[84];let Je;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`rootVolumeType`,children:`Volume Type`})}),t[85]=Je):Je=t[85];let Y;t[86]===h.rootVolumeType?Y=t[87]:(Y=e=>{let{field:t}=e;return(0,f.jsxs)(s,{onValueChange:e=>t.onChange(e),value:t.value??he,children:[(0,f.jsx)(o,{"aria-invalid":!!h.rootVolumeType,className:`w-full`,id:`rootVolumeType`,children:(0,f.jsx)(r,{})}),(0,f.jsx)(a,{children:le.map(ve)})]})},t[86]=h.rootVolumeType,t[87]=Y);let X;t[88]!==p||t[89]!==Y?(X=(0,f.jsx)(c,{control:p,name:`rootVolumeType`,render:Y}),t[88]=p,t[89]=Y,t[90]=X):X=t[90];let Z;t[91]===h.rootVolumeType?Z=t[92]:(Z=(0,f.jsx)(u,{errors:[h.rootVolumeType]}),t[91]=h.rootVolumeType,t[92]=Z);let Q;t[93]!==X||t[94]!==Z?(Q=(0,f.jsxs)(d,{children:[Je,X,Z]}),t[93]=X,t[94]=Z,t[95]=Q):Q=t[95];let $;t[96]!==J||t[97]!==Q?($=(0,f.jsxs)(pe,{children:[Ge,(0,f.jsxs)(de,{className:`mt-3 space-y-4 rounded-md border border-border p-4`,children:[J,Q]})]}),t[96]=J,t[97]=Q,t[98]=$):$=t[98];let Ye;return t[99]!==A||t[100]!==P||t[101]!==I||t[102]!==R||t[103]!==H||t[104]!==W||t[105]!==$?(Ye=(0,f.jsxs)(f.Fragment,{children:[A,P,I,R,H,W,$]}),t[99]=A,t[100]=P,t[101]=I,t[102]=R,t[103]=H,t[104]=W,t[105]=$,t[106]=Ye):Ye=t[106],Ye}function ve(e){return(0,f.jsx)(i,{value:e,children:e},e)}function ye(e){return e===``||e==null?void 0:Number(e)}function be(e){return(0,f.jsx)(i,{value:e.SubnetId??``,children:e.SubnetId},e.SubnetId)}function xe(e){return(0,f.jsx)(i,{value:e.KeyName??``,children:e.KeyName},e.KeyPairId)}function Se(e){return(0,f.jsx)(i,{value:e,children:e},e)}function Ce(e){return(0,f.jsxs)(i,{value:e.ImageId??``,children:[e.Name??`Unnamed`,` (`,e.Architecture,`)`]},e.ImageId)}function we(e){return!!e}function Te(e){return e.InstanceType}export{p as t}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as ee}from"./chevron-down.js";import{c as r,i,n as a,s as o,t as s}from"./select.js";import{t as te}from"./input.js";import{O as ne,c as re,o as ie,p as ae,w as oe}from"./ec2.js";import{a as se,n as c}from"./zod.js";import{a as l,n as ce,r as u,t as d}from"./field.js";import{t as le}from"./ec23.js";import{t as ue}from"./textarea.js";import{n as de,r as fe,t as pe}from"./collapsible.js";var me=t(),f=e(),he=`gp3`,ge=1,_e=16384;function p(e){let t=(0,me.c)(107),{control:p,register:m,errors:h}=e,{data:Ee}=n(ie),{data:De}=n(re),{data:Oe}=n(ae),{data:ke}=n(ne),{data:Ae}=n(oe),je;t[0]===Ee.Images?je=t[1]:(je=Ee.Images??[],t[0]=Ee.Images,t[1]=je);let g=je,_;t[2]===Oe.KeyPairs?_=t[3]:(_=Oe.KeyPairs??[],t[2]=Oe.KeyPairs,t[3]=_);let Me=_,v;t[4]===ke.Subnets?v=t[5]:(v=ke.Subnets??[],t[4]=ke.Subnets,t[5]=v);let y=v,b;t[6]===Ae.SecurityGroups?b=t[7]:(b=Ae.SecurityGroups??[],t[6]=Ae.SecurityGroups,t[7]=b);let x=b,S;t[8]===De.InstanceTypes?S=t[9]:(S=De.InstanceTypes??[],t[8]=De.InstanceTypes,t[9]=S);let C;t[10]===S?C=t[11]:(C=[...new Set(S.map(Te).filter(we))].toSorted(),t[10]=S,t[11]=C);let Ne=C,w;t[12]===p?w=t[13]:(w={control:p,name:`subnetId`},t[12]=p,t[13]=w);let Pe=se(w),T;t[14]!==Pe||t[15]!==y?(T=y.find(e=>e.SubnetId===Pe)?.VpcId,t[14]=Pe,t[15]=y,t[16]=T):T=t[16];let E=T,Fe;t[17]!==E||t[18]!==x?(Fe=E?x.filter(e=>e.VpcId===E):x,t[17]=E,t[18]=x,t[19]=Fe):Fe=t[19];let Ie=Fe,Le;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`imageId`,children:`Image`})}),t[20]=Le):Le=t[20];let D;t[21]!==h.imageId||t[22]!==g?(D=e=>{let{field:t}=e,n=g.find(e=>e.ImageId===t.value);return(0,f.jsxs)(s,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,f.jsx)(o,{"aria-invalid":!!h.imageId,className:`w-full`,id:`imageId`,children:(0,f.jsx)(r,{children:n?`${n.Name??`Unnamed`} (${n.Architecture})`:``})}),(0,f.jsx)(a,{children:g.map(Ce)})]})},t[21]=h.imageId,t[22]=g,t[23]=D):D=t[23];let O;t[24]!==p||t[25]!==D?(O=(0,f.jsx)(c,{control:p,name:`imageId`,render:D}),t[24]=p,t[25]=D,t[26]=O):O=t[26];let k;t[27]===h.imageId?k=t[28]:(k=(0,f.jsx)(u,{errors:[h.imageId]}),t[27]=h.imageId,t[28]=k);let A;t[29]!==O||t[30]!==k?(A=(0,f.jsxs)(d,{children:[Le,O,k]}),t[29]=O,t[30]=k,t[31]=A):A=t[31];let Re;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`instanceType`,children:`Instance Type`})}),t[32]=Re):Re=t[32];let j;t[33]!==h.instanceType||t[34]!==Ne?(j=e=>{let{field:t}=e;return(0,f.jsxs)(s,{onValueChange:e=>{t.onChange(e)},value:t.value||``,children:[(0,f.jsx)(o,{"aria-invalid":!!h.instanceType,className:`w-full`,id:`instanceType`,children:(0,f.jsx)(r,{})}),(0,f.jsx)(a,{children:Ne.map(Se)})]})},t[33]=h.instanceType,t[34]=Ne,t[35]=j):j=t[35];let M;t[36]!==p||t[37]!==j?(M=(0,f.jsx)(c,{control:p,name:`instanceType`,render:j}),t[36]=p,t[37]=j,t[38]=M):M=t[38];let N;t[39]===h.instanceType?N=t[40]:(N=(0,f.jsx)(u,{errors:[h.instanceType]}),t[39]=h.instanceType,t[40]=N);let P;t[41]!==M||t[42]!==N?(P=(0,f.jsxs)(d,{children:[Re,M,N]}),t[41]=M,t[42]=N,t[43]=P):P=t[43];let ze;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`keyName`,children:`Key Pair`})}),t[44]=ze):ze=t[44];let F;t[45]===Me?F=t[46]:(F=e=>{let{field:t}=e;return(0,f.jsxs)(s,{onValueChange:e=>{t.onChange(e===`none`?void 0:e)},value:t.value??`none`,children:[(0,f.jsx)(o,{className:`w-full`,id:`keyName`,children:(0,f.jsx)(r,{})}),(0,f.jsxs)(a,{children:[(0,f.jsx)(i,{value:`none`,children:`none`}),Me.map(xe)]})]})},t[45]=Me,t[46]=F);let I;t[47]!==p||t[48]!==F?(I=(0,f.jsxs)(d,{children:[ze,(0,f.jsx)(c,{control:p,name:`keyName`,render:F})]}),t[47]=p,t[48]=F,t[49]=I):I=t[49];let Be;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`subnetId`,children:`Subnet`})}),t[50]=Be):Be=t[50];let L;t[51]===y?L=t[52]:(L=e=>{let{field:t}=e;return(0,f.jsxs)(s,{onValueChange:e=>{t.onChange(e===`none`?void 0:e)},value:t.value??`none`,children:[(0,f.jsx)(o,{className:`w-full`,id:`subnetId`,children:(0,f.jsx)(r,{})}),(0,f.jsxs)(a,{children:[(0,f.jsx)(i,{value:`none`,children:`none`}),y.map(be)]})]})},t[51]=y,t[52]=L);let R;t[53]!==p||t[54]!==L?(R=(0,f.jsxs)(d,{children:[Be,(0,f.jsx)(c,{control:p,name:`subnetId`,render:L})]}),t[53]=p,t[54]=L,t[55]=R):R=t[55];let Ve;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,f.jsx)(l,{children:`Security Groups`}),t[56]=Ve):Ve=t[56];let He=E?`Applies to VPC ${E}`:`Showing all security groups — select a subnet to filter by VPC`,z;t[57]===He?z=t[58]:(z=(0,f.jsx)(ce,{children:He}),t[57]=He,t[58]=z);let B;t[59]===Ie?B=t[60]:(B=e=>{let{field:t}=e,n=t.value??[],ee=new Set(n),r=e=>{t.onChange(n.includes(e)?n.filter(t=>t!==e):[...n,e])};return Ie.length===0?(0,f.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No security groups available.`}):(0,f.jsx)(`div`,{className:`space-y-1`,children:Ie.map(e=>(0,f.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,f.jsx)(`input`,{"aria-label":`Security group ${e.GroupId} (${e.GroupName})`,checked:ee.has(e.GroupId??``),onChange:()=>{r(e.GroupId??``)},type:`checkbox`}),(0,f.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})},t[59]=Ie,t[60]=B);let V;t[61]!==p||t[62]!==B?(V=(0,f.jsx)(c,{control:p,name:`securityGroupIds`,render:B}),t[61]=p,t[62]=B,t[63]=V):V=t[63];let H;t[64]!==z||t[65]!==V?(H=(0,f.jsxs)(d,{children:[Ve,z,V]}),t[64]=z,t[65]=V,t[66]=H):H=t[66];let Ue,We;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`userData`,children:`User Data`})}),We=(0,f.jsx)(ce,{children:`Cloud-init or shell script run at first boot.`}),t[67]=Ue,t[68]=We):(Ue=t[67],We=t[68]);let U;t[69]===m?U=t[70]:(U=m(`userData`),t[69]=m,t[70]=U);let W;t[71]===U?W=t[72]:(W=(0,f.jsxs)(d,{children:[Ue,We,(0,f.jsx)(ue,{className:`min-h-32 font-mono`,id:`userData`,placeholder:`#!/bin/bash +echo hello`,...U})]}),t[71]=U,t[72]=W);let Ge;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,f.jsxs)(fe,{className:`group flex h-7 w-full items-center justify-between rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm transition-colors outline-none hover:bg-input/40 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 md:text-xs/relaxed dark:bg-input/30 dark:hover:bg-input/50`,render:(0,f.jsx)(`button`,{"aria-label":`Block Device Mappings (root volume)`,type:`button`}),children:[(0,f.jsx)(`span`,{children:`Block Device Mappings (root volume)`}),(0,f.jsx)(ee,{className:`size-3.5 text-muted-foreground transition-transform group-data-[panel-open]:rotate-180`})]}),t[73]=Ge):Ge=t[73];let Ke;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`rootVolumeSize`,children:`Volume Size (GiB)`})}),t[74]=Ke):Ke=t[74];let qe=!!h.rootVolumeSize,G;t[75]===m?G=t[76]:(G=m(`rootVolumeSize`,{setValueAs:ye}),t[75]=m,t[76]=G);let K;t[77]!==qe||t[78]!==G?(K=(0,f.jsx)(te,{"aria-invalid":qe,id:`rootVolumeSize`,max:_e,min:ge,placeholder:`use AMI default`,type:`number`,...G}),t[77]=qe,t[78]=G,t[79]=K):K=t[79];let q;t[80]===h.rootVolumeSize?q=t[81]:(q=(0,f.jsx)(u,{errors:[h.rootVolumeSize]}),t[80]=h.rootVolumeSize,t[81]=q);let J;t[82]!==K||t[83]!==q?(J=(0,f.jsxs)(d,{children:[Ke,K,q]}),t[82]=K,t[83]=q,t[84]=J):J=t[84];let Je;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`rootVolumeType`,children:`Volume Type`})}),t[85]=Je):Je=t[85];let Y;t[86]===h.rootVolumeType?Y=t[87]:(Y=e=>{let{field:t}=e;return(0,f.jsxs)(s,{onValueChange:e=>{t.onChange(e)},value:t.value??he,children:[(0,f.jsx)(o,{"aria-invalid":!!h.rootVolumeType,className:`w-full`,id:`rootVolumeType`,children:(0,f.jsx)(r,{})}),(0,f.jsx)(a,{children:le.map(ve)})]})},t[86]=h.rootVolumeType,t[87]=Y);let X;t[88]!==p||t[89]!==Y?(X=(0,f.jsx)(c,{control:p,name:`rootVolumeType`,render:Y}),t[88]=p,t[89]=Y,t[90]=X):X=t[90];let Z;t[91]===h.rootVolumeType?Z=t[92]:(Z=(0,f.jsx)(u,{errors:[h.rootVolumeType]}),t[91]=h.rootVolumeType,t[92]=Z);let Q;t[93]!==X||t[94]!==Z?(Q=(0,f.jsxs)(d,{children:[Je,X,Z]}),t[93]=X,t[94]=Z,t[95]=Q):Q=t[95];let $;t[96]!==J||t[97]!==Q?($=(0,f.jsxs)(pe,{children:[Ge,(0,f.jsxs)(de,{className:`mt-3 space-y-4 rounded-md border border-border p-4`,children:[J,Q]})]}),t[96]=J,t[97]=Q,t[98]=$):$=t[98];let Ye;return t[99]!==A||t[100]!==P||t[101]!==I||t[102]!==R||t[103]!==H||t[104]!==W||t[105]!==$?(Ye=(0,f.jsxs)(f.Fragment,{children:[A,P,I,R,H,W,$]}),t[99]=A,t[100]=P,t[101]=I,t[102]=R,t[103]=H,t[104]=W,t[105]=$,t[106]=Ye):Ye=t[106],Ye}function ve(e){return(0,f.jsx)(i,{value:e,children:e},e)}function ye(e){return e===``||e==null?void 0:Number(e)}function be(e){return(0,f.jsx)(i,{value:e.SubnetId??``,children:e.SubnetId},e.SubnetId)}function xe(e){return(0,f.jsx)(i,{value:e.KeyName??``,children:e.KeyName},e.KeyPairId)}function Se(e){return(0,f.jsx)(i,{value:e,children:e},e)}function Ce(e){return(0,f.jsxs)(i,{value:e.ImageId??``,children:[e.Name??`Unnamed`,` (`,e.Architecture,`)`]},e.ImageId)}function we(e){return!!e}function Te(e){return e.InstanceType}export{p as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/list-clusters.js b/spinifex/services/spinifexui/frontend/dist/assets/list-clusters.js index 4da0f7540..420aded33 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/list-clusters.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/list-clusters.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{n as i}from"./QueryClientProvider.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{t as s}from"./useNavigate.js";import{t as c}from"./button.js";import{t as l}from"./input.js";import{o as u}from"./ec2.js";import{n as d}from"./ecs.js";import{r as f,t as p}from"./ecs2.js";import{t as m}from"./error-banner.js";import{t as h}from"./page-heading.js";import{a as g,t as _}from"./field.js";import{a as v,i as y,l as b,n as x,o as S,r as C,s as w,t as T}from"./alert-dialog.js";import{t as E}from"./delete-confirmation-dialog.js";import{t as D}from"./state-badge.js";import{t as O}from"./system-managed.js";import{t as k}from"./system-image-required.js";import{t as A}from"./ecs-section-nav.js";var j=r(),M=e(n(),1),N=t();function P(e){let t=(0,j.c)(32),{open:n,onOpenChange:r}=e,i=p(),[a,o]=(0,M.useState)(``),s;t[0]!==i||t[1]!==r?(s=function(e){e||(o(``),i.reset()),r(e)},t[0]=i,t[1]=r,t[2]=s):s=t[2];let c=s,u;t[3]!==i||t[4]!==c||t[5]!==a?(u=async function(){try{await i.mutateAsync(a.trim()),c(!1)}catch{}},t[3]=i,t[4]=c,t[5]=a,t[6]=u):u=t[6];let d=u,f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,N.jsxs)(w,{children:[(0,N.jsx)(b,{children:`Create Cluster`}),(0,N.jsx)(v,{children:`A cluster groups the services, tasks, and container instances that run on it.`})]}),t[7]=f):f=t[7];let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,N.jsx)(g,{children:(0,N.jsx)(`label`,{htmlFor:`clusterName`,children:`Name`})}),t[8]=m):m=t[8];let h;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>o(e.target.value),t[9]=h):h=t[9];let E;t[10]===a?E=t[11]:(E=(0,N.jsxs)(_,{children:[m,(0,N.jsx)(l,{id:`clusterName`,onChange:h,placeholder:`my-cluster`,value:a})]}),t[10]=a,t[11]=E);let D;t[12]===i.error?D=t[13]:(D=i.error&&(0,N.jsx)(`p`,{className:`text-sm text-destructive`,children:i.error.message}),t[12]=i.error,t[13]=D);let O;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,N.jsx)(C,{children:`Cancel`}),t[14]=O):O=t[14];let k;t[15]!==i.isPending||t[16]!==a?(k=i.isPending||!a.trim(),t[15]=i.isPending,t[16]=a,t[17]=k):k=t[17];let A;t[18]===d?A=t[19]:(A=e=>{e.preventDefault(),d()},t[18]=d,t[19]=A);let P=i.isPending?`Creating…`:`Create Cluster`,F;t[20]!==A||t[21]!==P||t[22]!==k?(F=(0,N.jsxs)(S,{children:[O,(0,N.jsx)(x,{disabled:k,onClick:A,children:P})]}),t[20]=A,t[21]=P,t[22]=k,t[23]=F):F=t[23];let I;t[24]!==F||t[25]!==E||t[26]!==D?(I=(0,N.jsxs)(y,{children:[f,E,D,F]}),t[24]=F,t[25]=E,t[26]=D,t[27]=I):I=t[27];let L;return t[28]!==c||t[29]!==n||t[30]!==I?(L=(0,N.jsx)(T,{onOpenChange:c,open:n,children:I}),t[28]=c,t[29]=n,t[30]=I,t[31]=L):L=t[31],L}function F(){let e=s(),t=i(),{data:n}=a(d),{data:r}=a(u),l=f(),[p,g]=(0,M.useState)(!1),[_,v]=(0,M.useState)(null),[y,b]=(0,M.useState)(!1),x=(r.Images??[]).some(O);async function S(){b(!0);try{await t.invalidateQueries({queryKey:u.queryKey})}finally{b(!1)}}function C(){_&&l.mutate(_,{onSuccess:()=>v(null)})}return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(h,{actions:(0,N.jsx)(c,{disabled:!x,onClick:()=>g(!0),children:`Create Cluster`}),title:`Clusters`}),(0,N.jsx)(A,{}),!x&&(0,N.jsx)(k,{className:`mb-6`,description:`ECS clusters need a Spinifex-managed node image (containerd + ecs-agent) to launch container instances. Import it before creating a cluster.`,importCommand:`spx admin images import --name spinifex-ecs-node`,isRechecking:y,onRecheck:S,title:`ECS system image not found`}),l.isError&&(0,N.jsx)(m,{error:l.error instanceof Error?l.error:void 0,msg:`Failed to delete cluster.`}),n.length>0?(0,N.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Services`}),(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running Tasks`}),(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Instances`}),(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,N.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,N.jsx)(`tbody`,{children:n.map(t=>{if(!t.clusterName)return null;let n=t.clusterName;return(0,N.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await e({to:`/ecs/list-clusters/$clusterName`,params:{clusterName:n}}),children:[(0,N.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,N.jsx)(o,{className:`text-primary hover:underline`,onClick:e=>e.stopPropagation(),params:{clusterName:n},to:`/ecs/list-clusters/$clusterName`,children:n})}),(0,N.jsx)(`td`,{className:`px-4 py-2`,children:(0,N.jsx)(D,{state:t.status})}),(0,N.jsx)(`td`,{className:`px-4 py-2`,children:t.activeServicesCount??0}),(0,N.jsx)(`td`,{className:`px-4 py-2`,children:t.runningTasksCount??0}),(0,N.jsx)(`td`,{className:`px-4 py-2`,children:t.registeredContainerInstancesCount??0}),(0,N.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,N.jsx)(c,{onClick:e=>{e.stopPropagation(),v(n)},size:`sm`,variant:`destructive`,children:`Delete`})})]},n)})})]})}):(0,N.jsx)(`p`,{className:`text-muted-foreground`,children:`No ECS clusters found.`}),(0,N.jsx)(P,{onOpenChange:g,open:p}),(0,N.jsx)(E,{description:`This permanently deletes cluster "${_}" and force-stops every task it holds. This cannot be undone.`,isPending:l.isPending,onConfirm:C,onOpenChange:e=>!e&&v(null),open:_!==null,title:`Delete cluster`})]})}var I=F;export{I as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{n as i}from"./QueryClientProvider.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{t as s}from"./useNavigate.js";import{t as c}from"./button.js";import{t as l}from"./input.js";import{o as u}from"./ec2.js";import{n as d}from"./ecs.js";import{r as f,t as p}from"./ecs2.js";import{t as m}from"./error-banner.js";import{t as h}from"./page-heading.js";import{a as g,t as _}from"./field.js";import{a as v,i as y,l as b,n as x,o as S,r as C,s as w,t as T}from"./alert-dialog.js";import{t as E}from"./delete-confirmation-dialog.js";import{t as D}from"./state-badge.js";import{t as O}from"./system-managed.js";import{t as k}from"./system-image-required.js";import{t as A}from"./ecs-section-nav.js";var j=r(),M=e(n(),1),N=t();function P(e){let t=(0,j.c)(32),{open:n,onOpenChange:r}=e,i=p(),[a,o]=(0,M.useState)(``),s;t[0]!==i||t[1]!==r?(s=function(e){e||(o(``),i.reset()),r(e)},t[0]=i,t[1]=r,t[2]=s):s=t[2];let c=s,u;t[3]!==i||t[4]!==c||t[5]!==a?(u=async function(){try{await i.mutateAsync(a.trim()),c(!1)}catch{}},t[3]=i,t[4]=c,t[5]=a,t[6]=u):u=t[6];let d=u,f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,N.jsxs)(w,{children:[(0,N.jsx)(b,{children:`Create Cluster`}),(0,N.jsx)(v,{children:`A cluster groups the services, tasks, and container instances that run on it.`})]}),t[7]=f):f=t[7];let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,N.jsx)(g,{children:(0,N.jsx)(`label`,{htmlFor:`clusterName`,children:`Name`})}),t[8]=m):m=t[8];let h;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>{o(e.target.value)},t[9]=h):h=t[9];let E;t[10]===a?E=t[11]:(E=(0,N.jsxs)(_,{children:[m,(0,N.jsx)(l,{id:`clusterName`,onChange:h,placeholder:`my-cluster`,value:a})]}),t[10]=a,t[11]=E);let D;t[12]===i.error?D=t[13]:(D=i.error&&(0,N.jsx)(`p`,{className:`text-sm text-destructive`,children:i.error.message}),t[12]=i.error,t[13]=D);let O;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,N.jsx)(C,{children:`Cancel`}),t[14]=O):O=t[14];let k;t[15]!==i.isPending||t[16]!==a?(k=i.isPending||!a.trim(),t[15]=i.isPending,t[16]=a,t[17]=k):k=t[17];let A;t[18]===d?A=t[19]:(A=e=>{e.preventDefault(),d()},t[18]=d,t[19]=A);let P=i.isPending?`Creating…`:`Create Cluster`,F;t[20]!==A||t[21]!==P||t[22]!==k?(F=(0,N.jsxs)(S,{children:[O,(0,N.jsx)(x,{disabled:k,onClick:A,children:P})]}),t[20]=A,t[21]=P,t[22]=k,t[23]=F):F=t[23];let I;t[24]!==F||t[25]!==E||t[26]!==D?(I=(0,N.jsxs)(y,{children:[f,E,D,F]}),t[24]=F,t[25]=E,t[26]=D,t[27]=I):I=t[27];let L;return t[28]!==c||t[29]!==n||t[30]!==I?(L=(0,N.jsx)(T,{onOpenChange:c,open:n,children:I}),t[28]=c,t[29]=n,t[30]=I,t[31]=L):L=t[31],L}function F(){let e=s(),t=i(),{data:n}=a(d),{data:r}=a(u),l=f(),[p,g]=(0,M.useState)(!1),[_,v]=(0,M.useState)(null),[y,b]=(0,M.useState)(!1),x=(r.Images??[]).some(O);async function S(){b(!0);try{await t.invalidateQueries({queryKey:u.queryKey})}finally{b(!1)}}function C(){_&&l.mutate(_,{onSuccess:()=>{v(null)}})}return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(h,{actions:(0,N.jsx)(c,{disabled:!x,onClick:()=>{g(!0)},children:`Create Cluster`}),title:`Clusters`}),(0,N.jsx)(A,{}),!x&&(0,N.jsx)(k,{className:`mb-6`,description:`ECS clusters need a Spinifex-managed node image (containerd + ecs-agent) to launch container instances. Import it before creating a cluster.`,importCommand:`spx admin images import --name spinifex-ecs-node`,isRechecking:y,onRecheck:S,title:`ECS system image not found`}),l.isError&&(0,N.jsx)(m,{error:l.error instanceof Error?l.error:void 0,msg:`Failed to delete cluster.`}),n.length>0?(0,N.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Services`}),(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running Tasks`}),(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Instances`}),(0,N.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,N.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,N.jsx)(`tbody`,{children:n.map(t=>{if(!t.clusterName)return null;let n=t.clusterName;return(0,N.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>{await e({to:`/ecs/list-clusters/$clusterName`,params:{clusterName:n}})},children:[(0,N.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,N.jsx)(o,{className:`text-primary hover:underline`,onClick:e=>{e.stopPropagation()},params:{clusterName:n},to:`/ecs/list-clusters/$clusterName`,children:n})}),(0,N.jsx)(`td`,{className:`px-4 py-2`,children:(0,N.jsx)(D,{state:t.status})}),(0,N.jsx)(`td`,{className:`px-4 py-2`,children:t.activeServicesCount??0}),(0,N.jsx)(`td`,{className:`px-4 py-2`,children:t.runningTasksCount??0}),(0,N.jsx)(`td`,{className:`px-4 py-2`,children:t.registeredContainerInstancesCount??0}),(0,N.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,N.jsx)(c,{onClick:e=>{e.stopPropagation(),v(n)},size:`sm`,variant:`destructive`,children:`Delete`})})]},n)})})]})}):(0,N.jsx)(`p`,{className:`text-muted-foreground`,children:`No ECS clusters found.`}),(0,N.jsx)(P,{onOpenChange:g,open:p}),(0,N.jsx)(E,{description:`This permanently deletes cluster "${_}" and force-stops every task it holds. This cannot be undone.`,isPending:l.isPending,onConfirm:C,onOpenChange:e=>{e||v(null)},open:_!==null,title:`Delete cluster`})]})}var I=F;export{I as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/list-repositories.js b/spinifex/services/spinifexui/frontend/dist/assets/list-repositories.js index 80e40a163..88e0493aa 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/list-repositories.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/list-repositories.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{$t as s}from"./cluster-config.js";import{t as c}from"./button.js";import{t as l}from"./input.js";import{n as u}from"./ecr.js";import{i as d,n as f}from"./ecr2.js";import{t as p}from"./page-heading.js";import{a as m,t as h}from"./field.js";import{a as g,i as _,l as v,n as y,o as b,r as x,s as S,t as C}from"./alert-dialog.js";var w=r(),T=e(n(),1),E=t();function D(e){let t=(0,w.c)(32),{open:n,onOpenChange:r}=e,i=f(),[a,o]=(0,T.useState)(``),s;t[0]!==i||t[1]!==r?(s=function(e){e||(o(``),i.reset()),r(e)},t[0]=i,t[1]=r,t[2]=s):s=t[2];let c=s,u;t[3]!==i||t[4]!==c||t[5]!==a?(u=async function(){try{await i.mutateAsync(a.trim()),c(!1)}catch{}},t[3]=i,t[4]=c,t[5]=a,t[6]=u):u=t[6];let d=u,p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,E.jsxs)(S,{children:[(0,E.jsx)(v,{children:`Create Repository`}),(0,E.jsx)(g,{children:`Repository names may include namespaces, e.g. team/app.`})]}),t[7]=p):p=t[7];let D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,E.jsx)(m,{children:(0,E.jsx)(`label`,{htmlFor:`repositoryName`,children:`Name`})}),t[8]=D):D=t[8];let O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>o(e.target.value),t[9]=O):O=t[9];let k;t[10]===a?k=t[11]:(k=(0,E.jsxs)(h,{children:[D,(0,E.jsx)(l,{id:`repositoryName`,onChange:O,placeholder:`team/app`,value:a})]}),t[10]=a,t[11]=k);let A;t[12]===i.error?A=t[13]:(A=i.error&&(0,E.jsx)(`p`,{className:`text-sm text-destructive`,children:i.error.message}),t[12]=i.error,t[13]=A);let j;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,E.jsx)(x,{children:`Cancel`}),t[14]=j):j=t[14];let M;t[15]!==i.isPending||t[16]!==a?(M=i.isPending||!a.trim(),t[15]=i.isPending,t[16]=a,t[17]=M):M=t[17];let N;t[18]===d?N=t[19]:(N=e=>{e.preventDefault(),d()},t[18]=d,t[19]=N);let P=i.isPending?`Creating…`:`Create Repository`,F;t[20]!==N||t[21]!==P||t[22]!==M?(F=(0,E.jsxs)(b,{children:[j,(0,E.jsx)(y,{disabled:M,onClick:N,children:P})]}),t[20]=N,t[21]=P,t[22]=M,t[23]=F):F=t[23];let I;t[24]!==F||t[25]!==k||t[26]!==A?(I=(0,E.jsxs)(_,{children:[p,k,A,F]}),t[24]=F,t[25]=k,t[26]=A,t[27]=I):I=t[27];let L;return t[28]!==c||t[29]!==n||t[30]!==I?(L=(0,E.jsx)(C,{onOpenChange:c,open:n,children:I}),t[28]=c,t[29]=n,t[30]=I,t[31]=L):L=t[31],L}function O(){let e=(0,w.c)(35),t=o(),{data:n}=i(u),r=d(),[l,f]=(0,T.useState)(!1),[m,h]=(0,T.useState)(null),O;e[0]===n.repositories?O=e[1]:(O=n.repositories??[],e[0]=n.repositories,e[1]=O);let A=O,j;e[2]!==r||e[3]!==m?(j=async function(){if(m)try{await r.mutateAsync(m),h(null)}catch{}},e[2]=r,e[3]=m,e[4]=j):j=e[4];let M=j,N;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,E.jsx)(p,{actions:(0,E.jsx)(c,{onClick:()=>f(!0),children:`Create Repository`}),title:`Repositories`}),e[5]=N):N=e[5];let P;e[6]!==t||e[7]!==A?(P=A.length>0?(0,E.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,E.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,E.jsx)(`thead`,{children:(0,E.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`URI`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Tag Mutability`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Created`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,E.jsx)(`tbody`,{children:A.map(e=>{if(!e.repositoryName)return null;let n=e.repositoryName;return(0,E.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await t({to:`/ecr/list-repositories/$id`,params:{id:encodeURIComponent(n)}}),children:[(0,E.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,E.jsx)(a,{className:`text-primary hover:underline`,onClick:k,params:{id:encodeURIComponent(n)},to:`/ecr/list-repositories/$id`,children:n})}),(0,E.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.repositoryUri??``}),(0,E.jsx)(`td`,{className:`px-4 py-2`,children:e.imageTagMutability??``}),(0,E.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:s(e.createdAt)}),(0,E.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,E.jsx)(c,{onClick:e=>{e.stopPropagation(),h(n)},size:`sm`,variant:`destructive`,children:`Delete`})})]},n)})})]})}):(0,E.jsx)(`p`,{className:`text-muted-foreground`,children:`No repositories found.`}),e[6]=t,e[7]=A,e[8]=P):P=e[8];let F;e[9]===l?F=e[10]:(F=(0,E.jsx)(D,{onOpenChange:f,open:l}),e[9]=l,e[10]=F);let I;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>!e&&h(null),e[11]=I):I=e[11];let L=m!==null,R;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,E.jsx)(v,{children:`Delete repository?`}),e[12]=R):R=e[12];let z;e[13]===m?z=e[14]:(z=(0,E.jsxs)(S,{children:[R,(0,E.jsxs)(g,{children:[`This permanently deletes `,m,` and every image it holds. This cannot be undone.`]})]}),e[13]=m,e[14]=z);let B;e[15]===r.error?B=e[16]:(B=r.error&&(0,E.jsx)(`p`,{className:`text-sm text-destructive`,children:r.error.message}),e[15]=r.error,e[16]=B);let V;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,E.jsx)(x,{children:`Cancel`}),e[17]=V):V=e[17];let H;e[18]===M?H=e[19]:(H=e=>{e.preventDefault(),M()},e[18]=M,e[19]=H);let U=r.isPending?`Deleting…`:`Delete`,W;e[20]!==r.isPending||e[21]!==H||e[22]!==U?(W=(0,E.jsxs)(b,{children:[V,(0,E.jsx)(y,{disabled:r.isPending,onClick:H,children:U})]}),e[20]=r.isPending,e[21]=H,e[22]=U,e[23]=W):W=e[23];let G;e[24]!==W||e[25]!==z||e[26]!==B?(G=(0,E.jsxs)(_,{children:[z,B,W]}),e[24]=W,e[25]=z,e[26]=B,e[27]=G):G=e[27];let K;e[28]!==G||e[29]!==L?(K=(0,E.jsx)(C,{onOpenChange:I,open:L,children:G}),e[28]=G,e[29]=L,e[30]=K):K=e[30];let q;return e[31]!==K||e[32]!==P||e[33]!==F?(q=(0,E.jsxs)(E.Fragment,{children:[N,P,F,K]}),e[31]=K,e[32]=P,e[33]=F,e[34]=q):q=e[34],q}function k(e){return e.stopPropagation()}var A=O;export{A as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./useNavigate.js";import{$t as s}from"./cluster-config.js";import{t as c}from"./button.js";import{t as l}from"./input.js";import{n as u}from"./ecr.js";import{i as d,n as f}from"./ecr2.js";import{t as p}from"./page-heading.js";import{a as m,t as h}from"./field.js";import{a as g,i as _,l as v,n as y,o as b,r as x,s as S,t as C}from"./alert-dialog.js";var w=r(),T=e(n(),1),E=t();function D(e){let t=(0,w.c)(32),{open:n,onOpenChange:r}=e,i=f(),[a,o]=(0,T.useState)(``),s;t[0]!==i||t[1]!==r?(s=function(e){e||(o(``),i.reset()),r(e)},t[0]=i,t[1]=r,t[2]=s):s=t[2];let c=s,u;t[3]!==i||t[4]!==c||t[5]!==a?(u=async function(){try{await i.mutateAsync(a.trim()),c(!1)}catch{}},t[3]=i,t[4]=c,t[5]=a,t[6]=u):u=t[6];let d=u,p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,E.jsxs)(S,{children:[(0,E.jsx)(v,{children:`Create Repository`}),(0,E.jsx)(g,{children:`Repository names may include namespaces, e.g. team/app.`})]}),t[7]=p):p=t[7];let D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,E.jsx)(m,{children:(0,E.jsx)(`label`,{htmlFor:`repositoryName`,children:`Name`})}),t[8]=D):D=t[8];let O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{o(e.target.value)},t[9]=O):O=t[9];let k;t[10]===a?k=t[11]:(k=(0,E.jsxs)(h,{children:[D,(0,E.jsx)(l,{id:`repositoryName`,onChange:O,placeholder:`team/app`,value:a})]}),t[10]=a,t[11]=k);let A;t[12]===i.error?A=t[13]:(A=i.error&&(0,E.jsx)(`p`,{className:`text-sm text-destructive`,children:i.error.message}),t[12]=i.error,t[13]=A);let j;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,E.jsx)(x,{children:`Cancel`}),t[14]=j):j=t[14];let M;t[15]!==i.isPending||t[16]!==a?(M=i.isPending||!a.trim(),t[15]=i.isPending,t[16]=a,t[17]=M):M=t[17];let N;t[18]===d?N=t[19]:(N=e=>{e.preventDefault(),d()},t[18]=d,t[19]=N);let P=i.isPending?`Creating…`:`Create Repository`,F;t[20]!==N||t[21]!==P||t[22]!==M?(F=(0,E.jsxs)(b,{children:[j,(0,E.jsx)(y,{disabled:M,onClick:N,children:P})]}),t[20]=N,t[21]=P,t[22]=M,t[23]=F):F=t[23];let I;t[24]!==F||t[25]!==k||t[26]!==A?(I=(0,E.jsxs)(_,{children:[p,k,A,F]}),t[24]=F,t[25]=k,t[26]=A,t[27]=I):I=t[27];let L;return t[28]!==c||t[29]!==n||t[30]!==I?(L=(0,E.jsx)(C,{onOpenChange:c,open:n,children:I}),t[28]=c,t[29]=n,t[30]=I,t[31]=L):L=t[31],L}function O(){let e=(0,w.c)(35),t=o(),{data:n}=i(u),r=d(),[l,f]=(0,T.useState)(!1),[m,h]=(0,T.useState)(null),O;e[0]===n.repositories?O=e[1]:(O=n.repositories??[],e[0]=n.repositories,e[1]=O);let A=O,j;e[2]!==r||e[3]!==m?(j=async function(){if(m)try{await r.mutateAsync(m),h(null)}catch{}},e[2]=r,e[3]=m,e[4]=j):j=e[4];let M=j,N;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,E.jsx)(p,{actions:(0,E.jsx)(c,{onClick:()=>{f(!0)},children:`Create Repository`}),title:`Repositories`}),e[5]=N):N=e[5];let P;e[6]!==t||e[7]!==A?(P=A.length>0?(0,E.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,E.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,E.jsx)(`thead`,{children:(0,E.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`URI`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Tag Mutability`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Created`}),(0,E.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,E.jsx)(`tbody`,{children:A.map(e=>{if(!e.repositoryName)return null;let n=e.repositoryName;return(0,E.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>{await t({to:`/ecr/list-repositories/$id`,params:{id:encodeURIComponent(n)}})},children:[(0,E.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,E.jsx)(a,{className:`text-primary hover:underline`,onClick:k,params:{id:encodeURIComponent(n)},to:`/ecr/list-repositories/$id`,children:n})}),(0,E.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.repositoryUri??``}),(0,E.jsx)(`td`,{className:`px-4 py-2`,children:e.imageTagMutability??``}),(0,E.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:s(e.createdAt)}),(0,E.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,E.jsx)(c,{onClick:e=>{e.stopPropagation(),h(n)},size:`sm`,variant:`destructive`,children:`Delete`})})]},n)})})]})}):(0,E.jsx)(`p`,{className:`text-muted-foreground`,children:`No repositories found.`}),e[6]=t,e[7]=A,e[8]=P):P=e[8];let F;e[9]===l?F=e[10]:(F=(0,E.jsx)(D,{onOpenChange:f,open:l}),e[9]=l,e[10]=F);let I;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{e||h(null)},e[11]=I):I=e[11];let L=m!==null,R;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,E.jsx)(v,{children:`Delete repository?`}),e[12]=R):R=e[12];let z;e[13]===m?z=e[14]:(z=(0,E.jsxs)(S,{children:[R,(0,E.jsxs)(g,{children:[`This permanently deletes `,m,` and every image it holds. This cannot be undone.`]})]}),e[13]=m,e[14]=z);let B;e[15]===r.error?B=e[16]:(B=r.error&&(0,E.jsx)(`p`,{className:`text-sm text-destructive`,children:r.error.message}),e[15]=r.error,e[16]=B);let V;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,E.jsx)(x,{children:`Cancel`}),e[17]=V):V=e[17];let H;e[18]===M?H=e[19]:(H=e=>{e.preventDefault(),M()},e[18]=M,e[19]=H);let U=r.isPending?`Deleting…`:`Delete`,W;e[20]!==r.isPending||e[21]!==H||e[22]!==U?(W=(0,E.jsxs)(b,{children:[V,(0,E.jsx)(y,{disabled:r.isPending,onClick:H,children:U})]}),e[20]=r.isPending,e[21]=H,e[22]=U,e[23]=W):W=e[23];let G;e[24]!==W||e[25]!==z||e[26]!==B?(G=(0,E.jsxs)(_,{children:[z,B,W]}),e[24]=W,e[25]=z,e[26]=B,e[27]=G):G=e[27];let K;e[28]!==G||e[29]!==L?(K=(0,E.jsx)(C,{onOpenChange:I,open:L,children:G}),e[28]=G,e[29]=L,e[30]=K):K=e[30];let q;return e[31]!==K||e[32]!==P||e[33]!==F?(q=(0,E.jsxs)(E.Fragment,{children:[N,P,F,K]}),e[31]=K,e[32]=P,e[33]=F,e[34]=q):q=e[34],q}function k(e){e.stopPropagation()}var A=O;export{A as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/nodes.js b/spinifex/services/spinifexui/frontend/dist/assets/nodes.js index a0d7acc99..7f2628dd2 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/nodes.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/nodes.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./link.js";import{n as o}from"./redirect.js";import{tn as s}from"./cluster-config.js";import{t as c}from"./chevron-down.js";import{t as l}from"./chevron-right.js";import{n as u}from"./admin-context.js";import{t as d}from"./page-heading.js";import{r as f,t as p}from"./admin.js";import{t as m}from"./badge.js";import{o as h,r as g,s as _,t as v}from"./card.js";var y=r(),b=e(n(),1),x=t();function S(e){if(e.mig_enabled){let t=e.slices??[];return`${t.filter(e=>e.instance_id).length} / ${t.length}`}return`${+!!e.instance_id} / 1`}function C(e){let t=(0,y.c)(20),{nodes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,b.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[1]=o):o=t[1];let u=o,d,f,p,h;if(t[2]!==i||t[3]!==n){let e=n.flatMap(T);h=`overflow-x-auto`,f=`w-full text-xs`,t[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`w-6 pb-1`,children:(0,x.jsx)(`span`,{className:`sr-only`,children:`Expand`})}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Node`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Model`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`VRAM`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Mode`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Profile`}),(0,x.jsx)(`th`,{className:`pb-1 font-medium`,children:`Used / Total`})]})}),t[8]=p):p=t[8];let r;t[9]===i?r=t[10]:(r=e=>{let{node:t,gpu:n}=e,r=`${t}:${n.pci_address}`,a=n.slices??[],o=n.mig_enabled&&a.length>0,d=o&&i.has(r);return(0,x.jsxs)(b.Fragment,{children:[(0,x.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1.5`,children:o&&(0,x.jsx)(`button`,{"aria-expanded":d,"aria-label":d?`Collapse slices`:`Expand slices`,onClick:()=>u(r),type:`button`,children:d?(0,x.jsx)(c,{className:`size-3.5`}):(0,x.jsx)(l,{className:`size-3.5`})})}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono font-medium`,children:t}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:n.model}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:s(n.vram_mib)}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:(0,x.jsx)(m,{className:`text-[0.625rem]`,variant:`secondary`,children:n.mig_enabled?`MIG`:`Passthrough`})}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:n.mig_profile??`—`}),(0,x.jsx)(`td`,{className:`py-1.5 font-mono`,children:S(n)})]}),d&&a.map(w)]},r)},t[9]=i,t[10]=r),d=e.map(r),t[2]=i,t[3]=n,t[4]=d,t[5]=f,t[6]=p,t[7]=h}else d=t[4],f=t[5],p=t[6],h=t[7];let g;t[11]===d?g=t[12]:(g=(0,x.jsx)(`tbody`,{children:d}),t[11]=d,t[12]=g);let _;t[13]!==f||t[14]!==p||t[15]!==g?(_=(0,x.jsxs)(`table`,{className:f,children:[p,g]}),t[13]=f,t[14]=p,t[15]=g,t[16]=_):_=t[16];let v;return t[17]!==h||t[18]!==_?(v=(0,x.jsx)(`div`,{className:h,children:_}),t[17]=h,t[18]=_,t[19]=v):v=t[19],v}function w(e){return(0,x.jsxs)(`tr`,{className:`border-b text-muted-foreground last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1`,children:(0,x.jsx)(`span`,{className:`sr-only`,children:`Slice`})}),(0,x.jsxs)(`td`,{className:`py-1 pr-4 font-mono`,colSpan:2,children:[`↳ slice `,e.gi_id]}),(0,x.jsx)(`td`,{className:`py-1 pr-4`,children:s(e.vram_mib)}),(0,x.jsx)(`td`,{className:`py-1 pr-4`,children:(0,x.jsx)(`span`,{className:`sr-only`,children:`Mode`})}),(0,x.jsx)(`td`,{className:`py-1 pr-4 font-mono`,children:e.profile}),(0,x.jsx)(`td`,{className:`py-1 font-mono`,children:e.instance_id?(0,x.jsx)(a,{className:`text-primary hover:underline`,params:{id:e.instance_id},to:`/ec2/describe-instances/$id`,children:e.instance_id}):(0,x.jsx)(`span`,{className:`text-green-600`,children:`free`})})]},e.gi_id)}function T(e){return(e.gpus??[]).map(t=>({node:e.node,gpu:t}))}function E(e){let t=Math.floor(e/86400),n=Math.floor(e%86400/3600);if(t>0)return`${t}d ${n}h`;let r=Math.floor(e%3600/60);return n>0?`${n}h ${r}m`:`${r}m`}function D(e){return e>=1?`${e.toFixed(1)}Gi`:`${Math.round(e*1024)}Mi`}function O(e){let t=Math.floor(Date.now()/1e3-e);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function k(){let e=(0,y.c)(30),{isAdmin:t}=u(),n;e[0]===t?n=e[1]:(n={...p,enabled:t,refetchInterval:5e3},e[0]=t,e[1]=n);let{data:r}=i(n),a;e[2]===t?a=e[3]:(a={...f,enabled:t,refetchInterval:5e3},e[2]=t,e[3]=a);let{data:s}=i(a);if(!t)throw o({to:`/`});let c;e[4]===r?.nodes?c=e[5]:(c=r?.nodes??[],e[4]=r?.nodes,e[5]=c);let l=c,m;e[6]===s?.vms?m=e[7]:(m=s?.vms??[],e[6]=s?.vms,e[7]=m);let b;e[8]===m?b=e[9]:(b=m.filter(N),e[8]=m,e[9]=b);let S=b,w;if(e[10]!==l){let t=new Map;for(let e of l)for(let n of e.instance_types??[]){let e=t.get(n.name);e?e.available+=n.available:t.set(n.name,{vcpu:n.vcpu,memory_gb:n.memory_gb,available:n.available})}w=[...t.entries()].map(M).toSorted(j),e[10]=l,e[11]=w}else w=e[11];let T=w,E;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,x.jsx)(d,{title:`Nodes`}),e[12]=E):E=e[12];let D;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,x.jsx)(h,{children:(0,x.jsx)(_,{className:`text-sm`,children:`Cluster Nodes`})}),e[13]=D):D=e[13];let O;e[14]===l?O=e[15]:(O=(0,x.jsxs)(v,{children:[D,(0,x.jsx)(g,{children:l.length===0?(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No nodes responding`}):(0,x.jsx)(P,{nodes:l})})]}),e[14]=l,e[15]=O);let k;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,x.jsx)(h,{children:(0,x.jsx)(_,{className:`text-sm`,children:`Elastic Compute Cloud (EC2)`})}),e[16]=k):k=e[16];let F;e[17]===S?F=e[18]:(F=(0,x.jsxs)(v,{children:[k,(0,x.jsx)(g,{children:S.length===0?(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No instances running`}):(0,x.jsx)(L,{vms:S})})]}),e[17]=S,e[18]=F);let I;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,x.jsx)(h,{children:(0,x.jsx)(_,{className:`text-sm`,children:`Resource Usage`})}),e[19]=I):I=e[19];let R;e[20]!==T||e[21]!==l?(R=(0,x.jsxs)(v,{children:[I,(0,x.jsx)(g,{className:`space-y-4`,children:l.length===0?(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No data`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(z,{nodes:l}),T.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h4`,{className:`mt-4 text-xs font-medium text-muted-foreground`,children:`Instance Type Capacity`}),(0,x.jsx)(V,{instanceTypes:T})]})]})})]}),e[20]=T,e[21]=l,e[22]=R):R=e[22];let B;e[23]===l?B=e[24]:(B=l.some(A)&&(0,x.jsxs)(v,{children:[(0,x.jsx)(h,{children:(0,x.jsx)(_,{className:`text-sm`,children:`GPU Inventory`})}),(0,x.jsx)(g,{children:(0,x.jsx)(C,{nodes:l})})]}),e[23]=l,e[24]=B);let H;return e[25]!==F||e[26]!==R||e[27]!==B||e[28]!==O?(H=(0,x.jsxs)(x.Fragment,{children:[E,(0,x.jsxs)(`div`,{className:`space-y-6`,children:[O,F,R,B]})]}),e[25]=F,e[26]=R,e[27]=B,e[28]=O,e[29]=H):H=e[29],H}function A(e){return(e.gpus?.length??0)>0}function j(e,t){return e.name.localeCompare(t.name)}function M(e){let[t,n]=e;return{name:t,...n}}function N(e){return!e.managed_by}function P(e){let t=(0,y.c)(5),{nodes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Name`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Status`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Roles`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`IP`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Region`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`AZ`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Uptime`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`EC2`}),(0,x.jsx)(`th`,{className:`pb-1 font-medium`,children:`Services`})]})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(F),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,x.jsx)(`div`,{className:`overflow-x-auto`,children:(0,x.jsxs)(`table`,{className:`w-full text-xs`,children:[r,(0,x.jsx)(`tbody`,{children:i})]})}),t[3]=i,t[4]=a),a}function F(e){let t=[e.nats_role?`nats:${e.nats_role}`:null,e.predastore_role?`predastore:${e.predastore_role}`:null].filter(Boolean).join(`,`);return(0,x.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono font-medium`,children:e.node}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:(0,x.jsx)(m,{variant:e.status===`Ready`?`default`:`secondary`,className:`text-[0.625rem]`,children:e.status})}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono text-muted-foreground`,children:t||`-`}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.host}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.region}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.az}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:E(e.uptime)}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.vm_count}),(0,x.jsx)(`td`,{className:`py-1.5`,children:(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:e.services?.join(`,`)??`-`})})]},e.node)}function I(e){return e?e.profile?`${e.profile} ${s(e.vram_mib)}`:`${e.model} ${s(e.vram_mib)}`:`-`}function L(e){let t=(0,y.c)(5),{vms:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Instance`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Status`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Type`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`vCPU`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Memory`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`GPU`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Node`}),(0,x.jsx)(`th`,{className:`pb-1 font-medium`,children:`Age`})]})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(R),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,x.jsx)(`div`,{className:`overflow-x-auto`,children:(0,x.jsxs)(`table`,{className:`w-full text-xs`,children:[r,(0,x.jsx)(`tbody`,{children:i})]})}),t[3]=i,t[4]=a),a}function R(e){return(0,x.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.instance_id}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:(0,x.jsx)(m,{variant:e.status===`running`?`default`:`secondary`,className:`text-[0.625rem]`,children:e.status})}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.instance_type}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.vcpu}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:D(e.memory_gb)}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:I(e.gpu)}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.node}),(0,x.jsx)(`td`,{className:`py-1.5`,children:e.launch_time>0?O(e.launch_time):`-`})]},e.instance_id)}function z(e){let t=(0,y.c)(5),{nodes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Name`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`CPU (used/sched)`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`MEM (used/sched)`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`GPU (used/total)`}),(0,x.jsx)(`th`,{className:`pb-1 font-medium`,children:`EC2`})]})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(B),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,x.jsx)(`div`,{className:`overflow-x-auto`,children:(0,x.jsxs)(`table`,{className:`w-full text-xs`,children:[r,(0,x.jsx)(`tbody`,{children:i})]})}),t[3]=i,t[4]=a),a}function B(e){let t=e.total_vcpu-(e.reserved_vcpu??0),n=e.total_mem_gb-(e.reserved_mem_gb??0);return(0,x.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono font-medium`,children:e.node}),(0,x.jsxs)(`td`,{className:`py-1.5 pr-4 font-mono`,children:[e.alloc_vcpu,`/`,t]}),(0,x.jsxs)(`td`,{className:`py-1.5 pr-4 font-mono`,children:[D(e.alloc_mem_gb),`/`,D(n)]}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.total_gpus>0?`${e.alloc_gpus}/${e.total_gpus}`:`-`}),(0,x.jsx)(`td`,{className:`py-1.5`,children:e.vm_count})]},e.node)}function V(e){let t=(0,y.c)(5),{instanceTypes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Instance Type`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Available`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`vCPU`}),(0,x.jsx)(`th`,{className:`pb-1 font-medium`,children:`Memory`})]})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(H),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,x.jsx)(`div`,{className:`overflow-x-auto`,children:(0,x.jsxs)(`table`,{className:`w-full text-xs`,children:[r,(0,x.jsx)(`tbody`,{children:i})]})}),t[3]=i,t[4]=a),a}function H(e){return(0,x.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.name}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.available}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.vcpu}),(0,x.jsx)(`td`,{className:`py-1.5`,children:D(e.memory_gb)})]},e.name)}export{k as component,I as formatVMGPU}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./link.js";import{n as o}from"./redirect.js";import{tn as s}from"./cluster-config.js";import{t as c}from"./chevron-down.js";import{t as l}from"./chevron-right.js";import{n as u}from"./admin-context.js";import{t as d}from"./page-heading.js";import{r as f,t as p}from"./admin.js";import{t as m}from"./badge.js";import{o as h,r as g,s as _,t as v}from"./card.js";var y=r(),b=e(n(),1),x=t();function S(e){if(e.mig_enabled){let t=e.slices??[];return`${t.filter(e=>e.instance_id).length} / ${t.length}`}return`${+!!e.instance_id} / 1`}function C(e){let t=(0,y.c)(20),{nodes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,b.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[1]=o):o=t[1];let u=o,d,f,p,h;if(t[2]!==i||t[3]!==n){let e=n.flatMap(T);h=`overflow-x-auto`,f=`w-full text-xs`,t[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`w-6 pb-1`,children:(0,x.jsx)(`span`,{className:`sr-only`,children:`Expand`})}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Node`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Model`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`VRAM`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Mode`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Profile`}),(0,x.jsx)(`th`,{className:`pb-1 font-medium`,children:`Used / Total`})]})}),t[8]=p):p=t[8];let r;t[9]===i?r=t[10]:(r=e=>{let{node:t,gpu:n}=e,r=`${t}:${n.pci_address}`,a=n.slices??[],o=n.mig_enabled&&a.length>0,d=o&&i.has(r);return(0,x.jsxs)(b.Fragment,{children:[(0,x.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1.5`,children:o&&(0,x.jsx)(`button`,{"aria-expanded":d,"aria-label":d?`Collapse slices`:`Expand slices`,onClick:()=>{u(r)},type:`button`,children:d?(0,x.jsx)(c,{className:`size-3.5`}):(0,x.jsx)(l,{className:`size-3.5`})})}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono font-medium`,children:t}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:n.model}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:s(n.vram_mib)}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:(0,x.jsx)(m,{className:`text-[0.625rem]`,variant:`secondary`,children:n.mig_enabled?`MIG`:`Passthrough`})}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:n.mig_profile??`—`}),(0,x.jsx)(`td`,{className:`py-1.5 font-mono`,children:S(n)})]}),d&&a.map(w)]},r)},t[9]=i,t[10]=r),d=e.map(r),t[2]=i,t[3]=n,t[4]=d,t[5]=f,t[6]=p,t[7]=h}else d=t[4],f=t[5],p=t[6],h=t[7];let g;t[11]===d?g=t[12]:(g=(0,x.jsx)(`tbody`,{children:d}),t[11]=d,t[12]=g);let _;t[13]!==f||t[14]!==p||t[15]!==g?(_=(0,x.jsxs)(`table`,{className:f,children:[p,g]}),t[13]=f,t[14]=p,t[15]=g,t[16]=_):_=t[16];let v;return t[17]!==h||t[18]!==_?(v=(0,x.jsx)(`div`,{className:h,children:_}),t[17]=h,t[18]=_,t[19]=v):v=t[19],v}function w(e){return(0,x.jsxs)(`tr`,{className:`border-b text-muted-foreground last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1`,children:(0,x.jsx)(`span`,{className:`sr-only`,children:`Slice`})}),(0,x.jsxs)(`td`,{className:`py-1 pr-4 font-mono`,colSpan:2,children:[`↳ slice `,e.gi_id]}),(0,x.jsx)(`td`,{className:`py-1 pr-4`,children:s(e.vram_mib)}),(0,x.jsx)(`td`,{className:`py-1 pr-4`,children:(0,x.jsx)(`span`,{className:`sr-only`,children:`Mode`})}),(0,x.jsx)(`td`,{className:`py-1 pr-4 font-mono`,children:e.profile}),(0,x.jsx)(`td`,{className:`py-1 font-mono`,children:e.instance_id?(0,x.jsx)(a,{className:`text-primary hover:underline`,params:{id:e.instance_id},to:`/ec2/describe-instances/$id`,children:e.instance_id}):(0,x.jsx)(`span`,{className:`text-green-600`,children:`free`})})]},e.gi_id)}function T(e){return(e.gpus??[]).map(t=>({node:e.node,gpu:t}))}function E(e){let t=Math.floor(e/86400),n=Math.floor(e%86400/3600);if(t>0)return`${t}d ${n}h`;let r=Math.floor(e%3600/60);return n>0?`${n}h ${r}m`:`${r}m`}function D(e){return e>=1?`${e.toFixed(1)}Gi`:`${Math.round(e*1024)}Mi`}function O(e){let t=Math.floor(Date.now()/1e3-e);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function k(){let e=(0,y.c)(30),{isAdmin:t}=u(),n;e[0]===t?n=e[1]:(n={...p,enabled:t,refetchInterval:5e3},e[0]=t,e[1]=n);let{data:r}=i(n),a;e[2]===t?a=e[3]:(a={...f,enabled:t,refetchInterval:5e3},e[2]=t,e[3]=a);let{data:s}=i(a);if(!t)throw o({to:`/`});let c;e[4]===r?.nodes?c=e[5]:(c=r?.nodes??[],e[4]=r?.nodes,e[5]=c);let l=c,m;e[6]===s?.vms?m=e[7]:(m=s?.vms??[],e[6]=s?.vms,e[7]=m);let b;e[8]===m?b=e[9]:(b=m.filter(N),e[8]=m,e[9]=b);let S=b,w;if(e[10]!==l){let t=new Map;for(let e of l)for(let n of e.instance_types??[]){let e=t.get(n.name);e?e.available+=n.available:t.set(n.name,{vcpu:n.vcpu,memory_gb:n.memory_gb,available:n.available})}w=[...t.entries()].map(M).toSorted(j),e[10]=l,e[11]=w}else w=e[11];let T=w,E;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,x.jsx)(d,{title:`Nodes`}),e[12]=E):E=e[12];let D;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,x.jsx)(h,{children:(0,x.jsx)(_,{className:`text-sm`,children:`Cluster Nodes`})}),e[13]=D):D=e[13];let O;e[14]===l?O=e[15]:(O=(0,x.jsxs)(v,{children:[D,(0,x.jsx)(g,{children:l.length===0?(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No nodes responding`}):(0,x.jsx)(P,{nodes:l})})]}),e[14]=l,e[15]=O);let k;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,x.jsx)(h,{children:(0,x.jsx)(_,{className:`text-sm`,children:`Elastic Compute Cloud (EC2)`})}),e[16]=k):k=e[16];let F;e[17]===S?F=e[18]:(F=(0,x.jsxs)(v,{children:[k,(0,x.jsx)(g,{children:S.length===0?(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No instances running`}):(0,x.jsx)(L,{vms:S})})]}),e[17]=S,e[18]=F);let I;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,x.jsx)(h,{children:(0,x.jsx)(_,{className:`text-sm`,children:`Resource Usage`})}),e[19]=I):I=e[19];let R;e[20]!==T||e[21]!==l?(R=(0,x.jsxs)(v,{children:[I,(0,x.jsx)(g,{className:`space-y-4`,children:l.length===0?(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No data`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(z,{nodes:l}),T.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h4`,{className:`mt-4 text-xs font-medium text-muted-foreground`,children:`Instance Type Capacity`}),(0,x.jsx)(V,{instanceTypes:T})]})]})})]}),e[20]=T,e[21]=l,e[22]=R):R=e[22];let B;e[23]===l?B=e[24]:(B=l.some(A)&&(0,x.jsxs)(v,{children:[(0,x.jsx)(h,{children:(0,x.jsx)(_,{className:`text-sm`,children:`GPU Inventory`})}),(0,x.jsx)(g,{children:(0,x.jsx)(C,{nodes:l})})]}),e[23]=l,e[24]=B);let H;return e[25]!==F||e[26]!==R||e[27]!==B||e[28]!==O?(H=(0,x.jsxs)(x.Fragment,{children:[E,(0,x.jsxs)(`div`,{className:`space-y-6`,children:[O,F,R,B]})]}),e[25]=F,e[26]=R,e[27]=B,e[28]=O,e[29]=H):H=e[29],H}function A(e){return(e.gpus?.length??0)>0}function j(e,t){return e.name.localeCompare(t.name)}function M(e){let[t,n]=e;return{name:t,...n}}function N(e){return!e.managed_by}function P(e){let t=(0,y.c)(5),{nodes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Name`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Status`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Roles`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`IP`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Region`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`AZ`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Uptime`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`EC2`}),(0,x.jsx)(`th`,{className:`pb-1 font-medium`,children:`Services`})]})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(F),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,x.jsx)(`div`,{className:`overflow-x-auto`,children:(0,x.jsxs)(`table`,{className:`w-full text-xs`,children:[r,(0,x.jsx)(`tbody`,{children:i})]})}),t[3]=i,t[4]=a),a}function F(e){let t=[e.nats_role?`nats:${e.nats_role}`:null,e.predastore_role?`predastore:${e.predastore_role}`:null].filter(Boolean).join(`,`);return(0,x.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono font-medium`,children:e.node}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:(0,x.jsx)(m,{variant:e.status===`Ready`?`default`:`secondary`,className:`text-[0.625rem]`,children:e.status})}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono text-muted-foreground`,children:t||`-`}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.host}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.region}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.az}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:E(e.uptime)}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.vm_count}),(0,x.jsx)(`td`,{className:`py-1.5`,children:(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:e.services?.join(`,`)??`-`})})]},e.node)}function I(e){return e?e.profile?`${e.profile} ${s(e.vram_mib)}`:`${e.model} ${s(e.vram_mib)}`:`-`}function L(e){let t=(0,y.c)(5),{vms:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Instance`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Status`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Type`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`vCPU`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Memory`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`GPU`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Node`}),(0,x.jsx)(`th`,{className:`pb-1 font-medium`,children:`Age`})]})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(R),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,x.jsx)(`div`,{className:`overflow-x-auto`,children:(0,x.jsxs)(`table`,{className:`w-full text-xs`,children:[r,(0,x.jsx)(`tbody`,{children:i})]})}),t[3]=i,t[4]=a),a}function R(e){return(0,x.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.instance_id}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:(0,x.jsx)(m,{variant:e.status===`running`?`default`:`secondary`,className:`text-[0.625rem]`,children:e.status})}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.instance_type}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.vcpu}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:D(e.memory_gb)}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:I(e.gpu)}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.node}),(0,x.jsx)(`td`,{className:`py-1.5`,children:e.launch_time>0?O(e.launch_time):`-`})]},e.instance_id)}function z(e){let t=(0,y.c)(5),{nodes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Name`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`CPU (used/sched)`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`MEM (used/sched)`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`GPU (used/total)`}),(0,x.jsx)(`th`,{className:`pb-1 font-medium`,children:`EC2`})]})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(B),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,x.jsx)(`div`,{className:`overflow-x-auto`,children:(0,x.jsxs)(`table`,{className:`w-full text-xs`,children:[r,(0,x.jsx)(`tbody`,{children:i})]})}),t[3]=i,t[4]=a),a}function B(e){let t=e.total_vcpu-(e.reserved_vcpu??0),n=e.total_mem_gb-(e.reserved_mem_gb??0);return(0,x.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono font-medium`,children:e.node}),(0,x.jsxs)(`td`,{className:`py-1.5 pr-4 font-mono`,children:[e.alloc_vcpu,`/`,t]}),(0,x.jsxs)(`td`,{className:`py-1.5 pr-4 font-mono`,children:[D(e.alloc_mem_gb),`/`,D(n)]}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.total_gpus>0?`${e.alloc_gpus}/${e.total_gpus}`:`-`}),(0,x.jsx)(`td`,{className:`py-1.5`,children:e.vm_count})]},e.node)}function V(e){let t=(0,y.c)(5),{instanceTypes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Instance Type`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`Available`}),(0,x.jsx)(`th`,{className:`pr-4 pb-1 font-medium`,children:`vCPU`}),(0,x.jsx)(`th`,{className:`pb-1 font-medium`,children:`Memory`})]})}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(H),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,x.jsx)(`div`,{className:`overflow-x-auto`,children:(0,x.jsxs)(`table`,{className:`w-full text-xs`,children:[r,(0,x.jsx)(`tbody`,{children:i})]})}),t[3]=i,t[4]=a),a}function H(e){return(0,x.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,x.jsx)(`td`,{className:`py-1.5 pr-4 font-mono`,children:e.name}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.available}),(0,x.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.vcpu}),(0,x.jsx)(`td`,{className:`py-1.5`,children:D(e.memory_gb)})]},e.name)}export{k as component,I as formatVMGPU}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/rds-tags-tab.js b/spinifex/services/spinifexui/frontend/dist/assets/rds-tags-tab.js index 53f40dc42..bd9dde6ea 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/rds-tags-tab.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/rds-tags-tab.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{h as r}from"./rds2.js";import{g as i}from"./rds3.js";import{t as a}from"./tags-editor.js";var o=t(),s=e();function c(e){let t=(0,o.c)(14),{arn:c}=e,d;t[0]===c?d=t[1]:(d=i(c),t[0]=c,t[1]=d);let{data:f}=n(d),p=r(),m;t[2]===f?.TagList?m=t[3]:(m=f?.TagList??[],t[2]=f?.TagList,t[3]=m);let h=m,g;t[4]!==c||t[5]!==h||t[6]!==p?(g=e=>p.mutate({resourceName:c,tags:e,initialKeys:h.map(u).filter(l)}),t[4]=c,t[5]=h,t[6]=p,t[7]=g):g=t[7];let _;return t[8]!==g||t[9]!==h||t[10]!==p.error||t[11]!==p.isPending||t[12]!==p.isSuccess?(_=(0,s.jsx)(a,{error:p.error,isPending:p.isPending,isSuccess:p.isSuccess,onSubmit:g,tags:h}),t[8]=g,t[9]=h,t[10]=p.error,t[11]=p.isPending,t[12]=p.isSuccess,t[13]=_):_=t[13],_}function l(e){return e.length>0}function u(e){return e.Key??``}export{c as t}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{h as r}from"./rds2.js";import{g as i}from"./rds3.js";import{t as a}from"./tags-editor.js";var o=t(),s=e();function c(e){let t=(0,o.c)(14),{arn:c}=e,d;t[0]===c?d=t[1]:(d=i(c),t[0]=c,t[1]=d);let{data:f}=n(d),p=r(),m;t[2]===f?.TagList?m=t[3]:(m=f?.TagList??[],t[2]=f?.TagList,t[3]=m);let h=m,g;t[4]!==c||t[5]!==h||t[6]!==p?(g=e=>{p.mutate({resourceName:c,tags:e,initialKeys:h.map(u).filter(l)})},t[4]=c,t[5]=h,t[6]=p,t[7]=g):g=t[7];let _;return t[8]!==g||t[9]!==h||t[10]!==p.error||t[11]!==p.isPending||t[12]!==p.isSuccess?(_=(0,s.jsx)(a,{error:p.error,isPending:p.isPending,isSuccess:p.isSuccess,onSubmit:g,tags:h}),t[8]=g,t[9]=h,t[10]=p.error,t[11]=p.isPending,t[12]=p.isSuccess,t[13]=_):_=t[13],_}function l(e){return e.length>0}function u(e){return e.Key??``}export{c as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/rds.js b/spinifex/services/spinifexui/frontend/dist/assets/rds.js index d93988854..b9106b9ba 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/rds.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/rds.js @@ -1 +1 @@ -import{c as e,f as t,ft as n,h as r,jt as i,l as a,p as o}from"./cluster-config.js";import{ct as ee}from"./awsClient.js";var te=i(ee,`AmazonRDSv19`,`RDSClient`,n),s={},ne=(e,t,n,r)=>[],c=65536,l=1150,u=65535,d=63,f=8,p=128,m=30,h=1440,g={postgres:{reservedUsernames:[`rdsadmin`,`postgres`,`rds_superuser`],reservedUsernamePrefixes:[`pg_`],maxUsernameLen:63,maxDBNameLen:63},mariadb:{reservedUsernames:[`root`,`mariadb.sys`,`mysql`,`rdsadmin`,`public`],reservedUsernamePrefixes:[`mysql.`,`mariadb.`],maxUsernameLen:80,maxDBNameLen:64}},re={reservedUsernames:[],reservedUsernamePrefixes:[],maxUsernameLen:80,maxDBNameLen:64};function _(e){return g[e]??re}var v=r().min(1,`Identifier is required`).max(d,`Identifier must be at most ${d} characters`).regex(/^[a-z]/,`Identifier must begin with a lowercase letter`).regex(/^[a-z0-9-]*$/,`Identifier may contain only lowercase letters, digits and hyphens`).refine(e=>!e.endsWith(`-`),`Identifier may not end with a hyphen`).refine(e=>!e.includes(`--`),`Identifier may not contain consecutive hyphens`),y=r().min(f,`Password must be at least ${f} characters`).max(p,`Password must be at most ${p} characters`).regex(/^[ -~]*$/,`Password may only contain printable ASCII`).refine(e=>!/[/"@ ]/.test(e),`Password may not contain '/', '"', '@' or spaces`),b=t().int(`Storage must be a whole number of GiB`).min(20,`Storage must be at least 20 GiB`).max(c,`Storage must be at most ${c} GiB`),x=r().refine(e=>{if(e===``)return!0;let t=Number(e);return/^\d+$/.test(e)&&Number.isInteger(t)&&t>=1150&&t<=65535},`Port must be between ${l} and ${u}`),S=t().int(`Retention must be a whole number of days`).min(0,`Retention may not be negative`).max(7,`Retention must be at most 7 days`),ie=/^(?:[01]\d|2[0-3]):[0-5]\d-(?:[01]\d|2[0-3]):[0-5]\d$/,C=/^(?:sun|mon|tue|wed|thu|fri|sat):(?:[01]\d|2[0-3]):[0-5]\d-(?:sun|mon|tue|wed|thu|fri|sat):(?:[01]\d|2[0-3]):[0-5]\d$/,w=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`];function T(e){let[t,n]=e.split(`:`);return Number(t??0)*60+Number(n??0)}function E(e){let[t,n,r]=e.split(`:`);return w.indexOf(t??``)*h+Number(n??0)*60+Number(r??0)}function D(e,t,n){return((t-e)%n+n)%n}function ae(e){let[t,n]=e.split(`-`);return D(T(t??``),T(n??``),h)}function oe(e){let[t,n]=e.split(`-`);return D(E(t??``),E(n??``),7*h)}var O=r().refine(e=>e===``||ie.test(e),`Backup window must be hh24:mi-hh24:mi in UTC`).refine(e=>e===``||ae(e)>=m,`Backup window must be at least ${m} minutes long`),k=r().refine(e=>e===``||C.test(e),`Maintenance window must be ddd:hh24:mi-ddd:hh24:mi in UTC`).refine(e=>e===``||oe(e)>=m,`Maintenance window must be at least ${m} minutes long`),A=`aws:`,j=o({key:r().min(1,`Tag key is required`).max(128).refine(e=>!e.toLowerCase().startsWith(A),`Tag keys may not start with the reserved ${A} prefix`),value:r().max(256)}),M=e(j).max(50,`At most 50 tags may be supplied`);function N(e,t,n,r,i){let a=n=>e.addIssue({code:`custom`,path:[t],message:n});if(r.length>i){a(`${n} must be at most ${i} characters`);return}if(!/^[a-zA-Z]/.test(r)){a(`${n} must begin with a letter`);return}/^\w*$/.test(r)||a(`${n} may contain only letters, digits and underscores`)}function P(e,t,n){let r=_(t);N(e,`masterUsername`,`Master username`,n,r.maxUsernameLen);let i=n.trim().toLowerCase();if(r.reservedUsernames.includes(i)){e.addIssue({code:`custom`,path:[`masterUsername`],message:`"${n}" is reserved by ${t}`});return}let a=r.reservedUsernamePrefixes.find(e=>i.startsWith(e));a&&e.addIssue({code:`custom`,path:[`masterUsername`],message:`Master username may not begin with "${a}", which ${t} reserves`})}var F=o({dbInstanceIdentifier:v,engine:r().min(1,`Engine is required`),engineVersion:r(),dbInstanceClass:r().min(1,`Instance class is required`),allocatedStorage:b,masterUsername:r().min(1,`Master username is required`),masterUserPassword:y,confirmPassword:r(),dbName:r(),port:x,dbSubnetGroupName:r(),vpcSecurityGroupIds:e(r()),dbParameterGroupName:r(),deletionProtection:a(),backupRetentionPeriod:S,preferredBackupWindow:O,preferredMaintenanceWindow:k,tags:M}).superRefine((e,t)=>{P(t,e.engine,e.masterUsername),e.dbName!==``&&N(t,`dbName`,`Database name`,e.dbName,_(e.engine).maxDBNameLen),e.confirmPassword!==e.masterUserPassword&&t.addIssue({code:`custom`,path:[`confirmPassword`],message:`Passwords do not match`})}),I=o({currentAllocatedStorage:t(),dbInstanceClass:r().min(1,`Instance class is required`),allocatedStorage:b,dbParameterGroupName:r(),vpcSecurityGroupIds:e(r()),deletionProtection:a(),backupRetentionPeriod:S,preferredBackupWindow:O,preferredMaintenanceWindow:k,masterUserPassword:r(),applyImmediately:a()}).superRefine((e,t)=>{if(e.allocatedStorage!e.endsWith(`-`),`Snapshot identifier may not end with a hyphen`).refine(e=>!e.includes(`--`),`Snapshot identifier may not contain consecutive hyphens`),B=r().refine(e=>!e.toLowerCase().startsWith(R),`Snapshot identifier may not begin with "${R}", which automated backups use`).pipe(z),V=o({dbSnapshotIdentifier:B,tags:M});function H(e){return String(e).padStart(2,`0`)}function U(e){return`${e.getUTCFullYear()}${H(e.getUTCMonth()+1)}${H(e.getUTCDate())}-${H(e.getUTCHours())}${H(e.getUTCMinutes())}`}function W(e,t,n=new Date){let r=`-${t}-${U(n)}`,i=d-r.length;return`${e.slice(0,i).replace(/-+$/,``)}${r}`}var G=o({snapshotAllocatedStorage:t(),dbInstanceIdentifier:v,dbInstanceClass:r().min(1,`Instance class is required`),allocatedStorage:b,port:x,dbSubnetGroupName:r(),vpcSecurityGroupIds:e(r()),dbParameterGroupName:r(),deletionProtection:a(),tags:M}).superRefine((e,t)=>{e.allocatedStoragee.toLowerCase()!=="default",`${e} may not be "default", which the service reserves`)}function Z(e){return r().min(1,`${e} is required`).max(q,`${e} must be at most 255 characters`)}var se=o({dbSubnetGroupName:X(`Name`),dbSubnetGroupDescription:Z(`Description`),subnetIds:e(r()).min(1,`Select at least one subnet`).max(20,`A DB subnet group may hold at most 20 subnets`),tags:M}),ce=o({dbParameterGroupName:r().refine(e=>!Y(e),`Name may not begin with "${J}", which the service reserves`).pipe(X(`Name`)),dbParameterGroupFamily:r().min(1,`Family is required`),description:Z(`Description`),tags:M}),le=`static`,ue=`immediate`,Q=`pending-reboot`,$=`user`;function de(e){return e===`static`?[Q]:[ue,Q]}var fe=new Set([`creating`,`modifying`,`backing-up`,`rebooting`,`stopping`,`starting`,`recovering`,`deleting`]);function pe(e){return e!==void 0&&fe.has(e)}function me(e){return e===`stopped`}function he(e){return e===`available`}function ge(e){return e===`available`}function _e(e){return e!==void 0&&e!==`deleting`&&e!==`deleted`}function ve(e){return e===`available`||e===`stopped`}var ye=`creating`,be=`manual`,xe=`automated`;function Se(e){return e===`available`}function Ce(e,t){return e===`available`&&t!==`automated`}export{G as C,te as D,ne as E,I as S,s as T,V as _,xe as a,Y as b,_e as c,Se as d,ve as f,ce as g,F as h,ye as i,Ce as l,he as m,le as n,be as o,me as p,$ as r,de as s,Q as t,ge as u,se as v,W as w,pe as x,B as y}; \ No newline at end of file +import{c as e,f as t,ft as n,h as r,jt as i,l as a,p as o}from"./cluster-config.js";import{ct as ee}from"./awsClient.js";var te=i(ee,`AmazonRDSv19`,`RDSClient`,n),s={},ne=(e,t,n,r)=>[],c=65536,l=1150,u=65535,d=63,f=8,p=128,m=30,h=1440,g={postgres:{reservedUsernames:[`rdsadmin`,`postgres`,`rds_superuser`],reservedUsernamePrefixes:[`pg_`],maxUsernameLen:63,maxDBNameLen:63},mariadb:{reservedUsernames:[`root`,`mariadb.sys`,`mysql`,`rdsadmin`,`public`],reservedUsernamePrefixes:[`mysql.`,`mariadb.`],maxUsernameLen:80,maxDBNameLen:64}},re={reservedUsernames:[],reservedUsernamePrefixes:[],maxUsernameLen:80,maxDBNameLen:64};function _(e){return g[e]??re}var v=r().min(1,`Identifier is required`).max(d,`Identifier must be at most ${d} characters`).regex(/^[a-z]/,`Identifier must begin with a lowercase letter`).regex(/^[a-z0-9-]*$/,`Identifier may contain only lowercase letters, digits and hyphens`).refine(e=>!e.endsWith(`-`),`Identifier may not end with a hyphen`).refine(e=>!e.includes(`--`),`Identifier may not contain consecutive hyphens`),y=r().min(f,`Password must be at least ${f} characters`).max(p,`Password must be at most ${p} characters`).regex(/^[ -~]*$/,`Password may only contain printable ASCII`).refine(e=>!/[/"@ ]/.test(e),`Password may not contain '/', '"', '@' or spaces`),b=t().int(`Storage must be a whole number of GiB`).min(20,`Storage must be at least 20 GiB`).max(c,`Storage must be at most ${c} GiB`),x=r().refine(e=>{if(e===``)return!0;let t=Number(e);return/^\d+$/.test(e)&&Number.isInteger(t)&&t>=1150&&t<=65535},`Port must be between ${l} and ${u}`),S=t().int(`Retention must be a whole number of days`).min(0,`Retention may not be negative`).max(7,`Retention must be at most 7 days`),ie=/^(?:[01]\d|2[0-3]):[0-5]\d-(?:[01]\d|2[0-3]):[0-5]\d$/,C=/^(?:sun|mon|tue|wed|thu|fri|sat):(?:[01]\d|2[0-3]):[0-5]\d-(?:sun|mon|tue|wed|thu|fri|sat):(?:[01]\d|2[0-3]):[0-5]\d$/,w=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`];function T(e){let[t,n]=e.split(`:`);return Number(t??0)*60+Number(n??0)}function E(e){let[t,n,r]=e.split(`:`);return w.indexOf(t??``)*h+Number(n??0)*60+Number(r??0)}function D(e,t,n){return((t-e)%n+n)%n}function ae(e){let[t,n]=e.split(`-`);return D(T(t??``),T(n??``),h)}function oe(e){let[t,n]=e.split(`-`);return D(E(t??``),E(n??``),7*h)}var O=r().refine(e=>e===``||ie.test(e),`Backup window must be hh24:mi-hh24:mi in UTC`).refine(e=>e===``||ae(e)>=m,`Backup window must be at least ${m} minutes long`),k=r().refine(e=>e===``||C.test(e),`Maintenance window must be ddd:hh24:mi-ddd:hh24:mi in UTC`).refine(e=>e===``||oe(e)>=m,`Maintenance window must be at least ${m} minutes long`),A=`aws:`,j=o({key:r().min(1,`Tag key is required`).max(128).refine(e=>!e.toLowerCase().startsWith(A),`Tag keys may not start with the reserved ${A} prefix`),value:r().max(256)}),M=e(j).max(50,`At most 50 tags may be supplied`);function N(e,t,n,r,i){let a=n=>{e.addIssue({code:`custom`,path:[t],message:n})};if(r.length>i){a(`${n} must be at most ${i} characters`);return}if(!/^[a-zA-Z]/.test(r)){a(`${n} must begin with a letter`);return}/^\w*$/.test(r)||a(`${n} may contain only letters, digits and underscores`)}function P(e,t,n){let r=_(t);N(e,`masterUsername`,`Master username`,n,r.maxUsernameLen);let i=n.trim().toLowerCase();if(r.reservedUsernames.includes(i)){e.addIssue({code:`custom`,path:[`masterUsername`],message:`"${n}" is reserved by ${t}`});return}let a=r.reservedUsernamePrefixes.find(e=>i.startsWith(e));a&&e.addIssue({code:`custom`,path:[`masterUsername`],message:`Master username may not begin with "${a}", which ${t} reserves`})}var F=o({dbInstanceIdentifier:v,engine:r().min(1,`Engine is required`),engineVersion:r(),dbInstanceClass:r().min(1,`Instance class is required`),allocatedStorage:b,masterUsername:r().min(1,`Master username is required`),masterUserPassword:y,confirmPassword:r(),dbName:r(),port:x,dbSubnetGroupName:r(),vpcSecurityGroupIds:e(r()),dbParameterGroupName:r(),deletionProtection:a(),backupRetentionPeriod:S,preferredBackupWindow:O,preferredMaintenanceWindow:k,tags:M}).superRefine((e,t)=>{P(t,e.engine,e.masterUsername),e.dbName!==``&&N(t,`dbName`,`Database name`,e.dbName,_(e.engine).maxDBNameLen),e.confirmPassword!==e.masterUserPassword&&t.addIssue({code:`custom`,path:[`confirmPassword`],message:`Passwords do not match`})}),I=o({currentAllocatedStorage:t(),dbInstanceClass:r().min(1,`Instance class is required`),allocatedStorage:b,dbParameterGroupName:r(),vpcSecurityGroupIds:e(r()),deletionProtection:a(),backupRetentionPeriod:S,preferredBackupWindow:O,preferredMaintenanceWindow:k,masterUserPassword:r(),applyImmediately:a()}).superRefine((e,t)=>{if(e.allocatedStorage!e.endsWith(`-`),`Snapshot identifier may not end with a hyphen`).refine(e=>!e.includes(`--`),`Snapshot identifier may not contain consecutive hyphens`),B=r().refine(e=>!e.toLowerCase().startsWith(R),`Snapshot identifier may not begin with "${R}", which automated backups use`).pipe(z),V=o({dbSnapshotIdentifier:B,tags:M});function H(e){return String(e).padStart(2,`0`)}function U(e){return`${e.getUTCFullYear()}${H(e.getUTCMonth()+1)}${H(e.getUTCDate())}-${H(e.getUTCHours())}${H(e.getUTCMinutes())}`}function W(e,t,n=new Date){let r=`-${t}-${U(n)}`,i=d-r.length;return`${e.slice(0,i).replace(/-+$/,``)}${r}`}var G=o({snapshotAllocatedStorage:t(),dbInstanceIdentifier:v,dbInstanceClass:r().min(1,`Instance class is required`),allocatedStorage:b,port:x,dbSubnetGroupName:r(),vpcSecurityGroupIds:e(r()),dbParameterGroupName:r(),deletionProtection:a(),tags:M}).superRefine((e,t)=>{e.allocatedStoragee.toLowerCase()!=="default",`${e} may not be "default", which the service reserves`)}function Z(e){return r().min(1,`${e} is required`).max(q,`${e} must be at most 255 characters`)}var se=o({dbSubnetGroupName:X(`Name`),dbSubnetGroupDescription:Z(`Description`),subnetIds:e(r()).min(1,`Select at least one subnet`).max(20,`A DB subnet group may hold at most 20 subnets`),tags:M}),ce=o({dbParameterGroupName:r().refine(e=>!Y(e),`Name may not begin with "${J}", which the service reserves`).pipe(X(`Name`)),dbParameterGroupFamily:r().min(1,`Family is required`),description:Z(`Description`),tags:M}),le=`static`,ue=`immediate`,Q=`pending-reboot`,$=`user`;function de(e){return e===`static`?[Q]:[ue,Q]}var fe=new Set([`creating`,`modifying`,`backing-up`,`rebooting`,`stopping`,`starting`,`recovering`,`deleting`]);function pe(e){return e!==void 0&&fe.has(e)}function me(e){return e===`stopped`}function he(e){return e===`available`}function ge(e){return e===`available`}function _e(e){return e!==void 0&&e!==`deleting`&&e!==`deleted`}function ve(e){return e===`available`||e===`stopped`}var ye=`creating`,be=`manual`,xe=`automated`;function Se(e){return e===`available`}function Ce(e,t){return e===`available`&&t!==`automated`}export{G as C,te as D,ne as E,I as S,s as T,V as _,xe as a,Y as b,_e as c,Se as d,ve as f,ce as g,F as h,ye as i,Ce as l,he as m,le as n,be as o,me as p,$ as r,de as s,Q as t,ge as u,se as v,W as w,pe as x,B as y}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/register-task-definition2.js b/spinifex/services/spinifexui/frontend/dist/assets/register-task-definition2.js index ce90e090e..bb1bf1b93 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/register-task-definition2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/register-task-definition2.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as ee}from"./useNavigate.js";import{t as te}from"./back-link.js";import{c as n,i as r,n as i,s as a,t as o}from"./select.js";import{t as ne}from"./plus.js";import{t as re}from"./trash-2.js";import{t as ie}from"./button.js";import{t as s}from"./input.js";import{s as ae}from"./ecs2.js";import{t as c}from"./register-task-definition.js";import{i as oe,n as se,r as ce,t as le}from"./zod.js";import{t as ue}from"./error-banner.js";import{t as de}from"./form-actions.js";import{t as fe}from"./page-heading.js";import{a as l,r as pe,t as u}from"./field.js";import{r as me,t as he}from"./ecs3.js";var ge=t(),d=e();function f(e){let t=(0,ge.c)(129),{cluster:n}=e,r=ee(),i=ae(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=le(me),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={resolver:a,defaultValues:{family:``,networkMode:`bridge`,cpu:``,memory:``,containerName:``,image:``,containerCpu:``,containerMemory:``,containerGpuCount:0,essential:!0,portMappings:[]}},t[1]=o):o=t[1];let{control:c,handleSubmit:he,register:f,formState:ye}=oe(o),{errors:p,isSubmitting:be}=ye,xe;t[2]===c?xe=t[3]:(xe={control:c,name:`portMappings`},t[2]=c,t[3]=xe);let m=ce(xe),Se;t[4]!==n||t[5]!==r?(Se=function(){r(n?{to:`/ecs/list-clusters/$clusterName`,params:{clusterName:n}}:{to:`/ecs/list-clusters`})},t[4]=n,t[5]=r,t[6]=Se):Se=t[6];let h=Se,Ce;t[7]!==h||t[8]!==i?(Ce=async function(e){await i.mutateAsync(e),h()},t[7]=h,t[8]=i,t[9]=Ce):Ce=t[9];let we=Ce,Te,Ee;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,d.jsx)(te,{to:`/ecs/list-clusters`,children:`Clusters`}),Ee=(0,d.jsx)(fe,{subtitle:`Register a single-container task definition`,title:`Register Task Definition`}),t[10]=Te,t[11]=Ee):(Te=t[10],Ee=t[11]);let g;t[12]!==i.error||t[13]!==i.isError?(g=i.isError&&(0,d.jsx)(ue,{error:i.error instanceof Error?i.error:void 0,msg:`Failed to register task definition.`}),t[12]=i.error,t[13]=i.isError,t[14]=g):g=t[14];let _;t[15]!==he||t[16]!==we?(_=he(we),t[15]=he,t[16]=we,t[17]=_):_=t[17];let De;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`family`,children:`Family`})}),t[18]=De):De=t[18];let v;t[19]===f?v=t[20]:(v=f(`family`),t[19]=f,t[20]=v);let y;t[21]===v?y=t[22]:(y=(0,d.jsx)(s,{id:`family`,placeholder:`my-app`,...v}),t[21]=v,t[22]=y);let b;t[23]===p.family?b=t[24]:(b=(0,d.jsx)(pe,{errors:[p.family]}),t[23]=p.family,t[24]=b);let x;t[25]!==y||t[26]!==b?(x=(0,d.jsxs)(u,{children:[De,y,b]}),t[25]=y,t[26]=b,t[27]=x):x=t[27];let Oe;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`networkMode`,children:`Network mode`})}),t[28]=Oe):Oe=t[28];let S;t[29]===c?S=t[30]:(S=(0,d.jsxs)(u,{children:[Oe,(0,d.jsx)(se,{control:c,name:`networkMode`,render:ve})]}),t[29]=c,t[30]=S);let ke;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`cpu`,children:`Task CPU (units)`})}),t[31]=ke):ke=t[31];let C;t[32]===f?C=t[33]:(C=f(`cpu`),t[32]=f,t[33]=C);let w;t[34]===C?w=t[35]:(w=(0,d.jsxs)(u,{children:[ke,(0,d.jsx)(s,{id:`cpu`,placeholder:`optional`,...C})]}),t[34]=C,t[35]=w);let Ae;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`memory`,children:`Task memory (MiB)`})}),t[36]=Ae):Ae=t[36];let T;t[37]===f?T=t[38]:(T=f(`memory`),t[37]=f,t[38]=T);let E;t[39]===T?E=t[40]:(E=(0,d.jsxs)(u,{children:[Ae,(0,d.jsx)(s,{id:`memory`,placeholder:`optional`,...T})]}),t[39]=T,t[40]=E);let D;t[41]!==w||t[42]!==E?(D=(0,d.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[w,E]}),t[41]=w,t[42]=E,t[43]=D):D=t[43];let je;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,d.jsx)(`h2`,{className:`mb-4 font-semibold`,children:`Container`}),t[44]=je):je=t[44];let Me;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`containerName`,children:`Name`})}),t[45]=Me):Me=t[45];let O;t[46]===f?O=t[47]:(O=f(`containerName`),t[46]=f,t[47]=O);let k;t[48]===O?k=t[49]:(k=(0,d.jsx)(s,{id:`containerName`,placeholder:`app`,...O}),t[48]=O,t[49]=k);let A;t[50]===p.containerName?A=t[51]:(A=(0,d.jsx)(pe,{errors:[p.containerName]}),t[50]=p.containerName,t[51]=A);let j;t[52]!==k||t[53]!==A?(j=(0,d.jsxs)(u,{children:[Me,k,A]}),t[52]=k,t[53]=A,t[54]=j):j=t[54];let Ne;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`image`,children:`Image`})}),t[55]=Ne):Ne=t[55];let Pe;t[56]===f?Pe=t[57]:(Pe=f(`image`),t[56]=f,t[57]=Pe);let M;t[58]===Pe?M=t[59]:(M=(0,d.jsx)(s,{id:`image`,placeholder:`public.ecr.aws/nginx/nginx:latest`,...Pe}),t[58]=Pe,t[59]=M);let N;t[60]===p.image?N=t[61]:(N=(0,d.jsx)(pe,{errors:[p.image]}),t[60]=p.image,t[61]=N);let P;t[62]!==M||t[63]!==N?(P=(0,d.jsxs)(u,{children:[Ne,M,N]}),t[62]=M,t[63]=N,t[64]=P):P=t[64];let Fe;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`containerCpu`,children:`CPU (units)`})}),t[65]=Fe):Fe=t[65];let F;t[66]===f?F=t[67]:(F=f(`containerCpu`),t[66]=f,t[67]=F);let I;t[68]===F?I=t[69]:(I=(0,d.jsxs)(u,{children:[Fe,(0,d.jsx)(s,{id:`containerCpu`,placeholder:`optional`,...F})]}),t[68]=F,t[69]=I);let Ie;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`containerMemory`,children:`Memory (MiB)`})}),t[70]=Ie):Ie=t[70];let L;t[71]===f?L=t[72]:(L=f(`containerMemory`),t[71]=f,t[72]=L);let R;t[73]===L?R=t[74]:(R=(0,d.jsxs)(u,{children:[Ie,(0,d.jsx)(s,{id:`containerMemory`,placeholder:`optional`,...L})]}),t[73]=L,t[74]=R);let Le;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`containerGpuCount`,children:`GPU count`})}),t[75]=Le):Le=t[75];let z;t[76]===f?z=t[77]:(z=f(`containerGpuCount`,{valueAsNumber:!0}),t[76]=f,t[77]=z);let B;t[78]===z?B=t[79]:(B=(0,d.jsx)(s,{id:`containerGpuCount`,min:0,placeholder:`0`,type:`number`,...z}),t[78]=z,t[79]=B);let V;t[80]===p.containerGpuCount?V=t[81]:(V=(0,d.jsx)(pe,{errors:[p.containerGpuCount]}),t[80]=p.containerGpuCount,t[81]=V);let H;t[82]!==B||t[83]!==V?(H=(0,d.jsxs)(u,{children:[Le,B,V]}),t[82]=B,t[83]=V,t[84]=H):H=t[84];let U;t[85]!==I||t[86]!==R||t[87]!==H?(U=(0,d.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[I,R,H]}),t[85]=I,t[86]=R,t[87]=H,t[88]=U):U=t[88];let W;t[89]===f?W=t[90]:(W=f(`essential`),t[89]=f,t[90]=W);let G;t[91]===W?G=t[92]:(G=(0,d.jsx)(`input`,{type:`checkbox`,...W}),t[91]=W,t[92]=G);let Re;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,d.jsx)(`span`,{children:`Essential`}),t[93]=Re):Re=t[93];let K;t[94]===G?K=t[95]:(K=(0,d.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[G,Re]}),t[94]=G,t[95]=K);let ze;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,d.jsx)(`span`,{className:`text-sm font-medium`,children:`Port mappings`}),t[96]=ze):ze=t[96];let q;t[97]===m?q=t[98]:(q=()=>m.append({containerPort:80,protocol:`tcp`}),t[97]=m,t[98]=q);let Be;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,d.jsx)(ne,{className:`size-4`}),t[99]=Be):Be=t[99];let J;t[100]===q?J=t[101]:(J=(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[ze,(0,d.jsxs)(ie,{onClick:q,size:`sm`,type:`button`,variant:`outline`,children:[Be,`Add port`]})]}),t[100]=q,t[101]=J);let Y;t[102]!==c||t[103]!==f||t[104]!==m?(Y=m.fields.map((e,t)=>(0,d.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,d.jsxs)(u,{className:`flex-1`,children:[(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`port-${t}`,children:`Container port`})}),(0,d.jsx)(s,{id:`port-${t}`,type:`number`,...f(`portMappings.${t}.containerPort`,{valueAsNumber:!0})})]}),(0,d.jsx)(se,{control:c,name:`portMappings.${t}.protocol`,render:_e}),(0,d.jsx)(ie,{"aria-label":`Remove port mapping`,onClick:()=>m.remove(t),size:`icon`,type:`button`,variant:`ghost`,children:(0,d.jsx)(re,{className:`size-4`})})]},e.id)),t[102]=c,t[103]=f,t[104]=m,t[105]=Y):Y=t[105];let X;t[106]!==J||t[107]!==Y?(X=(0,d.jsxs)(`div`,{className:`space-y-2`,children:[J,Y]}),t[106]=J,t[107]=Y,t[108]=X):X=t[108];let Z;t[109]!==j||t[110]!==P||t[111]!==U||t[112]!==K||t[113]!==X?(Z=(0,d.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[je,(0,d.jsxs)(`div`,{className:`space-y-4`,children:[j,P,U,K,X]})]}),t[109]=j,t[110]=P,t[111]=U,t[112]=K,t[113]=X,t[114]=Z):Z=t[114];let Q;t[115]!==h||t[116]!==be||t[117]!==i.isPending?(Q=(0,d.jsx)(de,{isPending:i.isPending,isSubmitting:be,onCancel:h,pendingLabel:`Registering…`,submitLabel:`Register Task Definition`}),t[115]=h,t[116]=be,t[117]=i.isPending,t[118]=Q):Q=t[118];let $;t[119]!==_||t[120]!==x||t[121]!==S||t[122]!==D||t[123]!==Z||t[124]!==Q?($=(0,d.jsxs)(`form`,{className:`max-w-2xl space-y-6`,onSubmit:_,children:[x,S,D,Z,Q]}),t[119]=_,t[120]=x,t[121]=S,t[122]=D,t[123]=Z,t[124]=Q,t[125]=$):$=t[125];let Ve;return t[126]!==$||t[127]!==g?(Ve=(0,d.jsxs)(d.Fragment,{children:[Te,Ee,g,$]}),t[126]=$,t[127]=g,t[128]=Ve):Ve=t[128],Ve}function _e(e){let{field:t}=e;return(0,d.jsxs)(o,{onValueChange:t.onChange,value:t.value,children:[(0,d.jsx)(a,{className:`w-28`,children:(0,d.jsx)(n,{})}),(0,d.jsxs)(i,{children:[(0,d.jsx)(r,{value:`tcp`,children:`tcp`}),(0,d.jsx)(r,{value:`udp`,children:`udp`})]})]})}function ve(e){let{field:t}=e;return(0,d.jsxs)(o,{onValueChange:t.onChange,value:t.value,children:[(0,d.jsx)(a,{className:`w-full`,id:`networkMode`,children:(0,d.jsx)(n,{})}),(0,d.jsx)(i,{children:he.map(ye)})]})}function ye(e){return(0,d.jsx)(r,{value:e,children:e},e)}function p(){let e=(0,ge.c)(2),{cluster:t}=c.useSearch(),ee;return e[0]===t?ee=e[1]:(ee=(0,d.jsx)(f,{cluster:t}),e[0]=t,e[1]=ee),ee}export{p as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as ee}from"./useNavigate.js";import{t as te}from"./back-link.js";import{c as n,i as r,n as i,s as a,t as o}from"./select.js";import{t as ne}from"./plus.js";import{t as re}from"./trash-2.js";import{t as ie}from"./button.js";import{t as s}from"./input.js";import{s as ae}from"./ecs2.js";import{t as c}from"./register-task-definition.js";import{i as oe,n as se,r as ce,t as le}from"./zod.js";import{t as ue}from"./error-banner.js";import{t as de}from"./form-actions.js";import{t as fe}from"./page-heading.js";import{a as l,r as pe,t as u}from"./field.js";import{r as me,t as he}from"./ecs3.js";var ge=t(),d=e();function f(e){let t=(0,ge.c)(129),{cluster:n}=e,r=ee(),i=ae(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=le(me),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={resolver:a,defaultValues:{family:``,networkMode:`bridge`,cpu:``,memory:``,containerName:``,image:``,containerCpu:``,containerMemory:``,containerGpuCount:0,essential:!0,portMappings:[]}},t[1]=o):o=t[1];let{control:c,handleSubmit:he,register:f,formState:ye}=oe(o),{errors:p,isSubmitting:be}=ye,xe;t[2]===c?xe=t[3]:(xe={control:c,name:`portMappings`},t[2]=c,t[3]=xe);let m=ce(xe),Se;t[4]!==n||t[5]!==r?(Se=function(){r(n?{to:`/ecs/list-clusters/$clusterName`,params:{clusterName:n}}:{to:`/ecs/list-clusters`})},t[4]=n,t[5]=r,t[6]=Se):Se=t[6];let h=Se,Ce;t[7]!==h||t[8]!==i?(Ce=async function(e){await i.mutateAsync(e),h()},t[7]=h,t[8]=i,t[9]=Ce):Ce=t[9];let we=Ce,Te,Ee;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,d.jsx)(te,{to:`/ecs/list-clusters`,children:`Clusters`}),Ee=(0,d.jsx)(fe,{subtitle:`Register a single-container task definition`,title:`Register Task Definition`}),t[10]=Te,t[11]=Ee):(Te=t[10],Ee=t[11]);let g;t[12]!==i.error||t[13]!==i.isError?(g=i.isError&&(0,d.jsx)(ue,{error:i.error instanceof Error?i.error:void 0,msg:`Failed to register task definition.`}),t[12]=i.error,t[13]=i.isError,t[14]=g):g=t[14];let _;t[15]!==he||t[16]!==we?(_=he(we),t[15]=he,t[16]=we,t[17]=_):_=t[17];let De;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`family`,children:`Family`})}),t[18]=De):De=t[18];let v;t[19]===f?v=t[20]:(v=f(`family`),t[19]=f,t[20]=v);let y;t[21]===v?y=t[22]:(y=(0,d.jsx)(s,{id:`family`,placeholder:`my-app`,...v}),t[21]=v,t[22]=y);let b;t[23]===p.family?b=t[24]:(b=(0,d.jsx)(pe,{errors:[p.family]}),t[23]=p.family,t[24]=b);let x;t[25]!==y||t[26]!==b?(x=(0,d.jsxs)(u,{children:[De,y,b]}),t[25]=y,t[26]=b,t[27]=x):x=t[27];let Oe;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`networkMode`,children:`Network mode`})}),t[28]=Oe):Oe=t[28];let S;t[29]===c?S=t[30]:(S=(0,d.jsxs)(u,{children:[Oe,(0,d.jsx)(se,{control:c,name:`networkMode`,render:ve})]}),t[29]=c,t[30]=S);let ke;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`cpu`,children:`Task CPU (units)`})}),t[31]=ke):ke=t[31];let C;t[32]===f?C=t[33]:(C=f(`cpu`),t[32]=f,t[33]=C);let w;t[34]===C?w=t[35]:(w=(0,d.jsxs)(u,{children:[ke,(0,d.jsx)(s,{id:`cpu`,placeholder:`optional`,...C})]}),t[34]=C,t[35]=w);let Ae;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`memory`,children:`Task memory (MiB)`})}),t[36]=Ae):Ae=t[36];let T;t[37]===f?T=t[38]:(T=f(`memory`),t[37]=f,t[38]=T);let E;t[39]===T?E=t[40]:(E=(0,d.jsxs)(u,{children:[Ae,(0,d.jsx)(s,{id:`memory`,placeholder:`optional`,...T})]}),t[39]=T,t[40]=E);let D;t[41]!==w||t[42]!==E?(D=(0,d.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[w,E]}),t[41]=w,t[42]=E,t[43]=D):D=t[43];let je;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,d.jsx)(`h2`,{className:`mb-4 font-semibold`,children:`Container`}),t[44]=je):je=t[44];let Me;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`containerName`,children:`Name`})}),t[45]=Me):Me=t[45];let O;t[46]===f?O=t[47]:(O=f(`containerName`),t[46]=f,t[47]=O);let k;t[48]===O?k=t[49]:(k=(0,d.jsx)(s,{id:`containerName`,placeholder:`app`,...O}),t[48]=O,t[49]=k);let A;t[50]===p.containerName?A=t[51]:(A=(0,d.jsx)(pe,{errors:[p.containerName]}),t[50]=p.containerName,t[51]=A);let j;t[52]!==k||t[53]!==A?(j=(0,d.jsxs)(u,{children:[Me,k,A]}),t[52]=k,t[53]=A,t[54]=j):j=t[54];let Ne;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`image`,children:`Image`})}),t[55]=Ne):Ne=t[55];let Pe;t[56]===f?Pe=t[57]:(Pe=f(`image`),t[56]=f,t[57]=Pe);let M;t[58]===Pe?M=t[59]:(M=(0,d.jsx)(s,{id:`image`,placeholder:`public.ecr.aws/nginx/nginx:latest`,...Pe}),t[58]=Pe,t[59]=M);let N;t[60]===p.image?N=t[61]:(N=(0,d.jsx)(pe,{errors:[p.image]}),t[60]=p.image,t[61]=N);let P;t[62]!==M||t[63]!==N?(P=(0,d.jsxs)(u,{children:[Ne,M,N]}),t[62]=M,t[63]=N,t[64]=P):P=t[64];let Fe;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`containerCpu`,children:`CPU (units)`})}),t[65]=Fe):Fe=t[65];let F;t[66]===f?F=t[67]:(F=f(`containerCpu`),t[66]=f,t[67]=F);let I;t[68]===F?I=t[69]:(I=(0,d.jsxs)(u,{children:[Fe,(0,d.jsx)(s,{id:`containerCpu`,placeholder:`optional`,...F})]}),t[68]=F,t[69]=I);let Ie;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`containerMemory`,children:`Memory (MiB)`})}),t[70]=Ie):Ie=t[70];let L;t[71]===f?L=t[72]:(L=f(`containerMemory`),t[71]=f,t[72]=L);let R;t[73]===L?R=t[74]:(R=(0,d.jsxs)(u,{children:[Ie,(0,d.jsx)(s,{id:`containerMemory`,placeholder:`optional`,...L})]}),t[73]=L,t[74]=R);let Le;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`containerGpuCount`,children:`GPU count`})}),t[75]=Le):Le=t[75];let z;t[76]===f?z=t[77]:(z=f(`containerGpuCount`,{valueAsNumber:!0}),t[76]=f,t[77]=z);let B;t[78]===z?B=t[79]:(B=(0,d.jsx)(s,{id:`containerGpuCount`,min:0,placeholder:`0`,type:`number`,...z}),t[78]=z,t[79]=B);let V;t[80]===p.containerGpuCount?V=t[81]:(V=(0,d.jsx)(pe,{errors:[p.containerGpuCount]}),t[80]=p.containerGpuCount,t[81]=V);let H;t[82]!==B||t[83]!==V?(H=(0,d.jsxs)(u,{children:[Le,B,V]}),t[82]=B,t[83]=V,t[84]=H):H=t[84];let U;t[85]!==I||t[86]!==R||t[87]!==H?(U=(0,d.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[I,R,H]}),t[85]=I,t[86]=R,t[87]=H,t[88]=U):U=t[88];let W;t[89]===f?W=t[90]:(W=f(`essential`),t[89]=f,t[90]=W);let G;t[91]===W?G=t[92]:(G=(0,d.jsx)(`input`,{type:`checkbox`,...W}),t[91]=W,t[92]=G);let Re;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,d.jsx)(`span`,{children:`Essential`}),t[93]=Re):Re=t[93];let K;t[94]===G?K=t[95]:(K=(0,d.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[G,Re]}),t[94]=G,t[95]=K);let ze;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,d.jsx)(`span`,{className:`text-sm font-medium`,children:`Port mappings`}),t[96]=ze):ze=t[96];let q;t[97]===m?q=t[98]:(q=()=>{m.append({containerPort:80,protocol:`tcp`})},t[97]=m,t[98]=q);let Be;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,d.jsx)(ne,{className:`size-4`}),t[99]=Be):Be=t[99];let J;t[100]===q?J=t[101]:(J=(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[ze,(0,d.jsxs)(ie,{onClick:q,size:`sm`,type:`button`,variant:`outline`,children:[Be,`Add port`]})]}),t[100]=q,t[101]=J);let Y;t[102]!==c||t[103]!==f||t[104]!==m?(Y=m.fields.map((e,t)=>(0,d.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,d.jsxs)(u,{className:`flex-1`,children:[(0,d.jsx)(l,{children:(0,d.jsx)(`label`,{htmlFor:`port-${t}`,children:`Container port`})}),(0,d.jsx)(s,{id:`port-${t}`,type:`number`,...f(`portMappings.${t}.containerPort`,{valueAsNumber:!0})})]}),(0,d.jsx)(se,{control:c,name:`portMappings.${t}.protocol`,render:_e}),(0,d.jsx)(ie,{"aria-label":`Remove port mapping`,onClick:()=>{m.remove(t)},size:`icon`,type:`button`,variant:`ghost`,children:(0,d.jsx)(re,{className:`size-4`})})]},e.id)),t[102]=c,t[103]=f,t[104]=m,t[105]=Y):Y=t[105];let X;t[106]!==J||t[107]!==Y?(X=(0,d.jsxs)(`div`,{className:`space-y-2`,children:[J,Y]}),t[106]=J,t[107]=Y,t[108]=X):X=t[108];let Z;t[109]!==j||t[110]!==P||t[111]!==U||t[112]!==K||t[113]!==X?(Z=(0,d.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[je,(0,d.jsxs)(`div`,{className:`space-y-4`,children:[j,P,U,K,X]})]}),t[109]=j,t[110]=P,t[111]=U,t[112]=K,t[113]=X,t[114]=Z):Z=t[114];let Q;t[115]!==h||t[116]!==be||t[117]!==i.isPending?(Q=(0,d.jsx)(de,{isPending:i.isPending,isSubmitting:be,onCancel:h,pendingLabel:`Registering…`,submitLabel:`Register Task Definition`}),t[115]=h,t[116]=be,t[117]=i.isPending,t[118]=Q):Q=t[118];let $;t[119]!==_||t[120]!==x||t[121]!==S||t[122]!==D||t[123]!==Z||t[124]!==Q?($=(0,d.jsxs)(`form`,{className:`max-w-2xl space-y-6`,onSubmit:_,children:[x,S,D,Z,Q]}),t[119]=_,t[120]=x,t[121]=S,t[122]=D,t[123]=Z,t[124]=Q,t[125]=$):$=t[125];let Ve;return t[126]!==$||t[127]!==g?(Ve=(0,d.jsxs)(d.Fragment,{children:[Te,Ee,g,$]}),t[126]=$,t[127]=g,t[128]=Ve):Ve=t[128],Ve}function _e(e){let{field:t}=e;return(0,d.jsxs)(o,{onValueChange:t.onChange,value:t.value,children:[(0,d.jsx)(a,{className:`w-28`,children:(0,d.jsx)(n,{})}),(0,d.jsxs)(i,{children:[(0,d.jsx)(r,{value:`tcp`,children:`tcp`}),(0,d.jsx)(r,{value:`udp`,children:`udp`})]})]})}function ve(e){let{field:t}=e;return(0,d.jsxs)(o,{onValueChange:t.onChange,value:t.value,children:[(0,d.jsx)(a,{className:`w-full`,id:`networkMode`,children:(0,d.jsx)(n,{})}),(0,d.jsx)(i,{children:he.map(ye)})]})}function ye(e){return(0,d.jsx)(r,{value:e,children:e},e)}function p(){let e=(0,ge.c)(2),{cluster:t}=c.useSearch(),ee;return e[0]===t?ee=e[1]:(ee=(0,d.jsx)(f,{cluster:t}),e[0]=t,e[1]=ee),ee}export{p as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/run-instances2.js b/spinifex/services/spinifexui/frontend/dist/assets/run-instances2.js index daa41394a..fdc52c8f7 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/run-instances2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/run-instances2.js @@ -1,4 +1,4 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as ee}from"./useQuery.js";import{t as i}from"./useSuspenseQuery.js";import{t as te}from"./useNavigate.js";import{tn as ne}from"./cluster-config.js";import{t as re}from"./back-link.js";import{t as ie}from"./chevron-down.js";import{c as a,i as o,n as s,s as c,t as l}from"./select.js";import{t as ae}from"./cli-command-panel.js";import{t as oe}from"./button.js";import{t as u}from"./input.js";import{M as se,O as ce,c as le,h as ue,m as de,o as fe,p as pe,w as me,y as he}from"./ec2.js";import{f as ge}from"./ec22.js";import{t as d}from"./run-instances.js";import{a as f,i as _e,n as p,t as ve}from"./zod.js";import{t as ye}from"./error-banner.js";import{t as be}from"./page-heading.js";import{a as m,n as xe,r as h,t as g}from"./field.js";import{b as Se,i as Ce,t as we}from"./ec23.js";import{i as Te}from"./system-managed.js";import{t as Ee}from"./gpu-instance-type-select.js";import{n as De,r as Oe,t as ke}from"./collapsible.js";var Ae=r(),je=e(n(),1),_=t(),Me=`/dev/sda1`,Ne=`gp3`,Pe=1,Fe=16384;function v(e){let t=(0,Ae.c)(140),{launchTemplateId:n,launchTemplateVersion:r}=e,d=te(),{data:Te}=i(fe),{data:Me}=i(pe),{data:v}=i(le),{data:rt}=i(ce),{data:it}=i(he),{data:at}=i(se),{data:ot}=i(me),{data:st}=i(ue),y=ge(),ct;t[0]===Te.Images?ct=t[1]:(ct=Te.Images??[],t[0]=Te.Images,t[1]=ct);let b=ct.filter($e),lt;t[2]===Me.KeyPairs?lt=t[3]:(lt=Me.KeyPairs??[],t[2]=Me.KeyPairs,t[3]=lt);let ut=lt,dt;t[4]===rt.Subnets?dt=t[5]:(dt=rt.Subnets??[],t[4]=rt.Subnets,t[5]=dt);let ft=dt,pt;t[6]===it.PlacementGroups?pt=t[7]:(pt=it.PlacementGroups??[],t[6]=it.PlacementGroups,t[7]=pt);let mt=pt,ht;t[8]===at.Vpcs?ht=t[9]:(ht=at.Vpcs??[],t[8]=at.Vpcs,t[9]=ht);let gt=ht,_t;t[10]===ot.SecurityGroups?_t=t[11]:(_t=ot.SecurityGroups??[],t[10]=ot.SecurityGroups,t[11]=_t);let vt=_t,yt;t[12]===st.LaunchTemplates?yt=t[13]:(yt=st.LaunchTemplates??[],t[12]=st.LaunchTemplates,t[13]=yt);let bt=yt,xt;t[14]===gt?xt=t[15]:(xt=(gt.find(Qe)??gt[0])?.VpcId,t[14]=gt,t[15]=xt);let St=xt,Ct=Se(vt.map(Ze)),x;if(t[16]!==v.InstanceTypes){x={};for(let e of v.InstanceTypes??[]){let t=e.InstanceType;t&&(x[t]=(x[t]??0)+1)}t[16]=v.InstanceTypes,t[17]=x}else x=t[17];let S=Object.keys(x).toSorted(),wt=b[0]?.ImageId,Tt=ut[0]?.KeyName,Et=S.find(Xe)??S[0],Dt=et(b.find(e=>e.ImageId===wt)),Ot;t[18]===x?Ot=t[19]:(Ot=e=>!e.instanceType||e.count<=(x[e.instanceType]??1),t[18]=x,t[19]=Ot);let{control:C,handleSubmit:kt,register:w,setValue:T,getValues:At,watch:jt,formState:Mt}=_e({resolver:ve(Ce.refine(Ot,{message:`Cannot exceed available capacity`,path:[`count`]}).superRefine((e,t)=>{let n=et(b.find(t=>t.ImageId===e.imageId)).snapshotSize;e.rootVolumeSize!==void 0&&n!==void 0&&e.rootVolumeSizee.InstanceType===Ft))?.GpuInfo?.Gpus?.[0],Lt=D?.Name?.startsWith(`MIG `)?D.Name.slice(4):void 0,Rt;t[22]===C?Rt=t[23]:(Rt={control:C,name:`imageId`},t[22]=C,t[23]=Rt);let zt=f(Rt),Bt;t[24]===zt?Bt=t[25]:(Bt=e=>e.ImageId===zt,t[24]=zt,t[25]=Bt);let O=et(b.find(Bt)),Vt;t[26]===C?Vt=t[27]:(Vt={control:C,name:`subnetId`},t[26]=C,t[27]=Vt);let Ht=f(Vt),Ut;t[28]===C?Ut=t[29]:(Ut={control:C,name:`securityGroupMode`},t[28]=C,t[29]=Ut);let Wt=f(Ut),Gt;t[30]===C?Gt=t[31]:(Gt={control:C,name:`ruleSource`},t[30]=C,t[31]=Gt);let Kt=f(Gt),qt=f({control:C,name:`securityGroupIds`})??[],Jt;t[32]===qt?Jt=t[33]:(Jt=new Set(qt),t[32]=qt,t[33]=Jt);let Yt=Jt,Xt;t[34]===C?Xt=t[35]:(Xt={control:C,name:`launchTemplateId`},t[34]=C,t[35]=Xt);let k=f(Xt),Zt;t[36]===C?Zt=t[37]:(Zt={control:C,name:`launchTemplateVersion`},t[36]=C,t[37]=Zt);let Qt=f(Zt),$t=k??``,A;t[38]===$t?A=t[39]:(A=de($t),t[38]=$t,t[39]=A);let en=!!k,tn;t[40]!==A||t[41]!==en?(tn={...A,enabled:en},t[40]=A,t[41]=en,t[42]=tn):tn=t[42];let nn=ee(tn),rn;t[43]===nn.data?.LaunchTemplateVersions?rn=t[44]:(rn=nn.data?.LaunchTemplateVersions??[],t[43]=nn.data?.LaunchTemplateVersions,t[44]=rn);let j=rn,an;t[45]!==Qt||t[46]!==j?(an=tt(j,Qt)?.LaunchTemplateData,t[45]=Qt,t[46]=j,t[47]=an):an=t[47];let M=an,on;t[48]!==St||t[49]!==Ht||t[50]!==ft?(on=ft.find(e=>e.SubnetId===Ht)?.VpcId??St,t[48]=St,t[49]=Ht,t[50]=ft,t[51]=on):on=t[51];let N=on,sn;t[52]!==N||t[53]!==vt?(sn=N?vt.filter(e=>e.VpcId===N):vt,t[52]=N,t[53]=vt,t[54]=sn):sn=t[54];let cn=sn,ln;t[55]!==At||t[56]!==T?(ln=e=>{let t=At(`securityGroupIds`)??[],n=t.includes(e)?t.filter(t=>t!==e):[...t,e];T(`securityGroupIds`,n,{shouldValidate:!0})},t[55]=At,t[56]=T,t[57]=ln):ln=t[57];let un=ln,dn,fn;t[58]!==O.deviceName||t[59]!==T?(dn=()=>{T(`rootDeviceName`,O.deviceName)},fn=[O.deviceName,T],t[58]=O.deviceName,t[59]=T,t[60]=dn,t[61]=fn):(dn=t[60],fn=t[61]),(0,je.useEffect)(dn,fn);let pn;t[62]!==y||t[63]!==N||t[64]!==d?(pn=async e=>{let t=e.launchTemplateId?{count:e.count,launchTemplateId:e.launchTemplateId,launchTemplateVersion:e.launchTemplateVersion,resolvedVpcId:N}:{...e,resolvedVpcId:N};await y.mutateAsync(t),d({to:`/ec2/describe-instances`})},t[62]=y,t[63]=N,t[64]=d,t[65]=pn):pn=t[65];let mn=pn,P,F;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,_.jsx)(re,{to:`/ec2/describe-instances`,children:`Back to instances`}),F=(0,_.jsx)(be,{title:`Run Instances`}),t[66]=P,t[67]=F):(P=t[66],F=t[67]);let I;t[68]!==k||t[69]!==S?(I=S.length===0&&!k&&(0,_.jsx)(ye,{msg:`No compute available. No new instances can be created until compute is available.`}),t[68]=k,t[69]=S,t[70]=I):I=t[70];let L;t[71]===y.error?L=t[72]:(L=y.error&&(0,_.jsx)(ye,{error:y.error,msg:`Failed to create instance`}),t[71]=y.error,t[72]=L);let R;t[73]!==kt||t[74]!==mn?(R=kt(mn),t[73]=kt,t[74]=mn,t[75]=R):R=t[75];let hn;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(hn=(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`launchTemplateId`,children:`Launch Template`})}),t[76]=hn):hn=t[76];let z;t[77]===bt?z=t[78]:(z=e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>t.onChange(e===`none`?void 0:e),value:t.value??`none`,children:[(0,_.jsx)(c,{className:`w-full`,id:`launchTemplateId`,children:(0,_.jsx)(a,{})}),(0,_.jsxs)(s,{children:[(0,_.jsx)(o,{value:`none`,children:`none`}),bt.map(Ye)]})]})},t[77]=bt,t[78]=z);let B;t[79]!==C||t[80]!==z?(B=(0,_.jsxs)(g,{children:[hn,(0,_.jsx)(p,{control:C,name:`launchTemplateId`,render:z})]}),t[79]=C,t[80]=z,t[81]=B):B=t[81];let V;t[82]!==C||t[83]!==M||t[84]!==k||t[85]!==j?(V=k&&(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`launchTemplateVersion`,children:`Version`})}),(0,_.jsx)(p,{control:C,name:`launchTemplateVersion`,render:e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>t.onChange(e),value:t.value??`$Default`,children:[(0,_.jsx)(c,{className:`w-full`,id:`launchTemplateVersion`,children:(0,_.jsx)(a,{})}),(0,_.jsxs)(s,{children:[(0,_.jsx)(o,{value:`$Default`,children:`$Default`}),(0,_.jsx)(o,{value:`$Latest`,children:`$Latest`}),j.map(Je)]})]})}}),M&&(0,_.jsxs)(`div`,{className:`mt-3 space-y-1 rounded-md border border-border p-3 text-xs`,children:[(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:`Configuration from this version:`}),(0,_.jsxs)(`p`,{children:[`Image:`,` `,(0,_.jsx)(`span`,{className:`font-mono`,children:M.ImageId??`—`})]}),(0,_.jsxs)(`p`,{children:[`Instance type:`,` `,(0,_.jsx)(`span`,{className:`font-mono`,children:M.InstanceType??`—`})]}),(0,_.jsxs)(`p`,{children:[`Key pair:`,` `,(0,_.jsx)(`span`,{className:`font-mono`,children:M.KeyName??`—`})]})]})]}),t[82]=C,t[83]=M,t[84]=k,t[85]=j,t[86]=V):V=t[86];let gn=!k&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`imageId`,children:`Image`})}),(0,_.jsx)(p,{control:C,name:`imageId`,render:e=>{let{field:t}=e,n=b.find(e=>e.ImageId===t.value);return(0,_.jsxs)(l,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,_.jsx)(c,{"aria-invalid":!!E.imageId,className:`w-full`,id:`imageId`,children:(0,_.jsx)(a,{children:n?`${n.Name??`Unnamed`} (${n.Architecture})`:``})}),(0,_.jsx)(s,{children:b.map(qe)})]})}}),(0,_.jsx)(h,{errors:[E.imageId]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`instanceType`,children:`Instance Type`})}),(0,_.jsx)(p,{control:C,name:`instanceType`,render:e=>{let{field:t}=e;return(0,_.jsx)(Ee,{"aria-invalid":!!E.instanceType,availabilityByType:x,className:`w-full`,id:`instanceType`,instanceTypes:v.InstanceTypes??[],onValueChange:t.onChange,value:t.value??``})}}),D&&(0,_.jsxs)(xe,{children:[`GPU: `,D.Name,D.MemoryInfo?.SizeInMiB!==void 0&&` · ${ne(D.MemoryInfo.SizeInMiB)} VRAM`,Lt&&` · MIG ${Lt} slice`]}),(0,_.jsx)(h,{errors:[E.instanceType]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`keyName`,children:`Key Pair`})}),(0,_.jsx)(p,{control:C,name:`keyName`,render:e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,_.jsx)(c,{"aria-invalid":!!E.keyName,className:`w-full`,id:`keyName`,children:(0,_.jsx)(a,{})}),(0,_.jsx)(s,{children:ut.map(Ke)})]})}}),(0,_.jsx)(h,{errors:[E.keyName]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`subnetId`,children:`Subnet`})}),(0,_.jsx)(p,{control:C,name:`subnetId`,render:e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>t.onChange(e===`none`?void 0:e),value:t.value??`none`,children:[(0,_.jsx)(c,{className:`w-full`,id:`subnetId`,children:(0,_.jsx)(a,{})}),(0,_.jsxs)(s,{children:[(0,_.jsx)(o,{value:`none`,children:`none`}),ft.map(Ge)]})]})}})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:`Security Group`}),(0,_.jsx)(xe,{children:N?`Applies to VPC ${N}`:`No VPC resolved — select a subnet`}),(0,_.jsx)(p,{control:C,name:`securityGroupMode`,render:We}),Wt===`create`?(0,_.jsxs)(`div`,{className:`mt-3 space-y-4 rounded-md border border-border p-4`,children:[(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`newSgName`,children:`Name`})}),(0,_.jsx)(u,{"aria-invalid":!!E.newSgName,id:`newSgName`,type:`text`,...w(`newSgName`)}),(0,_.jsx)(h,{errors:[E.newSgName]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`newSgDescription`,children:`Description`})}),(0,_.jsx)(u,{id:`newSgDescription`,type:`text`,...w(`newSgDescription`)})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:`Inbound rules`}),(0,_.jsxs)(`div`,{className:`space-y-1`,children:[(0,_.jsx)(p,{control:C,name:`allowSsh`,render:Ue}),(0,_.jsx)(p,{control:C,name:`allowHttp`,render:He}),(0,_.jsx)(p,{control:C,name:`allowHttps`,render:Ve})]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:`Source`}),(0,_.jsx)(p,{control:C,name:`ruleSource`,render:Be}),Kt===`custom`&&(0,_.jsxs)(`div`,{className:`mt-2`,children:[(0,_.jsx)(u,{"aria-invalid":!!E.customCidr,placeholder:`203.0.113.0/24`,type:`text`,...w(`customCidr`)}),(0,_.jsx)(h,{errors:[E.customCidr]})]})]})]}):(0,_.jsxs)(`div`,{className:`mt-3`,children:[cn.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No security groups in the resolved VPC.`}):(0,_.jsx)(`div`,{className:`space-y-1`,children:cn.map(e=>(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,_.jsx)(`input`,{"aria-label":`Security group ${e.GroupId} (${e.GroupName})`,checked:Yt.has(e.GroupId??``),onChange:()=>un(e.GroupId??``),type:`checkbox`}),(0,_.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))}),(0,_.jsx)(h,{errors:[E.securityGroupIds]})]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`placementGroupName`,children:`Placement Group`})}),(0,_.jsx)(p,{control:C,name:`placementGroupName`,render:e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>t.onChange(e===`none`?void 0:e),value:t.value??`none`,children:[(0,_.jsx)(c,{className:`w-full`,id:`placementGroupName`,children:(0,_.jsx)(a,{})}),(0,_.jsxs)(s,{children:[(0,_.jsx)(o,{value:`none`,children:`none`}),mt.map(ze)]})]})}})]})]}),_n;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(_n=(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`count`,children:`Number of Instances`})}),t[87]=_n):_n=t[87];let vn=!!E.count,H;t[88]===w?H=t[89]:(H=w(`count`,{valueAsNumber:!0}),t[88]=w,t[89]=H);let U;t[90]!==vn||t[91]!==H?(U=(0,_.jsx)(u,{"aria-describedby":`count-description`,"aria-invalid":vn,id:`count`,type:`number`,...H}),t[90]=vn,t[91]=H,t[92]=U):U=t[92];let yn=Ft&&`Available capacity for ${Ft}: ${It}`,W;t[93]===yn?W=t[94]:(W=(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,id:`count-description`,children:yn}),t[93]=yn,t[94]=W);let G;t[95]===E.count?G=t[96]:(G=(0,_.jsx)(h,{errors:[E.count]}),t[95]=E.count,t[96]=G);let K;t[97]!==U||t[98]!==W||t[99]!==G?(K=(0,_.jsxs)(g,{children:[_n,U,W,G]}),t[97]=U,t[98]=W,t[99]=G,t[100]=K):K=t[100];let q;t[101]!==C||t[102]!==E.rootDeviceName||t[103]!==E.rootVolumeSize||t[104]!==E.rootVolumeType||t[105]!==w||t[106]!==O.snapshotSize||t[107]!==k?(q=!k&&(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(ke,{children:[(0,_.jsxs)(Oe,{className:`group flex h-7 w-full items-center justify-between rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm transition-colors outline-none hover:bg-input/40 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 md:text-xs/relaxed dark:bg-input/30 dark:hover:bg-input/50`,render:(0,_.jsx)(`button`,{"aria-label":`Block Device Mappings (root volume)`,type:`button`}),children:[(0,_.jsx)(`span`,{children:`Block Device Mappings (root volume)`}),(0,_.jsx)(ie,{className:`size-3.5 text-muted-foreground transition-transform group-data-[panel-open]:rotate-180`})]}),(0,_.jsxs)(De,{className:`mt-3 space-y-4 rounded-md border border-border p-4`,children:[(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`rootDeviceName`,children:`Device Name`})}),(0,_.jsx)(u,{"aria-invalid":!!E.rootDeviceName,id:`rootDeviceName`,type:`text`,...w(`rootDeviceName`)}),(0,_.jsx)(h,{errors:[E.rootDeviceName]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`rootVolumeSize`,children:`Volume Size (GiB)`})}),(0,_.jsx)(u,{"aria-invalid":!!E.rootVolumeSize,id:`rootVolumeSize`,max:Fe,min:O.snapshotSize??Pe,placeholder:O.snapshotSize?`${O.snapshotSize} (AMI default)`:`use AMI / backend default`,type:`number`,...w(`rootVolumeSize`,{setValueAs:Re})}),O.snapshotSize!==void 0&&(0,_.jsxs)(xe,{children:[`AMI snapshot size: `,O.snapshotSize,` GiB`]}),(0,_.jsx)(h,{errors:[E.rootVolumeSize]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`rootVolumeType`,children:`Volume Type`})}),(0,_.jsx)(p,{control:C,name:`rootVolumeType`,render:e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>t.onChange(e),value:t.value??Ne,children:[(0,_.jsx)(c,{"aria-invalid":!!E.rootVolumeType,className:`w-full`,id:`rootVolumeType`,children:(0,_.jsx)(a,{})}),(0,_.jsx)(s,{children:we.map(Le)})]})}}),(0,_.jsx)(h,{errors:[E.rootVolumeType]})]}),(0,_.jsx)(g,{children:(0,_.jsx)(p,{control:C,name:`rootDeleteOnTermination`,render:Ie})})]})]})}),t[101]=C,t[102]=E.rootDeviceName,t[103]=E.rootVolumeSize,t[104]=E.rootVolumeType,t[105]=w,t[106]=O.snapshotSize,t[107]=k,t[108]=q):q=t[108];let J;t[109]!==N||t[110]!==jt?(J=nt(jt,N),t[109]=N,t[110]=jt,t[111]=J):J=t[111];let Y;t[112]===J?Y=t[113]:(Y=(0,_.jsx)(ae,{commands:J}),t[112]=J,t[113]=Y);let bn=Nt||y.isPending,X;t[114]===d?X=t[115]:(X=async()=>await d({to:`/ec2/describe-instances`}),t[114]=d,t[115]=X);let Z;t[116]!==bn||t[117]!==X?(Z=(0,_.jsx)(oe,{disabled:bn,onClick:X,type:`button`,variant:`outline`,children:`Cancel`}),t[116]=bn,t[117]=X,t[118]=Z):Z=t[118];let xn=Nt||y.isPending||!k&&S.length===0,Sn=Nt||y.isPending?`Creating…`:`Create Instance`,Q;t[119]!==xn||t[120]!==Sn?(Q=(0,_.jsx)(oe,{disabled:xn,type:`submit`,children:Sn}),t[119]=xn,t[120]=Sn,t[121]=Q):Q=t[121];let Cn;t[122]!==Z||t[123]!==Q?(Cn=(0,_.jsxs)(`div`,{className:`flex gap-2`,children:[Z,Q]}),t[122]=Z,t[123]=Q,t[124]=Cn):Cn=t[124];let $;t[125]!==R||t[126]!==B||t[127]!==V||t[128]!==gn||t[129]!==K||t[130]!==q||t[131]!==Y||t[132]!==Cn?($=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:R,children:[B,V,gn,K,q,Y,Cn]}),t[125]=R,t[126]=B,t[127]=V,t[128]=gn,t[129]=K,t[130]=q,t[131]=Y,t[132]=Cn,t[133]=$):$=t[133];let wn;return t[134]!==P||t[135]!==F||t[136]!==I||t[137]!==L||t[138]!==$?(wn=(0,_.jsxs)(_.Fragment,{children:[P,F,I,L,$]}),t[134]=P,t[135]=F,t[136]=I,t[137]=L,t[138]=$,t[139]=wn):wn=t[139],wn}function Ie(e){let{field:t}=e;return(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(`input`,{"aria-label":`Delete on termination`,checked:t.value??!0,onChange:e=>t.onChange(e.target.checked),type:`checkbox`}),`Delete on termination`]})}function Le(e){return(0,_.jsx)(o,{value:e,children:e},e)}function Re(e){return e===``||e==null?void 0:Number(e)}function ze(e){return(0,_.jsxs)(o,{value:e.GroupName??``,children:[e.GroupName,` (`,e.Strategy,`)`]},e.GroupId)}function Be(e){let{field:t}=e;return(0,_.jsxs)(`div`,{className:`flex gap-4 text-sm`,children:[(0,_.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`input`,{"aria-label":`Source anywhere`,checked:t.value===`anywhere`,onChange:()=>t.onChange(`anywhere`),type:`radio`}),`Anywhere (0.0.0.0/0)`]}),(0,_.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`input`,{"aria-label":`Source custom CIDR`,checked:t.value===`custom`,onChange:()=>t.onChange(`custom`),type:`radio`}),`Custom CIDR`]})]})}function Ve(e){let{field:t}=e;return(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(`input`,{"aria-label":`Allow HTTPS`,checked:t.value,onChange:e=>t.onChange(e.target.checked),type:`checkbox`}),`Allow HTTPS (tcp/443)`]})}function He(e){let{field:t}=e;return(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(`input`,{"aria-label":`Allow HTTP`,checked:t.value,onChange:e=>t.onChange(e.target.checked),type:`checkbox`}),`Allow HTTP (tcp/80)`]})}function Ue(e){let{field:t}=e;return(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(`input`,{"aria-label":`Allow SSH`,checked:t.value,onChange:e=>t.onChange(e.target.checked),type:`checkbox`}),`Allow SSH (tcp/22)`]})}function We(e){let{field:t}=e;return(0,_.jsxs)(`div`,{className:`flex gap-4 text-sm`,children:[(0,_.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`input`,{"aria-label":`Create new security group`,checked:t.value===`create`,onChange:()=>t.onChange(`create`),type:`radio`}),`Create new`]}),(0,_.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`input`,{"aria-label":`Select existing security group`,checked:t.value===`existing`,onChange:()=>t.onChange(`existing`),type:`radio`}),`Select existing`]})]})}function Ge(e){return(0,_.jsx)(o,{value:e.SubnetId??``,children:e.SubnetId},e.SubnetId)}function Ke(e){return(0,_.jsx)(o,{value:e.KeyName??``,children:e.KeyName},e.KeyPairId)}function qe(e){return(0,_.jsxs)(o,{value:e.ImageId??``,children:[e.Name??`Unnamed`,` (`,e.Architecture,`)`]},e.ImageId)}function Je(e){return(0,_.jsxs)(o,{value:String(e.VersionNumber),children:[`v`,e.VersionNumber]},e.VersionNumber)}function Ye(e){return(0,_.jsx)(o,{value:e.LaunchTemplateId??``,children:e.LaunchTemplateName??e.LaunchTemplateId},e.LaunchTemplateId)}function Xe(e){return e.endsWith(`.nano`)}function Ze(e){return e.GroupName??``}function Qe(e){return e.IsDefault}function $e(e){return!Te(e)}function et(e){let t=e?.RootDeviceName??Me,n=e?.BlockDeviceMappings??[];return{deviceName:t,snapshotSize:(n.find(e=>e.DeviceName===t)??n[0])?.Ebs?.VolumeSize}}function tt(e,t){if(e.length===0)return;if(!t||t===`$Default`)return e.find(e=>e.DefaultVersion)??e[0];if(t===`$Latest`)return e.toSorted((e,t)=>(t.VersionNumber??0)-(e.VersionNumber??0))[0];let n=Number(t);return e.find(e=>e.VersionNumber===n)}function nt(e,t){let n=e(`launchTemplateId`)??``;if(n){let t=e(`launchTemplateVersion`)||`$Default`,r=e(`count`)??0;return[{label:`Run Instances`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 run-instances`},{type:`flag`,value:` \\ +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as ee}from"./useQuery.js";import{t as i}from"./useSuspenseQuery.js";import{t as te}from"./useNavigate.js";import{tn as ne}from"./cluster-config.js";import{t as re}from"./back-link.js";import{t as ie}from"./chevron-down.js";import{c as a,i as o,n as s,s as c,t as l}from"./select.js";import{t as ae}from"./cli-command-panel.js";import{t as oe}from"./button.js";import{t as u}from"./input.js";import{M as se,O as ce,c as le,h as ue,m as de,o as fe,p as pe,w as me,y as he}from"./ec2.js";import{f as ge}from"./ec22.js";import{t as d}from"./run-instances.js";import{a as f,i as _e,n as p,t as ve}from"./zod.js";import{t as ye}from"./error-banner.js";import{t as be}from"./page-heading.js";import{a as m,n as xe,r as h,t as g}from"./field.js";import{b as Se,i as Ce,t as we}from"./ec23.js";import{i as Te}from"./system-managed.js";import{t as Ee}from"./gpu-instance-type-select.js";import{n as De,r as Oe,t as ke}from"./collapsible.js";var Ae=r(),je=e(n(),1),_=t(),Me=`/dev/sda1`,Ne=`gp3`,Pe=1,Fe=16384;function v(e){let t=(0,Ae.c)(140),{launchTemplateId:n,launchTemplateVersion:r}=e,d=te(),{data:Te}=i(fe),{data:Me}=i(pe),{data:v}=i(le),{data:rt}=i(ce),{data:it}=i(he),{data:at}=i(se),{data:ot}=i(me),{data:st}=i(ue),y=ge(),ct;t[0]===Te.Images?ct=t[1]:(ct=Te.Images??[],t[0]=Te.Images,t[1]=ct);let b=ct.filter($e),lt;t[2]===Me.KeyPairs?lt=t[3]:(lt=Me.KeyPairs??[],t[2]=Me.KeyPairs,t[3]=lt);let ut=lt,dt;t[4]===rt.Subnets?dt=t[5]:(dt=rt.Subnets??[],t[4]=rt.Subnets,t[5]=dt);let ft=dt,pt;t[6]===it.PlacementGroups?pt=t[7]:(pt=it.PlacementGroups??[],t[6]=it.PlacementGroups,t[7]=pt);let mt=pt,ht;t[8]===at.Vpcs?ht=t[9]:(ht=at.Vpcs??[],t[8]=at.Vpcs,t[9]=ht);let gt=ht,_t;t[10]===ot.SecurityGroups?_t=t[11]:(_t=ot.SecurityGroups??[],t[10]=ot.SecurityGroups,t[11]=_t);let vt=_t,yt;t[12]===st.LaunchTemplates?yt=t[13]:(yt=st.LaunchTemplates??[],t[12]=st.LaunchTemplates,t[13]=yt);let bt=yt,xt;t[14]===gt?xt=t[15]:(xt=(gt.find(Qe)??gt[0])?.VpcId,t[14]=gt,t[15]=xt);let St=xt,Ct=Se(vt.map(Ze)),x;if(t[16]!==v.InstanceTypes){x={};for(let e of v.InstanceTypes??[]){let t=e.InstanceType;t&&(x[t]=(x[t]??0)+1)}t[16]=v.InstanceTypes,t[17]=x}else x=t[17];let S=Object.keys(x).toSorted(),wt=b[0]?.ImageId,Tt=ut[0]?.KeyName,Et=S.find(Xe)??S[0],Dt=et(b.find(e=>e.ImageId===wt)),Ot;t[18]===x?Ot=t[19]:(Ot=e=>!e.instanceType||e.count<=(x[e.instanceType]??1),t[18]=x,t[19]=Ot);let{control:C,handleSubmit:kt,register:w,setValue:T,getValues:At,watch:jt,formState:Mt}=_e({resolver:ve(Ce.refine(Ot,{message:`Cannot exceed available capacity`,path:[`count`]}).superRefine((e,t)=>{let n=et(b.find(t=>t.ImageId===e.imageId)).snapshotSize;e.rootVolumeSize!==void 0&&n!==void 0&&e.rootVolumeSizee.InstanceType===Ft))?.GpuInfo?.Gpus?.[0],Lt=D?.Name?.startsWith(`MIG `)?D.Name.slice(4):void 0,Rt;t[22]===C?Rt=t[23]:(Rt={control:C,name:`imageId`},t[22]=C,t[23]=Rt);let zt=f(Rt),Bt;t[24]===zt?Bt=t[25]:(Bt=e=>e.ImageId===zt,t[24]=zt,t[25]=Bt);let O=et(b.find(Bt)),Vt;t[26]===C?Vt=t[27]:(Vt={control:C,name:`subnetId`},t[26]=C,t[27]=Vt);let Ht=f(Vt),Ut;t[28]===C?Ut=t[29]:(Ut={control:C,name:`securityGroupMode`},t[28]=C,t[29]=Ut);let Wt=f(Ut),Gt;t[30]===C?Gt=t[31]:(Gt={control:C,name:`ruleSource`},t[30]=C,t[31]=Gt);let Kt=f(Gt),qt=f({control:C,name:`securityGroupIds`})??[],Jt;t[32]===qt?Jt=t[33]:(Jt=new Set(qt),t[32]=qt,t[33]=Jt);let Yt=Jt,Xt;t[34]===C?Xt=t[35]:(Xt={control:C,name:`launchTemplateId`},t[34]=C,t[35]=Xt);let k=f(Xt),Zt;t[36]===C?Zt=t[37]:(Zt={control:C,name:`launchTemplateVersion`},t[36]=C,t[37]=Zt);let Qt=f(Zt),$t=k??``,A;t[38]===$t?A=t[39]:(A=de($t),t[38]=$t,t[39]=A);let en=!!k,tn;t[40]!==A||t[41]!==en?(tn={...A,enabled:en},t[40]=A,t[41]=en,t[42]=tn):tn=t[42];let nn=ee(tn),rn;t[43]===nn.data?.LaunchTemplateVersions?rn=t[44]:(rn=nn.data?.LaunchTemplateVersions??[],t[43]=nn.data?.LaunchTemplateVersions,t[44]=rn);let j=rn,an;t[45]!==Qt||t[46]!==j?(an=tt(j,Qt)?.LaunchTemplateData,t[45]=Qt,t[46]=j,t[47]=an):an=t[47];let M=an,on;t[48]!==St||t[49]!==Ht||t[50]!==ft?(on=ft.find(e=>e.SubnetId===Ht)?.VpcId??St,t[48]=St,t[49]=Ht,t[50]=ft,t[51]=on):on=t[51];let N=on,sn;t[52]!==N||t[53]!==vt?(sn=N?vt.filter(e=>e.VpcId===N):vt,t[52]=N,t[53]=vt,t[54]=sn):sn=t[54];let cn=sn,ln;t[55]!==At||t[56]!==T?(ln=e=>{let t=At(`securityGroupIds`)??[],n=t.includes(e)?t.filter(t=>t!==e):[...t,e];T(`securityGroupIds`,n,{shouldValidate:!0})},t[55]=At,t[56]=T,t[57]=ln):ln=t[57];let un=ln,dn,fn;t[58]!==O.deviceName||t[59]!==T?(dn=()=>{T(`rootDeviceName`,O.deviceName)},fn=[O.deviceName,T],t[58]=O.deviceName,t[59]=T,t[60]=dn,t[61]=fn):(dn=t[60],fn=t[61]),(0,je.useEffect)(dn,fn);let pn;t[62]!==y||t[63]!==N||t[64]!==d?(pn=async e=>{let t=e.launchTemplateId?{count:e.count,launchTemplateId:e.launchTemplateId,launchTemplateVersion:e.launchTemplateVersion,resolvedVpcId:N}:{...e,resolvedVpcId:N};await y.mutateAsync(t),d({to:`/ec2/describe-instances`})},t[62]=y,t[63]=N,t[64]=d,t[65]=pn):pn=t[65];let mn=pn,P,F;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,_.jsx)(re,{to:`/ec2/describe-instances`,children:`Back to instances`}),F=(0,_.jsx)(be,{title:`Run Instances`}),t[66]=P,t[67]=F):(P=t[66],F=t[67]);let I;t[68]!==k||t[69]!==S?(I=S.length===0&&!k&&(0,_.jsx)(ye,{msg:`No compute available. No new instances can be created until compute is available.`}),t[68]=k,t[69]=S,t[70]=I):I=t[70];let L;t[71]===y.error?L=t[72]:(L=y.error&&(0,_.jsx)(ye,{error:y.error,msg:`Failed to create instance`}),t[71]=y.error,t[72]=L);let R;t[73]!==kt||t[74]!==mn?(R=kt(mn),t[73]=kt,t[74]=mn,t[75]=R):R=t[75];let hn;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(hn=(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`launchTemplateId`,children:`Launch Template`})}),t[76]=hn):hn=t[76];let z;t[77]===bt?z=t[78]:(z=e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>{t.onChange(e===`none`?void 0:e)},value:t.value??`none`,children:[(0,_.jsx)(c,{className:`w-full`,id:`launchTemplateId`,children:(0,_.jsx)(a,{})}),(0,_.jsxs)(s,{children:[(0,_.jsx)(o,{value:`none`,children:`none`}),bt.map(Ye)]})]})},t[77]=bt,t[78]=z);let B;t[79]!==C||t[80]!==z?(B=(0,_.jsxs)(g,{children:[hn,(0,_.jsx)(p,{control:C,name:`launchTemplateId`,render:z})]}),t[79]=C,t[80]=z,t[81]=B):B=t[81];let V;t[82]!==C||t[83]!==M||t[84]!==k||t[85]!==j?(V=k&&(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`launchTemplateVersion`,children:`Version`})}),(0,_.jsx)(p,{control:C,name:`launchTemplateVersion`,render:e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>{t.onChange(e)},value:t.value??`$Default`,children:[(0,_.jsx)(c,{className:`w-full`,id:`launchTemplateVersion`,children:(0,_.jsx)(a,{})}),(0,_.jsxs)(s,{children:[(0,_.jsx)(o,{value:`$Default`,children:`$Default`}),(0,_.jsx)(o,{value:`$Latest`,children:`$Latest`}),j.map(Je)]})]})}}),M&&(0,_.jsxs)(`div`,{className:`mt-3 space-y-1 rounded-md border border-border p-3 text-xs`,children:[(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:`Configuration from this version:`}),(0,_.jsxs)(`p`,{children:[`Image:`,` `,(0,_.jsx)(`span`,{className:`font-mono`,children:M.ImageId??`—`})]}),(0,_.jsxs)(`p`,{children:[`Instance type:`,` `,(0,_.jsx)(`span`,{className:`font-mono`,children:M.InstanceType??`—`})]}),(0,_.jsxs)(`p`,{children:[`Key pair:`,` `,(0,_.jsx)(`span`,{className:`font-mono`,children:M.KeyName??`—`})]})]})]}),t[82]=C,t[83]=M,t[84]=k,t[85]=j,t[86]=V):V=t[86];let gn=!k&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`imageId`,children:`Image`})}),(0,_.jsx)(p,{control:C,name:`imageId`,render:e=>{let{field:t}=e,n=b.find(e=>e.ImageId===t.value);return(0,_.jsxs)(l,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,_.jsx)(c,{"aria-invalid":!!E.imageId,className:`w-full`,id:`imageId`,children:(0,_.jsx)(a,{children:n?`${n.Name??`Unnamed`} (${n.Architecture})`:``})}),(0,_.jsx)(s,{children:b.map(qe)})]})}}),(0,_.jsx)(h,{errors:[E.imageId]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`instanceType`,children:`Instance Type`})}),(0,_.jsx)(p,{control:C,name:`instanceType`,render:e=>{let{field:t}=e;return(0,_.jsx)(Ee,{"aria-invalid":!!E.instanceType,availabilityByType:x,className:`w-full`,id:`instanceType`,instanceTypes:v.InstanceTypes??[],onValueChange:t.onChange,value:t.value??``})}}),D&&(0,_.jsxs)(xe,{children:[`GPU: `,D.Name,D.MemoryInfo?.SizeInMiB!==void 0&&` · ${ne(D.MemoryInfo.SizeInMiB)} VRAM`,Lt&&` · MIG ${Lt} slice`]}),(0,_.jsx)(h,{errors:[E.instanceType]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`keyName`,children:`Key Pair`})}),(0,_.jsx)(p,{control:C,name:`keyName`,render:e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,_.jsx)(c,{"aria-invalid":!!E.keyName,className:`w-full`,id:`keyName`,children:(0,_.jsx)(a,{})}),(0,_.jsx)(s,{children:ut.map(Ke)})]})}}),(0,_.jsx)(h,{errors:[E.keyName]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`subnetId`,children:`Subnet`})}),(0,_.jsx)(p,{control:C,name:`subnetId`,render:e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>{t.onChange(e===`none`?void 0:e)},value:t.value??`none`,children:[(0,_.jsx)(c,{className:`w-full`,id:`subnetId`,children:(0,_.jsx)(a,{})}),(0,_.jsxs)(s,{children:[(0,_.jsx)(o,{value:`none`,children:`none`}),ft.map(Ge)]})]})}})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:`Security Group`}),(0,_.jsx)(xe,{children:N?`Applies to VPC ${N}`:`No VPC resolved — select a subnet`}),(0,_.jsx)(p,{control:C,name:`securityGroupMode`,render:We}),Wt===`create`?(0,_.jsxs)(`div`,{className:`mt-3 space-y-4 rounded-md border border-border p-4`,children:[(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`newSgName`,children:`Name`})}),(0,_.jsx)(u,{"aria-invalid":!!E.newSgName,id:`newSgName`,type:`text`,...w(`newSgName`)}),(0,_.jsx)(h,{errors:[E.newSgName]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`newSgDescription`,children:`Description`})}),(0,_.jsx)(u,{id:`newSgDescription`,type:`text`,...w(`newSgDescription`)})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:`Inbound rules`}),(0,_.jsxs)(`div`,{className:`space-y-1`,children:[(0,_.jsx)(p,{control:C,name:`allowSsh`,render:Ue}),(0,_.jsx)(p,{control:C,name:`allowHttp`,render:He}),(0,_.jsx)(p,{control:C,name:`allowHttps`,render:Ve})]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:`Source`}),(0,_.jsx)(p,{control:C,name:`ruleSource`,render:Be}),Kt===`custom`&&(0,_.jsxs)(`div`,{className:`mt-2`,children:[(0,_.jsx)(u,{"aria-invalid":!!E.customCidr,placeholder:`203.0.113.0/24`,type:`text`,...w(`customCidr`)}),(0,_.jsx)(h,{errors:[E.customCidr]})]})]})]}):(0,_.jsxs)(`div`,{className:`mt-3`,children:[cn.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No security groups in the resolved VPC.`}):(0,_.jsx)(`div`,{className:`space-y-1`,children:cn.map(e=>(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,_.jsx)(`input`,{"aria-label":`Security group ${e.GroupId} (${e.GroupName})`,checked:Yt.has(e.GroupId??``),onChange:()=>{un(e.GroupId??``)},type:`checkbox`}),(0,_.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))}),(0,_.jsx)(h,{errors:[E.securityGroupIds]})]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`placementGroupName`,children:`Placement Group`})}),(0,_.jsx)(p,{control:C,name:`placementGroupName`,render:e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>{t.onChange(e===`none`?void 0:e)},value:t.value??`none`,children:[(0,_.jsx)(c,{className:`w-full`,id:`placementGroupName`,children:(0,_.jsx)(a,{})}),(0,_.jsxs)(s,{children:[(0,_.jsx)(o,{value:`none`,children:`none`}),mt.map(ze)]})]})}})]})]}),_n;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(_n=(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`count`,children:`Number of Instances`})}),t[87]=_n):_n=t[87];let vn=!!E.count,H;t[88]===w?H=t[89]:(H=w(`count`,{valueAsNumber:!0}),t[88]=w,t[89]=H);let U;t[90]!==vn||t[91]!==H?(U=(0,_.jsx)(u,{"aria-describedby":`count-description`,"aria-invalid":vn,id:`count`,type:`number`,...H}),t[90]=vn,t[91]=H,t[92]=U):U=t[92];let yn=Ft&&`Available capacity for ${Ft}: ${It}`,W;t[93]===yn?W=t[94]:(W=(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,id:`count-description`,children:yn}),t[93]=yn,t[94]=W);let G;t[95]===E.count?G=t[96]:(G=(0,_.jsx)(h,{errors:[E.count]}),t[95]=E.count,t[96]=G);let K;t[97]!==U||t[98]!==W||t[99]!==G?(K=(0,_.jsxs)(g,{children:[_n,U,W,G]}),t[97]=U,t[98]=W,t[99]=G,t[100]=K):K=t[100];let q;t[101]!==C||t[102]!==E.rootDeviceName||t[103]!==E.rootVolumeSize||t[104]!==E.rootVolumeType||t[105]!==w||t[106]!==O.snapshotSize||t[107]!==k?(q=!k&&(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(ke,{children:[(0,_.jsxs)(Oe,{className:`group flex h-7 w-full items-center justify-between rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm transition-colors outline-none hover:bg-input/40 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 md:text-xs/relaxed dark:bg-input/30 dark:hover:bg-input/50`,render:(0,_.jsx)(`button`,{"aria-label":`Block Device Mappings (root volume)`,type:`button`}),children:[(0,_.jsx)(`span`,{children:`Block Device Mappings (root volume)`}),(0,_.jsx)(ie,{className:`size-3.5 text-muted-foreground transition-transform group-data-[panel-open]:rotate-180`})]}),(0,_.jsxs)(De,{className:`mt-3 space-y-4 rounded-md border border-border p-4`,children:[(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`rootDeviceName`,children:`Device Name`})}),(0,_.jsx)(u,{"aria-invalid":!!E.rootDeviceName,id:`rootDeviceName`,type:`text`,...w(`rootDeviceName`)}),(0,_.jsx)(h,{errors:[E.rootDeviceName]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`rootVolumeSize`,children:`Volume Size (GiB)`})}),(0,_.jsx)(u,{"aria-invalid":!!E.rootVolumeSize,id:`rootVolumeSize`,max:Fe,min:O.snapshotSize??Pe,placeholder:O.snapshotSize?`${O.snapshotSize} (AMI default)`:`use AMI / backend default`,type:`number`,...w(`rootVolumeSize`,{setValueAs:Re})}),O.snapshotSize!==void 0&&(0,_.jsxs)(xe,{children:[`AMI snapshot size: `,O.snapshotSize,` GiB`]}),(0,_.jsx)(h,{errors:[E.rootVolumeSize]})]}),(0,_.jsxs)(g,{children:[(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`rootVolumeType`,children:`Volume Type`})}),(0,_.jsx)(p,{control:C,name:`rootVolumeType`,render:e=>{let{field:t}=e;return(0,_.jsxs)(l,{onValueChange:e=>{t.onChange(e)},value:t.value??Ne,children:[(0,_.jsx)(c,{"aria-invalid":!!E.rootVolumeType,className:`w-full`,id:`rootVolumeType`,children:(0,_.jsx)(a,{})}),(0,_.jsx)(s,{children:we.map(Le)})]})}}),(0,_.jsx)(h,{errors:[E.rootVolumeType]})]}),(0,_.jsx)(g,{children:(0,_.jsx)(p,{control:C,name:`rootDeleteOnTermination`,render:Ie})})]})]})}),t[101]=C,t[102]=E.rootDeviceName,t[103]=E.rootVolumeSize,t[104]=E.rootVolumeType,t[105]=w,t[106]=O.snapshotSize,t[107]=k,t[108]=q):q=t[108];let J;t[109]!==N||t[110]!==jt?(J=nt(jt,N),t[109]=N,t[110]=jt,t[111]=J):J=t[111];let Y;t[112]===J?Y=t[113]:(Y=(0,_.jsx)(ae,{commands:J}),t[112]=J,t[113]=Y);let bn=Nt||y.isPending,X;t[114]===d?X=t[115]:(X=async()=>{await d({to:`/ec2/describe-instances`})},t[114]=d,t[115]=X);let Z;t[116]!==bn||t[117]!==X?(Z=(0,_.jsx)(oe,{disabled:bn,onClick:X,type:`button`,variant:`outline`,children:`Cancel`}),t[116]=bn,t[117]=X,t[118]=Z):Z=t[118];let xn=Nt||y.isPending||!k&&S.length===0,Sn=Nt||y.isPending?`Creating…`:`Create Instance`,Q;t[119]!==xn||t[120]!==Sn?(Q=(0,_.jsx)(oe,{disabled:xn,type:`submit`,children:Sn}),t[119]=xn,t[120]=Sn,t[121]=Q):Q=t[121];let Cn;t[122]!==Z||t[123]!==Q?(Cn=(0,_.jsxs)(`div`,{className:`flex gap-2`,children:[Z,Q]}),t[122]=Z,t[123]=Q,t[124]=Cn):Cn=t[124];let $;t[125]!==R||t[126]!==B||t[127]!==V||t[128]!==gn||t[129]!==K||t[130]!==q||t[131]!==Y||t[132]!==Cn?($=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:R,children:[B,V,gn,K,q,Y,Cn]}),t[125]=R,t[126]=B,t[127]=V,t[128]=gn,t[129]=K,t[130]=q,t[131]=Y,t[132]=Cn,t[133]=$):$=t[133];let wn;return t[134]!==P||t[135]!==F||t[136]!==I||t[137]!==L||t[138]!==$?(wn=(0,_.jsxs)(_.Fragment,{children:[P,F,I,L,$]}),t[134]=P,t[135]=F,t[136]=I,t[137]=L,t[138]=$,t[139]=wn):wn=t[139],wn}function Ie(e){let{field:t}=e;return(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(`input`,{"aria-label":`Delete on termination`,checked:t.value??!0,onChange:e=>{t.onChange(e.target.checked)},type:`checkbox`}),`Delete on termination`]})}function Le(e){return(0,_.jsx)(o,{value:e,children:e},e)}function Re(e){return e===``||e==null?void 0:Number(e)}function ze(e){return(0,_.jsxs)(o,{value:e.GroupName??``,children:[e.GroupName,` (`,e.Strategy,`)`]},e.GroupId)}function Be(e){let{field:t}=e;return(0,_.jsxs)(`div`,{className:`flex gap-4 text-sm`,children:[(0,_.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`input`,{"aria-label":`Source anywhere`,checked:t.value===`anywhere`,onChange:()=>{t.onChange(`anywhere`)},type:`radio`}),`Anywhere (0.0.0.0/0)`]}),(0,_.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`input`,{"aria-label":`Source custom CIDR`,checked:t.value===`custom`,onChange:()=>{t.onChange(`custom`)},type:`radio`}),`Custom CIDR`]})]})}function Ve(e){let{field:t}=e;return(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(`input`,{"aria-label":`Allow HTTPS`,checked:t.value,onChange:e=>{t.onChange(e.target.checked)},type:`checkbox`}),`Allow HTTPS (tcp/443)`]})}function He(e){let{field:t}=e;return(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(`input`,{"aria-label":`Allow HTTP`,checked:t.value,onChange:e=>{t.onChange(e.target.checked)},type:`checkbox`}),`Allow HTTP (tcp/80)`]})}function Ue(e){let{field:t}=e;return(0,_.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,_.jsx)(`input`,{"aria-label":`Allow SSH`,checked:t.value,onChange:e=>{t.onChange(e.target.checked)},type:`checkbox`}),`Allow SSH (tcp/22)`]})}function We(e){let{field:t}=e;return(0,_.jsxs)(`div`,{className:`flex gap-4 text-sm`,children:[(0,_.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`input`,{"aria-label":`Create new security group`,checked:t.value===`create`,onChange:()=>{t.onChange(`create`)},type:`radio`}),`Create new`]}),(0,_.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`input`,{"aria-label":`Select existing security group`,checked:t.value===`existing`,onChange:()=>{t.onChange(`existing`)},type:`radio`}),`Select existing`]})]})}function Ge(e){return(0,_.jsx)(o,{value:e.SubnetId??``,children:e.SubnetId},e.SubnetId)}function Ke(e){return(0,_.jsx)(o,{value:e.KeyName??``,children:e.KeyName},e.KeyPairId)}function qe(e){return(0,_.jsxs)(o,{value:e.ImageId??``,children:[e.Name??`Unnamed`,` (`,e.Architecture,`)`]},e.ImageId)}function Je(e){return(0,_.jsxs)(o,{value:String(e.VersionNumber),children:[`v`,e.VersionNumber]},e.VersionNumber)}function Ye(e){return(0,_.jsx)(o,{value:e.LaunchTemplateId??``,children:e.LaunchTemplateName??e.LaunchTemplateId},e.LaunchTemplateId)}function Xe(e){return e.endsWith(`.nano`)}function Ze(e){return e.GroupName??``}function Qe(e){return e.IsDefault}function $e(e){return!Te(e)}function et(e){let t=e?.RootDeviceName??Me,n=e?.BlockDeviceMappings??[];return{deviceName:t,snapshotSize:(n.find(e=>e.DeviceName===t)??n[0])?.Ebs?.VolumeSize}}function tt(e,t){if(e.length===0)return;if(!t||t===`$Default`)return e.find(e=>e.DefaultVersion)??e[0];if(t===`$Latest`)return e.toSorted((e,t)=>(t.VersionNumber??0)-(e.VersionNumber??0))[0];let n=Number(t);return e.find(e=>e.VersionNumber===n)}function nt(e,t){let n=e(`launchTemplateId`)??``;if(n){let t=e(`launchTemplateVersion`)||`$Default`,r=e(`count`)??0;return[{label:`Run Instances`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 run-instances`},{type:`flag`,value:` \\ --launch-template`},{type:`value`,value:` LaunchTemplateId=${n},Version=${t}`},{type:`flag`,value:` \\ --count`},{type:`value`,value:` ${r||1}`}]}]}let r=e(`imageId`)??``,ee=e(`instanceType`)??``,i=e(`keyName`)??``,te=e(`subnetId`)??``,ne=e(`placementGroupName`)??``,re=e(`count`)??0,ie=e(`rootDeviceName`)??``,a=e(`rootVolumeSize`),o=e(`rootVolumeType`),s=e(`rootDeleteOnTermination`),c=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 run-instances`},{type:`flag`,value:` \\ --image-id`},{type:`value`,value:` ${r||``}`},{type:`flag`,value:` \\ diff --git a/spinifex/services/spinifexui/frontend/dist/assets/run-task2.js b/spinifex/services/spinifexui/frontend/dist/assets/run-task2.js index 254cec56f..6610a4d63 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/run-task2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/run-task2.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{t as te}from"./back-link.js";import{c as ne,i,n as re,s as ie,t as ae}from"./select.js";import{t as oe}from"./input.js";import{O as se,w as ce}from"./ec2.js";import{a as le,o as ue}from"./ecs.js";import{c as de}from"./ecs2.js";import{t as a}from"./run-task.js";import{a as fe,i as pe,n as me,t as he}from"./zod.js";import{t as ge}from"./error-banner.js";import{t as _e}from"./form-actions.js";import{t as ve}from"./page-heading.js";import{a as ye,r as be,t as xe}from"./field.js";import{i as Se}from"./ecs3.js";var Ce=t(),o=e();function s(e){return e.split(`/`).at(-1)??e}function c(e){let t=(0,Ce.c)(88),{cluster:i}=e,a=ee(),s=de(),{data:c}=r(ue),{data:l}=r(se),{data:Te}=r(ce),u;t[0]===l.Subnets?u=t[1]:(u=l.Subnets??[],t[0]=l.Subnets,t[1]=u);let Ee=u,d;t[2]===Te.SecurityGroups?d=t[3]:(d=Te.SecurityGroups??[],t[2]=Te.SecurityGroups,t[3]=d);let De=d,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=he(Se),t[4]=f):f=t[4];let p,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],m=[],t[5]=p,t[6]=m):(p=t[5],m=t[6]);let h;t[7]===i?h=t[8]:(h={resolver:f,defaultValues:{cluster:i,taskDefinition:``,count:1,subnets:p,securityGroups:m,assignPublicIp:!1}},t[7]=i,t[8]=h);let{control:g,handleSubmit:Oe,register:_,setValue:ke,getValues:Ae,formState:je}=pe(h),{errors:v,isSubmitting:y}=je,b;t[9]===g?b=t[10]:(b={control:g,name:`taskDefinition`},t[9]=g,t[10]=b);let x=fe(b),S;t[11]===x?S=t[12]:(S=le(x),t[11]=x,t[12]=S);let{data:Me}=n(S),C=Me?.networkMode===`awsvpc`,w;t[13]===g?w=t[14]:(w={control:g,name:`subnets`},t[13]=g,t[14]=w);let T=fe(w),E;t[15]===g?E=t[16]:(E={control:g,name:`securityGroups`},t[15]=g,t[16]=E);let D=fe(E),O;t[17]===T?O=t[18]:(O=new Set(T),t[17]=T,t[18]=O);let Ne=O,k;t[19]===D?k=t[20]:(k=new Set(D),t[19]=D,t[20]=k);let Pe=k,A;t[21]!==Ae||t[22]!==ke?(A=(e,t)=>{let n=Ae(e);ke(e,n.includes(t)?n.filter(e=>e!==t):[...n,t],{shouldValidate:!0})},t[21]=Ae,t[22]=ke,t[23]=A):A=t[23];let j=A,M;t[24]!==i||t[25]!==a?(M=function(){a({to:`/ecs/list-clusters/$clusterName`,params:{clusterName:i}})},t[24]=i,t[25]=a,t[26]=M):M=t[26];let N=M,P;t[27]!==C||t[28]!==N||t[29]!==s?(P=function(e){s.mutate({cluster:e.cluster,taskDefinition:e.taskDefinition,count:e.count,awsvpc:C,subnets:e.subnets,securityGroups:e.securityGroups,assignPublicIp:e.assignPublicIp},{onSuccess:N})},t[27]=C,t[28]=N,t[29]=s,t[30]=P):P=t[30];let Fe=P,Ie=C&&T.length===0,F;t[31]===i?F=t[32]:(F={clusterName:i},t[31]=i,t[32]=F);let I;t[33]!==i||t[34]!==F?(I=(0,o.jsx)(te,{params:F,to:`/ecs/list-clusters/$clusterName`,children:i}),t[33]=i,t[34]=F,t[35]=I):I=t[35];let Le=`Cluster: ${i}`,L;t[36]===Le?L=t[37]:(L=(0,o.jsx)(ve,{subtitle:Le,title:`Run Task`}),t[36]=Le,t[37]=L);let R;t[38]!==s.error||t[39]!==s.isError?(R=s.isError&&(0,o.jsx)(ge,{error:s.error instanceof Error?s.error:void 0,msg:`Failed to run task.`}),t[38]=s.error,t[39]=s.isError,t[40]=R):R=t[40];let z;t[41]!==Oe||t[42]!==Fe?(z=Oe(Fe),t[41]=Oe,t[42]=Fe,t[43]=z):z=t[43];let B;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,o.jsx)(ye,{children:(0,o.jsx)(`label`,{htmlFor:`taskDefinition`,children:`Task definition`})}),t[44]=B):B=t[44];let V;t[45]===c?V=t[46]:(V=e=>{let{field:t}=e;return(0,o.jsxs)(ae,{onValueChange:t.onChange,value:t.value,children:[(0,o.jsx)(ie,{className:`w-full`,id:`taskDefinition`,children:(0,o.jsx)(ne,{placeholder:`Select a task definition`})}),(0,o.jsx)(re,{children:c.map(we)})]})},t[45]=c,t[46]=V);let H;t[47]!==g||t[48]!==V?(H=(0,o.jsx)(me,{control:g,name:`taskDefinition`,render:V}),t[47]=g,t[48]=V,t[49]=H):H=t[49];let U;t[50]===v.taskDefinition?U=t[51]:(U=(0,o.jsx)(be,{errors:[v.taskDefinition]}),t[50]=v.taskDefinition,t[51]=U);let W;t[52]!==H||t[53]!==U?(W=(0,o.jsxs)(xe,{children:[B,H,U]}),t[52]=H,t[53]=U,t[54]=W):W=t[54];let G;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,o.jsx)(ye,{children:(0,o.jsx)(`label`,{htmlFor:`count`,children:`Count`})}),t[55]=G):G=t[55];let K;t[56]===_?K=t[57]:(K=_(`count`,{valueAsNumber:!0}),t[56]=_,t[57]=K);let q;t[58]===K?q=t[59]:(q=(0,o.jsx)(oe,{id:`count`,type:`number`,...K}),t[58]=K,t[59]=q);let J;t[60]===v.count?J=t[61]:(J=(0,o.jsx)(be,{errors:[v.count]}),t[60]=v.count,t[61]=J);let Y;t[62]!==q||t[63]!==J?(Y=(0,o.jsxs)(xe,{children:[G,q,J]}),t[62]=q,t[63]=J,t[64]=Y):Y=t[64];let X;t[65]!==C||t[66]!==_||t[67]!==De||t[68]!==Pe||t[69]!==Ne||t[70]!==Ee||t[71]!==j?(X=C&&(0,o.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This task definition uses awsvpc networking. Select at least one subnet.`}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:`Subnets`}),(0,o.jsx)(`div`,{className:`mt-2 space-y-1`,children:Ee.map(e=>(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,o.jsx)(`input`,{checked:Ne.has(e.SubnetId??``),onChange:()=>j(`subnets`,e.SubnetId??``),type:`checkbox`}),(0,o.jsxs)(`span`,{className:`font-mono`,children:[e.SubnetId,` (`,e.CidrBlock,`)`]})]},e.SubnetId))})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:`Security groups`}),(0,o.jsx)(`div`,{className:`mt-2 space-y-1`,children:De.map(e=>(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,o.jsx)(`input`,{checked:Pe.has(e.GroupId??``),onChange:()=>j(`securityGroups`,e.GroupId??``),type:`checkbox`}),(0,o.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})]}),(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,o.jsx)(`input`,{type:`checkbox`,..._(`assignPublicIp`)}),(0,o.jsx)(`span`,{children:`Assign public IP`})]})]}),t[65]=C,t[66]=_,t[67]=De,t[68]=Pe,t[69]=Ne,t[70]=Ee,t[71]=j,t[72]=X):X=t[72];let Re=s.isPending||Ie,Z;t[73]!==N||t[74]!==y||t[75]!==Re?(Z=(0,o.jsx)(_e,{isPending:Re,isSubmitting:y,onCancel:N,pendingLabel:`Running…`,submitLabel:`Run Task`}),t[73]=N,t[74]=y,t[75]=Re,t[76]=Z):Z=t[76];let Q;t[77]!==z||t[78]!==W||t[79]!==Y||t[80]!==X||t[81]!==Z?(Q=(0,o.jsxs)(`form`,{className:`max-w-2xl space-y-6`,onSubmit:z,children:[W,Y,X,Z]}),t[77]=z,t[78]=W,t[79]=Y,t[80]=X,t[81]=Z,t[82]=Q):Q=t[82];let $;return t[83]!==I||t[84]!==L||t[85]!==R||t[86]!==Q?($=(0,o.jsxs)(o.Fragment,{children:[I,L,R,Q]}),t[83]=I,t[84]=L,t[85]=R,t[86]=Q,t[87]=$):$=t[87],$}function we(e){let t=s(e);return(0,o.jsx)(i,{value:t,children:t},e)}function l(){let e=(0,Ce.c)(2),{cluster:t}=a.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,o.jsx)(c,{cluster:t}),e[0]=t,e[1]=n),n}export{l as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{t as te}from"./back-link.js";import{c as ne,i,n as re,s as ie,t as ae}from"./select.js";import{t as oe}from"./input.js";import{O as se,w as ce}from"./ec2.js";import{a as le,o as ue}from"./ecs.js";import{c as de}from"./ecs2.js";import{t as a}from"./run-task.js";import{a as fe,i as pe,n as me,t as he}from"./zod.js";import{t as ge}from"./error-banner.js";import{t as _e}from"./form-actions.js";import{t as ve}from"./page-heading.js";import{a as ye,r as be,t as xe}from"./field.js";import{i as Se}from"./ecs3.js";var Ce=t(),o=e();function s(e){return e.split(`/`).at(-1)??e}function c(e){let t=(0,Ce.c)(88),{cluster:i}=e,a=ee(),s=de(),{data:c}=r(ue),{data:l}=r(se),{data:Te}=r(ce),u;t[0]===l.Subnets?u=t[1]:(u=l.Subnets??[],t[0]=l.Subnets,t[1]=u);let Ee=u,d;t[2]===Te.SecurityGroups?d=t[3]:(d=Te.SecurityGroups??[],t[2]=Te.SecurityGroups,t[3]=d);let De=d,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=he(Se),t[4]=f):f=t[4];let p,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],m=[],t[5]=p,t[6]=m):(p=t[5],m=t[6]);let h;t[7]===i?h=t[8]:(h={resolver:f,defaultValues:{cluster:i,taskDefinition:``,count:1,subnets:p,securityGroups:m,assignPublicIp:!1}},t[7]=i,t[8]=h);let{control:g,handleSubmit:Oe,register:_,setValue:ke,getValues:Ae,formState:je}=pe(h),{errors:v,isSubmitting:y}=je,b;t[9]===g?b=t[10]:(b={control:g,name:`taskDefinition`},t[9]=g,t[10]=b);let x=fe(b),S;t[11]===x?S=t[12]:(S=le(x),t[11]=x,t[12]=S);let{data:Me}=n(S),C=Me?.networkMode===`awsvpc`,w;t[13]===g?w=t[14]:(w={control:g,name:`subnets`},t[13]=g,t[14]=w);let T=fe(w),E;t[15]===g?E=t[16]:(E={control:g,name:`securityGroups`},t[15]=g,t[16]=E);let D=fe(E),O;t[17]===T?O=t[18]:(O=new Set(T),t[17]=T,t[18]=O);let Ne=O,k;t[19]===D?k=t[20]:(k=new Set(D),t[19]=D,t[20]=k);let Pe=k,A;t[21]!==Ae||t[22]!==ke?(A=(e,t)=>{let n=Ae(e);ke(e,n.includes(t)?n.filter(e=>e!==t):[...n,t],{shouldValidate:!0})},t[21]=Ae,t[22]=ke,t[23]=A):A=t[23];let j=A,M;t[24]!==i||t[25]!==a?(M=function(){a({to:`/ecs/list-clusters/$clusterName`,params:{clusterName:i}})},t[24]=i,t[25]=a,t[26]=M):M=t[26];let N=M,P;t[27]!==C||t[28]!==N||t[29]!==s?(P=function(e){s.mutate({cluster:e.cluster,taskDefinition:e.taskDefinition,count:e.count,awsvpc:C,subnets:e.subnets,securityGroups:e.securityGroups,assignPublicIp:e.assignPublicIp},{onSuccess:N})},t[27]=C,t[28]=N,t[29]=s,t[30]=P):P=t[30];let Fe=P,Ie=C&&T.length===0,F;t[31]===i?F=t[32]:(F={clusterName:i},t[31]=i,t[32]=F);let I;t[33]!==i||t[34]!==F?(I=(0,o.jsx)(te,{params:F,to:`/ecs/list-clusters/$clusterName`,children:i}),t[33]=i,t[34]=F,t[35]=I):I=t[35];let Le=`Cluster: ${i}`,L;t[36]===Le?L=t[37]:(L=(0,o.jsx)(ve,{subtitle:Le,title:`Run Task`}),t[36]=Le,t[37]=L);let R;t[38]!==s.error||t[39]!==s.isError?(R=s.isError&&(0,o.jsx)(ge,{error:s.error instanceof Error?s.error:void 0,msg:`Failed to run task.`}),t[38]=s.error,t[39]=s.isError,t[40]=R):R=t[40];let z;t[41]!==Oe||t[42]!==Fe?(z=Oe(Fe),t[41]=Oe,t[42]=Fe,t[43]=z):z=t[43];let B;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,o.jsx)(ye,{children:(0,o.jsx)(`label`,{htmlFor:`taskDefinition`,children:`Task definition`})}),t[44]=B):B=t[44];let V;t[45]===c?V=t[46]:(V=e=>{let{field:t}=e;return(0,o.jsxs)(ae,{onValueChange:t.onChange,value:t.value,children:[(0,o.jsx)(ie,{className:`w-full`,id:`taskDefinition`,children:(0,o.jsx)(ne,{placeholder:`Select a task definition`})}),(0,o.jsx)(re,{children:c.map(we)})]})},t[45]=c,t[46]=V);let H;t[47]!==g||t[48]!==V?(H=(0,o.jsx)(me,{control:g,name:`taskDefinition`,render:V}),t[47]=g,t[48]=V,t[49]=H):H=t[49];let U;t[50]===v.taskDefinition?U=t[51]:(U=(0,o.jsx)(be,{errors:[v.taskDefinition]}),t[50]=v.taskDefinition,t[51]=U);let W;t[52]!==H||t[53]!==U?(W=(0,o.jsxs)(xe,{children:[B,H,U]}),t[52]=H,t[53]=U,t[54]=W):W=t[54];let G;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,o.jsx)(ye,{children:(0,o.jsx)(`label`,{htmlFor:`count`,children:`Count`})}),t[55]=G):G=t[55];let K;t[56]===_?K=t[57]:(K=_(`count`,{valueAsNumber:!0}),t[56]=_,t[57]=K);let q;t[58]===K?q=t[59]:(q=(0,o.jsx)(oe,{id:`count`,type:`number`,...K}),t[58]=K,t[59]=q);let J;t[60]===v.count?J=t[61]:(J=(0,o.jsx)(be,{errors:[v.count]}),t[60]=v.count,t[61]=J);let Y;t[62]!==q||t[63]!==J?(Y=(0,o.jsxs)(xe,{children:[G,q,J]}),t[62]=q,t[63]=J,t[64]=Y):Y=t[64];let X;t[65]!==C||t[66]!==_||t[67]!==De||t[68]!==Pe||t[69]!==Ne||t[70]!==Ee||t[71]!==j?(X=C&&(0,o.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This task definition uses awsvpc networking. Select at least one subnet.`}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:`Subnets`}),(0,o.jsx)(`div`,{className:`mt-2 space-y-1`,children:Ee.map(e=>(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,o.jsx)(`input`,{checked:Ne.has(e.SubnetId??``),onChange:()=>{j(`subnets`,e.SubnetId??``)},type:`checkbox`}),(0,o.jsxs)(`span`,{className:`font-mono`,children:[e.SubnetId,` (`,e.CidrBlock,`)`]})]},e.SubnetId))})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:`Security groups`}),(0,o.jsx)(`div`,{className:`mt-2 space-y-1`,children:De.map(e=>(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,o.jsx)(`input`,{checked:Pe.has(e.GroupId??``),onChange:()=>{j(`securityGroups`,e.GroupId??``)},type:`checkbox`}),(0,o.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})]}),(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,o.jsx)(`input`,{type:`checkbox`,..._(`assignPublicIp`)}),(0,o.jsx)(`span`,{children:`Assign public IP`})]})]}),t[65]=C,t[66]=_,t[67]=De,t[68]=Pe,t[69]=Ne,t[70]=Ee,t[71]=j,t[72]=X):X=t[72];let Re=s.isPending||Ie,Z;t[73]!==N||t[74]!==y||t[75]!==Re?(Z=(0,o.jsx)(_e,{isPending:Re,isSubmitting:y,onCancel:N,pendingLabel:`Running…`,submitLabel:`Run Task`}),t[73]=N,t[74]=y,t[75]=Re,t[76]=Z):Z=t[76];let Q;t[77]!==z||t[78]!==W||t[79]!==Y||t[80]!==X||t[81]!==Z?(Q=(0,o.jsxs)(`form`,{className:`max-w-2xl space-y-6`,onSubmit:z,children:[W,Y,X,Z]}),t[77]=z,t[78]=W,t[79]=Y,t[80]=X,t[81]=Z,t[82]=Q):Q=t[82];let $;return t[83]!==I||t[84]!==L||t[85]!==R||t[86]!==Q?($=(0,o.jsxs)(o.Fragment,{children:[I,L,R,Q]}),t[83]=I,t[84]=L,t[85]=R,t[86]=Q,t[87]=$):$=t[87],$}function we(e){let t=s(e);return(0,o.jsx)(i,{value:t,children:t},e)}function l(){let e=(0,Ce.c)(2),{cluster:t}=a.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,o.jsx)(c,{cluster:t}),e[0]=t,e[1]=n),n}export{l as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/security-group-checkboxes.js b/spinifex/services/spinifexui/frontend/dist/assets/security-group-checkboxes.js index 84ff870ef..29d394485 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/security-group-checkboxes.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/security-group-checkboxes.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{in as n}from"./cluster-config.js";import{c as r,i,n as a,s as o,t as s}from"./select.js";import{n as c}from"./zod.js";import{a as l,n as u,r as d,t as f}from"./field.js";import{t as p}from"./picker-notice.js";var m=t(),h=e();function g(e){let t=(0,m.c)(13),{control:n,name:i,id:g,label:v,placeholder:y,options:b,notice:x,description:S,warning:C,onValueChange:w}=e,T;t[0]!==S||t[1]!==g||t[2]!==v||t[3]!==x||t[4]!==w||t[5]!==b||t[6]!==y||t[7]!==C?(T=e=>{let{field:t,fieldState:n}=e,i=typeof t.value==`string`?t.value:``;return(0,h.jsxs)(f,{children:[(0,h.jsx)(l,{children:(0,h.jsx)(`label`,{htmlFor:g,children:v})}),x?(0,h.jsx)(p,{notice:x}):(0,h.jsxs)(s,{onValueChange:e=>(w??t.onChange)(e??``),value:i,children:[(0,h.jsx)(o,{"aria-invalid":!!n.error,className:`w-full`,id:g,children:(0,h.jsx)(r,{placeholder:y})}),(0,h.jsx)(a,{children:b.map(_)})]}),S&&(0,h.jsx)(u,{children:S}),C&&(0,h.jsx)(`p`,{className:`text-xs text-tactical-amber`,children:C}),(0,h.jsx)(d,{errors:[n.error]})]})},t[0]=S,t[1]=g,t[2]=v,t[3]=x,t[4]=w,t[5]=b,t[6]=y,t[7]=C,t[8]=T):T=t[8];let E;return t[9]!==n||t[10]!==i||t[11]!==T?(E=(0,h.jsx)(c,{control:n,name:i,render:T}),t[9]=n,t[10]=i,t[11]=T,t[12]=E):E=t[12],E}function _(e){return(0,h.jsx)(i,{value:e.value,children:e.label},e.value)}function v(e){let t=(0,m.c)(3),{control:n,name:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,h.jsx)(c,{control:n,name:r,render:y}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function y(e){let{field:t,fieldState:n}=e;return(0,h.jsxs)(f,{children:[(0,h.jsx)(l,{children:`Deletion protection`}),(0,h.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,h.jsx)(`input`,{"aria-label":`Enable deletion protection`,checked:t.value,onChange:e=>t.onChange(e.target.checked),type:`checkbox`}),(0,h.jsx)(`span`,{children:`Refuse DeleteDBInstance while this is on`})]}),(0,h.jsx)(d,{errors:[n.error]})]})}function b(e,t,n){let r=new Set(t.filter(e=>e.Engine===n).map(e=>e.DBParameterGroupFamily));return e.filter(e=>r.has(e.DBParameterGroupFamily))}function x(e,t){return t?e.filter(e=>e.VpcId===t):[]}function S(e,t,n){let r=new Set(x(e,t).map(e=>e.GroupId));return n.filter(e=>r.has(e))}function C(e,t){return x(e,t).find(e=>e.GroupName==="default")?.GroupId}function w(e){let t=(0,m.c)(16),{emptyText:r,groups:i,onChange:a,selected:o}=e;if(i.length===0){let e;return t[0]===r?e=t[1]:(e=(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r}),t[0]=r,t[1]=e),e}let s;t[2]===o?s=t[3]:(s=new Set(o),t[2]=o,t[3]=s);let c=s,l;t[4]!==a||t[5]!==o?(l=e=>a(o.includes(e)?o.filter(t=>t!==e):[...o,e]),t[4]=a,t[5]=o,t[6]=l):l=t[6];let u=l,d;if(t[7]!==i||t[8]!==c||t[9]!==u){let e;t[11]!==c||t[12]!==u?(e=e=>(0,h.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,h.jsx)(`input`,{"aria-label":`Security group ${n(e)}`,checked:c.has(e.GroupId??``),onChange:()=>u(e.GroupId??``),type:`checkbox`}),(0,h.jsx)(`span`,{className:`font-mono`,children:n(e)})]},e.GroupId),t[11]=c,t[12]=u,t[13]=e):e=t[13],d=i.map(e),t[7]=i,t[8]=c,t[9]=u,t[10]=d}else d=t[10];let f;return t[14]===d?f=t[15]:(f=(0,h.jsx)(`div`,{className:`space-y-1`,children:d}),t[14]=d,t[15]=f),f}export{v as a,x as i,C as n,g as o,S as r,b as s,w as t}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{in as n}from"./cluster-config.js";import{c as r,i,n as a,s as o,t as s}from"./select.js";import{n as c}from"./zod.js";import{a as l,n as u,r as d,t as f}from"./field.js";import{t as p}from"./picker-notice.js";var m=t(),h=e();function g(e){let t=(0,m.c)(13),{control:n,name:i,id:g,label:v,placeholder:y,options:b,notice:x,description:S,warning:C,onValueChange:w}=e,T;t[0]!==S||t[1]!==g||t[2]!==v||t[3]!==x||t[4]!==w||t[5]!==b||t[6]!==y||t[7]!==C?(T=e=>{let{field:t,fieldState:n}=e,i=typeof t.value==`string`?t.value:``;return(0,h.jsxs)(f,{children:[(0,h.jsx)(l,{children:(0,h.jsx)(`label`,{htmlFor:g,children:v})}),x?(0,h.jsx)(p,{notice:x}):(0,h.jsxs)(s,{onValueChange:e=>{(w??t.onChange)(e??``)},value:i,children:[(0,h.jsx)(o,{"aria-invalid":!!n.error,className:`w-full`,id:g,children:(0,h.jsx)(r,{placeholder:y})}),(0,h.jsx)(a,{children:b.map(_)})]}),S&&(0,h.jsx)(u,{children:S}),C&&(0,h.jsx)(`p`,{className:`text-xs text-tactical-amber`,children:C}),(0,h.jsx)(d,{errors:[n.error]})]})},t[0]=S,t[1]=g,t[2]=v,t[3]=x,t[4]=w,t[5]=b,t[6]=y,t[7]=C,t[8]=T):T=t[8];let E;return t[9]!==n||t[10]!==i||t[11]!==T?(E=(0,h.jsx)(c,{control:n,name:i,render:T}),t[9]=n,t[10]=i,t[11]=T,t[12]=E):E=t[12],E}function _(e){return(0,h.jsx)(i,{value:e.value,children:e.label},e.value)}function v(e){let t=(0,m.c)(3),{control:n,name:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,h.jsx)(c,{control:n,name:r,render:y}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function y(e){let{field:t,fieldState:n}=e;return(0,h.jsxs)(f,{children:[(0,h.jsx)(l,{children:`Deletion protection`}),(0,h.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,h.jsx)(`input`,{"aria-label":`Enable deletion protection`,checked:t.value,onChange:e=>{t.onChange(e.target.checked)},type:`checkbox`}),(0,h.jsx)(`span`,{children:`Refuse DeleteDBInstance while this is on`})]}),(0,h.jsx)(d,{errors:[n.error]})]})}function b(e,t,n){let r=new Set(t.filter(e=>e.Engine===n).map(e=>e.DBParameterGroupFamily));return e.filter(e=>r.has(e.DBParameterGroupFamily))}function x(e,t){return t?e.filter(e=>e.VpcId===t):[]}function S(e,t,n){let r=new Set(x(e,t).map(e=>e.GroupId));return n.filter(e=>r.has(e))}function C(e,t){return x(e,t).find(e=>e.GroupName==="default")?.GroupId}function w(e){let t=(0,m.c)(16),{emptyText:r,groups:i,onChange:a,selected:o}=e;if(i.length===0){let e;return t[0]===r?e=t[1]:(e=(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r}),t[0]=r,t[1]=e),e}let s;t[2]===o?s=t[3]:(s=new Set(o),t[2]=o,t[3]=s);let c=s,l;t[4]!==a||t[5]!==o?(l=e=>{a(o.includes(e)?o.filter(t=>t!==e):[...o,e])},t[4]=a,t[5]=o,t[6]=l):l=t[6];let u=l,d;if(t[7]!==i||t[8]!==c||t[9]!==u){let e;t[11]!==c||t[12]!==u?(e=e=>(0,h.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,h.jsx)(`input`,{"aria-label":`Security group ${n(e)}`,checked:c.has(e.GroupId??``),onChange:()=>{u(e.GroupId??``)},type:`checkbox`}),(0,h.jsx)(`span`,{className:`font-mono`,children:n(e)})]},e.GroupId),t[11]=c,t[12]=u,t[13]=e):e=t[13],d=i.map(e),t[7]=i,t[8]=c,t[9]=u,t[10]=d}else d=t[10];let f;return t[14]===d?f=t[15]:(f=(0,h.jsx)(`div`,{className:`space-y-1`,children:d}),t[14]=d,t[15]=f),f}export{v as a,x as i,C as n,g as o,S as r,b as s,w as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/tags-editor.js b/spinifex/services/spinifexui/frontend/dist/assets/tags-editor.js index 953987370..6d6942ff3 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/tags-editor.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/tags-editor.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as ee}from"./plus.js";import{t as te}from"./trash-2.js";import{t as i}from"./button.js";import{t as a}from"./input.js";var ne=r(),o=e(n(),1),s=t();function re(e){return e.map((e,t)=>({id:t,key:e.Key??``,value:e.Value??``}))}function c(e){return e.map(e=>({key:e.key.trim(),value:e.value})).filter(e=>e.key.length>0)}function l(e){let t=(0,ne.c)(66),{tags:n,onSubmit:r,isPending:l,error:d,isSuccess:f}=e,p;t[0]===n?p=t[1]:(p=re(n),t[0]=n,t[1]=p);let m=p,[h,g]=(0,o.useState)(m),[_,oe]=(0,o.useState)(m.length),v;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(v=(e,t)=>{g(n=>n.map(n=>n.id===e?{...n,...t}:n))},t[2]=v):v=t[2];let y=v,b;t[3]===_?b=t[4]:(b=()=>{g(e=>[...e,{id:_,key:``,value:``}]),oe(ae)},t[3]=_,t[4]=b);let x=b,S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{g(t=>t.filter(t=>t.id!==e))},t[5]=S):S=t[5];let C=S,w;t[6]===m?w=t[7]:(w=()=>{g(m)},t[6]=m,t[7]=w);let T=w,E;t[8]===h?E=t[9]:(E=h.some(u),t[8]=h,t[9]=E);let D=E,O,k,A,j;if(t[10]!==D||t[11]!==h){A=c(h);let e=A.map(ie);O=new Set(e).size!==e.length,k=D||O,j=JSON.stringify(A),t[10]=D,t[11]=h,t[12]=O,t[13]=k,t[14]=A,t[15]=j}else O=t[12],k=t[13],A=t[14],j=t[15];let M;t[16]===m?M=t[17]:(M=JSON.stringify(c(m)),t[16]=m,t[17]=M);let N=j!==M,P;t[18]!==N||t[19]!==k||t[20]!==A||t[21]!==r?(P=e=>{e.preventDefault(),!(k||!N)&&r(A)},t[18]=N,t[19]=k,t[20]=A,t[21]=r,t[22]=P):P=t[22];let F;t[23]===d?F=t[24]:(F=d&&(0,s.jsx)(`div`,{className:`mb-4 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive`,role:`alert`,children:d.message||`Failed to save tags`}),t[23]=d,t[24]=F);let I;t[25]!==N||t[26]!==f?(I=f&&!N&&(0,s.jsx)(`div`,{className:`mb-4 rounded-md border border-emerald-500 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-400`,role:`status`,children:`Tags saved.`}),t[25]=N,t[26]=f,t[27]=I):I=t[27];let L;t[28]===h.length?L=t[29]:(L=h.length===0&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tags.`}),t[28]=h.length,t[29]=L);let R;if(t[30]!==h){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsx)(a,{"aria-label":`Tag key`,onChange:t=>y(e.id,{key:t.target.value}),placeholder:`Key`,value:e.key}),(0,s.jsx)(a,{"aria-label":`Tag value`,onChange:t=>y(e.id,{value:t.target.value}),placeholder:`Value`,value:e.value}),(0,s.jsx)(i,{"aria-label":`Remove tag`,onClick:()=>C(e.id),size:`icon`,type:`button`,variant:`ghost`,children:(0,s.jsx)(te,{className:`size-4`})})]},e.id),t[32]=e):e=t[32],R=h.map(e),t[30]=h,t[31]=R}else R=t[31];let z;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,s.jsx)(ee,{className:`size-4`}),t[33]=z):z=t[33];let B;t[34]===x?B=t[35]:(B=(0,s.jsx)(`div`,{children:(0,s.jsxs)(i,{onClick:x,size:`sm`,type:`button`,variant:`secondary`,children:[z,` Add tag`]})}),t[34]=x,t[35]=B);let V;t[36]===D?V=t[37]:(V=D&&(0,s.jsx)(`p`,{className:`text-xs text-destructive`,children:`Every tag with a value needs a key.`}),t[36]=D,t[37]=V);let H;t[38]===O?H=t[39]:(H=O&&(0,s.jsx)(`p`,{className:`text-xs text-destructive`,children:`Tag keys must be unique.`}),t[38]=O,t[39]=H);let U;t[40]!==L||t[41]!==R||t[42]!==B||t[43]!==V||t[44]!==H?(U=(0,s.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[L,R,B,V,H]}),t[40]=L,t[41]=R,t[42]=B,t[43]=V,t[44]=H,t[45]=U):U=t[45];let W=N?`Unsaved changes`:`No changes`,G;t[46]===W?G=t[47]:(G=(0,s.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:W}),t[46]=W,t[47]=G);let K=l||!N,q;t[48]!==T||t[49]!==K?(q=(0,s.jsx)(i,{disabled:K,onClick:T,size:`sm`,type:`button`,variant:`secondary`,children:`Reset`}),t[48]=T,t[49]=K,t[50]=q):q=t[50];let J=l||k||!N,Y=l?`Saving…`:`Save changes`,X;t[51]!==J||t[52]!==Y?(X=(0,s.jsx)(i,{disabled:J,size:`sm`,type:`submit`,children:Y}),t[51]=J,t[52]=Y,t[53]=X):X=t[53];let Z;t[54]!==G||t[55]!==q||t[56]!==X?(Z=(0,s.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t p-4`,children:[G,q,X]}),t[54]=G,t[55]=q,t[56]=X,t[57]=Z):Z=t[57];let Q;t[58]!==U||t[59]!==Z?(Q=(0,s.jsxs)(`div`,{className:`rounded-lg border bg-card`,children:[U,Z]}),t[58]=U,t[59]=Z,t[60]=Q):Q=t[60];let $;return t[61]!==F||t[62]!==I||t[63]!==Q||t[64]!==P?($=(0,s.jsxs)(`form`,{onSubmit:P,children:[F,I,Q]}),t[61]=F,t[62]=I,t[63]=Q,t[64]=P,t[65]=$):$=t[65],$}function ie(e){return e.key}function u(e){return e.key.trim().length===0&&e.value.length>0}function ae(e){return e+1}export{l as t}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as ee}from"./plus.js";import{t as te}from"./trash-2.js";import{t as i}from"./button.js";import{t as a}from"./input.js";var ne=r(),o=e(n(),1),s=t();function re(e){return e.map((e,t)=>({id:t,key:e.Key??``,value:e.Value??``}))}function c(e){return e.map(e=>({key:e.key.trim(),value:e.value})).filter(e=>e.key.length>0)}function l(e){let t=(0,ne.c)(66),{tags:n,onSubmit:r,isPending:l,error:d,isSuccess:f}=e,p;t[0]===n?p=t[1]:(p=re(n),t[0]=n,t[1]=p);let m=p,[h,g]=(0,o.useState)(m),[_,oe]=(0,o.useState)(m.length),v;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(v=(e,t)=>{g(n=>n.map(n=>n.id===e?{...n,...t}:n))},t[2]=v):v=t[2];let y=v,b;t[3]===_?b=t[4]:(b=()=>{g(e=>[...e,{id:_,key:``,value:``}]),oe(ae)},t[3]=_,t[4]=b);let x=b,S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{g(t=>t.filter(t=>t.id!==e))},t[5]=S):S=t[5];let C=S,w;t[6]===m?w=t[7]:(w=()=>{g(m)},t[6]=m,t[7]=w);let T=w,E;t[8]===h?E=t[9]:(E=h.some(u),t[8]=h,t[9]=E);let D=E,O,k,A,j;if(t[10]!==D||t[11]!==h){A=c(h);let e=A.map(ie);O=new Set(e).size!==e.length,k=D||O,j=JSON.stringify(A),t[10]=D,t[11]=h,t[12]=O,t[13]=k,t[14]=A,t[15]=j}else O=t[12],k=t[13],A=t[14],j=t[15];let M;t[16]===m?M=t[17]:(M=JSON.stringify(c(m)),t[16]=m,t[17]=M);let N=j!==M,P;t[18]!==N||t[19]!==k||t[20]!==A||t[21]!==r?(P=e=>{e.preventDefault(),!(k||!N)&&r(A)},t[18]=N,t[19]=k,t[20]=A,t[21]=r,t[22]=P):P=t[22];let F;t[23]===d?F=t[24]:(F=d&&(0,s.jsx)(`div`,{className:`mb-4 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive`,role:`alert`,children:d.message||`Failed to save tags`}),t[23]=d,t[24]=F);let I;t[25]!==N||t[26]!==f?(I=f&&!N&&(0,s.jsx)(`div`,{className:`mb-4 rounded-md border border-emerald-500 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-400`,role:`status`,children:`Tags saved.`}),t[25]=N,t[26]=f,t[27]=I):I=t[27];let L;t[28]===h.length?L=t[29]:(L=h.length===0&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tags.`}),t[28]=h.length,t[29]=L);let R;if(t[30]!==h){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsx)(a,{"aria-label":`Tag key`,onChange:t=>{y(e.id,{key:t.target.value})},placeholder:`Key`,value:e.key}),(0,s.jsx)(a,{"aria-label":`Tag value`,onChange:t=>{y(e.id,{value:t.target.value})},placeholder:`Value`,value:e.value}),(0,s.jsx)(i,{"aria-label":`Remove tag`,onClick:()=>{C(e.id)},size:`icon`,type:`button`,variant:`ghost`,children:(0,s.jsx)(te,{className:`size-4`})})]},e.id),t[32]=e):e=t[32],R=h.map(e),t[30]=h,t[31]=R}else R=t[31];let z;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,s.jsx)(ee,{className:`size-4`}),t[33]=z):z=t[33];let B;t[34]===x?B=t[35]:(B=(0,s.jsx)(`div`,{children:(0,s.jsxs)(i,{onClick:x,size:`sm`,type:`button`,variant:`secondary`,children:[z,` Add tag`]})}),t[34]=x,t[35]=B);let V;t[36]===D?V=t[37]:(V=D&&(0,s.jsx)(`p`,{className:`text-xs text-destructive`,children:`Every tag with a value needs a key.`}),t[36]=D,t[37]=V);let H;t[38]===O?H=t[39]:(H=O&&(0,s.jsx)(`p`,{className:`text-xs text-destructive`,children:`Tag keys must be unique.`}),t[38]=O,t[39]=H);let U;t[40]!==L||t[41]!==R||t[42]!==B||t[43]!==V||t[44]!==H?(U=(0,s.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[L,R,B,V,H]}),t[40]=L,t[41]=R,t[42]=B,t[43]=V,t[44]=H,t[45]=U):U=t[45];let W=N?`Unsaved changes`:`No changes`,G;t[46]===W?G=t[47]:(G=(0,s.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:W}),t[46]=W,t[47]=G);let K=l||!N,q;t[48]!==T||t[49]!==K?(q=(0,s.jsx)(i,{disabled:K,onClick:T,size:`sm`,type:`button`,variant:`secondary`,children:`Reset`}),t[48]=T,t[49]=K,t[50]=q):q=t[50];let J=l||k||!N,Y=l?`Saving…`:`Save changes`,X;t[51]!==J||t[52]!==Y?(X=(0,s.jsx)(i,{disabled:J,size:`sm`,type:`submit`,children:Y}),t[51]=J,t[52]=Y,t[53]=X):X=t[53];let Z;t[54]!==G||t[55]!==q||t[56]!==X?(Z=(0,s.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t p-4`,children:[G,q,X]}),t[54]=G,t[55]=q,t[56]=X,t[57]=Z):Z=t[57];let Q;t[58]!==U||t[59]!==Z?(Q=(0,s.jsxs)(`div`,{className:`rounded-lg border bg-card`,children:[U,Z]}),t[58]=U,t[59]=Z,t[60]=Q):Q=t[60];let $;return t[61]!==F||t[62]!==I||t[63]!==Q||t[64]!==P?($=(0,s.jsxs)(`form`,{onSubmit:P,children:[F,I,Q]}),t[61]=F,t[62]=I,t[63]=Q,t[64]=P,t[65]=$):$=t[65],$}function ie(e){return e.key}function u(e){return e.key.trim().length===0&&e.value.length>0}function ae(e){return e+1}export{l as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/tags-field-array.js b/spinifex/services/spinifexui/frontend/dist/assets/tags-field-array.js index 3ea4462c1..0ec6c614e 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/tags-field-array.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/tags-field-array.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./plus.js";import{t as r}from"./trash-2.js";import{t as i}from"./button.js";import{t as a}from"./input.js";import{n as o,r as s}from"./zod.js";import{a as c,r as l,t as u}from"./field.js";var d=t(),f=e();function p(e){let t=(0,d.c)(21),{control:a,name:l}=e,p;t[0]!==a||t[1]!==l?(p={control:a,name:l},t[0]=a,t[1]=l,t[2]=p):p=t[2];let{fields:g,append:_,remove:v}=s(p),y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,f.jsx)(c,{children:`Tags`}),t[3]=y):y=t[3];let b;if(t[4]!==a||t[5]!==g||t[6]!==l||t[7]!==v){let e;t[9]!==a||t[10]!==l||t[11]!==v?(e=(e,t)=>(0,f.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,f.jsx)(o,{control:a,name:`${l}.${t}.key`,render:h}),(0,f.jsx)(o,{control:a,name:`${l}.${t}.value`,render:m}),(0,f.jsx)(i,{"aria-label":`Remove tag ${t+1}`,onClick:()=>v(t),size:`icon`,type:`button`,variant:`ghost`,children:(0,f.jsx)(r,{className:`size-3.5`})})]},e.id),t[9]=a,t[10]=l,t[11]=v,t[12]=e):e=t[12],b=g.map(e),t[4]=a,t[5]=g,t[6]=l,t[7]=v,t[8]=b}else b=t[8];let x;t[13]===_?x=t[14]:(x=()=>_({key:``,value:``}),t[13]=_,t[14]=x);let S;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,f.jsx)(n,{className:`size-3.5`}),t[15]=S):S=t[15];let C;t[16]===x?C=t[17]:(C=(0,f.jsxs)(i,{onClick:x,size:`sm`,type:`button`,variant:`outline`,children:[S,`Add Tag`]}),t[16]=x,t[17]=C);let w;return t[18]!==b||t[19]!==C?(w=(0,f.jsxs)(u,{children:[y,(0,f.jsxs)(`div`,{className:`space-y-2`,children:[b,C]})]}),t[18]=b,t[19]=C,t[20]=w):w=t[20],w}function m(e){let{field:t,fieldState:n}=e;return(0,f.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,f.jsx)(a,{"aria-invalid":!!n.error,placeholder:`Value`,...t}),(0,f.jsx)(l,{errors:[n.error]})]})}function h(e){let{field:t,fieldState:n}=e;return(0,f.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,f.jsx)(a,{"aria-invalid":!!n.error,placeholder:`Key`,...t}),(0,f.jsx)(l,{errors:[n.error]})]})}export{p as t}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./plus.js";import{t as r}from"./trash-2.js";import{t as i}from"./button.js";import{t as a}from"./input.js";import{n as o,r as s}from"./zod.js";import{a as c,r as l,t as u}from"./field.js";var d=t(),f=e();function p(e){let t=(0,d.c)(21),{control:a,name:l}=e,p;t[0]!==a||t[1]!==l?(p={control:a,name:l},t[0]=a,t[1]=l,t[2]=p):p=t[2];let{fields:g,append:_,remove:v}=s(p),y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,f.jsx)(c,{children:`Tags`}),t[3]=y):y=t[3];let b;if(t[4]!==a||t[5]!==g||t[6]!==l||t[7]!==v){let e;t[9]!==a||t[10]!==l||t[11]!==v?(e=(e,t)=>(0,f.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,f.jsx)(o,{control:a,name:`${l}.${t}.key`,render:h}),(0,f.jsx)(o,{control:a,name:`${l}.${t}.value`,render:m}),(0,f.jsx)(i,{"aria-label":`Remove tag ${t+1}`,onClick:()=>{v(t)},size:`icon`,type:`button`,variant:`ghost`,children:(0,f.jsx)(r,{className:`size-3.5`})})]},e.id),t[9]=a,t[10]=l,t[11]=v,t[12]=e):e=t[12],b=g.map(e),t[4]=a,t[5]=g,t[6]=l,t[7]=v,t[8]=b}else b=t[8];let x;t[13]===_?x=t[14]:(x=()=>{_({key:``,value:``})},t[13]=_,t[14]=x);let S;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,f.jsx)(n,{className:`size-3.5`}),t[15]=S):S=t[15];let C;t[16]===x?C=t[17]:(C=(0,f.jsxs)(i,{onClick:x,size:`sm`,type:`button`,variant:`outline`,children:[S,`Add Tag`]}),t[16]=x,t[17]=C);let w;return t[18]!==b||t[19]!==C?(w=(0,f.jsxs)(u,{children:[y,(0,f.jsxs)(`div`,{className:`space-y-2`,children:[b,C]})]}),t[18]=b,t[19]=C,t[20]=w):w=t[20],w}function m(e){let{field:t,fieldState:n}=e;return(0,f.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,f.jsx)(a,{"aria-invalid":!!n.error,placeholder:`Value`,...t}),(0,f.jsx)(l,{errors:[n.error]})]})}function h(e){let{field:t,fieldState:n}=e;return(0,f.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,f.jsx)(a,{"aria-invalid":!!n.error,placeholder:`Key`,...t}),(0,f.jsx)(l,{errors:[n.error]})]})}export{p as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/target-group-form.js b/spinifex/services/spinifexui/frontend/dist/assets/target-group-form.js index b95b60694..ad9ebf8ff 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/target-group-form.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/target-group-form.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{nn as ee}from"./cluster-config.js";import{c as te,i as n,n as ne,s as re,t as ie}from"./select.js";import{t as r}from"./input.js";import{a as ae,n as oe}from"./zod.js";import{a as i,r as a,t as o}from"./field.js";import{n as se,r as ce,t as le}from"./collapsible.js";import{t as ue}from"./tags-field-array.js";var de=t(),s=e(),fe=[`HTTP`,`HTTPS`,`TCP`,`UDP`,`TLS`,`TCP_UDP`];function pe(e){let t=(0,de.c)(126),{form:ee,vpcs:n,allowedProtocols:pe}=e,ge=pe===void 0?fe:pe,{control:c,register:l,setValue:u,formState:_e}=ee,{errors:d}=_e,ve;t[0]===c?ve=t[1]:(ve={control:c,name:`protocol`},t[0]=c,t[1]=ve);let ye=ae(ve),f=ye===`HTTP`||ye===`HTTPS`,be;t[2]===u?be=t[3]:(be=e=>{e&&(u(`protocol`,e),u(`healthCheck.protocol`,e===`HTTP`||e===`HTTPS`?`HTTP`:`TCP`))},t[2]=u,t[3]=be);let xe=be,Se;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`tg-name`,children:`Name`})}),t[4]=Se):Se=t[4];let Ce=!!d.name,p;t[5]===l?p=t[6]:(p=l(`name`),t[5]=l,t[6]=p);let m;t[7]!==Ce||t[8]!==p?(m=(0,s.jsx)(r,{"aria-invalid":Ce,id:`tg-name`,placeholder:`my-target-group`,...p}),t[7]=Ce,t[8]=p,t[9]=m):m=t[9];let h;t[10]===d.name?h=t[11]:(h=(0,s.jsx)(a,{errors:[d.name]}),t[10]=d.name,t[11]=h);let g;t[12]!==m||t[13]!==h?(g=(0,s.jsxs)(o,{children:[Se,m,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14];let we;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`tg-protocol`,children:`Protocol`})}),t[15]=we):we=t[15];let _;t[16]!==ge||t[17]!==xe?(_=e=>{let{field:t}=e;return(0,s.jsxs)(ie,{onValueChange:xe,value:t.value,children:[(0,s.jsx)(re,{className:`w-full`,id:`tg-protocol`,children:(0,s.jsx)(te,{})}),(0,s.jsx)(ne,{children:ge.map(he)})]})},t[16]=ge,t[17]=xe,t[18]=_):_=t[18];let v;t[19]!==c||t[20]!==_?(v=(0,s.jsxs)(o,{children:[we,(0,s.jsx)(oe,{control:c,name:`protocol`,render:_})]}),t[19]=c,t[20]=_,t[21]=v):v=t[21];let Te;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`tg-port`,children:`Port`})}),t[22]=Te):Te=t[22];let Ee=!!d.port,y;t[23]===l?y=t[24]:(y=l(`port`,{valueAsNumber:!0}),t[23]=l,t[24]=y);let b;t[25]!==Ee||t[26]!==y?(b=(0,s.jsx)(r,{"aria-invalid":Ee,id:`tg-port`,inputMode:`numeric`,placeholder:`80`,type:`number`,...y}),t[25]=Ee,t[26]=y,t[27]=b):b=t[27];let x;t[28]===d.port?x=t[29]:(x=(0,s.jsx)(a,{errors:[d.port]}),t[28]=d.port,t[29]=x);let S;t[30]!==b||t[31]!==x?(S=(0,s.jsxs)(o,{children:[Te,b,x]}),t[30]=b,t[31]=x,t[32]=S):S=t[32];let De;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`tg-vpc`,children:`VPC`})}),t[33]=De):De=t[33];let C;t[34]!==d.vpcId||t[35]!==n?(C=e=>{let{field:t}=e;return(0,s.jsxs)(ie,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,s.jsx)(re,{"aria-invalid":!!d.vpcId,className:`w-full`,id:`tg-vpc`,children:(0,s.jsx)(te,{placeholder:`Select VPC`})}),(0,s.jsx)(ne,{children:n.map(me)})]})},t[34]=d.vpcId,t[35]=n,t[36]=C):C=t[36];let w;t[37]!==c||t[38]!==C?(w=(0,s.jsx)(oe,{control:c,name:`vpcId`,render:C}),t[37]=c,t[38]=C,t[39]=w):w=t[39];let T;t[40]===d.vpcId?T=t[41]:(T=(0,s.jsx)(a,{errors:[d.vpcId]}),t[40]=d.vpcId,t[41]=T);let E;t[42]!==w||t[43]!==T?(E=(0,s.jsxs)(o,{children:[De,w,T]}),t[42]=w,t[43]=T,t[44]=E):E=t[44];let D;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,s.jsx)(ce,{className:`text-left text-sm font-medium text-muted-foreground hover:text-foreground`,render:(0,s.jsx)(`button`,{"aria-label":`Health check settings`,type:`button`}),children:`Health check settings`}),t[45]=D):D=t[45];let O;t[46]!==d.healthCheck?.path||t[47]!==f||t[48]!==l?(O=f&&(0,s.jsxs)(o,{children:[(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-path`,children:`Path`})}),(0,s.jsx)(r,{"aria-invalid":!!d.healthCheck?.path,id:`hc-path`,placeholder:`/`,...l(`healthCheck.path`)}),(0,s.jsx)(a,{errors:[d.healthCheck?.path]})]}),t[46]=d.healthCheck?.path,t[47]=f,t[48]=l,t[49]=O):O=t[49];let k;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-port`,children:`Port`})}),t[50]=k):k=t[50];let Oe=!!d.healthCheck?.port,A;t[51]===l?A=t[52]:(A=l(`healthCheck.port`),t[51]=l,t[52]=A);let j;t[53]!==Oe||t[54]!==A?(j=(0,s.jsx)(r,{"aria-invalid":Oe,id:`hc-port`,placeholder:`traffic-port or numeric`,...A}),t[53]=Oe,t[54]=A,t[55]=j):j=t[55];let ke=d.healthCheck?.port,M;t[56]===ke?M=t[57]:(M=(0,s.jsx)(a,{errors:[ke]}),t[56]=ke,t[57]=M);let N;t[58]!==j||t[59]!==M?(N=(0,s.jsxs)(o,{children:[k,j,M]}),t[58]=j,t[59]=M,t[60]=N):N=t[60];let Ae;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-interval`,children:`Interval (seconds)`})}),t[61]=Ae):Ae=t[61];let je=!!d.healthCheck?.intervalSeconds,P;t[62]===l?P=t[63]:(P=l(`healthCheck.intervalSeconds`,{valueAsNumber:!0}),t[62]=l,t[63]=P);let F;t[64]!==je||t[65]!==P?(F=(0,s.jsx)(r,{"aria-invalid":je,id:`hc-interval`,inputMode:`numeric`,type:`number`,...P}),t[64]=je,t[65]=P,t[66]=F):F=t[66];let Me=d.healthCheck?.intervalSeconds,I;t[67]===Me?I=t[68]:(I=(0,s.jsx)(a,{errors:[Me]}),t[67]=Me,t[68]=I);let L;t[69]!==F||t[70]!==I?(L=(0,s.jsxs)(o,{children:[Ae,F,I]}),t[69]=F,t[70]=I,t[71]=L):L=t[71];let Ne;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-timeout`,children:`Timeout (seconds)`})}),t[72]=Ne):Ne=t[72];let Pe=!!d.healthCheck?.timeoutSeconds,R;t[73]===l?R=t[74]:(R=l(`healthCheck.timeoutSeconds`,{valueAsNumber:!0}),t[73]=l,t[74]=R);let z;t[75]!==Pe||t[76]!==R?(z=(0,s.jsx)(r,{"aria-invalid":Pe,id:`hc-timeout`,inputMode:`numeric`,type:`number`,...R}),t[75]=Pe,t[76]=R,t[77]=z):z=t[77];let Fe=d.healthCheck?.timeoutSeconds,B;t[78]===Fe?B=t[79]:(B=(0,s.jsx)(a,{errors:[Fe]}),t[78]=Fe,t[79]=B);let V;t[80]!==z||t[81]!==B?(V=(0,s.jsxs)(o,{children:[Ne,z,B]}),t[80]=z,t[81]=B,t[82]=V):V=t[82];let Ie;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-healthy`,children:`Healthy threshold`})}),t[83]=Ie):Ie=t[83];let Le=!!d.healthCheck?.healthyThresholdCount,H;t[84]===l?H=t[85]:(H=l(`healthCheck.healthyThresholdCount`,{valueAsNumber:!0}),t[84]=l,t[85]=H);let U;t[86]!==Le||t[87]!==H?(U=(0,s.jsx)(r,{"aria-invalid":Le,id:`hc-healthy`,inputMode:`numeric`,type:`number`,...H}),t[86]=Le,t[87]=H,t[88]=U):U=t[88];let Re=d.healthCheck?.healthyThresholdCount,W;t[89]===Re?W=t[90]:(W=(0,s.jsx)(a,{errors:[Re]}),t[89]=Re,t[90]=W);let G;t[91]!==U||t[92]!==W?(G=(0,s.jsxs)(o,{children:[Ie,U,W]}),t[91]=U,t[92]=W,t[93]=G):G=t[93];let ze;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-unhealthy`,children:`Unhealthy threshold`})}),t[94]=ze):ze=t[94];let Be=!!d.healthCheck?.unhealthyThresholdCount,K;t[95]===l?K=t[96]:(K=l(`healthCheck.unhealthyThresholdCount`,{valueAsNumber:!0}),t[95]=l,t[96]=K);let q;t[97]!==Be||t[98]!==K?(q=(0,s.jsx)(r,{"aria-invalid":Be,id:`hc-unhealthy`,inputMode:`numeric`,type:`number`,...K}),t[97]=Be,t[98]=K,t[99]=q):q=t[99];let Ve=d.healthCheck?.unhealthyThresholdCount,J;t[100]===Ve?J=t[101]:(J=(0,s.jsx)(a,{errors:[Ve]}),t[100]=Ve,t[101]=J);let Y;t[102]!==q||t[103]!==J?(Y=(0,s.jsxs)(o,{children:[ze,q,J]}),t[102]=q,t[103]=J,t[104]=Y):Y=t[104];let X;t[105]!==d.healthCheck?.matcher||t[106]!==f||t[107]!==l?(X=f&&(0,s.jsxs)(o,{children:[(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-matcher`,children:`Matcher (HTTP codes)`})}),(0,s.jsx)(r,{"aria-invalid":!!d.healthCheck?.matcher,id:`hc-matcher`,placeholder:`200 or 200-299 or 200,201`,...l(`healthCheck.matcher`)}),(0,s.jsx)(a,{errors:[d.healthCheck?.matcher]})]}),t[105]=d.healthCheck?.matcher,t[106]=f,t[107]=l,t[108]=X):X=t[108];let Z;t[109]!==O||t[110]!==N||t[111]!==L||t[112]!==V||t[113]!==G||t[114]!==Y||t[115]!==X?(Z=(0,s.jsxs)(le,{children:[D,(0,s.jsxs)(se,{className:`mt-3 space-y-4 border-l-2 border-muted pl-4`,children:[O,N,L,V,G,Y,X]})]}),t[109]=O,t[110]=N,t[111]=L,t[112]=V,t[113]=G,t[114]=Y,t[115]=X,t[116]=Z):Z=t[116];let Q;t[117]===c?Q=t[118]:(Q=(0,s.jsx)(ue,{control:c,name:`tags`}),t[117]=c,t[118]=Q);let $;return t[119]!==g||t[120]!==v||t[121]!==S||t[122]!==E||t[123]!==Z||t[124]!==Q?($=(0,s.jsxs)(s.Fragment,{children:[g,v,S,E,Z,Q]}),t[119]=g,t[120]=v,t[121]=S,t[122]=E,t[123]=Z,t[124]=Q,t[125]=$):$=t[125],$}function me(e){let t=ee(e.Tags);return(0,s.jsx)(n,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function he(e){return(0,s.jsx)(n,{value:e,children:e},e)}export{pe as t}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{nn as ee}from"./cluster-config.js";import{c as te,i as n,n as ne,s as re,t as ie}from"./select.js";import{t as r}from"./input.js";import{a as ae,n as oe}from"./zod.js";import{a as i,r as a,t as o}from"./field.js";import{n as se,r as ce,t as le}from"./collapsible.js";import{t as ue}from"./tags-field-array.js";var de=t(),s=e(),fe=[`HTTP`,`HTTPS`,`TCP`,`UDP`,`TLS`,`TCP_UDP`];function pe(e){let t=(0,de.c)(126),{form:ee,vpcs:n,allowedProtocols:pe}=e,ge=pe===void 0?fe:pe,{control:c,register:l,setValue:u,formState:_e}=ee,{errors:d}=_e,ve;t[0]===c?ve=t[1]:(ve={control:c,name:`protocol`},t[0]=c,t[1]=ve);let ye=ae(ve),f=ye===`HTTP`||ye===`HTTPS`,be;t[2]===u?be=t[3]:(be=e=>{e&&(u(`protocol`,e),u(`healthCheck.protocol`,e===`HTTP`||e===`HTTPS`?`HTTP`:`TCP`))},t[2]=u,t[3]=be);let xe=be,Se;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`tg-name`,children:`Name`})}),t[4]=Se):Se=t[4];let Ce=!!d.name,p;t[5]===l?p=t[6]:(p=l(`name`),t[5]=l,t[6]=p);let m;t[7]!==Ce||t[8]!==p?(m=(0,s.jsx)(r,{"aria-invalid":Ce,id:`tg-name`,placeholder:`my-target-group`,...p}),t[7]=Ce,t[8]=p,t[9]=m):m=t[9];let h;t[10]===d.name?h=t[11]:(h=(0,s.jsx)(a,{errors:[d.name]}),t[10]=d.name,t[11]=h);let g;t[12]!==m||t[13]!==h?(g=(0,s.jsxs)(o,{children:[Se,m,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14];let we;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`tg-protocol`,children:`Protocol`})}),t[15]=we):we=t[15];let _;t[16]!==ge||t[17]!==xe?(_=e=>{let{field:t}=e;return(0,s.jsxs)(ie,{onValueChange:xe,value:t.value,children:[(0,s.jsx)(re,{className:`w-full`,id:`tg-protocol`,children:(0,s.jsx)(te,{})}),(0,s.jsx)(ne,{children:ge.map(he)})]})},t[16]=ge,t[17]=xe,t[18]=_):_=t[18];let v;t[19]!==c||t[20]!==_?(v=(0,s.jsxs)(o,{children:[we,(0,s.jsx)(oe,{control:c,name:`protocol`,render:_})]}),t[19]=c,t[20]=_,t[21]=v):v=t[21];let Te;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`tg-port`,children:`Port`})}),t[22]=Te):Te=t[22];let Ee=!!d.port,y;t[23]===l?y=t[24]:(y=l(`port`,{valueAsNumber:!0}),t[23]=l,t[24]=y);let b;t[25]!==Ee||t[26]!==y?(b=(0,s.jsx)(r,{"aria-invalid":Ee,id:`tg-port`,inputMode:`numeric`,placeholder:`80`,type:`number`,...y}),t[25]=Ee,t[26]=y,t[27]=b):b=t[27];let x;t[28]===d.port?x=t[29]:(x=(0,s.jsx)(a,{errors:[d.port]}),t[28]=d.port,t[29]=x);let S;t[30]!==b||t[31]!==x?(S=(0,s.jsxs)(o,{children:[Te,b,x]}),t[30]=b,t[31]=x,t[32]=S):S=t[32];let De;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`tg-vpc`,children:`VPC`})}),t[33]=De):De=t[33];let C;t[34]!==d.vpcId||t[35]!==n?(C=e=>{let{field:t}=e;return(0,s.jsxs)(ie,{onValueChange:e=>{t.onChange(e)},value:t.value??``,children:[(0,s.jsx)(re,{"aria-invalid":!!d.vpcId,className:`w-full`,id:`tg-vpc`,children:(0,s.jsx)(te,{placeholder:`Select VPC`})}),(0,s.jsx)(ne,{children:n.map(me)})]})},t[34]=d.vpcId,t[35]=n,t[36]=C):C=t[36];let w;t[37]!==c||t[38]!==C?(w=(0,s.jsx)(oe,{control:c,name:`vpcId`,render:C}),t[37]=c,t[38]=C,t[39]=w):w=t[39];let T;t[40]===d.vpcId?T=t[41]:(T=(0,s.jsx)(a,{errors:[d.vpcId]}),t[40]=d.vpcId,t[41]=T);let E;t[42]!==w||t[43]!==T?(E=(0,s.jsxs)(o,{children:[De,w,T]}),t[42]=w,t[43]=T,t[44]=E):E=t[44];let D;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,s.jsx)(ce,{className:`text-left text-sm font-medium text-muted-foreground hover:text-foreground`,render:(0,s.jsx)(`button`,{"aria-label":`Health check settings`,type:`button`}),children:`Health check settings`}),t[45]=D):D=t[45];let O;t[46]!==d.healthCheck?.path||t[47]!==f||t[48]!==l?(O=f&&(0,s.jsxs)(o,{children:[(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-path`,children:`Path`})}),(0,s.jsx)(r,{"aria-invalid":!!d.healthCheck?.path,id:`hc-path`,placeholder:`/`,...l(`healthCheck.path`)}),(0,s.jsx)(a,{errors:[d.healthCheck?.path]})]}),t[46]=d.healthCheck?.path,t[47]=f,t[48]=l,t[49]=O):O=t[49];let k;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-port`,children:`Port`})}),t[50]=k):k=t[50];let Oe=!!d.healthCheck?.port,A;t[51]===l?A=t[52]:(A=l(`healthCheck.port`),t[51]=l,t[52]=A);let j;t[53]!==Oe||t[54]!==A?(j=(0,s.jsx)(r,{"aria-invalid":Oe,id:`hc-port`,placeholder:`traffic-port or numeric`,...A}),t[53]=Oe,t[54]=A,t[55]=j):j=t[55];let ke=d.healthCheck?.port,M;t[56]===ke?M=t[57]:(M=(0,s.jsx)(a,{errors:[ke]}),t[56]=ke,t[57]=M);let N;t[58]!==j||t[59]!==M?(N=(0,s.jsxs)(o,{children:[k,j,M]}),t[58]=j,t[59]=M,t[60]=N):N=t[60];let Ae;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-interval`,children:`Interval (seconds)`})}),t[61]=Ae):Ae=t[61];let je=!!d.healthCheck?.intervalSeconds,P;t[62]===l?P=t[63]:(P=l(`healthCheck.intervalSeconds`,{valueAsNumber:!0}),t[62]=l,t[63]=P);let F;t[64]!==je||t[65]!==P?(F=(0,s.jsx)(r,{"aria-invalid":je,id:`hc-interval`,inputMode:`numeric`,type:`number`,...P}),t[64]=je,t[65]=P,t[66]=F):F=t[66];let Me=d.healthCheck?.intervalSeconds,I;t[67]===Me?I=t[68]:(I=(0,s.jsx)(a,{errors:[Me]}),t[67]=Me,t[68]=I);let L;t[69]!==F||t[70]!==I?(L=(0,s.jsxs)(o,{children:[Ae,F,I]}),t[69]=F,t[70]=I,t[71]=L):L=t[71];let Ne;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-timeout`,children:`Timeout (seconds)`})}),t[72]=Ne):Ne=t[72];let Pe=!!d.healthCheck?.timeoutSeconds,R;t[73]===l?R=t[74]:(R=l(`healthCheck.timeoutSeconds`,{valueAsNumber:!0}),t[73]=l,t[74]=R);let z;t[75]!==Pe||t[76]!==R?(z=(0,s.jsx)(r,{"aria-invalid":Pe,id:`hc-timeout`,inputMode:`numeric`,type:`number`,...R}),t[75]=Pe,t[76]=R,t[77]=z):z=t[77];let Fe=d.healthCheck?.timeoutSeconds,B;t[78]===Fe?B=t[79]:(B=(0,s.jsx)(a,{errors:[Fe]}),t[78]=Fe,t[79]=B);let V;t[80]!==z||t[81]!==B?(V=(0,s.jsxs)(o,{children:[Ne,z,B]}),t[80]=z,t[81]=B,t[82]=V):V=t[82];let Ie;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-healthy`,children:`Healthy threshold`})}),t[83]=Ie):Ie=t[83];let Le=!!d.healthCheck?.healthyThresholdCount,H;t[84]===l?H=t[85]:(H=l(`healthCheck.healthyThresholdCount`,{valueAsNumber:!0}),t[84]=l,t[85]=H);let U;t[86]!==Le||t[87]!==H?(U=(0,s.jsx)(r,{"aria-invalid":Le,id:`hc-healthy`,inputMode:`numeric`,type:`number`,...H}),t[86]=Le,t[87]=H,t[88]=U):U=t[88];let Re=d.healthCheck?.healthyThresholdCount,W;t[89]===Re?W=t[90]:(W=(0,s.jsx)(a,{errors:[Re]}),t[89]=Re,t[90]=W);let G;t[91]!==U||t[92]!==W?(G=(0,s.jsxs)(o,{children:[Ie,U,W]}),t[91]=U,t[92]=W,t[93]=G):G=t[93];let ze;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-unhealthy`,children:`Unhealthy threshold`})}),t[94]=ze):ze=t[94];let Be=!!d.healthCheck?.unhealthyThresholdCount,K;t[95]===l?K=t[96]:(K=l(`healthCheck.unhealthyThresholdCount`,{valueAsNumber:!0}),t[95]=l,t[96]=K);let q;t[97]!==Be||t[98]!==K?(q=(0,s.jsx)(r,{"aria-invalid":Be,id:`hc-unhealthy`,inputMode:`numeric`,type:`number`,...K}),t[97]=Be,t[98]=K,t[99]=q):q=t[99];let Ve=d.healthCheck?.unhealthyThresholdCount,J;t[100]===Ve?J=t[101]:(J=(0,s.jsx)(a,{errors:[Ve]}),t[100]=Ve,t[101]=J);let Y;t[102]!==q||t[103]!==J?(Y=(0,s.jsxs)(o,{children:[ze,q,J]}),t[102]=q,t[103]=J,t[104]=Y):Y=t[104];let X;t[105]!==d.healthCheck?.matcher||t[106]!==f||t[107]!==l?(X=f&&(0,s.jsxs)(o,{children:[(0,s.jsx)(i,{children:(0,s.jsx)(`label`,{htmlFor:`hc-matcher`,children:`Matcher (HTTP codes)`})}),(0,s.jsx)(r,{"aria-invalid":!!d.healthCheck?.matcher,id:`hc-matcher`,placeholder:`200 or 200-299 or 200,201`,...l(`healthCheck.matcher`)}),(0,s.jsx)(a,{errors:[d.healthCheck?.matcher]})]}),t[105]=d.healthCheck?.matcher,t[106]=f,t[107]=l,t[108]=X):X=t[108];let Z;t[109]!==O||t[110]!==N||t[111]!==L||t[112]!==V||t[113]!==G||t[114]!==Y||t[115]!==X?(Z=(0,s.jsxs)(le,{children:[D,(0,s.jsxs)(se,{className:`mt-3 space-y-4 border-l-2 border-muted pl-4`,children:[O,N,L,V,G,Y,X]})]}),t[109]=O,t[110]=N,t[111]=L,t[112]=V,t[113]=G,t[114]=Y,t[115]=X,t[116]=Z):Z=t[116];let Q;t[117]===c?Q=t[118]:(Q=(0,s.jsx)(ue,{control:c,name:`tags`}),t[117]=c,t[118]=Q);let $;return t[119]!==g||t[120]!==v||t[121]!==S||t[122]!==E||t[123]!==Z||t[124]!==Q?($=(0,s.jsxs)(s.Fragment,{children:[g,v,S,E,Z,Q]}),t[119]=g,t[120]=v,t[121]=S,t[122]=E,t[123]=Z,t[124]=Q,t[125]=$):$=t[125],$}function me(e){let t=ee(e.Tags);return(0,s.jsx)(n,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function he(e){return(0,s.jsx)(n,{value:e,children:e},e)}export{pe as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/task-definitions.js b/spinifex/services/spinifexui/frontend/dist/assets/task-definitions.js index 06e53a773..f2372b68b 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/task-definitions.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/task-definitions.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./button.js";import{o as s}from"./ecs.js";import{a as c}from"./ecs2.js";import{t as l}from"./error-banner.js";import{t as u}from"./page-heading.js";import{t as d}from"./delete-confirmation-dialog.js";import{t as f}from"./ecs-section-nav.js";var p=r(),m=e(n(),1),h=t();function g(e){return e.split(`/`).at(-1)??e}function _(e){let t=(0,p.c)(24),{clusterName:n}=e,{data:r}=i(s),u=c(),[f,_]=(0,m.useState)(null),v;t[0]!==u||t[1]!==f?(v=function(){f&&u.mutate(f,{onSuccess:()=>_(null)})},t[0]=u,t[1]=f,t[2]=v):v=t[2];let y=v,b=n??``,x;t[3]===b?x=t[4]:(x={cluster:b},t[3]=b,t[4]=x);let S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,h.jsx)(o,{size:`sm`,children:`Register task definition`}),t[5]=S):S=t[5];let C;t[6]===x?C=t[7]:(C=(0,h.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,h.jsx)(a,{search:x,to:`/ecs/register-task-definition`,children:S})}),t[6]=x,t[7]=C);let w;t[8]!==u.error||t[9]!==u.isError?(w=u.isError&&(0,h.jsx)(l,{error:u.error instanceof Error?u.error:void 0,msg:`Failed to deregister task definition.`}),t[8]=u.error,t[9]=u.isError,t[10]=w):w=t[10];let T;t[11]===r?T=t[12]:(T=r.length===0?(0,h.jsx)(`p`,{className:`text-muted-foreground`,children:`No task definitions found.`}):(0,h.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,h.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,h.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Family : Revision`}),(0,h.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,h.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,h.jsx)(`tbody`,{children:r.map(e=>{let t=g(e);return(0,h.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,h.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:t}),(0,h.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,h.jsx)(o,{onClick:()=>_(t),size:`sm`,variant:`destructive`,children:`Deregister`})})]},e)})})]})}),t[11]=r,t[12]=T);let E=`This marks task definition "${f}" INACTIVE. Existing tasks keep running; no new tasks can use it.`,D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>!e&&_(null),t[13]=D):D=t[13];let O=f!==null,k;t[14]!==u.isPending||t[15]!==y||t[16]!==O||t[17]!==E?(k=(0,h.jsx)(d,{confirmLabel:`Deregister`,description:E,isPending:u.isPending,onConfirm:y,onOpenChange:D,open:O,pendingLabel:`Deregistering…`,title:`Deregister task definition`}),t[14]=u.isPending,t[15]=y,t[16]=O,t[17]=E,t[18]=k):k=t[18];let A;return t[19]!==k||t[20]!==C||t[21]!==w||t[22]!==T?(A=(0,h.jsxs)(h.Fragment,{children:[C,w,T,k]}),t[19]=k,t[20]=C,t[21]=w,t[22]=T,t[23]=A):A=t[23],A}function v(){let e=(0,p.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(u,{title:`Task definitions`}),(0,h.jsx)(f,{}),(0,h.jsx)(_,{})]}),e[0]=t):t=e[0],t}var y=v;export{y as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./button.js";import{o as s}from"./ecs.js";import{a as c}from"./ecs2.js";import{t as l}from"./error-banner.js";import{t as u}from"./page-heading.js";import{t as d}from"./delete-confirmation-dialog.js";import{t as f}from"./ecs-section-nav.js";var p=r(),m=e(n(),1),h=t();function g(e){return e.split(`/`).at(-1)??e}function _(e){let t=(0,p.c)(24),{clusterName:n}=e,{data:r}=i(s),u=c(),[f,_]=(0,m.useState)(null),v;t[0]!==u||t[1]!==f?(v=function(){f&&u.mutate(f,{onSuccess:()=>{_(null)}})},t[0]=u,t[1]=f,t[2]=v):v=t[2];let y=v,b=n??``,x;t[3]===b?x=t[4]:(x={cluster:b},t[3]=b,t[4]=x);let S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,h.jsx)(o,{size:`sm`,children:`Register task definition`}),t[5]=S):S=t[5];let C;t[6]===x?C=t[7]:(C=(0,h.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,h.jsx)(a,{search:x,to:`/ecs/register-task-definition`,children:S})}),t[6]=x,t[7]=C);let w;t[8]!==u.error||t[9]!==u.isError?(w=u.isError&&(0,h.jsx)(l,{error:u.error instanceof Error?u.error:void 0,msg:`Failed to deregister task definition.`}),t[8]=u.error,t[9]=u.isError,t[10]=w):w=t[10];let T;t[11]===r?T=t[12]:(T=r.length===0?(0,h.jsx)(`p`,{className:`text-muted-foreground`,children:`No task definitions found.`}):(0,h.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,h.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,h.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Family : Revision`}),(0,h.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,h.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,h.jsx)(`tbody`,{children:r.map(e=>{let t=g(e);return(0,h.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,h.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:t}),(0,h.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,h.jsx)(o,{onClick:()=>{_(t)},size:`sm`,variant:`destructive`,children:`Deregister`})})]},e)})})]})}),t[11]=r,t[12]=T);let E=`This marks task definition "${f}" INACTIVE. Existing tasks keep running; no new tasks can use it.`,D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||_(null)},t[13]=D):D=t[13];let O=f!==null,k;t[14]!==u.isPending||t[15]!==y||t[16]!==O||t[17]!==E?(k=(0,h.jsx)(d,{confirmLabel:`Deregister`,description:E,isPending:u.isPending,onConfirm:y,onOpenChange:D,open:O,pendingLabel:`Deregistering…`,title:`Deregister task definition`}),t[14]=u.isPending,t[15]=y,t[16]=O,t[17]=E,t[18]=k):k=t[18];let A;return t[19]!==k||t[20]!==C||t[21]!==w||t[22]!==T?(A=(0,h.jsxs)(h.Fragment,{children:[C,w,T,k]}),t[19]=k,t[20]=C,t[21]=w,t[22]=T,t[23]=A):A=t[23],A}function v(){let e=(0,p.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(u,{title:`Task definitions`}),(0,h.jsx)(f,{}),(0,h.jsx)(_,{})]}),e[0]=t):t=e[0],t}var y=v;export{y as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/upload-button.js b/spinifex/services/spinifexui/frontend/dist/assets/upload-button.js index ca9b381d5..6aa98d6c8 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/upload-button.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/upload-button.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./link.js";import{$t as a,en as o}from"./cluster-config.js";import{t as s}from"./createLucideIcon.js";import{t as c}from"./download.js";import{t as l}from"./trash-2.js";import{t as u}from"./button.js";import{N as d,P as f,S as p,g as m,u as h}from"./awsClient.js";import{n as g}from"./s3.js";import{t as _}from"./error-banner.js";import{t as v}from"./delete-confirmation-dialog.js";var y=s(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),b=s(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),x=s(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),S=class extends f(p,d,`GetObject`,m){},C=r(),w=t();function T(e){let t=(0,C.c)(9),{folderName:n,fullPrefix:r,bucketName:a}=e,o;t[0]!==a||t[1]!==r?(o={bucket:a,_splat:r},t[0]=a,t[1]=r,t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,w.jsx)(b,{className:`size-5 text-muted-foreground`}),t[3]=s):s=t[3];let c;t[4]===n?c=t[5]:(c=(0,w.jsx)(`span`,{className:`font-medium`,children:n}),t[4]=n,t[5]=c);let l;return t[6]!==o||t[7]!==c?(l=(0,w.jsxs)(i,{className:`flex items-center gap-3 rounded-lg border bg-card p-4 transition-colors hover:bg-accent`,params:o,to:`/s3/ls/$bucket/$`,children:[s,c]}),t[6]=o,t[7]=c,t[8]=l):l=t[8],l}var E=e(n(),1);function D({object:e,bucketName:t,displayName:n,fullKey:r}){let[i,s]=(0,E.useState)(!1),[u,d]=(0,E.useState)(null),f=g();async function p(){d(null);try{let e=new S({Bucket:t,Key:r}),i=await h().send(e);if(i.Body){let e=await i.Body.transformToByteArray(),t=URL.createObjectURL(new Blob([e])),r=document.createElement(`a`);r.href=t,r.download=n,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(t)}}catch(e){d(Error(`Failed to download object`,{cause:e}))}}async function m(){try{await f.mutateAsync({bucket:t,key:r})}finally{s(!1)}}return(0,w.jsxs)(`div`,{children:[f.error&&(0,w.jsx)(_,{error:f.error,msg:`Failed to delete object`}),u&&(0,w.jsx)(_,{error:u,msg:`Failed to download object`}),(0,w.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border bg-card p-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,w.jsx)(y,{className:`size-5 text-muted-foreground`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{className:`font-medium`,children:n}),e.LastModified&&(0,w.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Last Modified: `,a(e.LastModified)]})]})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,w.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:o(e.Size??0)}),(0,w.jsx)(`button`,{"aria-label":`Download ${n}`,className:`rounded-md p-2 transition-colors hover:bg-accent`,onClick:p,type:`button`,children:(0,w.jsx)(c,{className:`size-4`})}),(0,w.jsx)(`button`,{"aria-label":`Delete ${n}`,className:`rounded-md p-2 text-destructive transition-colors hover:bg-accent`,onClick:()=>s(!0),type:`button`,children:(0,w.jsx)(l,{className:`size-4`})})]}),(0,w.jsx)(v,{description:(0,w.jsxs)(w.Fragment,{children:[`Are you sure you want to delete `,(0,w.jsx)(`strong`,{children:n}),`? This action cannot be undone.`]}),isPending:f.isPending,onConfirm:m,onOpenChange:s,open:i,title:`Delete Object`})]})]},e.Key)}function O({bucket:e,prefix:t=``,isPending:n,onUpload:r}){let i=(0,E.useRef)(null);async function a(n){let{files:a}=n.target;if(!(!a||a.length===0))try{await Promise.all([...a].map(async n=>await r({bucket:e,key:`${t}${n.name}`,file:n})))}finally{i.current&&(i.current.value=``)}}return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`input`,{accept:`*/*`,"aria-label":`Choose files to upload`,className:`hidden`,multiple:!0,onChange:a,ref:i,type:`file`}),(0,w.jsxs)(u,{disabled:n,onClick:()=>i.current?.click(),size:`sm`,children:[(0,w.jsx)(x,{className:`mr-2 size-4`}),n?`Uploading…`:`Upload Files`]})]})}export{D as n,T as r,O as t}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./link.js";import{$t as a,en as o}from"./cluster-config.js";import{t as s}from"./createLucideIcon.js";import{t as c}from"./download.js";import{t as l}from"./trash-2.js";import{t as u}from"./button.js";import{N as d,P as f,S as p,g as m,u as h}from"./awsClient.js";import{n as g}from"./s3.js";import{t as _}from"./error-banner.js";import{t as v}from"./delete-confirmation-dialog.js";var y=s(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),b=s(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),x=s(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),S=class extends f(p,d,`GetObject`,m){},C=r(),w=t();function T(e){let t=(0,C.c)(9),{folderName:n,fullPrefix:r,bucketName:a}=e,o;t[0]!==a||t[1]!==r?(o={bucket:a,_splat:r},t[0]=a,t[1]=r,t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,w.jsx)(b,{className:`size-5 text-muted-foreground`}),t[3]=s):s=t[3];let c;t[4]===n?c=t[5]:(c=(0,w.jsx)(`span`,{className:`font-medium`,children:n}),t[4]=n,t[5]=c);let l;return t[6]!==o||t[7]!==c?(l=(0,w.jsxs)(i,{className:`flex items-center gap-3 rounded-lg border bg-card p-4 transition-colors hover:bg-accent`,params:o,to:`/s3/ls/$bucket/$`,children:[s,c]}),t[6]=o,t[7]=c,t[8]=l):l=t[8],l}var E=e(n(),1);function D({object:e,bucketName:t,displayName:n,fullKey:r}){let[i,s]=(0,E.useState)(!1),[u,d]=(0,E.useState)(null),f=g();async function p(){d(null);try{let e=new S({Bucket:t,Key:r}),i=await h().send(e);if(i.Body){let e=await i.Body.transformToByteArray(),t=URL.createObjectURL(new Blob([e])),r=document.createElement(`a`);r.href=t,r.download=n,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(t)}}catch(e){d(Error(`Failed to download object`,{cause:e}))}}async function m(){try{await f.mutateAsync({bucket:t,key:r})}finally{s(!1)}}return(0,w.jsxs)(`div`,{children:[f.error&&(0,w.jsx)(_,{error:f.error,msg:`Failed to delete object`}),u&&(0,w.jsx)(_,{error:u,msg:`Failed to download object`}),(0,w.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border bg-card p-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,w.jsx)(y,{className:`size-5 text-muted-foreground`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{className:`font-medium`,children:n}),e.LastModified&&(0,w.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Last Modified: `,a(e.LastModified)]})]})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,w.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:o(e.Size??0)}),(0,w.jsx)(`button`,{"aria-label":`Download ${n}`,className:`rounded-md p-2 transition-colors hover:bg-accent`,onClick:p,type:`button`,children:(0,w.jsx)(c,{className:`size-4`})}),(0,w.jsx)(`button`,{"aria-label":`Delete ${n}`,className:`rounded-md p-2 text-destructive transition-colors hover:bg-accent`,onClick:()=>{s(!0)},type:`button`,children:(0,w.jsx)(l,{className:`size-4`})})]}),(0,w.jsx)(v,{description:(0,w.jsxs)(w.Fragment,{children:[`Are you sure you want to delete `,(0,w.jsx)(`strong`,{children:n}),`? This action cannot be undone.`]}),isPending:f.isPending,onConfirm:m,onOpenChange:s,open:i,title:`Delete Object`})]})]},e.Key)}function O({bucket:e,prefix:t=``,isPending:n,onUpload:r}){let i=(0,E.useRef)(null);async function a(n){let{files:a}=n.target;if(!(!a||a.length===0))try{await Promise.all([...a].map(async n=>await r({bucket:e,key:`${t}${n.name}`,file:n})))}finally{i.current&&(i.current.value=``)}}return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`input`,{accept:`*/*`,"aria-label":`Choose files to upload`,className:`hidden`,multiple:!0,onChange:a,ref:i,type:`file`}),(0,w.jsxs)(u,{disabled:n,onClick:()=>i.current?.click(),size:`sm`,children:[(0,w.jsx)(x,{className:`mr-2 size-4`}),n?`Uploading…`:`Upload Files`]})]})}export{D as n,T as r,O as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/use-copy-to-clipboard.js b/spinifex/services/spinifexui/frontend/dist/assets/use-copy-to-clipboard.js index 89fa59214..082185db5 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/use-copy-to-clipboard.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/use-copy-to-clipboard.js @@ -1 +1 @@ -import{a as e,r as t,t as n}from"./compiler-runtime.js";var r=n(),i=e(t(),1),a=2e3;function o(){let e=(0,r.c)(5),[t,n]=(0,i.useState)(!1),o=(0,i.useRef)(null),s,c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>()=>{o.current&&clearTimeout(o.current)},c=[],e[0]=s,e[1]=c):(s=e[0],c=e[1]),(0,i.useEffect)(s,c);let l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=async e=>{await navigator.clipboard.writeText(e),n(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>n(!1),a)},e[2]=l):l=e[2];let u=l,d;return e[3]===t?d=e[4]:(d={copied:t,copy:u},e[3]=t,e[4]=d),d}export{o as t}; \ No newline at end of file +import{a as e,r as t,t as n}from"./compiler-runtime.js";var r=n(),i=e(t(),1),a=2e3;function o(){let e=(0,r.c)(5),[t,n]=(0,i.useState)(!1),o=(0,i.useRef)(null),s,c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>()=>{o.current&&clearTimeout(o.current)},c=[],e[0]=s,e[1]=c):(s=e[0],c=e[1]),(0,i.useEffect)(s,c);let l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=async e=>{await navigator.clipboard.writeText(e),n(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{n(!1)},a)},e[2]=l):l=e[2];let u=l,d;return e[3]===t?d=e[4]:(d={copied:t,copy:u},e[3]=t,e[4]=d),d}export{o as t}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/oxlint.config.ts b/spinifex/services/spinifexui/frontend/oxlint.config.ts index 8ecdbafb9..64ab227cd 100644 --- a/spinifex/services/spinifexui/frontend/oxlint.config.ts +++ b/spinifex/services/spinifexui/frontend/oxlint.config.ts @@ -53,7 +53,6 @@ export default defineConfig({ "error", "react-you-might-not-need-an-effect/no-pass-data-to-parent": "error", "react-you-might-not-need-an-effect/no-pass-live-state-to-parent": "error", - "typescript/no-confusing-void-expression": "off", "typescript/no-floating-promises": [ "error", { diff --git a/spinifex/services/spinifexui/frontend/src/components/admin-dashboard-panel.tsx b/spinifex/services/spinifexui/frontend/src/components/admin-dashboard-panel.tsx index 6f409bb96..7554c00cd 100644 --- a/spinifex/services/spinifexui/frontend/src/components/admin-dashboard-panel.tsx +++ b/spinifex/services/spinifexui/frontend/src/components/admin-dashboard-panel.tsx @@ -162,7 +162,9 @@ export function AdminDashboardPanel() {