import { defineComponent as i, computed as s, createBlock as l, createElementBlock as p, openBlock as o, unref as a } from "vue";
import { getExampleFromSchema as u } from "@scalar/api-client/v2/blocks/operation-code-sample";
import { ScalarCodeBlock as m, ScalarVirtualText as d } from "@scalar/components";
import { prettyPrintJson as f } from "@scalar/oas-utils/helpers";
import { getResolvedRef as g } from "@scalar/workspace-store/helpers/get-resolved-ref";
import { getResolvedRefDeep as v } from "./helpers/get-resolved-ref-deep.js";
const x = {
  key: 3,
  class: "empty-state"
}, y = 2e4, S = /* @__PURE__ */ i({
  __name: "ExampleResponse",
  props: {
    response: {},
    example: {}
  },
  setup(e) {
    const c = () => e.example !== void 0 ? v(e.example)?.value ?? "" : e.response?.schema ? u(g(e.response.schema), {
      emptyString: "string",
      mode: "read"
    }) : "", r = s(
      () => t.value.length > y
    ), t = s(
      () => f(c())
    );
    return (n, h) => n.example !== void 0 && !r.value ? (o(), l(a(m), {
      key: 0,
      class: "bg-b-2 -outline-offset-2",
      lang: "json",
      prettyPrintedContent: t.value
    }, null, 8, ["prettyPrintedContent"])) : n.response?.schema && !r.value ? (o(), l(a(m), {
      key: 1,
      class: "bg-b-2 -outline-offset-2",
      lang: "json",
      prettyPrintedContent: t.value
    }, null, 8, ["prettyPrintedContent"])) : (n.example !== void 0 || n.response?.schema) && r.value ? (o(), l(a(d), {
      key: 2,
      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: t.value
    }, null, 8, ["text"])) : (o(), p("div", x, " No Body "));
  }
});
export {
  S as default
};
