import{i as o,a5 as x,M as E,_ as W,f as $,P as H,bx as I,a4 as q,a2 as B,a6 as G}from"./app-JmgyQoR0.js";import{_ as J}from"./radios.vue_vue_type_style_index_0_lang-1Sn__6GZ.js";import{F}from"./suspense-lwY0NW4i.js";import{F as U}from"./slot-skomV0Er.js";import{b as D,a as i,h as V,t as K,l,j as e,u as n,E as s,z as t,F as w,K as a,i as M,H as C,d as Q,c as A,D as P,a0 as R}from"./vue-y3KLWBaS.js";import{F as S}from"./folder-DNqDLK_K.js";import"./radio-F8oq6XnD.js";const X={class:"_formRoot"},Y={value:null},Z=n("option",{value:"hcaptcha"},"hCaptcha",-1),ee=n("option",{value:"recaptcha"},"reCAPTCHA",-1),ae=n("i",{class:"ph-key ph-bold ph-lg"},null,-1),le=n("i",{class:"ph-key ph-bold ph-lg"},null,-1),te=n("i",{class:"ph-key ph-bold ph-lg"},null,-1),oe=n("i",{class:"ph-key ph-bold ph-lg"},null,-1),se=n("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1),ne=D({__name:"bot-protection",setup(L){const b=Q(()=>W(()=>import("./MkCaptcha-QGoR8_i9.js"),__vite__mapDeps([0,1,2,3,4])));let m=i(null),k=i(null),f=i(null),u=i(null),_=i(null);async function y(){const v=await $("admin/meta");k.value=v.hcaptchaSiteKey,f.value=v.hcaptchaSecretKey,u.value=v.recaptchaSiteKey,_.value=v.recaptchaSecretKey,m.value=v.enableHcaptcha?"hcaptcha":v.enableRecaptcha?"recaptcha":null}function g(){H("admin/update-meta",{enableHcaptcha:m.value==="hcaptcha",hcaptchaSiteKey:k.value,hcaptchaSecretKey:f.value,enableRecaptcha:m.value==="recaptcha",recaptchaSiteKey:u.value,recaptchaSecretKey:_.value}).then(()=>{I()})}return(v,c)=>(V(),K("div",null,[l(F,{p:y},{default:e(()=>[n("div",X,[l(J,{modelValue:m.value,"onUpdate:modelValue":c[0]||(c[0]=p=>m.value=p),class:"_formBlock"},{default:e(()=>[n("option",Y,s(t(o).ts.none)+" ("+s(t(o).ts.notRecommended)+") ",1),Z,ee]),_:1},8,["modelValue"]),m.value==="hcaptcha"?(V(),K(w,{key:0},[l(x,{modelValue:k.value,"onUpdate:modelValue":c[1]||(c[1]=p=>k.value=p),class:"_formBlock"},{prefix:e(()=>[ae]),label:e(()=>[a(s(t(o).ts.hcaptchaSiteKey),1)]),_:1},8,["modelValue"]),l(x,{modelValue:f.value,"onUpdate:modelValue":c[2]||(c[2]=p=>f.value=p),class:"_formBlock"},{prefix:e(()=>[le]),label:e(()=>[a(s(t(o).ts.hcaptchaSecretKey),1)]),_:1},8,["modelValue"]),l(U,{class:"_formBlock"},{label:e(()=>[a(s(t(o).ts.preview),1)]),default:e(()=>[l(t(b),{provider:"hcaptcha",sitekey:k.value||"10000000-ffff-ffff-ffff-000000000001"},null,8,["sitekey"])]),_:1})],64)):m.value==="recaptcha"?(V(),K(w,{key:1},[l(x,{modelValue:u.value,"onUpdate:modelValue":c[3]||(c[3]=p=>u.value=p),class:"_formBlock"},{prefix:e(()=>[te]),label:e(()=>[a(s(t(o).ts.recaptchaSiteKey),1)]),_:1},8,["modelValue"]),l(x,{modelValue:_.value,"onUpdate:modelValue":c[4]||(c[4]=p=>_.value=p),class:"_formBlock"},{prefix:e(()=>[oe]),label:e(()=>[a(s(t(o).ts.recaptchaSecretKey),1)]),_:1},8,["modelValue"]),u.value?(V(),M(U,{key:0,class:"_formBlock"},{label:e(()=>[a(s(t(o).ts.preview),1)]),default:e(()=>[l(t(b),{provider:"recaptcha",sitekey:u.value},null,8,["sitekey"])]),_:1})):C("",!0)],64)):C("",!0),l(E,{primary:"",onClick:g},{default:e(()=>[se,a(" "+s(t(o).ts.save),1)]),_:1})])]),_:1})]))}}),ce={class:"_formRoot"},ie=n("i",{class:"ph-robot ph-bold ph-lg"},null,-1),ue={class:"_formRoot"},de={class:"_formBlock"},pe={class:"_formRoot"},re={class:"_formRoot"},me=n("i",{class:"ph-link-simple ph-bold ph-lg"},null,-1),fe=n("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1),_e={class:"_formRoot"},ve=n("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1),xe=D({__name:"security",setup(L){let b=i(""),m=i(!1),k=i(!1),f=i(!1),u=i(!1),_=i(!1),y=i(!1),g=i("");async function v(){const h=await $("admin/meta");b.value=h.summalyProxy,m.value=h.enableHcaptcha,k.value=h.enableRecaptcha,f.value=h.enableIpLogging,u.value=h.enableActiveEmailValidation,_.value=h.secureMode,y.value=h.privateMode,g.value=h.allowedHosts.join(`
`)}function c(){H("admin/update-meta",{summalyProxy:b.value,enableIpLogging:f.value,enableActiveEmailValidation:u.value}).then(()=>{I()})}function p(){H("admin/update-meta",{secureMode:_.value,privateMode:y.value,allowedHosts:g.value.split(`
`)}).then(()=>{I()})}const T=A(()=>[]),N=A(()=>[]);return q({title:o.ts.security,icon:"ph-lock ph-bold ph-lg"}),(h,d)=>{const j=P("MkPageHeader"),z=P("MkSpacer"),O=P("MkStickyContainer");return V(),M(O,null,{header:e(()=>[l(j,{actions:T.value,tabs:N.value,"display-back-button":!0},null,8,["actions","tabs"])]),default:e(()=>[l(z,{"content-max":700,"margin-min":16,"margin-max":32},{default:e(()=>[l(F,{p:v},{default:e(()=>[n("div",ce,[l(S,{class:"_formBlock"},R({icon:e(()=>[ie]),label:e(()=>[a(s(t(o).ts.botProtection),1)]),default:e(()=>[l(ne)]),_:2},[m.value?{name:"suffix",fn:e(()=>[a("hCaptcha")]),key:"0"}:k.value?{name:"suffix",fn:e(()=>[a("reCAPTCHA")]),key:"1"}:{name:"suffix",fn:e(()=>[a(s(t(o).ts.none)+" ("+s(t(o).ts.notRecommended)+")",1)]),key:"2"}]),1024),l(S,{class:"_formBlock"},R({label:e(()=>[a("Active Email Validation")]),default:e(()=>[n("div",ue,[n("span",de,s(t(o).ts.activeEmailValidationDescription),1),l(B,{modelValue:u.value,"onUpdate:modelValue":[d[0]||(d[0]=r=>u.value=r),c],class:"_formBlock"},{label:e(()=>[a("Enable")]),_:1},8,["modelValue"])])]),_:2},[u.value?{name:"suffix",fn:e(()=>[a("Enabled")]),key:"0"}:{name:"suffix",fn:e(()=>[a("Disabled")]),key:"1"}]),1024),l(S,{class:"_formBlock"},R({label:e(()=>[a("Log IP address")]),default:e(()=>[n("div",pe,[l(B,{modelValue:f.value,"onUpdate:modelValue":[d[1]||(d[1]=r=>f.value=r),c],class:"_formBlock"},{label:e(()=>[a("Enable")]),_:1},8,["modelValue"])])]),_:2},[f.value?{name:"suffix",fn:e(()=>[a("Enabled")]),key:"0"}:{name:"suffix",fn:e(()=>[a("Disabled")]),key:"1"}]),1024),l(S,{class:"_formBlock"},{label:e(()=>[a("Summaly Proxy")]),default:e(()=>[n("div",re,[l(x,{modelValue:b.value,"onUpdate:modelValue":d[2]||(d[2]=r=>b.value=r),class:"_formBlock"},{prefix:e(()=>[me]),label:e(()=>[a("Summaly Proxy URL")]),_:1},8,["modelValue"]),l(E,{primary:"",class:"_formBlock",onClick:c},{default:e(()=>[fe,a(" "+s(t(o).ts.save),1)]),_:1})])]),_:1}),l(S,{class:"_formBlock"},{label:e(()=>[a(s(t(o).ts.instanceSecurity),1)]),default:e(()=>[n("div",_e,[y.value?C("",!0):(V(),M(B,{key:0,modelValue:_.value,"onUpdate:modelValue":d[3]||(d[3]=r=>_.value=r)},{label:e(()=>[a(s(t(o).ts.secureMode),1)]),caption:e(()=>[a(s(t(o).ts.secureModeInfo),1)]),_:1},8,["modelValue"])),l(B,{modelValue:y.value,"onUpdate:modelValue":d[4]||(d[4]=r=>y.value=r)},{label:e(()=>[a(s(t(o).ts.privateMode),1)]),caption:e(()=>[a(s(t(o).ts.privateModeInfo),1)]),_:1},8,["modelValue"]),y.value?(V(),M(G,{key:1,modelValue:g.value,"onUpdate:modelValue":d[5]||(d[5]=r=>g.value=r)},{label:e(()=>[a(s(t(o).ts.allowedInstances),1)]),caption:e(()=>[a(s(t(o).ts.allowedInstancesDescription),1)]),_:1},8,["modelValue"])):C("",!0),l(E,{primary:"",class:"_formBlock",onClick:p},{default:e(()=>[ve,a(" "+s(t(o).ts.save),1)]),_:1})])]),_:1})])]),_:1})]),_:1})]),_:1})}}});export{xe as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = ["MkCaptcha-QGoR8_i9.js","MkCaptcha.vue_vue_type_script_setup_true_lang-lipTeJ2f.js","app-JmgyQoR0.js","vue-y3KLWBaS.js","app-9iivmIpH.css"]
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}