import{J as _}from"./index-UcVXCjOs.js";import{a4 as D,i as a,an as E,a6 as H,M as v,f as J,g as j,w as y,P as h}from"./app-JmgyQoR0.js";import{M as u}from"./MkKeyValue-qNXtpS4q.js";import{F as K}from"./split-mI9ZWkMh.js";import{b as O,c as p,a as g,w as z,D as m,h as M,i as I,j as e,l as t,K as s,E as l,z as o,t as U,F as W,H as q,u as B}from"./vue-y3KLWBaS.js";const G=B("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1),L=B("i",{class:"ph-trash ph-bold ph-lg"},null,-1),$=O({__name:"registry.value",props:{path:{}},setup(x){const d=x,i=p(()=>d.path.split("/").slice(0,-1)),c=p(()=>d.path.split("/").at(-1));let k=g(null),n=g(null);function C(){J("i/registry/get-detail",{scope:i.value,key:c.value}).then(r=>{k.value=r,n.value=_.stringify(r.value,null,"	")})}async function V(){try{_.parse(n.value)}catch(r){j({type:"error",text:a.ts.invalidValue});return}y({type:"warning",text:a.ts.saveConfirm}).then(({canceled:r})=>{r||h("i/registry/set",{scope:i.value,key:c.value,value:_.parse(n.value)})})}function b(){y({type:"warning",text:a.ts.deleteConfirm}).then(({canceled:r})=>{r||h("i/registry/remove",{scope:i.value,key:c.value})})}z(()=>d.path,C,{immediate:!0});const S=p(()=>[]),w=p(()=>[]);return D({title:a.ts.registry,icon:"ph-gear-six ph-bold ph-lg"}),(r,f)=>{const N=m("MkPageHeader"),T=m("MkTime"),F=m("MkSpacer"),A=m("MkStickyContainer");return M(),I(A,null,{header:e(()=>[t(N,{actions:S.value,tabs:w.value},null,8,["actions","tabs"])]),default:e(()=>[t(F,{"content-max":600,"margin-min":16},{default:e(()=>[t(E,{warn:""},{default:e(()=>[s(l(o(a).ts.editTheseSettingsMayBreakAccount),1)]),_:1}),k.value?(M(),U(W,{key:0},[t(K,null,{default:e(()=>[t(u,{class:"_formBlock"},{key:e(()=>[s(l(o(a).ts._registry.domain),1)]),value:e(()=>[s(l(o(a).ts.system),1)]),_:1}),t(u,{class:"_formBlock"},{key:e(()=>[s(l(o(a).ts._registry.scope),1)]),value:e(()=>[s(l(i.value.join("/")),1)]),_:1}),t(u,{class:"_formBlock"},{key:e(()=>[s(l(o(a).ts._registry.key),1)]),value:e(()=>[s(l(c.value),1)]),_:1})]),_:1}),t(H,{modelValue:n.value,"onUpdate:modelValue":f[0]||(f[0]=P=>n.value=P),tall:"",class:"_formBlock _monospace"},{label:e(()=>[s(l(o(a).ts.value)+" (JSON)",1)]),_:1},8,["modelValue"]),t(v,{class:"_formBlock",primary:"",onClick:V},{default:e(()=>[G,s(" "+l(o(a).ts.save),1)]),_:1}),t(u,{class:"_formBlock"},{key:e(()=>[s(l(o(a).ts.updatedAt),1)]),value:e(()=>[t(T,{time:k.value.updatedAt,mode:"detail"},null,8,["time"])]),_:1}),t(v,{danger:"",onClick:b},{default:e(()=>[L,s(" "+l(o(a).ts.delete),1)]),_:1})],64)):q("",!0)]),_:1})]),_:1})}}});export{$ as default};
