import{REDOCLY_TEAMS_RBAC as p}from"@redocly/config";function c(t,r,a){if(!r)throw new Error("Visitor required");if(t){t.description&&r(t,"description",a.location.absolutePointer+"/description",a);for(const o in t["x-enumDescriptions"])r(t["x-enumDescriptions"],o,a.location.absolutePointer+"/x-enumDescriptions/"+o,a)}}const f=({visitor:t})=>({any:{leave(r,a){c(r,t,a)}},ref:{leave(r,a){c(r,t,a)}}}),l=()=>{const t={};return{Tag:{enter(r){r?.["x-rbac"]&&(t[String(r.name)]=r["x-rbac"])}},any:{leave(r,a){if((a.type.name==="Operation"||a.type.name==="Webhook")&&"tags"in r&&Array.isArray(r.tags))for(const o of r.tags)t[o]&&(r["x-rbac"]=r["x-rbac"]||t[o]);r?.["x-rbac"]&&(r[p]=r["x-rbac"],delete r["x-rbac"])}}}};function g(t,r,a){const o={id:"markdown",decorators:{oas3:{markdown:f,rbac:l}}};return{...t,decorators:{"markdown/rbac":"on","markdown/markdown":{visitor:function(n,i,s,u){const{node:e}=u.resolve(n[i]);!e||typeof e!="string"||a.push({node:n,pointer:s,markdown:e,relativePath:r,key:i})}},...t.decorators||{}},plugins:[...t.plugins||[],o]}}export{f as MarkdownParserDecorator,l as RbacDecorator,g as injectDecoratorIntoConfig};
