import { ref as a, createElementBlock as n, openBlock as s, createElementVNode as i, createCommentVNode as f, createVNode as p, unref as c } from "vue";
import { t as m } from "../../../locale/useLocale.js";
import h from "../../1_icons/SearchIcon.vue.js";
import v from "../../1_icons/CloseButtonIcon.vue.js";
/* empty css                */
import I from "../../../_virtual/_plugin-vue_export-helper.js";
const C = { class: "chat-filter__container" }, k = { class: "chat-filter__icon" }, x = ["placeholder"], y = {
  __name: "ChatFilter",
  props: {
    placeholder: {
      type: String,
      required: !1,
      default: null
    }
  },
  emits: ["update"],
  setup(r, { emit: u }) {
    const t = a(""), l = u, o = a(""), d = () => {
      const e = c(t);
      o.value = e.value, l("update", e.value);
    }, _ = () => {
      const e = c(t);
      e.value = "", o.value = "", l("update", ""), e.focus();
    };
    return (e, V) => (s(), n("div", C, [
      i("div", k, [
        p(h)
      ]),
      i("input", {
        ref_key: "refInput",
        ref: t,
        class: "chat-filter__input",
        type: "text",
        placeholder: r.placeholder ? r.placeholder : c(m)("component.ChatFilter.InputPlaceholder"),
        onInput: d
      }, null, 40, x),
      o.value ? (s(), n("div", {
        key: 0,
        class: "chat-filter__clear",
        onClick: _
      }, [
        p(v)
      ])) : f("", !0)
    ]));
  }
}, q = /* @__PURE__ */ I(y, [["__scopeId", "data-v-21a6c84e"]]);
export {
  q as default
};
