import{_ as e}from"./public.js?v=1764233927359";import{_ as t}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764233927359";import{d as a}from"./page_layout.js?v=1764233927359";import{aG as l,Y as s}from"./site.js?v=1764233927359";import{dR as i,au as u,_ as r,aC as n}from"./naive.js?v=1764233927359";import{k as d,P as o,t as _,r as p,e as f,R as m,V as c,W as x,U as v,a3 as h,S as b,j as g,a4 as S}from"./vue.js?v=1764233927359";const k={class:"w-300px"},w={class:"w-300px"},$={class:"w-300px"},j={class:"flex flex-col"},C=d({__name:"form",props:{site:{}},emits:["changeHotlink"],setup(d,{expose:C,emit:y}){const{t:R}=o(),U=y,E=_(d,"site"),L=p(null),H=f({fix:"",domains:"",return_rule:"",status:!1,http_status:!1}),z={fix:{trigger:["blur","change"],validator:()=>""!==H.fix.trim()||new Error(R("Site.RulesError.index_330"))},return_rule:{trigger:["blur","change"],validator:()=>""!==H.return_rule.trim()||new Error(R("Site.RulesError.index_330"))}},G=()=>{V()},P=()=>{V()},V=async()=>{var e;await(null==(e=L.value)?void 0:e.validate()),await l({id:E.value.id,name:E.value.name,fix:H.fix,domains:H.domains.trim().split("\n").join(","),return_rule:H.return_rule,status:H.status,http_status:H.http_status}),U("changeHotlink",H.status),W()},W=async()=>{const{message:e}=await s({id:E.value.id,name:E.value.name});a(e)&&(H.fix=e.fix,H.domains=e.domains.split(",").join("\n"),H.return_rule=e.return_rule,H.status=e.status,H.http_status="true"===e.http_status||!0===e.http_status)};return W(),C({init:W}),(a,l)=>{const s=u,d=i,o=r,_=n,p=t,f=e;return c(),m("div",null,[x(p,{ref_key:"formRef",ref:L,class:"px-8px",model:v(H),rules:z},{default:h(()=>[x(d,{label:a.$t("Site.Lable.index_6"),path:"fix"},{default:h(()=>[b("div",k,[x(s,{value:v(H).fix,"onUpdate:value":l[0]||(l[0]=e=>v(H).fix=e),disabled:v(H).status,placeholder:""},null,8,["value","disabled"])])]),_:1},8,["label"]),x(d,{label:a.$t("Site.Lable.index_7")},{default:h(()=>[b("div",w,[x(s,{value:v(H).domains,"onUpdate:value":l[1]||(l[1]=e=>v(H).domains=e),type:"textarea",autosize:{minRows:6,maxRows:6},placeholder:""},null,8,["value"])])]),_:1},8,["label"]),x(d,{label:a.$t("Site.Lable.index_13"),path:"return_rule"},{default:h(()=>[b("div",$,[x(s,{value:v(H).return_rule,"onUpdate:value":l[2]||(l[2]=e=>v(H).return_rule=e),disabled:v(H).status,placeholder:""},null,8,["value","disabled"])])]),_:1},8,["label"]),x(d,{label:" "},{default:h(()=>[b("div",j,[x(o,{checked:v(H).status,"onUpdate:checked":[l[3]||(l[3]=e=>v(H).status=e),G]},{default:h(()=>[g(S(a.$t("Site.Config.index_94")),1)]),_:1},8,["checked"]),x(o,{checked:v(H).http_status,"onUpdate:checked":[l[4]||(l[4]=e=>v(H).http_status=e),P],class:"mt-16px"},{default:h(()=>[g(S(a.$t("Site.Config.index_95")),1)]),_:1},8,["checked"])])]),_:1}),x(d,{label:" ","show-feedback":!1},{default:h(()=>[x(_,{type:"primary",onClick:V},{default:h(()=>[g(S(a.$t("Site.Cert.index_60")),1)]),_:1})]),_:1})]),_:1},8,["model"]),x(f,{class:"mt-20px"},{default:h(()=>[b("li",null,[g(S(a.$t("Site.Config.index_96")),1),l[5]||(l[5]=b("br",null,null,-1)),g(" "+S(a.$t("Site.Config.index_97")),1)]),b("li",null,S(a.$t("Site.Config.index_98")),1),b("li",null,S(a.$t("Site.Config.index_99")),1)]),_:1})])}}});export{C as _};
