import{envConfig as o}from"../../config/env-config.js";async function d(E){return{id:"enforce-login",async processContent(s){const e=!!o.REDOCLY_ENFORCE_RESIDENCY,i=!!o.REDOCLY_ENFORCE_LOGIN;if(!e&&!i)return;const n=s.getConfig(),r=t=>!!t&&Object.keys(t).length>0,f=r(n.access?.rbac)||r(n.rbac),c=i&&!f;!e&&!c||s.setGlobalConfig({...c&&"rbac"in n&&{rbac:void 0},...c&&"requiresLogin"in n&&{requiresLogin:void 0},...e&&"residency"in n&&{residency:void 0},access:{...n.access,...e&&{residency:o.REDOCLY_ENFORCE_RESIDENCY},...c&&{requiresLogin:!0,rbac:void 0}}})}}}export{d as enforceLoginPlugin};
