import * as t from "monaco-editor/esm/vs/editor/editor.api.js";
import { configureMonacoYaml as m } from "monaco-yaml";
import n from "../schemas/openapi-3.1-schema.json.js";
const s = "inmemory://model/scalar/openapi-json-schema", f = (e) => {
  const o = t.languages.json.jsonDefaults, a = o.diagnosticsOptions, c = [
    ...(a.schemas ?? []).filter((i) => i.uri !== s),
    {
      uri: s,
      fileMatch: [e],
      schema: n
    }
  ];
  o.setDiagnosticsOptions({
    ...a,
    validate: !0,
    enableSchemaRequest: !1,
    schemas: c
  });
}, h = (e) => {
  m(t, {
    enableSchemaRequest: !1,
    validate: !0,
    format: !0,
    completion: !0,
    hover: !0,
    schemas: [
      {
        // If YAML file is opened matching this glob
        fileMatch: [e],
        schema: n,
        uri: s
      }
    ]
  });
};
export {
  f as configureJson,
  h as configureYaml
};
