import{r as e}from"./rolldown-runtime-C5c2KzVm.js";import{a as t,p as n}from"./utils-Bs-0X7qI.js";import{r}from"./bundle-mjs-C4g7ASB5.js";import{u as i}from"./chunk-LFPYN7LY-Bb6SdmrV.js";import{i as a,o,r as s,t as c}from"./card-BgiZuEPo.js";import{t as l}from"./permission-guard-C-WT75tf.js";import{t as u}from"./page-container-5wXiFE1n.js";import{t as d}from"./sidebar-config-C0gL6k3Q.js";var f=e({default:()=>h}),p=n(),m=r();function h(){let e=(0,p.c)(7),n=i(),{userInfo:r}=t(_),f;e[0]!==n||e[1]!==r?.isRoot||e[2]!==r?.permissionsCodes?(f=(e,t)=>{let i=r?.permissionsCodes??[],a=!!r?.isRoot,o=t.menuItems.find(e=>a?!0:(Array.isArray(e.permissions)?e.permissions:[e.permissions]).some(e=>i.includes(e)));o&&n(`/console/operation/${e}/${o.path}`)},e[0]=n,e[1]=r?.isRoot,e[2]=r?.permissionsCodes,e[3]=f):f=e[3];let h=f,v;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,m.jsx)(`h1`,{className:`text-lg font-semibold`,children:`营销工具`}),e[4]=v):v=e[4];let y;return e[5]===h?y=e[6]:(y=(0,m.jsx)(u,{children:(0,m.jsxs)(`div`,{className:`space-y-4 px-4`,children:[v,(0,m.jsx)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5`,children:Object.entries(d).map(e=>{let[t,n]=e;return(0,m.jsx)(l,{permissions:n.menuItems.flatMap(g),any:!0,children:(0,m.jsx)(c,{onClick:()=>h(t,n),className:`cursor-pointer transition-shadow hover:shadow-md`,children:(0,m.jsxs)(s,{className:`flex items-center gap-4`,children:[(0,m.jsx)(`div`,{className:`bg-primary/10 flex size-12 shrink-0 items-center justify-center rounded-lg`,children:(0,m.jsx)(n.icon,{className:`text-primary size-8`})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(o,{children:n.title}),(0,m.jsx)(a,{children:n.description})]})]})})},t)})})]})}),e[5]=h,e[6]=y),y}function g(e){return Array.isArray(e.permissions)?e.permissions:[e.permissions]}function _(e){return e.auth}export{f as n,h as t};