import { defineComponent, ref, watchEffect, onMounted, nextTick, openBlock, createElementBlock, createVNode } from "vue";
import { _ as _sfc_main$1 } from "./index2.js";
import "vant";
import "@wltech/svg";
import "dayjs";
import "qs";
import "vuedraggable";
import "vue-router";
const __default__ = {
  name: "SelectStage"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    is_trial: { type: Boolean, default: false },
    modelValue: { default: "" },
    data: { default: null },
    stage_list: { default: null },
    stage_fail_list: { default: null },
    businessOppDetail: { default: null }
  },
  emits: ["onClickItem", "onFail", "onSuccess"],
  setup(__props, { emit }) {
    const props = __props;
    const maxWidth = ref("");
    const selectStageRef = ref(null);
    const stagePopupData = ref(null);
    watchEffect(() => {
      stagePopupData.value = {
        key: props.modelValue + ""
      };
    });
    onMounted(() => {
      nextTick(() => {
        maxWidth.value = selectStageRef.value.parentElement.clientWidth;
      });
    });
    const onClickItem = (item) => {
      emit("onClickItem", { ...item, business_data: props.data });
    };
    const onFail = (val) => {
      emit("onFail", { ...val, business_data: props.data });
    };
    const onSuccess = (data) => {
      emit("onSuccess", { ...data, business_data: props.data });
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "business-opportunity-card-select-stage",
        ref_key: "selectStageRef",
        ref: selectStageRef
      }, [
        createVNode(_sfc_main$1, {
          modelValue: stagePopupData.value,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => stagePopupData.value = $event),
          isEdit: __props.data.is_edit,
          stageList: __props.stage_list,
          stageFailList: __props.stage_fail_list,
          businessOppDetail: __props.businessOppDetail,
          is_trial: __props.is_trial,
          maxWidth: maxWidth.value,
          onOnClickItem: onClickItem,
          onOnFail: onFail,
          onOnSuccess: onSuccess
        }, null, 8, ["modelValue", "isEdit", "stageList", "stageFailList", "businessOppDetail", "is_trial", "maxWidth"])
      ], 512);
    };
  }
});
export { _sfc_main as default };
