import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, createTextVNode, toDisplayString, createElementVNode, renderSlot, withDirectives, unref, vShow, createCommentVNode, createBlock } from "vue";
import { i as icon, _ as _export_sfc } from "./index-67bc0910.js";
const _hoisted_1 = {
  key: 0,
  class: "top go-mt-0 go-flex-no-wrap"
};
const _hoisted_2 = { class: "mt-1" };
const _hoisted_3 = {
  key: 1,
  class: "bottom go-mt-0"
};
const _hoisted_4 = { class: "aside" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    title: String,
    showTop: {
      type: Boolean,
      default: true
    },
    showBottom: {
      type: Boolean,
      default: false
    },
    flex: {
      type: Boolean,
      default: false
    },
    // back
    backIcon: {
      type: Boolean,
      default: true
    },
    // 背景深度
    depth: {
      type: Number,
      default: 1
    },
    // x 轴滚动
    xScroll: {
      type: Boolean,
      default: false
    },
    disabledScroll: {
      type: Boolean,
      default: false
    }
  },
  emits: ["back"],
  setup(__props, { emit }) {
    const { ChevronBackOutlineIcon } = icon.ionicons5;
    const backHandle = () => {
      emit("back");
    };
    return (_ctx, _cache) => {
      const _component_n_text = resolveComponent("n-text");
      const _component_n_ellipsis = resolveComponent("n-ellipsis");
      const _component_n_space = resolveComponent("n-space");
      const _component_n_icon = resolveComponent("n-icon");
      const _component_n_scrollbar = resolveComponent("n-scrollbar");
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["go-content-box", [`bg-depth${__props.depth}`, __props.flex && "flex"]])
      }, [
        __props.showTop ? (openBlock(), createElementBlock("div", _hoisted_1, [
          createVNode(_component_n_space, {
            class: "go-flex-no-wrap",
            size: 5
          }, {
            default: withCtx(() => [
              createVNode(_component_n_ellipsis, null, {
                default: withCtx(() => [
                  createVNode(_component_n_text, null, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(__props.title), 1)
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }),
              createElementVNode("div", _hoisted_2, [
                renderSlot(_ctx.$slots, "icon", {}, void 0, true)
              ])
            ]),
            _: 3
          }),
          createVNode(_component_n_space, {
            class: "go-flex-no-wrap",
            align: "center",
            style: { "gap": "4px" }
          }, {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "top-right", {}, void 0, true),
              withDirectives(createVNode(_component_n_icon, {
                size: "20",
                class: "go-cursor-pointer go-d-block",
                onClick: backHandle
              }, {
                default: withCtx(() => [
                  createVNode(unref(ChevronBackOutlineIcon))
                ]),
                _: 1
              }, 512), [
                [vShow, __props.backIcon]
              ])
            ]),
            _: 3
          })
        ])) : createCommentVNode("", true),
        createElementVNode("div", {
          class: normalizeClass(["content", {
            "content-height-show-top-bottom": __props.showBottom || __props.showTop,
            "content-height-show-both": __props.showBottom && __props.showTop
          }])
        }, [
          __props.disabledScroll ? renderSlot(_ctx.$slots, "default", { key: 0 }, void 0, true) : __props.xScroll ? (openBlock(), createBlock(_component_n_scrollbar, {
            key: 1,
            "x-scrollable": ""
          }, {
            default: withCtx(() => [
              createVNode(_component_n_scrollbar, null, {
                default: withCtx(() => [
                  renderSlot(_ctx.$slots, "default", {}, void 0, true)
                ]),
                _: 3
              })
            ]),
            _: 3
          })) : (openBlock(), createBlock(_component_n_scrollbar, { key: 2 }, {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default", {}, void 0, true)
            ]),
            _: 3
          }))
        ], 2),
        __props.showBottom ? (openBlock(), createElementBlock("div", _hoisted_3, [
          renderSlot(_ctx.$slots, "bottom", {}, void 0, true)
        ])) : createCommentVNode("", true),
        createElementVNode("div", _hoisted_4, [
          renderSlot(_ctx.$slots, "aside", {}, void 0, true)
        ])
      ], 2);
    };
  }
});
const index_vue_vue_type_style_index_0_scoped_5cc6ec96_lang = "";
const ContentBox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5cc6ec96"]]);
export {
  ContentBox as C
};
