import { defineComponent, useSlots, ref, resolveComponent, createBlock, openBlock, mergeProps, toHandlers, unref, createSlots, withCtx, renderSlot } from 'vue';
import '../../../../utils/index.mjs';
import { switchEmits } from 'element-plus';
import { switchEmits as switchEmits$1, switchProps } from './switch.mjs';
import { getGmEvent } from '../../../../utils/src/elementPlus/event.mjs';
import { getGmExports } from '../../../../utils/src/elementPlus/exports.mjs';

var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: "GmSwitch"
  },
  __name: "Switch",
  props: switchProps,
  emits: switchEmits$1,
  setup(__props, { expose: __expose, emit: __emit }) {
    const slots = useSlots();
    const props = __props;
    const emit = __emit;
    const elEvents = getGmEvent(switchEmits, emit);
    const elRef = ref();
    const exposeEvents = ["focus"];
    const { exposeFns } = getGmExports(elRef, exposeEvents);
    __expose({
      elRef,
      ...exposeFns
    });
    return (_ctx, _cache) => {
      const _component_el_switch = resolveComponent("el-switch");
      return openBlock(), createBlock(
        _component_el_switch,
        mergeProps({
          ref_key: "elRef",
          ref: elRef
        }, props, toHandlers(unref(elEvents))),
        createSlots({
          _: 2
          /* DYNAMIC */
        }, [
          unref(slots)["active-action"] ? {
            name: "active-action",
            fn: withCtx(() => [
              renderSlot(_ctx.$slots, "active-action")
            ]),
            key: "0"
          } : void 0,
          unref(slots)["inactive-action"] ? {
            name: "inactive-action",
            fn: withCtx(() => [
              renderSlot(_ctx.$slots, "inactive-action")
            ]),
            key: "1"
          } : void 0
        ]),
        1040
        /* FULL_PROPS, DYNAMIC_SLOTS */
      );
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=Switch.vue2.mjs.map
