import { createDOMElementFilter as e, format as t, plugins as n } from "../../pretty-format/dist/index.js";
//#region ../../node_modules/@vitest/utils/dist/display.js
var r = {
	bold: ["1", "22"],
	dim: ["2", "22"],
	italic: ["3", "23"],
	underline: ["4", "24"],
	inverse: ["7", "27"],
	hidden: ["8", "28"],
	strike: ["9", "29"],
	black: ["30", "39"],
	red: ["31", "39"],
	green: ["32", "39"],
	yellow: ["33", "39"],
	blue: ["34", "39"],
	magenta: ["35", "39"],
	cyan: ["36", "39"],
	white: ["37", "39"],
	brightblack: ["30;1", "39"],
	brightred: ["31;1", "39"],
	brightgreen: ["32;1", "39"],
	brightyellow: ["33;1", "39"],
	brightblue: ["34;1", "39"],
	brightmagenta: ["35;1", "39"],
	brightcyan: ["36;1", "39"],
	brightwhite: ["37;1", "39"],
	grey: ["90", "39"]
}, i = {
	special: "cyan",
	number: "yellow",
	bigint: "yellow",
	boolean: "yellow",
	undefined: "grey",
	null: "bold",
	string: "green",
	symbol: "green",
	date: "magenta",
	regexp: "red"
}, a = "…";
function o(e, t) {
	let n = r[i[t]] || r[t] || "";
	return n ? `\u001b[${n[0]}m${String(e)}\u001b[${n[1]}m` : String(e);
}
function s({ showHidden: e = !1, depth: t = 2, colors: n = !1, customInspect: r = !0, showProxy: i = !1, maxArrayLength: a = Infinity, breakLength: s = Infinity, seen: c = [], truncate: l = Infinity, stylize: u = String } = {}, d) {
	let f = {
		showHidden: !!e,
		depth: Number(t),
		colors: !!n,
		customInspect: !!r,
		showProxy: !!i,
		maxArrayLength: Number(a),
		breakLength: Number(s),
		truncate: Number(l),
		seen: c,
		inspect: d,
		stylize: u
	};
	return f.colors && (f.stylize = o), f;
}
function c(e) {
	return e >= "\ud800" && e <= "\udbff";
}
function l(e, t, n = a) {
	e = String(e);
	let r = n.length, i = e.length;
	if (r > t && i > r) return n;
	if (i > t && i > r) {
		let i = t - r;
		return i > 0 && c(e[i - 1]) && --i, `${e.slice(0, i)}${n}`;
	}
	return e;
}
function u(e, t, n, r = ", ") {
	n ||= t.inspect;
	let i = e.length;
	if (i === 0) return "";
	let o = t.truncate, s = "", c = "", l = "";
	for (let u = 0; u < i; u += 1) {
		let i = u + 1 === e.length, d = u + 2 === e.length;
		l = `${a}(${e.length - u})`;
		let f = e[u];
		t.truncate = o - s.length - (i ? 0 : r.length);
		let p = c || n(f, t) + (i ? "" : r), m = s.length + p.length, h = m + l.length;
		if (i && m > o && s.length + l.length <= o || !i && !d && h > o || (c = i ? "" : n(e[u + 1], t) + (d ? "" : r), !i && d && h > o && m + c.length > o)) break;
		if (s += p, !i && !d && m + c.length >= o) {
			l = `${a}(${e.length - u - 1})`;
			break;
		}
		l = "";
	}
	return `${s}${l}`;
}
function d(e) {
	return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/) ? e : JSON.stringify(e).replace(/'/g, "\\'").replace(/\\"/g, "\"").replace(/(^"|"$)/g, "'");
}
function f([e, t], n) {
	return n.truncate -= 2, typeof e == "string" ? e = d(e) : typeof e != "number" && (e = `[${n.inspect(e, n)}]`), n.truncate -= e.length, t = n.inspect(t, n), `${e}: ${t}`;
}
function p(e, t) {
	let n = Object.keys(e).slice(e.length);
	if (!e.length && !n.length) return "[]";
	t.truncate -= 4;
	let r = u(e, t);
	t.truncate -= r.length;
	let i = "";
	return n.length && (i = u(n.map((t) => [t, e[t]]), t, f)), `[ ${r}${i ? `, ${i}` : ""} ]`;
}
var m = (e) => typeof Buffer == "function" && e instanceof Buffer ? "Buffer" : e[Symbol.toStringTag] ? e[Symbol.toStringTag] : e.constructor.name;
function h(e, t) {
	let n = m(e);
	t.truncate -= n.length + 4;
	let r = Object.keys(e).slice(e.length);
	if (!e.length && !r.length) return `${n}[]`;
	let i = "";
	for (let n = 0; n < e.length; n++) {
		let r = `${t.stylize(l(e[n], t.truncate), "number")}${n === e.length - 1 ? "" : ", "}`;
		if (t.truncate -= r.length, e[n] !== e.length && t.truncate <= 3) {
			i += `${a}(${e.length - e[n] + 1})`;
			break;
		}
		i += r;
	}
	let o = "";
	return r.length && (o = u(r.map((t) => [t, e[t]]), t, f)), `${n}[ ${i}${o ? `, ${o}` : ""} ]`;
}
function ee(e, t) {
	let n = e.toJSON();
	if (n === null) return "Invalid Date";
	let r = n.split("T"), i = r[0];
	return t.stylize(`${i}T${l(r[1], t.truncate - i.length - 1)}`, "date");
}
function g(e, t) {
	let n = e[Symbol.toStringTag] || "Function", r = e.name;
	return r ? t.stylize(`[${n} ${l(r, t.truncate - 11)}]`, "special") : t.stylize(`[${n}]`, "special");
}
function te([e, t], n) {
	return n.truncate -= 4, e = n.inspect(e, n), n.truncate -= e.length, t = n.inspect(t, n), `${e} => ${t}`;
}
function _(e) {
	let t = [];
	return e.forEach((e, n) => {
		t.push([n, e]);
	}), t;
}
function v(e, t) {
	return e.size === 0 ? "Map{}" : (t.truncate -= 7, `Map{ ${u(_(e), t, te)} }`);
}
var y = Number.isNaN || ((e) => e !== e);
function b(e, t) {
	return y(e) ? t.stylize("NaN", "number") : e === Infinity ? t.stylize("Infinity", "number") : e === -Infinity ? t.stylize("-Infinity", "number") : e === 0 ? t.stylize(1 / e == Infinity ? "+0" : "-0", "number") : t.stylize(l(String(e), t.truncate), "number");
}
function x(e, t) {
	let n = l(e.toString(), t.truncate - 1);
	return n !== a && (n += "n"), t.stylize(n, "bigint");
}
function S(e, t) {
	let n = e.toString().split("/")[2], r = t.truncate - (2 + n.length), i = e.source;
	return t.stylize(`/${l(i, r)}/${n}`, "regexp");
}
function C(e) {
	let t = [];
	return e.forEach((e) => {
		t.push(e);
	}), t;
}
function w(e, t) {
	return e.size === 0 ? "Set{}" : (t.truncate -= 7, `Set{ ${u(C(e), t)} }`);
}
var T = /* @__PURE__ */ RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g"), E = {
	"\b": "\\b",
	"	": "\\t",
	"\n": "\\n",
	"\f": "\\f",
	"\r": "\\r",
	"'": "\\'",
	"\\": "\\\\"
}, D = 16;
function O(e) {
	return E[e] || `\\u${`0000${e.charCodeAt(0).toString(D)}`.slice(-4)}`;
}
function k(e, t) {
	return T.test(e) && (e = e.replace(T, O)), t.stylize(`'${l(e, t.truncate - 2)}'`, "string");
}
function A(e) {
	return "description" in Symbol.prototype ? e.description ? `Symbol(${e.description})` : "Symbol()" : e.toString();
}
var j = () => "Promise{…}";
function M(e, t) {
	let n = Object.getOwnPropertyNames(e), r = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e) : [];
	if (n.length === 0 && r.length === 0) return "{}";
	if (t.truncate -= 4, t.seen = t.seen || [], t.seen.includes(e)) return "[Circular]";
	t.seen.push(e);
	let i = u(n.map((t) => [t, e[t]]), t, f), a = u(r.map((t) => [t, e[t]]), t, f);
	t.seen.pop();
	let o = "";
	return i && a && (o = ", "), `{ ${i}${o}${a} }`;
}
var N = typeof Symbol < "u" && Symbol.toStringTag ? Symbol.toStringTag : !1;
function ne(e, t) {
	let n = "";
	return N && N in e && (n = e[N]), n ||= e.constructor.name, (!n || n === "_class") && (n = "<Anonymous Class>"), t.truncate -= n.length, `${n}${M(e, t)}`;
}
function re(e, t) {
	return e.length === 0 ? "Arguments[]" : (t.truncate -= 13, `Arguments[ ${u(e, t)} ]`);
}
var ie = [
	"stack",
	"line",
	"column",
	"name",
	"message",
	"fileName",
	"lineNumber",
	"columnNumber",
	"number",
	"description",
	"cause"
];
function ae(e, t) {
	let n = Object.getOwnPropertyNames(e).filter((e) => ie.indexOf(e) === -1), r = e.name;
	t.truncate -= r.length;
	let i = "";
	if (typeof e.message == "string" ? i = l(e.message, t.truncate) : n.unshift("message"), i = i ? `: ${i}` : "", t.truncate -= i.length + 5, t.seen = t.seen || [], t.seen.includes(e)) return "[Circular]";
	t.seen.push(e);
	let a = u(n.map((t) => [t, e[t]]), t, f);
	return `${r}${i}${a ? ` { ${a} }` : ""}`;
}
function oe([e, t], n) {
	return n.truncate -= 3, t ? `${n.stylize(String(e), "yellow")}=${n.stylize(`"${t}"`, "string")}` : `${n.stylize(String(e), "yellow")}`;
}
function P(e, t) {
	return u(e, t, F, "\n");
}
function F(e, t) {
	switch (e.nodeType) {
		case 1: return I(e, t);
		case 3: return t.inspect(e.data, t);
		default: return t.inspect(e, t);
	}
}
function I(e, t) {
	let n = e.getAttributeNames(), r = e.tagName.toLowerCase(), i = t.stylize(`<${r}`, "special"), o = t.stylize(">", "special"), s = t.stylize(`</${r}>`, "special");
	t.truncate -= r.length * 2 + 5;
	let c = "";
	n.length > 0 && (c += " ", c += u(n.map((t) => [t, e.getAttribute(t)]), t, oe, " ")), t.truncate -= c.length;
	let l = t.truncate, d = P(e.children, t);
	return d && d.length > l && (d = `${a}(${e.children.length})`), `${i}${c}${o}${d}${s}`;
}
var L = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("chai/inspect") : "@@chai/inspect", R = Symbol.for("nodejs.util.inspect.custom"), z = /* @__PURE__ */ new WeakMap(), B = {}, V = {
	undefined: (e, t) => t.stylize("undefined", "undefined"),
	null: (e, t) => t.stylize("null", "null"),
	boolean: (e, t) => t.stylize(String(e), "boolean"),
	Boolean: (e, t) => t.stylize(String(e), "boolean"),
	number: b,
	Number: b,
	bigint: x,
	BigInt: x,
	string: k,
	String: k,
	function: g,
	Function: g,
	symbol: A,
	Symbol: A,
	Array: p,
	Date: ee,
	Map: v,
	Set: w,
	RegExp: S,
	Promise: j,
	WeakSet: (e, t) => t.stylize("WeakSet{…}", "special"),
	WeakMap: (e, t) => t.stylize("WeakMap{…}", "special"),
	Arguments: re,
	Int8Array: h,
	Uint8Array: h,
	Uint8ClampedArray: h,
	Int16Array: h,
	Uint16Array: h,
	Int32Array: h,
	Uint32Array: h,
	Float32Array: h,
	Float64Array: h,
	Generator: () => "",
	DataView: () => "",
	ArrayBuffer: () => "",
	Error: ae,
	HTMLCollection: P,
	NodeList: P
}, H = (e, t, n, r) => L in e && typeof e[L] == "function" ? e[L](t) : R in e && typeof e[R] == "function" ? e[R](t.depth, t, r) : "inspect" in e && typeof e.inspect == "function" ? e.inspect(t.depth, t) : "constructor" in e && z.has(e.constructor) ? z.get(e.constructor)(e, t) : B[n] ? B[n](e, t) : "", U = Object.prototype.toString;
function W(e, t = {}) {
	let n = s(t, W), { customInspect: r } = n, i = e === null ? "null" : typeof e;
	if (i === "object" && (i = U.call(e).slice(8, -1)), i in V) return V[i](e, n);
	if (r && e) {
		let t = H(e, n, i, W);
		if (t) return typeof t == "string" ? t : W(t, n);
	}
	let a = e ? Object.getPrototypeOf(e) : !1;
	return a === Object.prototype || a === null ? M(e, n) : e && typeof HTMLElement == "function" && e instanceof HTMLElement ? I(e, n) : "constructor" in e ? e.constructor === Object ? M(e, n) : ne(e, n) : e === Object(e) ? M(e, n) : n.stylize(String(e), i);
}
var { AsymmetricMatcher: G, DOMCollection: K, DOMElement: se, Immutable: q, ReactElement: J, ReactTestComponent: Y } = n, ce = [
	Y,
	J,
	se,
	K,
	q,
	G
];
function X(n, r = 10, { maxLength: i, filterNode: a, ...o } = {}) {
	let s = i ?? 1e4, c, l = typeof a == "string" ? le(a) : a, u = l ? [
		Y,
		J,
		e(l),
		K,
		q,
		G
	] : ce;
	try {
		c = t(n, {
			maxDepth: r,
			escapeString: !1,
			plugins: u,
			...o
		});
	} catch {
		c = t(n, {
			callToJSON: !1,
			maxDepth: r,
			escapeString: !1,
			plugins: u,
			...o
		});
	}
	return c.length >= s && r > 1 ? X(n, Math.floor(Math.min(r, 2 ** 53 - 1) / 2), {
		maxLength: i,
		filterNode: a,
		...o
	}) : c;
}
function le(e) {
	return (t) => {
		if (t.nodeType === 8) return !1;
		if (t.nodeType === 1 && t.matches) try {
			return !t.matches(e);
		} catch {
			return !0;
		}
		return !0;
	};
}
var Z = /%[sdjifoOc%]/g;
function ue(e, t = {}) {
	let n = (e, n) => t.prettifyObject ? X(e, void 0, {
		printBasicPrototype: !1,
		escapeString: !1
	}) : $(e, n);
	if (typeof e[0] != "string") {
		let t = [];
		for (let r = 0; r < e.length; r++) t.push(n(e[r], {
			depth: 0,
			colors: !1
		}));
		return t.join(" ");
	}
	let r = e.length, i = 1, a = e[0], o = String(a).replace(Z, (t) => {
		if (t === "%%") return "%";
		if (i >= r) return t;
		switch (t) {
			case "%s": {
				let t = e[i++];
				return typeof t == "bigint" ? `${t.toString()}n` : typeof t == "number" && t === 0 && 1 / t < 0 ? "-0" : typeof t == "object" && t ? typeof t.toString == "function" && t.toString !== Object.prototype.toString ? t.toString() : n(t, {
					depth: 0,
					colors: !1
				}) : String(t);
			}
			case "%d": {
				let t = e[i++];
				return typeof t == "bigint" ? `${t.toString()}n` : typeof t == "symbol" ? "NaN" : Number(t).toString();
			}
			case "%i": {
				let t = e[i++];
				return typeof t == "bigint" ? `${t.toString()}n` : Number.parseInt(String(t)).toString();
			}
			case "%f": return Number.parseFloat(String(e[i++])).toString();
			case "%o": return n(e[i++], {
				showHidden: !0,
				showProxy: !0
			});
			case "%O": return n(e[i++]);
			case "%c": return i++, "";
			case "%j": try {
				return JSON.stringify(e[i++]);
			} catch (e) {
				let t = e.message;
				if (t.includes("circular structure") || t.includes("cyclic structures") || t.includes("cyclic object")) return "[Circular]";
				throw e;
			}
			default: return t;
		}
	});
	for (let t = e[i]; i < r; t = e[++i]) typeof t != "object" || !t ? o += ` ${typeof t == "symbol" ? t.toString() : t}` : o += ` ${n(t)}`;
	return o;
}
function Q(...e) {
	return ue(e);
}
function $(e, t = {}) {
	return t.truncate === 0 && (t.truncate = Infinity), W(e, t);
}
function de(e, t = {}) {
	t.truncate === void 0 && (t.truncate = 40);
	let n = $(e, t), r = Object.prototype.toString.call(e);
	if (t.truncate && n.length >= t.truncate) if (r === "[object Function]") {
		let t = e;
		return t.name ? `[Function: ${t.name}]` : "[Function]";
	} else if (r === "[object Array]") return `[ Array(${e.length}) ]`;
	else if (r === "[object Object]") {
		let t = Object.keys(e);
		return `{ Object (${t.length > 2 ? `${t.splice(0, 2).join(", ")}, ...` : t.join(", ")}) }`;
	} else return n;
	return n;
}
//#endregion
export { Q as format, Z as formatRegExp, de as objDisplay };

//# sourceMappingURL=display.js.map