import { defineComponent, computed, createBlock, openBlock, unref } from "vue";
import { getResolvedRefDeep } from "@scalar/api-client/v2/blocks/operation-code-sample";
import { ScalarCodeBlock, ScalarVirtualText } from "@scalar/components";
import { prettyPrintJson } from "@scalar/oas-utils/helpers";
const VIRTUALIZATION_THRESHOLD = 2e4;
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "ExampleSchema",
  props: {
    id: {},
    schema: {}
  },
  setup(__props) {
    const schemaContent = computed(() => {
      if (!__props.schema) {
        return void 0;
      }
      return prettyPrintJson(getResolvedRefDeep(__props.schema));
    });
    const shouldVirtualizeSchema = computed(() => {
      return (schemaContent.value?.length ?? 0) > VIRTUALIZATION_THRESHOLD;
    });
    return (_ctx, _cache) => {
      return !shouldVirtualizeSchema.value ? (openBlock(), createBlock(unref(ScalarCodeBlock), {
        key: 0,
        id: __props.id,
        class: "bg-b-2",
        lang: "json",
        prettyPrintedContent: schemaContent.value ?? ""
      }, null, 8, ["id", "prettyPrintedContent"])) : (openBlock(), createBlock(unref(ScalarVirtualText), {
        key: 1,
        id: __props.id,
        containerClass: "custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen",
        contentClass: "language-plaintext whitespace-pre font-code text-base",
        lineHeight: 20,
        text: schemaContent.value ?? ""
      }, null, 8, ["id", "text"]));
    };
  }
});
export {
  _sfc_main as default
};
