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