import { n as e, t } from "../../utils-CSEWuKHo.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 = d(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 = y(n), this.applyAccessibility(n), this.svg = f(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(e = {}) {
		this.el = p(e), e.container !== void 0 && t(e.container).appendChild(this.el);
	}
	destroy() {
		this.el.remove();
	}
}, u = class {
	el;
	constructor(n) {
		if (this.el = document.createElement("span"), this.el.id = e("cmm-connector-logo"), this.el.className = x(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 = g(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 d(t = {}) {
	let n = t.size ?? 24, r = C("0 0 46.64 46.64", n, n);
	r.id = e("cmm-diamond"), r.classList.add("cmm-diamond");
	let i = _("cmm-diamond", n);
	return i !== null && r.classList.add(i), t.className && r.classList.add(...D(t.className)), t.decorative === !1 ? (r.setAttribute("role", "img"), r.setAttribute("aria-label", t.label ?? "CounterMeasure diamond")) : r.setAttribute("aria-hidden", "true"), w(r, "cmm-diamond__foreground"), r;
}
function f(e = {}) {
	let t = e.size ?? 32, i = C("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)"), T(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 p(t = {}) {
	let n = document.createElement("span");
	if (n.id = e("cmm-brand-lockup"), n.className = b(t), t.decorative === !0 ? n.setAttribute("aria-hidden", "true") : (n.setAttribute("role", "img"), n.setAttribute("aria-label", t.label ?? "CounterMeasure")), n.appendChild(d({
		size: t.markSize ?? 22,
		decorative: !0
	})), t.showWordmark !== !1) {
		let e = document.createElement("span");
		e.className = "cmm-brand-lockup__wordmark", e.setAttribute("aria-hidden", "true");
		let t = document.createElement("span");
		t.className = "cmm-brand-lockup__counter", t.textContent = "COUNTER";
		let r = document.createElement("span");
		r.className = "cmm-brand-lockup__measure", r.textContent = "MEASURE", e.append(t, r), n.appendChild(e);
	}
	return n;
}
function m(e) {
	return i[S(e)];
}
function h(e) {
	return a[S(e)];
}
function g(e) {
	return e.trim().match(/[A-Za-z0-9]/)?.[0]?.toUpperCase() ?? "C";
}
function _(e, t) {
	return o.has(t) ? `${e}--${String(t)}` : null;
}
function v(e = 32) {
	return `cmm-connector-logo--${String(e)}`;
}
function y(e) {
	let t = ["cmm-wordmark", `cmm-wordmark--${e.variant ?? "auto"}`];
	return e.className && t.push(e.className), t.join(" ");
}
function b(e) {
	let t = ["cmm-brand-lockup"];
	return e.className && t.push(e.className), t.join(" ");
}
function x(e) {
	let t = [
		"cmm-connector-logo",
		v(e.size),
		`cmm-connector-logo--vendor-${h(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 S(e) {
	let t = e.trim().toLowerCase();
	for (let e of Object.keys(i)) if (e.toLowerCase() === t) return e;
	return "default";
}
function C(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 w(e, t) {
	e.appendChild(E("2.62", "16.42", "13.8", "13.8", "0.57", "-13.7 13.56", t)), e.appendChild(E("16.42", "30.22", "13.8", "13.8", "0.57", "-19.42 27.36", "cmm-diamond__slate")), e.appendChild(E("16.42", "2.62", "13.8", "13.8", "0.57", "0.1 19.28", "cmm-diamond__orange"));
}
function T(e) {
	e.appendChild(E("1.78", "11.16", "9.4", "9.4", "0.4", "-9.32 9.22", "cmm-wordmark__foreground")), e.appendChild(E("11.16", "20.54", "9.4", "9.4", "0.4", "-13.21 18.6", "cmm-wordmark__slate")), e.appendChild(E("11.16", "1.78", "9.4", "9.4", "0.4", "0.07 13.11", "cmm-wordmark__orange"));
}
function E(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 D(e) {
	return e.split(/\s+/).filter(Boolean);
}
//#endregion
export { l as BrandLockup, i as CONNECTOR_LOGO_PALETTE, u as ConnectorLogo, s as Diamond, c as Wordmark, p as createBrandLockupElement, d as createDiamondSvg, f as createWordmarkSvg, _ as getBrandSizeClass, m as getConnectorLogoColor, g as getConnectorLogoInitial, v as getConnectorLogoSizeClass, h as getConnectorLogoTone };

//# sourceMappingURL=index.js.map