@samyx/preview-stacks-ui 0.16.0 → 0.18.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.
Files changed (97) hide show
  1. package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-DjO5RzbR.js → ActionButton.vue_vue_type_script_setup_true_lang-BCYIjIMR.js} +2 -2
  2. package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-DjO5RzbR.js.map → ActionButton.vue_vue_type_script_setup_true_lang-BCYIjIMR.js.map} +1 -1
  3. package/dist/assets/{AxesTab-BZZXKEC0.js → AxesTab-DOL8988q.js} +2 -2
  4. package/dist/assets/{AxesTab-BZZXKEC0.js.map → AxesTab-DOL8988q.js.map} +1 -1
  5. package/dist/assets/{ConfigTab-CFbS48D0.js → ConfigTab-C2kKDMhx.js} +2 -2
  6. package/dist/assets/{ConfigTab-CFbS48D0.js.map → ConfigTab-C2kKDMhx.js.map} +1 -1
  7. package/dist/assets/ConflictNote.vue_vue_type_script_setup_true_lang-DsSczT71.js +2 -0
  8. package/dist/assets/ConflictNote.vue_vue_type_script_setup_true_lang-DsSczT71.js.map +1 -0
  9. package/dist/assets/DangerTab-DGaHMJol.js +2 -0
  10. package/dist/assets/DangerTab-DGaHMJol.js.map +1 -0
  11. package/dist/assets/{DashboardView-CFwb63EX.js → DashboardView-BfF38T9O.js} +2 -2
  12. package/dist/assets/{DashboardView-CFwb63EX.js.map → DashboardView-BfF38T9O.js.map} +1 -1
  13. package/dist/assets/DeploymentDetailView-BGjBFfU4.js +2 -0
  14. package/dist/assets/DeploymentDetailView-BGjBFfU4.js.map +1 -0
  15. package/dist/assets/{DeploymentsView-BX4GOb2A.js → DeploymentsView-BH6-KpUe.js} +2 -2
  16. package/dist/assets/{DeploymentsView-BX4GOb2A.js.map → DeploymentsView-BH6-KpUe.js.map} +1 -1
  17. package/dist/assets/{EquivalentCommand-w1nGowVi.js → EquivalentCommand-BXiEpLtI.js} +2 -2
  18. package/dist/assets/{EquivalentCommand-w1nGowVi.js.map → EquivalentCommand-BXiEpLtI.js.map} +1 -1
  19. package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-D28UQmNR.js → ErrorNote.vue_vue_type_script_setup_true_lang-BxEb711Y.js} +2 -2
  20. package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-D28UQmNR.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-BxEb711Y.js.map} +1 -1
  21. package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-TcgJr2CB.js → HelpModal.vue_vue_type_script_setup_true_lang-BQluOWdQ.js} +2 -2
  22. package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-TcgJr2CB.js.map → HelpModal.vue_vue_type_script_setup_true_lang-BQluOWdQ.js.map} +1 -1
  23. package/dist/assets/JobDetailView-BcE107xE.js +2 -0
  24. package/dist/assets/JobDetailView-BcE107xE.js.map +1 -0
  25. package/dist/assets/JobsView-Dm_Loiq8.js +2 -0
  26. package/dist/assets/JobsView-Dm_Loiq8.js.map +1 -0
  27. package/dist/assets/LogViewer.vue_vue_type_script_setup_true_lang-CJJilqst.js +3 -0
  28. package/dist/assets/LogViewer.vue_vue_type_script_setup_true_lang-CJJilqst.js.map +1 -0
  29. package/dist/assets/{LoginView-1ZpxP8a9.js → LoginView-XoomyWtl.js} +2 -2
  30. package/dist/assets/{LoginView-1ZpxP8a9.js.map → LoginView-XoomyWtl.js.map} +1 -1
  31. package/dist/assets/LogsTab-PetxKgUF.js +5 -0
  32. package/dist/assets/LogsTab-PetxKgUF.js.map +1 -0
  33. package/dist/assets/{NotFoundView-BhCKBrlY.js → NotFoundView-BcVYUxAo.js} +2 -2
  34. package/dist/assets/{NotFoundView-BhCKBrlY.js.map → NotFoundView-BcVYUxAo.js.map} +1 -1
  35. package/dist/assets/{NotifiersView-DN9UiqDs.js → NotifiersView-5xtub30J.js} +2 -2
  36. package/dist/assets/{NotifiersView-DN9UiqDs.js.map → NotifiersView-5xtub30J.js.map} +1 -1
  37. package/dist/assets/OverviewTab-DUEg-y_z.js +2 -0
  38. package/dist/assets/OverviewTab-DUEg-y_z.js.map +1 -0
  39. package/dist/assets/{RegistriesView-CPyfKKWJ.js → RegistriesView-BVFGjxi7.js} +2 -2
  40. package/dist/assets/{RegistriesView-CPyfKKWJ.js.map → RegistriesView-BVFGjxi7.js.map} +1 -1
  41. package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-mzHGsi43.js → RelativeTime.vue_vue_type_script_setup_true_lang-D0buom1m.js} +2 -2
  42. package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-mzHGsi43.js.map → RelativeTime.vue_vue_type_script_setup_true_lang-D0buom1m.js.map} +1 -1
  43. package/dist/assets/{RequiresTab-CjNRorI5.js → RequiresTab-D02oLAp-.js} +2 -2
  44. package/dist/assets/{RequiresTab-CjNRorI5.js.map → RequiresTab-D02oLAp-.js.map} +1 -1
  45. package/dist/assets/{RoutingView-Br16pPwF.js → RoutingView-1bDbTXbH.js} +3 -3
  46. package/dist/assets/{RoutingView-Br16pPwF.js.map → RoutingView-1bDbTXbH.js.map} +1 -1
  47. package/dist/assets/{RuntimeTab-BssqRUYz.js → RuntimeTab-DR6kK7VS.js} +2 -2
  48. package/dist/assets/{RuntimeTab-BssqRUYz.js.map → RuntimeTab-DR6kK7VS.js.map} +1 -1
  49. package/dist/assets/SelectMenu.vue_vue_type_script_setup_true_lang-CoNJMygb.js +2 -0
  50. package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-CLqZAezG.js.map → SelectMenu.vue_vue_type_script_setup_true_lang-CoNJMygb.js.map} +1 -1
  51. package/dist/assets/SettingsView-CNnikDTC.js +2 -0
  52. package/dist/assets/SettingsView-CNnikDTC.js.map +1 -0
  53. package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-CIiWzcE5.js → SkeletonList.vue_vue_type_script_setup_true_lang-BjPZSNt1.js} +2 -2
  54. package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-CIiWzcE5.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-BjPZSNt1.js.map} +1 -1
  55. package/dist/assets/{SpecDetailView-P6Kk7cwx.js → SpecDetailView-CobNJfyA.js} +2 -2
  56. package/dist/assets/{SpecDetailView-P6Kk7cwx.js.map → SpecDetailView-CobNJfyA.js.map} +1 -1
  57. package/dist/assets/{SpecsView-DogEWlyZ.js → SpecsView-CtE6K2qH.js} +2 -2
  58. package/dist/assets/{SpecsView-DogEWlyZ.js.map → SpecsView-CtE6K2qH.js.map} +1 -1
  59. package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-B5C48Wlo.js → StateBadge.vue_vue_type_script_setup_true_lang-CjYFKoV9.js} +2 -2
  60. package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-B5C48Wlo.js.map → StateBadge.vue_vue_type_script_setup_true_lang-CjYFKoV9.js.map} +1 -1
  61. package/dist/assets/SubmitView-BdQ2pmUr.js +50 -0
  62. package/dist/assets/SubmitView-BdQ2pmUr.js.map +1 -0
  63. package/dist/assets/{Teleport-0BmaJsBF.js → Teleport-DXtRNc70.js} +3 -3
  64. package/dist/assets/{Teleport-0BmaJsBF.js.map → Teleport-DXtRNc70.js.map} +1 -1
  65. package/dist/assets/{TerminalTab-DndloIiD.js → TerminalTab-ChiTxP-4.js} +2 -2
  66. package/dist/assets/{TerminalTab-DndloIiD.js.map → TerminalTab-ChiTxP-4.js.map} +1 -1
  67. package/dist/assets/{UsersView-KHRd16sV.js → UsersView-Ci3lY3mC.js} +2 -2
  68. package/dist/assets/{UsersView-KHRd16sV.js.map → UsersView-Ci3lY3mC.js.map} +1 -1
  69. package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-FaBOeld_.js → VarEditor.vue_vue_type_script_setup_true_lang-PNLLh1AH.js} +2 -2
  70. package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-FaBOeld_.js.map → VarEditor.vue_vue_type_script_setup_true_lang-PNLLh1AH.js.map} +1 -1
  71. package/dist/assets/index-WMJXAtiA.css +1 -0
  72. package/dist/assets/index-m4JghVue.js +134 -0
  73. package/dist/assets/index-m4JghVue.js.map +1 -0
  74. package/dist/assets/{useDeployment-DplTFu7s.js → useDeployment-BFsbmcLi.js} +2 -2
  75. package/dist/assets/{useDeployment-DplTFu7s.js.map → useDeployment-BFsbmcLi.js.map} +1 -1
  76. package/dist/index.html +5 -2
  77. package/package.json +1 -1
  78. package/dist/assets/DangerTab-Nyebdr6k.js +0 -2
  79. package/dist/assets/DangerTab-Nyebdr6k.js.map +0 -1
  80. package/dist/assets/DeploymentDetailView-DKCUbiGG.js +0 -2
  81. package/dist/assets/DeploymentDetailView-DKCUbiGG.js.map +0 -1
  82. package/dist/assets/JobDetailView-ow1_d8lc.js +0 -2
  83. package/dist/assets/JobDetailView-ow1_d8lc.js.map +0 -1
  84. package/dist/assets/JobsView-Boi9Cmdc.js +0 -2
  85. package/dist/assets/JobsView-Boi9Cmdc.js.map +0 -1
  86. package/dist/assets/LogsTab-Bgev0F7g.js +0 -4
  87. package/dist/assets/LogsTab-Bgev0F7g.js.map +0 -1
  88. package/dist/assets/OverviewTab-DzZG0moV.js +0 -2
  89. package/dist/assets/OverviewTab-DzZG0moV.js.map +0 -1
  90. package/dist/assets/SelectMenu.vue_vue_type_script_setup_true_lang-CLqZAezG.js +0 -2
  91. package/dist/assets/SettingsView-Cqsv0chw.js +0 -2
  92. package/dist/assets/SettingsView-Cqsv0chw.js.map +0 -1
  93. package/dist/assets/SubmitView-CufYXtWD.js +0 -45
  94. package/dist/assets/SubmitView-CufYXtWD.js.map +0 -1
  95. package/dist/assets/index-BnwKLRM7.css +0 -1
  96. package/dist/assets/index-D8OAewba.js +0 -134
  97. package/dist/assets/index-D8OAewba.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{R as n,C as i,A as d,B as l,J as p,S as c}from"./index-D8OAewba.js";import{w as u,r as y}from"./useVars-VN9gYdR6.js";const e=n({id:"",detail:null,error:"",loading:!1,vars:[]}),f=i(()=>p(e.vars)),k=i(()=>c(e.id)),b=i(()=>{var a;return((a=e.detail)==null?void 0:a.kind)==="shared"}),h=i(()=>{var a;return(((a=e.detail)==null?void 0:a.axes)??[]).filter(s=>!s.verifiable).map(s=>s.name)});async function t(){const a=e.id;e.loading=!0;const s=await d.get(`/api/deployments/${encodeURIComponent(a)}${f.value}`);if(e.id!==a)return;if(e.loading=!1,!s.ok){e.detail=null,e.error=l(s,`GET /api/deployments/${a}`);return}e.error="";const r=s.body;e.detail={id:r.id??a,kind:r.kind==="shared"?"shared":"isolated",createdAt:r.createdAt,updatedAt:r.updatedAt,stack:typeof r.stack=="string"?r.stack:"",busy:r.busy??null,compose:r.compose?{file:r.compose.file??"?",profiles:r.compose.profiles??[],overlays:r.compose.overlays??[]}:null,requires:Array.isArray(r.requires)?r.requires:[],axes:(Array.isArray(r.axes)?r.axes:[]).map(o=>({name:o.name,hooks:Array.isArray(o.hooks)?o.hooks:[],verifiable:o.verifiable??(Array.isArray(o.hooks)&&o.hooks.includes("assert_gone"))})),env:Array.isArray(r.env)?r.env:[]}}function g(a){e.id===a&&(e.detail||e.error)||(e.id=a,e.detail=null,e.error="",e.vars=y(a),t())}function m(){u(e.id,e.vars)}function x(){m(),t()}export{x as a,e as d,b as i,g as o,m as p,k as r,h as u,f as v};
2
- //# sourceMappingURL=useDeployment-DplTFu7s.js.map
1
+ import{S as n,C as i,A as d,B as l,J as p,U as c}from"./index-m4JghVue.js";import{w as u,r as y}from"./useVars-VN9gYdR6.js";const e=n({id:"",detail:null,error:"",loading:!1,vars:[]}),f=i(()=>p(e.vars)),k=i(()=>c(e.id)),b=i(()=>{var a;return((a=e.detail)==null?void 0:a.kind)==="shared"}),h=i(()=>{var a;return(((a=e.detail)==null?void 0:a.axes)??[]).filter(s=>!s.verifiable).map(s=>s.name)});async function t(){const a=e.id;e.loading=!0;const s=await d.get(`/api/deployments/${encodeURIComponent(a)}${f.value}`);if(e.id!==a)return;if(e.loading=!1,!s.ok){e.detail=null,e.error=l(s,`GET /api/deployments/${a}`);return}e.error="";const r=s.body;e.detail={id:r.id??a,kind:r.kind==="shared"?"shared":"isolated",createdAt:r.createdAt,updatedAt:r.updatedAt,stack:typeof r.stack=="string"?r.stack:"",busy:r.busy??null,compose:r.compose?{file:r.compose.file??"?",profiles:r.compose.profiles??[],overlays:r.compose.overlays??[]}:null,requires:Array.isArray(r.requires)?r.requires:[],axes:(Array.isArray(r.axes)?r.axes:[]).map(o=>({name:o.name,hooks:Array.isArray(o.hooks)?o.hooks:[],verifiable:o.verifiable??(Array.isArray(o.hooks)&&o.hooks.includes("assert_gone"))})),env:Array.isArray(r.env)?r.env:[]}}function g(a){e.id===a&&(e.detail||e.error)||(e.id=a,e.detail=null,e.error="",e.vars=y(a),t())}function m(){u(e.id,e.vars)}function x(){m(),t()}export{x as a,e as d,b as i,g as o,m as p,k as r,h as u,f as v};
2
+ //# sourceMappingURL=useDeployment-BFsbmcLi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDeployment-DplTFu7s.js","sources":["../../src/composables/useDeployment.ts"],"sourcesContent":["/**\n * The deployment currently open in the detail view.\n *\n * A module singleton rather than provide/inject, because the six tabs are CHILD ROUTES: they are\n * siblings of each other and are mounted and unmounted independently, so passing the loaded\n * deployment down as a prop would mean re-fetching it on every tab change. Switching tabs must not\n * re-fetch or blank the panel — only opening a DIFFERENT deployment does.\n *\n * `vars` here are REQUEST-TIME variables, sent as `?query` on every route that resolves this\n * deployment. See `useVars.ts` for why they matter and what they can get wrong.\n */\n\nimport { computed, reactive } from 'vue';\nimport { api, problem, query } from '../api/client';\nimport type { Deployment, VarPair } from '../api/types';\nimport { readVars, writeVars } from './useVars';\nimport { rowFor } from './useControlPlane';\n\nexport const dep = reactive({\n id: '',\n detail: null as Deployment | null,\n /** The resolve failure, verbatim. It is a 400 that NAMES the missing variable. */\n error: '',\n loading: false,\n vars: [] as VarPair[],\n});\n\nexport const varsQuery = computed(() => query(dep.vars));\n\n/** The list row, which is the only place the server exposes stored `vars` and `specName` today. */\nexport const row = computed(() => rowFor(dep.id));\n\nexport const isShared = computed(() => dep.detail?.kind === 'shared');\n\nexport const unverifiableAxes = computed(() =>\n (dep.detail?.axes ?? []).filter((a) => !a.verifiable).map((a) => a.name),\n);\n\nexport async function loadDetail(): Promise<void> {\n const id = dep.id;\n dep.loading = true;\n const r = await api.get<Deployment>(`/api/deployments/${encodeURIComponent(id)}${varsQuery.value}`);\n // Navigated to another deployment while this was in flight: drop the answer rather than render\n // one deployment's spec under another's id.\n if (dep.id !== id) return;\n dep.loading = false;\n\n if (!r.ok) {\n dep.detail = null;\n dep.error = problem(r, `GET /api/deployments/${id}`);\n return;\n }\n dep.error = '';\n const b = r.body;\n dep.detail = {\n id: b.id ?? id,\n kind: b.kind === 'shared' ? 'shared' : 'isolated',\n createdAt: b.createdAt,\n updatedAt: b.updatedAt,\n stack: typeof b.stack === 'string' ? b.stack : '',\n busy: b.busy ?? null,\n compose: b.compose\n ? {\n file: b.compose.file ?? '?',\n profiles: b.compose.profiles ?? [],\n overlays: b.compose.overlays ?? [],\n }\n : null,\n requires: Array.isArray(b.requires) ? b.requires : [],\n axes: (Array.isArray(b.axes) ? b.axes : []).map((a) => ({\n name: a.name,\n hooks: Array.isArray(a.hooks) ? a.hooks : [],\n // Derive it if an older build omits the field. Defaulting to `false` would claim an axis is\n // unverifiable when it may define a perfectly good `assert_gone`.\n verifiable: a.verifiable ?? (Array.isArray(a.hooks) && a.hooks.includes('assert_gone')),\n })),\n env: Array.isArray(b.env) ? b.env : [],\n };\n}\n\n/** Point the singleton at a deployment. Resets everything a stale id could leak into the new one. */\nexport function openDeployment(id: string): void {\n if (dep.id === id && (dep.detail || dep.error)) return; // a tab change, not a navigation\n dep.id = id;\n dep.detail = null;\n dep.error = '';\n dep.vars = readVars(id);\n void loadDetail();\n}\n\nexport function persistVars(): void {\n writeVars(dep.id, dep.vars);\n}\n\nexport function applyVars(): void {\n persistVars();\n void loadDetail();\n}\n"],"names":["dep","reactive","varsQuery","computed","query","row","rowFor","isShared","_a","unverifiableAxes","a","loadDetail","id","r","api","problem","b","openDeployment","readVars","persistVars","writeVars","applyVars"],"mappings":"4HAkBO,MAAMA,EAAMC,EAAS,CAC1B,GAAI,GACJ,OAAQ,KAER,MAAO,GACP,QAAS,GACT,KAAM,CAAA,CACR,CAAC,EAEYC,EAAYC,EAAS,IAAMC,EAAMJ,EAAI,IAAI,CAAC,EAG1CK,EAAMF,EAAS,IAAMG,EAAON,EAAI,EAAE,CAAC,EAEnCO,EAAWJ,EAAS,IAAA,OAAM,QAAAK,EAAAR,EAAI,SAAJ,YAAAQ,EAAY,QAAS,SAAQ,EAEvDC,EAAmBN,EAAS,IAAA,OACtC,SAAAK,EAAAR,EAAI,SAAJ,YAAAQ,EAAY,OAAQ,CAAA,GAAI,OAAQE,GAAM,CAACA,EAAE,UAAU,EAAE,IAAKA,GAAMA,EAAE,IAAI,EACzE,EAEA,eAAsBC,GAA4B,CAChD,MAAMC,EAAKZ,EAAI,GACfA,EAAI,QAAU,GACd,MAAMa,EAAI,MAAMC,EAAI,IAAgB,oBAAoB,mBAAmBF,CAAE,CAAC,GAAGV,EAAU,KAAK,EAAE,EAGlG,GAAIF,EAAI,KAAOY,EAAI,OAGnB,GAFAZ,EAAI,QAAU,GAEV,CAACa,EAAE,GAAI,CACTb,EAAI,OAAS,KACbA,EAAI,MAAQe,EAAQF,EAAG,wBAAwBD,CAAE,EAAE,EACnD,MACF,CACAZ,EAAI,MAAQ,GACZ,MAAMgB,EAAIH,EAAE,KACZb,EAAI,OAAS,CACX,GAAIgB,EAAE,IAAMJ,EACZ,KAAMI,EAAE,OAAS,SAAW,SAAW,WACvC,UAAWA,EAAE,UACb,UAAWA,EAAE,UACb,MAAO,OAAOA,EAAE,OAAU,SAAWA,EAAE,MAAQ,GAC/C,KAAMA,EAAE,MAAQ,KAChB,QAASA,EAAE,QACP,CACE,KAAMA,EAAE,QAAQ,MAAQ,IACxB,SAAUA,EAAE,QAAQ,UAAY,CAAA,EAChC,SAAUA,EAAE,QAAQ,UAAY,CAAA,CAAC,EAEnC,KACJ,SAAU,MAAM,QAAQA,EAAE,QAAQ,EAAIA,EAAE,SAAW,CAAA,EACnD,MAAO,MAAM,QAAQA,EAAE,IAAI,EAAIA,EAAE,KAAO,CAAA,GAAI,IAAKN,IAAO,CACtD,KAAMA,EAAE,KACR,MAAO,MAAM,QAAQA,EAAE,KAAK,EAAIA,EAAE,MAAQ,CAAA,EAG1C,WAAYA,EAAE,aAAe,MAAM,QAAQA,EAAE,KAAK,GAAKA,EAAE,MAAM,SAAS,aAAa,EAAA,EACrF,EACF,IAAK,MAAM,QAAQM,EAAE,GAAG,EAAIA,EAAE,IAAM,CAAA,CAAC,CAEzC,CAGO,SAASC,EAAeL,EAAkB,CAC3CZ,EAAI,KAAOY,IAAOZ,EAAI,QAAUA,EAAI,SACxCA,EAAI,GAAKY,EACTZ,EAAI,OAAS,KACbA,EAAI,MAAQ,GACZA,EAAI,KAAOkB,EAASN,CAAE,EACjBD,EAAA,EACP,CAEO,SAASQ,GAAoB,CAClCC,EAAUpB,EAAI,GAAIA,EAAI,IAAI,CAC5B,CAEO,SAASqB,GAAkB,CAChCF,EAAA,EACKR,EAAA,CACP"}
1
+ {"version":3,"file":"useDeployment-BFsbmcLi.js","sources":["../../src/composables/useDeployment.ts"],"sourcesContent":["/**\n * The deployment currently open in the detail view.\n *\n * A module singleton rather than provide/inject, because the six tabs are CHILD ROUTES: they are\n * siblings of each other and are mounted and unmounted independently, so passing the loaded\n * deployment down as a prop would mean re-fetching it on every tab change. Switching tabs must not\n * re-fetch or blank the panel — only opening a DIFFERENT deployment does.\n *\n * `vars` here are REQUEST-TIME variables, sent as `?query` on every route that resolves this\n * deployment. See `useVars.ts` for why they matter and what they can get wrong.\n */\n\nimport { computed, reactive } from 'vue';\nimport { api, problem, query } from '../api/client';\nimport type { Deployment, VarPair } from '../api/types';\nimport { readVars, writeVars } from './useVars';\nimport { rowFor } from './useControlPlane';\n\nexport const dep = reactive({\n id: '',\n detail: null as Deployment | null,\n /** The resolve failure, verbatim. It is a 400 that NAMES the missing variable. */\n error: '',\n loading: false,\n vars: [] as VarPair[],\n});\n\nexport const varsQuery = computed(() => query(dep.vars));\n\n/** The list row, which is the only place the server exposes stored `vars` and `specName` today. */\nexport const row = computed(() => rowFor(dep.id));\n\nexport const isShared = computed(() => dep.detail?.kind === 'shared');\n\nexport const unverifiableAxes = computed(() =>\n (dep.detail?.axes ?? []).filter((a) => !a.verifiable).map((a) => a.name),\n);\n\nexport async function loadDetail(): Promise<void> {\n const id = dep.id;\n dep.loading = true;\n const r = await api.get<Deployment>(`/api/deployments/${encodeURIComponent(id)}${varsQuery.value}`);\n // Navigated to another deployment while this was in flight: drop the answer rather than render\n // one deployment's spec under another's id.\n if (dep.id !== id) return;\n dep.loading = false;\n\n if (!r.ok) {\n dep.detail = null;\n dep.error = problem(r, `GET /api/deployments/${id}`);\n return;\n }\n dep.error = '';\n const b = r.body;\n dep.detail = {\n id: b.id ?? id,\n kind: b.kind === 'shared' ? 'shared' : 'isolated',\n createdAt: b.createdAt,\n updatedAt: b.updatedAt,\n stack: typeof b.stack === 'string' ? b.stack : '',\n busy: b.busy ?? null,\n compose: b.compose\n ? {\n file: b.compose.file ?? '?',\n profiles: b.compose.profiles ?? [],\n overlays: b.compose.overlays ?? [],\n }\n : null,\n requires: Array.isArray(b.requires) ? b.requires : [],\n axes: (Array.isArray(b.axes) ? b.axes : []).map((a) => ({\n name: a.name,\n hooks: Array.isArray(a.hooks) ? a.hooks : [],\n // Derive it if an older build omits the field. Defaulting to `false` would claim an axis is\n // unverifiable when it may define a perfectly good `assert_gone`.\n verifiable: a.verifiable ?? (Array.isArray(a.hooks) && a.hooks.includes('assert_gone')),\n })),\n env: Array.isArray(b.env) ? b.env : [],\n };\n}\n\n/** Point the singleton at a deployment. Resets everything a stale id could leak into the new one. */\nexport function openDeployment(id: string): void {\n if (dep.id === id && (dep.detail || dep.error)) return; // a tab change, not a navigation\n dep.id = id;\n dep.detail = null;\n dep.error = '';\n dep.vars = readVars(id);\n void loadDetail();\n}\n\nexport function persistVars(): void {\n writeVars(dep.id, dep.vars);\n}\n\nexport function applyVars(): void {\n persistVars();\n void loadDetail();\n}\n"],"names":["dep","reactive","varsQuery","computed","query","row","rowFor","isShared","_a","unverifiableAxes","a","loadDetail","id","r","api","problem","b","openDeployment","readVars","persistVars","writeVars","applyVars"],"mappings":"4HAkBO,MAAMA,EAAMC,EAAS,CAC1B,GAAI,GACJ,OAAQ,KAER,MAAO,GACP,QAAS,GACT,KAAM,CAAA,CACR,CAAC,EAEYC,EAAYC,EAAS,IAAMC,EAAMJ,EAAI,IAAI,CAAC,EAG1CK,EAAMF,EAAS,IAAMG,EAAON,EAAI,EAAE,CAAC,EAEnCO,EAAWJ,EAAS,IAAA,OAAM,QAAAK,EAAAR,EAAI,SAAJ,YAAAQ,EAAY,QAAS,SAAQ,EAEvDC,EAAmBN,EAAS,IAAA,OACtC,SAAAK,EAAAR,EAAI,SAAJ,YAAAQ,EAAY,OAAQ,CAAA,GAAI,OAAQE,GAAM,CAACA,EAAE,UAAU,EAAE,IAAKA,GAAMA,EAAE,IAAI,EACzE,EAEA,eAAsBC,GAA4B,CAChD,MAAMC,EAAKZ,EAAI,GACfA,EAAI,QAAU,GACd,MAAMa,EAAI,MAAMC,EAAI,IAAgB,oBAAoB,mBAAmBF,CAAE,CAAC,GAAGV,EAAU,KAAK,EAAE,EAGlG,GAAIF,EAAI,KAAOY,EAAI,OAGnB,GAFAZ,EAAI,QAAU,GAEV,CAACa,EAAE,GAAI,CACTb,EAAI,OAAS,KACbA,EAAI,MAAQe,EAAQF,EAAG,wBAAwBD,CAAE,EAAE,EACnD,MACF,CACAZ,EAAI,MAAQ,GACZ,MAAMgB,EAAIH,EAAE,KACZb,EAAI,OAAS,CACX,GAAIgB,EAAE,IAAMJ,EACZ,KAAMI,EAAE,OAAS,SAAW,SAAW,WACvC,UAAWA,EAAE,UACb,UAAWA,EAAE,UACb,MAAO,OAAOA,EAAE,OAAU,SAAWA,EAAE,MAAQ,GAC/C,KAAMA,EAAE,MAAQ,KAChB,QAASA,EAAE,QACP,CACE,KAAMA,EAAE,QAAQ,MAAQ,IACxB,SAAUA,EAAE,QAAQ,UAAY,CAAA,EAChC,SAAUA,EAAE,QAAQ,UAAY,CAAA,CAAC,EAEnC,KACJ,SAAU,MAAM,QAAQA,EAAE,QAAQ,EAAIA,EAAE,SAAW,CAAA,EACnD,MAAO,MAAM,QAAQA,EAAE,IAAI,EAAIA,EAAE,KAAO,CAAA,GAAI,IAAKN,IAAO,CACtD,KAAMA,EAAE,KACR,MAAO,MAAM,QAAQA,EAAE,KAAK,EAAIA,EAAE,MAAQ,CAAA,EAG1C,WAAYA,EAAE,aAAe,MAAM,QAAQA,EAAE,KAAK,GAAKA,EAAE,MAAM,SAAS,aAAa,EAAA,EACrF,EACF,IAAK,MAAM,QAAQM,EAAE,GAAG,EAAIA,EAAE,IAAM,CAAA,CAAC,CAEzC,CAGO,SAASC,EAAeL,EAAkB,CAC3CZ,EAAI,KAAOY,IAAOZ,EAAI,QAAUA,EAAI,SACxCA,EAAI,GAAKY,EACTZ,EAAI,OAAS,KACbA,EAAI,MAAQ,GACZA,EAAI,KAAOkB,EAASN,CAAE,EACjBD,EAAA,EACP,CAEO,SAASQ,GAAoB,CAClCC,EAAUpB,EAAI,GAAIA,EAAI,IAAI,CAC5B,CAEO,SAASqB,GAAkB,CAChCF,EAAA,EACKR,EAAA,CACP"}
package/dist/index.html CHANGED
@@ -5,6 +5,9 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <!-- An operations console for one host. Nothing here should ever be indexed. -->
7
7
  <meta name="robots" content="noindex, nofollow" />
