import { l as isPropertySet, 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-8f9455a3.mjs.map
