"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
;/* empty css                                               */
;/* empty css                                                     */
;/* empty css                                                     */
;/* empty css                                                */
;/* empty css                                               */
;/* empty css                                                  */
;/* empty css                                                 */
const Vue = require("vue");
;/* empty css           */
const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
;/* empty css                                                     */
;/* empty css                                                            */
;/* empty css                                                  */
;/* empty css                                                */
;/* empty css                                                 */
const index$1 = require("../../../../node_modules/vant/es/swipe-cell/index.js");
const functionCall = require("../../../../node_modules/vant/es/dialog/function-call.js");
require("../../../../node_modules/vant/es/dialog/index.js");
const index = require("../../../../node_modules/vant/es/cell-group/index.js");
const index$2 = require("../../../../node_modules/vant/es/button/index.js");
const _sfc_main = {
  __name: "Card",
  props: {
    swipeDelete: {
      type: Boolean,
      default: false
    }
  },
  emits: ["delete"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    const beforeClose = ({ position }) => {
      switch (position) {
        case "left":
        case "cell":
        case "outside":
          return true;
        case "right":
          return new Promise((resolve) => {
            functionCall.showConfirmDialog({
              title: "确定删除吗？"
            }).then(() => {
              emit("delete");
              resolve(true);
            }).catch(() => resolve(false));
          });
      }
    };
    return (_ctx, _cache) => {
      const _component_van_button = index$2.Button;
      const _component_van_swipe_cell = index$1.SwipeCell;
      const _component_van_cell_group = index.CellGroup;
      return Vue.openBlock(), Vue.createBlock(_component_van_cell_group, {
        class: "fec-card",
        inset: true,
        border: true
      }, {
        default: Vue.withCtx(() => [
          Vue.createVNode(_component_van_swipe_cell, {
            disabled: !__props.swipeDelete,
            "before-close": beforeClose
          }, {
            right: Vue.withCtx(() => [
              Vue.createVNode(_component_van_button, {
                square: "",
                text: "删除",
                type: "danger",
                class: "fec-swipe-delete-button"
              })
            ]),
            default: Vue.withCtx(() => [
              Vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
            ]),
            _: 3
          }, 8, ["disabled"])
        ]),
        _: 3
      });
    };
  }
};
const _Card = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-dc24b95f"]]);
exports.default = _Card;
