import{a as e,p as t}from"./utils-Bs-0X7qI.js";import{r as n}from"./bundle-mjs-C4g7ASB5.js";import{n as r}from"./dist-Cw-z5Xb0.js";import{t as i}from"./status-codes.constant-BV2w9Io6.js";var a=t(),o=n();function s(t){let n=(0,a.c)(13),{children:s,permissions:l,any:u,blockOnly:d,showToast:f,toastMessage:p,fallback:m,onDenied:h}=t,g=u===void 0?!1:u,_=d===void 0?!1:d,v=f===void 0?!0:f,y=p===void 0?`无权限执行此操作`:p,b=m===void 0?null:m,{userInfo:x}=e(c),S=x?.isRoot===i.YES,C=x?.permissionsCodes??[],w=Array.isArray(l)?l:[l],T=g?w.some(e=>C.includes(e)):w.every(e=>C.includes(e)),E=S||T;if(!E&&!_){let e;return n[0]===b?e=n[1]:(e=(0,o.jsx)(o.Fragment,{children:b}),n[0]=b,n[1]=e),e}if(!E){let e;n[2]!==h||n[3]!==v||n[4]!==y?(e=e=>{e.preventDefault(),e.stopPropagation(),v&&r.error(y),h?.()},n[2]=h,n[3]=v,n[4]=y,n[5]=e):e=n[5];let t=e,i;n[6]===s?i=n[7]:(i=(0,o.jsx)(`div`,{className:`pointer-events-none`,children:s}),n[6]=s,n[7]=i);let a;return n[8]!==t||n[9]!==i?(a=(0,o.jsx)(`div`,{onClick:t,onKeyDown:t,className:`cursor-not-allowed`,children:i}),n[8]=t,n[9]=i,n[10]=a):a=n[10],a}let D;return n[11]===s?D=n[12]:(D=(0,o.jsx)(o.Fragment,{children:s}),n[11]=s,n[12]=D),D}function c(e){return e.auth}export{s as t};