import '@das-fed/upf-ui/packages/components/select/style.css';
import { withInstall as De } from "@das-fed/upf-utils/with-install/index";
import { defineComponent as Ee, useCssVars as bl, useAttrs as yl, computed as u, ref as s, watch as X, useSlots as gl, onMounted as pe, onUnmounted as _e, watchEffect as me, nextTick as S, resolveComponent as Cl, openBlock as p, createElementBlock as g, normalizeClass as wl, normalizeStyle as K, withModifiers as J, createBlock as q, unref as r, createCommentVNode as I, withDirectives as he, mergeProps as Ce, isRef as xl, createSlots as Tl, withCtx as m, renderSlot as C, normalizeProps as Q, guardReactiveProps as Y, Fragment as be, createTextVNode as ye, toDisplayString as F, createElementVNode as b, createVNode as T, withKeys as kl } from "vue";
import { Select as Sl, Tag as ge } from "ant-design-vue";
import { DasCheckbox as Oe } from "@das-fed/upf-ui/packages/components/checkbox/index";
import { vScrollbar as Il } from "@das-fed/upf-ui/packages/components/scrollbar/index";
import { DasTooltip as Al } from "@das-fed/upf-ui/packages/components/tooltip/index";
import { vDasTooltip as Be } from "@das-fed/upf-ui/packages/components/text-tooltip/index";
import { DasInput as Ll } from "@das-fed/upf-ui/packages/components/input/index";
import { DasIconXiala as Ml } from "@das-fed/upf-ui/packages/icons/xiala/index";
import { DasIconEmpty as Vl } from "@das-fed/upf-ui/packages/icons/empty/index";
import { DasErrorOverlayModel as zl } from "@das-fed/upf-ui/packages/components/error-overlay-model/index";
import { vHoverInside as Nl } from "@das-fed/upf-utils/directive";
import { t as R, currentLang as $l, setI18nRule as _l } from "@das-fed/upf-web/packages/i18n/index";
import { useZIndex as Ol } from "@das-fed/upf-utils/hooks/popup-manager/use-zindex";
import { useModelValue as Bl } from "@das-fed/upf-utils/vue";
import { calcTextWidth as Dl } from "@das-fed/upf-utils/common-tools";
import "ant-design-vue/es/select/style/css";
import "ant-design-vue/es/tag/style/css";
import { SelectOption as El } from "ant-design-vue/es";
const Wl = { key: 0 }, Pl = { class: "das-multiple-option-item" }, Fl = { style: { display: "inline-block" } }, Rl = { key: 0 }, ql = { key: 2 }, Hl = { style: { display: "inline-block" } }, Zl = ["innerHTML"], Kl = ["innerHTML"], Ul = {
  key: 0,
  class: "das-select-error-label-content das-select-label-content"
}, jl = { class: "ant-select ant-select-multiple ant-select-selection-overflow-item ant-select-selection-overflow-item-rest" }, Gl = { class: "ant-select-selection-item" }, Xl = { class: "ant-select-selection-item-content" }, Jl = ["innerHTML"], Ql = Ee({
  inheritAttrs: !1,
  components: {
    VNodes: (d, { attrs: $ }) => $.vnodes
  }
}), Yl = /* @__PURE__ */ Ee({
  ...Ql,
  __name: "Select",
  props: {
    modelValue: { default: void 0 },
    options: {},
    preserveLabelWhenMissing: { type: Boolean, default: !1 },
    mode: { default: "combobox" },
    fieldNames: { default: {} },
    borderType: { default: "bordered" },
    placeholder: { default: "" },
    disabled: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    error: { type: Boolean, default: !1 },
    errorLabel: {},
    errorMode: { default: "default" },
    optionFilterProp: { default: "" },
    width: { default: "230px" },
    height: {},
    size: { default: "middle" },
    maxTagTextLength: { default: 10 },
    dropdownClassName: { default: "" },
    isTooltip: { type: Boolean, default: !0 },
    showTooltipLength: { default: 10 },
    open: { type: Boolean, default: void 0 },
    showArrow: { type: Boolean, default: !0 },
    focusOpen: { type: Boolean, default: !0 },
    isRenderNode: { type: Boolean, default: !1 },
    getPopupContainer: { type: Function, default: void 0 },
    noDropdown: { type: Boolean, default: !1 },
    maxTagsLength: { default: 3 },
    noSetDefaultVal: { type: Boolean, default: !1 },
    teleported: { type: Boolean, default: !0 },
    errorModelZIndex: { default: 2e3 },
    isExterControlCount: { type: Boolean, default: !1 },
    dropdownMode: {},
    inputAttrs: {},
    showSelectAll: { type: Boolean, default: !0 }
  },
  emits: ["update:model-value", "change", "focus", "blur", "dropdownVisibleChange", "addCustomItem"],
  setup(d, { expose: $, emit: _ }) {
    bl((e) => ({
      v79c6e20e: Je.value,
      b5733442: Qe.value
    }));
    const l = d, w = _, we = yl(), Pe = u(() => {
      const e = {};
      for (const t in we)
        t === "onClick" || t.startsWith("onClick") || (e[t] = we[t]);
      return e;
    }), n = Bl(l, "modelValue"), ee = u(() => {
      var e;
      return `<span class='key'>${((e = n.value) == null ? void 0 : e.length) ?? 0}</span>`;
    }), O = s(null), xe = s(null), y = s(!1), U = u(() => l.isView ? l.noSetDefaultVal ? "" : "-" : l.placeholder || R("请选择")), le = u(() => O.value ? O.value.querySelector(".ant-select-selector") : null), B = s(0), D = s(0), Fe = u(() => le.value ? l.isTooltip && A.value ? !1 : !l.isTooltip || V.value || !Ne.value || !ue.value : !0), Re = u(() => (Array.isArray(n.value) ? n.value.length : n.value) ? Ne.value : U.value), Te = () => {
      const e = l.size === "table" ? 12 : 14;
      return Dl(U.value, e);
    }, ke = () => {
      var N, Z, v;
      const e = (N = O.value) == null ? void 0 : N.querySelector(".ant-select-selection-placeholder"), t = (v = (Z = x.value) == null ? void 0 : Z.$el) == null ? void 0 : v.querySelectorAll(".ant-select-selection-item");
      t && t.length && t.forEach((ve) => ve.removeAttribute("title"));
      let a = (e == null ? void 0 : e.offsetWidth) ?? 0;
      if (a === 0) return a;
      const o = window.getComputedStyle(e, null), h = parseFloat(o.paddingRight), f = parseFloat(o.paddingLeft);
      return a - h - f;
    }, A = s(!1);
    X(() => [U.value, n.value], () => {
      S(() => {
        D.value = ke(), B.value = Te(), ((Array.isArray(n.value) ? n.value.length : n.value) || D.value === B.value || B.value - D.value < 1) && (A.value = !1);
      });
    }), X(
      () => {
        var e;
        return (e = xe.value) == null ? void 0 : e.$tooltipRef.popperRef.contentRef;
      },
      (e) => {
        e && (e.addEventListener("mouseenter", function() {
          A.value = !0, P.value && clearTimeout(P.value);
        }), e.addEventListener("mouseleave", function() {
          P.value = setTimeout(() => {
            A.value = !1;
          }, 200);
        }));
      }
    );
    const Se = s(null), Ie = u(() => l.dropdownMode ?? l.mode ?? ""), E = s(null), qe = s(null), W = s(""), He = () => {
      E.value = !0;
    }, Ze = () => {
      E.value = null;
    }, Ae = () => {
      W.value && (w("addCustomItem", W.value), S(() => {
        x.value.focus(), W.value = "";
      }));
    }, Le = gl(), te = () => {
      l.dropdownMode === "custom" && !Le.dropdownRender && (E.value = !1, S(() => {
        E.value = null;
      }));
    };
    pe(() => {
      document.addEventListener("click", te);
    }), _e(() => {
      document.removeEventListener("click", te);
    });
    const x = s(), Me = s(), L = u(() => {
      var e;
      return l.fieldNames && l.fieldNames.label ? (e = l.fieldNames) == null ? void 0 : e.label : "label";
    }), k = u(() => {
      var e;
      return l.fieldNames && l.fieldNames.value ? (e = l.fieldNames) == null ? void 0 : e.value : "value";
    }), oe = s(/* @__PURE__ */ new Map()), Ke = u(() => l.mode), Ue = u(() => l.size == "middle" ? "defalut" : l.size == "mini" ? "small" : l.size), Ve = (e, t) => {
      Array.isArray(e) && e.forEach((a) => {
        t(a), Array.isArray(a == null ? void 0 : a.children) && Ve(a.children, t);
      });
    }, ae = (e, t) => {
      if (Array.isArray(e))
        for (const a of e) {
          if ((a == null ? void 0 : a[k.value]) == t) return a;
          if (Array.isArray(a == null ? void 0 : a.children)) {
            const o = ae(a.children, t);
            if (o) return o;
          }
        }
    }, je = (e) => {
      Ve(e, (t) => {
        t && t[k.value] != null && t[L.value] != null && oe.value.set(t[k.value], t[L.value]);
      });
    }, ne = (e) => {
      if (e == null || e === "") return;
      const t = ae(l.options, e);
      if (t && t[L.value] != null) return t[L.value];
      if (l.preserveLabelWhenMissing)
        return oe.value.get(e);
    }, Ge = (e) => {
      const t = Array.isArray(e) ? e.slice() : [];
      return l.preserveLabelWhenMissing ? ((l.mode !== "combobox" && Array.isArray(n.value) ? n.value : n.value != null && n.value !== "" ? [n.value] : []).forEach((o) => {
        if (ae(t, o)) return;
        const f = oe.value.get(o);
        f != null && t.unshift({
          [k.value]: o,
          [L.value]: f,
          disabled: !0,
          title: "",
          __dasGhostOption: !0
        });
      }), t.map((o) => (o.title = o.title ? o.title : "", o))) : t.map((o) => (o.title = o.title ? o.title : "", o));
    }, se = s(!1), re = u(() => {
      if (E.value !== null) return E.value;
      if (l.open !== void 0) return l.open;
    }), M = 1e6, i = s(100), c = s(100), V = s(!1), ue = s(!0), ie = s(!1);
    me(() => {
      n.value && l.mode == "combobox" && (ue.value = !0, setTimeout(() => {
        var t;
        let e = (t = x.value) == null ? void 0 : t.$el.querySelectorAll(".ant-select-selection-item");
        if (e && e.length > 0)
          for (let a = 0; a < e.length; a++) {
            let o = e[a];
            o.scrollWidth <= o.offsetWidth && (ue.value = !1), o.title = "";
          }
      }, 300));
    }), me(() => {
      l.options && (je(l.options), Me.value = Ge(l.options));
    });
    const Xe = () => {
      setTimeout(async () => {
        i.value = 100, await z(), i.value = c.value, y.value = !0;
      }, 100);
    };
    me(() => {
      ie.value === !0 && l.mode != "combobox" && n.value && n.value.length > 0 && l.options.length > 0 && (ie.value = !1, Xe());
    }), pe(() => {
      ie.value = !0, l.focusOpen || (c.value = 1, i.value = c.value, y.value = !0);
    });
    const Je = u(() => l.width ? l.width : "230px"), Qe = u(() => l.height ? l.height : "auto"), ze = s(3e3), Ye = u(() => ({
      "z-index": ze.value
    })), Ne = u(() => {
      let e = [];
      if (l.mode != "combobox" && Array.isArray(n.value))
        n.value.map((t) => {
          const a = ne(t);
          a != null ? e.push(a) : t != null && t !== "" && e.push(String(t));
        });
      else if (l.mode == "combobox" && n.value) {
        const t = ne(n.value);
        t != null ? e.push(t) : n.value !== null && n.value !== void 0 && n.value !== "" && e.push(String(n.value));
      }
      return $l.value === "zh-CN" ? e.join("、") : e.join(", ");
    }), el = u(() => {
      var t;
      if (l.mode === "combobox") return !1;
      let e = l.options.filter((a) => !a.disabled);
      return !!(Array.isArray(n.value) && ((t = n.value) == null ? void 0 : t.length) == e.length);
    }), ll = u(() => {
      var t, a;
      if (l.mode === "combobox") return !1;
      let e = l.options.filter((o) => !o.disabled);
      return !!(Array.isArray(n.value) && ((t = n.value) == null ? void 0 : t.length) > 0 && ((a = n.value) == null ? void 0 : a.length) < e.length);
    }), tl = u(() => {
      var e, t;
      return l.optionFilterProp ? l.optionFilterProp : (e = l.fieldNames) != null && e.label ? (t = l.fieldNames) == null ? void 0 : t.label : "label";
    }), ol = u(() => ({
      width: typeof l.width == "number" ? l.width + "px" : l.width
    })), de = s(!1), al = s({
      display: "block",
      color: "var(--upf-color-error)",
      "white-space": "break-spaces"
    }), P = s(), nl = () => {
      var a;
      D.value = ke(), B.value = Te();
      let e = (a = x.value) == null ? void 0 : a.$el.querySelectorAll(".ant-select-selection-item");
      !!(Array.isArray(n.value) ? n.value.length : e != null && e.length) || D.value === B.value || B.value - D.value < 1 ? A.value = !1 : (A.value = !0, P.value && clearTimeout(P.value)), de.value = !0;
    }, sl = () => {
      P.value = setTimeout(() => {
        A.value = !1;
      }, 200), de.value = !1;
    }, rl = (e, t) => {
      e ? nl() : sl();
    }, ul = (e) => {
      e && (ze.value = Ol().nextZIndex(), W.value = ""), j.value = e, l.mode == "combobox" && (e || setTimeout(() => {
        var t, a;
        (a = (t = x.value) == null ? void 0 : t.blur) == null || a.call(t);
      })), w("dropdownVisibleChange", e);
    }, il = (e) => {
      let t = e.toString();
      return t.length > l.maxTagTextLength && (t = t.substr(0, l.maxTagTextLength) + "..."), t;
    }, dl = (e) => l.isRenderNode ? O.value : l.getPopupContainer === void 0 ? document.body : l.getPopupContainer(e), cl = (e) => {
      if (e) {
        Array.isArray(n.value) || (n.value = []);
        let t = n.value, a = [];
        l.options.forEach((o) => {
          !n.value.includes(o[k.value]) && !o.disabled && (t.push(o[k.value]), a.push(o));
        }), n.value = t, fe(n.value, a);
      } else {
        let t = n.value;
        n.value = t.filter((a) => {
          const o = l.options.find((h) => h[k.value] === a);
          return o ? !!o.disabled : !1;
        }), fe(n.value, []);
      }
    }, fl = (e) => {
      if (e.className.indexOf("ant-select-multiple") > -1 && e.children[0])
        return e.children[0];
    }, vl = (e) => {
      if (l.mode == "combobox") {
        w("focus", e);
        return;
      }
      se.value = !0, l.focusOpen && !l.isExterControlCount && (i.value = M, y.value = !1), w("focus", e);
    }, j = s(!1), pl = () => {
      j.value || setTimeout(() => {
        var e, t;
        (t = (e = x.value) == null ? void 0 : e.blur) == null || t.call(e);
      }), l.mode != "combobox";
    }, $e = (e) => {
      if (S(() => {
        j.value = !1;
      }), l.mode == "combobox") {
        w("blur", e);
        return;
      }
      se.value = !1, l.focusOpen && !l.isExterControlCount && (z(), i.value = c.value, y.value = !0), w("blur", e);
    }, ml = (e) => {
      e.onClose(), i.value = 100, S(() => {
        l.mode !== "combobox" && re.value || l.focusOpen && (z(), i.value = c.value, y.value = !0);
      });
    };
    X(
      () => l.disabled || l.isView,
      (e) => {
        if (e && l.mode !== "combobox") {
          se.value = !1;
          let t = new Event("blur");
          $e(t);
        }
      }
    );
    let H = s(!1);
    const hl = (e) => {
      H.value = e, V.value = !0, S(() => {
        V.value = !1, l.focusOpen && (z(), i.value = e ? M : c.value, y.value = !e);
      });
    };
    let G = null;
    pe(() => {
      G = new IntersectionObserver((e) => {
        e && e[0] && e[0].intersectionRatio > 0 && l.focusOpen && i.value === 0 && (i.value = 100, S(() => {
          z(), i.value = c.value, y.value = !0;
        }));
      }), G.observe(O.value);
    }), _e(() => {
      G && G.disconnect();
    });
    const z = () => {
      var Z;
      let e = (Z = x.value) == null ? void 0 : Z.$el;
      if (!e) return;
      let t = e == null ? void 0 : e.querySelector(".ant-select-selection-overflow");
      if (!t) return;
      let a = t.offsetWidth - 5;
      l.borderType === "underline" && (a -= 10);
      const h = Math.ceil(Se.value.querySelector(".ant-tag").offsetWidth) + 4;
      let f = e.querySelectorAll(".ant-select-selection-overflow-item");
      if (f.length < 1) return;
      i.value = M;
      let N = 0;
      for (let v = 0; v < f.length - 1 && (f[v].classList.remove("ellipsis"), !f[v].classList.contains("ant-select-selection-overflow-item-rest")); v++)
        if (N += Math.ceil(f[v].offsetWidth), N <= a - h)
          v >= n.value.length - 1 && N < a ? c.value = n.value.length : c.value = v + 1;
        else {
          v >= n.value.length - 1 && N < a ? c.value = n.value.length : c.value = v;
          break;
        }
      if (c.value === 0) {
        let v = f[0], ve = v.querySelector(".anticon-close") ? 86 : 69;
        v && !v.classList.contains("ant-select-selection-overflow-item-rest") && ve <= a - h && !Le.tagRender && (c.value = 1, v.classList.add("ellipsis"));
      }
    }, ce = s(!1);
    X(
      () => n.value,
      async () => {
        if (ce.value) {
          ce.value = !1;
          return;
        }
        l.mode !== "combobox" && re.value || (V.value = !0, i.value = M, await S(), await z(), V.value = !1, l.isExterControlCount && l.focusOpen ? (i.value = H.value ? M : c.value, y.value = !H.value) : (i.value = c.value, y.value = !0));
      }
    );
    const fe = async (e, t) => {
      ce.value = !0, j.value = !1, l.mode === "combobox" && te();
      const a = e;
      l.noDropdown && l.maxTagsLength < a.length && a.pop(), V.value = !0, w("update:model-value", a), w("change", a, t), i.value = M, await S(), await z(), V.value = !1, l.isExterControlCount && l.focusOpen && (i.value = H.value ? M : c.value, y.value = !H.value), l.focusOpen || (i.value = c.value);
    };
    return $({
      $select: x,
      toChangeMaxCount: hl
    }), (e, t) => {
      const a = Cl("v-nodes");
      return p(), g(
        "div",
        {
          class: wl(["das-ui-select", [
            l.borderType,
            l.isView ? "readonly" : "",
            l.error ? "is-error" : "",
            y.value ? "show-ellipsis" : ""
          ]]),
          ref_key: "$selectBox",
          ref: O,
          style: K(ol.value),
          onClick: J(pl, ["stop"])
        },
        [
          le.value ? (p(), q(r(Al), {
            key: 0,
            ref_key: "inputTooltipRef",
            ref: xe,
            placement: "top",
            "virtual-triggering": "",
            "virtual-ref": le.value,
            disabled: Fe.value,
            content: Re.value
          }, null, 8, ["virtual-ref", "disabled", "content"])) : I("v-if", !0),
          he((p(), q(r(Sl), Ce({ mode: Ke.value }, Pe.value, {
            value: r(n),
            "onUpdate:value": t[4] || (t[4] = (o) => xl(n) ? n.value = o : null),
            ref_key: "$select",
            ref: x,
            options: Me.value,
            fieldNames: d.fieldNames,
            bordered: l.borderType === "bordered",
            disabled: l.disabled || l.isView,
            showArrow: !0,
            open: l.noDropdown ? !1 : re.value,
            placeholder: U.value,
            optionFilterProp: tl.value,
            size: Ue.value,
            style: l.size == "mini" || l.size == "table" ? { fontSize: "12px" } : {},
            dropdownClassName: "das-ui-select-dorpdown " + d.dropdownClassName,
            maxTagCount: i.value,
            getPopupContainer: dl,
            dropdownStyle: Ye.value,
            onDropdownVisibleChange: ul,
            onChange: fe,
            onFocus: vl,
            onBlur: $e
          }), Tl({
            option: m((o) => [
              C(e.$slots, "option", Q(Y(o)), () => {
                var h;
                return [
                  o.children && typeof o.children == "function" ? (p(), q(a, {
                    key: 0,
                    vnodes: o.children()
                  }, null, 8, ["vnodes"])) : (p(), g(
                    be,
                    { key: 1 },
                    [
                      I(' :option="{value, label, [disabled, key, title]}" '),
                      d.mode === "combobox" ? he((p(), g("div", Wl, [
                        ye(
                          F(o[L.value]),
                          1
                          /* TEXT */
                        )
                      ])), [
                        [r(Be)]
                      ]) : (p(), g(
                        be,
                        { key: 1 },
                        [
                          I(` <das-tooltip v-if="mode === 'combobox'" placement="right-start" :text="option[labelKeyName]"></das-tooltip> `),
                          b("div", Pl, [
                            (p(), q(r(Oe), {
                              class: "das-select-checkbox",
                              modelValue: (h = r(n)) == null ? void 0 : h.includes(o[k.value]),
                              key: o[k.value],
                              disabled: o.disabled
                            }, null, 8, ["modelValue", "disabled"])),
                            he((p(), g("div", Fl, [
                              ye(
                                F(o[L.value]),
                                1
                                /* TEXT */
                              )
                            ])), [
                              [r(Be)]
                            ])
                          ])
                        ],
                        2112
                        /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
                      ))
                    ],
                    64
                    /* STABLE_FRAGMENT */
                  ))
                ];
              }, !0)
            ]),
            tagRender: m((o) => [
              C(e.$slots, "tagRender", Q(Y(o)), () => [
                T(r(ge), {
                  closable: o.closable,
                  style: { "margin-right": "3px", "background-color": "transparent" },
                  onClose: (h) => ml(o)
                }, {
                  default: m(() => [
                    b(
                      "span",
                      {
                        class: "tag-span",
                        style: K(l.size == "mini" || l.size == "table" ? { fontSize: "12px" } : {})
                      },
                      F(il(ne(o.value) ?? o.label ?? String(o.value))),
                      5
                      /* TEXT, STYLE */
                    )
                  ]),
                  _: 2
                  /* DYNAMIC */
                }, 1032, ["closable", "onClose"])
              ], !0)
            ]),
            dropdownRender: m(({ menuNode: o }) => [
              C(e.$slots, "dropdownRender", Q(Y({ menuNode: o })), () => {
                var h;
                return [
                  Ie.value === "combobox" ? (p(), g("div", Rl, [
                    T(a, { vnodes: o }, null, 8, ["vnodes"])
                  ])) : Ie.value === "custom" ? (p(), g("div", {
                    key: 1,
                    onClick: t[2] || (t[2] = J(() => {
                    }, ["stop"]))
                  }, [
                    T(a, { vnodes: o }, null, 8, ["vnodes"]),
                    b(
                      "div",
                      {
                        class: "customDropdown",
                        onMousedown: t[1] || (t[1] = (f) => f.preventDefault())
                      },
                      [
                        T(r(Ll), Ce({
                          ref_key: "testInput",
                          ref: qe,
                          modelValue: W.value,
                          "onUpdate:modelValue": t[0] || (t[0] = (f) => W.value = f),
                          onKeyup: kl(Ae, ["enter"]),
                          onFocus: J(He, ["stop"]),
                          onBlur: J(Ze, ["stop"]),
                          width: "100%",
                          borderType: "bordered"
                        }, l.inputAttrs), null, 16, ["modelValue"]),
                        b(
                          "div",
                          {
                            class: "addBtn",
                            onClick: Ae
                          },
                          F(r(R)("添加")),
                          1
                          /* TEXT */
                        )
                      ],
                      32
                      /* NEED_HYDRATION */
                    )
                  ])) : (p(), g("div", ql, [
                    T(a, { vnodes: o }, null, 8, ["vnodes"]),
                    (h = l.options) != null && h.length && l.showSelectAll ? (p(), g(
                      "div",
                      {
                        key: 0,
                        class: "das-ui-select-dropdown-checkall",
                        onMousedown: t[3] || (t[3] = (f) => f.preventDefault())
                      },
                      [
                        b("div", Hl, [
                          T(r(Oe), {
                            modelValue: el.value,
                            indeterminate: ll.value,
                            onChange: cl,
                            style: { display: "flex" }
                          }, {
                            default: m(() => [
                              ye(
                                F(r(R)("全选")),
                                1
                                /* TEXT */
                              )
                            ]),
                            _: 1
                            /* STABLE */
                          }, 8, ["modelValue", "indeterminate"])
                        ]),
                        b("span", {
                          class: "das-ui-dropdown-has-checked",
                          innerHTML: r(R)("das-ui-select-selectedItemsCountWithPlaceholder", ee.value)
                        }, null, 8, Zl)
                      ],
                      32
                      /* NEED_HYDRATION */
                    )) : I("v-if", !0)
                  ]))
                ];
              }, !0)
            ]),
            clearIcon: m(() => [
              C(e.$slots, "clearIcon", {}, () => [
                T(r(Vl), { size: "medium" })
              ], !0)
            ]),
            maxTagPlaceholder: m((o) => [
              C(e.$slots, "maxTagPlaceholder", Q(Y(o)), () => [
                I(" 隐藏tag时显示的内容 "),
                T(r(ge), {
                  style: K(l.size == "mini" || l.size == "table" ? { fontSize: "12px" } : {})
                }, {
                  default: m(() => [
                    b("span", {
                      innerHTML: r(R)("das-ui-select-selectedItemsCountWithPlaceholder", ee.value)
                    }, null, 8, Kl)
                  ]),
                  _: 1
                  /* STABLE */
                }, 8, ["style"]),
                I(" <a-tag>+{{ currValue?.length - maxTagCountCell }}</a-tag> ")
              ], !0)
            ]),
            notFoundContent: m(() => [
              C(e.$slots, "notFoundContent", {}, () => [
                t[5] || (t[5] = b(
                  "div",
                  { class: "hasNoData" },
                  "暂无数据",
                  -1
                  /* CACHED */
                ))
              ], !0)
            ]),
            suffixIcon: m(() => [
              C(e.$slots, "suffixIcon", {}, () => [
                T(r(Ml), {
                  class: "das-suffix-icon",
                  size: "medium"
                })
              ], !0)
            ]),
            default: m(() => [
              C(e.$slots, "default", {}, void 0, !0)
            ]),
            _: 2
            /* DYNAMIC */
          }, [
            e.$slots.menuItemSelectedIcon ? {
              name: "menuItemSelectedIcon",
              fn: m(() => [
                C(e.$slots, "menuItemSelectedIcon", {}, void 0, !0)
              ]),
              key: "0"
            } : void 0,
            e.$slots.placeholder ? {
              name: "placeholder",
              fn: m(() => [
                C(e.$slots, "placeholder", {}, void 0, !0)
              ]),
              key: "1"
            } : void 0,
            e.$slots.removeIcon ? {
              name: "removeIcon",
              fn: m(() => [
                C(e.$slots, "removeIcon", {}, void 0, !0)
              ]),
              key: "2"
            } : void 0
          ]), 1040, ["mode", "value", "options", "fieldNames", "bordered", "disabled", "open", "placeholder", "optionFilterProp", "size", "style", "dropdownClassName", "maxTagCount", "dropdownStyle"])), [
            [r(Il), { target: fl, x: !1 }],
            [r(Nl), rl]
          ]),
          d.error && d.errorLabel ? (p(), g(
            be,
            { key: 1 },
            [
              d.errorMode === "default" ? (p(), g("div", Ul, [
                b(
                  "span",
                  {
                    style: K(al.value)
                  },
                  F(d.errorLabel),
                  5
                  /* TEXT, STYLE */
                )
              ])) : I("v-if", !0),
              d.errorMode === "overlay" && de.value ? (p(), q(r(zl), {
                key: 1,
                errorLabel: d.errorLabel,
                getEl: () => x.value.$el,
                errorModelZIndex: d.errorModelZIndex
              }, null, 8, ["errorLabel", "getEl", "errorModelZIndex"])) : I("v-if", !0)
            ],
            64
            /* STABLE_FRAGMENT */
          )) : I("v-if", !0),
          b(
            "div",
            {
              class: "ant-select-selection-overflow",
              ref_key: "virtualTotalCount",
              ref: Se,
              style: { position: "absolute", left: "-50%", top: "-50%", opacity: "0", "pointer-events": "none" }
            },
            [
              b("div", jl, [
                b("div", Gl, [
                  b("span", Xl, [
                    T(r(ge), {
                      style: K(l.size == "mini" || l.size == "table" ? { fontSize: "12px" } : {})
                    }, {
                      default: m(() => [
                        b("span", {
                          innerHTML: r(R)("das-ui-select-selectedItemsCountWithPlaceholder", ee.value)
                        }, null, 8, Jl)
                      ]),
                      _: 1
                      /* STABLE */
                    }, 8, ["style"])
                  ])
                ])
              ])
            ],
            512
            /* NEED_PATCH */
          )
        ],
        6
        /* CLASS, STYLE */
      );
    };
  }
}), We = (d, $) => {
  const _ = d.__vccOpts || d;
  for (const [l, w] of $)
    _[l] = w;
  return _;
}, et = /* @__PURE__ */ We(Yl, [["__scopeId", "data-v-93ba5608"]]), lt = {};
function tt(d, $) {
  const _ = El;
  return p(), q(
    _,
    Ce({ class: "das-ui-select-option" }, d.$attrs),
    null,
    16
    /* FULL_PROPS */
  );
}
const ot = /* @__PURE__ */ We(lt, [["render", tt]]), at = {
  添加: { "zh-CN": "添加", en: "Add", "zh-MO": "添加", _appCode: "framework" },
  全选: { "zh-CN": "全选", en: "Select All", "zh-MO": "全選", _appCode: "framework" },
  已选: { "zh-CN": "已选", en: "Selected", "zh-MO": "已選", _appCode: "framework" },
  "das-ui-select-selectedItemsCountWithPlaceholder": {
    "zh-CN": "已选$0项",
    en: "$0 Items Selected",
    "zh-MO": "已選$0項",
    _appCode: "framework"
  }
};
_l(at);
const St = De(et), It = De(ot), At = { name: "select 选择器" };
export {
  St as DasSelect,
  It as DasSelectOption,
  At as default
};
