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