export const USER_FILTER_MIN_USERS=0x6;function normalizeText(_0x2b44b9){return String(_0x2b44b9??'')['trim']()['toLowerCase']();}function normalizeAccessFilter(_0x494e0f){const _0x271762=normalizeText(_0x494e0f);return _0x271762||'all';}export function canFilterUsers(_0x473e9f){return Array['isArray'](_0x473e9f)&&_0x473e9f['length']>=USER_FILTER_MIN_USERS;}export function hasActiveUserFilters(_0x1cb74a={}){return Boolean(normalizeText(_0x1cb74a['search']))||normalizeAccessFilter(_0x1cb74a['access'])!=='all';}export function userMatchesAccessFilter(_0x41027c,_0x56a9dd='all'){switch(normalizeAccessFilter(_0x56a9dd)){case'server-admin':return Boolean(_0x41027c?.['isServerAdmin']);case'user-binding':return Boolean(_0x41027c?.['hasUserBinding']);case'team-binding':return Boolean(_0x41027c?.['hasTeamBinding']);case'no-access':return!_0x41027c?.['isServerAdmin']&&!_0x41027c?.['hasUserBinding']&&!_0x41027c?.['hasTeamBinding'];case'all':default:return!![];}}export function userMatchesSearch(_0x46387d,_0x42094d=''){const _0x220ad8=normalizeText(_0x42094d)['split'](/\s+/)['filter'](Boolean);if(_0x220ad8['length']===0x0)return!![];const _0x233b83=[_0x46387d?.['username'],_0x46387d?.['name'],_0x46387d?.['email']]['map'](normalizeText)['join']('\x20');return _0x220ad8['every'](_0x5c64b4=>_0x233b83['includes'](_0x5c64b4));}export function filterUsers(_0x42fb73,_0x4ef46a={},_0x3b919a={}){const _0x19eb19=Array['isArray'](_0x42fb73)?_0x42fb73:[],_0x523cb6=_0x3b919a['requireThreshold']!==![];if(_0x523cb6&&!canFilterUsers(_0x19eb19))return _0x19eb19;return _0x19eb19['filter'](_0x33ac24=>userMatchesSearch(_0x33ac24,_0x4ef46a['search'])&&userMatchesAccessFilter(_0x33ac24,_0x4ef46a['access']));}