'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../utils/index.js');
var inlineStepper = require('./inline-stepper.js');
var createNamespace = require('../../../utils/create-namespace.js');

"use strict";
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{
    name: "LlInlineStepper"
  },
  __name: "inline-stepper",
  props: inlineStepper.inlineStepperProps,
  setup(__props) {
    const bem = createNamespace.createNamespace("inline-stepper");
    const props = __props;
    const attrs = vue.useAttrs();
    const newCurrent = vue.computed(() => {
      if (!Array.isArray(props.items)) return 0;
      const index = props.items.findIndex(
        (item) => Object.values(item).includes(props.current)
      );
      return index === -1 ? void 0 : index;
    });
    return (_ctx, _cache) => {
      const _component_ll_icon = vue.resolveComponent("ll-icon");
      const _component_a_steps = vue.resolveComponent("a-steps");
      return vue.openBlock(), vue.createBlock(_component_a_steps, vue.mergeProps({
        class: [vue.unref(bem).b(), vue.unref(bem).is(_ctx.mode)]
      }, vue.unref(attrs), {
        items: _ctx.items.map(({ tip, ...rest }) => rest),
        current: newCurrent.value,
        "label-placement": "vertical"
      }), {
        progressDot: vue.withCtx(({ index }) => [
          (vue.openBlock(), vue.createBlock(
            vue.resolveDynamicComponent(_ctx.items[index]?.tip ? "ll-tooltip" : "div"),
            vue.normalizeProps(vue.guardReactiveProps(_ctx.items[index]?.tip ? { tip: _ctx.items[index].tip } : {})),
            {
              default: vue.withCtx(() => [
                index < newCurrent.value ? (vue.openBlock(), vue.createElementBlock(
                  "div",
                  {
                    key: 0,
                    class: vue.normalizeClass(["dot-status", vue.unref(bem).m("dot-finish")])
                  },
                  [
                    vue.createVNode(_component_ll_icon, { "icon-name": "icon-check" })
                  ],
                  2
                  /* CLASS */
                )) : index === newCurrent.value ? (vue.openBlock(), vue.createElementBlock(
                  "div",
                  {
                    key: 1,
                    class: vue.normalizeClass([
                      "dot-status",
                      _ctx.mode === "flow-wizard" ? vue.unref(bem).m("dot-active") : vue.unref(bem).m("dot-finish")
                    ])
                  },
                  [
                    vue.createVNode(_component_ll_icon, {
                      "icon-name": _ctx.mode === "flow-wizard" ? "icon-more" : "icon-check"
                    }, null, 8, ["icon-name"])
                  ],
                  2
                  /* CLASS */
                )) : (vue.openBlock(), vue.createElementBlock(
                  "div",
                  {
                    key: 2,
                    class: vue.normalizeClass(["dot-status", vue.unref(bem).m("dot-pending")])
                  },
                  [..._cache[0] || (_cache[0] = [
                    vue.createElementVNode(
                      "div",
                      null,
                      null,
                      -1
                      /* CACHED */
                    )
                  ])],
                  2
                  /* CLASS */
                ))
              ]),
              _: 2
              /* DYNAMIC */
            },
            1040
            /* FULL_PROPS, DYNAMIC_SLOTS */
          ))
        ]),
        _: 1
        /* STABLE */
      }, 16, ["class", "items", "current"]);
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=inline-stepper.vue2.js.map
