import{B as e,Bt as t,Dt as n,G as r,L as i,Mt as a,N as o,R as s,T as c,Tt as l,Ut as u,bt as d,ot as f,qt as p,w as m,y as h}from"./vue-3bs2-dMU.js";import{K as g,U as _}from"./stores-DmetsdTd.js";import{C as v,D as y,K as b,S as x,b as S,ht as C,w,y as T}from"./vuetify-gGrfRH2I.js";r(),l(),h(),u();var E=e({__name:`ImportSettingsDialog`,props:{guid:{}},setup(e){let r=e,{t:l}=g(),{isOpened:u}=_(r.guid),h=a(),E=a(!1),D=a(``),O=[e=>!!e||l(`dialogs.importSettings.required`),e=>{try{JSON.parse(e)}catch{return l(`dialogs.importSettings.valid`)}return!0}];function k(){u.value=!1}async function A(){await h.value?.validate(),E.value&&(localStorage.setItem(`vuetorrent_webuiSettings`,D.value),location.reload())}return(e,r)=>(f(),o(x,{modelValue:t(u),"onUpdate:modelValue":r[3]||=e=>n(u)?u.value=e:null,"max-width":`500`},{default:d(()=>[s(v,{title:e.$t(`dialogs.importSettings.title`)},{default:d(()=>[s(w,null,{default:d(()=>[s(t(T),{ref_key:`form`,ref:h,modelValue:E.value,"onUpdate:modelValue":r[1]||=e=>E.value=e,onSubmit:r[2]||=c(()=>{},[`prevent`]),onKeydown:m(c(A,[`prevent`]),[`enter`])},{default:d(()=>[s(S,{modelValue:D.value,"onUpdate:modelValue":r[0]||=e=>D.value=e,clearable:``,rules:O},null,8,[`modelValue`])]),_:1},8,[`modelValue`,`onKeydown`])]),_:1}),s(y,null,{default:d(()=>[s(C),s(b,{color:`error`,onClick:k},{default:d(()=>[i(p(e.$t(`common.cancel`)),1)]),_:1}),s(b,{color:`accent`,disabled:!E.value,onClick:A},{default:d(()=>[i(p(e.$t(`common.save`)),1)]),_:1},8,[`disabled`])]),_:1})]),_:1},8,[`title`])]),_:1},8,[`modelValue`]))}});export{E as default};