import{ax as x,g as v,ak as g,ay as l}from"./index-3ac32eb9.js";const A=x("tagsView",()=>{const t=v([]),n=v([]);function r(e){var i,s;t.value.some(a=>a.path===e.path)||(e.meta&&e.meta.affix?t.value.unshift(Object.assign({},e,{title:((i=e.meta)==null?void 0:i.title)||"no-name"})):t.value.push(Object.assign({},e,{title:((s=e.meta)==null?void 0:s.title)||"no-name"})))}function o(e){var s;const i=e.name;n.value.includes(i)||(s=e.meta)!=null&&s.keepAlive&&n.value.push(i)}function c(e){return new Promise(i=>{for(const[s,a]of t.value.entries())if(a.path===e.path){t.value.splice(s,1);break}i([...t.value])})}function f(e){const i=e.name;return new Promise(s=>{const a=n.value.indexOf(i);a>-1&&n.value.splice(a,1),s([...n.value])})}function h(e){return new Promise(i=>{t.value=t.value.filter(s=>{var a;return((a=s.meta)==null?void 0:a.affix)||s.path===e.path}),i([...t.value])})}function w(e){const i=e.name;return new Promise(s=>{const a=n.value.indexOf(i);a>-1?n.value=n.value.slice(a,a+1):n.value=[],s([...n.value])})}function m(e){for(let i of t.value)if(i.path===e.path){i=Object.assign(i,e);break}}function u(e){r(e),o(e)}function p(e){return new Promise(i=>{c(e),f(e),i({visitedViews:[...t.value],cachedViews:[...n.value]})})}function b(e){return new Promise(i=>{h(e),w(e),i({visitedViews:[...t.value],cachedViews:[...n.value]})})}function k(e){return new Promise(i=>{const s=t.value.findIndex(a=>a.path===e.path);s!==-1&&(t.value=t.value.filter((a,V)=>{if(V>=s||a.meta&&a.meta.affix)return!0;const d=n.value.indexOf(a.name);return d>-1&&n.value.splice(d,1),!1}),i({visitedViews:[...t.value]}))})}function P(e){return new Promise(i=>{const s=t.value.findIndex(a=>a.path===e.path);s!==-1&&(t.value=t.value.filter((a,V)=>{if(V<=s||a.meta&&a.meta.affix)return!0;const d=n.value.indexOf(a.name);return d>-1&&n.value.splice(d,1),!1}),i({visitedViews:[...t.value]}))})}function O(){return new Promise(e=>{const i=t.value.filter(s=>{var a;return(a=s.meta)==null?void 0:a.affix});t.value=i,n.value=[],e({visitedViews:[...t.value],cachedViews:[...n.value]})})}function S(){return new Promise(e=>{const i=t.value.filter(s=>{var a;return(a=s.meta)==null?void 0:a.affix});t.value=i,e([...t.value])})}function y(){return new Promise(e=>{n.value=[],e([...n.value])})}return{visitedViews:t,cachedViews:n,addVisitedView:r,addCachedView:o,delVisitedView:c,delCachedView:f,delOtherVisitedViews:h,delOtherCachedViews:w,updateVisitedView:m,addView:u,delView:p,delOtherViews:b,delLeftViews:k,delRightViews:P,delAllViews:O,delAllVisitedViews:S,delAllCachedViews:y}}),C=x("setting",()=>{const t=g("tagsView",l.tagsView),n=v(l.showSettings),r=v(l.fixedHeader),o=v(l.sidebarLogo),c=g("layout",l.layout),f=g("theme",l.theme);function h(w){const{key:m,value:u}=w;switch(m){case"theme":f.value=u;break;case"showSettings":n.value=u;break;case"fixedHeader":r.value=u;break;case"tagsView":t.value=u;break;case"sidevarLogo":o.value=u;break;case"layout":c.value=u;break}}return{showSettings:n,tagsView:t,fixedHeader:r,sidebarLogo:o,layout:c,theme:f,changeSetting:h}});export{C as a,A as u};
