var h=Object.defineProperty;var v=(a,t,e)=>t in a?h(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var r=(a,t,e)=>(v(a,typeof t!="symbol"?t+"":t,e),e);import{d as m,r as d,i as g,S as u,o as b,c as S,a as s,e as _,k as l,p,n as x,D as f}from"../index.js";import"../vendor.js";class w{constructor(){r(this,"apiKey","")}}const k={class:"row"},K={class:"col-sm-12"},B={class:"card"},A={class:"card-header"},P=["disabled"],T=s("span",{class:"fa fa-sync"},null,-1),U=s("h3",null,"Security settings",-1),$={class:"card-body col-md-6 offset-md-6"},C=s("i",{class:"fa-3x fas fa-circle-notch fa-spin"},null,-1),I=[C],N={class:"list-group"},V={class:"list-group-item"},D={class:"form-group"},M=s("label",{for:"apiKey",class:"control-label"},"API Key",-1),j=s("small",{id:"apiKeyHelp",class:"form-text text-muted"}," This is the API key that can be used by external applications to consume Authority Server APIs ",-1),E={class:"list-group-item clearfix"},H={class:"float-right"},J=s("i",{class:"fa fa-save"},null,-1),z=m({__name:"Security",setup(a){const t=d(!1),e=d(new w);g(async()=>{await i()});async function i(){t.value=!0;try{const o=await(await fetch(`${u.settingsBaseUrl}/security`)).json();e.value=o.result}finally{t.value=!1}}async function y(){(await fetch(`${u.settingsBaseUrl}/security`,{method:"PUT",body:JSON.stringify(e.value)})).ok?f({type:"success",text:"Security settings saved."}):f({type:"error",text:"Security settings could not be saved."}),await i()}return(c,o)=>(b(),S("div",k,[s("div",K,[s("div",B,[s("div",A,[s("button",{class:"btn btn-sm btn-link float-right",disabled:t.value,onClick:o[0]||(o[0]=n=>i())},[T,_(" Refresh ")],8,P),U]),l(s("div",$,I,512),[[p,t.value]]),l(s("div",null,[s("ul",N,[s("li",V,[s("div",D,[M,l(s("input",{class:"form-control",id:"apiKey","onUpdate:modelValue":o[1]||(o[1]=n=>e.value.apiKey=n)},null,512),[[x,e.value.apiKey]]),j])]),s("li",E,[s("div",H,[s("button",{type:"button",onClick:o[2]||(o[2]=n=>y()),class:"btn btn-success"},[J,_(" Save")])])])])],512),[[p,!t.value]])])])]))}});export{z as default};
