var _=(e,s,t)=>new Promise((i,P)=>{var c=r=>{try{p(t.next(r))}catch(n){P(n)}},T=r=>{try{p(t.throw(r))}catch(n){P(n)}},p=r=>r.done?i(r.value):Promise.resolve(r.value).then(c,T);p((t=t.apply(e,s)).next())});import{d9 as S,da as o,C as E,N as u,E as a}from"./index-6OExHM45.js";const h=()=>S.request("get",o("/server")),I=e=>S.request("post",o("/server"),{data:e}),C=()=>S.request("get",o("/setting/server")),R=e=>S.request("post",o("/setting/server-global"),{data:e}),b=()=>S.request("get",o("/setting/public-ip")),g=E({id:"pure-server",state:()=>({id:"",ipScope:"",listenPort:0,privateKey:"",publicKey:"",postUpScript:"",preDownScript:"",postDownScript:""}),getters:{getServerInfo(e){return e}},actions:{SET_ID(e){this.id=e},SET_IP_SCOPE(e){this.ipScope=e},SET_LISTEN_PORT(e){this.listenPort=e},SET_PRIVATE_KEY(e){this.privateKey=e},SET_PUBLIC_KEY(e){this.publicKey=e},SET_POST_UP_SCRIPT(e){this.postUpScript=e},SET_PRE_UP_SCRIPT(e){this.preDownScript=e},SET_POST_DOWN_SCRIPT(e){this.postDownScript=e},getServerApi(){return _(this,null,function*(){return new Promise((e,s)=>{h().then(t=>{t.code===200&&(this.SET_ID(t.data.id),this.SET_IP_SCOPE(t.data.ipScope),this.SET_LISTEN_PORT(t.data.listenPort),this.SET_PRIVATE_KEY(t.data.privateKey),this.SET_PUBLIC_KEY(t.data.publicKey),this.SET_POST_UP_SCRIPT(t.data.postUpScript),this.SET_PRE_UP_SCRIPT(t.data.preDownScript),this.SET_POST_DOWN_SCRIPT(t.data.postDownScript)),u().setItem("server-info",t.data),e(t)}).catch(t=>{s(t)})})})},updateServerApi(e){return _(this,null,function*(){return new Promise((s,t)=>{I(e).then(i=>{s(i)}).catch(i=>{t(i)})})})}}});function d(){return g(a)}export{R as a,b,C as g,d as u};