1import{j as m,Q as g,m as h,P as c}from"./CoOMV6Kh.js";async function o(t,e={}){const u=m().public.apiBaseUrl;try{return{data:await $fetch(u+t,{...e,credentials:"include",headers:{Accept:"application/json",...e.headers}}),error:null}}catch(a){const r=a?.response?.status??a?.statusCode??0,s=a?.data??a?.response?._data??{};return{data:null,error:{statusCode:r,data:s}}}}var n;(t=>{t.login=e=>o("/auth/login",{method:"POST",body:e}),t.logout=()=>o("/auth/logout",{method:"POST"}),t.verifyTwoFactor=e=>o("/auth/two-factor/verify",{method:"POST",body:e}),t.me=()=>o("/auth/me"),t.preRegister=e=>o("/auth/pre-register",{method:"POST",body:e}),t.getPreRegisterEmail=e=>o(`/auth/pre-register/email?registerCode=${encodeURIComponent(e.registerCode)}`),t.register=e=>o("/auth/register",{method:"POST",body:e}),t.postPasswordResetRequest=e=>o("/auth/password-reset/request",{method:"POST",body:e}),t.postPasswordResetVerify=e=>o("/auth/password-reset/verify",{method:"POST",body:e}),t.postPasswordReset=e=>o("/auth/password-reset",{method:"POST",body:e})})(n||(n={}));var d;(t=>{t.getSettings=()=>o("/account",{method:"GET"}),t.update=e=>o("/account",{method:"PATCH",body:e}),t.getSocialAccounts=()=>o("/account/social",{method:"GET"}),t.unlinkSocial=e=>o(`/account/social/${e}`,{method:"DELETE"}),t.postNewEmailRequest=e=>o("/account/email/change/send",{method:"POST",body:e}),t.verifyNewEmailRequest=e=>o("/account/email/change/verify",{method:"POST",body:e}),t.putNewPassword=e=>o("/account/password",{method:"PUT",body:e}),t.getPhoneNumber=()=>o("/account/phone",{method:"GET"}),t.postPhoneNumber=e=>o("/account/sms/setting/send",{method:"POST",body:e}),t.verifyPhoneNumber=e=>o("/account/sms/setting/verify",{method:"POST",body:e}),t.getTwoFactorSetting=()=>o("/account/2fa/setting",{method:"GET"}),t.postTwoFactorCode=e=>o("/account/2fa/setting/send",{method:"POST",body:e}),t.postVerifyTwoFactorCode=e=>o("/account/2fa/setting/verify",{method:"POST",body:e}),t.postDeactiveTwoFactorSetting=e=>o("/account/2fa/setting/deactive",{method:"POST",body:e})})(d||(d={}));const P=()=>{const t=g("auth:user",()=>null),e=h(()=>t.value!==null);async function i(){const{data:r}=await d.getSettings();if(!r)return;const s=c("locale",{maxAge:3600*24*365,path:"/"}),l=c("timezone",{maxAge:3600*24*365,path:"/"});r.settings.locale&&(s.value=r.settings.locale),r.settings.timezone&&(l.value=r.settings.timezone)}async function u(){const{data:r,error:s}=await n.me();return s||!r?(t.value=null,!1):(t.value=r,await i(),!0)}async function a(r){await n.logout(),t.value=null,r&&(window.location.href=r)}return{user:t,isLoggedIn:e,fetchMe:u,logout:a}};export{d as A,n as a,o as b,P as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.