import { n as e, t } from "../../utils-C_mWfcFX.js";
//#region src/components/brand/index.ts
var n = "http://www.w3.org/2000/svg", r = 220 / 32, i = {
	Splunk: "#FF6B35",
	Sentinel: "#0078D4",
	Elastic: "#00BFB3",
	CrowdStrike: "#FA0F00",
	Defender: "#0078D4",
	SentinelOne: "#6300E5",
	MISP: "#00897B",
	OpenCTI: "#5C6BC0",
	"MITRE ATT&CK": "#C8102E",
	"Palo Alto": "#FA582D",
	"Carbon Black": "#000000",
	default: "#475569"
}, a = {
	Splunk: "splunk",
	Sentinel: "sentinel",
	Elastic: "elastic",
	CrowdStrike: "crowdstrike",
	Defender: "defender",
	SentinelOne: "sentinelone",
	MISP: "misp",
	OpenCTI: "opencti",
	"MITRE ATT&CK": "mitre-attack",
	"Palo Alto": "palo-alto",
	"Carbon Black": "carbon-black",
	default: "default"
}, o = new Set([
	16,
	20,
	24,
	32,
	48,
	64
]), s = class {
	el;
	constructor(e = {}) {
		this.el = u(e), e.container !== void 0 && t(e.container).appendChild(this.el);
	}
	destroy() {
		this.el.remove();
	}
}, c = class {
	el;
	svg;
	subtitleEl = null;
	constructor(n = {}) {
		this.el = document.createElement("div"), this.el.id = e("cmm-wordmark"), this.el.className = _(n), this.applyAccessibility(n), this.svg = d(n), this.svg.setAttribute("aria-hidden", "true"), this.el.appendChild(this.svg), n.subtitle !== void 0 && (this.subtitleEl = document.createElement("span"), this.subtitleEl.className = "cmm-wordmark__subtitle", this.subtitleEl.textContent = n.subtitle, this.el.appendChild(this.subtitleEl)), n.container !== void 0 && t(n.container).appendChild(this.el);
	}
	setSubtitle(e) {
		if (e === null) {
			this.subtitleEl?.remove(), this.subtitleEl = null;
			return;
		}
		this.subtitleEl === null && (this.subtitleEl = document.createElement("span"), this.subtitleEl.className = "cmm-wordmark__subtitle", this.el.appendChild(this.subtitleEl)), this.subtitleEl.textContent = e;
	}
	destroy() {
		this.el.remove();
	}
	applyAccessibility(e) {
		if (e.decorative === !0) {
			this.el.setAttribute("aria-hidden", "true");
			return;
		}
		this.el.setAttribute("role", "img"), this.el.setAttribute("aria-label", e.label ?? "CounterMeasure");
	}
}, l = class {
	el;
	constructor(n) {
		if (this.el = document.createElement("span"), this.el.id = e("cmm-connector-logo"), this.el.className = v(n), this.applyAccessibility(n), n.src !== void 0) {
			let e = document.createElement("img");
			e.className = "cmm-connector-logo__asset", e.src = n.src, e.alt = "", e.setAttribute("aria-hidden", "true"), this.el.appendChild(e);
		} else if (n.svg !== void 0) {
			let e = document.createElement("span");
			e.className = "cmm-connector-logo__asset", e.setAttribute("aria-hidden", "true"), e.appendChild(n.svg), this.el.appendChild(e);
		} else this.el.textContent = m(n.name);
		n.container !== void 0 && t(n.container).appendChild(this.el);
	}
	destroy() {
		this.el.remove();
	}
	applyAccessibility(e) {
		if (e.decorative === !0) {
			this.el.setAttribute("aria-hidden", "true");
			return;
		}
		this.el.setAttribute("role", "img"), this.el.setAttribute("aria-label", e.label ?? `${e.name} connector`);
	}
};
function u(t = {}) {
	let n = t.size ?? 24, r = b("0 0 46.64 46.64", n, n);
	r.id = e("cmm-diamond"), r.classList.add("cmm-diamond");
	let i = h("cmm-diamond", n);
	return i !== null && r.classList.add(i), t.className && r.classList.add(...w(t.className)), t.decorative === !1 ? (r.setAttribute("role", "img"), r.setAttribute("aria-label", t.label ?? "CounterMeasure diamond")) : r.setAttribute("aria-hidden", "true"), x(r, "cmm-diamond__foreground"), r;
}
function d(e = {}) {
	let t = e.size ?? 32, i = b("0 0 220 32", Math.round(t * r * 100) / 100, t);
	i.classList.add("cmm-wordmark__svg");
	let a = document.createElementNS(n, "g");
	a.setAttribute("transform", "translate(0,3)"), S(a), i.appendChild(a);
	let o = document.createElementNS(n, "text");
	return o.setAttribute("x", "42"), o.setAttribute("y", "22"), o.setAttribute("class", "cmm-wordmark__text"), o.setAttribute("font-family", "Outfit, sans-serif"), o.setAttribute("font-size", "18"), o.setAttribute("font-weight", "600"), o.setAttribute("letter-spacing", "-0.01em"), o.textContent = "CounterMeasure", i.appendChild(o), i;
}
function f(e) {
	return i[y(e)];
}
function p(e) {
	return a[y(e)];
}
function m(e) {
	return e.trim().match(/[A-Za-z0-9]/)?.[0]?.toUpperCase() ?? "C";
}
function h(e, t) {
	return o.has(t) ? `${e}--${String(t)}` : null;
}
function g(e = 32) {
	return `cmm-connector-logo--${String(e)}`;
}
function _(e) {
	let t = ["cmm-wordmark", `cmm-wordmark--${e.variant ?? "auto"}`];
	return e.className && t.push(e.className), t.join(" ");
}
function v(e) {
	let t = [
		"cmm-connector-logo",
		g(e.size),
		`cmm-connector-logo--vendor-${p(e.name)}`
	];
	return (e.src !== void 0 || e.svg !== void 0) && t.push("cmm-connector-logo--asset"), e.className && t.push(e.className), t.join(" ");
}
function y(e) {
	let t = e.trim().toLowerCase();
	for (let e of Object.keys(i)) if (e.toLowerCase() === t) return e;
	return "default";
}
function b(e, t, r) {
	let i = document.createElementNS(n, "svg");
	return i.setAttribute("xmlns", n), i.setAttribute("viewBox", e), i.setAttribute("width", String(t)), i.setAttribute("height", String(r)), i;
}
function x(e, t) {
	e.appendChild(C("2.62", "16.42", "13.8", "13.8", "0.57", "-13.7 13.56", t)), e.appendChild(C("16.42", "30.22", "13.8", "13.8", "0.57", "-19.42 27.36", "cmm-diamond__slate")), e.appendChild(C("16.42", "2.62", "13.8", "13.8", "0.57", "0.1 19.28", "cmm-diamond__orange"));
}
function S(e) {
	e.appendChild(C("1.78", "11.16", "9.4", "9.4", "0.4", "-9.32 9.22", "cmm-wordmark__foreground")), e.appendChild(C("11.16", "20.54", "9.4", "9.4", "0.4", "-13.21 18.6", "cmm-wordmark__slate")), e.appendChild(C("11.16", "1.78", "9.4", "9.4", "0.4", "0.07 13.11", "cmm-wordmark__orange"));
}
function C(e, t, r, i, a, o, s) {
	let c = document.createElementNS(n, "rect");
	return c.setAttribute("x", e), c.setAttribute("y", t), c.setAttribute("width", r), c.setAttribute("height", i), c.setAttribute("rx", a), c.setAttribute("transform", `translate(${o}) rotate(-45)`), c.setAttribute("class", s), c;
}
function w(e) {
	return e.split(/\s+/).filter(Boolean);
}
//#endregion
export { i as CONNECTOR_LOGO_PALETTE, l as ConnectorLogo, s as Diamond, c as Wordmark, u as createDiamondSvg, d as createWordmarkSvg, h as getBrandSizeClass, f as getConnectorLogoColor, m as getConnectorLogoInitial, g as getConnectorLogoSizeClass, p as getConnectorLogoTone };

//# sourceMappingURL=index.js.map