8
+ <!-- Matches --bg per scheme, so the browser chrome (tab bar, overscroll) agrees with the page. -->
9
+ <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0e1116" />
10
+ <meta name="theme-color" media="(prefers-color-scheme: light)" content="#f5f6f8" />
8
11
  <title>pstack</title>
9
12
  <script>
10
13
  /**
@@ -24,8 +27,8 @@
24
27
  /* private mode: fall through to the OS preference */
25
28
  }
26
29
  </script>
27
- <script type="module" crossorigin src="/assets/index-D8OAewba.js"></script>
28
- <link rel="stylesheet" crossorigin href="/assets/index-BnwKLRM7.css">
30
+ <script type="module" crossorigin src="/assets/index-m4JghVue.js"></script>
31
+ <link rel="stylesheet" crossorigin href="/assets/index-WMJXAtiA.css">
29
32
  </head>
30
33
  <body>
31
34
  <div id="app"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samyx/preview-stacks-ui",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "private": false,
5
5
  "description": "The advanced web UI for preview-stacks — an opt-in SPA that talks to the pstack HTTP API.",
6
6
  "type": "module",
@@ -1,2 +0,0 @@
1
- import{d as J,c as r,E as Y,a as o,t as y,f as t,e as f,w as v,j as P,o as a,u as d,F as M,g as w,_ as L,i as S,G as O,v as Z,x as Q,r as b,C as j,A as V,N as F,O as W,B as z,P as _,k as ee,y as te,Q as oe}from"./index-D8OAewba.js";import{d as i,i as $,v as G}from"./useDeployment-DplTFu7s.js";import{a as C}from"./useFormat-CKJxQp_i.js";import{_ as R}from"./ActionButton.vue_vue_type_script_setup_true_lang-DjO5RzbR.js";import{_ as ne}from"./ErrorNote.vue_vue_type_script_setup_true_lang-D28UQmNR.js";import"./useVars-VN9gYdR6.js";const se={class:"raw",style:{color:"var(--fg-dim)","max-height":"200px"}},ie={key:0},ae={key:1},le={key:2},re={key:3},de={key:4},ue=J({__name:"ConflictNote",props:{conflict:{},jobId:{}},setup(m){return(I,s)=>{const p=P("RouterLink");return a(),r("div",{class:Y(["banner",m.conflict.kind==="shared"?"leaked":"info"]),role:"alert"},[s[5]||(s[5]=o("b",null,"Refused — nothing was started.",-1)),o("pre",se,y(m.conflict.text),1),m.conflict.kind==="shared"?(a(),r("p",ie,[...s[0]||(s[0]=[t(" Type the stack name in the confirmation field above and press ",-1),o("code",null,"down",-1),t(" again. ",-1)])])):m.conflict.kind==="containers"?(a(),r("p",ae,[...s[1]||(s[1]=[t(" Run ",-1),o("code",null,"down",-1),t(" first. Forgetting the record now would orphan those containers beyond the control plane's view: nothing left would know their stack name, their axes, or how to tear them down. ",-1)])])):m.conflict.kind==="referenced"?(a(),r("p",le,[s[2]||(s[2]=t(" These deployments still use this spec: ",-1)),o("strong",null,y(m.conflict.deployments.join(", ")),1),s[3]||(s[3]=t(". Deleting it would leave them with no way to be torn down. ",-1))])):m.jobId?(a(),r("p",re,[f(p,{to:`/jobs/${encodeURIComponent(m.jobId)}`},{default:v(()=>[...s[4]||(s[4]=[t("Follow the running job →",-1)])]),_:1},8,["to"])])):(a(),r("p",de,"Nothing was retried. Wait for the current work to finish, then try again."))],2)}}}),fe={class:"panel"},ve={key:0,class:"mute"},me={key:0,class:"banner warn"},pe={class:"row"},ye={key:1,class:"hint"},we={class:"hint"},be={class:"row",style:{"margin-top":"var(--s3)"}},ke={class:"check"},ce={key:2,class:"hint"},he={key:3,class:"banner leaked"},ge={class:"field",style:{"margin-top":"var(--s3)","max-width":"380px"}},$e=["for"],Ce=["id","placeholder"],xe={key:0,class:"s-failed"},Te={class:"panel"},je={key:0,class:"mute"},Re={class:"dim"},Ie={class:"row",style:{"margin-top":"var(--s3)"}},Ue={class:"check"},De=J({__name:"DangerTab",setup(m){const I=ee(),s=b(""),p=b(""),k=b(null),U=b(""),x=b(!0),c=b(""),h=b(!1),H=j(()=>{const n=i.vars.filter(e=>e.k).map(e=>e.k);return n.length?`Sending ${n.join(", ")} with every action.`:"Using the variables saved with this deployment."}),T=j(()=>{var n;return!!((n=i.detail)!=null&&n.stack)&&c.value===i.detail.stack}),K=j(()=>{var n;return((n=te.health)==null?void 0:n.authEnforced)===!0&&!oe.token}),g=j(()=>{var n;return((n=i.detail)==null?void 0:n.busy)===!0});function N(n){if(!i.detail)return"The spec has not resolved — the server cannot compute the stack name.";if(g.value)return`A job is already in flight for ${i.detail.stack}.`;if(n==="down"&&$.value&&!T.value)return`Type the stack name "${i.detail.stack}" below to confirm a shared teardown.`}async function A(n){if(!i.detail)return;s.value=n,p.value="",k.value=null;const e=n==="down"?{verify:x.value,force:$.value&&T.value}:{},u=await V.post(`/api/deployments/${encodeURIComponent(i.id)}/${n}${G.value}`,e);if(s.value="",u.status===202){const l=u.body.job;if(l!=null&&l.id){F("info",`${C(n)} started on ${l.stack}`,{to:`/jobs/${encodeURIComponent(l.id)}`,toLabel:"Follow"}),W(),I.push(`/jobs/${encodeURIComponent(l.id)}`);return}p.value="The action was accepted, but the response carried nothing to follow.";return}if(u.status===409)return D(u.body);p.value=z(u,C(n).toLowerCase()),F("error",`${C(n)} was refused.`)}async function X(){if(!h.value)return;s.value="forget",p.value="",k.value=null;const n=await V.del(`/api/deployments/${encodeURIComponent(i.id)}${G.value}`);if(s.value="",n.ok){F("ok",`Forgot ${i.id}. Nothing was torn down.`),W(),I.push("/deployments");return}if(n.status===409)return D(n.body);p.value=z(n,"forget this deployment")}async function D(n){var B;const e=_(n);k.value=e,U.value="",e.kind==="shared"&&(c.value="");const u=e.stack||((B=i.detail)==null?void 0:B.stack);if(e.kind!=="other"||!u)return;const E=((await V.get("/api/jobs")).body.jobs??[]).find(q=>q.state==="running"&&q.stack===u);E&&(U.value=E.id)}return(n,e)=>{const u=P("RouterLink");return a(),r("div",null,[o("section",fe,[e[30]||(e[30]=o("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Lifecycle",-1)),d(i).detail?(a(),r(M,{key:1},[K.value?(a(),r("div",me,[e[12]||(e[12]=o("b",null,"No access token set.",-1)),o("p",null,[e[10]||(e[10]=t(" Every action below will be refused. Add your token under ",-1)),f(u,{to:"/settings"},{default:v(()=>[...e[9]||(e[9]=[t("Settings",-1)])]),_:1}),e[11]||(e[11]=t(". ",-1))])])):w("",!0),o("div",pe,[f(R,{variant:"primary",pending:s.value==="up",disabled:!!s.value||g.value,title:N("up"),onClick:e[0]||(e[0]=l=>A("up"))},{default:v(()=>[t(y(d(C)("up")),1)]),_:1},8,["pending","disabled","title"]),f(R,{pending:s.value==="verify",disabled:!!s.value||g.value,title:N("verify"),onClick:e[1]||(e[1]=l=>A("verify"))},{default:v(()=>[t(y(d(C)("verify")),1)]),_:1},8,["pending","disabled","title"]),f(R,{variant:"danger",pending:s.value==="down",disabled:!!s.value||g.value||d($)&&!T.value,title:N("down"),onClick:e[2]||(e[2]=l=>A("down"))},{default:v(()=>[t(y(d($)?"Tear down (force)":"Tear down"),1)]),_:1},8,["pending","disabled","title"]),e[14]||(e[14]=o("span",{class:"grow"},null,-1)),f(u,{to:`/submit/${encodeURIComponent(d(i).id)}`},{default:v(()=>[...e[13]||(e[13]=[t("Edit spec & compose →",-1)])]),_:1},8,["to"])]),g.value?(a(),r("p",ye,[e[16]||(e[16]=t(" Something is already running on ",-1)),o("b",null,y(d(i).detail.stack),1),e[17]||(e[17]=t(". ",-1)),f(L,{label:"why actions wait"},{default:v(()=>[...e[15]||(e[15]=[t(" One action at a time per stack, and they are not queued. A teardown racing a deploy over the same database would corrupt it, so the second request is refused rather than delayed. ",-1)])]),_:1})])):w("",!0),o("p",we,[t(y(H.value)+" ",1),f(u,{to:`/deployments/${encodeURIComponent(d(i).id)}/config`},{default:v(()=>[...e[18]||(e[18]=[t("change",-1)])]),_:1},8,["to"])]),o("div",be,[o("label",ke,[S(o("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>x.value=l),type:"checkbox"},null,512),[[O,x.value]]),e[19]||(e[19]=t(" Check for leftovers afterwards ",-1))])]),x.value?w("",!0):(a(),r("p",ce,[...e[20]||(e[20]=[t(" Nothing will check that teardown actually finished. A teardown that silently half-worked is the exact failure this tool exists to catch — run ",-1),o("b",null,"Verify",-1),t(" yourself afterwards. ",-1)])])),d($)?(a(),r("div",he,[e[29]||(e[29]=o("b",null,"Shared — read this before tearing down.",-1)),o("p",null,[e[22]||(e[22]=t(" Tearing this down ",-1)),e[23]||(e[23]=o("b",null,"deletes its stored data",-1)),e[24]||(e[24]=t(": the TLS certificates, the shared database or queue, admin credentials. Nothing here recreates them, so ",-1)),e[25]||(e[25]=o("b",null,"every preview on this host breaks",-1)),e[26]||(e[26]=t(" until someone rebuilds it by hand. The button is the same one that is routine on a single preview. ",-1)),f(L,{label:"what tearing down runs"},{default:v(()=>[...e[21]||(e[21]=[o("code",null,"docker compose down -v",-1),t(" — the ",-1),o("code",null,"-v",-1),t(" is what removes the volumes. ",-1)])]),_:1})]),o("div",ge,[o("label",{for:`confirm-${d(i).id}`},[e[27]||(e[27]=t(" Type the stack name ",-1)),o("b",null,y(d(i).detail.stack),1),e[28]||(e[28]=t(" to confirm ",-1))],8,$e),S(o("input",{id:`confirm-${d(i).id}`,"onUpdate:modelValue":e[4]||(e[4]=l=>c.value=l),type:"text",placeholder:d(i).detail.stack,spellcheck:"false",autocomplete:"off"},null,8,Ce),[[Z,c.value,void 0,{trim:!0}]])]),c.value&&!T.value?(a(),r("p",xe," That does not match, so tearing down stays disabled. ")):w("",!0)])):w("",!0),p.value?(a(),Q(ne,{key:4,text:p.value,title:"The action was refused."},null,8,["text"])):w("",!0),k.value?(a(),Q(ue,{key:5,conflict:k.value,"job-id":U.value},null,8,["conflict","job-id"])):w("",!0)],64)):(a(),r("p",ve,[e[7]||(e[7]=t(" Actions are unavailable until this deployment's variables are filled in — without them its stack has no name to act on. Set them under ",-1)),f(u,{to:`/deployments/${encodeURIComponent(d(i).id)}/config`},{default:v(()=>[...e[6]||(e[6]=[t(" Config & variables ",-1)])]),_:1},8,["to"]),e[8]||(e[8]=t("first. ",-1))]))]),o("section",Te,[e[39]||(e[39]=o("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Forget this deployment",-1)),d(i).detail?(a(),r(M,{key:1},[o("p",Re,[e[32]||(e[32]=t(" This removes the ",-1)),e[33]||(e[33]=o("em",null,"record only",-1)),e[34]||(e[34]=t(" — ",-1)),e[35]||(e[35]=o("b",null,"it never tears anything down",-1)),e[36]||(e[36]=t(". Afterwards nothing here knows how to remove whatever this deployment created. ",-1)),f(L,{label:"when forgetting is refused"},{default:v(()=>[...e[31]||(e[31]=[t(" Refused while any container for this stack still exists — and refused just as firmly when docker cannot be reached, because “cannot confirm” is not evidence of absence. What is deleted is the stored spec, compose file and metadata. ",-1)])]),_:1})]),o("div",Ie,[o("label",Ue,[S(o("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>h.value=l),type:"checkbox"},null,512),[[O,h.value]]),e[37]||(e[37]=t(" I have torn this down and want the record removed ",-1))]),f(R,{variant:"danger",pending:s.value==="forget",disabled:!h.value||!!s.value,title:h.value?void 0:"Confirm you have torn this down first.",onClick:X},{default:v(()=>[...e[38]||(e[38]=[t(" Forget ",-1)])]),_:1},8,["pending","disabled","title"])])],64)):(a(),r("p",je," Unavailable until the variables are filled in: this stack's containers are counted before the record can be forgotten, and that needs its name. "))])])}}});export{De as default};
2
- //# sourceMappingURL=DangerTab-Nyebdr6k.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DangerTab-Nyebdr6k.js","sources":["../../src/components/ConflictNote.vue","../../src/views/tabs/DangerTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A 409, explained.\n *\n * \"409\" on this API always means the same thing about consequences — **refused, and nothing was\n * started** — but four different things about the cause, and guessing wrong sends the operator\n * down the wrong path. The classification is done on payload SHAPE in `client.ts`, never on the\n * message text, and the server's own message is always printed verbatim underneath.\n *\n * Note what is deliberately NOT distinguished: \"a job is in flight\" and \"docker did not answer\"\n * are shape-identical, so this renders neither claim — it prints the message and offers a link to\n * a running job only when one demonstrably exists.\n */\nimport type { Conflict } from '../api/client';\n\ndefineProps<{ conflict: Conflict; jobId?: string }>();\n</script>\n\n<template>\n <div class=\"banner\" :class=\"conflict.kind === 'shared' ? 'leaked' : 'info'\" role=\"alert\">\n <b>Refused — nothing was started.</b>\n <pre class=\"raw\" style=\"color: var(--fg-dim); max-height: 200px\">{{ conflict.text }}</pre>\n\n <p v-if=\"conflict.kind === 'shared'\">\n Type the stack name in the confirmation field above and press <code>down</code> again.\n </p>\n <p v-else-if=\"conflict.kind === 'containers'\">\n Run <code>down</code> first. Forgetting the record now would orphan those containers beyond\n the control plane's view: nothing left would know their stack name, their axes, or how to\n tear them down.\n </p>\n <p v-else-if=\"conflict.kind === 'referenced'\">\n These deployments still use this spec: <strong>{{ conflict.deployments.join(', ') }}</strong>.\n Deleting it would leave them with no way to be torn down.\n </p>\n <p v-else-if=\"jobId\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(jobId)}`\">Follow the running job →</RouterLink>\n </p>\n <p v-else>Nothing was retried. Wait for the current work to finish, then try again.</p>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Lifecycle actions, and forgetting the record. Everything on this page destroys something.\n *\n * The two guards that matter:\n *\n * 1. TYPED CONFIRMATION FOR A SHARED `down`. A checkbox is one stray click; typing a name is a\n * decision. The typed string is the resolved STACK NAME — not the deployment id — because the\n * stack is the actual blast target, it is what the server's own 409 refusal names, and it is\n * what `compose down -v` will be pointed at. The server holds the authoritative guard\n * (`down()` refuses without `force`, and the API answers 409 before starting a job), so this\n * is defence in depth, not the only barrier.\n *\n * 2. FORGETTING IS NOT TEARING DOWN. `DELETE` removes the record and never touches a container.\n * The server refuses with 409 while any container exists — and refuses just as firmly when\n * docker did not answer, because \"cannot confirm\" is not evidence of absence.\n */\nimport { computed, ref } from 'vue';\nimport { useRouter } from 'vue-router';\nimport { api, classifyConflict, problem, type Conflict } from '../../api/client';\nimport type { ActionResponse, ConflictBody, JobsResponse } from '../../api/types';\nimport { dep, isShared, varsQuery } from '../../composables/useDeployment';\nimport { loadDeployments, state } from '../../composables/useControlPlane';\nimport { settings } from '../../composables/useSettings';\nimport { toast } from '../../composables/useToasts';\nimport { actionLabel } from '../../composables/useFormat';\nimport ActionButton from '../../components/ActionButton.vue';\nimport ConflictNote from '../../components/ConflictNote.vue';\nimport InfoHint from '../../components/InfoHint.vue';\nimport ErrorNote from '../../components/ErrorNote.vue';\n\nconst router = useRouter();\n\nconst pending = ref<'' | 'up' | 'verify' | 'down' | 'forget'>('');\nconst actionError = ref('');\nconst conflict = ref<Conflict | null>(null);\nconst conflictJobId = ref('');\nconst downVerify = ref(true);\nconst forceTyped = ref('');\nconst forgetArmed = ref(false);\n\n/**\n * The variables these actions will send, as prose. Which variables are set decides which stack is\n * touched, so the NAMES are worth stating — the URL-encoded query string they become is not.\n */\nconst varsSummary = computed(() => {\n const names = dep.vars.filter((v) => v.k).map((v) => v.k);\n // NOT \"no variables\": with none set here the server resolves the ones stored with the deployment,\n // and claiming otherwise would have an operator hunting for variables that are already in place.\n return names.length\n ? `Sending ${names.join(', ')} with every action.`\n : 'Using the variables saved with this deployment.';\n});\n\n/** Exact match against the resolved stack name. Nothing looser — no trim-insensitive, no prefix. */\nconst forceArmed = computed(\n () => !!dep.detail?.stack && forceTyped.value === dep.detail.stack,\n);\n\nconst tokenMissing = computed(() => state.health?.authEnforced === true && !settings.token);\nconst busy = computed(() => dep.detail?.busy === true);\n\n/** A disabled control must say why. This is the text that answers it. */\nfunction whyDisabled(action: 'up' | 'verify' | 'down'): string | undefined {\n if (!dep.detail) return 'The spec has not resolved — the server cannot compute the stack name.';\n if (busy.value) return `A job is already in flight for ${dep.detail.stack}.`;\n if (action === 'down' && isShared.value && !forceArmed.value) {\n return `Type the stack name \"${dep.detail.stack}\" below to confirm a shared teardown.`;\n }\n return undefined;\n}\n\nasync function act(action: 'up' | 'verify' | 'down'): Promise<void> {\n if (!dep.detail) return;\n pending.value = action;\n actionError.value = '';\n conflict.value = null;\n\n const body =\n action === 'down'\n ? // `force` is only ever true for a shared deployment whose stack name was typed out in full.\n { verify: downVerify.value, force: isShared.value && forceArmed.value }\n : {};\n\n const r = await api.post<ActionResponse & ConflictBody>(\n `/api/deployments/${encodeURIComponent(dep.id)}/${action}${varsQuery.value}`,\n body,\n );\n pending.value = '';\n\n if (r.status === 202) {\n const job = r.body.job;\n if (job?.id) {\n toast('info', `${actionLabel(action)} started on ${job.stack}`, {\n to: `/jobs/${encodeURIComponent(job.id)}`,\n toLabel: 'Follow',\n });\n void loadDeployments();\n void router.push(`/jobs/${encodeURIComponent(job.id)}`);\n return;\n }\n actionError.value = 'The action was accepted, but the response carried nothing to follow.';\n return;\n }\n if (r.status === 409) return onConflict(r.body);\n\n actionError.value = problem(r, actionLabel(action).toLowerCase());\n toast('error', `${actionLabel(action)} was refused.`);\n}\n\nasync function forget(): Promise<void> {\n if (!forgetArmed.value) return;\n pending.value = 'forget';\n actionError.value = '';\n conflict.value = null;\n\n const r = await api.del<ConflictBody>(\n `/api/deployments/${encodeURIComponent(dep.id)}${varsQuery.value}`,\n );\n pending.value = '';\n\n if (r.ok) {\n toast('ok', `Forgot ${dep.id}. Nothing was torn down.`);\n void loadDeployments();\n void router.push('/deployments');\n return;\n }\n if (r.status === 409) return onConflict(r.body);\n actionError.value = problem(r, 'forget this deployment');\n}\n\n/**\n * Classify on payload SHAPE (in `client.ts`), never on message text — then look for a running job\n * ONLY to offer a link. \"A job is in flight\" and \"docker did not answer\" are shape-identical, so\n * neither is claimed; the server's message is printed verbatim either way. Never retry.\n */\nasync function onConflict(body: ConflictBody): Promise<void> {\n const c = classifyConflict(body);\n conflict.value = c;\n conflictJobId.value = '';\n if (c.kind === 'shared') forceTyped.value = '';\n\n const stack = c.stack || dep.detail?.stack;\n if (c.kind !== 'other' || !stack) return;\n const jl = await api.get<JobsResponse>('/api/jobs');\n const live = (jl.body.jobs ?? []).find((j) => j.state === 'running' && j.stack === stack);\n if (live) conflictJobId.value = live.id;\n}\n</script>\n\n<template>\n <div>\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Lifecycle</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">\n Actions are unavailable until this deployment's variables are filled in — without them its\n stack has no name to act on. Set them under\n <RouterLink :to=\"`/deployments/${encodeURIComponent(dep.id)}/config`\">\n Config &amp; variables </RouterLink\n >first.\n </p>\n\n <template v-else>\n <div v-if=\"tokenMissing\" class=\"banner warn\">\n <b>No access token set.</b>\n <p>\n Every action below will be refused. Add your token under\n <RouterLink to=\"/settings\">Settings</RouterLink>.\n </p>\n </div>\n\n <div class=\"row\">\n <ActionButton\n variant=\"primary\"\n :pending=\"pending === 'up'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('up')\"\n @click=\"act('up')\"\n >\n {{ actionLabel('up') }}\n </ActionButton>\n <ActionButton\n :pending=\"pending === 'verify'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('verify')\"\n @click=\"act('verify')\"\n >\n {{ actionLabel('verify') }}\n </ActionButton>\n <ActionButton\n variant=\"danger\"\n :pending=\"pending === 'down'\"\n :disabled=\"!!pending || busy || (isShared && !forceArmed)\"\n :title=\"whyDisabled('down')\"\n @click=\"act('down')\"\n >\n {{ isShared ? 'Tear down (force)' : 'Tear down' }}\n </ActionButton>\n <span class=\"grow\" />\n <RouterLink :to=\"`/submit/${encodeURIComponent(dep.id)}`\">Edit spec &amp; compose →</RouterLink>\n </div>\n\n <p v-if=\"busy\" class=\"hint\">\n Something is already running on <b>{{ dep.detail.stack }}</b>.\n <InfoHint label=\"why actions wait\">\n One action at a time per stack, and they are not queued. A teardown racing a deploy over\n the same database would corrupt it, so the second request is refused rather than delayed.\n </InfoHint>\n </p>\n <p class=\"hint\">\n {{ varsSummary }}\n <RouterLink :to=\"`/deployments/${encodeURIComponent(dep.id)}/config`\">change</RouterLink>\n </p>\n\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <label class=\"check\">\n <input v-model=\"downVerify\" type=\"checkbox\" />\n Check for leftovers afterwards\n </label>\n </div>\n <p v-if=\"!downVerify\" class=\"hint\">\n Nothing will check that teardown actually finished. A teardown that silently half-worked is\n the exact failure this tool exists to catch — run <b>Verify</b> yourself afterwards.\n </p>\n\n <!--\n Gate 1 of 2. The typed name is the point: a checkbox is one stray click, typing the stack\n name is a decision.\n -->\n <div v-if=\"isShared\" class=\"banner leaked\">\n <b>Shared — read this before tearing down.</b>\n <p>\n Tearing this down <b>deletes its stored data</b>: the TLS certificates, the shared\n database or queue, admin credentials. Nothing here recreates them, so\n <b>every preview on this host breaks</b> until someone rebuilds it by hand. The button is\n the same one that is routine on a single preview.\n <InfoHint label=\"what tearing down runs\">\n <code>docker compose down -v</code> — the <code>-v</code> is what removes the volumes.\n </InfoHint>\n </p>\n <div class=\"field\" style=\"margin-top: var(--s3); max-width: 380px\">\n <label :for=\"`confirm-${dep.id}`\">\n Type the stack name <b>{{ dep.detail.stack }}</b> to confirm\n </label>\n <input\n :id=\"`confirm-${dep.id}`\"\n v-model.trim=\"forceTyped\"\n type=\"text\"\n :placeholder=\"dep.detail.stack\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <p v-if=\"forceTyped && !forceArmed\" class=\"s-failed\">\n That does not match, so tearing down stays disabled.\n </p>\n </div>\n\n <ErrorNote v-if=\"actionError\" :text=\"actionError\" title=\"The action was refused.\" />\n <ConflictNote v-if=\"conflict\" :conflict=\"conflict\" :job-id=\"conflictJobId\" />\n </template>\n </section>\n\n <!-- ============================ forget ============================ -->\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Forget this deployment</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">\n Unavailable until the variables are filled in: this stack's containers are counted before the\n record can be forgotten, and that needs its name.\n </p>\n <template v-else>\n <p class=\"dim\">\n This removes the <em>record only</em> — <b>it never tears anything down</b>. Afterwards\n nothing here knows how to remove whatever this deployment created.\n <InfoHint label=\"when forgetting is refused\">\n Refused while any container for this stack still exists — and refused just as firmly when\n docker cannot be reached, because “cannot confirm” is not evidence of absence. What is\n deleted is the stored spec, compose file and metadata.\n </InfoHint>\n </p>\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <label class=\"check\">\n <input v-model=\"forgetArmed\" type=\"checkbox\" />\n I have torn this down and want the record removed\n </label>\n <ActionButton\n variant=\"danger\"\n :pending=\"pending === 'forget'\"\n :disabled=\"!forgetArmed || !!pending\"\n :title=\"forgetArmed ? undefined : 'Confirm you have torn this down first.'\"\n @click=\"forget\"\n >\n Forget\n </ActionButton>\n </div>\n </template>\n </section>\n </div>\n</template>\n"],"names":["_createElementBlock","_normalizeClass","__props","_cache","_createElementVNode","_hoisted_1","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_createVNode","_component_RouterLink","_openBlock","router","useRouter","pending","ref","actionError","conflict","conflictJobId","downVerify","forceTyped","forgetArmed","varsSummary","computed","names","dep","v","forceArmed","_a","tokenMissing","state","settings","busy","whyDisabled","action","isShared","act","body","r","api","varsQuery","job","toast","actionLabel","loadDeployments","onConflict","problem","forget","c","classifyConflict","stack","live","j","_unref","_Fragment","ActionButton","InfoHint","_hoisted_6","_createTextVNode","_hoisted_7","_hoisted_8","$event","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_14","_createBlock","ErrorNote","ConflictNote","_hoisted_15","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_16"],"mappings":"wwBAmBEA,EAoBM,MAAA,CApBD,MAAKC,EAAA,CAAC,SAAiBC,EAAA,SAAS,OAAI,SAAA,SAAA,MAAA,CAAA,EAAmC,KAAK,OAAA,GAC/EC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,EAAqC,SAAlC,iCAA8B,EAAA,GACjCA,EAA0F,MAA1FC,GAA0FC,EAAtBJ,EAAA,SAAS,IAAI,EAAA,CAAA,EAExEA,EAAA,SAAS,OAAI,cAAtBF,EAEI,IAAAO,GAAA,CAAA,GAAAJ,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAFiC,kEAC2B,EAAA,EAAAC,EAAiB,YAAX,OAAI,EAAA,IAAO,WACjF,EAAA,CAAA,MACcF,EAAA,SAAS,OAAI,kBAA3BF,EAII,IAAAQ,GAAA,CAAA,GAAAL,EAA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AAgF,KAAA,CAA5E,MAAM,UAAU,MAAA,CAAA,gBAAA,WAAA,CAAA,EAAiC,yBAAsB,EAAA,GAEjEmD,EAAA5B,CAAA,EAAI,YAId3B,EAyBWwD,EAAA,CAAA,IAAA,GAAA,CAxBTpD,EAQI,IARJoE,GAQI,iBARW,qBACI,EAAA,GAAArE,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAC,EAAoB,UAAhB,cAAW,EAAA,mBAAK,MAAG,EAAA,GAAAD,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAC,EAAmC,SAAhC,+BAA4B,EAAA,mBAAI,mFAE3E,EAAA,GAAAO,EAIW+C,EAAA,CAJD,MAAM,8BAA4B,WAAC,IAI7C,CAAA,GAAAvD,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAJ6C,4OAI7C,EAAA,CAAA,aAEFC,EAcM,MAdNqE,GAcM,CAbJrE,EAGQ,QAHRsE,GAGQ,GAFNtE,EAA+C,QAAA,sCAA/BmB,EAAW,MAAAwC,GAAE,KAAK,UAAA,gBAAlBxC,EAAA,KAAW,CAAA,mBAAoB,sDAEjD,EAAA,EAAA,GACAZ,EAQe8C,EAAA,CAPb,QAAQ,SACP,QAASzC,EAAA,QAAO,SAChB,SAAQ,CAAGO,EAAA,OAAW,CAAA,CAAMP,EAAA,MAC5B,MAAOO,EAAA,MAAc,OAAS,yCAC9B,QAAO0B,CAAA,aACT,IAED,CAAA,GAAA9C,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAFC,WAED,EAAA,CAAA,yDA3BJH,EAGI,IAHJ2E,GAAmC,mJAGnC"}
@@ -1,2 +0,0 @@
1
- import{d as C,H as k,c as l,a as t,e as r,w as i,t as p,u as s,f as a,E as R,g as u,F as D,s as V,x as w,_,j as c,o,T as B,k as I,I as T}from"./index-D8OAewba.js";import{d as n,i as $,o as A}from"./useDeployment-DplTFu7s.js";import{_ as L}from"./ErrorNote.vue_vue_type_script_setup_true_lang-D28UQmNR.js";import"./useVars-VN9gYdR6.js";const N={class:"page-head"},S={class:"mute",style:{"font-size":"var(--t-sm)"}},q={style:{"font-size":"var(--t-xl)"}},z={class:"sub"},U={key:0},E={key:1},F={key:2},j={key:1,class:"badge busy"},H={class:"tabs","aria-label":"Deployment sections"},O={key:1,class:"hint"},G={key:2,class:"hint",style:{"margin-bottom":"var(--s4)"}},Q=C({__name:"DeploymentDetailView",props:{id:{}},setup(y){const v=y,b=I(),h=[{to:"overview",label:"Overview"},{to:"runtime",label:"Containers & routes"},{to:"config",label:"Config & variables"},{to:"axes",label:"Axes"},{to:"requires",label:"Requires"},{to:"logs",label:"Logs"},{to:"terminal",label:"Terminal"},{to:"danger",label:"Danger"}];return k(()=>v.id,m=>A(m),{immediate:!0}),k(()=>n.error,m=>{m&&b.currentRoute.value.name==="d.overview"&&b.replace(`/deployments/${encodeURIComponent(v.id)}/config`)}),(m,e)=>{var g;const f=c("RouterLink"),x=c("RouterView");return o(),l("div",null,[t("div",N,[t("div",null,[t("div",S,[r(f,{to:"/deployments"},{default:i(()=>[...e[0]||(e[0]=[a("← deployments",-1)])]),_:1})]),t("h1",q,p(y.id),1),t("div",z,[s(n).detail?(o(),l("span",U,[e[1]||(e[1]=a(" stack ",-1)),t("b",null,p(s(n).detail.stack),1)])):s(n).error?(o(),l("span",E,"unresolved")):(o(),l("span",F,"loading…"))])]),e[3]||(e[3]=t("span",{class:"grow"},null,-1)),s(n).detail?(o(),l("span",{key:0,class:R(["badge",s(n).detail.kind])},p(s(n).detail.kind),3)):u("",!0),((g=s(n).detail)==null?void 0:g.busy)===!0?(o(),l("span",j,[...e[2]||(e[2]=[t("span",{class:"dot pulse"},null,-1),a("busy",-1)])])):u("",!0)]),t("nav",H,[(o(),l(D,null,V(h,d=>r(f,{key:d.to,to:`/deployments/${encodeURIComponent(y.id)}/${d.to}`},{default:i(()=>[a(p(d.label),1)]),_:2},1032,["to"])),64))]),s(n).error?(o(),w(L,{key:0,text:s(n).error,title:"Could not resolve this deployment."},null,8,["text"])):u("",!0),s(n).error?(o(),l("p",O,[e[5]||(e[5]=a(" If that message names a variable, add it under ",-1)),e[6]||(e[6]=t("b",null,"Config & variables",-1)),e[7]||(e[7]=a(" and press ",-1)),e[8]||(e[8]=t("b",null,"Apply & reload",-1)),e[9]||(e[9]=a(". ",-1)),r(_,{label:"why the rest of the page is unavailable"},{default:i(()=>[...e[4]||(e[4]=[a(" Until the spec resolves there is no stack name, and every action on this deployment needs one. ",-1)])]),_:1})])):u("",!0),s($)?(o(),l("p",G,[e[11]||(e[11]=a(" Shared with every preview on this host. ",-1)),r(_,{label:"what a shared deployment is"},{default:i(()=>[...e[10]||(e[10]=[a(" A host singleton that previews borrow — a database, a queue, a registry mirror. It declares no axes, and tearing it down needs an explicit confirmation, because doing so destroys state every other deployment depends on. ",-1)])]),_:1})])):u("",!0),r(x,null,{default:i(({Component:d})=>[r(B,{name:"view",mode:"out-in"},{default:i(()=>[(o(),w(T(d)))]),_:2},1024)]),_:1})])}}});export{Q as default};
2
- //# sourceMappingURL=DeploymentDetailView-DKCUbiGG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeploymentDetailView-DKCUbiGG.js","sources":["../../src/views/DeploymentDetailView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The detail shell: breadcrumb, tabs, and the resolve-failure banner that gates the rest.\n *\n * A deployment whose spec will not resolve is not a dead end — the fix (its variables) lives on\n * the Config tab, so this sends the operator there rather than leaving them in front of an error\n * with no control in reach. Everything else stays unavailable until it resolves, because the\n * server cannot name the stack without the variables, and every action needs the stack name.\n */\nimport { watch } from 'vue';\nimport { useRouter } from 'vue-router';\nimport { dep, isShared, openDeployment } from '../composables/useDeployment';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst props = defineProps<{ id: string }>();\nconst router = useRouter();\n\nconst TABS = [\n { to: 'overview', label: 'Overview' },\n // Second, not buried: \"the hostname does not work\" is the most common question, and this is the\n // only tab that can answer it.\n { to: 'runtime', label: 'Containers & routes' },\n { to: 'config', label: 'Config & variables' },\n { to: 'axes', label: 'Axes' },\n { to: 'requires', label: 'Requires' },\n { to: 'logs', label: 'Logs' },\n // After Logs: a shell is what you reach for when the logs did not answer it.\n { to: 'terminal', label: 'Terminal' },\n { to: 'danger', label: 'Danger' },\n] as const;\n\nwatch(() => props.id, (id) => openDeployment(id), { immediate: true });\n\n// Land the operator on the editor when the spec will not resolve — but only from the tab that has\n// nothing to show. Sending them away from Logs or Danger mid-read would be its own annoyance.\nwatch(\n () => dep.error,\n (err) => {\n if (err && router.currentRoute.value.name === 'd.overview') {\n void router.replace(`/deployments/${encodeURIComponent(props.id)}/config`);\n }\n },\n);\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=\"/deployments\">← deployments</RouterLink>\n </div>\n <h1 style=\"font-size: var(--t-xl)\">{{ id }}</h1>\n <div class=\"sub\">\n <span v-if=\"dep.detail\">\n stack <b>{{ dep.detail.stack }}</b>\n </span>\n <span v-else-if=\"dep.error\">unresolved</span>\n <span v-else>loading…</span>\n </div>\n </div>\n <span class=\"grow\" />\n <span v-if=\"dep.detail\" class=\"badge\" :class=\"dep.detail.kind\">{{ dep.detail.kind }}</span>\n <span v-if=\"dep.detail?.busy === true\" class=\"badge busy\"><span class=\"dot pulse\" />busy</span>\n </div>\n\n <nav class=\"tabs\" aria-label=\"Deployment sections\">\n <RouterLink\n v-for=\"t in TABS\"\n :key=\"t.to\"\n :to=\"`/deployments/${encodeURIComponent(id)}/${t.to}`\"\n >{{ t.label }}</RouterLink\n >\n </nav>\n\n <ErrorNote v-if=\"dep.error\" :text=\"dep.error\" title=\"Could not resolve this deployment.\">\n </ErrorNote>\n <p v-if=\"dep.error\" class=\"hint\">\n If that message names a variable, add it under <b>Config &amp; variables</b> and press\n <b>Apply &amp; reload</b>.\n <InfoHint label=\"why the rest of the page is unavailable\">\n Until the spec resolves there is no stack name, and every action on this deployment needs one.\n </InfoHint>\n </p>\n\n <p v-if=\"isShared\" class=\"hint\" style=\"margin-bottom: var(--s4)\">\n Shared with every preview on this host.\n <InfoHint label=\"what a shared deployment is\">\n A host singleton that previews borrow — a database, a queue, a registry mirror. It declares no\n axes, and tearing it down needs an explicit confirmation, because doing so destroys state\n every other deployment depends on.\n </InfoHint>\n </p>\n\n <RouterView v-slot=\"{ Component }\">\n <Transition name=\"view\" mode=\"out-in\">\n <component :is=\"Component\" />\n </Transition>\n </RouterView>\n </div>\n</template>\n"],"names":["props","__props","router","useRouter","TABS","watch","id","openDeployment","dep","err","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_createVNode","_component_RouterLink","_cache","_hoisted_3","_toDisplayString","_hoisted_4","_unref","_hoisted_5","_openBlock","_hoisted_8","_hoisted_9","_Fragment","_renderList","t","_createTextVNode","_createBlock","ErrorNote","_hoisted_10","InfoHint","isShared","_hoisted_11","_component_RouterView","_withCtx","Component","_Transition","_resolveDynamicComponent"],"mappings":"+sBAeA,MAAMA,EAAQC,EACRC,EAASC,EAAA,EAETC,EAAO,CACX,CAAE,GAAI,WAAY,MAAO,UAAA,EAGzB,CAAE,GAAI,UAAW,MAAO,qBAAA,EACxB,CAAE,GAAI,SAAU,MAAO,oBAAA,EACvB,CAAE,GAAI,OAAQ,MAAO,MAAA,EACrB,CAAE,GAAI,WAAY,MAAO,UAAA,EACzB,CAAE,GAAI,OAAQ,MAAO,MAAA,EAErB,CAAE,GAAI,WAAY,MAAO,UAAA,EACzB,CAAE,GAAI,SAAU,MAAO,QAAA,CAAS,EAGlC,OAAAC,EAAM,IAAML,EAAM,GAAKM,GAAOC,EAAeD,CAAE,EAAG,CAAE,UAAW,GAAM,EAIrED,EACE,IAAMG,EAAI,MACTC,GAAQ,CACHA,GAAOP,EAAO,aAAa,MAAM,OAAS,cACvCA,EAAO,QAAQ,gBAAgB,mBAAmBF,EAAM,EAAE,CAAC,SAAS,CAE7E,CAAA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AAVC,EAAAV,EAAAS,EAAE,KAAK,EAAA,CAAA,CAAA,6BAIEP,EAAAZ,CAAA,EAAI,WAArBqB,EACYC,EAAA,OADiB,KAAMV,EAAAZ,CAAA,EAAI,MAAO,MAAM,oCAAA,6BAE3CY,EAAAZ,CAAA,EAAI,OAAbc,IAAAZ,EAMI,IANJqB,EAMI,eAN6B,mDACgB,EAAA,GAAAf,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAL,EAA6B,SAA1B,qBAAsB,EAAA,iBAAI,cAC5E,EAAA,GAAAK,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAL,EAAyB,SAAtB,iBAAkB,EAAA,iBAAI,KACzB,EAAA,GAAAG,EAEWkB,EAAA,CAFD,MAAM,2CAAyC,WAAC,IAE1D,CAAA,GAAAhB,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAF0D,mGAE1D,EAAA,CAAA,uBAGOI,EAAAa,CAAA,GAATX,IAAAZ,EAOI,IAPJwB,EAOI,iBAP6D,4CAE/D,EAAA,GAAApB,EAIWkB,EAAA,CAJD,MAAM,+BAA6B,WAAC,IAI9C,CAAA,GAAAhB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAJ8C,gOAI9C,EAAA,CAAA,uBAGFF,EAIaqB,EAAA,KAAA,CAHX,QAAAC,EAAA,CAEa,CAHO,UAAAC,KAAS,CAC7BvB,EAEawB,EAAA,CAFD,KAAK,OAAO,KAAK,QAAA,aAC3B,IAA6B,EAA7BhB,IAAAO,EAA6BU,EAAbF,CAAS,CAAA,EAAA"}
@@ -1,2 +0,0 @@
1
- import{d as D,c as r,a as e,F as g,s as z,a0 as J,o as n,D as M,E as _,u as p,t as u,H as q,K as H,e as V,w as G,f as d,g as c,x as B,i as K,G as O,r as f,C as E,A as R,j as W,B as P}from"./index-D8OAewba.js";import{a as Q,s as U,t as X}from"./useFormat-CKJxQp_i.js";import{_ as Y}from"./StateBadge.vue_vue_type_script_setup_true_lang-B5C48Wlo.js";import{_ as Z}from"./ErrorNote.vue_vue_type_script_setup_true_lang-D28UQmNR.js";function k(o){var i;return(i=o.message)!=null&&i.startsWith("unverifiable")?"unverifiable":o.ok?"ok":o.phase==="assert_gone"?"leaked":"failed"}function ee(o){return{ok:"✓",unverifiable:"?",leaked:"!",failed:"✗"}[k(o)]}function se(o){return o.message?o.message:o.skipped?"skipped":k(o)==="ok"?"ok":`exit ${o.code}`}function te(o){return o.filter(i=>i.phase==="assert_gone"&&!i.ok).map(i=>i.axis)}function ae(o){return o.filter(i=>k(i)==="unverifiable").length}const oe={class:"steps stagger"},ne={class:"who"},le={class:"dim",style:{"font-size":"var(--t-sm)"}},re=D({__name:"StepList",props:{steps:{}},setup(o){return(i,t)=>(n(),r("div",null,[e("ul",oe,[(n(!0),r(g,null,z(o.steps,(l,v)=>(n(),r("li",{key:`${l.phase}-${l.axis}-${v}`,class:"step",style:M({"--i":v})},[e("span",{class:_(["mark",`s-${p(k)(l)}`]),"aria-hidden":"true"},u(p(ee)(l)),3),e("span",null,[e("span",ne,u(l.axis),1),e("span",le," · "+u(l.phase),1),e("span",{class:_(["badge",p(k)(l)]),style:{"margin-left":"var(--s2)"}},u(p(k)(l)),3),e("div",{class:_(["msg",`s-${p(k)(l)}`])},u(p(se)(l)),3)])],4))),128))]),t[0]||(t[0]=J('<p class="hint"><span class="s-ok">✓ ok</span> · <span class="s-failed">✗ failed</span> · <span class="s-leaked">! leaked — survived teardown</span> · <span class="s-unverifiable">? unverifiable — nothing to check, not a pass</span>. A <code>down</code> step marked ok may still carry a <code>non-fatal:</code> note: teardown is best-effort by design, so aborting halfway would leave more behind than continuing. </p>',1))]))}}),ue={class:"page-head"},ie={class:"sub"},de={key:1,class:"panel leaked-banner"},ce={key:2,class:"panel"},pe={class:"pre"},ve={class:"panel"},me={class:"phead"},fe={class:"row",style:{gap:"8px"}},ke={key:0,class:"mute pulse"},be={class:"row",style:{gap:"6px"}},ge={key:0,class:"mute"},he={key:1,class:"mute"},ye={class:"mute"},_e={key:3,class:"panel"},we={class:"phead"},xe={key:0,class:"mute"},Le=D({__name:"JobDetailView",props:{jobId:{}},setup(o){const i=o,t=f(null),l=f([]),v=f(""),w=f(!0),h=f(!1),x=f(!0),$=f(null);let m=null;const C=E(()=>{var a;return(a=t.value)!=null&&a.outcome?te(t.value.outcome.steps):[]}),S=E(()=>{var a;return(a=t.value)!=null&&a.outcome?ae(t.value.outcome.steps):0});async function j(){var s;const a=await R.get(`/api/jobs/${encodeURIComponent(i.jobId)}`);return w.value=!1,a.ok?(v.value="",t.value=a.body.job,(s=a.body.job.log)!=null&&s.length&&l.value.length===0&&(l.value=[...a.body.job.log]),a.body.job):(v.value=P(a,"load job"),null)}function y(){m==null||m.close(),m=null,h.value=!1}function L(){y(),m=new EventSource(R.url(`/api/jobs/${encodeURIComponent(i.jobId)}/stream`)),h.value=!0,m.onmessage=a=>{let s;try{s=JSON.parse(a.data)}catch{return}if(s.done){y(),j();return}l.value.push(s),x.value&&queueMicrotask(F)},m.onerror=()=>{y(),j()}}function F(){const a=$.value;a&&(a.scrollTop=a.scrollHeight)}return q(()=>i.jobId,async()=>{l.value=[],t.value=null,w.value=!0;const a=await j();a&&a.state==="running"&&L()},{immediate:!0}),H(y),(a,s)=>{var I,N,T;const A=W("RouterLink");return n(),r("div",null,[e("div",ue,[e("div",null,[e("h1",null,[V(A,{to:"/jobs",class:"mute"},{default:G(()=>[...s[1]||(s[1]=[d("Jobs",-1)])]),_:1}),s[2]||(s[2]=e("span",{class:"mute"}," / ",-1)),d(u(t.value?p(Q)(t.value.action):"…"),1)]),e("div",ie,[t.value?(n(),r(g,{key:0},[e("code",null,u(t.value.stack),1),d(" · started "+u(p(U)(t.value.startedAt))+" ",1),t.value.endedAt?(n(),r(g,{key:0},[d(" · took "+u(p(X)(t.value.startedAt,t.value.endedAt)),1)],64)):c("",!0)],64)):(n(),r(g,{key:1},[d(u(o.jobId),1)],64))])]),t.value?(n(),B(Y,{key:0,state:t.value.state},null,8,["state"])):c("",!0)]),v.value?(n(),B(Z,{key:0,text:v.value},null,8,["text"])):c("",!0),C.value.length?(n(),r("section",de,[s[3]||(s[3]=e("strong",null,"Leaked:",-1)),d(" "+u(C.value.join(", "))+" ",1),s[4]||(s[4]=e("div",{class:"mute"},[d(" These axes' "),e("code",null,"assert_gone"),d(" failed, so the resources are still present. They will not be retried — tear them down by hand, then re-run "),e("code",null,"verify"),d(". ")],-1))])):c("",!0),(I=t.value)!=null&&I.error?(n(),r("section",ce,[s[5]||(s[5]=e("strong",{class:"bad"},"The job crashed",-1)),e("pre",pe,u(t.value.error),1)])):c("",!0),e("section",ve,[e("div",me,[s[7]||(s[7]=e("h2",{class:"phead-title"},"Log",-1)),e("div",fe,[h.value?(n(),r("span",ke,"streaming…")):c("",!0),e("label",be,[K(e("input",{"onUpdate:modelValue":s[0]||(s[0]=b=>x.value=b),type:"checkbox"},null,512),[[O,x.value]]),s[6]||(s[6]=e("span",{class:"mute"},"Follow",-1))]),!h.value&&((N=t.value)==null?void 0:N.state)==="running"?(n(),r("button",{key:1,class:"btn",onClick:L}," Reconnect ")):c("",!0)])]),e("div",{ref_key:"logEl",ref:$,class:"logbox",role:"log","aria-live":"polite"},[w.value?(n(),r("div",ge,"Loading…")):l.value.length?c("",!0):(n(),r("div",he,"No output.")),(n(!0),r(g,null,z(l.value,b=>(n(),r("div",{key:b.seq,class:_(["logline",b.level])},[e("span",ye,u(p(U)(b.at)),1),d(" "+u(b.message),1)],2))),128))],512)]),(T=t.value)!=null&&T.outcome?(n(),r("section",_e,[e("div",we,[s[10]||(s[10]=e("h2",{class:"phead-title"},"Steps",-1)),S.value?(n(),r("span",xe,[d(u(S.value)+" unverifiable — no ",1),s[8]||(s[8]=e("code",null,"assert_gone",-1)),s[9]||(s[9]=d(", so nothing was checked ",-1))])):c("",!0)]),V(re,{steps:t.value.outcome.steps},null,8,["steps"])])):c("",!0)])}}});export{Le as default};
2
- //# sourceMappingURL=JobDetailView-ow1_d8lc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JobDetailView-ow1_d8lc.js","sources":["../../src/composables/useSteps.ts","../../src/components/StepList.vue","../../src/views/JobDetailView.vue"],"sourcesContent":["/**\n * Step classification — the single most important logic in this app.\n *\n * A job's outcome has four states that MUST NOT blur into one another. The whole product is the\n * distinction between the middle two:\n *\n * ok passed. A `down` step is ALWAYS ok and may still carry a \"non-fatal:\" note —\n * teardown is best-effort by design, so the step really did pass.\n * unverifiable the axis defines no `assert_gone`, so `verify` had nothing to check. NOT a pass.\n * A green here would be exactly the false confidence this tool exists to remove.\n * leaked `assert_gone` FAILED — the resource survived teardown. Nothing else will clean\n * it up. This is the signal the whole tool exists for, and the CLI's exit code 2.\n * failed any other non-zero step.\n *\n * Order matters: `unverifiable` is matched on the message FIRST, exactly as the CLI's own report\n * does. `skipped` alone is not enough — a dry run also skips.\n */\n\nimport type { StepResult } from '../api/types';\n\nexport type StepState = 'ok' | 'unverifiable' | 'leaked' | 'failed';\n\nexport function stepState(s: StepResult): StepState {\n if (s.message?.startsWith('unverifiable')) return 'unverifiable';\n if (!s.ok) return s.phase === 'assert_gone' ? 'leaked' : 'failed';\n return 'ok';\n}\n\nexport function stepMark(s: StepResult): string {\n return { ok: '✓', unverifiable: '?', leaked: '!', failed: '✗' }[stepState(s)];\n}\n\nexport function stepText(s: StepResult): string {\n if (s.message) return s.message;\n if (s.skipped) return 'skipped';\n return stepState(s) === 'ok' ? 'ok' : `exit ${s.code}`;\n}\n\n/** Only a failed `assert_gone` is a leak. Every other non-zero step is a plain failure. */\nexport function leakedAxes(steps: StepResult[]): string[] {\n return steps.filter((s) => s.phase === 'assert_gone' && !s.ok).map((s) => s.axis);\n}\n\nexport function countUnverifiable(steps: StepResult[]): number {\n return steps.filter((s) => stepState(s) === 'unverifiable').length;\n}\n","<script setup lang=\"ts\">\n/**\n * A job's step results.\n *\n * The legend is part of the component because the four states only mean anything together:\n * `unverifiable` is not a pass, and `leaked` is not the same problem as `failed`.\n */\nimport type { StepResult } from '../api/types';\nimport { stepMark, stepState, stepText } from '../composables/useSteps';\n\ndefineProps<{ steps: StepResult[] }>();\n</script>\n\n<template>\n <div>\n <ul class=\"steps stagger\">\n <li\n v-for=\"(s, i) in steps\"\n :key=\"`${s.phase}-${s.axis}-${i}`\"\n class=\"step\"\n :style=\"{ '--i': i }\"\n >\n <span class=\"mark\" :class=\"`s-${stepState(s)}`\" aria-hidden=\"true\">{{ stepMark(s) }}</span>\n <span>\n <span class=\"who\">{{ s.axis }}</span>\n <span class=\"dim\" style=\"font-size: var(--t-sm)\"> · {{ s.phase }}</span>\n <span class=\"badge\" :class=\"stepState(s)\" style=\"margin-left: var(--s2)\">\n {{ stepState(s) }}\n </span>\n <div class=\"msg\" :class=\"`s-${stepState(s)}`\">{{ stepText(s) }}</div>\n </span>\n </li>\n </ul>\n\n <p class=\"hint\">\n <span class=\"s-ok\">✓ ok</span> ·\n <span class=\"s-failed\">✗ failed</span> ·\n <span class=\"s-leaked\">! leaked — survived teardown</span> ·\n <span class=\"s-unverifiable\">? unverifiable — nothing to check, not a pass</span>.\n A <code>down</code> step marked ok may still carry a <code>non-fatal:</code> note: teardown is\n best-effort by design, so aborting halfway would leave more behind than continuing.\n </p>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * One job: its live log while it runs, then the step table that says what actually happened.\n *\n * The log streams over `EventSource`. The server replays the whole buffered history first and then\n * sends live events, so attaching late still shows the beginning — no polling, no gap to reconcile.\n * A final `{done:true,state}` ends the stream; we close the source then and fetch the job once more\n * to pick up `outcome`, which only exists after the job finishes.\n */\nimport { computed, onBeforeUnmount, ref, watch } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { Job, LogEvent } from '../api/types';\nimport { leakedAxes, countUnverifiable } from '../composables/useSteps';\nimport { actionLabel, stamp, took } from '../composables/useFormat';\nimport StepList from '../components/StepList.vue';\nimport StateBadge from '../components/StateBadge.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\n\nconst props = defineProps<{ jobId: string }>();\n\nconst job = ref<Job | null>(null);\nconst lines = ref<LogEvent[]>([]);\nconst error = ref('');\nconst loading = ref(true);\nconst streaming = ref(false);\nconst follow = ref(true);\nconst logEl = ref<HTMLElement | null>(null);\n\nlet source: EventSource | null = null;\n\nconst leaks = computed(() => (job.value?.outcome ? leakedAxes(job.value.outcome.steps) : []));\nconst unverifiable = computed(() =>\n job.value?.outcome ? countUnverifiable(job.value.outcome.steps) : 0,\n);\n\n/** Returns the job it loaded, so callers need not re-read the ref — see the note at the watcher. */\nasync function load(): Promise<Job | null> {\n const r = await api.get<{ job: Job }>(`/api/jobs/${encodeURIComponent(props.jobId)}`);\n loading.value = false;\n if (!r.ok) {\n error.value = problem(r, 'load job');\n return null;\n }\n error.value = '';\n job.value = r.body.job;\n // The job carries its buffered log too. Seed from it so a finished job renders instantly without\n // opening a stream that would only replay and close.\n if (r.body.job.log?.length && lines.value.length === 0) lines.value = [...r.body.job.log];\n return r.body.job;\n}\n\nfunction closeStream(): void {\n source?.close();\n source = null;\n streaming.value = false;\n}\n\nfunction stream(): void {\n closeStream();\n // No auth header: EventSource cannot send one. Reads are unauthenticated by design, which is\n // exactly why the log is a GET.\n source = new EventSource(api.url(`/api/jobs/${encodeURIComponent(props.jobId)}/stream`));\n streaming.value = true;\n\n source.onmessage = (ev) => {\n let payload: unknown;\n try {\n payload = JSON.parse(ev.data as string);\n } catch {\n return; // a frame we cannot parse is not worth tearing the stream down for\n }\n const done = payload as { done?: boolean };\n if (done.done) {\n closeStream();\n void load(); // `outcome` only exists once the job has ended\n return;\n }\n lines.value.push(payload as LogEvent);\n if (follow.value) queueMicrotask(scrollToEnd);\n };\n\n // An error here is usually the job having ended between the fetch and the connect, or the API\n // becoming unreachable. Either way stop rather than let the browser reconnect forever.\n source.onerror = () => {\n closeStream();\n void load();\n };\n}\n\nfunction scrollToEnd(): void {\n const el = logEl.value;\n if (el) el.scrollTop = el.scrollHeight;\n}\n\nwatch(\n () => props.jobId,\n async () => {\n lines.value = [];\n job.value = null;\n loading.value = true;\n // Use what `load` returned rather than re-reading the ref: control-flow analysis still has\n // `job.value` narrowed to the `null` assigned above, because it cannot see that an awaited\n // call reassigned it.\n const loaded = await load();\n if (loaded && loaded.state === 'running') stream();\n },\n { immediate: true },\n);\n\nonBeforeUnmount(closeStream);\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>\n <RouterLink to=\"/jobs\" class=\"mute\">Jobs</RouterLink>\n <span class=\"mute\"> / </span>{{ job ? actionLabel(job.action) : '…' }}\n </h1>\n <div class=\"sub\">\n <template v-if=\"job\">\n <code>{{ job.stack }}</code> · started {{ stamp(job.startedAt) }}\n <template v-if=\"job.endedAt\"> · took {{ took(job.startedAt, job.endedAt) }}</template>\n </template>\n <template v-else>{{ jobId }}</template>\n </div>\n </div>\n <StateBadge v-if=\"job\" :state=\"job.state\" />\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" />\n\n <!--\n Leaked is called out above everything else. It means a resource survived teardown and nothing\n else is going to clean it up — the one outcome that needs a human.\n -->\n <section v-if=\"leaks.length\" class=\"panel leaked-banner\">\n <strong>Leaked:</strong> {{ leaks.join(', ') }}\n <div class=\"mute\">\n These axes' <code>assert_gone</code> failed, so the resources are still present. They will\n not be retried — tear them down by hand, then re-run <code>verify</code>.\n </div>\n </section>\n\n <section v-if=\"job?.error\" class=\"panel\">\n <strong class=\"bad\">The job crashed</strong>\n <pre class=\"pre\">{{ job.error }}</pre>\n </section>\n\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"phead-title\">Log</h2>\n <div class=\"row\" style=\"gap: 8px\">\n <span v-if=\"streaming\" class=\"mute pulse\">streaming…</span>\n <label class=\"row\" style=\"gap: 6px\">\n <input v-model=\"follow\" type=\"checkbox\" />\n <span class=\"mute\">Follow</span>\n </label>\n <button\n v-if=\"!streaming && job?.state === 'running'\"\n class=\"btn\"\n @click=\"stream\"\n >\n Reconnect\n </button>\n </div>\n </div>\n\n <div ref=\"logEl\" class=\"logbox\" role=\"log\" aria-live=\"polite\">\n <div v-if=\"loading\" class=\"mute\">Loading…</div>\n <div v-else-if=\"!lines.length\" class=\"mute\">No output.</div>\n <div v-for=\"l in lines\" :key=\"l.seq\" class=\"logline\" :class=\"l.level\">\n <span class=\"mute\">{{ stamp(l.at) }}</span> {{ l.message }}\n </div>\n </div>\n </section>\n\n <section v-if=\"job?.outcome\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"phead-title\">Steps</h2>\n <span v-if=\"unverifiable\" class=\"mute\">\n {{ unverifiable }} unverifiable — no <code>assert_gone</code>, so nothing was checked\n </span>\n </div>\n <StepList :steps=\"job.outcome.steps\" />\n </section>\n </div>\n</template>\n"],"names":["stepState","s","_a","stepMark","stepText","leakedAxes","steps","countUnverifiable","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_Fragment","_renderList","__props","i","_normalizeClass","_unref","_toDisplayString","_hoisted_2","_hoisted_3","props","job","ref","lines","error","loading","streaming","follow","logEl","source","leaks","computed","unverifiable","load","r","api","problem","closeStream","stream","ev","payload","scrollToEnd","el","watch","loaded","onBeforeUnmount","_createVNode","_component_RouterLink","_cache","_createTextVNode","actionLabel","stamp","_createBlock","StateBadge","ErrorNote","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","$event","_b","_hoisted_11","_hoisted_12","l","_hoisted_13","_c","_hoisted_14","_hoisted_15","_hoisted_16","StepList"],"mappings":"4aAsBO,SAASA,EAAUC,EAA0B,OAClD,OAAIC,EAAAD,EAAE,UAAF,MAAAC,EAAW,WAAW,gBAAwB,eAC7CD,EAAE,GACA,KADWA,EAAE,QAAU,cAAgB,SAAW,QAE3D,CAEO,SAASE,GAASF,EAAuB,CAC9C,MAAO,CAAE,GAAI,IAAK,aAAc,IAAK,OAAQ,IAAK,OAAQ,GAAA,EAAMD,EAAUC,CAAC,CAAC,CAC9E,CAEO,SAASG,GAASH,EAAuB,CAC9C,OAAIA,EAAE,QAA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AA,iBAAO,4BAC/D,EAAA,EAAA,eAEFsC,EAAuC0B,GAAA,CAA5B,MAAOnD,EAAA,MAAI,QAAQ,KAAA"}
@@ -1,2 +0,0 @@
1
- import{d as k,c as l,a as t,i as y,v as g,e as n,u as o,y as r,t as i,x as w,F as m,s as x,f as p,g as C,r as f,C as V,o as a,D as L,w as b,j as N}from"./index-D8OAewba.js";import{a as $,t as A}from"./useFormat-CKJxQp_i.js";import{_ as R}from"./StateBadge.vue_vue_type_script_setup_true_lang-B5C48Wlo.js";import{_ as B}from"./SkeletonList.vue_vue_type_script_setup_true_lang-CIiWzcE5.js";import{_ as F}from"./RelativeTime.vue_vue_type_script_setup_true_lang-mzHGsi43.js";import{_ as S}from"./SelectMenu.vue_vue_type_script_setup_true_lang-CLqZAezG.js";import"./Teleport-0BmaJsBF.js";const U={class:"panel"},j={class:"phead"},q={class:"field",style:{flex:"1","min-width":"180px"}},z={class:"field"},D={key:0,class:"s-failed"},E={key:2,class:"cards"},T={class:"stagger"},I={"data-label":"state"},J={"data-label":"action"},M={class:"name","data-label":"stack"},H={class:"dim nowrap","data-label":"started"},O={class:"dim nowrap","data-label":"took"},G={class:"dim","data-label":"steps"},K={key:0},P={colspan:"6",class:"mute"},at=k({__name:"JobsView",setup(Q){const c=f(""),d=f("all"),_=V(()=>{const u=c.value.trim().toLowerCase();return r.jobs.filter(e=>d.value!=="all"&&e.state!==d.value?!1:u?e.stack.toLowerCase().includes(u)||e.action.includes(u):!0)});return(u,e)=>{const h=N("RouterLink");return a(),l("div",null,[e[6]||(e[6]=t("div",{class:"page-head"},[t("div",null,[t("h1",null,"Jobs"),t("div",{class:"sub"},"Most recent first, capped at the last 50.")])],-1)),t("section",U,[t("div",j,[t("div",q,[e[2]||(e[2]=t("label",{for:"jq",class:"mute",style:{"font-size":"var(--t-xs)"}},"Search — press /",-1)),y(t("input",{id:"jq","onUpdate:modelValue":e[0]||(e[0]=s=>c.value=s),"data-search":"",type:"search",placeholder:"stack or action",spellcheck:"false"},null,512),[[g,c.value]])]),t("div",z,[e[3]||(e[3]=t("label",{for:"js",class:"mute",style:{"font-size":"var(--t-xs)"}},"State",-1)),n(S,{modelValue:d.value,"onUpdate:modelValue":e[1]||(e[1]=s=>d.value=s),id:"js",label:"Filter jobs",options:[{value:"all",label:"All"},{value:"running",label:"Running"},{value:"ok",label:"Ok"},{value:"leaked",label:"Leaked"},{value:"failed",label:"Failed"}]},null,8,["modelValue"])])]),e[5]||(e[5]=t("p",{class:"hint",style:{margin:"0 0 var(--s3)"}}," Held in memory. A server restart clears the history — a job record is the transcript of an attempt, not the truth about what exists. That truth lives in docker and in each axis's own probe. ",-1)),o(r).jobsError?(a(),l("p",D,i(o(r).jobsError),1)):o(r).jobsLoaded?(a(),l("table",E,[e[4]||(e[4]=t("thead",null,[t("tr",null,[t("th",null,"state"),t("th",null,"action"),t("th",null,"stack"),t("th",null,"started"),t("th",null,"took"),t("th",null,"steps")])],-1)),t("tbody",T,[(a(!0),l(m,null,x(_.value,(s,v)=>(a(),l("tr",{key:s.id,style:L({"--i":v})},[t("td",I,[n(h,{to:`/jobs/${encodeURIComponent(s.id)}`},{default:b(()=>[n(R,{state:s.state},null,8,["state"])]),_:2},1032,["to"])]),t("td",J,i(o($)(s.action)),1),t("td",M,[n(h,{to:`/jobs/${encodeURIComponent(s.id)}`},{default:b(()=>[p(i(s.stack),1)]),_:2},1032,["to"])]),t("td",H,[n(F,{at:s.startedAt},null,8,["at"])]),t("td",O,i(o(A)(s.startedAt,s.endedAt)),1),t("td",G,i(s.outcome?s.outcome.steps.length:"—"),1)],4))),128)),_.value.length?C("",!0):(a(),l("tr",K,[t("td",P,[o(r).jobs.length?(a(),l(m,{key:0},[p("Nothing matches this filter.")],64)):(a(),l(m,{key:1},[p("No jobs recorded.")],64))])]))])])):(a(),w(B,{key:1,rows:5}))])])}}});export{at as default};
2
- //# sourceMappingURL=JobsView-Boi9Cmdc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JobsView-Boi9Cmdc.js","sources":["../../src/views/JobsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/** Job history. Polled by the shell already, so this view only filters what is in memory. */\nimport { computed, ref } from 'vue';\nimport { state } from '../composables/useControlPlane';\nimport { actionLabel, took } from '../composables/useFormat';\nimport StateBadge from '../components/StateBadge.vue';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport RelativeTime from '../components/RelativeTime.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\nimport type { JobState } from '../api/types';\n\nconst q = ref('');\nconst only = ref<'all' | JobState>('all');\n\nconst rows = computed(() => {\n const needle = q.value.trim().toLowerCase();\n return state.jobs.filter((j) => {\n if (only.value !== 'all' && j.state !== only.value) return false;\n if (!needle) return true;\n return j.stack.toLowerCase().includes(needle) || j.action.includes(needle);\n });\n});\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Jobs</h1>\n <div class=\"sub\">Most recent first, capped at the last 50.</div>\n </div>\n </div>\n\n <section class=\"panel\">\n <div class=\"phead\">\n <div class=\"field\" style=\"flex: 1; min-width: 180px\">\n <label for=\"jq\" class=\"mute\" style=\"font-size: var(--t-xs)\">Search — press /</label>\n <input id=\"jq\" v-model=\"q\" data-search type=\"search\" placeholder=\"stack or action\" spellcheck=\"false\" />\n </div>\n <div class=\"field\">\n <label for=\"js\" class=\"mute\" style=\"font-size: var(--t-xs)\">State</label>\n <SelectMenu v-model=\"only\" id=\"js\" label=\"Filter jobs\" :options=\"[{ value: 'all', label: 'All' }, { value: 'running', label: 'Running' }, { value: 'ok', label: 'Ok' }, { value: 'leaked', label: 'Leaked' }, { value: 'failed', label: 'Failed' }]\" />\n </div>\n </div>\n\n <p class=\"hint\" style=\"margin: 0 0 var(--s3)\">\n Held in memory. A server restart clears the history — a job record is the transcript of an\n attempt, not the truth about what exists. That truth lives in docker and in each axis's own\n probe.\n </p>\n\n <p v-if=\"state.jobsError\" class=\"s-failed\">{{ state.jobsError }}</p>\n <SkeletonList v-else-if=\"!state.jobsLoaded\" :rows=\"5\" />\n\n <table v-else class=\"cards\">\n <thead>\n <tr>\n <th>state</th>\n <th>action</th>\n <th>stack</th>\n <th>started</th>\n <th>took</th>\n <th>steps</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(j, i) in rows\" :key=\"j.id\" :style=\"{ '--i': i }\">\n <td data-label=\"state\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">\n <StateBadge :state=\"j.state\" />\n </RouterLink>\n </td>\n <td data-label=\"action\">{{ actionLabel(j.action) }}</td>\n <td class=\"name\" data-label=\"stack\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">{{ j.stack }}</RouterLink>\n </td>\n <td class=\"dim nowrap\" data-label=\"started\"><RelativeTime :at=\"j.startedAt\" /></td>\n <td class=\"dim nowrap\" data-label=\"took\">{{ took(j.startedAt, j.endedAt) }}</td>\n <td class=\"dim\" data-label=\"steps\">{{ j.outcome ? j.outcome.steps.length : '—' }}</td>\n </tr>\n <tr v-if=\"!rows.length\">\n <td colspan=\"6\" class=\"mute\">\n <template v-if=\"state.jobs.length\">Nothing matches this filter.</template>\n <template v-else>No jobs recorded.</template>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n</template>\n"],"names":["q","ref","only","rows","computed","needle","state","j","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_hoisted_3","$event","_hoisted_4","_createVNode","SelectMenu","_unref","_openBlock","_hoisted_5","_toDisplayString","_hoisted_6","_hoisted_7","_Fragment","_renderList","i","_hoisted_8","_component_RouterLink","StateBadge","_hoisted_9","_hoisted_10","_createTextVNode","_hoisted_11","RelativeTime","_hoisted_12","took","_hoisted_13","_hoisted_14","_hoisted_15","_createBlock","SkeletonList"],"mappings":"giCAWA,MAAMA,EAAIC,EAAI,EAAE,EACVC,EAAOD,EAAsB,KAAK,EAElCE,EAAOC,EAAS,IAAM,CAC1B,MAAMC,EAASL,EAAE,MAAM,KAAA,EA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A,CAAA,CAAA,aAE/DJ,EAAA,MAAK,qBAAhBK,EAKK,KAAA6B,EAAA,CAJH5B,EAGK,KAHL6B,EAGK,CAFarB,EAAAX,CAAA,EAAM,KAAK,YAA3BE,EAA0Ee,EAAA,CAAA,IAAA,CAAA,EAAA,GAAvC,8BAA4B,CAAA,YAC/Df,EAA6Ce,EAAA,CAAA,IAAA,GAAA,GAA5B,mBAAiB,CAAA,sBA/B1CgB,EAAwDC,EAAA,OAAX,KAAM,CAAA"}
@@ -1,4 +0,0 @@
1
- import{d as F,H as L,c as a,a as l,e as g,g as d,u as w,f as u,t as m,F as T,i as z,v as A,w as B,_ as R,r as v,C as k,A as x,J as _,B as I,o}from"./index-D8OAewba.js";import{d as r}from"./useDeployment-DplTFu7s.js";import{_ as C}from"./SelectMenu.vue_vue_type_script_setup_true_lang-CLqZAezG.js";import"./useVars-VN9gYdR6.js";import"./Teleport-0BmaJsBF.js";const M={class:"panel"},j={class:"phead"},D={key:0,class:"field"},E={class:"field"},H=["disabled"],O={key:0,class:"progress","aria-hidden":"true"},q={key:0,class:"mute"},J={key:1,class:"mute"},P={key:0,class:"banner failed"},G={key:1,class:"banner warn"},K={key:2,class:"field",style:{"margin-top":"var(--s3)"}},Q={key:3,class:"hint",style:{"margin-top":"var(--s3)"}},W={key:4,class:"log"},X={key:5,class:"mute",style:{"margin-top":"var(--s3)"}},Y={key:6,class:"hint"},oe=F({__name:"LogsTab",setup(Z){const y=v(200),p=v(""),f=v([]);async function V(){const s=await x.get(`/api/deployments/${encodeURIComponent(r.id)}/runtime${_(r.vars)}`);s.ok&&(f.value=[...new Set(s.body.containers.map(e=>e.service).filter(e=>!!e))].sort())}const $=k(()=>[{value:"",label:"All services"},...f.value.map(s=>({value:s,label:s}))]),h=v(""),n=v(null),b=v(""),c=v(!1);L(()=>{var s;return[r.id,!!((s=r.detail)!=null&&s.compose)]},([s,e],t)=>{(!t||t[0]!==s)&&(f.value=[],p.value="",n.value=null),e&&f.value.length===0&&V()},{immediate:!0});async function N(){var i;if(!((i=r.detail)!=null&&i.compose))return;const s=r.id;c.value=!0,b.value="";const e=p.value,t=await x.get(`/api/deployments/${encodeURIComponent(s)}/logs${_(r.vars,{tail:y.value,...e?{service:e}:{}})}`);if(c.value=!1,r.id===s&&!(t.ok&&(t.body.service??"")!==e)){if(!t.ok){n.value=null,b.value=I(t,"load the logs");return}n.value={...t.body,ok:t.body.ok!==!1,text:t.body.text??""}}}const S=k(()=>{var i;const s=((i=n.value)==null?void 0:i.text)??"",e=h.value.trim().toLowerCase();if(!e)return s;const t=s.split(`
2
- `).filter(U=>U.toLowerCase().includes(e));return t.length?t.join(`
3
- `):`(no line matches "${h.value}")`});return(s,e)=>{var t;return o(),a("section",M,[l("div",j,[e[5]||(e[5]=l("h2",{class:"section"},"Compose logs",-1)),e[6]||(e[6]=l("span",{class:"grow"},null,-1)),f.value.length>1?(o(),a("div",D,[e[3]||(e[3]=l("label",{for:"svc",class:"mute",style:{"font-size":"var(--t-xs)"}},"service",-1)),g(C,{modelValue:p.value,"onUpdate:modelValue":e[0]||(e[0]=i=>p.value=i),id:"svc",label:"Service",options:$.value},null,8,["modelValue","options"])])):d("",!0),l("div",E,[e[4]||(e[4]=l("label",{for:"tail",class:"mute",style:{"font-size":"var(--t-xs)"}},"tail",-1)),g(C,{"model-value":String(y.value),label:"How many lines",options:[{value:"50",label:"50"},{value:"200",label:"200"},{value:"500",label:"500"},{value:"1000",label:"1000"},{value:"2000",label:"2000"}],"onUpdate:modelValue":e[1]||(e[1]=i=>y.value=Number(i))},null,8,["model-value"])]),l("button",{class:"primary",style:{"align-self":"end"},disabled:c.value||!((t=w(r).detail)!=null&&t.compose),onClick:N},[u(m(c.value?"reading…":"Fetch")+" ",1),c.value?(o(),a("span",O)):d("",!0)],8,H)]),w(r).detail?w(r).detail.compose?(o(),a(T,{key:2},[e[16]||(e[16]=l("p",{class:"hint",style:{margin:"0 0 var(--s3)"}}," Fetched on demand, never polled: an auto-refresh against a chatty stack would hammer the host. The server caps how many lines it will return. ",-1)),b.value?(o(),a("div",P,m(b.value),1)):n.value&&!n.value.ok?(o(),a("div",G,[...e[8]||(e[8]=[l("b",null,"compose exited non-zero.",-1),l("p",null," Most often the project does not exist yet (nothing has been brought up), or a profile is missing. Any output it did produce is below. ",-1)])])):d("",!0),n.value?(o(),a("div",K,[e[9]||(e[9]=l("label",{for:"lf",class:"mute",style:{"font-size":"var(--t-xs)"}},"Search in these lines",-1)),z(l("input",{id:"lf","onUpdate:modelValue":e[2]||(e[2]=i=>h.value=i),"data-search":"",type:"search",placeholder:"substring",spellcheck:"false"},null,512),[[A,h.value]])])):d("",!0),n.value&&n.value.service?(o(),a("div",Q,[e[11]||(e[11]=u(" Showing ",-1)),l("b",null,m(n.value.service),1),e[12]||(e[12]=u(" only. ",-1)),g(R,{label:"why narrowing helps"},{default:B(()=>[...e[10]||(e[10]=[u(" On a stack with a chatty sidecar the interleaved output is unreadable, and the lines you want are often already past the tail. Narrowing spends the whole tail on one service. ",-1)])]),_:1})])):d("",!0),n.value?(o(),a("pre",W,m(S.value||"(no output)"),1)):c.value?d("",!0):(o(),a("p",X,[e[13]||(e[13]=u(" Press ",-1)),e[14]||(e[14]=l("b",null,"Fetch",-1)),u(" to read the last "+m(y.value)+" lines"+m(p.value?` of ${p.value}`:"")+". ",1)])),n.value?(o(),a("p",Y,[...e[15]||(e[15]=[u(" Redacted on the host before sending: credentials inside URLs, ",-1),l("code",null,"NAME=value",-1),u(" pairs whose name reads as a secret, and this server's own token. ",-1)])])):d("",!0)],64)):(o(),a("p",J,[...e[7]||(e[7]=[u(" This spec has no ",-1),l("code",null,"compose:",-1),u(" section, so there are no compose logs to read. Its axes may still have created resources — check those at their own source. ",-1)])])):(o(),a("p",q,"Unavailable until the spec resolves."))])}}});export{oe as default};
4
- //# sourceMappingURL=LogsTab-Bgev0F7g.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LogsTab-Bgev0F7g.js","sources":["../../src/views/tabs/LogsTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Compose logs, fetched ON DEMAND.\n *\n * Never polled: an auto-refresh against a chatty stack would hammer the host through\n * `docker compose logs` — the same host that is running everyone else's previews. The tail is\n * clamped to 1–2000 by the server for the same reason.\n */\nimport { computed, ref, watch } from 'vue';\nimport { api, problem, query } from '../../api/client';\nimport type { LogsResponse, RuntimeResponse } from '../../api/types';\nimport { dep } from '../../composables/useDeployment';\nimport InfoHint from '../../components/InfoHint.vue';\nimport SelectMenu from '../../components/SelectMenu.vue';\n\nconst tail = ref(200);\n/** '' means the whole stack. */\nconst service = ref('');\n/**\n * The services to choose from, taken from what is actually RUNNING rather than from the compose file.\n * A service the spec declares but never started has no logs, and offering it would produce an\n * empty pane that reads like a bug.\n */\nconst services = ref<string[]>([]);\n\nasync function loadServices(): Promise<void> {\n const r = await api.get<RuntimeResponse>(\n `/api/deployments/${encodeURIComponent(dep.id)}/runtime${query(dep.vars)}`,\n );\n if (!r.ok) return; // the picker is a convenience; without it the whole-stack read still works\n services.value = [\n ...new Set(r.body.containers.map((c) => c.service).filter((s): s is string => !!s)),\n ].sort();\n}\n\n/** Empty value = the whole stack, which is a real choice here rather than a placeholder. */\nconst serviceOptions = computed(() => [\n { value: '', label: 'All services' },\n ...services.value.map((s) => ({ value: s, label: s })),\n]);\n\nconst filter = ref('');\nconst logs = ref<LogsResponse | null>(null);\nconst error = ref('');\nconst loading = ref(false);\n\nwatch(\n () => [dep.id, !!dep.detail?.compose] as const,\n ([id, hasCompose], prev) => {\n if (!prev || prev[0] !== id) {\n services.value = [];\n service.value = '';\n logs.value = null;\n }\n // Gated on the RESOLVED spec, not just the id: this component mounts before the parent has\n // resolved the deployment, so an id-only watcher saw `dep.detail === undefined` and the service\n // picker never appeared.\n if (hasCompose && services.value.length === 0) void loadServices();\n },\n { immediate: true },\n);\n\nasync function fetchLogs(): Promise<void> {\n if (!dep.detail?.compose) return;\n const id = dep.id;\n loading.value = true;\n error.value = '';\n const chosen = service.value;\n const r = await api.get<LogsResponse>(\n `/api/deployments/${encodeURIComponent(id)}/logs${query(dep.vars, {\n tail: tail.value,\n ...(chosen ? { service: chosen } : {}),\n })}`,\n );\n loading.value = false;\n if (dep.id !== id) return; // navigated away mid-flight\n // A slow response for the previously-selected service must not land in a pane now labelled with a\n // different one.\n if (r.ok && (r.body.service ?? '') !== chosen) return;\n if (!r.ok) {\n logs.value = null;\n error.value = problem(r, 'load the logs');\n return;\n }\n logs.value = { ...r.body, ok: r.body.ok !== false, text: r.body.text ?? '' };\n}\n\n/** Search-in-logs: filter to matching lines rather than highlighting inside a wall of text. */\nconst shown = computed(() => {\n const text = logs.value?.text ?? '';\n const needle = filter.value.trim().toLowerCase();\n if (!needle) return text;\n const lines = text.split('\\n').filter((l) => l.toLowerCase().includes(needle));\n return lines.length ? lines.join('\\n') : `(no line matches \"${filter.value}\")`;\n});\n</script>\n\n<template>\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Compose logs</h2>\n <span class=\"grow\" />\n <div v-if=\"services.length > 1\" class=\"field\">\n <label for=\"svc\" class=\"mute\" style=\"font-size: var(--t-xs)\">service</label>\n <SelectMenu v-model=\"service\" id=\"svc\" label=\"Service\" :options=\"serviceOptions\" />\n </div>\n <div class=\"field\">\n <label for=\"tail\" class=\"mute\" style=\"font-size: var(--t-xs)\">tail</label>\n <SelectMenu :model-value=\"String(tail)\" label=\"How many lines\" :options=\"[{ value: '50', label: '50' }, { value: '200', label: '200' }, { value: '500', label: '500' }, { value: '1000', label: '1000' }, { value: '2000', label: '2000' }]\" @update:model-value=\"(v) => (tail = Number(v))\" />\n </div>\n <button\n class=\"primary\"\n style=\"align-self: end\"\n :disabled=\"loading || !dep.detail?.compose\"\n @click=\"fetchLogs\"\n >\n {{ loading ? 'reading…' : 'Fetch' }}\n <span v-if=\"loading\" class=\"progress\" aria-hidden=\"true\" />\n </button>\n </div>\n\n <p v-if=\"!dep.detail\" class=\"mute\">Unavailable until the spec resolves.</p>\n <!-- Guard on the field rather than calling and interpreting the failure after the fact. -->\n <p v-else-if=\"!dep.detail.compose\" class=\"mute\">\n This spec has no <code>compose:</code> section, so there are no compose logs to read. Its axes\n may still have created resources — check those at their own source.\n </p>\n\n <template v-else>\n <p class=\"hint\" style=\"margin: 0 0 var(--s3)\">\n Fetched on demand, never polled: an auto-refresh against a chatty stack would hammer the\n host. The server caps how many lines it will return.\n </p>\n\n <div v-if=\"error\" class=\"banner failed\">{{ error }}</div>\n\n <!--\n `ok: false` means compose exited non-zero. Usually \"no such project\" because the stack was\n never brought up — not a server fault, so it is a note rather than an error.\n -->\n <div v-else-if=\"logs && !logs.ok\" class=\"banner warn\">\n <b>compose exited non-zero.</b>\n <p>\n Most often the project does not exist yet (nothing has been brought up), or a profile is\n missing. Any output it did produce is below.\n </p>\n </div>\n\n <div v-if=\"logs\" class=\"field\" style=\"margin-top: var(--s3)\">\n <label for=\"lf\" class=\"mute\" style=\"font-size: var(--t-xs)\">Search in these lines</label>\n <input id=\"lf\" v-model=\"filter\" data-search type=\"search\" placeholder=\"substring\" spellcheck=\"false\" />\n </div>\n\n <div v-if=\"logs && logs.service\" class=\"hint\" style=\"margin-top: var(--s3)\">\n Showing <b>{{ logs.service }}</b> only.\n <InfoHint label=\"why narrowing helps\">\n On a stack with a chatty sidecar the interleaved output is unreadable, and the lines you want\n are often already past the tail. Narrowing spends the whole tail on one service.\n </InfoHint>\n </div>\n\n <pre v-if=\"logs\" class=\"log\">{{ shown || '(no output)' }}</pre>\n <p v-else-if=\"!loading\" class=\"mute\" style=\"margin-top: var(--s3)\">\n Press <b>Fetch</b> to read the last {{ tail }} lines{{ service ? ` of ${service}` : '' }}.\n </p>\n\n <p v-if=\"logs\" class=\"hint\">\n Redacted on the host before sending: credentials inside URLs, <code>NAME=value</code> pairs\n whose name reads as a secret, and this server's own token.\n </p>\n </template>\n </section>\n</template>\n"],"names":["tail","ref","service","services","loadServices","r","api","dep","query","c","s","serviceOptions","computed","filter","logs","error","loading","watch","_a","id","hasCompose","prev","fetchLogs","chosen","problem","shown","text","needle","lines","l","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_cache","_hoisted_3","_createVNode","SelectMenu","$event","_hoisted_4","v","_unref","_createTextVNode","_toDisplayString","_hoisted_6","_Fragment","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","InfoHint","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_8","_hoisted_7"],"mappings":"21BAeA,MAAMA,EAAOC,EAAI,GAAG,EAEdC,EAAUD,EAAI,EAAE,EAMhBE,EAAWF,EAAc,EAAE,EAEjC,eAAeG,GAA8B,CAC3C,MAAMC,EAAI,MAAMC,EAAI,IAClB,oBAAoB,mBAAmBC,EAAI,EAAE,CAAC,WAAWC,EAAMD,EAAI,IAAI,CAAC,EAAA,EAErEF,EAAE,KACPF,EAAS,MAAQ,CACf,GAAG,IAAI,IAAIE,EAAE,KAAK,WAAW,IAAKI,GAAMA,EAAE,OAAO,EAAE,OAAQC,GAAmB,CAAC,CAACA,CAAC,CAAC,CAAA,EAClF,KAAA,EACJ,CAGA,MAAMC,EAAiBC,EAAS,IAAM,CACpC,CAAE,MAAO,GAAI,MAAO,cAAA,EACpB,GAAGT,EAAS,MAAM,IAAK,IAAO,CAAE,MAAO,EAAG,MAAO,GAAI,CAAA,CACtD,EAEKU,EAASZ,EAAI,EAAE,EACfa,EAAOb,EAAyB,IAAI,EACpCc,EAAQd,EAAI,EAAE,EACde,EAAUf,EAAI,EAAK,EAEzBgB,EACE,IAAA,OAAM,OAACV,EAAI,GAAI,CAAC,GAACW,EAAAX,EAAI,SAAJ,MAAAW,EAAY,QAAO,GACpC,CAAC,CAACC,EAAIC,CAAU,EAAGC,IAAS,EACtB,CAACA,GAAQA,EAAK,CAAC,IAAMF,KACvBhB,EAAS,MAAQ,CAAA,EACjBD,EAAQ,MAAQ,GAChBY,EAAK,MAAQ,MAKXM,GAAcjB,EAAS,MAAM,SAAW,GAAQC,EAAA,CACtD,E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,CAAA,IAESY,EAAA,OAATgB,IAAAC,EAGI,IAHJuB,EAGI,CAAA,GAAAnB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAHwB,kEACoC,EAAA,EAAAF,EAAuB,YAAjB,aAAU,EAAA,IAAO,qEAEvF,EAAA,CAAA,sBA9CFH,IAAAC,EAGI,IAHJwB,EAGI,CAAA,GAAApB,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAH4C,qBAC7B,EAAA,EAAAF,EAAqB,YAAf,WAAQ,EAAA,IAAO,gIAExC,EAAA,CAAA,WALAF,EAA2E,IAA3EyB,EAAmC,sCAAoC"}
@@ -1,2 +0,0 @@
1
- import{d as o,r as _,i as x}from"./useDeployment-DplTFu7s.js";import{s as h}from"./useFormat-CKJxQp_i.js";import{_ as C}from"./SkeletonList.vue_vue_type_script_setup_true_lang-CIiWzcE5.js";import{d as T,c as a,a as e,u as t,x as m,w as p,g as r,f as l,e as b,_ as g,t as i,E as A,F as u,s as k,C as N,j as R,o as n}from"./index-D8OAewba.js";import"./useVars-VN9gYdR6.js";const $={class:"panel"},B={class:"phead"},z={key:1,class:"mute"},L={key:1,class:"mute"},S={key:2,class:"kvlist"},U={class:"k"},V={class:"v mono"},E={class:"v"},I={class:"mute",style:{"margin-left":"8px","font-size":"var(--t-sm)"}},j={key:0},q={class:"v"},D={class:"v mono"},F={key:1},H={class:"v"},P={key:0,class:"mute"},K={key:2},O={class:"k"},G={class:"v"},J={class:"mono"},M={class:"mute",style:{"font-size":"var(--t-sm)"}},Q={key:3},W={class:"v"},X={key:0,class:"mute"},Y={class:"v"},Z={class:"v"},ss={class:"v"},es={class:"v"},rs=T({__name:"OverviewTab",setup(ts){const w=N(()=>x.value?"a host singleton previews borrow — no axes, and down is guarded":"one tenant, created and destroyed constantly, expected to leave nothing behind");return(os,s)=>{var y,v,f;const c=R("RouterLink");return n(),a("section",$,[e("div",B,[s[2]||(s[2]=e("h2",{class:"section"},"Resolved spec",-1)),s[3]||(s[3]=e("span",{class:"grow"},null,-1)),t(o).detail?(n(),m(c,{key:0,to:`/submit?from=${encodeURIComponent(t(o).id)}`},{default:p(()=>[...s[0]||(s[0]=[l(" Duplicate ",-1)])]),_:1},8,["to"])):r("",!0),t(o).detail?(n(),a("span",z,"·")):r("",!0),t(o).detail?(n(),m(c,{key:2,to:`/submit/${encodeURIComponent(t(o).id)}`},{default:p(()=>[...s[1]||(s[1]=[l(" Edit spec & compose → ",-1)])]),_:1},8,["to"])):r("",!0)]),!t(o).detail&&!t(o).error?(n(),m(C,{key:0,rows:5})):t(o).detail?(n(),a("ul",S,[e("li",null,[e("span",U,[s[5]||(s[5]=l(" stack ",-1)),b(g,{label:"the difference between id and stack"},{default:p(()=>[...s[4]||(s[4]=[l(" The ",-1),e("b",null,"id",-1),l(" is what you named this deployment. The ",-1),e("b",null,"stack",-1),l(" is what its spec resolved to once the variables were filled in — the compose project name, the hostname label, and ",-1),e("code",null,"$STACK",-1),l(" inside every hook. ",-1)])]),_:1})]),e("span",V,i(t(o).detail.stack||"—"),1)]),e("li",null,[s[6]||(s[6]=e("span",{class:"k"},"kind",-1)),e("span",E,[e("span",{class:A(["badge",t(o).detail.kind])},i(t(o).detail.kind),3),e("span",I,i(w.value),1)])]),(y=t(_))!=null&&y.specName?(n(),a("li",j,[s[8]||(s[8]=e("span",{class:"k"},"spec",-1)),e("span",q,[e("b",null,i(t(_).specName),1),s[7]||(s[7]=e("span",{class:"mute",style:{"font-size":"var(--t-sm)"}}," — stored, and shared with any other deployment using it ",-1))])])):r("",!0),e("li",null,[s[9]||(s[9]=e("span",{class:"k"},"compose file",-1)),e("span",D,i(t(o).detail.compose?t(o).detail.compose.file:"— (no compose section)"),1)]),t(o).detail.compose?(n(),a("li",F,[s[10]||(s[10]=e("span",{class:"k"},"profiles",-1)),e("span",H,[(n(!0),a(u,null,k(t(o).detail.compose.profiles,d=>(n(),a("span",{key:d,class:"badge",style:{"margin-right":"4px"}},i(d),1))),128)),t(o).detail.compose.profiles.length?r("",!0):(n(),a("span",P," none — a bare up starts every service "))])])):r("",!0),(f=(v=t(o).detail.compose)==null?void 0:v.subdomains)!=null&&f.length?(n(),a("li",K,[e("span",O,[s[15]||(s[15]=l(" subdomains ",-1)),b(g,{label:"how wildcard subdomains work"},{default:p(()=>[s[14]||(s[14]=l(" Anything one label under these hosts reaches the same service the bare host does. An exact hostname you route yourself always wins over the wildcard. ",-1)),t(o).detail.compose.subdomains.some(d=>d.depth==="any")?(n(),a(u,{key:0},[s[11]||(s[11]=l(" A route marked ",-1)),s[12]||(s[12]=e("b",null,"any depth",-1)),s[13]||(s[13]=l(" works over HTTP only — no TLS certificate can cover more than one label. ",-1))],64)):r("",!0)]),_:1})]),e("span",G,[(n(!0),a(u,null,k(t(o).detail.compose.subdomains,d=>(n(),a("div",{key:d.profile},[e("span",J,"*."+i(d.host),1),e("span",M,[l(" → "+i(d.profile),1),d.depth==="any"?(n(),a(u,{key:0},[l(" · any depth, HTTP only")],64)):r("",!0)])]))),128))])])):r("",!0),t(o).detail.compose?(n(),a("li",Q,[s[16]||(s[16]=e("span",{class:"k"},"overlays",-1)),e("span",W,[(n(!0),a(u,null,k(t(o).detail.compose.overlays,d=>(n(),a("span",{key:d,class:"mono",style:{"margin-right":"8px"}},i(d),1))),128)),t(o).detail.compose.overlays.length?r("",!0):(n(),a("span",X,"none"))])])):r("",!0),e("li",null,[s[18]||(s[18]=e("span",{class:"k"},"axes",-1)),e("span",Y,[l(i(t(o).detail.axes.length)+" ",1),t(o).detail.axes.length?(n(),m(c,{key:0,to:`/deployments/${encodeURIComponent(t(o).id)}/axes`},{default:p(()=>[...s[17]||(s[17]=[l(" view → ",-1)])]),_:1},8,["to"])):r("",!0)])]),e("li",null,[s[19]||(s[19]=e("span",{class:"k"},"requires",-1)),e("span",Z,i(t(o).detail.requires.length),1)]),e("li",null,[s[20]||(s[20]=e("span",{class:"k"},"created",-1)),e("span",ss,i(t(h)(t(o).detail.createdAt)),1)]),e("li",null,[s[21]||(s[21]=e("span",{class:"k"},"updated",-1)),e("span",es,i(t(h)(t(o).detail.updatedAt)),1)])])):(n(),a("p",L,"Unavailable until the spec resolves."))])}}});export{rs as default};
2
- //# sourceMappingURL=OverviewTab-DzZG0moV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OverviewTab-DzZG0moV.js","sources":["../../src/views/tabs/OverviewTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/** The resolved spec, summarised. Read-only — everything that acts lives on Danger. */\nimport { computed } from 'vue';\nimport { dep, isShared, row } from '../../composables/useDeployment';\nimport { stamp } from '../../composables/useFormat';\nimport SkeletonList from '../../components/SkeletonList.vue';\nimport InfoHint from '../../components/InfoHint.vue';\n\nconst kindBlurb = computed(() =>\n isShared.value\n ? 'a host singleton previews borrow — no axes, and down is guarded'\n : 'one tenant, created and destroyed constantly, expected to leave nothing behind',\n);\n</script>\n\n<template>\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Resolved spec</h2>\n <span class=\"grow\" />\n <RouterLink v-if=\"dep.detail\" :to=\"`/submit?from=${encodeURIComponent(dep.id)}`\">\n Duplicate\n </RouterLink>\n <span v-if=\"dep.detail\" class=\"mute\">·</span>\n <RouterLink v-if=\"dep.detail\" :to=\"`/submit/${encodeURIComponent(dep.id)}`\">\n Edit spec &amp; compose →\n </RouterLink>\n </div>\n\n <SkeletonList v-if=\"!dep.detail && !dep.error\" :rows=\"5\" />\n <p v-else-if=\"!dep.detail\" class=\"mute\">Unavailable until the spec resolves.</p>\n\n <template v-else>\n <ul class=\"kvlist\">\n <li>\n <span class=\"k\">\n stack\n <InfoHint label=\"the difference between id and stack\">\n The <b>id</b> is what you named this deployment. The <b>stack</b> is what its spec\n resolved to once the variables were filled in — the compose project name, the hostname\n label, and <code>$STACK</code> inside every hook.\n </InfoHint>\n </span>\n <span class=\"v mono\">{{ dep.detail.stack || '—' }}</span>\n </li>\n <li>\n <span class=\"k\">kind</span>\n <span class=\"v\">\n <span class=\"badge\" :class=\"dep.detail.kind\">{{ dep.detail.kind }}</span>\n <span class=\"mute\" style=\"margin-left: 8px; font-size: var(--t-sm)\">{{ kindBlurb }}</span>\n </span>\n </li>\n <li v-if=\"row?.specName\">\n <span class=\"k\">spec</span>\n <span class=\"v\">\n <b>{{ row.specName }}</b>\n <span class=\"mute\" style=\"font-size: var(--t-sm)\">\n — stored, and shared with any other deployment using it\n </span>\n </span>\n </li>\n <li>\n <span class=\"k\">compose file</span>\n <span class=\"v mono\">\n {{ dep.detail.compose ? dep.detail.compose.file : '— (no compose section)' }}\n </span>\n </li>\n <li v-if=\"dep.detail.compose\">\n <span class=\"k\">profiles</span>\n <span class=\"v\">\n <span v-for=\"p in dep.detail.compose.profiles\" :key=\"p\" class=\"badge\" style=\"margin-right: 4px\">\n {{ p }}\n </span>\n <span v-if=\"!dep.detail.compose.profiles.length\" class=\"mute\">\n none — a bare up starts every service\n </span>\n </span>\n </li>\n <li v-if=\"dep.detail.compose?.subdomains?.length\">\n <span class=\"k\">\n subdomains\n <InfoHint label=\"how wildcard subdomains work\">\n Anything one label under these hosts reaches the same service the bare host does.\n An exact hostname you route yourself always wins over the wildcard.\n <template v-if=\"dep.detail.compose.subdomains.some((s) => s.depth === 'any')\">\n A route marked <b>any depth</b> works over HTTP only — no TLS certificate can cover\n more than one label.\n </template>\n </InfoHint>\n </span>\n <span class=\"v\">\n <div v-for=\"s in dep.detail.compose.subdomains\" :key=\"s.profile\">\n <span class=\"mono\">*.{{ s.host }}</span>\n <span class=\"mute\" style=\"font-size: var(--t-sm)\">\n → {{ s.profile }}<template v-if=\"s.depth === 'any'\"> · any depth, HTTP only</template>\n </span>\n </div>\n </span>\n </li>\n <li v-if=\"dep.detail.compose\">\n <span class=\"k\">overlays</span>\n <span class=\"v\">\n <span v-for=\"o in dep.detail.compose.overlays\" :key=\"o\" class=\"mono\" style=\"margin-right: 8px\">{{ o }}</span>\n <span v-if=\"!dep.detail.compose.overlays.length\" class=\"mute\">none</span>\n </span>\n </li>\n <li>\n <span class=\"k\">axes</span>\n <span class=\"v\">\n {{ dep.detail.axes.length }}\n <RouterLink v-if=\"dep.detail.axes.length\" :to=\"`/deployments/${encodeURIComponent(dep.id)}/axes`\">\n view →\n </RouterLink>\n </span>\n </li>\n <li>\n <span class=\"k\">requires</span>\n <span class=\"v\">{{ dep.detail.requires.length }}</span>\n </li>\n <li><span class=\"k\">created</span><span class=\"v\">{{ stamp(dep.detail.createdAt) }}</span></li>\n <li><span class=\"k\">updated</span><span class=\"v\">{{ stamp(dep.detail.updatedAt) }}</span></li>\n </ul>\n </template>\n </section>\n</template>\n"],"names":["kindBlurb","computed","isShared","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_cache","_unref","dep","_createBlock","_component_RouterLink","_hoisted_3","SkeletonList","_hoisted_5","_hoisted_6","_createVNode","InfoHint","_hoisted_7","_toDisplayString","_hoisted_8","_hoisted_9","row","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_Fragment","_renderList","p","_hoisted_15","_hoisted_16","_hoisted_17","s","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","o","_hoisted_23","_hoisted_24","_createTextVNode","_hoisted_25","_hoisted_26","stamp","_hoisted_27","_hoisted_4"],"mappings":"46BAQA,MAAMA,EAAYC,EAAS,IACzBC,EAAS,MACL,kEACA,gFAAA,mDAKJ,OAAAC,EAAA,EAAAC,EA2GU,UA3GVC,EA2GU,CA1GRC,EAUM,MAVNC,EAUM,CATJC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAF,EAAsC,KAAA,CAAlC,MAAM,SAAA,EAAU,gBAAa,EAAA,eACjCA,EAAqB,OAAA,CAAf,MAAM,MAAA,EAAM,KAAA,EAAA,GACAG,EAAAC,CAAA,EAAI,YAAtBC,EAEaC,EAAA,OAFkB,GAAE,gBAAkB,mBAAmBH,EAAAC,CAAA,EAAI,EAAE,CAAA,EAAA,aAAK,IAEjF,CAAA,GAAAF,EAAA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t,n)=>t.has(e)||ht("Cannot "+n);var Ae=(e,t,n)=>(fn(e,t,"read from private field"),n?n.call(e):t.get(e)),gt=(e,t,n)=>t.has(e)?ht("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);import{j as Mt,k as pn,l as Ve,e as mn,r as hn,g as Vt,S as vt,P as Y,c as Ce,a as me,m as gn,u as yt,n as wt,i as vn,f as yn,F as wn,D as xn,o as xt,p as bn,h as Sn,b as Lt,q as Cn,T as _n}from"./Teleport-0BmaJsBF.js";import{r as E,C as q,a3 as Le,a4 as An,a5 as Pn,a6 as On,a7 as En,X as he,a8 as qn,d as k,a9 as bt,H as de,aa as Rn,ab as Tn,o as $,x as L,w as R,V,u as w,ac as Ft,ad as we,M as $n,ae as Bn,af as kn,c as J,e as N,W as ne,D as Nt,ag as In,U as it,g as Ee,s as zt,F as lt,a as xe,h as Oe,I as Dn,ah as Pe,a1 as Ht,Y as Wt,Z as jt,ai as Mn,f as Kt,aj as Vn,ak as Ln,t as Ge}from"./index-D8OAewba.js";function St(e){return typeof e=="string"?`'${e}'`:new Fn().serialize(e)}const Fn=(function(){var t;class e{constructor(){gt(this,t,new Map)}compare(o,r){const i=typeof o,l=typeof r;return i==="string"&&l==="string"?o.localeCompare(r):i==="number"&&l==="number"?o-r:String.prototype.localeCompare.call(this.serialize(o,!0),this.serialize(r,!0))}serialize(o,r){if(o===null)return"null";switch(typeof o){case"string":return r?o:`'${o}'`;case"bigint":return`${o}n`;case"object":return this.$object(o);case"function":return this.$function(o)}return String(o)}serializeObject(o){const r=Object.prototype.toString.call(o);if(r!=="[object Object]")return this.serializeBuiltInType(r.length<10?`unknown:${r}`:r.slice(8,-1),o);const i=o.constructor,l=i===Object||i===void 0?"":i.name;if(l!==""&&globalThis[l]===i)return this.serializeBuiltInType(l,o);if(typeof o.toJSON=="function"){const s=o.toJSON();return l+(s!==null&&typeof s=="object"?this.$object(s):`(${this.serialize(s)})`)}return this.serializeObjectEntries(l,Object.entries(o))}serializeBuiltInType(o,r){const i=this["$"+o];if(i)return i.call(this,r);if(typeof(r==null?void 0:r.entries)=="function")return this.serializeObjectEntries(o,r.entries());throw new Error(`Cannot serialize ${o}`)}serializeObjectEntries(o,r){const i=Array.from(r).sort((s,a)=>this.compare(s[0],a[0]));let l=`${o}{`;for(let s=0;s<i.length;s++){const[a,u]=i[s];l+=`${this.serialize(a,!0)}:${this.serialize(u)}`,s<i.length-1&&(l+=",")}return l+"}"}$object(o){let r=Ae(this,t).get(o);return r===void 0&&(Ae(this,t).set(o,`#${Ae(this,t).size}`),r=this.serializeObject(o),Ae(this,t).set(o,r)),r}$function(o){const r=Function.prototype.toString.call(o);return r.slice(-15)==="[native code] }"?`${o.name||""}()[native]`:`${o.name}(${o.length})${r.replace(/\s*\n\s*/g,"")}`}$Array(o){let r="[";for(let i=0;i<o.length;i++)r+=this.serialize(o[i]),i<o.length-1&&(r+=",");return r+"]"}$Date(o){try{return`Date(${o.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(o){return`ArrayBuffer[${new Uint8Array(o).join(",")}]`}$Set(o){return`Set${this.$Array(Array.from(o).sort((r,i)=>this.compare(r,i)))}`}$Map(o){return this.serializeObjectEntries("Map",o.entries())}}t=new WeakMap;for(const n of["Error","RegExp","URL"])e.prototype["$"+n]=function(o){return`${n}(${o})`};for(const n of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])e.prototype["$"+n]=function(o){return`${n}[${o.join(",")}]`};for(const n of["BigInt64Array","BigUint64Array"])e.prototype["$"+n]=function(o){return`${n}[${o.join("n,")}${o.length>0?"n":""}]`};return e})();function Nn(e,t){return e===t||St(e)===St(t)}function Ct(e,t=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY){return Math.min(n,Math.max(t,e))}function zn(e){const t=Mt({dir:E("ltr")});return q(()=>{var n;return(e==null?void 0:e.value)||((n=t.dir)==null?void 0:n.value)||"ltr"})}let Ze=0;function Hn(){Le(e=>{if(!pn)return;const t=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",t[0]??_t()),document.body.insertAdjacentElement("beforeend",t[1]??_t()),Ze++,e(()=>{Ze===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(n=>n.remove()),Ze--})})}function _t(){const e=document.createElement("span");return e.setAttribute("data-reka-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function Wn(e){return q(()=>{var t;return An(e)?!!((t=Ve(e))!=null&&t.closest("form")):!0})}function st(e){const t=Pn(),n=Object.keys((t==null?void 0:t.type.props)??{}).reduce((r,i)=>{const l=(t==null?void 0:t.type.props[i]).default;return l!==void 0&&(r[i]=l),r},{}),o=En(e);return q(()=>{const r={},i=(t==null?void 0:t.vnode.props)??{};return Object.keys(i).forEach(l=>{r[On(l)]=i[l]}),Object.keys({...n,...r}).reduce((l,s)=>(o.value[s]!==void 0&&(l[s]=o.value[s]),l),{})})}function jn(e,t){const n=st(e),o=t?mn(t):{};return q(()=>({...n.value,...o}))}function Kn(e){const t=E(),n=q(()=>{var r;return((r=t.value)==null?void 0:r.width)??0}),o=q(()=>{var r;return((r=t.value)==null?void 0:r.height)??0});return he(()=>{const r=Ve(e);if(r){t.value={width:r.offsetWidth,height:r.offsetHeight};const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const s=l[0];let a,u;if("borderBoxSize"in s){const p=s.borderBoxSize,f=Array.isArray(p)?p[0]:p;a=f.inlineSize,u=f.blockSize}else a=r.offsetWidth,u=r.offsetHeight;t.value={width:a,height:u}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else t.value=void 0}),{width:n,height:o}}function Ut(e){const t=hn("",1e3);return{search:t,handleTypeaheadSearch:(r,i)=>{t.value=t.value+r;{const l=Vt(),s=i.map(d=>{var c,m;return{...d,textValue:((c=d.value)==null?void 0:c.textValue)??((m=d.ref.textContent)==null?void 0:m.trim())??""}}),a=s.find(d=>d.ref===l),u=s.map(d=>d.textValue),p=Yn(u,t.value,a==null?void 0:a.textValue),f=s.find(d=>d.textValue===p);return f&&f.ref.focus(),f==null?void 0:f.ref}},resetTypeahead:()=>{t.value=""}}}function Un(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function Yn(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=Un(e,Math.max(i,0));r.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return a!==n?a:void 0}function At(){const e=E(),t=q(()=>{var n,o;return["#text","#comment"].includes((n=e.value)==null?void 0:n.$el.nodeName)?(o=e.value)==null?void 0:o.$el.nextElementSibling:Ve(e)});return{primitiveElement:e,currentElement:t}}const Pt="data-reka-collection-item";function Te(e={}){const{key:t="",isProvider:n=!1}=e,o=`${t}CollectionProvider`;let r;if(n){const p=E(new Map);r={collectionRef:E(),itemMap:p},Tn(o,r)}else r=qn(o);const i=(p=!1)=>{const f=r.collectionRef.value;if(!f)return[];const d=Array.from(f.querySelectorAll(`[${Pt}]`)),m=Array.from(r.itemMap.value.values()).sort((y,x)=>d.indexOf(y.ref)-d.indexOf(x.ref));return p?m:m.filter(y=>y.ref.dataset.disabled!=="")},l=k({name:"CollectionSlot",inheritAttrs:!1,setup(p,{slots:f,attrs:d}){const{primitiveElement:c,currentElement:m}=At();return de(m,()=>{r.collectionRef.value=m.value}),()=>bt(vt,{ref:c,...d},f)}}),s=k({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(p,{slots:f,attrs:d}){const{primitiveElement:c,currentElement:m}=At();return Le(y=>{if(m.value){const x=Rn(m.value);r.itemMap.value.set(x,{ref:m.value,value:p.value}),y(()=>r.itemMap.value.delete(x))}}),()=>bt(vt,{...d,[Pt]:"",ref:c},f)}}),a=q(()=>Array.from(r.itemMap.value.values())),u=q(()=>r.itemMap.value.size);return{getItems:i,reactiveItems:a,itemMapSize:u,CollectionSlot:l,CollectionItem:s}}var Xn=k({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){return(t,n)=>($(),L(w(Y),{as:t.as,"as-child":t.asChild,"aria-hidden":t.feature==="focusable"?"true":void 0,"data-hidden":t.feature==="fully-hidden"?"":void 0,tabindex:t.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:R(()=>[V(t.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),Gn=Xn;const[Yt,Zn]=Ce("PopperRoot");var Jn=k({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=E();return Zn({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>V(n.$slots,"default")}}),Qn=Jn,eo=k({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n,currentElement:o}=me(),r=Yt();return Ft(()=>{r.onAnchorChange(t.reference??o.value)}),(i,l)=>($(),L(w(Y),{ref:w(n),as:i.as,"as-child":i.asChild},{default:R(()=>[V(i.$slots,"default")]),_:3},8,["as","as-child"]))}}),to=eo;function no(e){return e!==null}function oo(e){return{name:"transformOrigin",options:e,fn(t){var x,_,g;const{placement:n,rects:o,middlewareData:r}=t,l=((x=r.arrow)==null?void 0:x.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,p]=et(n),f={start:"0%",center:"50%",end:"100%"}[p],d=(((_=r.arrow)==null?void 0:_.x)??0)+s/2,c=(((g=r.arrow)==null?void 0:g.y)??0)+a/2;let m="",y="";return u==="bottom"?(m=l?f:`${d}px`,y=`${-a}px`):u==="top"?(m=l?f:`${d}px`,y=`${o.floating.height+a}px`):u==="right"?(m=`${-a}px`,y=l?f:`${c}px`):u==="left"&&(m=`${o.floating.width+a}px`,y=l?f:`${c}px`),{data:{x:m,y}}}}}function et(e){const[t,n="center"]=e.split("-");return[t,n]}const ro=["top","right","bottom","left"],ie=Math.min,Q=Math.max,ke=Math.round,Be=Math.floor,ee=e=>({x:e,y:e}),io={left:"right",right:"left",bottom:"top",top:"bottom"};function Xt(e,t,n){return Q(e,ie(t,n))}function te(e,t){return typeof e=="function"?e(t):e}function le(e){return e.split("-")[0]}function _e(e){return e.split("-")[1]}function at(e){return e==="x"?"y":"x"}function ut(e){return e==="y"?"height":"width"}function U(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ct(e){return at(U(e))}function lo(e,t,n){n===void 0&&(n=!1);const o=_e(e),r=ct(e),i=ut(r);let l=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Ie(l)),[l,Ie(l)]}function so(e){const t=Ie(e);return[tt(e),t,tt(t)]}function tt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ot=["left","right"],Et=["right","left"],ao=["top","bottom"],uo=["bottom","top"];function co(e,t,n){switch(e){case"top":case"bottom":return n?t?Et:Ot:t?Ot:Et;case"left":case"right":return t?ao:uo;default:return[]}}function fo(e,t,n,o){const r=_e(e);let i=co(le(e),n==="start",o);return r&&(i=i.map(l=>l+"-"+r),t&&(i=i.concat(i.map(tt)))),i}function Ie(e){const t=le(e);return io[t]+e.slice(t.length)}function po(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function Gt(e){return typeof e!="number"?po(e):{top:e,right:e,bottom:e,left:e}}function De(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function qt(e,t,n){let{reference:o,floating:r}=e;const i=U(t),l=ct(t),s=ut(l),a=le(t),u=i==="y",p=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[s]/2-r[s]/2;let c;switch(a){case"top":c={x:p,y:o.y-r.height};break;case"bottom":c={x:p,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:f};break;case"left":c={x:o.x-r.width,y:f};break;default:c={x:o.x,y:o.y}}const m=_e(t);return m&&(c[l]+=d*(m==="end"?1:-1)*(n&&u?-1:1)),c}async function mo(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:l,elements:s,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:d=!1,padding:c=0}=te(t,e),m=Gt(c),x=s[d?f==="floating"?"reference":"floating":f],_=De(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:p,strategy:a})),g=f==="floating"?{x:o,y:r,width:l.floating.width,height:l.floating.height}:l.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),h=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},S=De(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:C,strategy:a}):g);return{top:(_.top-S.top+m.top)/h.y,bottom:(S.bottom-_.bottom+m.bottom)/h.y,left:(_.left-S.left+m.left)/h.x,right:(S.right-_.right+m.right)/h.x}}const ho=50,go=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,s=l.detectOverflow?l:{...l,detectOverflow:mo},a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:p,y:f}=qt(u,o,a),d=o,c=0;const m={};for(let y=0;y<i.length;y++){const x=i[y];if(!x)continue;const{name:_,fn:g}=x,{x:C,y:h,data:S,reset:v}=await g({x:p,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:m,rects:u,platform:s,elements:{reference:e,floating:t}});p=C??p,f=h??f,m[_]={...m[_],...S},v&&c<ho&&(c++,typeof v=="object"&&(v.placement&&(d=v.placement),v.rects&&(u=v.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:r}):v.rects),{x:p,y:f}=qt(u,d,a)),y=-1)}return{x:p,y:f,placement:d,strategy:r,middlewareData:m}},vo=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:p=0}=te(e,t)||{};if(u==null)return{};const f=Gt(p),d={x:n,y:o},c=ct(r),m=ut(c),y=await l.getDimensions(u),x=c==="y",_=x?"top":"left",g=x?"bottom":"right",C=x?"clientHeight":"clientWidth",h=i.reference[m]+i.reference[c]-d[c]-i.floating[m],S=d[c]-i.reference[c],v=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let b=v?v[C]:0;(!b||!await(l.isElement==null?void 0:l.isElement(v)))&&(b=s.floating[C]||i.floating[m]);const A=h/2-S/2,P=b/2-y[m]/2-1,O=ie(f[_],P),I=ie(f[g],P),T=b-y[m]-I,B=b/2-y[m]/2+A,D=Xt(O,B,T),z=!a.arrow&&_e(r)!=null&&B!==D&&i.reference[m]/2-(B<O?O:I)-y[m]/2<0,F=z?B<O?B-O:B-T:0;return{[c]:d[c]+F,data:{[c]:D,centerOffset:B-D-F,...z&&{alignmentOffset:F}},reset:z}}}),yo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:u}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...x}=te(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=le(r),g=U(s),C=le(s)===s,h=await(a.isRTL==null?void 0:a.isRTL(u.floating)),S=d||(C||!y?[Ie(s)]:so(s)),v=m!=="none";!d&&v&&S.push(...fo(s,y,m,h));const b=[s,...S],A=await a.detectOverflow(t,x),P=[];let O=((o=i.flip)==null?void 0:o.overflows)||[];if(p&&P.push(A[_]),f){const D=lo(r,l,h);P.push(A[D[0]],A[D[1]])}if(O=[...O,{placement:r,overflows:P}],!P.every(D=>D<=0)){var I,T;const D=(((I=i.flip)==null?void 0:I.index)||0)+1,z=b[D];if(z&&(!(f==="alignment"?g!==U(z):!1)||O.every(M=>U(M.placement)===g?M.overflows[0]>0:!0)))return{data:{index:D,overflows:O},reset:{placement:z}};let F=(T=O.filter(W=>W.overflows[0]<=0).sort((W,M)=>W.overflows[1]-M.overflows[1])[0])==null?void 0:T.placement;if(!F)switch(c){case"bestFit":{var B;const W=(B=O.filter(M=>{if(v){const K=U(M.placement);return K===g||K==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(K=>K>0).reduce((K,ye)=>K+ye,0)]).sort((M,K)=>M[1]-K[1])[0])==null?void 0:B[0];W&&(F=W);break}case"initialPlacement":F=s;break}if(r!==F)return{reset:{placement:F}}}return{}}}};function Rt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tt(e){return ro.some(t=>e[t]>=0)}const wo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=te(e,t);switch(r){case"referenceHidden":{const l=await o.detectOverflow(t,{...i,elementContext:"reference"}),s=Rt(l,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Tt(s)}}}case"escaped":{const l=await o.detectOverflow(t,{...i,altBoundary:!0}),s=Rt(l,n.floating);return{data:{escapedOffsets:s,escaped:Tt(s)}}}default:return{}}}}},Zt=new Set(["left","top"]);async function xo(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),l=le(n),s=_e(n),a=U(n)==="y",u=Zt.has(l)?-1:1,p=i&&a?-1:1,f=te(t,e);let{mainAxis:d,crossAxis:c,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof m=="number"&&(c=s==="end"?m*-1:m),a?{x:c*p,y:d*u}:{x:d*u,y:c*p}}const bo=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:l,middlewareData:s}=t,a=await xo(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:l}}}}},So=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:l=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:C,y:h}=g;return{x:C,y:h}}},...u}=te(e,t),p={x:n,y:o},f=await i.detectOverflow(t,u),d=U(r),c=at(d);let m=p[c],y=p[d];const x=(g,C)=>Xt(C+f[g==="y"?"top":"left"],C,C-f[g==="y"?"bottom":"right"]);l&&(m=x(c,m)),s&&(y=x(d,y));const _=a.fn({...t,[c]:m,[d]:y});return{..._,data:{x:_.x-n,y:_.y-o,enabled:{[c]:l,[d]:s}}}}}},Co=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:i,placement:l,rects:s,middlewareData:a}=t,{offset:u=0,mainAxis:p=!0,crossAxis:f=!0}=te(e,t),d={x:r,y:i},c=U(l),m=at(c);let y=d[m],x=d[c];const _=te(u,t),g=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:(n=_.mainAxis)!=null?n:0,crossAxis:(o=_.crossAxis)!=null?o:0};if(p){const S=m==="y"?"height":"width",v=s.reference[m]-s.floating[S]+g.mainAxis,b=s.reference[m]+s.reference[S]-g.mainAxis;y<v?y=v:y>b&&(y=b)}if(f){var C,h;const S=m==="y"?"width":"height",v=Zt.has(le(l)),b=s.reference[c]-s.floating[S]+(v&&((C=a.offset)==null?void 0:C[c])||0)+(v?0:g.crossAxis),A=s.reference[c]+s.reference[S]+(v?0:((h=a.offset)==null?void 0:h[c])||0)-(v?g.crossAxis:0);x<b?x=b:x>A&&(x=A)}return{[m]:y,[c]:x}}}},_o=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:l=()=>{},...s}=te(e,t),a=await r.detectOverflow(t,s),u=le(n),p=_e(n),f=U(n)==="y",{width:d,height:c}=o.floating;let m,y;u==="top"||u==="bottom"?(m=u,y=p===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(y=u,m=p==="end"?"top":"bottom");const x=c-a.top-a.bottom,_=d-a.left-a.right,g=ie(c-a[m],x),C=ie(d-a[y],_),h=t.middlewareData.shift,S=!h;let v=g,b=C;h!=null&&h.enabled.x&&(b=_),h!=null&&h.enabled.y&&(v=x),S&&!p&&(f?b=d-2*Q(a.left,a.right):v=c-2*Q(a.top,a.bottom)),await l({...t,availableWidth:b,availableHeight:v});const A=await r.getDimensions(i.floating);return d!==A.width||c!==A.height?{reset:{rects:!0}}:{}}}};function Fe(){return typeof window<"u"}function ge(e){return dt(e)?(e.nodeName||"").toLowerCase():"#document"}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function oe(e){var t;return(t=(dt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dt(e){return Fe()?e instanceof Node||e instanceof H(e).Node:!1}function X(e){return Fe()?e instanceof Element||e instanceof H(e).Element:!1}function se(e){return Fe()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function $t(e){return!Fe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function Ne(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=G(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function Ao(e){return/^(table|td|th)$/.test(ge(e))}function ze(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Po=/transform|translate|scale|rotate|perspective|filter/,Oo=/paint|layout|strict|content/,ce=e=>!!e&&e!=="none";let Je;function ft(e){const t=X(e)?G(e):e;return ce(t.transform)||ce(t.translate)||ce(t.scale)||ce(t.rotate)||ce(t.perspective)||!pt()&&(ce(t.backdropFilter)||ce(t.filter))||Po.test(t.willChange||"")||Oo.test(t.contain||"")}function Eo(e){let t=fe(e);for(;se(t)&&!qe(t);){if(ft(t))return t;if(ze(t))return null;t=fe(t)}return null}function pt(){return Je==null&&(Je=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Je}function qe(e){return/^(html|body|#document)$/.test(ge(e))}function G(e){return H(e).getComputedStyle(e)}function He(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fe(e){if(ge(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$t(e)&&e.host||oe(e);return $t(t)?t.host:t}function Jt(e){const t=fe(e);return qe(t)?(e.ownerDocument||e).body:se(t)&&Ne(t)?t:Jt(t)}function Re(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Jt(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),l=H(r);if(i){const s=nt(l);return t.concat(l,l.visualViewport||[],Ne(r)?r:[],s&&n?Re(s):[])}else return t.concat(r,Re(r,[],n))}function nt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qt(e){const t=G(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=se(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,s=ke(n)!==i||ke(o)!==l;return s&&(n=i,o=l),{width:n,height:o,$:s}}function mt(e){return X(e)?e:e.contextElement}function Se(e){const t=mt(e);if(!se(t))return ee(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Qt(t);let l=(i?ke(n.width):n.width)/o,s=(i?ke(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const qo=ee(0);function en(e){const t=H(e);return!pt()||!t.visualViewport?qo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ro(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function pe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=mt(e);let l=ee(1);t&&(o?X(o)&&(l=Se(o)):l=Se(e));const s=Ro(i,n,o)?en(i):ee(0);let a=(r.left+s.x)/l.x,u=(r.top+s.y)/l.y,p=r.width/l.x,f=r.height/l.y;if(i&&o){const d=H(i),c=X(o)?H(o):o;let m=d,y=nt(m);for(;y&&c!==m;){const x=Se(y),_=y.getBoundingClientRect(),g=G(y),C=_.left+(y.clientLeft+parseFloat(g.paddingLeft))*x.x,h=_.top+(y.clientTop+parseFloat(g.paddingTop))*x.y;a*=x.x,u*=x.y,p*=x.x,f*=x.y,a+=C,u+=h,m=H(y),y=nt(m)}}return De({width:p,height:f,x:a,y:u})}function We(e,t){const n=He(e).scrollLeft;return t?t.left+n:pe(oe(e)).left+n}function tn(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-We(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function To(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",l=oe(o),s=t?ze(t.floating):!1;if(o===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},u=ee(1);const p=ee(0),f=se(o);if((f||!i)&&((ge(o)!=="body"||Ne(l))&&(a=He(o)),f)){const c=pe(o);u=Se(o),p.x=c.x+o.clientLeft,p.y=c.y+o.clientTop}const d=l&&!f&&!i?tn(l,a):ee(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+p.x+d.x,y:n.y*u.y-a.scrollTop*u.y+p.y+d.y}}function $o(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Bo(e){const t=He(e),n=e.ownerDocument.body,o=Q(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Q(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+We(e);const l=-t.scrollTop;return G(n).direction==="rtl"&&(i+=Q(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:l}}const ko=25;function Io(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=H(e),i=oe(e),l=r.visualViewport;let s=i.clientWidth,a=i.clientHeight,u=0,p=0;if(l){const d=!pt()||t==="fixed";o?d||(u=-l.offsetLeft,p=-l.offsetTop):(s=l.width,a=l.height,d&&(u=l.offsetLeft,p=l.offsetTop))}if(We(i)<=0){const d=i.ownerDocument,c=d.body,m=getComputedStyle(c),y=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(i.clientWidth-c.clientWidth-y),_=getComputedStyle(i).scrollbarGutter==="stable both-edges"?x/2:x;_<=ko&&(s-=_)}return{width:s,height:a,x:u,y:p}}function Do(e,t){const n=pe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Se(e),l=e.clientWidth*i.x,s=e.clientHeight*i.y,a=r*i.x,u=o*i.y;return{width:l,height:s,x:a,y:u}}function Bt(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Io(e,n,t);else if(t==="document")o=Bo(oe(e));else if(X(t))o=Do(t,n);else{const r=en(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return De(o)}function Mo(e,t){const n=t.get(e);if(n)return n;let o=Re(e,[],!1).filter(s=>X(s)&&ge(s)!=="body"),r=null;const i=G(e).position==="fixed";let l=i?fe(e):e;for(;X(l)&&!qe(l);){const s=G(l),a=ft(l),u=r?r.position:i?"fixed":"";!a&&(u==="fixed"||u==="absolute"&&s.position==="static")?o=o.filter(f=>f!==l):r=s,l=fe(l)}return t.set(e,o),o}function Vo(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const l=[...n==="clippingAncestors"?ze(t)?[]:Mo(t,this._c):[].concat(n),o],s=Bt(t,l[0],r);let a=s.top,u=s.right,p=s.bottom,f=s.left;for(let d=1;d<l.length;d++){const c=Bt(t,l[d],r);a=Q(c.top,a),u=ie(c.right,u),p=ie(c.bottom,p),f=Q(c.left,f)}return{width:u-f,height:p-a,x:f,y:a}}function Lo(e){const{width:t,height:n}=Qt(e);return{width:t,height:n}}function Fo(e,t,n){const o=se(t),r=oe(t),i=n==="fixed",l=pe(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=ee(0);if((o||!i)&&((ge(t)!=="body"||Ne(r))&&(s=He(t)),o)){const d=pe(t,!0,i,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}!o&&r&&(a.x=We(r));const u=r&&!o&&!i?tn(r,s):ee(0),p=l.left+s.scrollLeft-a.x-u.x,f=l.top+s.scrollTop-a.y-u.y;return{x:p,y:f,width:l.width,height:l.height}}function Qe(e){return G(e).position==="static"}function kt(e,t){if(!se(e)||G(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return oe(e)===n&&(n=n.ownerDocument.body),n}function nn(e,t){const n=H(e);if(ze(e))return n;if(!se(e)){let r=fe(e);for(;r&&!qe(r);){if(X(r)&&!Qe(r))return r;r=fe(r)}return n}let o=kt(e,t);for(;o&&Ao(o)&&Qe(o);)o=kt(o,t);return o&&qe(o)&&Qe(o)&&!ft(o)?n:o||Eo(e)||n}const No=async function(e){const t=this.getOffsetParent||nn,n=this.getDimensions,o=await n(e.floating);return{reference:Fo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function zo(e){return G(e).direction==="rtl"}const Ho={convertOffsetParentRelativeRectToViewportRelativeRect:To,getDocumentElement:oe,getClippingRect:Vo,getOffsetParent:nn,getElementRects:No,getClientRects:$o,getDimensions:Lo,getScale:Se,isElement:X,isRTL:zo};function on(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wo(e,t,n){let o=null,r;const i=oe(e);function l(){var p;clearTimeout(r),(p=o)==null||p.disconnect(),o=null}function s(p,f){p===void 0&&(p=!1),f===void 0&&(f=1),l();const d=e.getBoundingClientRect(),{left:c,top:m,width:y,height:x}=d;if(p||t(),!y||!x)return;const _=Be(m),g=Be(i.clientWidth-(c+y)),C=Be(i.clientHeight-(m+x)),h=Be(c),v={rootMargin:-_+"px "+-g+"px "+-C+"px "+-h+"px",threshold:Q(0,ie(1,f))||1};let b=!0;function A(P){const O=P[0].intersectionRatio;if(!on(d,e.getBoundingClientRect()))return s();if(O!==f){if(!b)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}b=!1}try{o=new IntersectionObserver(A,{...v,root:i.ownerDocument})}catch{o=new IntersectionObserver(A,v)}o.observe(e)}const a=H(e),u=()=>s(n);return a.addEventListener("resize",u),s(!0),()=>{a.removeEventListener("resize",u),l()}}function jo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,u=mt(e),p=r||i?[...u?Re(u):[],...t?Re(t):[]]:[];p.forEach(_=>{r&&_.addEventListener("scroll",n),i&&_.addEventListener("resize",n)});const f=u&&s?Wo(u,n,i):null;let d=-1,c=null;l&&(c=new ResizeObserver(_=>{let[g]=_;g&&g.target===u&&c&&t&&(c.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var C;(C=c)==null||C.observe(t)})),n()}),u&&!a&&c.observe(u),t&&c.observe(t));let m,y=a?pe(e):null;a&&x();function x(){const _=pe(e);y&&!on(y,_)&&n(),y=_,m=requestAnimationFrame(x)}return n(),()=>{var _;p.forEach(g=>{r&&g.removeEventListener("scroll",n),i&&g.removeEventListener("resize",n)}),f==null||f(),(_=c)==null||_.disconnect(),c=null,a&&cancelAnimationFrame(m)}}const Ko=bo,Uo=So,It=yo,Yo=_o,Xo=wo,Go=vo,Zo=Co,Jo=(e,t,n)=>{const o=new Map,r=n??{},i={...Ho,...r.platform,_c:o};return go(e,t,{...r,platform:i})};function Qo(e){return e!=null&&typeof e=="object"&&"$el"in e}function ot(e){if(Qo(e)){const t=e.$el;return dt(t)&&ge(t)==="#comment"?null:t}return e}function be(e){return typeof e=="function"?e():w(e)}function er(e){return{name:"arrow",options:e,fn(t){const n=ot(be(e.element));return n==null?{}:Go({element:n,padding:e.padding}).fn(t)}}}function rn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Dt(e,t){const n=rn(e);return Math.round(t*n)/n}function tr(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=q(()=>{var b;return(b=be(n.open))!=null?b:!0}),i=q(()=>be(n.middleware)),l=q(()=>{var b;return(b=be(n.placement))!=null?b:"bottom"}),s=q(()=>{var b;return(b=be(n.strategy))!=null?b:"absolute"}),a=q(()=>{var b;return(b=be(n.transform))!=null?b:!0}),u=q(()=>ot(e.value)),p=q(()=>ot(t.value)),f=E(0),d=E(0),c=E(s.value),m=E(l.value),y=$n({}),x=E(!1),_=q(()=>{const b={position:c.value,left:"0",top:"0"};if(!p.value)return b;const A=Dt(p.value,f.value),P=Dt(p.value,d.value);return a.value?{...b,transform:"translate("+A+"px, "+P+"px)",...rn(p.value)>=1.5&&{willChange:"transform"}}:{position:c.value,left:A+"px",top:P+"px"}});let g;function C(){if(u.value==null||p.value==null)return;const b=r.value;Jo(u.value,p.value,{middleware:i.value,placement:l.value,strategy:s.value}).then(A=>{f.value=A.x,d.value=A.y,c.value=A.strategy,m.value=A.placement,y.value=A.middlewareData,x.value=b!==!1})}function h(){typeof g=="function"&&(g(),g=void 0)}function S(){if(h(),o===void 0){C();return}if(u.value!=null&&p.value!=null){g=o(u.value,p.value,C);return}}function v(){r.value||(x.value=!1)}return de([i,l,s,r],C,{flush:"sync"}),de([u,p],S,{flush:"sync"}),de(r,v,{flush:"sync"}),Bn()&&kn(h),{x:we(f),y:we(d),strategy:we(c),placement:we(m),middlewareData:we(y),isPositioned:we(x),floatingStyles:_,update:C}}const nr={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[Yr,or]=Ce("PopperContent");var rr=k({inheritAttrs:!1,__name:"PopperContent",props:In({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...nr}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,r=Yt(),{forwardRef:i,currentElement:l}=me(),s=E(),a=E(),{width:u,height:p}=Kn(a),f=q(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),d=q(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),c=q(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),m=q(()=>({padding:d.value,boundary:c.value.filter(no),altBoundary:c.value.length>0})),y=q(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),x=gn(()=>[Ko({mainAxis:n.sideOffset+p.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&It({...m.value,...y.value}),n.avoidCollisions&&Uo({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Zo():void 0,...m.value}),!n.prioritizePosition&&n.avoidCollisions&&It({...m.value,...y.value}),Yo({...m.value,apply:({elements:T,rects:B,availableWidth:D,availableHeight:z})=>{const{width:F,height:W}=B.reference,M=T.floating.style;M.setProperty("--reka-popper-available-width",`${D}px`),M.setProperty("--reka-popper-available-height",`${z}px`),M.setProperty("--reka-popper-anchor-width",`${F}px`),M.setProperty("--reka-popper-anchor-height",`${W}px`)}}),a.value&&er({element:a.value,padding:n.arrowPadding}),oo({arrowWidth:u.value,arrowHeight:p.value}),n.hideWhenDetached&&Xo({strategy:"referenceHidden",...m.value})]),_=q(()=>n.reference??r.anchor.value),{floatingStyles:g,placement:C,isPositioned:h,middlewareData:S}=tr(_,s,{strategy:n.positionStrategy,placement:f,whileElementsMounted:(...T)=>jo(...T,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:x}),v=q(()=>et(C.value)[0]),b=q(()=>et(C.value)[1]);Ft(()=>{h.value&&o("placed")});const A=q(()=>{var B;const T=((B=S.value.arrow)==null?void 0:B.centerOffset)!==0;return n.hideShiftedArrow&&T}),P=E("");Le(()=>{l.value&&(P.value=window.getComputedStyle(l.value).zIndex)});const O=q(()=>{var T;return((T=S.value.arrow)==null?void 0:T.x)??0}),I=q(()=>{var T;return((T=S.value.arrow)==null?void 0:T.y)??0});return or({placedSide:v,onArrowChange:T=>a.value=T,arrowX:O,arrowY:I,shouldHideArrow:A}),(T,B)=>{var D,z,F;return $(),J("div",{ref_key:"floatingRef",ref:s,"data-reka-popper-content-wrapper":"",style:Nt({...w(g),transform:w(h)?w(g).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:P.value,"--reka-popper-transform-origin":[(D=w(S).transformOrigin)==null?void 0:D.x,(z=w(S).transformOrigin)==null?void 0:z.y].join(" "),...((F=w(S).hide)==null?void 0:F.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[N(w(Y),ne({ref:w(i)},T.$attrs,{"as-child":n.asChild,as:T.as,"data-side":v.value,"data-align":b.value,style:{animation:w(h)?void 0:"none"}}),{default:R(()=>[V(T.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),ir=rr;function lr(e){const t=Mt({nonce:E()});return q(()=>{var n;return(e==null?void 0:e.value)||((n=t.nonce)==null?void 0:n.value)})}const sr=[" ","Enter","ArrowUp","ArrowDown"],ar=[" ","Enter"],j=10;function Me(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(o=>rt(o,t,n)):rt(e,t,n)}function rt(e,t,n){return e===void 0||t===void 0?!1:typeof e=="string"?e===t:typeof n=="function"?n(e,t):typeof n=="string"?(e==null?void 0:e[n])===(t==null?void 0:t[n]):Nn(e,t)}function ur(e){return e==null||e===""||Array.isArray(e)&&e.length===0}const cr={key:0,value:""},[ve,ln]=Ce("SelectRoot");var dr=k({inheritAttrs:!1,__name:"SelectRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:open"],setup(e,{emit:t}){const n=e,o=t,{required:r,disabled:i,multiple:l,dir:s}=it(n),a=yt(n,"modelValue",o,{defaultValue:n.defaultValue??(l.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),u=yt(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0}),p=E(),f=E(),d=E({x:0,y:0}),c=q(()=>{var h;return l.value&&Array.isArray(a.value)?((h=a.value)==null?void 0:h.length)===0:wt(a.value)});Te({isProvider:!0});const m=zn(s),y=Wn(p),x=E(new Set),_=q(()=>Array.from(x.value).map(h=>h.value).join(";"));function g(h){if(l.value){const S=Array.isArray(a.value)?[...a.value]:[],v=S.findIndex(b=>rt(b,h,n.by));v===-1?S.push(h):S.splice(v,1),a.value=[...S]}else a.value=h}function C(h){return Array.from(x.value).find(S=>Me(h,S.value,n.by))}return ln({triggerElement:p,onTriggerChange:h=>{p.value=h},valueElement:f,onValueElementChange:h=>{f.value=h},contentId:"",modelValue:a,onValueChange:g,by:n.by,open:u,multiple:l,required:r,onOpenChange:h=>{u.value=h},dir:m,triggerPointerDownPosRef:d,disabled:i,isEmptyModelValue:c,optionsSet:x,onOptionAdd:h=>{const S=C(h.value);S&&x.value.delete(S),x.value.add(h)},onOptionRemove:h=>{const S=C(h.value);S&&x.value.delete(S)}}),(h,S)=>($(),L(w(Qn),null,{default:R(()=>[V(h.$slots,"default",{modelValue:w(a),open:w(u)}),w(y)&&h.name?($(),L(mr,{key:_.value,"aria-hidden":"true",tabindex:"-1",multiple:w(l),required:w(r),name:h.name,autocomplete:h.autocomplete,disabled:w(i),value:w(a)},{default:R(()=>[w(wt)(w(a))?($(),J("option",cr)):Ee("v-if",!0),($(!0),J(lt,null,zt(Array.from(x.value),v=>($(),J("option",ne({key:v.value??""},{ref_for:!0},v),null,16))),128))]),_:1},8,["multiple","required","name","autocomplete","disabled","value"])):Ee("v-if",!0)]),_:3}))}}),fr=dr,pr=k({__name:"BubbleSelect",props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){const t=e,n=E(),o=ve();de(()=>t.value,(i,l)=>{const s=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(s,"value").set;if(i!==l&&u&&n.value){const p=new Event("change",{bubbles:!0});u.call(n.value,i),n.value.dispatchEvent(p)}});function r(i){o.onValueChange(i.target.value)}return(i,l)=>($(),L(w(Gn),{"as-child":""},{default:R(()=>[xe("select",ne({ref_key:"selectElement",ref:n},t,{onInput:r}),[V(i.$slots,"default")],16)]),_:3}))}}),mr=pr,hr=k({__name:"SelectPopperPosition",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:j},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const n=st(e);return(o,r)=>($(),L(w(ir),ne(w(n),{style:{boxSizing:"border-box","--reka-select-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-select-content-available-width":"var(--reka-popper-available-width)","--reka-select-content-available-height":"var(--reka-popper-available-height)","--reka-select-trigger-width":"var(--reka-popper-anchor-width)","--reka-select-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:R(()=>[V(o.$slots,"default")]),_:3},16))}}),gr=hr;const vr={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[je,sn]=Ce("SelectContent");var yr=k({__name:"SelectContentImpl",props:{position:{type:String,required:!1,default:"item-aligned"},bodyLock:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=ve();Hn(),vn(n.bodyLock);const{CollectionSlot:i,getItems:l}=Te(),s=E();yn(s);const{search:a,handleTypeaheadSearch:u}=Ut(),p=E(),f=E(),d=E(),c=E(!1),m=E(!1),y=E(!1);function x(){f.value&&s.value&&xt([f.value,s.value])}de(c,()=>{x()});const{onOpenChange:_,triggerPointerDownPosRef:g}=r;Le(v=>{if(!s.value)return;let b={x:0,y:0};const A=O=>{var I,T;b={x:Math.abs(Math.round(O.pageX)-(((I=g.value)==null?void 0:I.x)??0)),y:Math.abs(Math.round(O.pageY)-(((T=g.value)==null?void 0:T.y)??0))}},P=O=>{var I;O.pointerType!=="touch"&&(b.x<=10&&b.y<=10?O.preventDefault():(I=s.value)!=null&&I.contains(O.target)||_(!1),document.removeEventListener("pointermove",A),g.value=null)};g.value!==null&&(document.addEventListener("pointermove",A),document.addEventListener("pointerup",P,{capture:!0,once:!0})),v(()=>{document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",P,{capture:!0})})});function C(v){const b=v.ctrlKey||v.altKey||v.metaKey;if(v.key==="Tab"&&v.preventDefault(),!b&&v.key.length===1&&u(v.key,l()),["ArrowUp","ArrowDown","Home","End"].includes(v.key)){let P=[...l().map(O=>O.ref)];if(["ArrowUp","End"].includes(v.key)&&(P=P.slice().reverse()),["ArrowUp","ArrowDown"].includes(v.key)){const O=v.target,I=P.indexOf(O);P=P.slice(I+1)}setTimeout(()=>xt(P)),v.preventDefault()}}const h=q(()=>n.position==="popper"?n:{}),S=st(h.value);return sn({content:s,viewport:p,onViewportChange:v=>{p.value=v},itemRefCallback:(v,b,A)=>{const P=!m.value&&!A,O=Me(r.modelValue.value,b,r.by);if(r.multiple.value){if(y.value)return;(O||P)&&(f.value=v,O&&(y.value=!0))}else(O||P)&&(f.value=v);P&&(m.value=!0)},selectedItem:f,selectedItemText:d,onItemLeave:()=>{var v;(v=s.value)==null||v.focus()},itemTextRefCallback:(v,b,A)=>{const P=!m.value&&!A;(Me(r.modelValue.value,b,r.by)||P)&&(d.value=v)},focusSelectedItem:x,position:n.position,isPositioned:c,searchRef:a}),(v,b)=>($(),L(w(i),null,{default:R(()=>[N(w(wn),{"as-child":"",onMountAutoFocus:b[6]||(b[6]=Oe(()=>{},["prevent"])),onUnmountAutoFocus:b[7]||(b[7]=A=>{var P;o("closeAutoFocus",A),!A.defaultPrevented&&((P=w(r).triggerElement.value)==null||P.focus({preventScroll:!0}),A.preventDefault())})},{default:R(()=>[N(w(xn),{"as-child":"","disable-outside-pointer-events":v.disableOutsidePointerEvents,onFocusOutside:b[2]||(b[2]=Oe(()=>{},["prevent"])),onDismiss:b[3]||(b[3]=A=>w(r).onOpenChange(!1)),onEscapeKeyDown:b[4]||(b[4]=A=>o("escapeKeyDown",A)),onPointerDownOutside:b[5]||(b[5]=A=>o("pointerDownOutside",A))},{default:R(()=>[($(),L(Dn(v.position==="popper"?gr:Cr),ne({...v.$attrs,...w(S)},{id:w(r).contentId,ref:A=>{if(!A)return;const P=w(Ve)(A);P!=null&&P.hasAttribute("data-reka-popper-content-wrapper")?s.value=P.firstElementChild:s.value=P},role:"listbox","data-state":w(r).open.value?"open":"closed",dir:w(r).dir.value,style:{display:"flex",flexDirection:"column",outline:"none"},onContextmenu:b[0]||(b[0]=Oe(()=>{},["prevent"])),onPlaced:b[1]||(b[1]=A=>c.value=!0),onKeydown:C}),{default:R(()=>[V(v.$slots,"default")]),_:3},16,["id","data-state","dir","onKeydown"]))]),_:3},8,["disable-outside-pointer-events"])]),_:3})]),_:3}))}}),wr=yr;const[xr,br]=Ce("SelectItemAlignedPosition");var Sr=k({inheritAttrs:!1,__name:"SelectItemAlignedPosition",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["placed"],setup(e,{emit:t}){const n=e,o=t,{getItems:r}=Te(),i=ve(),l=je(),s=E(!1),a=E(!0),u=E(),{forwardRef:p,currentElement:f}=me(),{viewport:d,selectedItem:c,selectedItemText:m,focusSelectedItem:y}=l;function x(){if(i.triggerElement.value&&i.valueElement.value&&u.value&&f.value&&(d!=null&&d.value)&&(c!=null&&c.value)&&(m!=null&&m.value)){const C=i.triggerElement.value.getBoundingClientRect(),h=f.value.getBoundingClientRect(),S=i.valueElement.value.getBoundingClientRect(),v=m.value.getBoundingClientRect();if(i.dir.value!=="rtl"){const Z=v.left-h.left,re=S.left-Z,ae=C.left-re,ue=C.width+ae,Ue=Math.max(ue,h.width),Ye=window.innerWidth-j,Xe=Ct(re,j,Math.max(j,Ye-Ue));u.value.style.minWidth=`${ue}px`,u.value.style.left=`${Xe}px`}else{const Z=h.right-v.right,re=window.innerWidth-S.right-Z,ae=window.innerWidth-C.right-re,ue=C.width+ae,Ue=Math.max(ue,h.width),Ye=window.innerWidth-j,Xe=Ct(re,j,Math.max(j,Ye-Ue));u.value.style.minWidth=`${ue}px`,u.value.style.right=`${Xe}px`}const b=r().map(Z=>Z.ref),A=window.innerHeight-j*2,P=d.value.scrollHeight,O=window.getComputedStyle(f.value),I=Number.parseInt(O.borderTopWidth,10),T=Number.parseInt(O.paddingTop,10),B=Number.parseInt(O.borderBottomWidth,10),D=Number.parseInt(O.paddingBottom,10),z=I+T+P+D+B,F=Math.min(c.value.offsetHeight*5,z),W=window.getComputedStyle(d.value),M=Number.parseInt(W.paddingTop,10),K=Number.parseInt(W.paddingBottom,10),ye=C.top+C.height/2-j,un=A-ye,Ke=c.value.offsetHeight/2,cn=c.value.offsetTop+Ke,$e=I+T+cn,dn=z-$e;if($e<=ye){const Z=c.value===b.at(-1);u.value.style.bottom="0px";const re=f.value.clientHeight-d.value.offsetTop-d.value.offsetHeight,ae=Math.max(un,Ke+(Z?K:0)+re+B),ue=$e+ae;u.value.style.height=`${ue}px`}else{const Z=c.value===b[0];u.value.style.top="0px";const ae=Math.max(ye,I+d.value.offsetTop+(Z?M:0)+Ke)+dn;u.value.style.height=`${ae}px`,d.value.scrollTop=$e-ye+d.value.offsetTop}u.value.style.margin=`${j}px 0`,u.value.style.minHeight=`${F}px`,u.value.style.maxHeight=`${A}px`,o("placed"),requestAnimationFrame(()=>s.value=!0)}}const _=E("");he(async()=>{await Pe(),x(),f.value&&(_.value=window.getComputedStyle(f.value).zIndex)});function g(C){C&&a.value===!0&&(x(),y==null||y(),a.value=!1)}return bn(i.triggerElement,()=>{x()}),br({contentWrapper:u,shouldExpandOnScrollRef:s,onScrollButtonChange:g}),(C,h)=>($(),J("div",{ref_key:"contentWrapperElement",ref:u,style:Nt({display:"flex",flexDirection:"column",position:"fixed",zIndex:_.value})},[N(w(Y),ne({ref:w(p),style:{boxSizing:"border-box",maxHeight:"100%"}},{...C.$attrs,...n}),{default:R(()=>[V(C.$slots,"default")]),_:3},16)],4))}}),Cr=Sr,_r=k({inheritAttrs:!1,__name:"SelectProvider",props:{context:{type:Object,required:!0}},setup(e){return ln(e.context),sn(vr),(n,o)=>V(n.$slots,"default")}}),Ar=_r;const Pr={key:1};var Or=k({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,r=jn(n,t),i=ve(),l=E();he(()=>{l.value=new DocumentFragment});const s=E(),a=q(()=>n.forceMount||i.open.value),u=E(a.value);let p;function f(){p&&(clearTimeout(p),p=void 0)}return de(a,(d,c,m)=>{f(),p=setTimeout(()=>{u.value=a.value,p=void 0}),m(f)}),Ht(f),(d,c)=>{var m;return a.value||u.value||(m=s.value)!=null&&m.present?($(),L(w(Sn),{key:0,ref_key:"presenceRef",ref:s,present:a.value},{default:R(()=>[N(wr,Wt(jt({...w(r),...d.$attrs})),{default:R(()=>[V(d.$slots,"default")]),_:3},16)]),_:3},8,["present"])):l.value?($(),J("div",Pr,[($(),L(Mn,{to:l.value},[N(Ar,{context:w(i)},{default:R(()=>[V(d.$slots,"default")]),_:3},8,["context"])],8,["to"]))])):Ee("v-if",!0)}}}),Er=Or;const[an,qr]=Ce("SelectItem");var Rr=k({__name:"SelectItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{disabled:r}=it(n),i=ve(),l=je(),{forwardRef:s,currentElement:a}=me(),{CollectionItem:u}=Te(),p=q(()=>{var h;return Me((h=i.modelValue)==null?void 0:h.value,n.value,i.by)}),f=E(!1),d=E(n.textValue??""),c=Lt(void 0,"reka-select-item-text"),m="select.select";async function y(h){if(h.defaultPrevented)return;const S={originalEvent:h,value:n.value};Cn(m,x,S)}async function x(h){await Pe(),o("select",h),!h.defaultPrevented&&(r.value||(i.onValueChange(n.value),i.multiple.value||i.onOpenChange(!1)))}async function _(h){var S,v;await Pe(),!h.defaultPrevented&&(r.value?(S=l.onItemLeave)==null||S.call(l):(v=h.currentTarget)==null||v.focus({preventScroll:!0}))}async function g(h){var S;await Pe(),!h.defaultPrevented&&h.currentTarget===Vt()&&((S=l.onItemLeave)==null||S.call(l))}async function C(h){var v;await Pe(),!(h.defaultPrevented||((v=l.searchRef)==null?void 0:v.value)!==""&&h.key===" ")&&(ar.includes(h.key)&&y(h),h.key===" "&&h.preventDefault())}if(n.value==="")throw new Error("A <SelectItem /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return he(()=>{a.value&&l.itemRefCallback(a.value,n.value,n.disabled)}),qr({value:n.value,disabled:r,textId:c,isSelected:p,onItemTextChange:h=>{d.value=((d.value||(h==null?void 0:h.textContent))??"").trim()}}),(h,S)=>($(),L(w(u),{value:{textValue:d.value}},{default:R(()=>[N(w(Y),{ref:w(s),role:"option","aria-labelledby":w(c),"data-highlighted":f.value?"":void 0,"aria-selected":p.value,"data-state":p.value?"checked":"unchecked","aria-disabled":w(r)||void 0,"data-disabled":w(r)?"":void 0,tabindex:w(r)?void 0:-1,as:h.as,"as-child":h.asChild,onFocus:S[0]||(S[0]=v=>f.value=!0),onBlur:S[1]||(S[1]=v=>f.value=!1),onPointerup:y,onPointerdown:S[2]||(S[2]=v=>{v.currentTarget.focus({preventScroll:!0})}),onTouchend:S[3]||(S[3]=Oe(()=>{},["prevent","stop"])),onPointermove:_,onPointerleave:g,onKeydown:C},{default:R(()=>[V(h.$slots,"default")]),_:3},8,["aria-labelledby","data-highlighted","aria-selected","data-state","aria-disabled","data-disabled","tabindex","as","as-child"])]),_:3},8,["value"]))}}),Tr=Rr,$r=k({__name:"SelectItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,n=an();return(o,r)=>w(n).isSelected.value?($(),L(w(Y),ne({key:0,"aria-hidden":"true"},t),{default:R(()=>[V(o.$slots,"default")]),_:3},16)):Ee("v-if",!0)}}),Br=$r,kr=k({inheritAttrs:!1,__name:"SelectItemText",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,n=ve(),o=je(),r=an(),{forwardRef:i,currentElement:l}=me(),s=q(()=>{var a,u;return{value:r.value,disabled:r.disabled.value,textContent:((a=l.value)==null?void 0:a.textContent)??((u=r.value)==null?void 0:u.toString())??""}});return he(()=>{l.value&&(r.onItemTextChange(l.value),o.itemTextRefCallback(l.value,r.value,r.disabled.value),n.onOptionAdd(s.value))}),Ht(()=>{n.onOptionRemove(s.value)}),(a,u)=>($(),L(w(Y),ne({id:w(r).textId,ref:w(i)},{...t,...a.$attrs}),{default:R(()=>[V(a.$slots,"default")]),_:3},16,["id"]))}}),Ir=kr,Dr=k({__name:"SelectPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,o)=>($(),L(w(_n),Wt(jt(t)),{default:R(()=>[V(n.$slots,"default")]),_:3},16))}}),Mr=Dr,Vr=k({__name:"SelectTrigger",props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=ve(),{forwardRef:o,currentElement:r}=me(),i=q(()=>{var d;return((d=n.disabled)==null?void 0:d.value)||t.disabled});n.contentId||(n.contentId=Lt(void 0,"reka-select-content")),he(()=>{n.onTriggerChange(r.value)});const{getItems:l}=Te(),{search:s,handleTypeaheadSearch:a,resetTypeahead:u}=Ut();function p(){i.value||(n.onOpenChange(!0),u())}function f(d){p(),n.triggerPointerDownPosRef.value={x:Math.round(d.pageX),y:Math.round(d.pageY)}}return(d,c)=>($(),L(w(to),{"as-child":"",reference:d.reference},{default:R(()=>{var m,y,x,_;return[N(w(Y),{ref:w(o),role:"combobox",type:d.as==="button"?"button":void 0,"aria-controls":w(n).contentId,"aria-expanded":w(n).open.value||!1,"aria-required":(m=w(n).required)==null?void 0:m.value,"aria-autocomplete":"none",disabled:i.value,dir:(y=w(n))==null?void 0:y.dir.value,"data-state":(x=w(n))!=null&&x.open.value?"open":"closed","data-disabled":i.value?"":void 0,"data-placeholder":w(ur)((_=w(n).modelValue)==null?void 0:_.value)?"":void 0,"as-child":d.asChild,as:d.as,onClick:c[0]||(c[0]=g=>{var C;(C=g==null?void 0:g.currentTarget)==null||C.focus()}),onPointerdown:c[1]||(c[1]=g=>{if(g.pointerType==="touch")return g.preventDefault();const C=g.target;C.hasPointerCapture(g.pointerId)&&C.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&(f(g),g.preventDefault())}),onPointerup:c[2]||(c[2]=Oe(g=>{g.pointerType==="touch"&&f(g)},["prevent"])),onKeydown:c[3]||(c[3]=g=>{const C=w(s)!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&C&&g.key===" "||(w(a)(g.key,w(l)()),w(sr).includes(g.key)&&(p(),g.preventDefault()))})},{default:R(()=>[V(d.$slots,"default")]),_:3},8,["type","aria-controls","aria-expanded","aria-required","disabled","dir","data-state","data-disabled","data-placeholder","as-child","as"])]}),_:3},8,["reference"]))}}),Lr=Vr,Fr=k({__name:"SelectViewport",props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{nonce:n}=it(t),o=lr(n),r=je(),i=r.position==="item-aligned"?xr():void 0,{forwardRef:l,currentElement:s}=me();he(()=>{r==null||r.onViewportChange(s.value)});const a=E(0);function u(p){const f=p.currentTarget,{shouldExpandOnScrollRef:d,contentWrapper:c}=i??{};if(d!=null&&d.value&&(c!=null&&c.value)){const m=Math.abs(a.value-f.scrollTop);if(m>0){const y=window.innerHeight-j*2,x=Number.parseFloat(c.value.style.minHeight),_=Number.parseFloat(c.value.style.height),g=Math.max(x,_);if(g<y){const C=g+m,h=Math.min(y,C),S=C-h;c.value.style.height=`${h}px`,c.value.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,c.value.style.justifyContent="flex-end")}}}a.value=f.scrollTop}return(p,f)=>($(),J(lt,null,[N(w(Y),ne({ref:w(l),"data-reka-select-viewport":"",role:"presentation"},{...p.$attrs,...t},{style:{position:"relative",flex:1,overflow:"hidden auto"},onScroll:u}),{default:R(()=>[V(p.$slots,"default")]),_:3},16),N(w(Y),{as:"style",nonce:w(o)},{default:R(()=>f[0]||(f[0]=[Kt(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } ")])),_:1,__:[0]},8,["nonce"])],64))}}),Nr=Fr;const zr={class:"selm-value"},Hr={key:0,class:"selm-hint"},Xr=k({__name:"SelectMenu",props:Ln({options:{},label:{},disabled:{type:Boolean},placeholder:{},id:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Vn(e,"modelValue");return(n,o)=>($(),L(w(fr),{modelValue:t.value,"onUpdate:modelValue":o[0]||(o[0]=r=>t.value=r),disabled:e.disabled},{default:R(()=>[N(w(Lr),{id:e.id,class:"selm-trigger","aria-label":e.label},{default:R(()=>{var r;return[xe("span",zr,Ge(((r=e.options.find(i=>i.value===t.value))==null?void 0:r.label)??e.placeholder??"—"),1),o[1]||(o[1]=xe("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true",class:"selm-caret"},[xe("path",{d:"m6 9 6 6 6-6",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))]}),_:1},8,["id","aria-label"]),N(w(Mr),null,{default:R(()=>[N(w(Er),{class:"selm-list",position:"popper","side-offset":6},{default:R(()=>[N(w(Nr),null,{default:R(()=>[($(!0),J(lt,null,zt(e.options,r=>($(),L(w(Tr),{key:r.value,value:r.value,class:"selm-opt"},{default:R(()=>[N(w(Ir),null,{default:R(()=>[Kt(Ge(r.label),1)]),_:2},1024),r.hint?($(),J("span",Hr,Ge(r.hint),1)):Ee("",!0),N(w(Br),{class:"selm-tick"},{default:R(()=>[...o[2]||(o[2]=[xe("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},[xe("path",{d:"m5 13 4 4L19 7",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),_:1})]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","disabled"]))}});export{Xr as _};
2
- //# sourceMappingURL=SelectMenu.vue_vue_type_script_setup_true_lang-CLqZAezG.js.map