@visulima/vis 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/LICENSE.md +1 -130
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +1 -1
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +168 -170
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler54.js +1 -1
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler58.js +1 -1
- package/dist/packem_chunks/handler6.js +5 -5
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler64.js +2 -2
- package/dist/packem_chunks/handler67.js +1 -1
- package/dist/packem_chunks/handler69.js +1 -1
- package/dist/packem_chunks/handler70.js +1 -1
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +1 -1
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +1 -1
- package/dist/packem_chunks/handler76.js +1 -1
- package/dist/packem_chunks/handler77.js +40 -40
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_shared/{advisories-DZd1uGqa.js → advisories-0ScpWAHV.js} +1 -1
- package/dist/packem_shared/{affected-selection-CoRXp5H4.js → affected-selection-BMoQWuHl.js} +1 -1
- package/dist/packem_shared/{ai-fix-6nXZbecQ.js → ai-fix-CKN1JGRh.js} +1 -1
- package/dist/packem_shared/{bin-C2eYtJ_N.js → bin-CN4heKmb.js} +1 -1
- package/dist/packem_shared/{osv-bloom-1JS__1or.js → osv-bloom-JYIWcH3F.js} +1 -1
- package/dist/packem_shared/{package-version-Bb7KGF36.js → package-version-CJxZ_B7G.js} +3 -3
- package/dist/packem_shared/{project-name-filter-DYaIbrXa.js → project-name-filter-DsrVo0MY.js} +1 -1
- package/dist/packem_shared/{scan-progress-aVHGZYWf.js → scan-progress-5uTRdC1G.js} +2 -2
- package/dist/packem_shared/{spinner-CbJfWYwB.js → spinner-BM_0Bj6x.js} +1 -1
- package/dist/packem_shared/{tabs-BilwonkM.js → tabs-UDYQ3tqt.js} +1 -1
- package/dist/packem_shared/target-merge-B4No-LHM.js +4 -0
- package/dist/packem_shared/{vis-update-app-ngwL2mRv.js → vis-update-app-zqSa2clT.js} +1 -1
- package/dist/packem_shared/{vis-user-error-CAu9wIbe.js → vis-user-error-Dkc97rGY.js} +1 -1
- package/index.js +26 -26
- package/package.json +11 -11
- package/dist/packem_shared/target-merge-DCGow6Kw.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as wt}from"node:module";import{a as x,$ as it,U as yt,v as at,e as P,q as Tt}from"../packem_shared/index-DHD8wb6Z.js";import{y as m,X as E,m as b,v as vt,j as St}from"./catalog.js";import ot from"./index.js";import{x as ct}from"../packem_shared/main-BP-w-K-6.js";import{y as B}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{
|
|
1
|
+
import{createRequire as wt}from"node:module";import{a as x,$ as it,U as yt,v as at,e as P,q as Tt}from"../packem_shared/index-DHD8wb6Z.js";import{y as m,X as E,m as b,v as vt,j as St}from"./catalog.js";import ot from"./index.js";import{x as ct}from"../packem_shared/main-BP-w-K-6.js";import{y as B}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{d as $t}from"./cli-main.js";import{l as At}from"../packem_shared/spinner-BM_0Bj6x.js";import{C as dt,D as F,T as lt}from"../packem_shared/symbols-BXDZ_sKt.js";import{b as z,F as C,q as D,X as L,J as It}from"../packem_shared/index.server-BAjDJSEu.js";import{withEnhancedPath as Mt}from"@visulima/task-runner";let mt;const kt=t=>(mt??=wt(import.meta.url))(t),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,G=t=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,s]=M.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return M.getBuiltinModule(t)}return kt(t)},{readFileSync:bt,writeFileSync:xt,unlinkSync:Ct}=G("node:fs"),{randomBytes:Et}=G("node:crypto"),{availableParallelism:V}=G("node:os");class A extends Error{constructor(e,s){super(e,s),this.name=this.constructor.name}}class Rt extends A{}class T extends A{}class W extends A{}class j extends A{stderr;constructor(e,s,r){super(e,r),this.stderr=s}}class X extends A{}class $ extends A{commandTitle;constructor(e,s,r){super(s,r),this.commandTitle=e}}const ut=t=>t.includes("/"),N=(t,e)=>e?t.toLowerCase():t,jt=(t,e,s,r={})=>{const n=ut(t),a=r.caseInsensitive===!0,c=N(t,a),i=[];for(const o of e){const l=n?x(s,o):it(o);ot(c,N(l,a))&&i.push(o)}return i},_t=(t,e,s,r={})=>{if(!e||e.length===0)return[...t];const n=r.caseInsensitive===!0;return t.filter(a=>{for(const c of e){const i=ut(c)?x(s,a):it(a),o=N(c,n);if(ot(o,N(i,n)))return!1}return!0})},U=t=>typeof t=="object"&&t!==null&&typeof t.title=="string"&&typeof t.task=="function",_=t=>typeof t=="object"&&t!==null&&typeof t.command=="string"&&typeof t.task!="function",Pt=(t,e)=>{const s=x(t,e);return s===""||!s.startsWith("..")&&!at(s)},Ft=(t,e)=>{let s;for(const r of e)Pt(r,t)&&(s===void 0||r.length>s.length)&&(s=r);return s},Nt=async t=>{let e=0,s=0;const r=()=>(e+=1,`pattern-${e}`),n=()=>(s+=1,`cmd-${s}`),a=(o,l,f,d)=>{if(o.perPackage===!0){const u=t.workspacePackages??[],g=new Map;for(const h of f){const p=Ft(h,u)??t.cwd,k=g.get(p)??[];k.push(x(p,h)),g.set(p,k)}for(const h of[...g.keys()].sort()){const p=x(t.cwd,h)||".";d.push({command:o.command,cwd:h,files:g.get(h)??[],id:n(),source:"string",title:`${o.command} — ${p}`})}return}if(o.cwd!==void 0){const u=yt(t.cwd,o.cwd);d.push({command:o.command,cwd:u,files:f,id:n(),source:"string",title:`${o.command} — ${x(t.cwd,u)||"."}`});return}d.push({command:o.command,files:l,id:n(),source:"string",title:o.command})},c=async(o,l,f,d)=>{if(typeof o=="string"){d.push({command:o,files:l,id:n(),source:"string",title:o});return}if(Array.isArray(o)){for(const u of o)await c(u,l,f,d);return}if(_(o)){a(o,l,f,d);return}if(typeof o=="function"){const u=await o([...l]);if(typeof u=="string"){d.push({command:u,files:l,id:n(),source:"function",title:u});return}if(Array.isArray(u)){for(const g of u)if(typeof g=="string")d.push({command:g,files:l,id:n(),source:"function",title:g});else if(_(g))a(g,l,f,d);else if(U(g))d.push({files:l,id:n(),run:g.task,source:"custom",title:g.title});else throw new T("Task function returned an array with an unsupported entry — expected strings, { command, … }, or { title, task }.");return}if(_(u)){a(u,l,f,d);return}if(U(u)){d.push({files:l,id:n(),run:u.task,source:"custom",title:u.title});return}throw new T("Task function returned an unsupported value — expected string, string[], { command, … }, or { title, task }.")}if(U(o)){d.push({files:l,id:n(),run:o.task,source:"custom",title:o.title});return}throw new T("Unsupported task value — expected string, string[], function, { command, … }, or { title, task }.")},i=[];for(const[o,l]of Object.entries(t.config)){const f=jt(o,t.files,t.cwd,{caseInsensitive:t.caseInsensitive===!0});if(f.length===0)continue;const d=t.relative?f.map(g=>x(t.cwd,g)):f,u=[];await c(l,d,f,u),u.length!==0&&i.push({commands:u,files:d,id:r(),pattern:o,title:`${o} — ${f.length} file${f.length===1?"":"s"}`})}return i},Ot=async t=>{if(t.config!==void 0)return t.config;throw new T(`No staged config provided. Add \`staged\` to your vis.config.ts:
|
|
2
2
|
|
|
3
3
|
import { defineConfig } from "@visulima/vis/config";
|
|
4
4
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as Ne}from"node:module";import{
|
|
1
|
+
import{createRequire as Ne}from"node:module";import{v as W,V as Ce,U as ze,W as Ge,T as $e,X as We,Y as Ve,d as Ue}from"./cli-main.js";import{i as Xe}from"../packem_shared/index-BjdW45xX.js";import{u as p,y as e,X as s,m as o,R as He}from"./catalog.js";import{d as Ke}from"../packem_shared/pm-runner-de-jCq8q.js";import{i as qe,e as le,z as Ye,m as Qe}from"../packem_shared/index-DHD8wb6Z.js";import{y as Ze}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{h as et}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{n as tt,a as ot}from"../packem_shared/tabs-UDYQ3tqt.js";let Re;const Be=i=>(Re??=Ne(import.meta.url))(i),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_e=i=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[t,n]=q.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return q.getBuiltinModule(i)}return Be(i)},{writeFileSync:Je}=_e("node:fs"),rt=(i,{whitespace:t=!0}={})=>i.replace(qe,n=>n.startsWith('"')||n[1]==="*"&&!n.endsWith("*/")?n:t?n.replaceAll(/\S/g," "):""),V=[{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode"]}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{}},forwardPorts:[3e3],image:"mcr.microsoft.com/devcontainers/javascript-node:22",name:"Node.js",postCreateCommand:"npm install"},description:"Node.js 22 with Git and GitHub CLI",id:"node",name:"Node.js"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode"]}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{}},forwardPorts:[3e3],image:"mcr.microsoft.com/devcontainers/javascript-node:22",mounts:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-pnpm-store",target:"/home/node/.local/share/pnpm/store",type:"volume"}],name:"Node.js + pnpm Monorepo",postCreateCommand:"corepack enable && pnpm install",remoteUser:"node",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}"},description:"Node.js 22 with pnpm, corepack, and optimized volume mounts",id:"node-pnpm",name:"Node.js + pnpm"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode","ms-azuretools.vscode-docker"]}},dockerComposeFile:"docker-compose.yml",forwardPorts:[3e3,5432],name:"Node.js + PostgreSQL",postCreateCommand:"npm install",service:"app",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}"},description:"Node.js with PostgreSQL via Docker Compose",id:"node-postgres",name:"Node.js + PostgreSQL"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode","ms-azuretools.vscode-docker"]}},features:{"ghcr.io/devcontainers/features/docker-in-docker:2":{},"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{}},forwardPorts:[3e3],image:"mcr.microsoft.com/devcontainers/javascript-node:22",name:"Node.js + Docker",postCreateCommand:"npm install"},description:"Node.js 22 with Docker-in-Docker for container workflows",id:"node-dind",name:"Node.js + Docker-in-Docker"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode","ms-azuretools.vscode-docker"]}},dockerComposeFile:"docker-compose.yml",features:{"ghcr.io/devcontainers/features/docker-in-docker:2":{}},forwardPorts:[3e3,5432,6379],name:"Full Stack",postCreateCommand:"npm install",service:"app",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}"},description:"Node.js + PostgreSQL + Redis + Docker via Compose",id:"fullstack",name:"Full Stack"},{config:{customizations:{vscode:{extensions:["ms-python.python","ms-python.vscode-pylance"],settings:{"editor.formatOnSave":!0,"python.defaultInterpreterPath":"/usr/local/bin/python"}}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{},"ghcr.io/devcontainers/features/python:1":{version:"3.12"}},forwardPorts:[8e3],image:"mcr.microsoft.com/devcontainers/python:3.12",name:"Python",postCreateCommand:"pip install -r requirements.txt || true"},description:"Python 3.12 with pip and venv",id:"python",name:"Python"},{config:{customizations:{vscode:{extensions:["golang.go"],settings:{"editor.formatOnSave":!0,"go.toolsManagement.autoUpdate":!0}}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/go:1":{version:"1.22"}},forwardPorts:[8080],image:"mcr.microsoft.com/devcontainers/go:1.22",name:"Go",postCreateCommand:"go mod download || true"},description:"Go 1.22 development environment",id:"go",name:"Go"},{config:{customizations:{vscode:{extensions:["rust-lang.rust-analyzer","tamasfe.even-better-toml"],settings:{"editor.formatOnSave":!0}}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/rust:1":{}},image:"mcr.microsoft.com/devcontainers/rust:latest",name:"Rust",postCreateCommand:"cargo build || true"},description:"Rust development with cargo and rust-analyzer",id:"rust",name:"Rust"},{config:{customizations:{vscode:{extensions:["vscjava.vscode-java-pack","vscjava.vscode-maven"]}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/java:1":{version:"17"}},forwardPorts:[8080],image:"mcr.microsoft.com/devcontainers/java:17",name:"Java",postCreateCommand:"./mvnw install || ./gradlew build || true"},description:"Java 17 with Maven/Gradle support",id:"java",name:"Java"},{config:{customizations:{vscode:{extensions:["ms-azuretools.vscode-docker","ms-kubernetes-tools.vscode-kubernetes-tools","hashicorp.terraform"]}},features:{"ghcr.io/devcontainers/features/aws-cli:1":{},"ghcr.io/devcontainers/features/azure-cli:1":{},"ghcr.io/devcontainers/features/docker-in-docker:2":{},"ghcr.io/devcontainers/features/kubectl-helm-minikube:1":{},"ghcr.io/devcontainers/features/terraform:1":{}},image:"mcr.microsoft.com/devcontainers/base:ubuntu",name:"DevOps"},description:"Docker, Kubernetes, Terraform, AWS & Azure CLIs",id:"devops",name:"DevOps"},{config:{features:{"ghcr.io/devcontainers/features/common-utils:2":{}},image:"mcr.microsoft.com/devcontainers/base:ubuntu",name:"Minimal",remoteUser:"vscode"},description:"Bare Ubuntu with common utilities",id:"minimal",name:"Minimal"},{config:{image:"mcr.microsoft.com/devcontainers/base:ubuntu",name:"Custom"},description:"Minimal Ubuntu base - configure from scratch",id:"custom",name:"Custom (Blank)"}],nt=i=>{const t=le(i,".devcontainer","devcontainer.json");if(!Ze(t))return null;const n=Ye(t),c=rt(n),l=c!==n;let r;try{r=JSON.parse(c)}catch(a){const m=a instanceof Error?a.message:String(a);throw new Error(`Failed to parse ${t}: ${m}`,{cause:a})}return{config:r,hadComments:l}},it=(i,t,n)=>{const c=n?Qe(n):le(i,".devcontainer"),l=n??le(c,"devcontainer.json");et(c),Je(l,`${JSON.stringify(t,null,2)}
|
|
2
2
|
`,"utf8")},st={bun:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-bun-cache",target:"/home/node/.bun/install/cache",type:"volume"}],deno:[{source:"${localWorkspaceFolderBasename}-deno-cache",target:"/home/node/.cache/deno",type:"volume"}],npm:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-npm-cache",target:"/home/node/.npm",type:"volume"}],pnpm:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-pnpm-store",target:"/home/node/.local/share/pnpm/store",type:"volume"}],yarn:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-yarn-cache",target:"/home/node/.yarn/cache",type:"volume"}]},ct=[{featureMatch:"docker-in-docker",mounts:[]},{featureMatch:"docker-outside-of-docker",mounts:[{source:"/var/run/docker.sock",target:"/var/run/docker.sock",type:"bind"}]},{featureMatch:"/features/git:",mounts:[{source:"${localWorkspaceFolderBasename}-git-config",target:"/home/node/.gitconfig",type:"volume"}]}],pe=(i,t,n)=>{const c=[],l=new Set(n.map(a=>typeof a=="string"?a:a.target));if(i)for(const a of st[i])l.has(a.target)||c.push(a);const r=Object.keys(t);for(const{featureMatch:a,mounts:m}of ct)if(r.some(g=>g.includes(a)))for(const g of m)l.has(g.target)||c.push(g);return c},B=["general","features","ports","lifecycle","extensions","environment","mounts","compose"],Y=i=>structuredClone(i);class lt{#r=new Set;#e;constructor(t,n,c=null){const l=t===null,r=t??{name:""},a=Y(r);this.#e={config:a,detectedPm:c,extensionSearch:"",featureSearch:"",fieldEditing:!1,fieldIndex:0,hadComments:n,isDirty:!1,mode:l?"create":"edit",originalConfig:l?null:Y(r),section:"general",showTemplateSelector:l,suggestedMounts:pe(c,a.features??{},a.mounts??[]),templateIndex:0}}getSnapshot=()=>this.#e;subscribe=t=>(this.#r.add(t),()=>{this.#r.delete(t)});setSection(t){t!==this.#e.section&&this.#t({...this.#e,fieldEditing:!1,fieldIndex:0,section:t})}nextSection(){const n=(B.indexOf(this.#e.section)+1)%B.length;this.setSection(B[n])}previousSection(){const n=(B.indexOf(this.#e.section)-1+B.length)%B.length;this.setSection(B[n])}setFieldIndex(t){t!==this.#e.fieldIndex&&this.#t({...this.#e,fieldIndex:Math.max(0,t)})}setFieldEditing(t){t!==this.#e.fieldEditing&&this.#t({...this.#e,fieldEditing:t})}setTemplateIndex(t){const n=Math.max(0,Math.min(t,V.length-1));n!==this.#e.templateIndex&&this.#t({...this.#e,templateIndex:n})}applyTemplate(t){const n=V.find(c=>c.id===t);n&&this.#t(this.#o({...this.#e,config:Y(n.config),isDirty:!0,showTemplateSelector:!1}))}dismissTemplateSelector(){this.#t({...this.#e,showTemplateSelector:!1})}updateConfig(t){this.#t({...this.#e,config:{...this.#e.config,...t},isDirty:!0})}toggleFeature(t){const n={...this.#e.config.features};n[t]===void 0?n[t]={}:delete n[t],this.#t(this.#o({...this.#e,config:{...this.#e.config,features:n},isDirty:!0}))}setFeatureSearch(t){this.#t({...this.#e,featureSearch:t,fieldIndex:0})}addPort(t){const n=this.#e.config.forwardPorts??[];if(n.includes(t))return;const c=[...n,t];this.#t({...this.#e,config:{...this.#e.config,forwardPorts:c},isDirty:!0})}removePort(t){const n=[...this.#e.config.forwardPorts??[]];n.splice(t,1),this.#t({...this.#e,config:{...this.#e.config,forwardPorts:n.length>0?n:void 0},isDirty:!0})}toggleExtension(t){const n={...this.#e.config.customizations},c={...n.vscode},l=[...c.extensions??[]],r=l.indexOf(t);r===-1?l.push(t):l.splice(r,1),c.extensions=l.length>0?l:void 0,n.vscode=c.extensions||c.settings?c:void 0,this.#t({...this.#e,config:{...this.#e.config,customizations:n.vscode||n.jetbrains?n:void 0},isDirty:!0})}setExtensionSearch(t){this.#t({...this.#e,extensionSearch:t,fieldIndex:0})}addEnvVar(t,n,c){const l=t==="container"?"containerEnv":"remoteEnv",r={...this.#e.config[l],[n]:c};this.#t({...this.#e,config:{...this.#e.config,[l]:r},isDirty:!0})}removeEnvVar(t,n){const c=t==="container"?"containerEnv":"remoteEnv",l={...this.#e.config[c]};delete l[n],this.#t({...this.#e,config:{...this.#e.config,[c]:Object.keys(l).length>0?l:void 0},isDirty:!0})}addMount(t){const n=[...this.#e.config.mounts??[],t];this.#t(this.#o({...this.#e,config:{...this.#e.config,mounts:n},isDirty:!0}))}removeMount(t){const n=[...this.#e.config.mounts??[]];n.splice(t,1),this.#t(this.#o({...this.#e,config:{...this.#e.config,mounts:n.length>0?n:void 0},isDirty:!0}))}applySuggestedMounts(){if(this.#e.suggestedMounts.length===0)return;const t=[...this.#e.config.mounts??[],...this.#e.suggestedMounts];this.#t(this.#o({...this.#e,config:{...this.#e.config,mounts:t},isDirty:!0}))}setLifecycleCommand(t,n){this.#t({...this.#e,config:{...this.#e.config,[t]:n||void 0},isDirty:!0})}markClean(){this.#t({...this.#e,isDirty:!1,originalConfig:Y(this.#e.config)})}getJsonPreview(){return JSON.stringify(this.#n(),null,2)}cleanConfig(){return this.#n()}#n(){const t=Y(this.#e.config);for(const[n,c]of Object.entries(t))(c===""||c===void 0)&&delete t[n];return t.build&&(t.build.dockerfile===""&&delete t.build.dockerfile,t.build.context===""&&delete t.build.context,t.build.args&&Object.keys(t.build.args).length===0&&delete t.build.args,Object.keys(t.build).length===0&&delete t.build),t.forwardPorts?.length===0&&delete t.forwardPorts,t.mounts?.length===0&&delete t.mounts,t.runServices?.length===0&&delete t.runServices,t.capAdd?.length===0&&delete t.capAdd,t.securityOpt?.length===0&&delete t.securityOpt,t.features&&Object.keys(t.features).length===0&&delete t.features,t.customizations?.vscode?.extensions?.length===0&&delete t.customizations.vscode.extensions,t.customizations?.vscode&&Object.keys(t.customizations.vscode).length===0&&delete t.customizations.vscode,t.customizations&&Object.keys(t.customizations).length===0&&delete t.customizations,t.containerEnv&&Object.keys(t.containerEnv).length===0&&delete t.containerEnv,t.remoteEnv&&Object.keys(t.remoteEnv).length===0&&delete t.remoteEnv,t}#o(t){return{...t,suggestedMounts:pe(t.detectedPm,t.config.features??{},t.config.mounts??[])}}#t(t){this.#e=t;for(const n of this.#r)try{n()}catch{}}}const xe=[{category:"linting",description:"Integrates ESLint into the editor",id:"dbaeumer.vscode-eslint",name:"ESLint"},{category:"linting",description:"Stylelint CSS/SCSS linting",id:"stylelint.vscode-stylelint",name:"Stylelint"},{category:"formatting",description:"Opinionated code formatter",id:"esbenp.prettier-vscode",name:"Prettier"},{category:"formatting",description:"EditorConfig file support",id:"editorconfig.editorconfig",name:"EditorConfig"},{category:"formatting",description:"Fast Rust-based formatter and linter",id:"biomejs.biome",name:"Biome"},{category:"language",description:"Rich TypeScript and JavaScript support",id:"ms-vscode.vscode-typescript-next",name:"TypeScript Nightly"},{category:"language",description:"Tailwind CSS IntelliSense",id:"bradlc.vscode-tailwindcss",name:"Tailwind CSS"},{category:"language",description:"YAML language support with schemas",id:"redhat.vscode-yaml",name:"YAML"},{category:"language",description:"TOML language support",id:"tamasfe.even-better-toml",name:"TOML"},{category:"language",description:"Dockerfile and Docker Compose support",id:"ms-azuretools.vscode-docker",name:"Docker"},{category:"language",description:"Python language support with Pylance",id:"ms-python.python",name:"Python"},{category:"language",description:"Go language support",id:"golang.go",name:"Go"},{category:"language",description:"Rust language support via rust-analyzer",id:"rust-lang.rust-analyzer",name:"rust-analyzer"},{category:"git",description:"Git supercharged: blame, history, stash, etc.",id:"eamodio.gitlens",name:"GitLens"},{category:"git",description:"GitHub Pull Requests and Issues",id:"github.vscode-pull-request-github",name:"GitHub PR"},{category:"testing",description:"Vitest test explorer integration",id:"vitest.explorer",name:"Vitest Explorer"},{category:"testing",description:"Jest test runner and assertions",id:"orta.vscode-jest",name:"Jest"},{category:"debugging",description:"REST client for testing APIs",id:"humao.rest-client",name:"REST Client"},{category:"debugging",description:"Error Lens: inline error highlighting",id:"usernamehw.errorlens",name:"Error Lens"},{category:"other",description:"Intelligent code completion with AI",id:"github.copilot",name:"GitHub Copilot"},{category:"other",description:"Path autocompletion for imports",id:"christian-kohler.path-intellisense",name:"Path Intellisense"},{category:"other",description:"Import cost display in editor",id:"wix.vscode-import-cost",name:"Import Cost"},{category:"other",description:"Todo Tree: highlight and list TODOs",id:"gruntfuggly.todo-tree",name:"Todo Tree"}],je=[{category:"language",description:"Node.js runtime via nvm with optional pnpm/yarn",id:"ghcr.io/devcontainers/features/node:1",name:"Node.js"},{category:"language",description:"Python runtime with pip and optional tools",id:"ghcr.io/devcontainers/features/python:1",name:"Python"},{category:"language",description:"Go compiler and tools",id:"ghcr.io/devcontainers/features/go:1",name:"Go"},{category:"language",description:"Rust toolchain via rustup",id:"ghcr.io/devcontainers/features/rust:1",name:"Rust"},{category:"language",description:"Java runtime and JDK via SDKMAN",id:"ghcr.io/devcontainers/features/java:1",name:"Java"},{category:"language",description:".NET SDK and runtime",id:"ghcr.io/devcontainers/features/dotnet:2",name:".NET"},{category:"tool",description:"Common utilities: zsh, Oh My Zsh, git, curl, etc.",id:"ghcr.io/devcontainers/features/common-utils:2",name:"Common Utilities"},{category:"tool",description:"Git version control",id:"ghcr.io/devcontainers/features/git:1",name:"Git"},{category:"tool",description:"Git Large File Storage support",id:"ghcr.io/devcontainers/features/git-lfs:1",name:"Git LFS"},{category:"tool",description:"GitHub CLI for repository management",id:"ghcr.io/devcontainers/features/github-cli:1",name:"GitHub CLI"},{category:"tool",description:"Run Docker containers inside the dev container",id:"ghcr.io/devcontainers/features/docker-in-docker:2",name:"Docker-in-Docker"},{category:"tool",description:"Access host Docker daemon from inside the container",id:"ghcr.io/devcontainers/features/docker-outside-of-docker:1",name:"Docker-from-Docker"},{category:"tool",description:"kubectl, Helm, and Minikube for Kubernetes",id:"ghcr.io/devcontainers/features/kubectl-helm-minikube:1",name:"Kubernetes Tools"},{category:"tool",description:"Infrastructure as code with Terraform",id:"ghcr.io/devcontainers/features/terraform:1",name:"Terraform"},{category:"tool",description:"Nix package manager",id:"ghcr.io/devcontainers/features/nix:1",name:"Nix"},{category:"tool",description:"SSH server for remote connections to the container",id:"ghcr.io/devcontainers/features/sshd:1",name:"SSH Server"},{category:"cloud",description:"Amazon Web Services CLI v2",id:"ghcr.io/devcontainers/features/aws-cli:1",name:"AWS CLI"},{category:"cloud",description:"Microsoft Azure CLI",id:"ghcr.io/devcontainers/features/azure-cli:1",name:"Azure CLI"},{category:"cloud",description:"Google Cloud Platform CLI",id:"ghcr.io/devcontainers/features/gcloud:1",name:"Google Cloud CLI"},{category:"database",description:"PostgreSQL client tools",id:"ghcr.io/devcontainers-extra/features/postgres-client:1",name:"PostgreSQL Client"},{category:"database",description:"Redis client tools",id:"ghcr.io/devcontainers-extra/features/redis-client:1",name:"Redis Client"}],de=i=>{if(!i)return je;const t=i.toLowerCase();return je.filter(n=>n.name.toLowerCase().includes(t)||n.id.toLowerCase().includes(t)||n.description.toLowerCase().includes(t))},ue=i=>{if(!i)return xe;const t=i.toLowerCase();return xe.filter(n=>n.name.toLowerCase().includes(t)||n.id.toLowerCase().includes(t)||n.description.toLowerCase().includes(t))},at=/^[a-z]$/i,dt=i=>{const t=i.codePointAt(0);return t!==void 0&&(t<32||t===127)},ut=(i,t)=>i.length===0||dt(i)?!1:t.ctrl&&t.meta?!at.test(i):!(t.ctrl||t.meta),ht=/\S+\s*$/,se=(i,t)=>i.length===0||!t?void 0:t.find(n=>n.startsWith(i))?.slice(i.length)??void 0,ke=-1,mt=(i,t,n,c)=>t.leftArrow?Math.max(0,n-1):t.home||t.ctrl&&i==="a"?0:t.end||t.ctrl&&i==="e"?c:ke,gt=(i,t,n,c)=>{if(t.backspace&&c>0)return[n.slice(0,c-1)+n.slice(c),c-1];if(t.delete&&c<n.length)return[n.slice(0,c)+n.slice(c+1),c];if(t.ctrl&&i==="u")return[n.slice(c),0];if(t.ctrl&&i==="k")return[n.slice(0,c),c];if(t.ctrl&&i==="w"){const l=n.slice(0,c).replace(ht,"");return[l+n.slice(c),l.length]}};function he({defaultValue:i="",isDisabled:t=!1,mask:n=!1,onChange:c,onSubmit:l,placeholder:r,suggestions:a}){const[m,f]=p.useState(i),[g,v]=p.useState(i.length),x=p.useRef(m);x.current=m;const b=p.useRef(g);b.current=g;const y=p.useRef(c);y.current=c;const D=p.useRef(l);D.current=l;const k=se(m,a),M=p.useCallback((T,I)=>{const{current:E}=b,S=x.current;if(I.return){const w=se(S,a),C=w?S+w:S;w&&(f(C),v(C.length),y.current?.(C)),D.current?.(C);return}if(I.escape)return;if(I.rightArrow){const w=se(S,a);if(E===S.length&&w){const C=S+w;f(C),v(C.length),y.current?.(C);return}v(Math.min(S.length,E+1));return}const A=mt(T,I,E,S.length);if(A!==ke){v(A);return}const H=gt(T,I,S,E);if(H){const[w,C]=H;f(w),v(C),y.current?.(w);return}if(ut(T,I)){const w=S.slice(0,E)+T+S.slice(E);f(w),v(E+T.length),y.current?.(w)}},[a]);W(M,{isActive:!t});const L=n?"*".repeat(m.length):m,U=L.slice(0,g),X=L[g],Q=L.slice(g+1);return t?e.jsx(s,{children:e.jsx(o,{dimColor:!0,children:L||r||""})}):m.length===0&&r?e.jsxs(s,{children:[e.jsx(o,{dimColor:!0,inverse:!0,children:r[0]}),e.jsx(o,{dimColor:!0,children:r.slice(1)})]}):e.jsxs(s,{children:[e.jsxs(o,{children:[U,e.jsx(o,{inverse:!0,children:X??" "}),Q]}),k?e.jsx(o,{dimColor:!0,children:k}):void 0]})}const Ee=["dockerComposeFile","service"],ft={dockerComposeFile:"Compose File",service:"Service"},ve={dockerComposeFile:"docker-compose.yml",service:"app"},pt={dockerComposeFile:"Path to Docker Compose file (relative to .devcontainer/)",service:"Which service in the compose file to connect the IDE to"},xt=({config:i,fieldEditing:t,fieldIndex:n,onUpdate:c})=>{const l=!!i.dockerComposeFile,r=!!(i.image||i.build);return e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsx(s,{marginBottom:1,children:e.jsx(o,{bold:!0,color:"cyan",children:"Docker Compose Integration"})}),r&&l&&e.jsx(s,{marginBottom:1,children:e.jsx(o,{color:"yellow",children:"Note: When using Docker Compose, the image/build settings in General are ignored."})}),Ee.map((a,m)=>{const f=m===n,g=i[a]??"",v=Array.isArray(i[a])?i[a].join(", "):g;return e.jsxs(s,{flexDirection:"column",marginBottom:1,children:[e.jsxs(s,{children:[e.jsx(s,{width:20,children:e.jsxs(o,{bold:f,color:f?"cyan":"white",children:[f?"❯ ":" ",ft[a],":"]})}),e.jsx(s,{flexGrow:1,children:f&&t?e.jsx(he,{defaultValue:v,onChange:x=>{c({[a]:x||void 0})},placeholder:ve[a]}):e.jsx(o,{color:v?"white":"gray",children:v||ve[a]})})]}),e.jsx(s,{paddingLeft:4,children:e.jsx(o,{dimColor:!0,children:pt[a]})})]},a)}),e.jsx(s,{marginTop:1,children:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ","edit field"," ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",e.jsx(o,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]})},jt=Ee.length,vt=({config:i,fieldIndex:t})=>{const n=i.containerEnv??{},c=i.remoteEnv??{},l=Object.keys(n),r=Object.keys(c),a=l.length,m=l.length+1,f=m+r.length,g=t<=a,v=t>a;return e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsxs(s,{borderColor:g?"cyan":"gray",borderStyle:"single",flexDirection:"column",paddingX:1,paddingY:0,children:[e.jsxs(s,{flexShrink:0,marginBottom:l.length>0?1:0,children:[e.jsx(o,{bold:!0,color:g?"cyan":"white",children:"containerEnv"}),e.jsx(o,{dimColor:!0,children:" — baked into the container image"})]}),l.map((x,b)=>{const y=b===t;return e.jsx(s,{flexShrink:0,children:e.jsxs(o,{color:y?"cyan":void 0,inverse:y,wrap:"truncate",children:[y?" ❯ ":" ",e.jsx(o,{bold:!0,children:x}),e.jsx(o,{dimColor:!0,children:" = "}),e.jsx(o,{children:n[x]})]})},x)}),e.jsx(s,{flexShrink:0,marginTop:l.length>0?1:0,children:e.jsxs(o,{color:t===a?"cyan":"gray",inverse:t===a,children:[" ","+ Add variable..."]})})]}),e.jsxs(s,{borderColor:v?"cyan":"gray",borderStyle:"single",flexDirection:"column",marginTop:1,paddingX:1,paddingY:0,children:[e.jsxs(s,{flexShrink:0,marginBottom:r.length>0?1:0,children:[e.jsx(o,{bold:!0,color:v?"cyan":"white",children:"remoteEnv"}),e.jsx(o,{dimColor:!0,children:" — set at runtime by the IDE"})]}),r.map((x,b)=>{const D=m+b===t;return e.jsx(s,{flexShrink:0,children:e.jsxs(o,{color:D?"cyan":void 0,inverse:D,wrap:"truncate",children:[D?" ❯ ":" ",e.jsx(o,{bold:!0,children:x}),e.jsx(o,{dimColor:!0,children:" = "}),e.jsx(o,{children:c[x]})]})},x)}),e.jsx(s,{flexShrink:0,marginTop:r.length>0?1:0,children:e.jsxs(o,{color:t===f?"cyan":"gray",inverse:t===f,children:[" ","+ Add variable..."]})})]}),e.jsx(s,{flexShrink:0,marginTop:1,children:e.jsxs(o,{dimColor:!0,wrap:"truncate",children:[e.jsx(o,{bold:!0,color:"white",children:"a"}),"/",e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ","add on + row"," ",e.jsx(o,{bold:!0,color:"white",children:"d"})," ","remove"," ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"]})})]})},bt=i=>{const t=Object.keys(i.containerEnv??{}).length,n=Object.keys(i.remoteEnv??{}).length;return t+1+n+1},wt=({config:i,fieldIndex:t,scrollOffset:n,searchText:c,viewportHeight:l})=>{const r=p.useMemo(()=>new Set(i.customizations?.vscode?.extensions),[i.customizations?.vscode?.extensions]),a=p.useMemo(()=>ue(c),[c]),m=a.length,f=m>l&&l>0;return e.jsxs(s,{flexDirection:"column",flexGrow:1,children:[e.jsxs(s,{flexShrink:0,gap:1,paddingX:1,children:[e.jsxs(o,{bold:!0,color:"cyan",children:[r.size," ","selected"]}),c&&e.jsxs(o,{dimColor:!0,children:["— filter:"," ",e.jsx(o,{color:"yellow",children:c})," ","(",a.length," ","results)"]})]}),e.jsxs(s,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[e.jsx(s,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:e.jsx(s,{flexDirection:"column",marginTop:-n,children:a.map((g,v)=>{const x=v===t,b=r.has(g.id);return e.jsxs(s,{flexShrink:0,height:1,children:[e.jsx(o,{children:x?">":" "}),e.jsxs(o,{color:b?"white":"gray",children:[" ",b?"☑":"☐"," "]}),e.jsx(s,{flexGrow:1,children:e.jsxs(o,{bold:x,inverse:x,wrap:"truncate",children:[g.name,e.jsxs(o,{dimColor:!0,children:[" ","-",g.id]})]})})]},g.id)})})}),f&&e.jsx(s,{flexShrink:0,marginLeft:1,marginRight:1,children:e.jsx(Ce,{contentHeight:m,placement:"inset",scrollOffset:n,style:"block",viewportHeight:l})})]}),a.length===0&&e.jsx(s,{paddingX:1,children:e.jsx(o,{dimColor:!0,children:"No extensions match the search."})})]})},yt=({config:i,fieldIndex:t,scrollOffset:n,searchText:c,viewportHeight:l})=>{const r=p.useMemo(()=>new Set(Object.keys(i.features??{})),[i.features]),a=p.useMemo(()=>de(c),[c]),m=a.length,f=m>l&&l>0;return e.jsxs(s,{flexDirection:"column",flexGrow:1,children:[e.jsxs(s,{flexShrink:0,gap:1,paddingX:1,children:[e.jsxs(o,{bold:!0,color:"cyan",children:[r.size," ","selected"]}),c&&e.jsxs(o,{dimColor:!0,children:["— filter:"," ",e.jsx(o,{color:"yellow",children:c})," ","(",a.length," ","results)"]})]}),e.jsxs(s,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[e.jsx(s,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:e.jsx(s,{flexDirection:"column",marginTop:-n,children:a.map((g,v)=>{const x=v===t,b=r.has(g.id);return e.jsxs(s,{flexShrink:0,height:1,children:[e.jsx(o,{children:x?">":" "}),e.jsxs(o,{color:b?"white":"gray",children:[" ",b?"☑":"☐"," "]}),e.jsx(s,{flexGrow:1,children:e.jsxs(o,{bold:x,inverse:x,wrap:"truncate",children:[g.name,e.jsxs(o,{dimColor:!0,children:[" ","-",g.description]})]})})]},g.id)})})}),f&&e.jsx(s,{flexShrink:0,marginLeft:1,marginRight:1,children:e.jsx(Ce,{contentHeight:m,placement:"inset",scrollOffset:n,style:"block",viewportHeight:l})})]}),a.length===0&&e.jsx(s,{paddingX:1,children:e.jsx(o,{dimColor:!0,children:"No features match the search."})})]})},ae=["name","image","workspaceFolder","workspaceMount","remoteUser","containerUser","shutdownAction"],St={containerUser:"Container User",image:"Image",name:"Name",remoteUser:"Remote User",shutdownAction:"Shutdown Action",workspaceFolder:"Workspace Folder",workspaceMount:"Workspace Mount"},be={containerUser:"root",image:"mcr.microsoft.com/devcontainers/javascript-node:22",name:"My Dev Container",remoteUser:"node",shutdownAction:"none | stopContainer",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}",workspaceMount:"source=${localWorkspaceFolder},target=...,type=bind"},te=["privileged","overrideCommand"],Ct={overrideCommand:"Override Command",privileged:"Privileged"},kt=ae.length+te.length,Et=({config:i,fieldEditing:t,fieldIndex:n,onUpdate:c})=>e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsx(s,{marginBottom:1,children:e.jsx(o,{bold:!0,color:"cyan",children:"General Configuration"})}),ae.map((l,r)=>{const a=r===n,m=i[l]??"";return e.jsxs(s,{marginBottom:1,children:[e.jsx(s,{width:20,children:e.jsxs(o,{bold:a,color:a?"cyan":"white",children:[a?"❯ ":" ",St[l],":"]})}),e.jsx(s,{flexGrow:1,children:a&&t?e.jsx(he,{defaultValue:m,onChange:f=>{c({[l]:f})},placeholder:be[l]}):e.jsx(o,{color:m?"white":"gray",children:m||be[l]})})]},l)}),te.map((l,r)=>{const m=ae.length+r===n,f=i[l]??!1;return e.jsxs(s,{marginBottom:r<te.length-1?1:0,children:[e.jsx(s,{width:20,children:e.jsxs(o,{bold:m,color:m?"cyan":"white",children:[m?"❯ ":" ",Ct[l],":"]})}),e.jsx(s,{flexGrow:1,children:e.jsxs(o,{color:f?"green":"gray",children:[f?"yes":"no",m&&e.jsx(o,{dimColor:!0,children:" (Space to toggle)"})]})})]},l)}),e.jsx(s,{marginTop:1,children:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ","edit field"," ",e.jsx(o,{bold:!0,color:"white",children:"Space"})," ","toggle"," ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",e.jsx(o,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]}),Ie=kt,ce=te,De=["postCreateCommand","postStartCommand","postAttachCommand","onCreateCommand"],It={onCreateCommand:"On Create",postAttachCommand:"Post Attach",postCreateCommand:"Post Create",postStartCommand:"Post Start"},Dt={onCreateCommand:"Runs once when the container is first created",postAttachCommand:"Runs each time the IDE attaches",postCreateCommand:"Runs after the container is created and workspace mounted",postStartCommand:"Runs each time the container starts"},Tt=({config:i,fieldEditing:t,fieldIndex:n,onSetCommand:c})=>e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsx(s,{marginBottom:1,children:e.jsx(o,{bold:!0,color:"cyan",children:"Lifecycle Commands"})}),De.map((l,r)=>{const a=r===n,m=i[l],f=Array.isArray(m)?m.join(" && "):m??"";return e.jsxs(s,{flexDirection:"column",marginBottom:1,children:[e.jsx(s,{children:e.jsxs(o,{bold:a,color:a?"cyan":"white",children:[a?"❯ ":" ",It[l]]})}),e.jsx(s,{paddingLeft:4,children:e.jsx(o,{dimColor:!0,children:Dt[l]})}),e.jsx(s,{paddingLeft:4,children:a&&t?e.jsx(he,{defaultValue:f,onChange:g=>{c(l,g)},placeholder:"e.g. npm install"}):e.jsx(o,{color:f?"green":"gray",children:f||"(not set)"})})]},l)}),e.jsx(s,{marginTop:1,children:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ","edit command"," ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",e.jsx(o,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]}),At=De.length,we=i=>typeof i=="string"?i:`[${i.type}] ${i.source} → ${i.target}`,Ft=({addingMount:i,config:t,detectedPm:n,fieldIndex:c,mountPhase:l,mountSource:r,mountTarget:a,mountType:m,suggestedMounts:f})=>{const g=t.mounts??[];return e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsxs(s,{flexShrink:0,gap:1,paddingX:1,children:[e.jsxs(o,{bold:!0,color:"cyan",children:[g.length," ","mounts"]}),n&&e.jsxs(o,{dimColor:!0,children:["— detected:"," ",e.jsx(o,{color:"white",children:n})]})]}),f.length>0&&!i&&e.jsxs(s,{borderColor:"yellow",borderStyle:"single",flexDirection:"column",marginBottom:1,marginTop:1,paddingX:1,children:[e.jsxs(s,{flexShrink:0,children:[e.jsx(o,{bold:!0,color:"yellow",children:"Suggested mounts"}),e.jsxs(o,{dimColor:!0,children:[" ","— press"," ",e.jsx(o,{bold:!0,color:"white",children:"A"})," ","to add all"]})]}),f.map((v,x)=>e.jsx(s,{flexShrink:0,children:e.jsxs(o,{dimColor:!0,wrap:"truncate",children:[" + ",we(v)]})},`suggestion-${String(x)}`))]}),g.length>0&&e.jsx(s,{flexDirection:"column",marginBottom:1,children:g.map((v,x)=>{const b=x===c;return e.jsxs(s,{flexShrink:0,height:1,children:[e.jsx(o,{children:b?">":" "}),e.jsx(s,{flexGrow:1,children:e.jsxs(o,{bold:b,inverse:b,wrap:"truncate",children:[" ",we(v)]})})]},`mount-${String(x)}`)})}),!i&&e.jsx(s,{flexShrink:0,children:e.jsxs(o,{color:c===g.length?"cyan":"gray",inverse:c===g.length,children:[" ","+ Add mount..."]})}),i&&e.jsxs(s,{borderColor:"cyan",borderStyle:"single",flexDirection:"column",marginTop:1,paddingX:1,children:[e.jsx(s,{flexShrink:0,marginBottom:1,children:e.jsx(o,{bold:!0,color:"cyan",children:"New Mount"})}),e.jsxs(s,{flexShrink:0,children:[e.jsx(s,{width:12,children:e.jsxs(o,{bold:l==="source",color:l==="source"?"cyan":"white",children:[l==="source"?"❯ ":" ","Source:"]})}),e.jsx(o,{color:r?"yellow":"gray",children:r||(l==="source"?"_":"(type source, Enter to continue)")})]}),e.jsxs(s,{flexShrink:0,children:[e.jsx(s,{width:12,children:e.jsxs(o,{bold:l==="target",color:l==="target"?"cyan":"white",children:[l==="target"?"❯ ":" ","Target:"]})}),e.jsx(o,{color:a?"yellow":"gray",children:a||(l==="target"?"_":"/container/path")})]}),e.jsxs(s,{flexShrink:0,children:[e.jsx(s,{width:12,children:e.jsxs(o,{bold:l==="type",color:l==="type"?"cyan":"white",children:[l==="type"?"❯ ":" ","Type:"]})}),l==="type"?e.jsxs(o,{children:[e.jsx(o,{bold:m==="volume",color:m==="volume"?"cyan":"gray",children:"[1] volume"})," ",e.jsx(o,{bold:m==="bind",color:m==="bind"?"cyan":"gray",children:"[2] bind"})," ",e.jsx(o,{bold:m==="tmpfs",color:m==="tmpfs"?"cyan":"gray",children:"[3] tmpfs"})]}):e.jsx(o,{color:"gray",children:m})]}),e.jsx(s,{flexShrink:0,marginTop:1,children:e.jsx(o,{dimColor:!0,wrap:"truncate",children:l==="type"?"1/2/3 select type, Enter confirm, Esc cancel":"Type text, Enter next step, Esc cancel"})})]}),g.length===0&&!i&&f.length===0&&e.jsx(s,{marginTop:1,children:e.jsx(o,{dimColor:!0,children:"Tip: Use volume mounts for node_modules and caches to improve performance."})})]})},Lt=({addingPort:i,addPortValue:t,config:n,fieldIndex:c})=>{const l=n.forwardPorts??[],r=c===l.length;return e.jsxs(s,{flexDirection:"column",paddingX:1,children:[e.jsxs(s,{marginBottom:1,children:[e.jsx(o,{bold:!0,color:"cyan",children:"Forwarded Ports"}),e.jsxs(o,{dimColor:!0,children:[" ","(",l.length," ","ports)"]})]}),l.map((a,m)=>{const f=m===c;return e.jsx(s,{children:e.jsxs(o,{color:f?"cyan":void 0,inverse:f,children:[" ",String(a)]})},`port-${String(a)}`)}),e.jsx(s,{marginTop:l.length>0?1:0,children:e.jsxs(o,{color:r?"cyan":"gray",inverse:r,children:[" ",r&&i?e.jsxs(o,{children:["Enter port:"," ",e.jsx(o,{color:"yellow",children:t||"_"})]}):"+ Add port..."]})}),e.jsx(s,{marginTop:1,children:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ",r?"type port number, Enter to confirm":"select"," ",e.jsx(o,{bold:!0,color:"white",children:"d"})," ","remove selected"," ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"]})})]})},Ot=({focused:i,hadComments:t,jsonPreview:n,mode:c,scrollRef:l})=>e.jsxs(s,{borderColor:i?"cyan":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsxs(s,{flexShrink:0,paddingX:1,children:[e.jsx(o,{bold:!0,color:i?"cyan":"white",children:"Preview"}),e.jsxs(o,{dimColor:!0,children:[" ","(",c==="create"?"new":"edit",")"]})]}),t&&c==="edit"&&e.jsx(s,{flexShrink:0,paddingX:1,children:e.jsx(o,{color:"yellow",children:"Comments will not be preserved."})}),e.jsx(ze,{flexGrow:1,ref:l,scrollbar:!0,scrollbarColor:"gray",children:n.split(`
|
|
3
3
|
`).map((r,a)=>e.jsx(o,{color:"green",children:r},`line-${String(a)}`))})]}),Pt=i=>{const t=[],n=[],c=[];if(!i.image&&!i.build&&!i.dockerComposeFile&&t.push({field:"image",message:'One of "image", "build", or "dockerComposeFile" is required'}),i.build&&(i.image&&n.push({field:"image",message:'Both "image" and "build" are set; "build" takes precedence'}),i.build.dockerfile||t.push({field:"build.dockerfile",message:'"build" requires a "dockerfile" path'})),i.dockerComposeFile&&!i.service&&t.push({field:"service",message:'"service" is required when using "dockerComposeFile"'}),i.features!==void 0&&(typeof i.features!="object"||Array.isArray(i.features))&&t.push({field:"features",message:'"features" must be an object mapping feature IDs to options'}),i.forwardPorts)if(Array.isArray(i.forwardPorts))for(const[l,r]of i.forwardPorts.entries())typeof r=="number"&&(r<1||r>65535)&&t.push({field:"forwardPorts",message:`Invalid port ${String(r)} at index ${String(l)}`});else t.push({field:"forwardPorts",message:'"forwardPorts" must be an array'});return i.customizations?.vscode?.extensions&&!Array.isArray(i.customizations.vscode.extensions)&&t.push({field:"customizations.vscode.extensions",message:"Extensions must be an array"}),i.customizations?.vscode?.settings&&typeof i.customizations.vscode.settings!="object"&&t.push({field:"customizations.vscode.settings",message:"Settings must be an object"}),i.name||c.push({field:"name",message:"Consider adding a name for better identification"}),(!i.features||Object.keys(i.features).length===0)&&c.push({field:"features",message:"Consider adding features for common tools"}),(!i.customizations?.vscode?.extensions||i.customizations.vscode.extensions.length===0)&&c.push({field:"extensions",message:"Consider adding VS Code extensions for your stack"}),i.privileged&&n.push({field:"privileged",message:"Running in privileged mode is a security risk"}),{errors:t,suggestions:c,valid:t.length===0,warnings:n}},ye=80,Se=15,Mt=120,Te=[{description:"Container name, base image, workspace folder, and user",id:"general",label:"General"},{description:"Installable tools and runtimes (Node, Python, Docker, etc.)",id:"features",label:"Features"},{description:"Ports to forward from the container to your host",id:"ports",label:"Ports"},{description:"Commands to run at different stages of the container lifecycle",id:"lifecycle",label:"Lifecycle"},{description:"VS Code extensions to auto-install in the container",id:"extensions",label:"Extensions"},{description:"Environment variables for the container and IDE",id:"environment",label:"Env"},{description:"Volume and bind mounts for persistent data and caches",id:"mounts",label:"Mounts"},{description:"Docker Compose integration for multi-container setups",id:"compose",label:"Compose"}],Nt=new Map(Te.map(i=>[i.id,i.description])),Rt=(i,t,n,c)=>{switch(i){case"compose":return jt;case"environment":return bt(t);case"extensions":return ue(c).length;case"features":return de(n).length;case"general":return Ie;case"lifecycle":return At;case"mounts":return(t.mounts?.length??0)+1;case"ports":return(t.forwardPorts?.length??0)+1;default:return 0}},Bt=({onSave:i,store:t})=>{const{exit:n}=Ge(),{columns:c,rows:l}=$e(),r=p.useSyncExternalStore(t.subscribe,t.getSnapshot),[a,m]=p.useState(!1),[f,g]=p.useState(!1),[v,x]=p.useState(!1),[b,y]=p.useState(null),[D,k]=p.useState("editor"),[M,L]=p.useState(0),[U,X]=p.useState(!1),[Q,T]=p.useState(""),[I,E]=p.useState(null),[S,A]=p.useState(""),[H,w]=p.useState(""),[C,_]=p.useState("key"),[oe,Z]=p.useState(!1),[re,z]=p.useState(""),[ne,G]=p.useState(""),[me,K]=p.useState("volume"),[O,$]=p.useState("source"),ie=p.useRef(null),R=p.useRef(null),N=p.useRef(null),ee=p.useRef(!0);p.useEffect(()=>(ee.current=!0,()=>{ee.current=!1,N.current&&clearTimeout(N.current)}),[]);const ge=Rt(r.section,r.config,r.featureSearch,r.extensionSearch),J=Math.max(1,l-9);p.useEffect(()=>{r.section!=="features"&&r.section!=="extensions"||L(u=>r.fieldIndex>=u+J?r.fieldIndex-J+1:r.fieldIndex<u?r.fieldIndex:u)},[r.fieldIndex,r.section,J]),p.useEffect(()=>{L(0)},[r.section,r.featureSearch,r.extensionSearch]);const Ae=p.useCallback(()=>{const u=t.cleanConfig(),h=Pt(u);if(!h.valid){const j=h.errors[0];y(j?`Error: ${j.message}`:"Validation failed"),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{ee.current&&y(null)},3e3);return}i(u),t.markClean();const d=h.warnings.length;y(d>0?`Saved! (${String(d)} warning${d>1?"s":""})`:"Saved!"),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{ee.current&&y(null)},2e3)},[i,t]);W((u,h)=>{if(h.downArrow||u==="j")t.setTemplateIndex(r.templateIndex+1);else if(h.upArrow||u==="k")t.setTemplateIndex(r.templateIndex-1);else if(h.return){const d=V[r.templateIndex];d&&t.applyTemplate(d.id)}else h.escape&&t.dismissTemplateSelector()},{isActive:r.showTemplateSelector}),W((u,h)=>{if(h.escape){X(!1),T("");return}if(h.return){const d=Number.parseInt(Q,10);!Number.isNaN(d)&&d>0&&d<=65535&&t.addPort(d),X(!1),T("");return}if(h.backspace){T(d=>d.slice(0,-1));return}u&&/^\d$/u.test(u)&&T(d=>d+u)},{isActive:U}),W((u,h)=>{if(h.escape){E(null),A(""),w(""),_("key");return}if(h.return){if(C==="key"&&S){_("value");return}if(C==="value"&&S){t.addEnvVar(I,S,H),E(null),A(""),w(""),_("key");return}}if(h.backspace){C==="key"?A(d=>d.slice(0,-1)):w(d=>d.slice(0,-1));return}u&&!h.ctrl&&!h.meta&&(C==="key"?A(d=>d+u):w(d=>d+u))},{isActive:I!==null}),W((u,h)=>{if(h.escape){Z(!1),z(""),G(""),$("source");return}if(h.return){if(O==="source"&&re){$("target");return}if(O==="target"&&ne){$("type");return}if(O==="type"){t.addMount({source:re,target:ne,type:me}),Z(!1),z(""),G(""),$("source");return}}if(O==="type"){switch(u){case"1":{K("volume");break}case"2":{K("bind");break}case"3":{K("tmpfs");break}}return}if(h.backspace){O==="source"?z(d=>d.slice(0,-1)):O==="target"&&G(d=>d.slice(0,-1));return}u&&!h.ctrl&&!h.meta&&(O==="source"?z(d=>d+u):O==="target"&&G(d=>d+u))},{isActive:oe}),W((u,h)=>{if(u==="c"&&h.ctrl){n();return}if(!f){if(a){h.escape||u==="?"?m(!1):h.downArrow||u==="j"?ie.current?.scrollBy(1):h.upArrow||u==="k"?ie.current?.scrollBy(-1):u==="q"&&(m(!1),g(!0));return}if(v){if(h.escape){x(!1),r.section==="features"?t.setFeatureSearch(""):t.setExtensionSearch("");return}if(h.return){x(!1);return}if(h.backspace){r.section==="features"?t.setFeatureSearch(r.featureSearch.slice(0,-1)):t.setExtensionSearch(r.extensionSearch.slice(0,-1));return}if(u&&!h.ctrl&&!h.meta){r.section==="features"?t.setFeatureSearch(r.featureSearch+u):t.setExtensionSearch(r.extensionSearch+u);return}return}if(r.fieldEditing){if(h.escape){t.setFieldEditing(!1);return}if(h.return){t.setFieldEditing(!1);return}return}if(u==="?"){m(!0);return}if(u==="q"){r.isDirty?g(!0):n();return}if(u==="s"){Ae();return}if(h.tab){k(d=>d==="editor"?"preview":"editor");return}if(D==="preview"){if(h.downArrow||u==="j"){R.current?.scrollBy(1);return}if(h.upArrow||u==="k"){R.current?.scrollBy(-1);return}if(h.pageDown){R.current?.scrollBy(10);return}if(h.pageUp){R.current?.scrollBy(-10);return}if(h.home){R.current?.scrollToTop();return}if(h.end){R.current?.scrollToBottom();return}h.escape&&k("editor");return}if(h.downArrow||u==="j"){ge>0&&t.setFieldIndex(Math.min(r.fieldIndex+1,ge-1));return}if(h.upArrow||u==="k"){t.setFieldIndex(Math.max(r.fieldIndex-1,0));return}if(h.return){switch(r.section){case"compose":case"general":case"lifecycle":{t.setFieldEditing(!0);break}case"environment":{const d=Object.keys(r.config.containerEnv??{}).length,j=d,P=d+1+Object.keys(r.config.remoteEnv??{}).length;r.fieldIndex===j?(E("container"),A(""),w(""),_("key")):r.fieldIndex===P&&(E("remote"),A(""),w(""),_("key"));break}case"mounts":{const d=r.config.mounts??[];r.fieldIndex===d.length&&(Z(!0),z(""),G(""),K("volume"),$("source"));break}case"ports":{const d=r.config.forwardPorts??[];r.fieldIndex===d.length&&(X(!0),T(""));break}}return}if(u===" "){switch(r.section){case"extensions":{const j=ue(r.extensionSearch)[r.fieldIndex];j&&t.toggleExtension(j.id);break}case"features":{const j=de(r.featureSearch)[r.fieldIndex];j&&t.toggleFeature(j.id);break}case"general":{const d=Ie-ce.length,j=r.fieldIndex-d;if(j>=0&&j<ce.length){const P=ce[j];t.updateConfig({[P]:!r.config[P]})}break}}return}if(u==="/"){(r.section==="features"||r.section==="extensions")&&x(!0);return}if(u==="A"&&r.section==="mounts"){t.applySuggestedMounts();return}if(u==="a"){if(r.section==="environment"){const d=Object.keys(r.config.containerEnv??{}).length,j=r.fieldIndex<=d?"container":"remote";E(j),A(""),w(""),_("key")}else r.section==="mounts"&&(Z(!0),z(""),G(""),K("volume"),$("source"));return}if(u==="d")switch(r.section){case"environment":{const d=Object.keys(r.config.containerEnv??{}),j=Object.keys(r.config.remoteEnv??{});if(r.fieldIndex<d.length)t.removeEnvVar("container",d[r.fieldIndex]),d.length===1||r.fieldIndex>=d.length-1&&t.setFieldIndex(d.length-2);else{const P=r.fieldIndex-d.length-1;P>=0&&P<j.length&&(t.removeEnvVar("remote",j[P]),j.length===1||P>=j.length-1&&t.setFieldIndex(r.fieldIndex-1))}break}case"mounts":{const d=r.config.mounts??[];if(r.fieldIndex<d.length){t.removeMount(r.fieldIndex);const j=d.length-1;r.fieldIndex>=j&&j>0&&t.setFieldIndex(j-1)}break}case"ports":{const d=r.config.forwardPorts??[];if(r.fieldIndex<d.length){t.removePort(r.fieldIndex);const j=d.length-1;r.fieldIndex>=j&&j>0&&t.setFieldIndex(j-1)}break}}}},{isActive:!r.showTemplateSelector&&!U&&I===null&&!oe});const Fe=p.useMemo(()=>t.getJsonPreview(),[r.config]);if(c<ye||l<Se)return e.jsx(s,{alignItems:"center",height:l,justifyContent:"center",width:c,children:e.jsxs(o,{color:"yellow",children:["Terminal too small (",c,"x",l,"), need"," ",ye,"x",Se]})});if(r.showTemplateSelector)return e.jsx(s,{alignItems:"center",flexDirection:"column",height:l,justifyContent:"center",width:c,children:e.jsxs(s,{borderColor:"cyan",borderStyle:"round",flexDirection:"column",paddingX:2,paddingY:1,width:60,children:[e.jsx(s,{justifyContent:"center",marginBottom:1,children:e.jsx(o,{bold:!0,color:"cyan",children:"Select a Template"})}),V.map((u,h)=>{const d=h===r.templateIndex;return e.jsx(s,{children:e.jsxs(o,{color:d?"cyan":void 0,inverse:d,children:[d?" ❯ ":" ",e.jsx(o,{bold:d,children:u.name}),e.jsxs(o,{dimColor:!0,children:[" ","-",u.description]})]})},u.id)}),e.jsx(s,{justifyContent:"center",marginTop:1,children:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",e.jsx(o,{bold:!0,color:"white",children:"Enter"})," ","select"," ",e.jsx(o,{bold:!0,color:"white",children:"Esc"})," ","blank"]})})]})});let F;switch(r.section){case"compose":{F=e.jsx(xt,{config:r.config,fieldEditing:r.fieldEditing,fieldIndex:r.fieldIndex,onUpdate:u=>{t.updateConfig(u)}});break}case"environment":{F=e.jsxs(s,{flexDirection:"column",children:[e.jsx(vt,{config:r.config,fieldIndex:r.fieldIndex}),I!==null&&e.jsx(s,{marginTop:1,paddingX:1,children:e.jsxs(o,{color:"cyan",children:["Add"," ",I," ","env:"," ",C==="key"?e.jsxs(o,{children:["key=",e.jsx(o,{color:"yellow",children:S||"_"})," ","(Enter to set value)"]}):e.jsxs(o,{children:[S,"=",e.jsx(o,{color:"yellow",children:H||"_"})," ","(Enter to confirm, Esc to cancel)"]})]})})]});break}case"extensions":{F=e.jsx(wt,{config:r.config,fieldIndex:r.fieldIndex,scrollOffset:M,searchText:r.extensionSearch,viewportHeight:J});break}case"features":{F=e.jsx(yt,{config:r.config,fieldIndex:r.fieldIndex,scrollOffset:M,searchText:r.featureSearch,viewportHeight:J});break}case"general":{F=e.jsx(Et,{config:r.config,fieldEditing:r.fieldEditing,fieldIndex:r.fieldIndex,onUpdate:u=>{t.updateConfig(u)}});break}case"lifecycle":{F=e.jsx(Tt,{config:r.config,fieldEditing:r.fieldEditing,fieldIndex:r.fieldIndex,onSetCommand:(u,h)=>{t.setLifecycleCommand(u,h)}});break}case"mounts":{F=e.jsx(Ft,{addingMount:oe,config:r.config,detectedPm:r.detectedPm,fieldIndex:r.fieldIndex,mountPhase:O,mountSource:re,mountTarget:ne,mountType:me,suggestedMounts:r.suggestedMounts});break}case"ports":{F=e.jsx(Lt,{addingPort:U,addPortValue:Q,config:r.config,fieldIndex:r.fieldIndex});break}default:F=e.jsx(o,{children:"Unknown section"})}const Le=e.jsxs(s,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:[e.jsxs(s,{flexGrow:1,flexWrap:"wrap",gap:2,paddingX:1,children:[e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"q"}),e.jsx(o,{dimColor:!0,children:"QUIT"})]}),e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"?"}),e.jsx(o,{dimColor:!0,children:"HELP"})]}),e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"↑↓"}),e.jsx(o,{dimColor:!0,children:"NAV"})]}),(r.section==="features"||r.section==="extensions")&&e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"Space"}),e.jsx(o,{dimColor:!0,children:"CHECK"})]}),e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"←→"}),e.jsx(o,{dimColor:!0,children:"TABS"})]}),e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"Tab"}),e.jsx(o,{dimColor:!0,children:"PANEL"})]}),(r.section==="features"||r.section==="extensions")&&e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"/"}),e.jsx(o,{dimColor:!0,children:"FILTER"})]}),e.jsxs(s,{gap:1,children:[e.jsx(o,{bold:!0,color:"white",children:"s"}),e.jsx(o,{dimColor:!0,children:"SAVE"})]})]}),e.jsxs(s,{paddingX:1,children:[b&&e.jsxs(o,{color:b.startsWith("Error")?"red":"green",children:[b," "]}),r.isDirty&&e.jsx(o,{color:"yellow",children:"[modified]"}),!r.isDirty&&!b&&e.jsx(o,{dimColor:!0,children:"[saved]"})]})]}),Oe=e.jsxs(We,{footer:e.jsxs(o,{dimColor:!0,children:[e.jsx(o,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(o,{bold:!0,color:"white",children:"?"}),"/",e.jsx(o,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:ie,title:"KEYBOARD SHORTCUTS",visible:a,width:56,children:[e.jsxs(s,{flexDirection:"column",marginBottom:1,children:[e.jsxs(s,{marginBottom:1,children:[e.jsx(o,{dimColor:!0,children:"── "}),e.jsx(o,{bold:!0,color:"white",children:"NAVIGATION"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"←→"}),e.jsx(o,{dimColor:!0,children:" Switch tabs"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"↑↓"}),"/",e.jsx(o,{bold:!0,color:"white",children:"j/k"}),e.jsx(o,{dimColor:!0,children:" Navigate within section"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"Tab"}),e.jsx(o,{dimColor:!0,children:" Switch editor/preview panel"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"Enter"}),e.jsx(o,{dimColor:!0,children:" Edit selected field"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"Esc"}),e.jsx(o,{dimColor:!0,children:" Stop editing / cancel"})]})]}),e.jsxs(s,{flexDirection:"column",marginBottom:1,children:[e.jsxs(s,{marginBottom:1,children:[e.jsx(o,{dimColor:!0,children:"── "}),e.jsx(o,{bold:!0,color:"white",children:"FEATURES / EXTENSIONS"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"Space"}),e.jsx(o,{dimColor:!0,children:" Toggle selection"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"/"}),e.jsx(o,{dimColor:!0,children:" Search / filter"})]})]}),e.jsxs(s,{flexDirection:"column",marginBottom:1,children:[e.jsxs(s,{marginBottom:1,children:[e.jsx(o,{dimColor:!0,children:"── "}),e.jsx(o,{bold:!0,color:"white",children:"LISTS (Ports, Mounts, Env)"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"a"}),e.jsx(o,{dimColor:!0,children:" Add new entry"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"d"}),e.jsx(o,{dimColor:!0,children:" Delete selected entry"})]})]}),e.jsxs(s,{flexDirection:"column",children:[e.jsxs(s,{marginBottom:1,children:[e.jsx(o,{dimColor:!0,children:"── "}),e.jsx(o,{bold:!0,color:"white",children:"ACTIONS"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"s"}),e.jsx(o,{dimColor:!0,children:" Save configuration"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"q"}),e.jsx(o,{dimColor:!0,children:" Quit"})]}),e.jsxs(o,{children:[" ",e.jsx(o,{bold:!0,color:"white",children:"?"}),e.jsx(o,{dimColor:!0,children:" Toggle help"})]})]})]}),Pe=e.jsx(Ot,{focused:D==="preview",hadComments:r.hadComments,jsonPreview:Fe,mode:r.mode,scrollRef:R}),fe=c>=Mt,Me=fe?Math.floor(c*.38):0;return e.jsxs(s,{flexDirection:"column",height:l,width:c,children:[e.jsxs(s,{flexShrink:0,gap:1,paddingX:1,children:[e.jsx(o,{bold:!0,inverse:!0,children:" VIS "}),e.jsxs(o,{wrap:"truncate",children:[r.mode==="create"?"Create":"Edit"," ","devcontainer"]})]}),e.jsx(s,{flexShrink:0,paddingX:1,paddingY:1,children:e.jsx(tt,{defaultValue:r.section,keyMap:{useNumbers:!1,useTab:!1},onChange:u=>{t.setSection(u),k("editor")},showIndex:!1,children:Te.map(({id:u,label:h})=>e.jsx(ot,{name:u,children:h},u))})}),e.jsx(s,{flexShrink:0,paddingRight:2,children:e.jsx(o,{dimColor:!0,wrap:"truncate",children:Nt.get(r.section)??""})}),e.jsxs(s,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[e.jsx(s,{borderColor:D==="editor"?"white":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,overflow:"hidden",children:F}),fe&&e.jsx(s,{flexShrink:0,width:Me,children:Pe})]}),Le,e.jsx(Ve,{autoExitSeconds:3,onCancel:()=>{g(!1)},visible:f}),Oe]})},Kt=async({logger:i,options:t,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a monorepo or project directory.");const c=n,l=t.template,r=t.output,a=!!process.stdout.isTTY&&!Xe;let m=null;try{m=Ke(c).name}catch{}const f=nt(c);let g=f?.config??null;const v=f?.hadComments??!1;if(l&&!f){const k=V.find(M=>M.id===l);if(!k){const M=V.map(L=>L.id).join(", ");throw new Error(`Unknown template "${l}". Valid templates: ${M}`)}g=k.config}if(!a){g?i.info(JSON.stringify(g,null,2)):(i.error("No existing devcontainer.json found. Use --template to generate one in non-TTY mode."),process.exitCode=1);return}process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume());const x=setInterval(()=>{},1e3),b=new lt(g,v,m);l&&!f&&b.dismissTemplateSelector();let y=null;if(await Ue(He.createElement(Bt,{onSave:k=>{it(c,k,r),y=k},store:b}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),clearInterval(x),y){const k=r??".devcontainer/devcontainer.json";i.info(`DevContainer config saved to ${k}`)}};export{Kt as default};
|