import { defineComponent as x, openBlock as u, createElementBlock as v, createVNode as l, unref as k, createElementVNode as w, toDisplayString as b, ref as m, onMounted as z, computed as B, resolveComponent as C, resolveDirective as D, Fragment as V, withCtx as _, createTextVNode as I, withDirectives as M, renderList as N, createBlock as U, normalizeClass as q } from "vue";
import { l as L, _ as y, m as E, a as O } from "./index-597e6e44.mjs";
const R = { class: "name" }, j = /* @__PURE__ */ x({
  __name: "pickerSingle",
  props: {
    icon: {
      type: String,
      required: !0,
      default: ""
    }
  },
  emits: ["iconChoosed"],
  setup(d, { emit: p }) {
    let i = d;
    const s = p;
    function e() {
      s("iconChoosed", i.icon);
    }
    return (c, t) => (u(), v("div", {
      class: "icon-holder",
      onClick: e
    }, [
      l(L, {
        size: "3em",
        icon: k(i).icon,
        onClick: e
      }, null, 8, ["icon"]),
      w("span", R, b(d.icon), 1)
    ]));
  }
});
const A = /* @__PURE__ */ y(j, [["__scopeId", "data-v-11fae865"]]), F = { class: "icon-list" }, T = /* @__PURE__ */ x({
  __name: "pickerList",
  emits: ["iconChoosed", "closePopover"],
  setup(d, { expose: p, emit: i }) {
    const s = i, e = m([]), c = m(""), t = m(0), f = () => {
      t.value = Math.min(t.value + 60, r.value.length), console.log("load is called" + t.value);
    };
    z(() => {
      let o = [];
      for (const [n] of Object.entries(E))
        o.push(n);
      e.value = o;
    });
    const r = B(() => c.value ? e.value.filter((o) => o.toUpperCase().indexOf(c.value.toUpperCase()) >= 0) : e.value);
    function g() {
      f();
    }
    return p({ show: g }), (o, n) => {
      const h = C("el-button"), P = C("el-button-group"), S = C("el-input"), $ = D("infinite-scroll");
      return u(), v(V, null, [
        l(S, {
          modelValue: c.value,
          "onUpdate:modelValue": n[2] || (n[2] = (a) => c.value = a),
          clearable: ""
        }, {
          append: _(() => [
            l(P, null, {
              default: _(() => [
                l(h, {
                  onClick: n[0] || (n[0] = (a) => s("iconChoosed", void 0))
                }, {
                  default: _(() => [
                    I(b(o.$t("_._.clear")), 1)
                  ]),
                  _: 1
                }),
                l(h, {
                  onClick: n[1] || (n[1] = (a) => s("closePopover"))
                }, {
                  default: _(() => [
                    I(b(o.$t("_._.close")), 1)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"]),
        M((u(), v("ul", F, [
          (u(!0), v(V, null, N(Math.min(t.value, r.value.length), (a) => (u(), v("li", {
            key: a,
            class: "icon-item"
          }, [
            l(A, {
              icon: r.value[a - 1],
              onIconChoosed: (J) => s("iconChoosed", k(O)(r.value[a - 1]))
            }, null, 8, ["icon", "onIconChoosed"])
          ]))), 128))
        ])), [
          [$, f]
        ])
      ], 64);
    };
  }
});
const G = /* @__PURE__ */ y(T, [["__scopeId", "data-v-943844bb"]]), H = /* @__PURE__ */ x({
  __name: "index",
  props: {
    modelValue: {
      type: String,
      required: !1,
      default: ""
    }
  },
  emits: ["update:modelValue"],
  setup(d, { emit: p }) {
    let i = d;
    const s = p, e = m(!1);
    function c() {
      e.value = !0;
    }
    const t = m(null);
    function f() {
      t.value.show();
    }
    function r(o) {
      s("update:modelValue", o), e.value = !1;
    }
    const g = () => {
      e.value = !1;
    };
    return (o, n) => {
      const h = C("el-popover");
      return u(), U(h, {
        visible: e.value,
        placement: "bottom",
        width: "100%",
        teleported: !0,
        onShow: f
      }, {
        reference: _(() => [
          w("div", {
            class: q(["icon", { icon_empty: !k(i).modelValue }]),
            onClick: c
          }, [
            l(L, {
              size: "large",
              icon: k(i).modelValue
            }, null, 8, ["icon"])
          ], 2)
        ]),
        default: _(() => [
          l(G, {
            ref_key: "pickerListRef",
            ref: t,
            onIconChoosed: r,
            onClosePopover: g
          }, null, 512)
        ]),
        _: 1
      }, 8, ["visible"]);
    };
  }
});
const W = /* @__PURE__ */ y(H, [["__scopeId", "data-v-f675c29a"]]);
export {
  W as default
};
