
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * https://fantastic-admin.hurui.me
 */
  
import{C as e}from"./reactivity.esm-bundler-D9OPVc9J.js";import{r as t}from"./settings-BmQ0nZoD.js";var n=t(`appKeepAlive`,()=>{let t=e([]);function n(e){typeof e==`string`?!t.value.includes(e)&&t.value.push(e):e.forEach(e=>{e&&!t.value.includes(e)&&t.value.push(e)})}function r(e){typeof e==`string`?t.value=t.value.filter(t=>t!==e):t.value=t.value.filter(t=>!e.includes(t))}function i(){t.value=[]}return{list:t,add:n,remove:r,clean:i}}),r=t(`appTabbar`,()=>{let t=n(),r=e([]),i=e(-1);function a(e){let t=[];e.matched.forEach((e,n)=>{n>0&&e.components?.default.name&&t.push(e.components.default.name)});let n=e.matched.at(-1)?.meta,a=e.fullPath;if(e.name!==`reload`){let o=r.value.find(e=>e.tabId===a);if(o)o.tabId=a,o.fullPath=e.fullPath,o.activeMenu=n?.activeMenu,o.title=typeof n?.title==`function`?n.title():n?.title,o.icon=n?.icon??e.matched?.findLast(e=>e.meta?.icon)?.meta?.icon;else{let o={tabId:a,fullPath:e.fullPath,activeMenu:n?.activeMenu,title:typeof n?.title==`function`?n.title():n?.title,icon:n?.icon??e.matched?.findLast(e=>e.meta?.icon)?.meta?.icon,name:t};i.value>=0?(r.value.splice(i.value+1,0,o),i.value=-1):r.value.push(o)}}}function o(e){let n=[],i=[];r.value.forEach(t=>{t.tabId===e?i.push(...t.name):n.push(...t.name)});let a=[];i.forEach(e=>{n.includes(e)||a.push(e)}),t.remove(a),r.value=r.value.filter(t=>t.tabId!==e)}function s(e){let n=[],i=[];r.value.forEach(t=>{t.tabId===e?n.push(...t.name):i.push(...t.name)});let a=[];i.forEach(e=>{n.includes(e)||a.push(e)}),t.remove(a),r.value=r.value.filter(t=>t.tabId===e)}function c(e){let n=r.value.findIndex(t=>t.tabId===e),i=[],a=[];r.value.forEach((e,t)=>{t<n?a.push(...e.name):i.push(...e.name)});let o=[];a.forEach(e=>{i.includes(e)||o.push(e)}),t.remove(o),r.value=r.value.filter((e,t)=>t>=n)}function l(e){let n=r.value.findIndex(t=>t.tabId===e),i=[],a=[];r.value.forEach((e,t)=>{t>n?a.push(...e.name):i.push(...e.name)});let o=[];a.forEach(e=>{i.includes(e)||o.push(e)}),t.remove(o),r.value=r.value.filter((e,t)=>t<=n)}function u(){r.value=[]}return{list:r,leaveIndex:i,add:a,remove:o,removeOtherSide:s,removeLeftSide:c,removeRightSide:l,clean:u}});export{n,r as t};