import{at as o,ba as n}from"./index-ktJf6c6X.js";const c=["production","jobcard"],u=r=>String(r??"").toLowerCase().replace(/[^a-z0-9]/g,""),a=r=>{const t=u(r);return c.some(e=>t.includes(e))},l=()=>o(r=>{const t=(r==null?void 0:r.userRole)??{},e=t.roleDetails??t.userRoleDTOList;return Array.isArray(e)?e:(e==null?void 0:e.privilegeList)??(e==null?void 0:e.userPrivilegeList)??(e==null?void 0:e.userPrivileges)??[]}),m=()=>{const r=l(),t=o(n);if(!r||r.length===0)return{read:!0,write:!0,create:!1};const e=r.find(s=>a(s==null?void 0:s.applicationEntityName));if(e)return{read:!0,write:e.write!==!1,create:!!e.create};const i=(t||"").toLowerCase().includes("admin");return{read:i,write:i,create:i}};export{m as u};
