import { ref as u, createElementBlock as s, openBlock as n, createCommentVNode as h, createElementVNode as e, toDisplayString as m, Fragment as k, renderList as y, withDirectives as C, vModelCheckbox as b } from "vue";
/* empty css                */
import x from "../../../_virtual/_plugin-vue_export-helper.js";
const I = {
  key: 0,
  class: "new-chat-modal"
}, w = { class: "modal-content" }, S = { class: "participant-list" }, U = ["id", "value"], V = ["for"], g = {
  __name: "SelectUser",
  props: {
    users: {
      type: Array,
      required: !0
    },
    title: {
      type: String,
      required: !0
    }
  },
  emits: ["confirm", "close"],
  setup(l, { emit: p }) {
    const r = u(!0), o = u([]), c = p, v = async () => {
      c("confirm", o.value), a(), i();
    }, a = () => {
      c("close"), r.value = !1;
    }, i = () => {
      o.value = [];
    }, _ = () => {
      a(), i();
    };
    return (M, d) => (n(), s("div", null, [
      r.value ? (n(), s("div", I, [
        e("div", w, [
          e("h2", null, m(l.title), 1),
          e("div", S, [
            (n(!0), s(k, null, y(l.users, (t) => (n(), s("div", {
              key: t.userId,
              class: "participant-item"
            }, [
              C(e("input", {
                id: t.userId,
                "onUpdate:modelValue": d[0] || (d[0] = (f) => o.value = f),
                type: "checkbox",
                value: t.userId
              }, null, 8, U), [
                [b, o.value]
              ]),
              e("label", {
                for: t.userId
              }, m(t.name || "unknown username"), 9, V)
            ]))), 128))
          ]),
          e("div", { class: "modal-actions" }, [
            e("button", { onClick: v }, " ОК "),
            e("button", { onClick: _ }, " Отмена ")
          ])
        ])
      ])) : h("", !0)
    ]));
  }
}, E = /* @__PURE__ */ x(g, [["__scopeId", "data-v-9121a142"]]);
export {
  E as default
};
