@samyx/preview-stacks-ui 0.19.0 → 0.22.0
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/dist/assets/ActionButton.vue_vue_type_script_setup_true_lang-D06apM-6.js +2 -0
- package/dist/assets/ActionButton.vue_vue_type_script_setup_true_lang-D06apM-6.js.map +1 -0
- package/dist/assets/{AxesTab-COaSNzrG.js → AxesTab-CCB3wdSX.js} +2 -2
- package/dist/assets/{AxesTab-COaSNzrG.js.map → AxesTab-CCB3wdSX.js.map} +1 -1
- package/dist/assets/ConfigTab-Cyqzeq3C.js +2 -0
- package/dist/assets/ConfigTab-Cyqzeq3C.js.map +1 -0
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-DrzDcr4X.js → ConflictNote.vue_vue_type_script_setup_true_lang-CtwJE2eJ.js} +2 -2
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-DrzDcr4X.js.map → ConflictNote.vue_vue_type_script_setup_true_lang-CtwJE2eJ.js.map} +1 -1
- package/dist/assets/{DangerTab-DsSJqxzj.js → DangerTab-Cdr9luUy.js} +2 -2
- package/dist/assets/{DangerTab-DsSJqxzj.js.map → DangerTab-Cdr9luUy.js.map} +1 -1
- package/dist/assets/{DashboardView-0BLBDth-.js → DashboardView-S4eiNX8X.js} +2 -2
- package/dist/assets/{DashboardView-0BLBDth-.js.map → DashboardView-S4eiNX8X.js.map} +1 -1
- package/dist/assets/DeploymentDetailView-CD4RVr06.js +2 -0
- package/dist/assets/DeploymentDetailView-CD4RVr06.js.map +1 -0
- package/dist/assets/DeploymentsView-DIX7IA8g.js +2 -0
- package/dist/assets/DeploymentsView-DIX7IA8g.js.map +1 -0
- package/dist/assets/{EquivalentCommand-DyCAI1Cy.js → EquivalentCommand-NHzDrg5d.js} +2 -2
- package/dist/assets/{EquivalentCommand-DyCAI1Cy.js.map → EquivalentCommand-NHzDrg5d.js.map} +1 -1
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-DjEWoD0O.js → ErrorNote.vue_vue_type_script_setup_true_lang-BFuRxw1l.js} +2 -2
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-DjEWoD0O.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-BFuRxw1l.js.map} +1 -1
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-CACw-lfW.js → HelpModal.vue_vue_type_script_setup_true_lang-DwwXY7EX.js} +2 -2
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-CACw-lfW.js.map → HelpModal.vue_vue_type_script_setup_true_lang-DwwXY7EX.js.map} +1 -1
- package/dist/assets/JobDetailView-BsCnnkPz.js +2 -0
- package/dist/assets/JobDetailView-BsCnnkPz.js.map +1 -0
- package/dist/assets/{JobsView-UUwzBG2c.js → JobsView-Bd_XHRkd.js} +2 -2
- package/dist/assets/{JobsView-UUwzBG2c.js.map → JobsView-Bd_XHRkd.js.map} +1 -1
- package/dist/assets/LogViewer.vue_vue_type_script_setup_true_lang-7Ggcxz1R.js +3 -0
- package/dist/assets/LogViewer.vue_vue_type_script_setup_true_lang-7Ggcxz1R.js.map +1 -0
- package/dist/assets/{LoginView-cKuF7PhJ.js → LoginView-Bj7uMFvv.js} +2 -2
- package/dist/assets/{LoginView-cKuF7PhJ.js.map → LoginView-Bj7uMFvv.js.map} +1 -1
- package/dist/assets/LogsTab-DRp76oC1.js +6 -0
- package/dist/assets/LogsTab-DRp76oC1.js.map +1 -0
- package/dist/assets/{NotFoundView-Bpcd3Ptj.js → NotFoundView-D-A8YFJw.js} +2 -2
- package/dist/assets/{NotFoundView-Bpcd3Ptj.js.map → NotFoundView-D-A8YFJw.js.map} +1 -1
- package/dist/assets/NotifiersView-CChDRHSy.js +2 -0
- package/dist/assets/NotifiersView-CChDRHSy.js.map +1 -0
- package/dist/assets/OverviewTab-jE_kOZI7.js +2 -0
- package/dist/assets/OverviewTab-jE_kOZI7.js.map +1 -0
- package/dist/assets/{RegistriesView-CfblUxVo.js → RegistriesView-D3Nh0dbq.js} +2 -2
- package/dist/assets/{RegistriesView-CfblUxVo.js.map → RegistriesView-D3Nh0dbq.js.map} +1 -1
- package/dist/assets/RelativeTime.vue_vue_type_script_setup_true_lang-mVrRpkV_.js +2 -0
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-Dx90hw4F.js.map → RelativeTime.vue_vue_type_script_setup_true_lang-mVrRpkV_.js.map} +1 -1
- package/dist/assets/{RequiresTab-DKFeob92.js → RequiresTab-BgGIZ1Tn.js} +2 -2
- package/dist/assets/{RequiresTab-DKFeob92.js.map → RequiresTab-BgGIZ1Tn.js.map} +1 -1
- package/dist/assets/{RoutingView-7SWVlOx8.js → RoutingView-D2StZawf.js} +3 -3
- package/dist/assets/{RoutingView-7SWVlOx8.js.map → RoutingView-D2StZawf.js.map} +1 -1
- package/dist/assets/RuntimeTab-B0D_MxFQ.js +2 -0
- package/dist/assets/RuntimeTab-B0D_MxFQ.js.map +1 -0
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-B-DTK242.js → SelectMenu.vue_vue_type_script_setup_true_lang-qGkx2MwW.js} +2 -2
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-B-DTK242.js.map → SelectMenu.vue_vue_type_script_setup_true_lang-qGkx2MwW.js.map} +1 -1
- package/dist/assets/SettingsView-Cu1Zkufg.js +2 -0
- package/dist/assets/SettingsView-Cu1Zkufg.js.map +1 -0
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-DiCGtn2a.js → SkeletonList.vue_vue_type_script_setup_true_lang-BYHXRCNR.js} +2 -2
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-DiCGtn2a.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-BYHXRCNR.js.map} +1 -1
- package/dist/assets/SpecDetailView-DIi21wo1.js +2 -0
- package/dist/assets/SpecDetailView-DIi21wo1.js.map +1 -0
- package/dist/assets/SpecsView-B49LI4Ut.js +2 -0
- package/dist/assets/SpecsView-B49LI4Ut.js.map +1 -0
- package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-DANvveJ6.js +2 -0
- package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-DANvveJ6.js.map +1 -0
- package/dist/assets/{SubmitView-6cqvVYlz.js → SubmitView-ZYGApCXE.js} +3 -3
- package/dist/assets/{SubmitView-6cqvVYlz.js.map → SubmitView-ZYGApCXE.js.map} +1 -1
- package/dist/assets/{Teleport-SesEhfqH.js → Teleport-d5PoAxFM.js} +2 -2
- package/dist/assets/{Teleport-SesEhfqH.js.map → Teleport-d5PoAxFM.js.map} +1 -1
- package/dist/assets/TerminalTab-DAZpn3jK.js +3 -0
- package/dist/assets/TerminalTab-DAZpn3jK.js.map +1 -0
- package/dist/assets/TerminalTab-DbjRludT.css +1 -0
- package/dist/assets/UsersView-BfQKf8Sf.js +2 -0
- package/dist/assets/UsersView-BfQKf8Sf.js.map +1 -0
- package/dist/assets/UsersView-DpZ_4vlY.css +1 -0
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-UEG5poOe.js → VarEditor.vue_vue_type_script_setup_true_lang-D--Rd-Mv.js} +2 -2
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-UEG5poOe.js.map → VarEditor.vue_vue_type_script_setup_true_lang-D--Rd-Mv.js.map} +1 -1
- package/dist/assets/VariablesView-Bej9ZZmS.js +2 -0
- package/dist/assets/VariablesView-Bej9ZZmS.js.map +1 -0
- package/dist/assets/VariablesView-Cnpkn8AM.css +1 -0
- package/dist/assets/index-Cyc_WOgY.css +1 -0
- package/dist/assets/{index-jLPJ82ve.js → index-DVCVnKbf.js} +28 -28
- package/dist/assets/index-DVCVnKbf.js.map +1 -0
- package/dist/assets/{useDeployment-Bgo0U4-I.js → useDeployment-752fTjLE.js} +2 -2
- package/dist/assets/{useDeployment-Bgo0U4-I.js.map → useDeployment-752fTjLE.js.map} +1 -1
- package/dist/assets/useFormat-DVXTfIS-.js +2 -0
- package/dist/assets/{useFormat-CKJxQp_i.js.map → useFormat-DVXTfIS-.js.map} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/ActionButton.vue_vue_type_script_setup_true_lang-C0iLjBml.js +0 -2
- package/dist/assets/ActionButton.vue_vue_type_script_setup_true_lang-C0iLjBml.js.map +0 -1
- package/dist/assets/ConfigTab-XGvUbd66.js +0 -2
- package/dist/assets/ConfigTab-XGvUbd66.js.map +0 -1
- package/dist/assets/DeploymentDetailView-dJjqob1P.js +0 -2
- package/dist/assets/DeploymentDetailView-dJjqob1P.js.map +0 -1
- package/dist/assets/DeploymentsView-BM9LVpU-.js +0 -2
- package/dist/assets/DeploymentsView-BM9LVpU-.js.map +0 -1
- package/dist/assets/JobDetailView-DsYfLQUd.js +0 -2
- package/dist/assets/JobDetailView-DsYfLQUd.js.map +0 -1
- package/dist/assets/LogViewer.vue_vue_type_script_setup_true_lang-DYfYw8_a.js +0 -3
- package/dist/assets/LogViewer.vue_vue_type_script_setup_true_lang-DYfYw8_a.js.map +0 -1
- package/dist/assets/LogsTab-QEuDGrG2.js +0 -5
- package/dist/assets/LogsTab-QEuDGrG2.js.map +0 -1
- package/dist/assets/NotifiersView-B1xAKTwU.js +0 -2
- package/dist/assets/NotifiersView-B1xAKTwU.js.map +0 -1
- package/dist/assets/OverviewTab-B2aCu4e0.js +0 -2
- package/dist/assets/OverviewTab-B2aCu4e0.js.map +0 -1
- package/dist/assets/RelativeTime.vue_vue_type_script_setup_true_lang-Dx90hw4F.js +0 -2
- package/dist/assets/RuntimeTab-CiSAV3D0.js +0 -2
- package/dist/assets/RuntimeTab-CiSAV3D0.js.map +0 -1
- package/dist/assets/SettingsView-BEha1Bt3.js +0 -2
- package/dist/assets/SettingsView-BEha1Bt3.js.map +0 -1
- package/dist/assets/SpecDetailView-l86eWf2v.js +0 -2
- package/dist/assets/SpecDetailView-l86eWf2v.js.map +0 -1
- package/dist/assets/SpecsView-BfWq69K5.js +0 -2
- package/dist/assets/SpecsView-BfWq69K5.js.map +0 -1
- package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-DMzCGltO.js +0 -2
- package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-DMzCGltO.js.map +0 -1
- package/dist/assets/TerminalTab-4vbfGB2S.css +0 -1
- package/dist/assets/TerminalTab-gDAKYgTX.js +0 -3
- package/dist/assets/TerminalTab-gDAKYgTX.js.map +0 -1
- package/dist/assets/UsersView-Bvs30U8o.js +0 -2
- package/dist/assets/UsersView-Bvs30U8o.js.map +0 -1
- package/dist/assets/UsersView-DZhhpsnX.css +0 -1
- package/dist/assets/VariablesView-Xn79UX3b.js +0 -2
- package/dist/assets/VariablesView-Xn79UX3b.js.map +0 -1
- package/dist/assets/VariablesView-m1RjJR-x.css +0 -1
- package/dist/assets/index-WMJXAtiA.css +0 -1
- package/dist/assets/index-jLPJ82ve.js.map +0 -1
- package/dist/assets/useFormat-CKJxQp_i.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as _,c as d,a as t,i as f,v as x,u as s,R as o,f as n,e as k,w as v,_ as c,a3 as B,t as u,g as m,x as E,F as S,y as l,r as y,C as g,a5 as L,N,o as r}from"./index-DVCVnKbf.js";import{_ as T}from"./ActionButton.vue_vue_type_script_setup_true_lang-D06apM-6.js";import{_ as b}from"./SelectMenu.vue_vue_type_script_setup_true_lang-qGkx2MwW.js";import"./Teleport-d5PoAxFM.js";const U={class:"panel settings-form"},$={class:"field"},A={class:"mute hint"},D={class:"field"},R=["type"],F={class:"row",style:{"margin-top":"var(--s2)"}},M={key:2,class:"mute",style:{"font-size":"var(--t-xs)"}},q={class:"mute hint"},H={class:"row",style:{gap:"8px","margin-top":"4px"}},I=["disabled"],P={key:0,class:"mute"},j={key:1,class:"bad"},z={class:"panel"},O={class:"field"},W={class:"field"},Y=_({__name:"SettingsView",setup(G){const p=y(!1),h=y(!1),w=g(()=>{const i=o.token;return i.startsWith("pstack_pat_")?"Looks like a personal token.":/^[0-9a-f]{40,}$/i.test(i)?"Looks like a machine token.":`${i.length} characters — this does not look like a pstack token.`}),C=g(()=>{var i;return((i=l.health)==null?void 0:i.authEnforced)??null});async function V(){p.value=!0;try{await L(),N(l.healthError?"error":"ok",l.healthError||"Control plane reachable")}finally{p.value=!1}}return(i,e)=>(r(),d("div",null,[e[19]||(e[19]=t("div",{class:"page-head"},[t("div",null,[t("h1",null,"Settings"),t("div",{class:"sub"},"Stored in this browser only. Nothing here is sent to the server.")])],-1)),t("section",U,[e[14]||(e[14]=t("h2",{class:"phead-title"},"Connection",-1)),t("div",$,[e[8]||(e[8]=t("label",{for:"apiBase"},"API base URL",-1)),f(t("input",{id:"apiBase","onUpdate:modelValue":e[0]||(e[0]=a=>s(o).apiBase=a),type:"url",spellcheck:"false",placeholder:"(same origin)"},null,512),[[x,s(o).apiBase,void 0,{trim:!0}]]),t("div",A,[e[7]||(e[7]=n(" Leave it empty unless you are pointing this page at another host. ",-1)),k(c,{label:"about the API base URL"},{default:v(()=>[...e[6]||(e[6]=[n(" Empty means same-origin, which is how the control stack serves this page — the browser never makes a cross-origin request, so there is no CORS to configure. Set an absolute URL only for a development session against a remote host. ",-1)])]),_:1})])]),t("div",D,[e[11]||(e[11]=t("label",{for:"token"},"Access token",-1)),f(t("input",{id:"token","onUpdate:modelValue":e[1]||(e[1]=a=>s(o).token=a),type:h.value||!s(o).token?"text":"password",name:"pstack-access-token",autocomplete:"off","data-1p-ignore":"","data-lpignore":"true","data-bwignore":"","data-form-type":"other",spellcheck:"false",placeholder:"paste the token from pstack init"},null,8,R),[[B,s(o).token,void 0,{trim:!0}]]),t("div",F,[s(o).token?(r(),d("button",{key:0,class:"ghost sm",onClick:e[2]||(e[2]=a=>h.value=!h.value)},u(h.value?"Hide":"Show"),1)):m("",!0),s(o).token?(r(),E(T,{key:1,variant:"ghost",class:"sm",confirm:"Clear it?",onRun:e[3]||(e[3]=a=>s(o).token="")},{default:v(()=>[...e[9]||(e[9]=[n(" Clear ",-1)])]),_:1})):m("",!0),s(o).token?(r(),d("span",M,u(w.value),1)):m("",!0)]),t("div",q,[e[10]||(e[10]=n(" Authenticates every request — signing in with an account does the same job, so set this only for token-based access (the machine token, or a personal token from your account). ",-1)),C.value===!1?(r(),d(S,{key:0},[n(" This server is not asking for one — it only accepts connections from this machine, so a token here is harmless but unnecessary. ")],64)):m("",!0)])]),t("div",H,[t("button",{class:"btn",disabled:p.value,onClick:V},u(p.value?"Checking…":"Test connection"),9,I),s(l).health?(r(),d("span",P,[n(" Connected to pstack "+u(s(l).health.version)+" ",1),k(c,{label:"where data is stored"},{default:v(()=>[e[12]||(e[12]=n(" Deployment records and stored specs live in ",-1)),t("code",null,u(s(l).health.dataDir),1),e[13]||(e[13]=n(" on the host. ",-1))]),_:1})])):s(l).healthError?(r(),d("span",j,u(s(l).healthError),1)):m("",!0)])]),t("section",z,[e[18]||(e[18]=t("h2",{class:"phead-title"},"Appearance",-1)),t("div",O,[e[15]||(e[15]=t("label",{for:"theme"},"Theme",-1)),k(b,{modelValue:s(o).theme,"onUpdate:modelValue":e[4]||(e[4]=a=>s(o).theme=a),id:"theme",label:"Theme",options:[{value:"system",label:"Follow the system"},{value:"dark",label:"Dark"},{value:"light",label:"Light"}]},null,8,["modelValue"])]),t("div",W,[e[16]||(e[16]=t("label",{for:"motion"},"Motion",-1)),k(b,{modelValue:s(o).motion,"onUpdate:modelValue":e[5]||(e[5]=a=>s(o).motion=a),id:"motion",label:"Motion",options:[{value:"system",label:"Follow the system"},{value:"full",label:"Always animate"},{value:"none",label:"No animation"}]},null,8,["modelValue"]),e[17]||(e[17]=t("div",{class:"mute hint"}," “Follow the system” uses your device's reduce-motion setting. The other two override it, in either direction. ",-1))])])]))}});export{Y as default};
|
|
2
|
+
//# sourceMappingURL=SettingsView-Cu1Zkufg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsView-Cu1Zkufg.js","sources":["../../src/views/SettingsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Settings: where the API is, how to authenticate to it, and how the app looks.\n *\n * Everything here is client-side and persisted to localStorage by `useSettings` — nothing is sent\n * to the server, and there is nothing to save. Bindings write through immediately.\n */\nimport { computed, ref } from 'vue';\nimport { settings } from '../composables/useSettings';\nimport { state, loadHealth } from '../composables/useControlPlane';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\n\nconst checking = ref(false);\nconst reveal = ref(false);\n\n/**\n * What is in the token box, described without printing it.\n *\n * The point is to make a WRONG value visible at a glance. A password autofilled into this field is\n * short and matches neither shape, and \"12 characters, not a pstack token\" is the sentence that\n * ends the mystery — before this, the only symptom was every page 401ing.\n */\nconst tokenShape = computed(() => {\n const t = settings.token;\n if (t.startsWith('pstack_pat_')) return 'Looks like a personal token.';\n if (/^[0-9a-f]{40,}$/i.test(t)) return 'Looks like a machine token.';\n return `${t.length} characters — this does not look like a pstack token.`;\n});\n\n/**\n * The server tells us whether it enforces auth. When it does not, it is bound to loopback and a\n * token would be pointless — worth saying, so nobody hunts for one that was never issued.\n */\nconst authEnforced = computed(() => state.health?.authEnforced ?? null);\n\nasync function recheck(): Promise<void> {\n checking.value = true;\n try {\n await loadHealth();\n toast(state.healthError ? 'error' : 'ok', state.healthError || 'Control plane reachable');\n } finally {\n checking.value = false;\n }\n}\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Settings</h1>\n <div class=\"sub\">Stored in this browser only. Nothing here is sent to the server.</div>\n </div>\n </div>\n\n <!-- `settings-form` caps the field widths: a URL input stretched to the panel's full 1500px\n reads as a text editor, not a form — see the rule in app.css. -->\n <section class=\"panel settings-form\">\n <h2 class=\"phead-title\">Connection</h2>\n\n <div class=\"field\">\n <label for=\"apiBase\">API base URL</label>\n <input\n id=\"apiBase\"\n v-model.trim=\"settings.apiBase\"\n type=\"url\"\n spellcheck=\"false\"\n placeholder=\"(same origin)\"\n />\n <div class=\"mute hint\">\n Leave it empty unless you are pointing this page at another host.\n <InfoHint label=\"about the API base URL\">\n Empty means same-origin, which is how the control stack serves this page — the browser\n never makes a cross-origin request, so there is no CORS to configure. Set an absolute\n URL only for a development session against a remote host.\n </InfoHint>\n </div>\n </div>\n\n <div class=\"field\">\n <label for=\"token\">Access token</label>\n <!--\n NOT `type=\"password\"`, and none of these attributes are decorative.\n\n This field is why \"opening Settings signs me out\" was a real bug. A password input is an\n autofill magnet: Chrome and every password manager fill one on sight and ignore\n `autocomplete=\"off\"` while doing it. The filled value went straight through `v-model` into\n localStorage and onto every request as `Authorization: Bearer <someone's password>` — and\n the server used to treat a bad bearer as a hard refusal rather than falling back to the\n session cookie, so a perfectly good login 401'd on every route until site data was cleared.\n\n The server now falls through (that is the real fix), and this field stops inviting the\n fill: a text input that masks itself only while it holds a value, named nothing like a\n password, with the ignore hints the managers respect.\n -->\n <input\n id=\"token\"\n v-model.trim=\"settings.token\"\n :type=\"reveal || !settings.token ? 'text' : 'password'\"\n name=\"pstack-access-token\"\n autocomplete=\"off\"\n data-1p-ignore\n data-lpignore=\"true\"\n data-bwignore\n data-form-type=\"other\"\n spellcheck=\"false\"\n placeholder=\"paste the token from pstack init\"\n />\n <div class=\"row\" style=\"margin-top: var(--s2)\">\n <button v-if=\"settings.token\" class=\"ghost sm\" @click=\"reveal = !reveal\">\n {{ reveal ? 'Hide' : 'Show' }}\n </button>\n <ActionButton\n v-if=\"settings.token\"\n variant=\"ghost\"\n class=\"sm\"\n confirm=\"Clear it?\"\n @run=\"settings.token = ''\"\n >\n Clear\n </ActionButton>\n <span v-if=\"settings.token\" class=\"mute\" style=\"font-size: var(--t-xs)\">\n {{ tokenShape }}\n </span>\n </div>\n <div class=\"mute hint\">\n Authenticates every request — signing in with an account does the same job, so set this\n only for token-based access (the machine token, or a personal token from your account).\n <template v-if=\"authEnforced === false\">\n This server is not asking for one — it only accepts connections from this machine, so a\n token here is harmless but unnecessary.\n </template>\n </div>\n </div>\n\n <div class=\"row\" style=\"gap: 8px; margin-top: 4px\">\n <button class=\"btn\" :disabled=\"checking\" @click=\"recheck\">\n {{ checking ? 'Checking…' : 'Test connection' }}\n </button>\n <span v-if=\"state.health\" class=\"mute\">\n Connected to pstack {{ state.health.version }}\n <InfoHint label=\"where data is stored\">\n Deployment records and stored specs live in\n <code>{{ state.health.dataDir }}</code> on the host.\n </InfoHint>\n </span>\n <span v-else-if=\"state.healthError\" class=\"bad\">{{ state.healthError }}</span>\n </div>\n </section>\n\n <section class=\"panel\">\n <h2 class=\"phead-title\">Appearance</h2>\n\n <div class=\"field\">\n <label for=\"theme\">Theme</label>\n <SelectMenu\n v-model=\"settings.theme\" id=\"theme\"\n label=\"Theme\"\n :options=\"[\n { value: 'system', label: 'Follow the system' },\n { value: 'dark', label: 'Dark' },\n { value: 'light', label: 'Light' },\n ]\"\n />\n </div>\n\n <div class=\"field\">\n <label for=\"motion\">Motion</label>\n <SelectMenu\n v-model=\"settings.motion\" id=\"motion\"\n label=\"Motion\"\n :options=\"[\n { value: 'system', label: 'Follow the system' },\n { value: 'full', label: 'Always animate' },\n { value: 'none', label: 'No animation' },\n ]\"\n />\n <div class=\"mute hint\">\n “Follow the system” uses your device's reduce-motion setting. The other two override it,\n in either direction.\n </div>\n </div>\n </section>\n </div>\n</template>\n"],"names":["checking","ref","reveal","tokenShape","computed","t","settings","authEnforced","_a","state","recheck","loadHealth","toast","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","$event","_unref","_hoisted_3","_createVNode","InfoHint","_hoisted_4","_hoisted_6","_createBlock","ActionButton","_hoisted_7","_toDisplayString","_hoisted_8","_Fragment","_hoisted_9","_hoisted_10","_openBlock","_hoisted_11","_createTextVNode","_hoisted_12","_hoisted_13","_hoisted_14","SelectMenu","_hoisted_15"],"mappings":"izBAeA,MAAMA,EAAWC,EAAI,EAAK,EACpBC,EAASD,EAAI,EAAK,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,GAAAC,EAAAb,CAAA,EAAS,OAAMY,GAAE,GAAG,SAC7B,MAAM,SACL,QAAS,sHAIT,yBAELF,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAGM,MAAA,CAHD,MAAM,aAAY,kHAGvB,EAAA,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as s,o as e,c as a,F as o,s as r,D as n,E as i}from"./index-
|
|
2
|
-
//# sourceMappingURL=SkeletonList.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{d as s,o as e,c as a,F as o,s as r,D as n,E as i}from"./index-DVCVnKbf.js";const c={role:"status","aria-live":"polite","aria-label":"loading"},p=s({__name:"SkeletonList",props:{rows:{default:3},tall:{type:Boolean,default:!1}},setup(l){return(d,u)=>(e(),a("div",c,[(e(!0),a(o,null,r(l.rows,t=>(e(),a("div",{key:t,class:i(["skel",{tall:l.tall}]),style:n({width:`${100-t*7}%`})},null,6))),128))]))}});export{p as _};
|
|
2
|
+
//# sourceMappingURL=SkeletonList.vue_vue_type_script_setup_true_lang-BYHXRCNR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkeletonList.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"SkeletonList.vue_vue_type_script_setup_true_lang-BYHXRCNR.js","sources":["../../src/components/SkeletonList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A loading placeholder shaped like the thing that is coming.\n *\n * Deliberately not a spinner on an empty page: a spinner says \"wait\" and nothing else, while a\n * skeleton says what will be there and stops the layout jumping when it arrives. It also makes an\n * empty result visibly different from a slow one, which on this page is the difference between\n * \"nothing is deployed\" and \"the API is not answering\".\n */\nwithDefaults(defineProps<{ rows?: number; tall?: boolean }>(), { rows: 3, tall: false });\n</script>\n\n<template>\n <div role=\"status\" aria-live=\"polite\" aria-label=\"loading\">\n <div v-for=\"n in rows\" :key=\"n\" class=\"skel\" :class=\"{ tall }\" :style=\"{ width: `${100 - n * 7}%` }\" />\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_hoisted_1","_Fragment","_renderList","__props","n","_normalizeClass"],"mappings":"gQAaEA,EAAA,EAAAC,EAEM,MAFNC,EAEM,QADJD,EAAuGE,EAAA,KAAAC,EAAtFC,EAAA,KAALC,QAAZL,EAAuG,MAAA,CAA/E,IAAKK,EAAG,MAAKC,EAAA,CAAC,OAAM,CAAA,KAAWF,EAAA,IAAA,CAAI,CAAA,EAAK,sBAAyBC,EAAC,CAAA,GAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as R,H as V,y as A,O as $,c as n,a as s,e as c,w as d,t as o,E as D,u as h,g as m,x as b,F as g,f as l,_ as N,s as I,r as v,C as L,j as U,o as t,R as z,A as E,B as S}from"./index-DVCVnKbf.js";import{s as j,c as B}from"./useFormat-DVXTfIS-.js";import{_ as q}from"./SkeletonList.vue_vue_type_script_setup_true_lang-BYHXRCNR.js";import{_ as F}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BFuRxw1l.js";const H={class:"page-head"},T={class:"mute",style:{"font-size":"var(--t-sm)"}},O={style:{"font-size":"var(--t-xl)"}},P={class:"sub"},W={key:0},G={key:1},J={key:2},K={key:3,class:"mute"},M={key:1,class:"panel"},Q={class:"banner failed"},X={class:"panel"},Y={key:1,class:"kvlist"},Z={class:"k"},ee={class:"v"},se={key:0},te={key:1,class:"mute"},ne={class:"v"},ae={key:1,class:"mute"},oe={class:"v"},le={class:"v"},ie={key:0,class:"panel"},de={key:0,class:"banner plain"},re={key:1,class:"code"},ue={key:2,class:"mute"},ye=R({__name:"SpecDetailView",props:{name:{}},setup(y){const f=y,a=v(null),r=v(!0),u=v(""),p=v(!1);async function w(){r.value=!0,p.value=!1;const i=await E.getAuthed(`/api/specs/${encodeURIComponent(f.name)}`);if(r.value=!1,i.status===404){p.value=!0;return}if(!i.ok){u.value=S(i,"load this spec");return}u.value="",a.value=i.body}V(()=>f.name,w,{immediate:!0}),V(()=>z.token,w),A.deploymentsLoaded||$();const x=L(()=>A.deployments.filter(i=>i.specName===f.name));return(i,e)=>{var C;const k=U("RouterLink");return t(),n("div",null,[s("div",H,[s("div",null,[s("div",T,[c(k,{to:"/specs"},{default:d(()=>[...e[0]||(e[0]=[l("← specs",-1)])]),_:1})]),s("h1",O,o(y.name),1),s("div",P,[(C=a.value)!=null&&C.description?(t(),n("span",W,o(a.value.description),1)):p.value?(t(),n("span",G,"not found")):r.value?(t(),n("span",J,"loading…")):(t(),n("span",K,"no description"))])]),e[1]||(e[1]=s("span",{class:"grow"},null,-1)),a.value?(t(),n("span",{key:0,class:D(["badge",a.value.kind])},o(h(j)(a.value.kind)),3)):m("",!0)]),u.value?(t(),b(F,{key:0,text:u.value,title:"Could not load this spec."},null,8,["text"])):m("",!0),p.value?(t(),n("section",M,[s("div",Q,[s("b",null,"No spec named “"+o(y.name)+"”.",1),e[2]||(e[2]=s("p",null,"It may have been deleted, or this is an older link.",-1))])])):(t(),n(g,{key:2},[s("section",X,[r.value?(t(),b(q,{key:0,rows:4})):a.value?(t(),n("ul",Y,[s("li",null,[s("span",Z,[e[4]||(e[4]=l(" Needs ",-1)),c(N,{label:"what needs means"},{default:d(()=>[...e[3]||(e[3]=[l(" Variables the spec uses but does not set. Every deployment referencing it supplies these, which is how one spec serves many stacks — and a missing one is refused by name rather than filled in blank. ",-1)])]),_:1})]),s("span",ee,[a.value.requiredVars.length?(t(),n("b",se,o(a.value.requiredVars.join(", ")),1)):(t(),n("span",te,"nothing — every value is fixed by the spec"))])]),s("li",null,[e[6]||(e[6]=s("span",{class:"k"},"Used by",-1)),s("span",ne,[x.value.length?(t(),n(g,{key:0},[(t(!0),n(g,null,I(x.value,_=>(t(),b(k,{key:_.id,to:`/deployments/${encodeURIComponent(_.id)}`,style:{"margin-right":"10px"}},{default:d(()=>[l(o(_.id),1)]),_:2},1032,["to"]))),128)),c(N,{label:"why this matters"},{default:d(()=>[...e[5]||(e[5]=[l(" Deleting a spec while a deployment still references it is refused: that deployment could no longer be resolved, and one that cannot be resolved can never be torn down. ",-1)])]),_:1})],64)):(t(),n("span",ae,"no deployments reference it"))])]),s("li",null,[e[7]||(e[7]=s("span",{class:"k"},"Created",-1)),s("span",oe,o(h(B)(a.value.createdAt)),1)]),s("li",null,[e[8]||(e[8]=s("span",{class:"k"},"Updated",-1)),s("span",le,o(h(B)(a.value.updatedAt)),1)])])):m("",!0)]),a.value?(t(),n("section",ie,[e[13]||(e[13]=s("div",{class:"phead"},[s("h2",{class:"section"},"Source")],-1)),a.value.sourceWithheld?(t(),n("div",de,[e[12]||(e[12]=s("b",null,"Hidden without an access token.",-1)),s("p",null,[e[10]||(e[10]=l(" A spec's hooks are shell commands, and they often carry a password or an API token inline — so the server does not send the file to an unauthenticated reader. ",-1)),c(k,{to:"/settings"},{default:d(()=>[...e[9]||(e[9]=[l("Add your token",-1)])]),_:1}),e[11]||(e[11]=l(" to see it. ",-1))])])):a.value.source?(t(),n("pre",re,o(a.value.source),1)):(t(),n("p",ue,"The server returned no source for this spec."))])):m("",!0)],64))])}}});export{ye as default};
|
|
2
|
+
//# sourceMappingURL=SpecDetailView-DIi21wo1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpecDetailView-DIi21wo1.js","sources":["../../src/views/SpecDetailView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One stored spec: what it needs, who uses it, and its source.\n *\n * THE SOURCE IS A RESTRICTED READ. Everything else on this API can be read without a token, but a\n * spec's hook bodies are shell strings that routinely carry a credential inline, so the server sends\n * `source` only to an authenticated request and sets `sourceWithheld` otherwise. That is why this\n * one view uses `getAuthed`, and why \"no token\" renders an explanation rather than an empty editor —\n * a blank box would read as an empty spec, which is a different and much more alarming fact.\n */\nimport { computed, ref, watch } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { SpecDetail } from '../api/types';\nimport { state, loadDeployments } from '../composables/useControlPlane';\nimport { settings } from '../composables/useSettings';\nimport { sentence, stamp } from '../composables/useFormat';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst props = defineProps<{ name: string }>();\n\nconst spec = ref<SpecDetail | null>(null);\nconst loading = ref(true);\nconst error = ref('');\nconst missing = ref(false);\n\nasync function load(): Promise<void> {\n loading.value = true;\n missing.value = false;\n const r = await api.getAuthed<SpecDetail>(`/api/specs/${encodeURIComponent(props.name)}`);\n loading.value = false;\n if (r.status === 404) {\n missing.value = true;\n return;\n }\n if (!r.ok) {\n error.value = problem(r, 'load this spec');\n return;\n }\n error.value = '';\n spec.value = r.body;\n}\n\nwatch(() => props.name, load, { immediate: true });\n// Re-fetch when a token is pasted: the same URL returns strictly more with one.\nwatch(() => settings.token, load);\n\nif (!state.deploymentsLoaded) void loadDeployments();\n\n/** Deployments that would become unresolvable if this spec were deleted. */\nconst users = computed(() => state.deployments.filter((d) => d.specName === props.name));\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <div class=\"mute\" style=\"font-size: var(--t-sm)\">\n <RouterLink to=\"/specs\">← specs</RouterLink>\n </div>\n <h1 style=\"font-size: var(--t-xl)\">{{ name }}</h1>\n <div class=\"sub\">\n <span v-if=\"spec?.description\">{{ spec.description }}</span>\n <span v-else-if=\"missing\">not found</span>\n <span v-else-if=\"loading\">loading…</span>\n <span v-else class=\"mute\">no description</span>\n </div>\n </div>\n <span class=\"grow\" />\n <span v-if=\"spec\" class=\"badge\" :class=\"spec.kind\">{{ sentence(spec.kind) }}</span>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not load this spec.\" />\n\n <section v-if=\"missing\" class=\"panel\">\n <div class=\"banner failed\">\n <b>No spec named “{{ name }}”.</b>\n <p>It may have been deleted, or this is an older link.</p>\n </div>\n </section>\n\n <template v-else>\n <section class=\"panel\">\n <SkeletonList v-if=\"loading\" :rows=\"4\" />\n <ul v-else-if=\"spec\" class=\"kvlist\">\n <li>\n <span class=\"k\">\n Needs\n <InfoHint label=\"what needs means\">\n Variables the spec uses but does not set. Every deployment referencing it supplies\n these, which is how one spec serves many stacks — and a missing one is refused by\n name rather than filled in blank.\n </InfoHint>\n </span>\n <span class=\"v\">\n <b v-if=\"spec.requiredVars.length\">{{ spec.requiredVars.join(', ') }}</b>\n <span v-else class=\"mute\">nothing — every value is fixed by the spec</span>\n </span>\n </li>\n <li>\n <span class=\"k\">Used by</span>\n <span class=\"v\">\n <template v-if=\"users.length\">\n <RouterLink\n v-for=\"d in users\"\n :key=\"d.id\"\n :to=\"`/deployments/${encodeURIComponent(d.id)}`\"\n style=\"margin-right: 10px\"\n >{{ d.id }}</RouterLink\n >\n <InfoHint label=\"why this matters\">\n Deleting a spec while a deployment still references it is refused: that deployment\n could no longer be resolved, and one that cannot be resolved can never be torn\n down.\n </InfoHint>\n </template>\n <span v-else class=\"mute\">no deployments reference it</span>\n </span>\n </li>\n <li><span class=\"k\">Created</span><span class=\"v\">{{ stamp(spec.createdAt) }}</span></li>\n <li><span class=\"k\">Updated</span><span class=\"v\">{{ stamp(spec.updatedAt) }}</span></li>\n </ul>\n </section>\n\n <section v-if=\"spec\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Source</h2>\n </div>\n\n <!--\n Withheld, not empty. The server never sent the source, so there is nothing here to reveal —\n the same reasoning as the masked variables: an affordance that promises plaintext the page\n does not have would be a lie.\n -->\n <div v-if=\"spec.sourceWithheld\" class=\"banner plain\">\n <b>Hidden without an access token.</b>\n <p>\n A spec's hooks are shell commands, and they often carry a password or an API token\n inline — so the server does not send the file to an unauthenticated reader.\n <RouterLink to=\"/settings\">Add your token</RouterLink> to see it.\n </p>\n </div>\n <pre v-else-if=\"spec.source\" class=\"code\">{{ spec.source }}</pre>\n <p v-else class=\"mute\">The server returned no source for this spec.</p>\n </section>\n </template>\n </div>\n</template>\n"],"names":["props","__props","spec","ref","loading","error","missing","load","r","api","problem","watch","settings","state","loadDeployments","users","computed","d","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_createVNode","_component_RouterLink","_cache","_hoisted_3","_toDisplayString","_hoisted_4","_a","_hoisted_5","_openBlock","_hoisted_8","_normalizeClass","_unref","sentence","_createBlock","ErrorNote","_hoisted_9","_hoisted_10","_Fragment","_hoisted_11","SkeletonList","_hoisted_12","_hoisted_13","InfoHint","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_renderList","_createTextVNode","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24"],"mappings":"29BAoBA,MAAMA,EAAQC,EAERC,EAAOC,EAAuB,IAAI,EAClCC,EAAUD,EAAI,EAAI,EAClBE,EAAQF,EAAI,EAAE,EACdG,EAAUH,EAAI,EAAK,EAEzB,eAAeI,GAAsB,CACnCH,EAAQ,MAAQ,GAChBE,EAAQ,MAAQ,GAChB,MAAME,EAAI,MAAMC,EAAI,UAAsB,cAAc,mBAAmBT,EAAM,IAAI,CAAC,EAAE,EAExF,GADAI,EAAQ,MAAQ,GACZI,EAAE,SAAW,IAAK,CACpBF,EAAQ,MAAQ,GAChB,MACF,CACA,GAAI,CAACE,EAAE,GAAI,CACTH,EAAM,MAAQK,EAAQF,EAAG,gBAAgB,EACzC,MACF,CACAH,EAAM,MAAQ,GACdH,EAAK,MAAQM,EAAE,IACjB,CAEAG,EAAM,IAAMX,EAAM,KAAMO,EAAM,CAAE,UAAW,GAAM,EAEjDI,EAAM,IAAMC,EAAS,MAAOL,CAAI,EAE3BM,EAAM,mBAAwBC,EAAA,EAGnC,MAAMC,EAAQC,EAAS,IAAMH,EAAM,YAAY,OAAQI,GAAMA,EAAE,WAAajB,EAAM,IAAI,CAAC,yDAIrFkB,EA4FM,MAAA,KAAA,CA3FJC,EAeM,MAfNC,EAeM,CAdJD,EAWM,MAAA,KAAA,CAVJA,EAEM,MAFNE,EAEM,CADJC,EAA4CC,EAAA,CAAhC,GAAG,UAAQ,WAA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AA,KAAA,CAArFK,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAL,EAA8B,OAAA,CAAxB,MAAM,GAAA,EAAI,UAAO,EAAA,GAAOA,EAAkD,OAAlDkC,GAAkD3B,EAA/BO,KAAM/B,EAAA,MAAK,SAAS,CAAA,EAAA,CAAA,CAAA,iBAI9DA,EAAA,OAAf4B,EAAA,EAAAZ,EAoBU,UApBVoC,GAoBU,eAnBRnC,EAEM,MAAA,CAFD,MAAM,SAAO,CAChBA,EAA+B,KAAA,CAA3B,MAAM,SAAA,EAAU,QAAM,CAAA,OAQjBjB,EAAA,MAAK,gBAAhB4B,IAAAZ,EAOM,MAPNqC,GAOM,CANJ/B,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAL,EAAsC,SAAnC,kCAA+B,EAAA,GAClCA,EAII,IAAA,KAAA,iBAJD,mKAGD,EAAA,GAAAG,EAAsDC,EAAA,CAA1C,GAAG,aAAW,WAAC,IAAc,CAAA,GAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAd,iBAAc,EAAA,CAAA,2BAAa,eACxD,EAAA,EAAA,MAEctB,EAAA,MAAK,QAArB4B,EAAA,EAAAZ,EAAiE,MAAjEsC,GAAiE9B,EAApBxB,EAAA,MAAK,MAAM,EAAA,CAAA,QACxDgB,EAAuE,IAAvEuC,GAAuB,8CAA4C,EAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as q,y as g,O as L,c as a,a as t,f as l,e as i,w as y,_ as k,x as C,g as f,F as x,i as U,v as T,s as B,t as d,r as p,A as E,B as $,C as N,j as D,o as s,D as z,E as A,u as R}from"./index-DVCVnKbf.js";import{s as j}from"./useFormat-DVXTfIS-.js";import{_ as F}from"./SkeletonList.vue_vue_type_script_setup_true_lang-BYHXRCNR.js";import{_ as I}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BFuRxw1l.js";import{_ as M}from"./RelativeTime.vue_vue_type_script_setup_true_lang-mVrRpkV_.js";import{E as P}from"./EquivalentCommand-NHzDrg5d.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const K={class:"page-head"},O={class:"sub"},W={key:1,class:"panel"},G={key:2,class:"panel"},H={class:"field",style:{"max-width":"320px","margin-bottom":"var(--s4)"}},J={class:"cards","data-testid":"specs.list"},Q={class:"stagger"},X={class:"name","data-label":"name"},Y={key:0,class:"mute",style:{"font-size":"var(--t-sm)"}},Z={"data-label":"kind"},ee={"data-label":"needs"},te={key:0},se={key:1,class:"mute"},ne={"data-label":"used by"},oe={key:0},ae={key:1,class:"mute"},le={class:"dim nowrap","data-label":"updated"},ie={key:0},de={colspan:"5",class:"mute"},re={key:2,class:"banner plain"},be=q({__name:"SpecsView",setup(pe){const u=p([]),v=p(!1),m=p(""),h=p(!1),c=p("");async function V(){const o=await E.get("/api/specs");if(v.value=!0,o.status===404){h.value=!0;return}if(!o.ok){m.value=$(o,"load specs");return}m.value="",u.value=o.body.specs??[]}V(),g.deploymentsLoaded||L();const b=N(()=>{const o=new Map;for(const e of g.deployments){if(!e.specName)continue;const r=o.get(e.specName)??[];r.push(e.id),o.set(e.specName,r)}return o}),_=N(()=>{const o=c.value.trim().toLowerCase();return o?u.value.filter(e=>e.name.toLowerCase().includes(o)||(e.description??"").toLowerCase().includes(o)):u.value});return(o,e)=>{const r=D("RouterLink");return s(),a("div",null,[t("div",K,[t("div",null,[e[3]||(e[3]=t("h1",null,"Specs",-1)),t("div",O,[e[2]||(e[2]=l(" Stored once, used by any number of deployments ",-1)),i(k,{label:"why store a spec"},{default:y(()=>[...e[1]||(e[1]=[l(" Without this, every deployment carries its own copy — 50 open pull requests meant 50 identical files, and fixing a teardown step meant re-submitting it 50 times. ",-1)])]),_:1})])])]),m.value?(s(),C(I,{key:0,text:m.value,title:"Could not load the specs."},null,8,["text"])):f("",!0),h.value?(s(),a("section",W,[...e[4]||(e[4]=[t("div",{class:"banner plain"},[t("b",null,"This server has no stored specs."),t("p",null," It is an older build of pstack — every deployment carries its own copy of its spec, which still works. Upgrade the host to store specs and reference them by name. ")],-1)])])):(s(),a("section",G,[v.value?u.value.length?(s(),a(x,{key:1},[t("div",H,[e[5]||(e[5]=t("label",{for:"q"},"Search",-1)),U(t("input",{id:"q","onUpdate:modelValue":e[0]||(e[0]=n=>c.value=n),type:"search",placeholder:"name or description"},null,512),[[T,c.value]])]),t("table",J,[t("thead",null,[t("tr",null,[e[8]||(e[8]=t("th",null,"Name",-1)),e[9]||(e[9]=t("th",null,"Kind",-1)),t("th",null,[e[7]||(e[7]=l(" needs ",-1)),i(k,{label:"what needs means"},{default:y(()=>[...e[6]||(e[6]=[l(" Variables the spec uses but does not set. Every deployment referencing it must supply these, which is how one spec serves many stacks. ",-1)])]),_:1})]),e[10]||(e[10]=t("th",null,"Used by",-1)),e[11]||(e[11]=t("th",null,"Updated",-1))])]),t("tbody",Q,[(s(!0),a(x,null,B(_.value,(n,S)=>{var w;return s(),a("tr",{key:n.name,style:z({"--i":S})},[t("td",X,[i(r,{to:`/specs/${encodeURIComponent(n.name)}`},{default:y(()=>[l(d(n.name),1)]),_:2},1032,["to"]),n.description?(s(),a("div",Y,d(n.description),1)):f("",!0)]),t("td",Z,[t("span",{class:A(["badge",n.kind])},d(R(j)(n.kind)),3)]),t("td",ee,[n.requiredVars.length?(s(),a("span",te,d(n.requiredVars.join(", ")),1)):(s(),a("span",se,"nothing"))]),t("td",ne,[(w=b.value.get(n.name))!=null&&w.length?(s(),a("span",oe,d(b.value.get(n.name).length)+" deployment(s) ",1)):(s(),a("span",ae,"nothing yet"))]),t("td",le,[i(M,{at:n.updatedAt},null,8,["at"])])],4)}),128)),_.value.length?f("",!0):(s(),a("tr",ie,[t("td",de,"No spec matches “"+d(c.value)+"”.",1)]))])])],64)):(s(),a("div",re,[e[15]||(e[15]=t("b",null,"No specs stored yet.",-1)),t("p",null,[e[13]||(e[13]=l(" A deployment can carry its own spec inline — see ",-1)),i(r,{to:"/submit"},{default:y(()=>[...e[12]||(e[12]=[l("Submit",-1)])]),_:1}),e[14]||(e[14]=l(" — and that is all you need for a one-off. Storing one here pays off when several deployments share it. ",-1))]),e[16]||(e[16]=t("p",{class:"mute"},"This page cannot store one yet — the command below does.",-1)),i(P,{what:"storing a spec",method:"PUT",path:"/api/specs/my-spec",body:{spec:"…the contents of your preview.yml…"},cli:"pstack validate -f preview.yml # then PUT it with the curl above"})])):(s(),C(F,{key:0,rows:3}))]))])}}});export{be as default};
|
|
2
|
+
//# sourceMappingURL=SpecsView-B49LI4Ut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpecsView-B49LI4Ut.js","sources":["../../src/views/SpecsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Stored specs: what is on this host, and who is using each one.\n *\n * The \"used by\" count is computed from the deployments already in shared state rather than asked\n * for: every row carries `specName`, so the join is free. It matters because deleting a spec that\n * deployments still reference is refused — a deployment that cannot resolve its spec can never be\n * torn down — so knowing the count before you try is the difference between a plan and a 409.\n *\n * A server built before named specs answers 404 here. That is a capability difference, not an\n * error, so it gets its own explanation instead of a red banner.\n */\nimport { computed, ref } from 'vue';\nimport { sentence } from '../composables/useFormat';\nimport { api, problem } from '../api/client';\nimport type { SpecMeta, SpecsResponse } from '../api/types';\nimport { state, loadDeployments } from '../composables/useControlPlane';\n\nimport SkeletonList from '../components/SkeletonList.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport RelativeTime from '../components/RelativeTime.vue';\nimport EquivalentCommand from '../components/EquivalentCommand.vue';\n\nconst specs = ref<SpecMeta[]>([]);\nconst loaded = ref(false);\nconst error = ref('');\nconst unsupported = ref(false);\nconst needle = ref('');\n\nasync function load(): Promise<void> {\n const r = await api.get<SpecsResponse>('/api/specs');\n loaded.value = true;\n if (r.status === 404) {\n unsupported.value = true;\n return;\n }\n if (!r.ok) {\n error.value = problem(r, 'load specs');\n return;\n }\n error.value = '';\n specs.value = r.body.specs ?? [];\n}\n\nvoid load();\n// The deployment list is what the \"used by\" column joins against; a deep link straight here may\n// arrive before the shell's poll has filled it.\nif (!state.deploymentsLoaded) void loadDeployments();\n\n/** Deployment ids referencing each spec, by spec name. */\nconst users = computed(() => {\n const m = new Map<string, string[]>();\n for (const d of state.deployments) {\n if (!d.specName) continue;\n const list = m.get(d.specName) ?? [];\n list.push(d.id);\n m.set(d.specName, list);\n }\n return m;\n});\n\nconst shown = computed(() => {\n const q = needle.value.trim().toLowerCase();\n if (!q) return specs.value;\n return specs.value.filter(\n (s) => s.name.toLowerCase().includes(q) || (s.description ?? '').toLowerCase().includes(q),\n );\n});\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Specs</h1>\n <div class=\"sub\">\n Stored once, used by any number of deployments\n <InfoHint label=\"why store a spec\">\n Without this, every deployment carries its own copy — 50 open pull requests meant 50\n identical files, and fixing a teardown step meant re-submitting it 50 times.\n </InfoHint>\n </div>\n </div>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not load the specs.\" />\n\n <section v-if=\"unsupported\" class=\"panel\">\n <div class=\"banner plain\">\n <b>This server has no stored specs.</b>\n <p>\n It is an older build of pstack — every deployment carries its own copy of its spec, which\n still works. Upgrade the host to store specs and reference them by name.\n </p>\n </div>\n </section>\n\n <section v-else class=\"panel\">\n <SkeletonList v-if=\"!loaded\" :rows=\"3\" />\n\n <template v-else-if=\"specs.length\">\n <div class=\"field\" style=\"max-width: 320px; margin-bottom: var(--s4)\">\n <label for=\"q\">Search</label>\n <input id=\"q\" v-model=\"needle\" type=\"search\" placeholder=\"name or description\" />\n </div>\n\n <table class=\"cards\" data-testid=\"specs.list\">\n <thead>\n <tr>\n <th>Name</th>\n <th>Kind</th>\n <th>\n needs\n <InfoHint label=\"what needs means\">\n Variables the spec uses but does not set. Every deployment referencing it must\n supply these, which is how one spec serves many stacks.\n </InfoHint>\n </th>\n <th>Used by</th>\n <th>Updated</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(s, i) in shown\" :key=\"s.name\" :style=\"{ '--i': i }\">\n <td class=\"name\" data-label=\"name\">\n <RouterLink :to=\"`/specs/${encodeURIComponent(s.name)}`\">{{ s.name }}</RouterLink>\n <div v-if=\"s.description\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n {{ s.description }}\n </div>\n </td>\n <td data-label=\"kind\">\n <span class=\"badge\" :class=\"s.kind\">{{ sentence(s.kind) }}</span>\n </td>\n <td data-label=\"needs\">\n <span v-if=\"s.requiredVars.length\">{{ s.requiredVars.join(', ') }}</span>\n <span v-else class=\"mute\">nothing</span>\n </td>\n <td data-label=\"used by\">\n <span v-if=\"users.get(s.name)?.length\">\n {{ users.get(s.name)!.length }} deployment(s)\n </span>\n <span v-else class=\"mute\">nothing yet</span>\n </td>\n <td class=\"dim nowrap\" data-label=\"updated\"><RelativeTime :at=\"s.updatedAt\" /></td>\n </tr>\n <tr v-if=\"!shown.length\">\n <td colspan=\"5\" class=\"mute\">No spec matches “{{ needle }}”.</td>\n </tr>\n </tbody>\n </table>\n </template>\n\n <!--\n Honest empty state. This page cannot create a spec yet, so pointing at \"New spec\" would be a\n dead end — it names the way that does work instead.\n -->\n <div v-else class=\"banner plain\">\n <b>No specs stored yet.</b>\n <p>\n A deployment can carry its own spec inline — see\n <RouterLink to=\"/submit\">Submit</RouterLink> — and that is all you need for a one-off.\n Storing one here pays off when several deployments share it.\n </p>\n <p class=\"mute\">This page cannot store one yet — the command below does.</p>\n <EquivalentCommand\n what=\"storing a spec\"\n method=\"PUT\"\n path=\"/api/specs/my-spec\"\n :body=\"{ spec: '…the contents of your preview.yml…' }\"\n cli=\"pstack validate -f preview.yml # then PUT it with the curl above\"\n />\n </div>\n </section>\n </div>\n</template>\n"],"names":["specs","ref","loaded","error","unsupported","needle","load","r","api","problem","state","loadDeployments","users","computed","m","d","list","shown","q","s","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_createVNode","InfoHint","_createBlock","ErrorNote","_openBlock","_hoisted_3","_hoisted_4","_Fragment","_hoisted_5","$event","_hoisted_6","_hoisted_7","_renderList","i","_hoisted_8","_component_RouterLink","_createTextVNode","_toDisplayString","_hoisted_9","_hoisted_10","_normalizeClass","_unref","sentence","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_a","_hoisted_15","_hoisted_16","_hoisted_17","RelativeTime","_hoisted_18","_hoisted_19","_hoisted_20","EquivalentCommand","SkeletonList"],"mappings":"0sCAwBA,MAAMA,EAAQC,EAAgB,EAAE,EAC1BC,EAASD,EAAI,EAAK,EAClBE,EAAQF,EAAI,EAAE,EACdG,EAAcH,EAAI,EAAK,EACvBI,EAASJ,EAAI,EAAE,EAErB,eAAeK,GAAsB,CACnC,MAAMC,EAAI,MAAMC,EAAI,IAAmB,YAAY,EAEnD,GADAN,EAAO,MAAQ,GACXK,EAAE,SAAW,IAAK,CACpBH,EAAY,MAAQ,GACpB,MACF,CACA,GAAI,CAACG,EAAE,GAAI,CACTJ,EAAM,MAAQM,EAAQF,EAAG,YAAY,EACrC,MACF,CACAJ,EAAM,MAAQ,GACdH,EAAM,MAAQO,EAAE,KAAK,OAAS,CAAA,CAChC,CAEKD,EAAA,EAGAI,EAAM,mBAAwBC,EAAA,EAGnC,MAAMC,EAAQC,EAAS,IAAM,CAC3B,MAAMC,MAAQ,IACd,UAAWC,KAAKL,EAAM,YAAa,CACjC,GAAI,CAACK,EAAE,SAAU,SACjB,MAAMC,EAAOF,EAAE,IAAIC,EAAE,QAAQ,GAAK,CAAA,EAClCC,EAAK,KAAKD,EAAE,EAAE,EACdD,EAAE,IAAIC,EAAE,SAAUC,CAAI,CACxB,CACA,OAAOF,CACT,CAAC,EAEKG,EAAQJ,EAAS,IAAM,CAC3B,MAAMK,EAAIb,EAAO,MAAM,KAAA,EAAO,YAAA,EAC9B,OAAKa,EACElB,EAAM,MAAM,OAChBmB,GAAMA,EAAE,KAAK,cAAc,SAASD,CAAC,IAAMC,EAAE,aAAe,IAAI,YAAA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AAiC,EAAmB,YAA/BhC,EAEO,OAAAiC,GAAAX,EADF9B,EAAA,MAAM,IAAIO,EAAE,IAAI,EAAG,MAAM,EAAG,kBACjC,CAAA,QACAC,EAA4C,OAA5CkC,GAA0B,aAAW,EAAA,GAEvCjC,EAAmF,KAAnFkC,GAAmF,CAAvC9B,EAAkC+B,EAAA,CAAnB,GAAIrC,EAAE,SAAA,+BAExDF,EAAA,MAAM,qBAAjBG,EAEK,KAAAqC,GAAA,CADHpC,EAAiE,KAAjEqC,GAA6B,oBAAiBhB,EAAGrC,EAAA,KAAM,EAAG,KAAE,CAAA,CAAA,eAUpEwB,IAAAT,EAeM,MAfNuC,GAeM,CAdJpC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAA2B,SAAxB,uBAAoB,EAAA,GACvBA,EAII,IAAA,KAAA,iBAJD,qDAED,EAAA,GAAAI,EAA4Ce,EAAA,CAAhC,GAAG,WAAS,WAAC,IAAM,CAAA,GAAAjB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAAN,SAAM,EAAA,CAAA,2BAAa,2GAE9C,EAAA,EAAA,GACAA,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAA4E,IAAA,CAAzE,MAAM,MAAA,EAAO,2DAAwD,EAAA,GACxEI,EAMEmC,EAAA,CALA,KAAK,iBACL,OAAO,MACP,KAAK,qBACJ,KAAM,CAAA,KAAA,oCAAA,EACP,IAAI,oEAAA,WAvERjC,EAAyCkC,EAAA,OAAX,KAAM,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{s}from"./useFormat-DVXTfIS-.js";import{d as t,c as n,E as o,a as r,f as c,t as l,u as m,o as p}from"./index-DVCVnKbf.js";const u=t({__name:"StateBadge",props:{state:{}},setup(e){return(d,a)=>(p(),n("span",{class:o(["badge",e.state])},[a[0]||(a[0]=r("span",{class:"dot"},null,-1)),c(" "+l(m(s)(e.state)),1)],2))}});export{u as _};
|
|
2
|
+
//# sourceMappingURL=StateBadge.vue_vue_type_script_setup_true_lang-DANvveJ6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateBadge.vue_vue_type_script_setup_true_lang-DANvveJ6.js","sources":["../../src/components/StateBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The job states, and only these. Kept in one component so the colour of `leaked` can never drift\n * from the colour of `failed` in one view and not another:\n *\n * ok green · failed red · leaked AMBER · running blue, pulsing · cancelled grey\n *\n * `cancelled` is deliberately quiet: someone meant to stop it, so it is not an alarm — but it is\n * not `ok` either, because whatever the job had already done was left exactly as it was.\n *\n * `leaked` must be unmistakably distinct from `failed`. They are different problems with different\n * owners — \"teardown errored\" versus \"teardown ran and something survived\" — which is why the CLI\n * gives leaked its own exit code, and why this app never renders them in the same colour.\n */\nimport type { JobState } from '../api/types';\nimport { sentence } from '../composables/useFormat';\n\ndefineProps<{ state: JobState }>();\n</script>\n\n<template>\n <span class=\"badge\" :class=\"state\">\n <span class=\"dot\" />\n {{ sentence(state) }}\n </span>\n</template>\n"],"names":["_createElementBlock","_normalizeClass","__props","_createElementVNode","_toDisplayString","_unref","sentence"],"mappings":"2MAqBEA,EAGO,OAAA,CAHD,MAAKC,EAAA,CAAC,QAAgBC,EAAA,KAAK,CAAA,CAAA,eAC/BC,EAAoB,OAAA,CAAd,MAAM,KAAA,EAAK,KAAA,EAAA,KAAG,IACpBC,EAAGC,EAAAC,CAAA,EAASJ,EAAA,KAAK,CAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as J,r as h,A as I,H as j,c as n,a as t,t as m,f as o,F as T,e as p,w as y,g as v,E as Q,i as V,v as E,_ as R,a0 as O,s as Y,x as Z,C as A,j as _,o as a,l as ee,O as te,N as se,B as oe,U as D}from"./index-
|
|
1
|
+
import{d as J,r as h,A as I,H as j,c as n,a as t,t as m,f as o,F as T,e as p,w as y,g as v,E as Q,i as V,v as E,_ as R,a0 as O,s as Y,x as Z,C as A,j as _,o as a,l as ee,O as te,N as se,B as oe,U as D}from"./index-DVCVnKbf.js";import{a as le,w as ae,p as F,r as ne}from"./useVars-VN9gYdR6.js";import{_ as ie}from"./ActionButton.vue_vue_type_script_setup_true_lang-D06apM-6.js";import{_ as re}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BFuRxw1l.js";import{_ as de}from"./VarEditor.vue_vue_type_script_setup_true_lang-D--Rd-Mv.js";import{_ as ue}from"./SelectMenu.vue_vue_type_script_setup_true_lang-qGkx2MwW.js";import"./Teleport-d5PoAxFM.js";const pe={class:"page-head"},ve={class:"sub"},me={class:"panel"},ye={key:0,class:"banner warn"},ce={key:0},he={key:1},fe={key:2},ke={key:3},be={key:2,class:"banner warn"},ge={class:"row",style:{"margin-bottom":"var(--s4)"}},we={class:"field",style:{"max-width":"280px"}},Se={class:"mute",style:{"align-self":"end","padding-bottom":"10px"}},xe={key:3,class:"row",style:{"margin-bottom":"var(--s4)"}},$e={class:"check"},Ce={class:"check"},Te={class:"field",style:{"max-width":"340px"}},Ve={key:0,class:"hint"},Re={key:0},Ae={key:1},Le={key:2},Ue={class:"field"},Ne={class:"field",style:{"margin-top":"var(--s3)"}},Ie={class:"hint"},Ee={class:"hint"},Pe={class:"row",style:{"margin-top":"var(--s5)"}},We={key:0,class:"mute",style:{"font-size":"var(--t-sm)"}},je={key:1,class:"s-ok"},Oe={key:6,class:"banner warn"},De={key:0},Fe=`services:
|
|
2
2
|
app:
|
|
3
3
|
image: nginx:alpine
|
|
4
4
|
profiles: [app]
|
|
@@ -43,8 +43,8 @@ axes:
|
|
|
43
43
|
assert_gone: |
|
|
44
44
|
test -d /tmp || exit 1
|
|
45
45
|
! test -d /tmp/$STACK
|
|
46
|
-
`;function X(){k.value="inline",l.value.spec=H(z()),l.value.compose.trim()||(l.value.compose=Fe),l.value.id||(l.value.id="pr-123"),f.value.some(s=>s.k)||(f.value=[{k:"PR",v:"123"}])}return(s,e)=>{var u,N;const r=_("RouterLink");return a(),n("div",null,[t("div",pe,[t("div",null,[t("h1",null,m(U.value?"Edit a deployment":C.value?"Duplicate a deployment":"Submit a deployment"),1),t("div",ve,m(U.value?"Loaded from what is stored; saving replaces the record":C.value?`Copied from ${C.value} — give it a new id, then edit`:"Stores a spec so it can be deployed"),1)]),e[7]||(e[7]=t("span",{class:"grow"},null,-1)),t("button",{class:"ghost",onClick:X},"Load example spec")]),t("section",me,[C.value&&!U.value?(a(),n("div",ye,[e[20]||(e[20]=t("b",null,"Change the stack, not just the id.",-1)),t("p",null,[e[11]||(e[11]=o(" Two deployments that resolve to the same ",-1)),e[12]||(e[12]=t("code",null,"stack",-1)),e[13]||(e[13]=o(" drive the same compose project — ",-1)),e[14]||(e[14]=t("code",null,"down",-1)),e[15]||(e[15]=o(" on either stops the other's containers. If the stack interpolates a variable (",-1)),e[16]||(e[16]=t("code",null,"pr-${PR}",-1)),e[17]||(e[17]=o(") give it a different value below; if it is a literal, edit the ",-1)),e[18]||(e[18]=t("code",null,"stack:",-1)),e[19]||(e[19]=o(" line. ",-1)),c.value==="withheld"?(a(),n(T,{key:0},[e[9]||(e[9]=o(" The spec could not be copied without an access token — ",-1)),p(r,{to:"/settings"},{default:y(()=>[...e[8]||(e[8]=[o("add yours",-1)])]),_:1}),e[10]||(e[10]=o(". ",-1))],64)):v("",!0)])])):v("",!0),U.value?(a(),n("div",{key:1,class:Q(["banner",c.value==="loaded"?"info":"warn"])},[t("b",null,"Replacing "+m(P.id)+".",1),c.value==="loading"?(a(),n("p",ce,"Loading what is stored…")):c.value==="loaded"?(a(),n("p",he," Loaded from the stored record — edit it and save. Saving replaces the record outright, so anything you delete here stops being tracked while whatever it created keeps running. ")):c.value==="withheld"?(a(),n("p",fe,[e[22]||(e[22]=o(" The stored spec was not loaded: reading it needs an access token, because hooks routinely carry a credential inline. ",-1)),p(r,{to:"/settings"},{default:y(()=>[...e[21]||(e[21]=[o("Add your token",-1)])]),_:1}),e[23]||(e[23]=o(" to edit in place — otherwise paste the ",-1)),e[24]||(e[24]=t("b",null,"complete",-1)),e[25]||(e[25]=o(" spec, since anything you leave out stops being tracked. ",-1))])):(a(),n("p",ke,[...e[26]||(e[26]=[o(" The stored spec could not be loaded, so this form is empty. Paste the ",-1),t("b",null,"complete",-1),o(" spec you want stored — anything you leave out stops being tracked while whatever it created keeps running. ",-1)])]))],2)):v("",!0),b.value?(a(),n("div",be,[t("b",null,"This deployment tracks the stored spec “"+m(b.value)+"”.",1),t("p",null,[e[28]||(e[28]=o(" Saving here writes a private copy and stops it following that spec. To change every deployment using it, edit ",-1)),p(r,{to:`/specs/${encodeURIComponent(b.value)}`},{default:y(()=>[...e[27]||(e[27]=[o("the spec",-1)])]),_:1},8,["to"]),e[29]||(e[29]=o(" instead. ",-1))])])):v("",!0),t("div",ge,[t("div",we,[e[30]||(e[30]=t("label",{for:"did"},"Deployment id",-1)),V(t("input",{id:"did","onUpdate:modelValue":e[0]||(e[0]=i=>l.value.id=i),type:"text",placeholder:"pr-123",spellcheck:"false",autocomplete:"off"},null,512),[[E,l.value.id,void 0,{trim:!0}]])]),t("span",Se,[e[32]||(e[32]=o(" Lower case ",-1)),p(R,{label:"allowed characters in a deployment id"},{default:y(()=>[...e[31]||(e[31]=[o(" Starts with a letter or digit, then letters, digits, dot, dash or underscore. Up to 64 characters — ",-1),t("code",null,"[a-z0-9][a-z0-9._-]{0,63}",-1),o(". ",-1)])]),_:1})])]),x.value.length?(a(),n("div",xe,[t("label",$e,[V(t("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>k.value=i),type:"radio",value:"inline"},null,512),[[O,k.value]]),e[33]||(e[33]=o(" inline spec ",-1))]),t("label",Ce,[V(t("input",{"onUpdate:modelValue":e[2]||(e[2]=i=>k.value=i),type:"radio",value:"stored"},null,512),[[O,k.value]]),e[34]||(e[34]=o(" reference a stored spec ",-1))])])):v("",!0),k.value==="stored"&&x.value.length?(a(),n(T,{key:4},[t("div",Te,[e[35]||(e[35]=t("label",{for:"sn"},"Stored spec",-1)),p(ue,{modelValue:w.value,"onUpdate:modelValue":e[3]||(e[3]=i=>w.value=i),id:"sn",label:"Stored spec",options:q.value},null,8,["modelValue","options"])]),$.value?(a(),n("p",Ve,[$.value.description?(a(),n("span",Re,m($.value.description)+" — ",1)):v("",!0),e[37]||(e[37]=o(" needs ",-1)),$.value.requiredVars.length?(a(),n("b",Ae,m($.value.requiredVars.join(", ")),1)):(a(),n("span",Le,"no variables")),e[38]||(e[38]=o(". ",-1)),p(R,{label:"why variables are required"},{default:y(()=>[...e[36]||(e[36]=[o(" A missing variable is refused by name. It is never filled in with a blank, which would silently give every deployment the same stack name. ",-1)])]),_:1})])):v("",!0)],64)):(a(),n(T,{key:5},[t("div",Ue,[e[39]||(e[39]=t("label",{for:"spec"},"
|
|
46
|
+
`;function X(){k.value="inline",l.value.spec=H(z()),l.value.compose.trim()||(l.value.compose=Fe),l.value.id||(l.value.id="pr-123"),f.value.some(s=>s.k)||(f.value=[{k:"PR",v:"123"}])}return(s,e)=>{var u,N;const r=_("RouterLink");return a(),n("div",null,[t("div",pe,[t("div",null,[t("h1",null,m(U.value?"Edit a deployment":C.value?"Duplicate a deployment":"Submit a deployment"),1),t("div",ve,m(U.value?"Loaded from what is stored; saving replaces the record":C.value?`Copied from ${C.value} — give it a new id, then edit`:"Stores a spec so it can be deployed"),1)]),e[7]||(e[7]=t("span",{class:"grow"},null,-1)),t("button",{class:"ghost",onClick:X},"Load example spec")]),t("section",me,[C.value&&!U.value?(a(),n("div",ye,[e[20]||(e[20]=t("b",null,"Change the stack, not just the id.",-1)),t("p",null,[e[11]||(e[11]=o(" Two deployments that resolve to the same ",-1)),e[12]||(e[12]=t("code",null,"stack",-1)),e[13]||(e[13]=o(" drive the same compose project — ",-1)),e[14]||(e[14]=t("code",null,"down",-1)),e[15]||(e[15]=o(" on either stops the other's containers. If the stack interpolates a variable (",-1)),e[16]||(e[16]=t("code",null,"pr-${PR}",-1)),e[17]||(e[17]=o(") give it a different value below; if it is a literal, edit the ",-1)),e[18]||(e[18]=t("code",null,"stack:",-1)),e[19]||(e[19]=o(" line. ",-1)),c.value==="withheld"?(a(),n(T,{key:0},[e[9]||(e[9]=o(" The spec could not be copied without an access token — ",-1)),p(r,{to:"/settings"},{default:y(()=>[...e[8]||(e[8]=[o("add yours",-1)])]),_:1}),e[10]||(e[10]=o(". ",-1))],64)):v("",!0)])])):v("",!0),U.value?(a(),n("div",{key:1,class:Q(["banner",c.value==="loaded"?"info":"warn"])},[t("b",null,"Replacing "+m(P.id)+".",1),c.value==="loading"?(a(),n("p",ce,"Loading what is stored…")):c.value==="loaded"?(a(),n("p",he," Loaded from the stored record — edit it and save. Saving replaces the record outright, so anything you delete here stops being tracked while whatever it created keeps running. ")):c.value==="withheld"?(a(),n("p",fe,[e[22]||(e[22]=o(" The stored spec was not loaded: reading it needs an access token, because hooks routinely carry a credential inline. ",-1)),p(r,{to:"/settings"},{default:y(()=>[...e[21]||(e[21]=[o("Add your token",-1)])]),_:1}),e[23]||(e[23]=o(" to edit in place — otherwise paste the ",-1)),e[24]||(e[24]=t("b",null,"complete",-1)),e[25]||(e[25]=o(" spec, since anything you leave out stops being tracked. ",-1))])):(a(),n("p",ke,[...e[26]||(e[26]=[o(" The stored spec could not be loaded, so this form is empty. Paste the ",-1),t("b",null,"complete",-1),o(" spec you want stored — anything you leave out stops being tracked while whatever it created keeps running. ",-1)])]))],2)):v("",!0),b.value?(a(),n("div",be,[t("b",null,"This deployment tracks the stored spec “"+m(b.value)+"”.",1),t("p",null,[e[28]||(e[28]=o(" Saving here writes a private copy and stops it following that spec. To change every deployment using it, edit ",-1)),p(r,{to:`/specs/${encodeURIComponent(b.value)}`},{default:y(()=>[...e[27]||(e[27]=[o("the spec",-1)])]),_:1},8,["to"]),e[29]||(e[29]=o(" instead. ",-1))])])):v("",!0),t("div",ge,[t("div",we,[e[30]||(e[30]=t("label",{for:"did"},"Deployment id",-1)),V(t("input",{id:"did","onUpdate:modelValue":e[0]||(e[0]=i=>l.value.id=i),type:"text",placeholder:"pr-123",spellcheck:"false",autocomplete:"off"},null,512),[[E,l.value.id,void 0,{trim:!0}]])]),t("span",Se,[e[32]||(e[32]=o(" Lower case ",-1)),p(R,{label:"allowed characters in a deployment id"},{default:y(()=>[...e[31]||(e[31]=[o(" Starts with a letter or digit, then letters, digits, dot, dash or underscore. Up to 64 characters — ",-1),t("code",null,"[a-z0-9][a-z0-9._-]{0,63}",-1),o(". ",-1)])]),_:1})])]),x.value.length?(a(),n("div",xe,[t("label",$e,[V(t("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>k.value=i),type:"radio",value:"inline"},null,512),[[O,k.value]]),e[33]||(e[33]=o(" inline spec ",-1))]),t("label",Ce,[V(t("input",{"onUpdate:modelValue":e[2]||(e[2]=i=>k.value=i),type:"radio",value:"stored"},null,512),[[O,k.value]]),e[34]||(e[34]=o(" reference a stored spec ",-1))])])):v("",!0),k.value==="stored"&&x.value.length?(a(),n(T,{key:4},[t("div",Te,[e[35]||(e[35]=t("label",{for:"sn"},"Stored spec",-1)),p(ue,{modelValue:w.value,"onUpdate:modelValue":e[3]||(e[3]=i=>w.value=i),id:"sn",label:"Stored spec",options:q.value},null,8,["modelValue","options"])]),$.value?(a(),n("p",Ve,[$.value.description?(a(),n("span",Re,m($.value.description)+" — ",1)):v("",!0),e[37]||(e[37]=o(" needs ",-1)),$.value.requiredVars.length?(a(),n("b",Ae,m($.value.requiredVars.join(", ")),1)):(a(),n("span",Le,"no variables")),e[38]||(e[38]=o(". ",-1)),p(R,{label:"why variables are required"},{default:y(()=>[...e[36]||(e[36]=[o(" A missing variable is refused by name. It is never filled in with a blank, which would silently give every deployment the same stack name. ",-1)])]),_:1})])):v("",!0)],64)):(a(),n(T,{key:5},[t("div",Ue,[e[39]||(e[39]=t("label",{for:"spec"},"Spec.yml",-1)),V(t("textarea",{id:"spec","onUpdate:modelValue":e[4]||(e[4]=i=>l.value.spec=i),rows:"12",spellcheck:"false",placeholder:`version: 1
|
|
47
47
|
kind: isolated
|
|
48
48
|
stack: pr-\${PR}
|
|
49
49
|
axes: []`},null,512),[[E,l.value.spec]])]),t("div",Ne,[e[40]||(e[40]=t("label",{for:"compose"},[o("compose.yml "),t("span",{class:"mute"},"(optional)")],-1)),V(t("textarea",{id:"compose","onUpdate:modelValue":e[5]||(e[5]=i=>l.value.compose=i),rows:"6",spellcheck:"false",placeholder:"Written next to spec.yml, so a compose file named compose.yml resolves"},null,512),[[E,l.value.compose]])]),t("p",Ie,[e[42]||(e[42]=o(" Hooks must be inline shell or an absolute path. ",-1)),p(R,{label:"why a relative script path does not work"},{default:y(()=>[...e[41]||(e[41]=[o(" A deployment directory only ever holds ",-1),t("code",null,"spec.yml",-1),o(" and ",-1),t("code",null,"compose.yml",-1),o(", and hooks run from there — so ",-1),t("code",null,"up: ./hooks/db.sh",-1),o(" has nothing to find. ",-1)])]),_:1})])],64)),e[55]||(e[55]=t("h2",{class:"section",style:{margin:"var(--s5) 0 var(--s3)"}},"Variables",-1)),p(de,{modelValue:f.value,"onUpdate:modelValue":e[6]||(e[6]=i=>f.value=i)},null,8,["modelValue"]),t("p",Ee,[e[44]||(e[44]=o(" Saved with the deployment, so tearing it down later targets the same stack. ",-1)),p(R,{label:"how variables are remembered"},{default:y(()=>[...e[43]||(e[43]=[o(" They are stored on the server where it supports that, and in this browser either way — so the actions on the deployment page send exactly these values. ",-1)])]),_:1})]),t("div",Pe,[p(ie,{variant:"primary",pending:S.value,disabled:!B.value,onClick:K},{default:y(()=>[o(m(S.value?"Submitting…":"Submit"),1)]),_:1},8,["pending","disabled"]),d.value?v("",!0):(a(),n("span",We,[e[46]||(e[46]=o(" Nothing is saved until the spec is valid ",-1)),p(R,{label:"what happens on a rejected submission"},{default:y(()=>[...e[45]||(e[45]=[o(" The spec is checked before anything is written, so a rejected submission leaves nothing behind — and a replace never destroys a good record over a typo. Whether the deployment is shared or isolated comes from the spec, not from this form. ",-1)])]),_:1})])),d.value?(a(),n("span",je,[o(m(d.value.created?"Created":"Replaced")+" — stack ",1),t("b",null,m(d.value.stack),1),p(r,{to:`/deployments/${encodeURIComponent(d.value.id)}`,style:{"margin-left":"8px"}},{default:y(()=>[...e[47]||(e[47]=[o(" open → ",-1)])]),_:1},8,["to"])])):v("",!0)]),(N=(u=d.value)==null?void 0:u.stackSharedWith)!=null&&N.length?(a(),n("div",Oe,[t("b",null,"Another deployment already resolves to stack “"+m(d.value.stack)+"”.",1),t("p",null,[(a(!0),n(T,null,Y(d.value.stackSharedWith,(i,G)=>(a(),n(T,{key:i},[p(r,{to:`/deployments/${encodeURIComponent(i)}`},{default:y(()=>[o(m(i),1)]),_:2},1032,["to"]),G<d.value.stackSharedWith.length-1?(a(),n("span",De,", ")):v("",!0)],64))),128)),e[48]||(e[48]=o("— both records now drive the same compose project, so ",-1)),e[49]||(e[49]=t("code",null,"down",-1)),e[50]||(e[50]=o(" on either stops the other's containers and ",-1)),e[51]||(e[51]=t("code",null,"verify",-1)),e[52]||(e[52]=o(" on either reports the other's leaks. If that was not intended, change this one's ",-1)),e[53]||(e[53]=t("code",null,"stack",-1)),e[54]||(e[54]=o(" and save again. ",-1))])])):v("",!0),g.value?(a(),Z(re,{key:7,text:g.value,title:"The server rejected this submission."},null,8,["text"])):v("",!0)])])}}});export{Ge as default};
|
|
50
|
-
//# sourceMappingURL=SubmitView-
|
|
50
|
+
//# sourceMappingURL=SubmitView-ZYGApCXE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitView-6cqvVYlz.js","sources":["../../src/views/SubmitView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Submit or replace a deployment.\n *\n * The server's 400 is the whole point of this screen. It carries the SpecError verbatim — the key\n * or variable that is wrong, often the corrected form, and the assert-lint warnings about an\n * `assert_gone` that fails open. That text is the tool's main teaching surface, so it is rendered\n * whole, with newlines intact, and never summarised.\n *\n * The spec is parsed BEFORE anything touches disk, so a rejected submission leaves nothing behind\n * and, on a replace, a good record is never destroyed over a typo.\n */\nimport { computed, ref, watch } from 'vue';\nimport { useRoute } from 'vue-router';\nimport { api, problem } from '../api/client';\nimport InfoHint from '../components/InfoHint.vue';\nimport type {\n DeploymentSourceResponse,\n SpecMeta,\n SpecsResponse,\n SubmitResponse,\n VarPair,\n} from '../api/types';\nimport { loadDeployments, rowFor } from '../composables/useControlPlane';\nimport { pairsFromRecord, readVars, recordFromPairs, writeVars } from '../composables/useVars';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport VarEditor from '../components/VarEditor.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\n\nconst props = defineProps<{ id?: string }>();\n\nconst form = ref({ id: props.id ?? '', spec: '', compose: '' });\nconst vars = ref<VarPair[]>([{ k: '', v: '' }]);\nconst source = ref<'inline' | 'stored'>('inline');\nconst specName = ref('');\n\nconst submitting = ref(false);\nconst error = ref('');\nconst result = ref<{\n id: string;\n stack: string;\n created: boolean;\n /** Other deployments resolving to the same stack — reported by the server on a new deployment. */\n stackSharedWith?: string[];\n} | null>(null);\n\n/**\n * Stored specs, when this server has them. A build without `/api/specs` answers 404, which is not\n * an error here — the picker simply is not offered and inline stays the only shape.\n */\nconst specs = ref<SpecMeta[]>([]);\n\n/** `— choose —` stays first: an empty value is a real state here, not a placeholder. */\nconst specOptions = computed(() => [\n { value: '', label: '— choose —' },\n ...specs.value.map((s) => ({ value: s.name, label: s.name, hint: s.kind })),\n]);\nvoid api.get<SpecsResponse>('/api/specs').then((r) => {\n if (r.ok && Array.isArray(r.body.specs)) specs.value = r.body.specs;\n});\n\nconst chosenSpec = computed(() => specs.value.find((s) => s.name === specName.value));\n\nconst replacing = computed(() => !!props.id);\n\n/**\n * Duplicate mode: `/submit?from=<id>` copies an existing deployment's spec, compose and variables into\n * a NEW submission. Distinct from replacing — the id starts empty so you name the new one, and nothing\n * is written over.\n *\n * The `stack:` line is the thing to watch, which is why the banner says so: copy a spec whose stack is a\n * literal and both deployments drive the same compose project, so `down` on either stops the other's\n * containers. A spec whose stack interpolates a variable (`pr-${PR}`) just needs a different value. The\n * server independently reports a collision at submit time — see `stackSharedWith`.\n */\nconst route = useRoute();\nconst copyFrom = computed(() => {\n const v = route.query.from;\n return typeof v === 'string' && v ? v : null;\n});\n\n/**\n * Replacing now PRE-FILLS from what is stored.\n *\n * It used to start empty, because nothing could hand the source back. Replacing is whole-record, so\n * an operator retyping a spec from memory silently dropped whatever they forgot — and a dropped axis\n * stops being tracked while the resources it created keep running. Being unable to read your own\n * submission is what made that a likely mistake rather than a careless one.\n *\n * The body is still cleared FIRST, on every id change. A leftover body from another deployment is the\n * dangerous case: it is perfectly valid YAML, so the PUT would succeed and overwrite the wrong\n * deployment with nothing able to catch it. Clearing first means a failed or withheld fetch leaves the\n * form empty rather than holding someone else's spec.\n */\nconst sourceState = ref<'idle' | 'loading' | 'loaded' | 'withheld' | 'failed'>('idle');\n/** Set when this deployment tracks a stored spec — editing this copy forks it from the original. */\nconst forkWarning = ref<string | null>(null);\n\nasync function loadSource(id: string): Promise<void> {\n sourceState.value = 'loading';\n forkWarning.value = null;\n const r = await api.getAuthed<DeploymentSourceResponse>(\n `/api/deployments/${encodeURIComponent(id)}/source`,\n );\n // A build of the API without the route answers 404; that is a capability difference, not an error,\n // and it must land on the old empty-form behaviour rather than an alarming banner.\n if (r.status === 404 || !r.ok) {\n sourceState.value = 'failed';\n return;\n }\n if (r.body.sourceWithheld) {\n sourceState.value = 'withheld';\n if (r.body.specName) forkWarning.value = r.body.specName;\n return;\n }\n // Only fill if the user has not started typing — a slow fetch must never overwrite their edit.\n if (!form.value.spec) form.value.spec = r.body.spec ?? '';\n if (!form.value.compose) form.value.compose = r.body.compose ?? '';\n if (r.body.specName) forkWarning.value = r.body.specName;\n sourceState.value = 'loaded';\n}\n\n// Duplicate: same fetch, but the id stays empty and the variables come across too, since a copied\n// spec interpolates the same names.\nwatch(\n copyFrom,\n async (from) => {\n if (!from || props.id) return;\n error.value = '';\n result.value = null;\n form.value.spec = '';\n form.value.compose = '';\n const saved = rowFor(from)?.vars;\n if (saved) vars.value = pairsFromRecord(saved);\n await loadSource(from);\n // A copied record's own id is not a name for the new one; the operator picks that.\n form.value.id = '';\n },\n { immediate: true },\n);\n\nwatch(\n () => props.id,\n (id) => {\n error.value = '';\n result.value = null;\n sourceState.value = 'idle';\n forkWarning.value = null;\n if (!id) return;\n if (id !== form.value.id) {\n form.value.spec = '';\n form.value.compose = '';\n }\n form.value.id = id;\n // Seed the variables from what this deployment already uses: replacing a spec usually needs\n // the same ones that resolved it.\n const stored = rowFor(id)?.vars;\n const saved = stored ? pairsFromRecord(stored) : readVars(id);\n if (saved.some((e) => e.k)) vars.value = saved;\n void loadSource(id);\n },\n { immediate: true },\n);\n\nconst canSubmit = computed(\n () =>\n !!form.value.id &&\n (source.value === 'stored' ? !!specName.value : !!form.value.spec.trim()) &&\n !submitting.value,\n);\n\nasync function submit(): Promise<void> {\n submitting.value = true;\n error.value = '';\n result.value = null;\n\n const id = form.value.id;\n const record = recordFromPairs(vars.value);\n /**\n * `vars` are STORED with the deployment on servers that support it, which makes a later `down`\n * resolve the same stack `up` created with no query parameters at all. `env` validates this\n * submission on every server, new or old. Sending both is what keeps this form working against\n * either build — an older server ignores the key it does not know.\n */\n const body: Record<string, unknown> = { vars: record, env: record };\n if (source.value === 'stored') body.specName = specName.value;\n else {\n body.spec = form.value.spec;\n if (form.value.compose.trim()) body.compose = form.value.compose;\n }\n\n const r = await api.put<SubmitResponse>(`/api/deployments/${encodeURIComponent(id)}`, body);\n submitting.value = false;\n\n if (r.status === 200 || r.status === 201) {\n result.value = {\n id: r.body.id ?? id,\n stack: r.body.stack ?? '?',\n created: r.status === 201,\n stackSharedWith: r.body.stackSharedWith,\n };\n // Persist the variables that just validated this spec. On an older server this is the single\n // thing keeping a later `down` pointed at the stack the `up` created.\n writeVars(id, vars.value);\n void loadDeployments();\n toast('ok', `${r.status === 201 ? 'Created' : 'Replaced'} ${id} → ${result.value.stack}`, {\n to: `/deployments/${encodeURIComponent(id)}`,\n toLabel: 'Open',\n });\n return;\n }\n // 400 (SpecError), 409 (a job in flight over this stack), 401, 404 — all rendered verbatim.\n error.value = problem(r, 'save this deployment');\n}\n\n/**\n * The preview domain, guessed from where this page is served.\n *\n * The UI lives on a host UNDER the preview domain (ui.preview.example.com, pstack.preview…), so\n * previews live beside it: drop this page's own first label and that is the base every generated\n * hostname hangs off. localhost and bare IPs have no domain to offer — those keep an honest\n * placeholder rather than generating `pr-123.192.168.1.5`.\n */\nfunction detectPreviewDomain(): string {\n const h = location.hostname;\n if (h === 'localhost' || h.endsWith('.localhost') || /^[\\d.]+$/.test(h) || h.includes(':')) {\n return 'preview.example.com';\n }\n const labels = h.split('.');\n return labels.length >= 3 ? labels.slice(1).join('.') : h;\n}\n\n/**\n * Kept as a function of the domain so the example is true on the host it is loaded on — a spec\n * copied from here should deploy without edits, not after find-and-replacing example.com.\n *\n * The compose half uses `pstack.routing.port`, NOT hand-written traefik labels: pstack generates\n * the router, TLS and network wiring from that one label. A bare `traefik.enable=true` is the\n * OPT-OUT signal (any traefik.* label means \"leave my service alone\") — which is what an older\n * version of this example taught, producing a service that was never reachable.\n */\nconst exampleSpec = (domain: string): string => `version: 1\nkind: isolated\n\n# The stack identity: the compose project name, and $STACK inside every hook.\n# \\${PR} is interpolated ONCE, at resolve time, from the variables sent with the request.\nstack: pr-\\${PR}\n\nenv:\n # The base every generated hostname hangs off: the app below is served at\n # app-pr-\\${PR}.${domain}\n PREVIEW_DOMAIN: ${domain}\n\ncompose:\n file: compose.yml\n # Every service sits behind a profile so a bare \\`up\\` starts nothing.\n # \\`down\\` always enables ALL of them — otherwise the unselected profiles' network leaks.\n profiles: [app]\n\nrequires:\n - name: traefik-network\n assert: docker network inspect traefik >/dev/null 2>&1\n hint: run \\`pstack init\\` on the host first\n\naxes:\n # Hooks run from the deployment directory, which holds only spec.yml and compose.yml —\n # so use inline shell or absolute paths, never ./hooks/foo.sh.\n - name: scratch\n up: mkdir -p /tmp/$STACK\n assert_live: test -d /tmp/$STACK\n down: rm -rf /tmp/$STACK\n # assert_gone MUST FAIL CLOSED. A bare \\`! <probe>\\` reports \"gone\" whenever the probe fails\n # for any reason — a missing CLI, an expired token — turning \"I could not tell\" into\n # \"it is gone\", a false negative on the one thing this tool exists to catch.\n assert_gone: |\n test -d /tmp || exit 1\n ! test -d /tmp/$STACK\n`;\n\nconst EXAMPLE_COMPOSE = `services:\n app:\n image: nginx:alpine\n profiles: [app]\n labels:\n # The ONE label routing needs: pstack generates the Traefik router, TLS and network wiring\n # from it. Writing any traefik.* label yourself is the opt-out — pstack then leaves the\n # service entirely alone, so only do that when you need something the shorthand cannot say.\n - pstack.routing.port=80\n`;\n\nfunction loadExample(): void {\n source.value = 'inline';\n form.value.spec = exampleSpec(detectPreviewDomain());\n if (!form.value.compose.trim()) form.value.compose = EXAMPLE_COMPOSE;\n if (!form.value.id) form.value.id = 'pr-123';\n if (!vars.value.some((e) => e.k)) vars.value = [{ k: 'PR', v: '123' }];\n}\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>\n {{ replacing ? 'Edit a deployment' : copyFrom ? 'Duplicate a deployment' : 'Submit a deployment' }}\n </h1>\n <div class=\"sub\">\n {{\n replacing\n ? 'Loaded from what is stored; saving replaces the record'\n : copyFrom\n ? `Copied from ${copyFrom} — give it a new id, then edit`\n : 'Stores a spec so it can be deployed'\n }}\n </div>\n </div>\n <span class=\"grow\" />\n <button class=\"ghost\" @click=\"loadExample\">Load example spec</button>\n </div>\n\n <section class=\"panel\">\n <!-- The \"nothing saved until valid\" reassurance lives beside the Submit button below — the\n moment of commitment is where a guarantee about committing belongs, not floating above\n an unrelated id field. -->\n\n <!--\n A `PUT` REPLACES the whole record, and this form cannot pre-fill it: the API has no route\n that returns a stored spec. Say that out loud, because a half-remembered spec pasted here\n is still valid YAML — the server will accept it, and the axes the original declared simply\n stop existing as far as the control plane knows, while whatever they created keeps running.\n -->\n <!--\n The one thing that makes duplicating dangerous, said before the form rather than after the\n submission: two records resolving to one stack drive the same compose project.\n -->\n <div v-if=\"copyFrom && !replacing\" class=\"banner warn\">\n <b>Change the stack, not just the id.</b>\n <p>\n Two deployments that resolve to the same <code>stack</code> drive the same compose project —\n <code>down</code> on either stops the other's containers. If the stack interpolates a variable\n (<code>pr-${PR}</code>) give it a different value below; if it is a literal, edit the\n <code>stack:</code> line.\n <template v-if=\"sourceState === 'withheld'\">\n The spec could not be copied without an access token —\n <RouterLink to=\"/settings\">add yours</RouterLink>.\n </template>\n </p>\n </div>\n\n <div v-if=\"replacing\" class=\"banner\" :class=\"sourceState === 'loaded' ? 'info' : 'warn'\">\n <b>Replacing {{ id }}.</b>\n <p v-if=\"sourceState === 'loading'\">Loading what is stored…</p>\n <p v-else-if=\"sourceState === 'loaded'\">\n Loaded from the stored record — edit it and save. Saving replaces the record outright, so\n anything you delete here stops being tracked while whatever it created keeps running.\n </p>\n <p v-else-if=\"sourceState === 'withheld'\">\n The stored spec was not loaded: reading it needs an access token, because hooks routinely\n carry a credential inline. <RouterLink to=\"/settings\">Add your token</RouterLink> to edit\n in place — otherwise paste the <b>complete</b> spec, since anything you leave out stops\n being tracked.\n </p>\n <p v-else>\n The stored spec could not be loaded, so this form is empty. Paste the <b>complete</b> spec\n you want stored — anything you leave out stops being tracked while whatever it created keeps\n running.\n </p>\n </div>\n\n <!--\n A deployment that references a stored spec keeps its own copy of the source. Editing that copy\n forks it: the stored spec every other deployment shares is untouched, and this one stops\n following it. Silent forks are the kind of thing discovered months later.\n -->\n <div v-if=\"forkWarning\" class=\"banner warn\">\n <b>This deployment tracks the stored spec “{{ forkWarning }}”.</b>\n <p>\n Saving here writes a private copy and stops it following that spec. To change every\n deployment using it, edit\n <RouterLink :to=\"`/specs/${encodeURIComponent(forkWarning)}`\">the spec</RouterLink> instead.\n </p>\n </div>\n\n <div class=\"row\" style=\"margin-bottom: var(--s4)\">\n <div class=\"field\" style=\"max-width: 280px\">\n <label for=\"did\">Deployment id</label>\n <input\n id=\"did\"\n v-model.trim=\"form.id\"\n type=\"text\"\n placeholder=\"pr-123\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <span class=\"mute\" style=\"align-self: end; padding-bottom: 10px\">\n Lower case\n <InfoHint label=\"allowed characters in a deployment id\">\n Starts with a letter or digit, then letters, digits, dot, dash or underscore. Up to 64\n characters — <code>[a-z0-9][a-z0-9._-]{0,63}</code>.\n </InfoHint>\n </span>\n </div>\n\n <!-- Offered only when this server actually has stored specs. -->\n <div v-if=\"specs.length\" class=\"row\" style=\"margin-bottom: var(--s4)\">\n <label class=\"check\">\n <input v-model=\"source\" type=\"radio\" value=\"inline\" /> inline spec\n </label>\n <label class=\"check\">\n <input v-model=\"source\" type=\"radio\" value=\"stored\" /> reference a stored spec\n </label>\n </div>\n\n <template v-if=\"source === 'stored' && specs.length\">\n <div class=\"field\" style=\"max-width: 340px\">\n <label for=\"sn\">Stored spec</label>\n <SelectMenu v-model=\"specName\" id=\"sn\" label=\"Stored spec\" :options=\"specOptions\" />\n </div>\n <p v-if=\"chosenSpec\" class=\"hint\">\n <span v-if=\"chosenSpec.description\">{{ chosenSpec.description }} — </span>\n needs\n <b v-if=\"chosenSpec.requiredVars.length\">{{ chosenSpec.requiredVars.join(', ') }}</b>\n <span v-else>no variables</span>.\n <InfoHint label=\"why variables are required\">\n A missing variable is refused by name. It is never filled in with a blank, which would\n silently give every deployment the same stack name.\n </InfoHint>\n </p>\n </template>\n\n <template v-else>\n <div class=\"field\">\n <label for=\"spec\">spec.yml</label>\n <textarea\n id=\"spec\"\n v-model=\"form.spec\"\n rows=\"12\"\n spellcheck=\"false\"\n placeholder=\"version: 1 kind: isolated stack: pr-${PR} axes: []\"\n />\n </div>\n\n <div class=\"field\" style=\"margin-top: var(--s3)\">\n <label for=\"compose\">compose.yml <span class=\"mute\">(optional)</span></label>\n <textarea\n id=\"compose\"\n v-model=\"form.compose\"\n rows=\"6\"\n spellcheck=\"false\"\n placeholder=\"Written next to spec.yml, so a compose file named compose.yml resolves\"\n />\n </div>\n <p class=\"hint\">\n Hooks must be inline shell or an absolute path.\n <InfoHint label=\"why a relative script path does not work\">\n A deployment directory only ever holds <code>spec.yml</code> and\n <code>compose.yml</code>, and hooks run from there — so\n <code>up: ./hooks/db.sh</code> has nothing to find.\n </InfoHint>\n </p>\n </template>\n\n <h2 class=\"section\" style=\"margin: var(--s5) 0 var(--s3)\">Variables</h2>\n <VarEditor v-model=\"vars\" />\n <p class=\"hint\">\n Saved with the deployment, so tearing it down later targets the same stack.\n <InfoHint label=\"how variables are remembered\">\n They are stored on the server where it supports that, and in this browser either way — so\n the actions on the deployment page send exactly these values.\n </InfoHint>\n </p>\n\n <div class=\"row\" style=\"margin-top: var(--s5)\">\n <ActionButton variant=\"primary\" :pending=\"submitting\" :disabled=\"!canSubmit\" @click=\"submit\">\n {{ submitting ? 'Submitting…' : 'Submit' }}\n </ActionButton>\n <span v-if=\"!result\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n Nothing is saved until the spec is valid\n <InfoHint label=\"what happens on a rejected submission\">\n The spec is checked before anything is written, so a rejected submission leaves nothing\n behind — and a replace never destroys a good record over a typo. Whether the deployment\n is shared or isolated comes from the spec, not from this form.\n </InfoHint>\n </span>\n <span v-if=\"result\" class=\"s-ok\">\n {{ result.created ? 'Created' : 'Replaced' }} — stack\n <b>{{ result.stack }}</b>\n <RouterLink :to=\"`/deployments/${encodeURIComponent(result.id)}`\" style=\"margin-left: 8px\">\n open →\n </RouterLink>\n </span>\n </div>\n\n <!--\n The server's rejection text IS the documentation: it names the key, the variable or the\n assert that is wrong, and often prints the corrected form. Rendered whole, newlines and\n indentation intact. Never truncate it, never collapse it, never say \"invalid spec\".\n -->\n <!--\n Reported by the server, which resolved every other deployment to check. Shown after the fact\n because it can only be known once the spec has resolved — and it is a warning, not a rejection:\n it can be deliberate, and refusing over a guess would be worse than saying so.\n -->\n <div v-if=\"result?.stackSharedWith?.length\" class=\"banner warn\">\n <b>Another deployment already resolves to stack “{{ result.stack }}”.</b>\n <p>\n <template v-for=\"(o, i) in result.stackSharedWith\" :key=\"o\">\n <RouterLink :to=\"`/deployments/${encodeURIComponent(o)}`\">{{ o }}</RouterLink\n ><span v-if=\"i < result.stackSharedWith.length - 1\">, </span> </template\n >— both records now drive the same compose project, so <code>down</code> on either stops the\n other's containers and <code>verify</code> on either reports the other's leaks. If that was not\n intended, change this one's <code>stack</code> and save again.\n </p>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"The server rejected this submission.\" />\n </section>\n </div>\n</template>\n"],"names":["EXAMPLE_COMPOSE","props","__props","form","ref","vars","source","specName","submitting","error","result","specs","specOptions","computed","api","r","chosenSpec","replacing","route","useRoute","copyFrom","v","sourceState","forkWarning","loadSource","id","watch","from","saved","_a","rowFor","pairsFromRecord","stored","readVars","e","canSubmit","submit","record","recordFromPairs","body","writeVars","loadDeployments","toast","problem","detectPreviewDomain","h","labels","exampleSpec","domain","loadExample","_createElementBlock","_createElementVNode","_hoisted_1","_toDisplayString","_hoisted_2","_hoisted_3","_openBlock","_hoisted_4","_cache","_Fragment","_createVNode","_component_RouterLink","_normalizeClass","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","$event","_hoisted_12","InfoHint","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","SelectMenu","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_21","_vModelText","_hoisted_22","_hoisted_23","VarEditor","_hoisted_24","_hoisted_25","ActionButton","_hoisted_26","_hoisted_27","_b","_hoisted_28","o","i","_createBlock","ErrorNote"],"mappings":"k8CAyRMA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mDA1PxB,MAAMC,EAAQC,EAERC,EAAOC,EAAI,CAAE,GAAIH,EAAM,IAAM,GAAI,KAAM,GAAI,QAAS,EAAA,CAAI,EACxDI,EAAOD,EAAe,CAAC,CAAE,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AAA,EAAA,IAAAA,EAAA,EAAA,EAAAP,EAAiB,YAAX,OAAI,EAAA,mBAAO,+CACjD,EAAA,GAAAO,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAP,EAAmB,YAAb,SAAM,EAAA,mBAAO,qFACd,EAAA,GAAAO,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAP,EAAkB,YAAZ,QAAK,EAAA,mBAAO,oBAChD,EAAA,EAAA,eAGe1C,EAAA,WAAjBoF,EAAqFC,GAAA,OAA5D,KAAMrF,EAAA,MAAO,MAAM,sCAAA"}
|
|
1
|
+
{"version":3,"file":"SubmitView-ZYGApCXE.js","sources":["../../src/views/SubmitView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Submit or replace a deployment.\n *\n * The server's 400 is the whole point of this screen. It carries the SpecError verbatim — the key\n * or variable that is wrong, often the corrected form, and the assert-lint warnings about an\n * `assert_gone` that fails open. That text is the tool's main teaching surface, so it is rendered\n * whole, with newlines intact, and never summarised.\n *\n * The spec is parsed BEFORE anything touches disk, so a rejected submission leaves nothing behind\n * and, on a replace, a good record is never destroyed over a typo.\n */\nimport { computed, ref, watch } from 'vue';\nimport { useRoute } from 'vue-router';\nimport { api, problem } from '../api/client';\nimport InfoHint from '../components/InfoHint.vue';\nimport type {\n DeploymentSourceResponse,\n SpecMeta,\n SpecsResponse,\n SubmitResponse,\n VarPair,\n} from '../api/types';\nimport { loadDeployments, rowFor } from '../composables/useControlPlane';\nimport { pairsFromRecord, readVars, recordFromPairs, writeVars } from '../composables/useVars';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport VarEditor from '../components/VarEditor.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\n\nconst props = defineProps<{ id?: string }>();\n\nconst form = ref({ id: props.id ?? '', spec: '', compose: '' });\nconst vars = ref<VarPair[]>([{ k: '', v: '' }]);\nconst source = ref<'inline' | 'stored'>('inline');\nconst specName = ref('');\n\nconst submitting = ref(false);\nconst error = ref('');\nconst result = ref<{\n id: string;\n stack: string;\n created: boolean;\n /** Other deployments resolving to the same stack — reported by the server on a new deployment. */\n stackSharedWith?: string[];\n} | null>(null);\n\n/**\n * Stored specs, when this server has them. A build without `/api/specs` answers 404, which is not\n * an error here — the picker simply is not offered and inline stays the only shape.\n */\nconst specs = ref<SpecMeta[]>([]);\n\n/** `— choose —` stays first: an empty value is a real state here, not a placeholder. */\nconst specOptions = computed(() => [\n { value: '', label: '— choose —' },\n ...specs.value.map((s) => ({ value: s.name, label: s.name, hint: s.kind })),\n]);\nvoid api.get<SpecsResponse>('/api/specs').then((r) => {\n if (r.ok && Array.isArray(r.body.specs)) specs.value = r.body.specs;\n});\n\nconst chosenSpec = computed(() => specs.value.find((s) => s.name === specName.value));\n\nconst replacing = computed(() => !!props.id);\n\n/**\n * Duplicate mode: `/submit?from=<id>` copies an existing deployment's spec, compose and variables into\n * a NEW submission. Distinct from replacing — the id starts empty so you name the new one, and nothing\n * is written over.\n *\n * The `stack:` line is the thing to watch, which is why the banner says so: copy a spec whose stack is a\n * literal and both deployments drive the same compose project, so `down` on either stops the other's\n * containers. A spec whose stack interpolates a variable (`pr-${PR}`) just needs a different value. The\n * server independently reports a collision at submit time — see `stackSharedWith`.\n */\nconst route = useRoute();\nconst copyFrom = computed(() => {\n const v = route.query.from;\n return typeof v === 'string' && v ? v : null;\n});\n\n/**\n * Replacing now PRE-FILLS from what is stored.\n *\n * It used to start empty, because nothing could hand the source back. Replacing is whole-record, so\n * an operator retyping a spec from memory silently dropped whatever they forgot — and a dropped axis\n * stops being tracked while the resources it created keep running. Being unable to read your own\n * submission is what made that a likely mistake rather than a careless one.\n *\n * The body is still cleared FIRST, on every id change. A leftover body from another deployment is the\n * dangerous case: it is perfectly valid YAML, so the PUT would succeed and overwrite the wrong\n * deployment with nothing able to catch it. Clearing first means a failed or withheld fetch leaves the\n * form empty rather than holding someone else's spec.\n */\nconst sourceState = ref<'idle' | 'loading' | 'loaded' | 'withheld' | 'failed'>('idle');\n/** Set when this deployment tracks a stored spec — editing this copy forks it from the original. */\nconst forkWarning = ref<string | null>(null);\n\nasync function loadSource(id: string): Promise<void> {\n sourceState.value = 'loading';\n forkWarning.value = null;\n const r = await api.getAuthed<DeploymentSourceResponse>(\n `/api/deployments/${encodeURIComponent(id)}/source`,\n );\n // A build of the API without the route answers 404; that is a capability difference, not an error,\n // and it must land on the old empty-form behaviour rather than an alarming banner.\n if (r.status === 404 || !r.ok) {\n sourceState.value = 'failed';\n return;\n }\n if (r.body.sourceWithheld) {\n sourceState.value = 'withheld';\n if (r.body.specName) forkWarning.value = r.body.specName;\n return;\n }\n // Only fill if the user has not started typing — a slow fetch must never overwrite their edit.\n if (!form.value.spec) form.value.spec = r.body.spec ?? '';\n if (!form.value.compose) form.value.compose = r.body.compose ?? '';\n if (r.body.specName) forkWarning.value = r.body.specName;\n sourceState.value = 'loaded';\n}\n\n// Duplicate: same fetch, but the id stays empty and the variables come across too, since a copied\n// spec interpolates the same names.\nwatch(\n copyFrom,\n async (from) => {\n if (!from || props.id) return;\n error.value = '';\n result.value = null;\n form.value.spec = '';\n form.value.compose = '';\n const saved = rowFor(from)?.vars;\n if (saved) vars.value = pairsFromRecord(saved);\n await loadSource(from);\n // A copied record's own id is not a name for the new one; the operator picks that.\n form.value.id = '';\n },\n { immediate: true },\n);\n\nwatch(\n () => props.id,\n (id) => {\n error.value = '';\n result.value = null;\n sourceState.value = 'idle';\n forkWarning.value = null;\n if (!id) return;\n if (id !== form.value.id) {\n form.value.spec = '';\n form.value.compose = '';\n }\n form.value.id = id;\n // Seed the variables from what this deployment already uses: replacing a spec usually needs\n // the same ones that resolved it.\n const stored = rowFor(id)?.vars;\n const saved = stored ? pairsFromRecord(stored) : readVars(id);\n if (saved.some((e) => e.k)) vars.value = saved;\n void loadSource(id);\n },\n { immediate: true },\n);\n\nconst canSubmit = computed(\n () =>\n !!form.value.id &&\n (source.value === 'stored' ? !!specName.value : !!form.value.spec.trim()) &&\n !submitting.value,\n);\n\nasync function submit(): Promise<void> {\n submitting.value = true;\n error.value = '';\n result.value = null;\n\n const id = form.value.id;\n const record = recordFromPairs(vars.value);\n /**\n * `vars` are STORED with the deployment on servers that support it, which makes a later `down`\n * resolve the same stack `up` created with no query parameters at all. `env` validates this\n * submission on every server, new or old. Sending both is what keeps this form working against\n * either build — an older server ignores the key it does not know.\n */\n const body: Record<string, unknown> = { vars: record, env: record };\n if (source.value === 'stored') body.specName = specName.value;\n else {\n body.spec = form.value.spec;\n if (form.value.compose.trim()) body.compose = form.value.compose;\n }\n\n const r = await api.put<SubmitResponse>(`/api/deployments/${encodeURIComponent(id)}`, body);\n submitting.value = false;\n\n if (r.status === 200 || r.status === 201) {\n result.value = {\n id: r.body.id ?? id,\n stack: r.body.stack ?? '?',\n created: r.status === 201,\n stackSharedWith: r.body.stackSharedWith,\n };\n // Persist the variables that just validated this spec. On an older server this is the single\n // thing keeping a later `down` pointed at the stack the `up` created.\n writeVars(id, vars.value);\n void loadDeployments();\n toast('ok', `${r.status === 201 ? 'Created' : 'Replaced'} ${id} → ${result.value.stack}`, {\n to: `/deployments/${encodeURIComponent(id)}`,\n toLabel: 'Open',\n });\n return;\n }\n // 400 (SpecError), 409 (a job in flight over this stack), 401, 404 — all rendered verbatim.\n error.value = problem(r, 'save this deployment');\n}\n\n/**\n * The preview domain, guessed from where this page is served.\n *\n * The UI lives on a host UNDER the preview domain (ui.preview.example.com, pstack.preview…), so\n * previews live beside it: drop this page's own first label and that is the base every generated\n * hostname hangs off. localhost and bare IPs have no domain to offer — those keep an honest\n * placeholder rather than generating `pr-123.192.168.1.5`.\n */\nfunction detectPreviewDomain(): string {\n const h = location.hostname;\n if (h === 'localhost' || h.endsWith('.localhost') || /^[\\d.]+$/.test(h) || h.includes(':')) {\n return 'preview.example.com';\n }\n const labels = h.split('.');\n return labels.length >= 3 ? labels.slice(1).join('.') : h;\n}\n\n/**\n * Kept as a function of the domain so the example is true on the host it is loaded on — a spec\n * copied from here should deploy without edits, not after find-and-replacing example.com.\n *\n * The compose half uses `pstack.routing.port`, NOT hand-written traefik labels: pstack generates\n * the router, TLS and network wiring from that one label. A bare `traefik.enable=true` is the\n * OPT-OUT signal (any traefik.* label means \"leave my service alone\") — which is what an older\n * version of this example taught, producing a service that was never reachable.\n */\nconst exampleSpec = (domain: string): string => `version: 1\nkind: isolated\n\n# The stack identity: the compose project name, and $STACK inside every hook.\n# \\${PR} is interpolated ONCE, at resolve time, from the variables sent with the request.\nstack: pr-\\${PR}\n\nenv:\n # The base every generated hostname hangs off: the app below is served at\n # app-pr-\\${PR}.${domain}\n PREVIEW_DOMAIN: ${domain}\n\ncompose:\n file: compose.yml\n # Every service sits behind a profile so a bare \\`up\\` starts nothing.\n # \\`down\\` always enables ALL of them — otherwise the unselected profiles' network leaks.\n profiles: [app]\n\nrequires:\n - name: traefik-network\n assert: docker network inspect traefik >/dev/null 2>&1\n hint: run \\`pstack init\\` on the host first\n\naxes:\n # Hooks run from the deployment directory, which holds only spec.yml and compose.yml —\n # so use inline shell or absolute paths, never ./hooks/foo.sh.\n - name: scratch\n up: mkdir -p /tmp/$STACK\n assert_live: test -d /tmp/$STACK\n down: rm -rf /tmp/$STACK\n # assert_gone MUST FAIL CLOSED. A bare \\`! <probe>\\` reports \"gone\" whenever the probe fails\n # for any reason — a missing CLI, an expired token — turning \"I could not tell\" into\n # \"it is gone\", a false negative on the one thing this tool exists to catch.\n assert_gone: |\n test -d /tmp || exit 1\n ! test -d /tmp/$STACK\n`;\n\nconst EXAMPLE_COMPOSE = `services:\n app:\n image: nginx:alpine\n profiles: [app]\n labels:\n # The ONE label routing needs: pstack generates the Traefik router, TLS and network wiring\n # from it. Writing any traefik.* label yourself is the opt-out — pstack then leaves the\n # service entirely alone, so only do that when you need something the shorthand cannot say.\n - pstack.routing.port=80\n`;\n\nfunction loadExample(): void {\n source.value = 'inline';\n form.value.spec = exampleSpec(detectPreviewDomain());\n if (!form.value.compose.trim()) form.value.compose = EXAMPLE_COMPOSE;\n if (!form.value.id) form.value.id = 'pr-123';\n if (!vars.value.some((e) => e.k)) vars.value = [{ k: 'PR', v: '123' }];\n}\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>\n {{ replacing ? 'Edit a deployment' : copyFrom ? 'Duplicate a deployment' : 'Submit a deployment' }}\n </h1>\n <div class=\"sub\">\n {{\n replacing\n ? 'Loaded from what is stored; saving replaces the record'\n : copyFrom\n ? `Copied from ${copyFrom} — give it a new id, then edit`\n : 'Stores a spec so it can be deployed'\n }}\n </div>\n </div>\n <span class=\"grow\" />\n <button class=\"ghost\" @click=\"loadExample\">Load example spec</button>\n </div>\n\n <section class=\"panel\">\n <!-- The \"nothing saved until valid\" reassurance lives beside the Submit button below — the\n moment of commitment is where a guarantee about committing belongs, not floating above\n an unrelated id field. -->\n\n <!--\n A `PUT` REPLACES the whole record, and this form cannot pre-fill it: the API has no route\n that returns a stored spec. Say that out loud, because a half-remembered spec pasted here\n is still valid YAML — the server will accept it, and the axes the original declared simply\n stop existing as far as the control plane knows, while whatever they created keeps running.\n -->\n <!--\n The one thing that makes duplicating dangerous, said before the form rather than after the\n submission: two records resolving to one stack drive the same compose project.\n -->\n <div v-if=\"copyFrom && !replacing\" class=\"banner warn\">\n <b>Change the stack, not just the id.</b>\n <p>\n Two deployments that resolve to the same <code>stack</code> drive the same compose project —\n <code>down</code> on either stops the other's containers. If the stack interpolates a variable\n (<code>pr-${PR}</code>) give it a different value below; if it is a literal, edit the\n <code>stack:</code> line.\n <template v-if=\"sourceState === 'withheld'\">\n The spec could not be copied without an access token —\n <RouterLink to=\"/settings\">add yours</RouterLink>.\n </template>\n </p>\n </div>\n\n <div v-if=\"replacing\" class=\"banner\" :class=\"sourceState === 'loaded' ? 'info' : 'warn'\">\n <b>Replacing {{ id }}.</b>\n <p v-if=\"sourceState === 'loading'\">Loading what is stored…</p>\n <p v-else-if=\"sourceState === 'loaded'\">\n Loaded from the stored record — edit it and save. Saving replaces the record outright, so\n anything you delete here stops being tracked while whatever it created keeps running.\n </p>\n <p v-else-if=\"sourceState === 'withheld'\">\n The stored spec was not loaded: reading it needs an access token, because hooks routinely\n carry a credential inline. <RouterLink to=\"/settings\">Add your token</RouterLink> to edit\n in place — otherwise paste the <b>complete</b> spec, since anything you leave out stops\n being tracked.\n </p>\n <p v-else>\n The stored spec could not be loaded, so this form is empty. Paste the <b>complete</b> spec\n you want stored — anything you leave out stops being tracked while whatever it created keeps\n running.\n </p>\n </div>\n\n <!--\n A deployment that references a stored spec keeps its own copy of the source. Editing that copy\n forks it: the stored spec every other deployment shares is untouched, and this one stops\n following it. Silent forks are the kind of thing discovered months later.\n -->\n <div v-if=\"forkWarning\" class=\"banner warn\">\n <b>This deployment tracks the stored spec “{{ forkWarning }}”.</b>\n <p>\n Saving here writes a private copy and stops it following that spec. To change every\n deployment using it, edit\n <RouterLink :to=\"`/specs/${encodeURIComponent(forkWarning)}`\">the spec</RouterLink> instead.\n </p>\n </div>\n\n <div class=\"row\" style=\"margin-bottom: var(--s4)\">\n <div class=\"field\" style=\"max-width: 280px\">\n <label for=\"did\">Deployment id</label>\n <input\n id=\"did\"\n v-model.trim=\"form.id\"\n type=\"text\"\n placeholder=\"pr-123\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <span class=\"mute\" style=\"align-self: end; padding-bottom: 10px\">\n Lower case\n <InfoHint label=\"allowed characters in a deployment id\">\n Starts with a letter or digit, then letters, digits, dot, dash or underscore. Up to 64\n characters — <code>[a-z0-9][a-z0-9._-]{0,63}</code>.\n </InfoHint>\n </span>\n </div>\n\n <!-- Offered only when this server actually has stored specs. -->\n <div v-if=\"specs.length\" class=\"row\" style=\"margin-bottom: var(--s4)\">\n <label class=\"check\">\n <input v-model=\"source\" type=\"radio\" value=\"inline\" /> inline spec\n </label>\n <label class=\"check\">\n <input v-model=\"source\" type=\"radio\" value=\"stored\" /> reference a stored spec\n </label>\n </div>\n\n <template v-if=\"source === 'stored' && specs.length\">\n <div class=\"field\" style=\"max-width: 340px\">\n <label for=\"sn\">Stored spec</label>\n <SelectMenu v-model=\"specName\" id=\"sn\" label=\"Stored spec\" :options=\"specOptions\" />\n </div>\n <p v-if=\"chosenSpec\" class=\"hint\">\n <span v-if=\"chosenSpec.description\">{{ chosenSpec.description }} — </span>\n needs\n <b v-if=\"chosenSpec.requiredVars.length\">{{ chosenSpec.requiredVars.join(', ') }}</b>\n <span v-else>no variables</span>.\n <InfoHint label=\"why variables are required\">\n A missing variable is refused by name. It is never filled in with a blank, which would\n silently give every deployment the same stack name.\n </InfoHint>\n </p>\n </template>\n\n <template v-else>\n <div class=\"field\">\n <label for=\"spec\">Spec.yml</label>\n <textarea\n id=\"spec\"\n v-model=\"form.spec\"\n rows=\"12\"\n spellcheck=\"false\"\n placeholder=\"version: 1 kind: isolated stack: pr-${PR} axes: []\"\n />\n </div>\n\n <div class=\"field\" style=\"margin-top: var(--s3)\">\n <label for=\"compose\">compose.yml <span class=\"mute\">(optional)</span></label>\n <textarea\n id=\"compose\"\n v-model=\"form.compose\"\n rows=\"6\"\n spellcheck=\"false\"\n placeholder=\"Written next to spec.yml, so a compose file named compose.yml resolves\"\n />\n </div>\n <p class=\"hint\">\n Hooks must be inline shell or an absolute path.\n <InfoHint label=\"why a relative script path does not work\">\n A deployment directory only ever holds <code>spec.yml</code> and\n <code>compose.yml</code>, and hooks run from there — so\n <code>up: ./hooks/db.sh</code> has nothing to find.\n </InfoHint>\n </p>\n </template>\n\n <h2 class=\"section\" style=\"margin: var(--s5) 0 var(--s3)\">Variables</h2>\n <VarEditor v-model=\"vars\" />\n <p class=\"hint\">\n Saved with the deployment, so tearing it down later targets the same stack.\n <InfoHint label=\"how variables are remembered\">\n They are stored on the server where it supports that, and in this browser either way — so\n the actions on the deployment page send exactly these values.\n </InfoHint>\n </p>\n\n <div class=\"row\" style=\"margin-top: var(--s5)\">\n <ActionButton variant=\"primary\" :pending=\"submitting\" :disabled=\"!canSubmit\" @click=\"submit\">\n {{ submitting ? 'Submitting…' : 'Submit' }}\n </ActionButton>\n <span v-if=\"!result\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n Nothing is saved until the spec is valid\n <InfoHint label=\"what happens on a rejected submission\">\n The spec is checked before anything is written, so a rejected submission leaves nothing\n behind — and a replace never destroys a good record over a typo. Whether the deployment\n is shared or isolated comes from the spec, not from this form.\n </InfoHint>\n </span>\n <span v-if=\"result\" class=\"s-ok\">\n {{ result.created ? 'Created' : 'Replaced' }} — stack\n <b>{{ result.stack }}</b>\n <RouterLink :to=\"`/deployments/${encodeURIComponent(result.id)}`\" style=\"margin-left: 8px\">\n open →\n </RouterLink>\n </span>\n </div>\n\n <!--\n The server's rejection text IS the documentation: it names the key, the variable or the\n assert that is wrong, and often prints the corrected form. Rendered whole, newlines and\n indentation intact. Never truncate it, never collapse it, never say \"invalid spec\".\n -->\n <!--\n Reported by the server, which resolved every other deployment to check. Shown after the fact\n because it can only be known once the spec has resolved — and it is a warning, not a rejection:\n it can be deliberate, and refusing over a guess would be worse than saying so.\n -->\n <div v-if=\"result?.stackSharedWith?.length\" class=\"banner warn\">\n <b>Another deployment already resolves to stack “{{ result.stack }}”.</b>\n <p>\n <template v-for=\"(o, i) in result.stackSharedWith\" :key=\"o\">\n <RouterLink :to=\"`/deployments/${encodeURIComponent(o)}`\">{{ o }}</RouterLink\n ><span v-if=\"i < result.stackSharedWith.length - 1\">, </span> </template\n >— both records now drive the same compose project, so <code>down</code> on either stops the\n other's containers and <code>verify</code> on either reports the other's leaks. If that was not\n intended, change this one's <code>stack</code> and save again.\n </p>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"The server rejected this submission.\" />\n </section>\n </div>\n</template>\n"],"names":["EXAMPLE_COMPOSE","props","__props","form","ref","vars","source","specName","submitting","error","result","specs","specOptions","computed","api","r","chosenSpec","replacing","route","useRoute","copyFrom","v","sourceState","forkWarning","loadSource","id","watch","from","saved","_a","rowFor","pairsFromRecord","stored","readVars","e","canSubmit","submit","record","recordFromPairs","body","writeVars","loadDeployments","toast","problem","detectPreviewDomain","h","labels","exampleSpec","domain","loadExample","_createElementBlock","_createElementVNode","_hoisted_1","_toDisplayString","_hoisted_2","_hoisted_3","_openBlock","_hoisted_4","_cache","_Fragment","_createVNode","_component_RouterLink","_normalizeClass","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","$event","_hoisted_12","InfoHint","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","SelectMenu","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_21","_vModelText","_hoisted_22","_hoisted_23","VarEditor","_hoisted_24","_hoisted_25","ActionButton","_hoisted_26","_hoisted_27","_b","_hoisted_28","o","i","_createBlock","ErrorNote"],"mappings":"k8CAyRMA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mDA1PxB,MAAMC,EAAQC,EAERC,EAAOC,EAAI,CAAE,GAAIH,EAAM,IAAM,GAAI,KAAM,GAAI,QAAS,EAAA,CAAI,EACxDI,EAAOD,EAAe,CAAC,CAAE,EAAG,GAAI,EAAG,EAAA,CAAI,CAAC,EACxCE,EAASF,EAAyB,QAAQ,EAC1CG,EAAWH,EAAI,EAAE,EAEjBI,EAAaJ,EAAI,EAAK,EACtBK,EAAQL,EAAI,EAAE,EACdM,EAASN,EAML,IAAI,EAMRO,EAAQP,EAAgB,EAAE,EAG1BQ,EAAcC,EAAS,IAAM,CACjC,CAAE,MAAO,GAAI,MAAO,YAAA,EACpB,GAAGF,EAAM,MAAM,IAAK,IAAO,CAAE,MAAO,EAAE,KAAM,MAAO,EAAE,KAAM,KAAM,EAAE,MAAO,CAAA,CAC3E,EACIG,EAAI,IAAmB,YAAY,EAAE,KAAMC,GAAM,CAChDA,EAAE,IAAM,MAAM,QAAQA,EAAE,KAAK,KAAK,IAAGJ,EAAM,MAAQI,EAAE,KAAK,MAChE,CAAC,EAED,MAAMC,EAAaH,EAA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as Le,as as Ie,a4 as ie,at as Me,d as B,V as Fe,ac as $,au as Ne,X as xe,av as Be,o as G,x as J,w as ae,W as X,D as ke,S as ue,ak as Re,g as je}from"./index-jLPJ82ve.js";function $e(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[u=>{const a=ge(o,u);if(a||a===null)return a;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},u=>(Ee(o,u),u)]}function T(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function le(e,t,n){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(s)}function Ue(e){return e==null}function Tt(e,t){var n;const o=se();return F(()=>{o.value=e()},{...t,flush:(n=t==null?void 0:t.flush)!==null&&n!==void 0?n:"sync"}),Se(o)}function Q(e,t){return Ae()?(Pe(e,t),!0):!1}function We(e){let t=!1,n;const o=re(!0);return((...s)=>(t||(n=o.run(()=>e(...s)),t=!0),n))}const _=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ke=e=>typeof e<"u",qe=Object.prototype.toString,He=e=>qe.call(e)==="[object Object]",ee=Ve();function Ve(){var e,t,n;return _&&!!(!((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0)&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test((n=window)===null||n===void 0?void 0:n.navigator.userAgent))}function K(e){return Array.isArray(e)?e:[e]}function ze(e){return x()}function Ye(e){if(!_)return e;let t=0,n,o;const s=()=>{t-=1,o&&t<=0&&(o.stop(),n=void 0,o=void 0)};return((...r)=>(t+=1,o||(o=re(!0),n=o.run(()=>e(...r))),Q(s),n))}function _t(e,t=1e4){return Oe((n,o)=>{let s=E(e),r;const u=()=>setTimeout(()=>{s=E(e),o()},E(t));return Q(()=>{clearTimeout(r)}),{get(){return n(),s},set(a){s=a,o(),clearTimeout(r),r=u()}}})}function Ge(e,t){ze()&&we(e,t)}function Je(e,t,n){return P(e,t,{...n,immediate:!0})}const U=_?window:void 0;function N(e){var t;const n=E(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function ce(...e){const t=(o,s,r,u)=>(o.addEventListener(s,r,u),()=>o.removeEventListener(s,r,u)),n=w(()=>{const o=K(E(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return Je(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>N(r)))!==null&&o!==void 0?o:[U].filter(r=>r!=null),K(E(n.value?e[1]:e[0])),K(D(n.value?e[2]:e[1])),E(n.value?e[3]:e[2])]},([o,s,r,u],a,f)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const v=He(u)?{...u}:u,l=o.flatMap(i=>s.flatMap(c=>r.map(d=>t(i,c,d,v))));f(()=>{l.forEach(i=>i())})},{flush:"post"})}function de(){const e=se(!1),t=x();return t&&Ce(()=>{e.value=!0},t),e}function Xe(e){const t=de();return w(()=>(t.value,!!e()))}function Qe(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ze(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:s=U,eventName:r="keydown",passive:u=!1,dedupe:a=!1}=o,f=Qe(t);return ce(s,r,l=>{l.repeat&&E(a)||f(l)&&n(l)},u)}function et(e){return JSON.parse(JSON.stringify(e))}function Lt(e,t,n={}){const{window:o=U,...s}=n;let r;const u=Xe(()=>o&&"ResizeObserver"in o),a=()=>{r&&(r.disconnect(),r=void 0)},f=P(w(()=>{const l=E(e);return Array.isArray(l)?l.map(i=>N(i)):[N(l)]}),l=>{if(a(),u.value&&o){r=new ResizeObserver(t);for(const i of l)i&&r.observe(i,s)}},{immediate:!0,flush:"post"}),v=()=>{a(),f()};return Q(v),{isSupported:u,stop:v}}function It(e,t,n,o={}){var s,r;const{clone:u=!1,passive:a=!1,eventName:f,deep:v=!1,defaultValue:l,shouldEmit:i}=o,c=x(),d=n||(c==null?void 0:c.emit)||(c==null||(s=c.$emit)===null||s===void 0?void 0:s.bind(c))||(c==null||(r=c.proxy)===null||r===void 0||(r=r.$emit)===null||r===void 0?void 0:r.bind(c==null?void 0:c.proxy));let y=f;t||(t="modelValue"),y=y||`update:${t.toString()}`;const h=p=>u?typeof u=="function"?u(p):et(p):p,b=()=>Ke(e[t])?h(e[t]):l,m=p=>{i?i(p)&&d(y,p):d(y,p)};if(a){const p=g(b());let S=!1;return P(()=>e[t],A=>{S||(S=!0,p.value=h(A),I(()=>S=!1))}),P(p,A=>{!S&&(A!==e[t]||v)&&m(A)},{deep:v}),p}else return w({get(){return b()},set(p){m(p)}})}function Z(e){return e?e.flatMap(t=>t.type===De?Z(t.children):[t]):[]}const[fe]=$e("ConfigProvider");function q(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Y(e,t,n=".",o){if(!q(t))return Y(e,{},n,o);const s={...t};for(const r of Object.keys(e)){if(r==="__proto__"||r==="constructor")continue;const u=e[r];u!=null&&(o&&o(s,r,u,n)||(Array.isArray(u)&&Array.isArray(s[r])?s[r]=[...u,...s[r]]:q(u)&&q(s[r])?s[r]=Y(u,s[r],(n?`${n}.`:"")+r.toString(),o):s[r]=u))}return s}function tt(e){return(...t)=>t.reduce((n,o)=>Y(n,o,"",e),{})}const nt=tt(),ot=Ye(()=>{const e=g(new Map),t=g(),n=w(()=>{for(const u of e.value.values())if(u)return!0;return!1}),o=fe({scrollBody:g(!0)});let s=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",ee&&(s==null||s()),t.value=void 0};return P(n,(u,a)=>{var i;if(!_)return;if(!u){a&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const f=window.innerWidth-document.documentElement.clientWidth,v={padding:f,margin:0},l=(i=o.scrollBody)!=null&&i.value?typeof o.scrollBody.value=="object"?nt({padding:o.scrollBody.value.padding===!0?f:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?f:o.scrollBody.value.margin},v):v:{padding:0,margin:0};f>0&&(document.body.style.paddingRight=typeof l.padding=="number"?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin=="number"?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty("--scrollbar-width",`${f}px`),document.body.style.overflow="hidden"),ee&&(s=ce(document,"touchmove",c=>rt(c),{passive:!1})),I(()=>{n.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),e});function Mt(e){const t=Math.random().toString(36).substring(2,7),n=ot();n.value.set(t,e??!1);const o=w({get:()=>n.value.get(t)??!1,set:s=>n.value.set(t,s)});return Ge(()=>{n.value.delete(t)}),o}function ve(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!(n instanceof Element)||n.tagName==="BODY"?!1:ve(n)}}function rt(e){const t=e||window.event,n=t.target;return n instanceof Element&&ve(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Ft(e){const t=x(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(s=>{o[Te(_e(s))]=(...r)=>e(s,...r)}),o}function pe(){const e=x(),t=g(),n=w(()=>o());Le(()=>{n.value!==o()&&Ie(t)});function o(){return t.value&&"$el"in t.value&&["#text","#comment"].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:N(t)}const s=Object.assign({},e.exposed),r={};for(const a in e.props)Object.defineProperty(r,a,{enumerable:!0,configurable:!0,get:()=>e.props[a]});if(Object.keys(s).length>0)for(const a in s)Object.defineProperty(r,a,{enumerable:!0,configurable:!0,get:()=>s[a]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function u(a){if(t.value=a,!!a&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),!(a instanceof Element)&&!Object.hasOwn(a,"$el"))){const f=a.$.exposed,v=Object.assign({},r);for(const l in f)Object.defineProperty(v,l,{enumerable:!0,configurable:!0,get:()=>f[l]});e.exposed=v}}return{forwardRef:u,currentRef:t,currentElement:n}}var st=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},M=new WeakMap,k=new WeakMap,R={},H=0,me=function(e){return e&&(e.host||me(e.parentNode))},it=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=me(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},at=function(e,t,n,o){var s=it(t,Array.isArray(e)?e:[e]);R[n]||(R[n]=new WeakMap);var r=R[n],u=[],a=new Set,f=new Set(s),v=function(i){!i||a.has(i)||(a.add(i),v(i.parentNode))};s.forEach(v);var l=function(i){!i||f.has(i)||Array.prototype.forEach.call(i.children,function(c){if(a.has(c))l(c);else try{var d=c.getAttribute(o),y=d!==null&&d!=="false",h=(M.get(c)||0)+1,b=(r.get(c)||0)+1;M.set(c,h),r.set(c,b),u.push(c),h===1&&y&&k.set(c,!0),b===1&&c.setAttribute(n,"true"),y||c.setAttribute(o,"true")}catch(m){console.error("aria-hidden: cannot operate on ",c,m)}})};return l(t),a.clear(),H++,function(){u.forEach(function(i){var c=M.get(i)-1,d=r.get(i)-1;M.set(i,c),r.set(i,d),c||(k.has(i)||i.removeAttribute(o),k.delete(i)),d||i.removeAttribute(n)}),H--,H||(M=new WeakMap,M=new WeakMap,k=new WeakMap,R={})}},ut=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),s=st(e);return s?(o.push.apply(o,Array.from(s.querySelectorAll("[aria-live], script"))),at(o,s,n,"aria-hidden")):function(){return null}};function Nt(e){let t;P(()=>N(e),n=>{let o=!1;try{o=!!(n!=null&&n.closest("[popover]:not(:popover-open)"))}catch{}n&&!o?t=ut(n):t&&t()}),ie(()=>{t&&t()})}function xt(e,t="reka"){var s;let n;const o=fe({useId:void 0});return o.useId?n=o.useId():n=(s=Me)==null?void 0:s(),t?`${t}-${n}`:n}function lt(e,t){const n=g(e);function o(r){return t[n.value][r]??n.value}return{state:n,dispatch:r=>{n.value=o(r)}}}function ct(e,t){var b;const n=g({}),o=g("none"),s=g(e),r=e.value?"mounted":"unmounted";let u;const a=((b=t.value)==null?void 0:b.ownerDocument.defaultView)??U,{state:f,dispatch:v}=lt(r,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),l=m=>{var p;if(_){const S=new CustomEvent(m,{bubbles:!1,cancelable:!1});(p=t.value)==null||p.dispatchEvent(S)}};P(e,async(m,p)=>{var A;const S=p!==m;if(await I(),S){const W=o.value,L=j(t.value);m?(v("MOUNT"),l("enter"),L==="none"&&l("after-enter")):L==="none"||L==="undefined"||((A=n.value)==null?void 0:A.display)==="none"?(v("UNMOUNT"),l("leave"),l("after-leave")):p&&W!==L?(v("ANIMATION_OUT"),l("leave")):(v("UNMOUNT"),l("after-leave"))}},{immediate:!0});const i=m=>{const p=j(t.value),S=p.includes(CSS.escape(m.animationName)),A=f.value==="mounted"?"enter":"leave";if(m.target===t.value&&S&&(l(`after-${A}`),v("ANIMATION_END"),!s.value)){const W=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",u=a==null?void 0:a.setTimeout(()=>{var L;((L=t.value)==null?void 0:L.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=W)})}m.target===t.value&&p==="none"&&v("ANIMATION_END")},c=m=>{m.target===t.value&&(o.value=j(t.value))},d=P(t,(m,p)=>{m?(n.value=getComputedStyle(m),m.addEventListener("animationstart",c),m.addEventListener("animationcancel",i),m.addEventListener("animationend",i)):(v("ANIMATION_END"),u!==void 0&&(a==null||a.clearTimeout(u)),p==null||p.removeEventListener("animationstart",c),p==null||p.removeEventListener("animationcancel",i),p==null||p.removeEventListener("animationend",i))},{immediate:!0}),y=P(f,()=>{const m=j(t.value);o.value=f.value==="mounted"?m:"none"});return ie(()=>{d(),y()}),{isPresent:w(()=>["mounted","unmountSuspended"].includes(f.value))}}function j(e){return e&&getComputedStyle(e).animationName||"none"}var Bt=B({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var v;const{present:o,forceMount:s}=Fe(e),r=g(),{isPresent:u}=ct(o,r);n({present:u});let a=t.default({present:u.value});a=Z(a||[]);const f=x();if(a&&(a==null?void 0:a.length)>1){const l=(v=f==null?void 0:f.parent)!=null&&v.type.name?`<${f.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${l}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(i=>` - ${i}`).join(`
|
|
1
|
+
import{ab as ge,ae as Ee,an as Oe,a7 as E,J as we,ao as re,a8 as x,a6 as F,ap as Se,H as P,M as se,ah as Ae,ai as Pe,r as g,C as w,Y as Ce,u as D,a2 as I,F as De,aq as Te,a9 as _e,ar as Le,as as Ie,a4 as ie,at as Me,d as B,V as Fe,ac as $,au as Ne,X as xe,av as Be,o as G,x as J,w as ae,W as X,D as ke,S as ue,ak as Re,g as je}from"./index-DVCVnKbf.js";function $e(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[u=>{const a=ge(o,u);if(a||a===null)return a;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},u=>(Ee(o,u),u)]}function T(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function le(e,t,n){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(s)}function Ue(e){return e==null}function Tt(e,t){var n;const o=se();return F(()=>{o.value=e()},{...t,flush:(n=t==null?void 0:t.flush)!==null&&n!==void 0?n:"sync"}),Se(o)}function Q(e,t){return Ae()?(Pe(e,t),!0):!1}function We(e){let t=!1,n;const o=re(!0);return((...s)=>(t||(n=o.run(()=>e(...s)),t=!0),n))}const _=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const qe=e=>typeof e<"u",Ke=Object.prototype.toString,He=e=>Ke.call(e)==="[object Object]",ee=Ve();function Ve(){var e,t,n;return _&&!!(!((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0)&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test((n=window)===null||n===void 0?void 0:n.navigator.userAgent))}function q(e){return Array.isArray(e)?e:[e]}function ze(e){return x()}function Ye(e){if(!_)return e;let t=0,n,o;const s=()=>{t-=1,o&&t<=0&&(o.stop(),n=void 0,o=void 0)};return((...r)=>(t+=1,o||(o=re(!0),n=o.run(()=>e(...r))),Q(s),n))}function _t(e,t=1e4){return Oe((n,o)=>{let s=E(e),r;const u=()=>setTimeout(()=>{s=E(e),o()},E(t));return Q(()=>{clearTimeout(r)}),{get(){return n(),s},set(a){s=a,o(),clearTimeout(r),r=u()}}})}function Ge(e,t){ze()&&we(e,t)}function Je(e,t,n){return P(e,t,{...n,immediate:!0})}const U=_?window:void 0;function N(e){var t;const n=E(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function ce(...e){const t=(o,s,r,u)=>(o.addEventListener(s,r,u),()=>o.removeEventListener(s,r,u)),n=w(()=>{const o=q(E(e[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return Je(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(r=>N(r)))!==null&&o!==void 0?o:[U].filter(r=>r!=null),q(E(n.value?e[1]:e[0])),q(D(n.value?e[2]:e[1])),E(n.value?e[3]:e[2])]},([o,s,r,u],a,f)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const v=He(u)?{...u}:u,l=o.flatMap(i=>s.flatMap(c=>r.map(d=>t(i,c,d,v))));f(()=>{l.forEach(i=>i())})},{flush:"post"})}function de(){const e=se(!1),t=x();return t&&Ce(()=>{e.value=!0},t),e}function Xe(e){const t=de();return w(()=>(t.value,!!e()))}function Qe(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ze(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:s=U,eventName:r="keydown",passive:u=!1,dedupe:a=!1}=o,f=Qe(t);return ce(s,r,l=>{l.repeat&&E(a)||f(l)&&n(l)},u)}function et(e){return JSON.parse(JSON.stringify(e))}function Lt(e,t,n={}){const{window:o=U,...s}=n;let r;const u=Xe(()=>o&&"ResizeObserver"in o),a=()=>{r&&(r.disconnect(),r=void 0)},f=P(w(()=>{const l=E(e);return Array.isArray(l)?l.map(i=>N(i)):[N(l)]}),l=>{if(a(),u.value&&o){r=new ResizeObserver(t);for(const i of l)i&&r.observe(i,s)}},{immediate:!0,flush:"post"}),v=()=>{a(),f()};return Q(v),{isSupported:u,stop:v}}function It(e,t,n,o={}){var s,r;const{clone:u=!1,passive:a=!1,eventName:f,deep:v=!1,defaultValue:l,shouldEmit:i}=o,c=x(),d=n||(c==null?void 0:c.emit)||(c==null||(s=c.$emit)===null||s===void 0?void 0:s.bind(c))||(c==null||(r=c.proxy)===null||r===void 0||(r=r.$emit)===null||r===void 0?void 0:r.bind(c==null?void 0:c.proxy));let y=f;t||(t="modelValue"),y=y||`update:${t.toString()}`;const h=p=>u?typeof u=="function"?u(p):et(p):p,b=()=>qe(e[t])?h(e[t]):l,m=p=>{i?i(p)&&d(y,p):d(y,p)};if(a){const p=g(b());let S=!1;return P(()=>e[t],A=>{S||(S=!0,p.value=h(A),I(()=>S=!1))}),P(p,A=>{!S&&(A!==e[t]||v)&&m(A)},{deep:v}),p}else return w({get(){return b()},set(p){m(p)}})}function Z(e){return e?e.flatMap(t=>t.type===De?Z(t.children):[t]):[]}const[fe]=$e("ConfigProvider");function K(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Y(e,t,n=".",o){if(!K(t))return Y(e,{},n,o);const s={...t};for(const r of Object.keys(e)){if(r==="__proto__"||r==="constructor")continue;const u=e[r];u!=null&&(o&&o(s,r,u,n)||(Array.isArray(u)&&Array.isArray(s[r])?s[r]=[...u,...s[r]]:K(u)&&K(s[r])?s[r]=Y(u,s[r],(n?`${n}.`:"")+r.toString(),o):s[r]=u))}return s}function tt(e){return(...t)=>t.reduce((n,o)=>Y(n,o,"",e),{})}const nt=tt(),ot=Ye(()=>{const e=g(new Map),t=g(),n=w(()=>{for(const u of e.value.values())if(u)return!0;return!1}),o=fe({scrollBody:g(!0)});let s=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",ee&&(s==null||s()),t.value=void 0};return P(n,(u,a)=>{var i;if(!_)return;if(!u){a&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const f=window.innerWidth-document.documentElement.clientWidth,v={padding:f,margin:0},l=(i=o.scrollBody)!=null&&i.value?typeof o.scrollBody.value=="object"?nt({padding:o.scrollBody.value.padding===!0?f:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?f:o.scrollBody.value.margin},v):v:{padding:0,margin:0};f>0&&(document.body.style.paddingRight=typeof l.padding=="number"?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin=="number"?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty("--scrollbar-width",`${f}px`),document.body.style.overflow="hidden"),ee&&(s=ce(document,"touchmove",c=>rt(c),{passive:!1})),I(()=>{n.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),e});function Mt(e){const t=Math.random().toString(36).substring(2,7),n=ot();n.value.set(t,e??!1);const o=w({get:()=>n.value.get(t)??!1,set:s=>n.value.set(t,s)});return Ge(()=>{n.value.delete(t)}),o}function ve(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!(n instanceof Element)||n.tagName==="BODY"?!1:ve(n)}}function rt(e){const t=e||window.event,n=t.target;return n instanceof Element&&ve(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Ft(e){const t=x(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(s=>{o[Te(_e(s))]=(...r)=>e(s,...r)}),o}function pe(){const e=x(),t=g(),n=w(()=>o());Le(()=>{n.value!==o()&&Ie(t)});function o(){return t.value&&"$el"in t.value&&["#text","#comment"].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:N(t)}const s=Object.assign({},e.exposed),r={};for(const a in e.props)Object.defineProperty(r,a,{enumerable:!0,configurable:!0,get:()=>e.props[a]});if(Object.keys(s).length>0)for(const a in s)Object.defineProperty(r,a,{enumerable:!0,configurable:!0,get:()=>s[a]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function u(a){if(t.value=a,!!a&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),!(a instanceof Element)&&!Object.hasOwn(a,"$el"))){const f=a.$.exposed,v=Object.assign({},r);for(const l in f)Object.defineProperty(v,l,{enumerable:!0,configurable:!0,get:()=>f[l]});e.exposed=v}}return{forwardRef:u,currentRef:t,currentElement:n}}var st=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},M=new WeakMap,k=new WeakMap,R={},H=0,me=function(e){return e&&(e.host||me(e.parentNode))},it=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=me(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},at=function(e,t,n,o){var s=it(t,Array.isArray(e)?e:[e]);R[n]||(R[n]=new WeakMap);var r=R[n],u=[],a=new Set,f=new Set(s),v=function(i){!i||a.has(i)||(a.add(i),v(i.parentNode))};s.forEach(v);var l=function(i){!i||f.has(i)||Array.prototype.forEach.call(i.children,function(c){if(a.has(c))l(c);else try{var d=c.getAttribute(o),y=d!==null&&d!=="false",h=(M.get(c)||0)+1,b=(r.get(c)||0)+1;M.set(c,h),r.set(c,b),u.push(c),h===1&&y&&k.set(c,!0),b===1&&c.setAttribute(n,"true"),y||c.setAttribute(o,"true")}catch(m){console.error("aria-hidden: cannot operate on ",c,m)}})};return l(t),a.clear(),H++,function(){u.forEach(function(i){var c=M.get(i)-1,d=r.get(i)-1;M.set(i,c),r.set(i,d),c||(k.has(i)||i.removeAttribute(o),k.delete(i)),d||i.removeAttribute(n)}),H--,H||(M=new WeakMap,M=new WeakMap,k=new WeakMap,R={})}},ut=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),s=st(e);return s?(o.push.apply(o,Array.from(s.querySelectorAll("[aria-live], script"))),at(o,s,n,"aria-hidden")):function(){return null}};function Nt(e){let t;P(()=>N(e),n=>{let o=!1;try{o=!!(n!=null&&n.closest("[popover]:not(:popover-open)"))}catch{}n&&!o?t=ut(n):t&&t()}),ie(()=>{t&&t()})}function xt(e,t="reka"){var s;let n;const o=fe({useId:void 0});return o.useId?n=o.useId():n=(s=Me)==null?void 0:s(),t?`${t}-${n}`:n}function lt(e,t){const n=g(e);function o(r){return t[n.value][r]??n.value}return{state:n,dispatch:r=>{n.value=o(r)}}}function ct(e,t){var b;const n=g({}),o=g("none"),s=g(e),r=e.value?"mounted":"unmounted";let u;const a=((b=t.value)==null?void 0:b.ownerDocument.defaultView)??U,{state:f,dispatch:v}=lt(r,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),l=m=>{var p;if(_){const S=new CustomEvent(m,{bubbles:!1,cancelable:!1});(p=t.value)==null||p.dispatchEvent(S)}};P(e,async(m,p)=>{var A;const S=p!==m;if(await I(),S){const W=o.value,L=j(t.value);m?(v("MOUNT"),l("enter"),L==="none"&&l("after-enter")):L==="none"||L==="undefined"||((A=n.value)==null?void 0:A.display)==="none"?(v("UNMOUNT"),l("leave"),l("after-leave")):p&&W!==L?(v("ANIMATION_OUT"),l("leave")):(v("UNMOUNT"),l("after-leave"))}},{immediate:!0});const i=m=>{const p=j(t.value),S=p.includes(CSS.escape(m.animationName)),A=f.value==="mounted"?"enter":"leave";if(m.target===t.value&&S&&(l(`after-${A}`),v("ANIMATION_END"),!s.value)){const W=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",u=a==null?void 0:a.setTimeout(()=>{var L;((L=t.value)==null?void 0:L.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=W)})}m.target===t.value&&p==="none"&&v("ANIMATION_END")},c=m=>{m.target===t.value&&(o.value=j(t.value))},d=P(t,(m,p)=>{m?(n.value=getComputedStyle(m),m.addEventListener("animationstart",c),m.addEventListener("animationcancel",i),m.addEventListener("animationend",i)):(v("ANIMATION_END"),u!==void 0&&(a==null||a.clearTimeout(u)),p==null||p.removeEventListener("animationstart",c),p==null||p.removeEventListener("animationcancel",i),p==null||p.removeEventListener("animationend",i))},{immediate:!0}),y=P(f,()=>{const m=j(t.value);o.value=f.value==="mounted"?m:"none"});return ie(()=>{d(),y()}),{isPresent:w(()=>["mounted","unmountSuspended"].includes(f.value))}}function j(e){return e&&getComputedStyle(e).animationName||"none"}var Bt=B({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var v;const{present:o,forceMount:s}=Fe(e),r=g(),{isPresent:u}=ct(o,r);n({present:u});let a=t.default({present:u.value});a=Z(a||[]);const f=x();if(a&&(a==null?void 0:a.length)>1){const l=(v=f==null?void 0:f.parent)!=null&&v.type.name?`<${f.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${l}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(i=>` - ${i}`).join(`
|
|
2
2
|
`)].join(`
|
|
3
3
|
`))}return()=>s.value||o.value||u.value?$(t.default({present:u.value})[0],{ref:l=>{const i=N(l);return typeof(i==null?void 0:i.hasAttribute)>"u"||(i!=null&&i.hasAttribute("data-reka-popper-content-wrapper")?r.value=i.firstElementChild:r.value=i),i}}):null}});const dt=B({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var f;if(!n.default)return null;const o=Z(n.default()),s=o.findIndex(v=>v.type!==Ne);if(s===-1)return o;const r=o[s];(f=r.props)==null||delete f.ref;const u=r.props?xe(t,r.props):t,a=Be({...r,props:{}},u);return o.length===1?a:(o[s]=a,o)}}}),ft=["area","img","input"],ye=B({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&ft.includes(o)?()=>$(o,t):o!=="template"?()=>$(e.as,t,{default:n.default}):()=>$(dt,t,{default:n.default})}}),vt="dismissableLayer.pointerDownOutside",pt="dismissableLayer.focusOutside";function he(e,t){if(!(t instanceof Element))return!1;const n=t.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),s=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(o===n||s.indexOf(o)<s.indexOf(n)))}function mt(e,t,n=!0){var u;const o=((u=t==null?void 0:t.value)==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),s=g(!1),r=g(()=>{});return F(a=>{if(!_||!E(n))return;const f=async l=>{const i=l.target;if(!(!(t!=null&&t.value)||!i)){if(he(t.value,i)){s.value=!1;return}if(l.target&&!s.value){let d=function(){le(vt,e,c)};const c={originalEvent:l};l.pointerType==="touch"?(o.removeEventListener("click",r.value),r.value=d,o.addEventListener("click",r.value,{once:!0})):d()}else o.removeEventListener("click",r.value);s.value=!1}},v=window.setTimeout(()=>{o.addEventListener("pointerdown",f)},0);a(()=>{window.clearTimeout(v),o.removeEventListener("pointerdown",f),o.removeEventListener("click",r.value)})}),{onPointerDownCapture:()=>{E(n)&&(s.value=!0)}}}function yt(e,t,n=!0){var r;const o=((r=t==null?void 0:t.value)==null?void 0:r.ownerDocument)??(globalThis==null?void 0:globalThis.document),s=g(!1);return F(u=>{if(!_||!E(n))return;const a=async f=>{if(!(t!=null&&t.value))return;await I(),await I();const v=f.target;!t.value||!v||he(t.value,v)||f.target&&!s.value&&le(pt,e,{originalEvent:f})};o.addEventListener("focusin",a),u(()=>o.removeEventListener("focusin",a))}),{onFocusCapture:()=>{E(n)&&(s.value=!0)},onBlurCapture:()=>{E(n)&&(s.value=!1)}}}const O=ue({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var ht=B({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const n=e,o=t,{forwardRef:s,currentElement:r}=pe(),u=w(()=>{var d;return((d=r.value)==null?void 0:d.ownerDocument)??globalThis.document}),a=w(()=>O.layersRoot),f=w(()=>r.value?Array.from(a.value).indexOf(r.value):-1),v=w(()=>O.layersWithOutsidePointerEventsDisabled.size>0),l=w(()=>{const d=Array.from(a.value),[y]=[...O.layersWithOutsidePointerEventsDisabled].slice(-1),h=d.indexOf(y);return f.value>=h}),i=mt(async d=>{const y=[...O.branches].some(h=>h==null?void 0:h.contains(d.target));!l.value||y||(o("pointerDownOutside",d),o("interactOutside",d),await I(),d.defaultPrevented||o("dismiss"))},r),c=yt(d=>{[...O.branches].some(h=>h==null?void 0:h.contains(d.target))||(o("focusOutside",d),o("interactOutside",d),d.defaultPrevented||o("dismiss"))},r);return Ze("Escape",d=>{f.value===a.value.size-1&&(o("escapeKeyDown",d),d.defaultPrevented||o("dismiss"))}),P([r,()=>n.disableOutsidePointerEvents],([d,y],h,b)=>{d&&(y&&(O.layersWithOutsidePointerEventsDisabled.size===0&&(O.originalBodyPointerEvents=u.value.body.style.pointerEvents,u.value.body.style.pointerEvents="none"),O.layersWithOutsidePointerEventsDisabled.add(d),b(()=>{O.layersWithOutsidePointerEventsDisabled.delete(d),O.layersWithOutsidePointerEventsDisabled.size===0&&!Ue(O.originalBodyPointerEvents)&&(u.value.body.style.pointerEvents=O.originalBodyPointerEvents)})),a.value.add(d))},{immediate:!0}),F(d=>{d(()=>{r.value&&(a.value.delete(r.value),O.layersWithOutsidePointerEventsDisabled.delete(r.value))})}),(d,y)=>(G(),J(D(ye),{ref:D(s),"as-child":d.asChild,as:d.as,"data-dismissable-layer":"",style:ke({pointerEvents:v.value?l.value?"auto":"none":void 0}),onFocusCapture:D(c).onFocusCapture,onBlurCapture:D(c).onBlurCapture,onPointerdownCapture:D(i).onPointerDownCapture},{default:ae(()=>[X(d.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),kt=ht;const bt=We(()=>g([]));function gt(){const e=bt();return{add(t){const n=e.value[0];t!==n&&(n==null||n.pause()),e.value=te(e.value,t),e.value.unshift(t)},remove(t){var n;e.value=te(e.value,t),(n=e.value[0])==null||n.resume()}}}function te(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}const V="focusScope.autoFocusOnMount",z="focusScope.autoFocusOnUnmount",ne={bubbles:!1,cancelable:!0};function Et(e,{select:t=!1}={}){const n=T();for(const o of e)if(C(o,{select:t}),T()!==n)return!0}function Ot(e){const t=be(e),n=oe(t,e),o=oe(t.reverse(),e);return[n,o]}function be(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const s=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||s?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function oe(e,t){for(const n of e)if(!wt(n,{upTo:t}))return n}function wt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function St(e){return e instanceof HTMLInputElement&&"select"in e}function C(e,{select:t=!1}={}){if(e&&e.focus){const n=T();e.focus({preventScroll:!0}),e!==n&&St(e)&&t&&e.select()}}var At=B({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const n=e,o=t,{currentRef:s,currentElement:r}=pe(),u=g(null),a=gt(),f=ue({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});F(l=>{if(!_)return;const i=r.value;if(!n.trapped)return;function c(b){if(f.paused||!i)return;const m=b.target;i.contains(m)?u.value=m:C(u.value,{select:!0})}function d(b){if(f.paused||!i)return;const m=b.relatedTarget;m!==null&&(i.contains(m)||C(u.value,{select:!0}))}function y(b){const m=u.value;if(m===null||!b.some(A=>A.removedNodes.length>0))return;i.contains(m)||C(i)}document.addEventListener("focusin",c),document.addEventListener("focusout",d);const h=new MutationObserver(y);i&&h.observe(i,{childList:!0,subtree:!0}),l(()=>{document.removeEventListener("focusin",c),document.removeEventListener("focusout",d),h.disconnect()})}),F(async l=>{const i=r.value;if(await I(),!i)return;a.add(f);const c=T();if(!i.contains(c)){const y=new CustomEvent(V,ne);i.addEventListener(V,h=>o("mountAutoFocus",h)),i.dispatchEvent(y),y.defaultPrevented||(Et(be(i),{select:!0}),T()===c&&C(i))}l(()=>{i.removeEventListener(V,b=>o("mountAutoFocus",b));const y=new CustomEvent(z,ne),h=b=>{o("unmountAutoFocus",b)};i.addEventListener(z,h),i.dispatchEvent(y),i.setAttribute("data-focus-scope-unmounting",""),setTimeout(()=>{y.defaultPrevented||C(c??document.body,{select:!0}),i.removeEventListener(z,h),a.remove(f),i.removeAttribute("data-focus-scope-unmounting")},0)})});function v(l){if(!n.loop&&!n.trapped||f.paused)return;const i=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,c=T();if(i&&c){const d=l.currentTarget,[y,h]=Ot(d);y&&h?!l.shiftKey&&c===h?(l.preventDefault(),n.loop&&C(y,{select:!0})):l.shiftKey&&c===y&&(l.preventDefault(),n.loop&&C(h,{select:!0})):c===d&&l.preventDefault()}}return(l,i)=>(G(),J(D(ye),{ref_key:"currentRef",ref:s,tabindex:"-1","as-child":l.asChild,as:l.as,onKeydown:v},{default:ae(()=>[X(l.$slots,"default")]),_:3},8,["as-child","as"]))}}),Rt=At;function jt(e){return e?"open":"closed"}function $t(e){const t=T();for(const n of e)if(n===t||(n.focus(),T()!==t))return}var Pt=B({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=de();return(n,o)=>D(t)||n.forceMount?(G(),J(Re,{key:0,to:n.to,disabled:n.disabled,defer:n.defer},[X(n.$slots,"default")],8,["to","disabled","defer"])):je("v-if",!0)}}),Ut=Pt;export{kt as D,Rt as F,ye as P,dt as S,Ut as T,pe as a,xt as b,$e as c,jt as d,Ft as e,Nt as f,T as g,Bt as h,Mt as i,fe as j,_ as k,N as l,Tt as m,Ue as n,$t as o,Lt as p,le as q,_t as r,It as u};
|
|
4
|
-
//# sourceMappingURL=Teleport-
|
|
4
|
+
//# sourceMappingURL=Teleport-d5PoAxFM.js.map
|