import{c as l,o as e,r as a,v as s,x as t,z as p,e as u,B as o,A as i,y as d,F as r,b0 as n,N as c,C as f,ak as m,al as b,T as _,ab as x,a9 as v,G as h}from"./base-lib.js?v=1761009159";import{p as y,P as g,j1 as j,j2 as w,ak as k,j3 as C,_ as V}from"./utils-lib.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const z={class:"px-20px pt-24px pb-8px"},D={class:"mb-20px"},P={class:"w-260px"},q={class:"flex justify-end gap-0 w-full px-18px py-10px border-t border-lighter rounded-b-base bg-light"},I=V(l({__name:"unsubscribe",emits:["close"],setup(l,{expose:V,emit:I}){const U=I,A=e({http:"https://",url:""}),B=a(""),F=a([{label:"http://",value:"http://"},{label:"https://",value:"https://"}]),G=l=>{const{clipboardData:e}=l;if(e){const l=e.getData("text");if(l)if(-1===l.indexOf("://"))A.url=l;else{const e=l.split("://")[0]+"://";A.http=e,A.url=l.replace(e,"")}}l.preventDefault()},H=async()=>{y({title:"恢复默认",content:"确定要恢复默认退订设置吗？",onConfirm:async()=>{g({loading:"正在恢复...",message:!0,request:j(),success:()=>{N()}})}})},N=async()=>{const{data:l}=await w();if(k(l)){if(B.value=l.panel_url,B.value){const l=B.value.split("://")[0]+"://";A.http=l}if(l.url){const e=l.url.split("://")[0]+"://";A.http=e,A.url=l.url.replace(e,"")}}},O=()=>{U("close")},T=async()=>{g({loading:"正在设置...",message:!0,request:C({url:A.http+A.url}),success:()=>{U("close")}})};return N(),V({onConfirm:T}),(l,e)=>{const a=m,y=b,g=_,j=x,w=v,k=h;return s(),t("div",null,[p("div",z,[u(w,{model:d(A),"label-width":"auto"},{default:o(()=>[p("div",D,"链接："+i(d(B)||"--"),1),e[2]||(e[2]=p("div",{class:"mb-20px text-desc"},[p("div",{class:"mb-6px"},"注意："),p("div",{class:"leading-18px text-tertiary text-small"},"默认链接直接使用面板地址访问，用户可以根据IP端口判断出你的面板地址，建议你对原链接反向代理后填入以保证你的面板地址不被泄露。")],-1)),u(j,{label:"新链接：",prop:"url","label-position":"left","label-width":"50px"},{default:o(()=>[p("div",P,[u(g,{modelValue:d(A).url,"onUpdate:modelValue":e[1]||(e[1]=l=>d(A).url=l),class:"w-full",placeholder:"",onPaste:G},{prepend:o(()=>[u(y,{modelValue:d(A).http,"onUpdate:modelValue":e[0]||(e[0]=l=>d(A).http=l),style:{width:"90px"}},{default:o(()=>[(s(!0),t(r,null,n(d(F),l=>(s(),c(a,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])])]),_:1})]),_:1,__:[2]},8,["model"])]),p("div",q,[u(k,{size:"default",onClick:H},{default:o(()=>e[3]||(e[3]=[f(" 恢复默认 ",-1)])),_:1,__:[3]}),u(k,{type:"danger",size:"default",onClick:O},{default:o(()=>e[4]||(e[4]=[f(" 取消 ",-1)])),_:1,__:[4]}),u(k,{type:"primary",size:"default",onClick:T},{default:o(()=>e[5]||(e[5]=[f(" 确定 ",-1)])),_:1,__:[5]})])])}}}),[["__scopeId","data-v-8914c0f7"]]);export{I as default};
