import { M as e, Mt as t, Ot as n, P as r, S as i, _ as a, d as o, g as s, h as c, it as l, m as u, p as d } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
import "./useEditorCore-D0uZbPKG.js";
import { n as f } from "./_plugin-vue_export-helper-GRmvIR5A.js";
import { n as p } from "./useCloudI18n-D0Fi0hBU.js";
import { t as m } from "./readableTextColor-Uc7ntzXo.js";
var h = f("wifi-off", [
	["path", {
		d: "M12 20h.01",
		key: "zekei9"
	}],
	["path", {
		d: "M8.5 16.429a5 5 0 0 1 7 0",
		key: "1bycff"
	}],
	["path", {
		d: "M5 12.859a10 10 0 0 1 5.17-2.69",
		key: "1dl1wf"
	}],
	["path", {
		d: "M19 12.859a10 10 0 0 0-2.007-1.523",
		key: "4k23kn"
	}],
	["path", {
		d: "M2 8.82a15 15 0 0 1 4.177-2.643",
		key: "1grhjp"
	}],
	["path", {
		d: "M22 8.82a15 15 0 0 0-11.288-3.764",
		key: "z3jwby"
	}],
	["path", {
		d: "m2 2 20 20",
		key: "1ooewy"
	}]
]), g = f("wifi", [
	["path", {
		d: "M12 20h.01",
		key: "zekei9"
	}],
	["path", {
		d: "M2 8.82a15 15 0 0 1 20 0",
		key: "dnpr2z"
	}],
	["path", {
		d: "M5 12.859a10 10 0 0 1 14 0",
		key: "1x1e6c"
	}],
	["path", {
		d: "M8.5 16.429a5 5 0 0 1 7 0",
		key: "1bycff"
	}]
]), _ = { class: "tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2" }, v = ["title"], y = {
	key: 0,
	class: "tpl:flex tpl:items-center tpl:-space-x-1.5"
}, b = ["title"], x = ["title"], S = 3, C = /* @__PURE__ */ i({
	__name: "CollaboratorBar",
	props: {
		collaborators: {},
		isConnected: { type: Boolean }
	},
	setup(i) {
		let f = i, { t: C } = p(), w = d(() => f.collaborators.slice(0, S)), T = d(() => f.collaborators.slice(S)), E = d(() => T.value.length), D = d(() => T.value.map((e) => e.name).join("\n"));
		function O(e) {
			let t = e.trim().split(/\s+/);
			return t.length >= 2 ? (t[0].charAt(0) + t[t.length - 1].charAt(0)).toUpperCase() : e.charAt(0).toUpperCase();
		}
		return (d, f) => (e(), a("div", _, [u("div", {
			class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]",
			style: n({ color: i.isConnected ? "var(--tpl-success)" : "var(--tpl-text-muted)" }),
			title: i.isConnected ? l(C).collaboration.connected : l(C).collaboration.disconnected
		}, [i.isConnected ? (e(), c(l(g), {
			key: 0,
			size: 12,
			"stroke-width": 2
		})) : (e(), c(l(h), {
			key: 1,
			size: 12,
			"stroke-width": 2
		}))], 12, v), i.collaborators.length > 0 ? (e(), a("div", y, [(e(!0), a(o, null, r(w.value, (r) => (e(), a("div", {
			key: r.id,
			class: "tpl-collaborator-avatar tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[10px] tpl:font-bold tpl:transition-transform tpl:duration-150 tpl:hover:z-10 tpl:hover:scale-110 tpl:border-[var(--tpl-bg)]",
			style: n({
				backgroundColor: r.color,
				color: l(m)(r.color)
			}),
			title: r.name
		}, t(O(r.name)), 13, b))), 128)), E.value > 0 ? (e(), a("div", {
			key: 0,
			class: "tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[9px] tpl:font-bold tpl:border-[var(--tpl-bg)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]",
			title: D.value
		}, " +" + t(E.value), 9, x)) : s("", !0)])) : s("", !0)]));
	}
});
//#endregion
export { C as default };
