"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_popup_props = require("./props.js");
const uni_modules_tdesignUniapp_components_mixins_transition = require("../mixins/transition.js");
const uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar = require("../mixins/using-custom-navbar.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const uni_modules_tdesignUniapp_components_popup_computed = require("./computed.js");
const common_vendor = require("../../../../common/vendor.js");
const TOverlay = () => "../overlay/overlay.js";
const TIcon = () => "../icon/icon.js";
delete uni_modules_tdesignUniapp_components_popup_props.props.visible;
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-popup`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
  name,
  options: {
    styleIsolation: "shared"
  },
  externalClasses: [
    `${uni_modules_tdesignUniapp_components_common_config.prefix}-class`,
    `${uni_modules_tdesignUniapp_components_common_config.prefix}-class-content`
  ],
  mixins: [uni_modules_tdesignUniapp_components_mixins_transition.transitionMixins, uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar.useCustomNavbarBehavior],
  components: {
    TOverlay,
    TIcon
  },
  props: {
    ...uni_modules_tdesignUniapp_components_popup_props.props
  },
  emits: [
    "visible-change",
    "leaved",
    "update:visible"
  ],
  data() {
    return {
      prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
      classPrefix: name,
      popup: uni_modules_tdesignUniapp_components_popup_computed.popup,
      tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools
    };
  },
  computed: {
    innerPreventScrollThrough() {
      const { preventScrollThrough, overlayProps } = this;
      return preventScrollThrough || (overlayProps ? !!overlayProps.preventScrollThrough : false);
    }
  },
  methods: {
    noop() {
    },
    handleOverlayClick() {
      const { closeOnOverlayClick } = this;
      if (closeOnOverlayClick) {
        this.$emit("visible-change", { visible: false, trigger: "overlay" });
        this.$emit("update:visible", false);
      }
    },
    handleClose() {
      this.$emit("visible-change", { visible: false, trigger: "close-btn" });
      this.$emit("update:visible", false);
    }
  }
});
if (!Array) {
  const _easycom_t_icon2 = common_vendor.resolveComponent("t-icon");
  const _easycom_t_overlay2 = common_vendor.resolveComponent("t-overlay");
  (_easycom_t_icon2 + _easycom_t_overlay2)();
}
const _easycom_t_icon = () => "../icon/icon.js";
const _easycom_t_overlay = () => "../overlay/overlay.js";
if (!Math) {
  (_easycom_t_icon + _easycom_t_overlay)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return common_vendor.e({
    a: _ctx.realVisible
  }, _ctx.realVisible ? common_vendor.e({
    b: _ctx.innerPreventScrollThrough
  }, _ctx.innerPreventScrollThrough ? common_vendor.e({
    c: _ctx.closeBtn
  }, _ctx.closeBtn ? {
    d: common_vendor.p({
      name: "close",
      size: "64rpx"
    })
  } : {}, {
    e: common_vendor.r("close-btn", {
      class: _ctx.classPrefix + "-slot"
    }),
    f: common_vendor.n(_ctx.classPrefix + "__close"),
    g: common_vendor.o((...args) => _ctx.handleClose && _ctx.handleClose(...args)),
    h: common_vendor.n(_ctx.classPrefix + "__content " + _ctx.tClassContent),
    i: common_vendor.o((...args) => _ctx.noop && _ctx.noop(...args))
  }) : common_vendor.e({
    j: _ctx.closeBtn
  }, _ctx.closeBtn ? {
    k: common_vendor.p({
      name: "close",
      size: "64rpx"
    })
  } : {}, {
    l: common_vendor.r("close-btn", {
      class: _ctx.classPrefix + "-slot"
    }),
    m: common_vendor.n(_ctx.classPrefix + "__close"),
    n: common_vendor.o((...args) => _ctx.handleClose && _ctx.handleClose(...args)),
    o: common_vendor.n(_ctx.classPrefix + "__content " + _ctx.tClassContent)
  }), {
    p: common_vendor.s(_ctx.tools._style([_ctx.popup.getPopupStyles({
      zIndex: _ctx.zIndex,
      distanceTop: _ctx.distanceTop,
      placement: _ctx.placement,
      duration: _ctx.duration
    }), _ctx.customStyle])),
    q: common_vendor.n(_ctx.tools.cls(_ctx.classPrefix, [_ctx.placement]) + " " + _ctx.transitionClass + " " + _ctx.tClass),
    r: common_vendor.o((...args) => _ctx.onTransitionEnd && _ctx.onTransitionEnd(...args))
  }) : {}, {
    s: _ctx.showOverlay
  }, _ctx.showOverlay ? {
    t: common_vendor.o(($event) => _ctx.handleOverlayClick($event, {
      tagId: "popup-overlay"
    })),
    v: common_vendor.p({
      id: "popup-overlay",
      visible: _ctx.visible,
      ["using-custom-navbar"]: _ctx.usingCustomNavbar,
      ["custom-navbar-height"]: _ctx.customNavbarHeight,
      ["z-index"]: _ctx.overlayProps && _ctx.overlayProps.zIndex || 11e3,
      duration: _ctx.overlayProps && _ctx.overlayProps.duration || 300,
      ["background-color"]: _ctx.overlayProps && _ctx.overlayProps.backgroundColor || "",
      ["prevent-scroll-through"]: _ctx.preventScrollThrough || (_ctx.overlayProps ? !!_ctx.overlayProps.preventScrollThrough : false),
      ["custom-style"]: _ctx.overlayProps && _ctx.overlayProps.style || ""
    })
  } : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cb4f1fe8"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/popup/popup.js.map
