import { defineComponent as l, computed as m, createElementBlock as n, createCommentVNode as i, openBlock as p, createElementVNode as o, createVNode as s, unref as a, createTextVNode as d, toDisplayString as r } from "vue";
import { ScalarIconCaretRight as u } from "@scalar/icons";
import { requestSchema as f } from "@scalar/oas-utils/entities/spec";
import { schemaModel as h } from "@scalar/oas-utils/helpers";
import b from "../OperationParameters.vue.js";
import k from "../OperationResponses.vue.js";
import g from "../../../../components/HttpMethod/HttpMethod.vue.js";
const y = {
  key: 0,
  class: "group"
}, _ = { class: "font-code bg-b-1 callback-sticky-offset sticky flex cursor-pointer flex-row items-center gap-2 border-t py-3 text-sm group-open:flex-wrap" }, q = { class: "text-c-1 truncate leading-3 group-open:whitespace-normal" }, B = { class: "text-c-2" }, v = { class: "callback-operation-container flex flex-col gap-2" }, I = /* @__PURE__ */ l({
  __name: "Callback",
  props: {
    callback: {},
    collection: {},
    method: {},
    name: {},
    schemas: {},
    url: {}
  },
  setup(t) {
    const c = m(
      () => h({ ...t.callback, path: t.url, method: t.method }, f, !1)
    );
    return (e, x) => e.collection && c.value ? (p(), n("details", y, [
      o("summary", _, [
        s(a(u), { class: "text-c-3 group-hover:text-c-1 absolute -left-5 size-4 transition-transform group-open:rotate-90" }),
        s(a(g), {
          as: "span",
          class: "request-method",
          method: e.method
        }, null, 8, ["method"]),
        o("div", q, [
          d(r(e.name) + " ", 1),
          o("span", B, r(e.url), 1)
        ])
      ]),
      o("div", v, [
        s(b, {
          requestBody: e.callback.requestBody,
          parameters: e.callback.parameters,
          schemas: e.schemas
        }, null, 8, ["requestBody", "parameters", "schemas"]),
        s(k, {
          collapsableItems: !1,
          responses: e.callback.responses,
          schemas: e.schemas
        }, null, 8, ["responses", "schemas"])
      ])
    ])) : i("", !0);
  }
});
export {
  I as default
};
