import f from"@markdoc/markdoc";import{markdoc as g}from"@redocly/theme";import{includes as p}from"./functions/includes.js";import{importUserTags as u}from"./import-user-tags.js";import*as d from"./nodes/index.js";import l from"./tags/index.js";import{reporter as h}from"../../../utils/reporter/reporter.js";import{concat as O}from"./functions/concat.js";const y=g.tags;function b(o){return Object.fromEntries(Object.entries(o).map(([r,e])=>[e.tagName||r,e]))}function T(o){const{tags:r,functions:e={},...n}=o,a={...r,...n};let i=Object.entries(a);const s=[],t=[];for(const[c,m]of i)f.nodes[c]?s.push([c,m]):t.push([c,m]);return{nodes:Object.fromEntries(s),tags:Object.fromEntries(t),functions:e}}async function S(o="../../../esbuild/cache/server/",r=""){let e;try{e=(await u(o)).schema}catch(t){throw t.code==="ERR_MODULE_NOT_FOUND"?(h.printErrors(),new Error("Please fix the errors above and try again.")):t}const{tags:n={},nodes:a={},functions:i={}}=T(e),s={tags:{schemaDefinition:{render:"SchemaDefinition",attributes:{schemaRef:{type:String},exampleRef:{type:String},showReadOnly:{type:Boolean},showWriteOnly:{type:Boolean}}}}};return{nodes:{...d,...a},tags:{...l,...y,...b(n),...s.tags},functions:{...f.functions,...i,includes:p,concat:O}}}export{S as getMarkdocOptions};
