"use strict";
const common_vendor = require("../../../../common/vendor.js");
if (!Array) {
  const _easycom_uni_popup_1 = common_vendor.resolveComponent("uni-popup");
  _easycom_uni_popup_1();
}
const _easycom_uni_popup = () => "../../../uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
  _easycom_uni_popup();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "mosowe-confirm-popup",
  props: {
    modelValue: { type: Boolean },
    title: { default: "提示" },
    message: { type: Boolean },
    hideCancel: { type: Boolean },
    confirmText: { default: "确认" },
    cancelText: { default: "取消" }
  },
  emits: ["update:modelValue", "cancel", "confirm"],
  setup(__props, _a) {
    var __emit = _a.emit;
    const props = __props;
    const emits = __emit;
    const zoConfirmPopupRef = common_vendor.ref(null);
    common_vendor.watch(() => {
      return props.modelValue;
    }, () => {
      props.modelValue ? zoConfirmPopupRef.value.open() : zoConfirmPopupRef.value.close();
    });
    const instance = common_vendor.getCurrentInstance();
    const hasProps = instance.vnode.props;
    const cancel = () => {
      if (hasProps === null || hasProps === void 0 ? void 0 : hasProps.onCancel) {
        emits("cancel");
      } else {
        emits("update:modelValue", false);
      }
    };
    const confirm = () => {
      if (hasProps === null || hasProps === void 0 ? void 0 : hasProps.onConfirm) {
        emits("confirm");
      } else {
        emits("update:modelValue", false);
      }
    };
    return (_ctx = null, _cache = null) => {
      const __returned__ = common_vendor.e(new UTSJSONObject({
        a: props.title
      }), props.title ? new UTSJSONObject({
        b: common_vendor.t(props.title)
      }) : new UTSJSONObject({}), new UTSJSONObject({
        c: props.message ? 1 : "",
        d: !props.hideCancel
      }), !props.hideCancel ? new UTSJSONObject({
        e: common_vendor.t(_ctx.cancelText),
        f: common_vendor.o(cancel)
      }) : new UTSJSONObject({}), new UTSJSONObject({
        g: common_vendor.t(_ctx.confirmText),
        h: common_vendor.o(confirm),
        i: common_vendor.sr(zoConfirmPopupRef, "58b7238c-0", new UTSJSONObject({
          "k": "zoConfirmPopupRef"
        })),
        j: _ctx.virtualHostId,
        k: common_vendor.p(new UTSJSONObject({
          ["is-mask-click"]: false,
          id: _ctx.virtualHostId
        }))
      }));
      return __returned__;
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-58b7238c"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/mosowe-confirm-popup/components/mosowe-confirm-popup/mosowe-confirm-popup.js.map
