import { i as isPropertySet } from './auth-2d06b6ac.mjs';
import { R as REALM_MASTER_NAME } from './server.mjs';

function isRealmResourceWritable(realm, resourceRealmId) {
  if (Array.isArray(resourceRealmId)) {
    for (let i = 0; i < resourceRealmId.length; i++) {
      if (isRealmResourceWritable(realm, resourceRealmId[i])) {
        return true;
      }
    }
    return false;
  }
  if (!realm) {
    return false;
  }
  if (isPropertySet(realm, "name") && realm.name === REALM_MASTER_NAME) {
    return true;
  }
  return realm.id === resourceRealmId;
}

export { isRealmResourceWritable as i };
//# sourceMappingURL=utils-e4eb8c9d.mjs.map
