import{J as S}from"./index-UcVXCjOs.js";import{a4 as x,i as t,M as B,f as K,q as j,P as w}from"./app-JmgyQoR0.js";import{F as N}from"./link-UF1gGYGD.js";import{F as V}from"./section-yxO0GkeZ.js";import{M as g}from"./MkKeyValue-qNXtpS4q.js";import{F as P}from"./split-mI9ZWkMh.js";import{b as D,c as y,a as H,w as L,D as _,h as c,i as f,j as e,l as o,K as a,E as s,z as n,u as E,t as J,G as O,F as T,H as $}from"./vue-y3KLWBaS.js";const q={class:"_formLinks"},R=D({__name:"registry.keys",props:{path:{}},setup(h){const d=h,i=y(()=>d.path.split("/"));let p=H(null);function k(){K("i/registry/keys-with-type",{scope:i.value}).then(l=>{p.value=Object.entries(l).sort((r,u)=>r[0].localeCompare(u[0]))})}async function v(){const{canceled:l,result:r}=await j(t.ts._registry.createKey,{key:{type:"string",label:t.ts._registry.key},value:{type:"string",multiline:!0,label:t.ts.value},scope:{type:"string",label:t.ts._registry.scope,default:i.value.join("/")}});l||w("i/registry/set",{scope:r.scope.split("/"),key:r.key,value:S.parse(r.value)}).then(()=>{k()})}L(()=>d.path,k,{immediate:!0});const M=y(()=>[]),b=y(()=>[]);return x({title:t.ts.registry,icon:"ph-gear-six ph-bold ph-lg"}),(l,r)=>{const u=_("MkPageHeader"),C=_("MkSpacer"),F=_("MkStickyContainer");return c(),f(F,null,{header:e(()=>[o(u,{actions:M.value,tabs:b.value},null,8,["actions","tabs"])]),default:e(()=>[o(C,{"content-max":600,"margin-min":16},{default:e(()=>[o(P,null,{default:e(()=>[o(g,{class:"_formBlock"},{key:e(()=>[a(s(n(t).ts._registry.domain),1)]),value:e(()=>[a(s(n(t).ts.system),1)]),_:1}),o(g,{class:"_formBlock"},{key:e(()=>[a(s(n(t).ts._registry.scope),1)]),value:e(()=>[a(s(i.value.join("/")),1)]),_:1})]),_:1}),o(B,{primary:"",onClick:v},{default:e(()=>[a(s(n(t).ts._registry.createKey),1)]),_:1}),p.value?(c(),f(V,{key:0},{label:e(()=>[a(s(n(t).ts.keys),1)]),default:e(()=>[E("div",q,[(c(!0),J(T,null,O(p.value,m=>(c(),f(N,{to:`/registry/value/system/${i.value.join("/")}/${m[0]}`,class:"_monospace"},{suffix:e(()=>[a(s(m[1].toUpperCase()),1)]),default:e(()=>[a(s(m[0]),1)]),_:2},1032,["to"]))),256))])]),_:1})):$("",!0)]),_:1})]),_:1})}}});export{R as default};
