text: 'use strict';
  
  Object.defineProperty(exports, '__esModule', { value: true });
  
  var vue = require('vue');
  var index = require('../../checkbox/index.js');
  var index$1 = require('../../radio/index.js');
  var index$2 = require('../../icon/index.js');
  var icons = require('@element-plus/icons');
  var nodeContent = require('./node-content.js');
  var types = require('./types.js');
  
  var script = vue.defineComponent({
    name: "ElCascaderNode",
    components: {
      ElCheckbox: index.ElCheckbox,
      ElRadio: index$1.ElRadio,
      NodeContent: nodeContent["default"],
      ElIcon: index$2.ElIcon,
      Check: icons.Check,
      Loading: icons.Loading,
      ArrowRight: icons.ArrowRight
    },
    props: {
      node: {
        type: Object,
        required: true
      },
      menuId: String
    },
    emits: ["expand"],
    setup(props, { emit }) {
      const panel = vue.inject(types.CASCADER_PANEL_INJECTION_KEY);
      const isHoverMenu = vue.computed(() => panel.isHoverMenu);
      const multiple = vue.computed(() => panel.config.multiple);
      const checkStrictly = vue.computed(() => panel.config.checkStrictly);
      const checkedNodeId = vue.computed(() => {
        var _a;
        return (_a = panel.checkedNodes[0]) == null ? void 0 : _a.uid;
      });
      const isDisabled = vue.computed(() => props.node.isDisabled);
      const isLeaf = vue.computed(() => props.node.isLeaf);
      const expandable = vue.computed(() => checkStrictly.value && !isLeaf.value || !isDisabled.value);
      const inExpandingPath = vue.computed(() => isInPath(panel.expandingNode));
      const inCheckedPath = vue.computed(() => checkStrictly.value && panel.checkedNodes.some(isInPath));
      const isInPath = (node) => {
        var _a;
        const { level, uid } = props.node;
        return ((_a = node == null ? void 0 : node.pathNodes[level - 1]) == null ? void 0 : _a.uid) === uid;
      };
      const doExpand = () => {
        if (inExpandingPath.value)
          return;
        panel.expandNode(props.node);
      };
      const doCheck = (checked) => {
        const { node } = props;
        if (checked === node.checked)
          return;
        panel.handleCheckChange(node, checked);
      };
      const doLoad = () => {
        panel.lazyLoad(props.node, () => {
          if (!isLeaf.value)
            doExpand();
        });
      };
      const handleHoverExpand = (e) => {
        if (!isHoverMenu.value)
          return;
        handleExpand();
        !isLeaf.value && emit("expand", e);
      };
      const handleExpand = () => {
        const { node } = props;
        if (!expandable.value || node.loading)
          return;
        node.loaded ? doExpand() : doLoad();
      };
      const handleClick = () => {
        if (isHoverMenu.value && !isLeaf.value)
          return;
        if (isLeaf.value && !isDisabled.value && !checkStrictly.value && !multiple.value) {
          handleCheck(true);
        } else {
          handleExpand();
        }
      };
      const handleCheck = (checked) => {
        if (!props.node.loaded) {
          doLoad();
        } else {
          doCheck(checked);
          !checkStrictly.value && doExpand();
        }
      };
      return {
        panel,
        isHoverMenu,
        multiple,
        checkStrictly,
        checkedNodeId,
        isDisabled,
        isLeaf,
        expandable,
        inExpandingPath,
        inCheckedPath,
        handleHoverExpand,
        handleExpand,
        handleClick,
        handleCheck
      };
    }
  });
  
  exports["default"] = script;
  //# sourceMappingURL=node.vue_vue_type_script_lang.js.map
  