import{u as e}from"./index-yiIyVSv0.js";import{a}from"./setting-BuW_WiRV.js";import{m as t,s as o,r as l,w as r}from"./main-D8Z-8iPZ.js";import{u as s}from"./index-Cc_zz0Ev.js";import{b as n}from"./access-DymwmDzp.js";const i=t("layout-store",(()=>{const{handleError:t}=e(),o=s("layout-collapsed",!1),i=l([]),u=l([]),c=s("menu-active","home"),v=r((()=>"home"!==c.value?"var(--n-content-padding)":"0"));return{locales:s("locales-active","zhCN"),notifyProvider:i,dnsProvider:u,isCollapsed:o,layoutPadding:v,menuActive:c,resetDataInfo:()=>{c.value="home",localStorage.removeItem("menu-active")},updateMenuActive:e=>{"logout"!==e&&(c.value=e)},toggleCollapse:()=>{o.value=!o.value},handleCollapse:()=>{o.value=!0},handleExpand:()=>{o.value=!1},fetchNotifyProvider:async()=>{try{const{data:e}=await a({p:1,search:"",limit:1e3}).fetch();i.value=[],i.value=null==e?void 0:e.map((e=>({label:e.name,value:e.id.toString(),type:e.type})))}catch(e){t(e)}},fetchDnsProvider:async(e="")=>{try{const{data:a}=await n({type:e}).fetch();u.value=(null==a?void 0:a.map((e=>({label:e.name,value:e.id.toString(),type:e.type}))))||[]}catch(a){u.value=[],t(a)}}}})),u=()=>{const e=i();return{...e,...o(e)}};export{u};
